* Wrap the editpage template in the standard misctemplate, this allows the

pagetemplate hook to work for that page.
* Above change fixes the favicon plugin to work on edit pages.
master
joey 2007-07-16 05:24:31 +00:00
parent 3ead2e7420
commit c92ab9cddd
4 changed files with 30 additions and 34 deletions

View File

@ -316,6 +316,7 @@ sub cgi_editpage ($$) { #{{{
javascript => 0,
params => $q,
action => $config{cgiurl},
header => 0,
table => 0,
template => scalar template_params("editpage.tmpl"),
wikiname => $config{wikiname},
@ -472,6 +473,7 @@ sub cgi_editpage ($$) { #{{{
$form->field(name => "type", type => 'select',
options => \@page_types);
$form->title(sprintf(gettext("creating %s"), pagetitle($page)));
}
elsif ($form->field("do") eq "edit") {
check_canedit($page, $q, $session);
@ -491,7 +493,8 @@ sub cgi_editpage ($$) { #{{{
$form->title(sprintf(gettext("editing %s"), pagetitle($page)));
}
print $form->render(submit => \@buttons);
printheader($session);
print misctemplate($form->title, $form->render(submit => \@buttons));
}
else {
# save page
@ -504,7 +507,8 @@ sub cgi_editpage ($$) { #{{{
$form->field(name => "page", type => 'hidden');
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
print $form->render(submit => \@buttons);
printheader($session);
print misctemplate($form->title, $form->render(submit => \@buttons));
return;
}
elsif (-e "$config{srcdir}/$file" &&
@ -519,7 +523,8 @@ sub cgi_editpage ($$) { #{{{
value => readfile("$config{srcdir}/$file").
"\n\n\n".$form->field("editcontent"),
force => 1);
print $form->render(submit => \@buttons);
printheader($session);
print misctemplate($form->title, $form->render(submit => \@buttons));
return;
}
@ -541,7 +546,8 @@ sub cgi_editpage ($$) { #{{{
$form->field(name => "page", type => 'hidden');
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
print $form->render(submit => \@buttons);
printheader($session);
print misctemplate($form->title, $form->render(submit => \@buttons));
return;
}
@ -585,7 +591,8 @@ sub cgi_editpage ($$) { #{{{
$form->field(name => "page", type => 'hidden');
$form->field(name => "type", type => 'hidden');
$form->title(sprintf(gettext("editing %s"), $page));
print $form->render(submit => \@buttons);
printheader($session);
print misctemplate($form->title, $form->render(submit => \@buttons));
return;
}
else {

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
ikiwiki (2.5) UNRELEASED; urgency=low
* Wrap the editpage template in the standard misctemplate, this allows the
pagetemplate hook to work for that page.
* Above change fixes the favicon plugin to work on edit pages.
-- Joey Hess <joeyh@debian.org> Mon, 16 Jul 2007 01:11:03 -0400
ikiwiki (2.4) unstable; urgency=low
* Make the toc plugin use html-compatible anchors. This is necessary since

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2007-07-15 15:03-0400\n"
"POT-Creation-Date: 2007-07-16 01:17-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -53,17 +53,17 @@ msgstr ""
msgid "creating %s"
msgstr ""
#: ../IkiWiki/CGI.pm:491 ../IkiWiki/CGI.pm:506 ../IkiWiki/CGI.pm:517
#: ../IkiWiki/CGI.pm:543 ../IkiWiki/CGI.pm:587
#: ../IkiWiki/CGI.pm:492 ../IkiWiki/CGI.pm:507 ../IkiWiki/CGI.pm:518
#: ../IkiWiki/CGI.pm:544 ../IkiWiki/CGI.pm:588
#, perl-format
msgid "editing %s"
msgstr ""
#: ../IkiWiki/CGI.pm:684
#: ../IkiWiki/CGI.pm:685
msgid "You are banned."
msgstr ""
#: ../IkiWiki/CGI.pm:716
#: ../IkiWiki/CGI.pm:717
msgid "login failed, perhaps you need to turn on cookies?"
msgstr ""

View File

@ -1,17 +1,3 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<base href="<TMPL_VAR BASEURL>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><TMPL_VAR FORM-TITLE></title>
<link rel="stylesheet" href="<TMPL_VAR BASEURL>style.css" type="text/css" />
<link rel="stylesheet" href="<TMPL_VAR BASEURL>local.css" type="text/css" />
<TMPL_IF NAME="FAVICON">
<link rel="icon" href="<TMPL_VAR BASEURL><TMPL_VAR FAVICON>" type="image/x-icon" />
</TMPL_IF>
</head>
<body>
<TMPL_IF NAME="PAGE_CONFLICT">
<p>
<b>Your changes conflict with other changes made to the page.</b>
@ -54,9 +40,6 @@ together before saving.
</p>
</TMPL_IF>
<TMPL_VAR FORM-START>
<div class="header">
<span><TMPL_VAR INDEXLINK>/ <TMPL_VAR FORM-TITLE></span>
</div>
<TMPL_VAR FIELD-DO>
<TMPL_VAR FIELD-FROM>
<TMPL_VAR FIELD-RCSINFO>
@ -74,20 +57,18 @@ Page type: <TMPL_VAR FIELD-TYPE>
Optional comment about this change:<br />
<TMPL_VAR FIELD-COMMENTS><br />
</TMPL_IF>
<input id="_submit" name="_submit" type="submit" value="Save Page" /><input id="_submit_2" name="_submit" type="submit" value="Preview" /><input id="_submit_3" name="_submit" type="submit" value="Cancel" />
<input id="_submit" name="_submit" type="submit" value="Save Page" />
<input id="_submit_2" name="_submit" type="submit" value="Preview" />
<input id="_submit_3" name="_submit" type="submit" value="Cancel" />
<TMPL_VAR HELPONFORMATTINGLINK>
<TMPL_VAR FORM-END>
<TMPL_IF NAME="PAGE_PREVIEW">
<hr />
<div class="header">
<span>Page preview:</span>
</div>
<div id="content">
<div id="preview">
<TMPL_VAR PAGE_PREVIEW>
</div>
</TMPL_IF>
<div id="footer">
<!-- from <TMPL_VAR NAME=WIKINAME> -->
</div>
</body>
</html>