X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cf35ee04cddd7b9b39636499dd24b689443c0e97..234414aa4a93c19a666624b757acc4890773c969:/IkiWiki/CGI.pm?ds=inline diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 3b1cab9a8..d3f0203d8 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -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 { @@ -648,9 +655,6 @@ sub cgi (;$$) { #{{{ cgi_recentchanges($q); return; } - elsif ($do eq 'hyperestraier') { - cgi_hyperestraier(); - } # Need to lock the wiki before getting a session. lockwiki(); @@ -684,7 +688,10 @@ sub cgi (;$$) { #{{{ print gettext("You are banned."); cgi_savesession($session); } - elsif ($do eq 'signin') { + + run_hooks(sessioncgi => sub { shift->($q, $session) }); + + if ($do eq 'signin') { cgi_signin($q, $session); cgi_savesession($session); } @@ -697,21 +704,6 @@ sub cgi (;$$) { #{{{ elsif ($do eq 'create' || $do eq 'edit') { cgi_editpage($q, $session); } - elsif ($do eq 'blog') { - my $page=decode_utf8($q->param('title')); - $page=~s/\///g; # no slashes in blog posts - # if the page already exists, munge it to be unique - my $from=$q->param('from'); - my $add=""; - while (exists $pagecase{lc($from."/".titlepage($page).$add)}) { - $add=1 unless length $add; - $add++; - } - $q->param('page', $page.$add); - # now run same as create - $q->param('do', 'create'); - cgi_editpage($q, $session); - } elsif ($do eq 'postsignin') { error(gettext("login failed, perhaps you need to turn on cookies?")); }