error($@) if $@;
my $form = CGI::FormBuilder->new(
title => "signin",
- header => 1,
+ name => "signin",
charset => "utf-8",
method => 'POST',
required => 'NONE',
params => $q,
action => $config{cgiurl},
header => 0,
- template => scalar template_params("signin.tmpl"),
+ template => {type => 'div'},
stylesheet => baseurl()."style.css",
);
my $buttons=["Login"];
error($@) if $@;
my $form = CGI::FormBuilder->new(
title => "preferences",
+ name => "preferences",
header => 0,
charset => "utf-8",
method => 'POST',
javascript => 0,
params => $q,
action => $config{cgiurl},
- template => scalar template_params("prefs.tmpl"),
+ template => {type => 'div'},
stylesheet => baseurl()."style.css",
fieldsets => [
[login => gettext("Login")],
error($@) if $@;
my $form = CGI::FormBuilder->new(
fields => \@fields,
- header => 1,
charset => "utf-8",
method => 'POST',
validate => {
javascript => 0,
params => $q,
action => $config{cgiurl},
+ header => 0,
table => 0,
template => scalar template_params("editpage.tmpl"),
+ wikiname => $config{wikiname},
);
run_hooks(formbuilder_setup => sub {
htmlize($page, $type,
linkify($page, "",
preprocess($page, $page,
- filter($page, $form->field('editcontent')), 0, 1))));
+ filter($page, $page, $form->field('editcontent')), 0, 1))));
}
else {
$form->tmpl_param("page_preview", "");
$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);
$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
$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" &&
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;
}
$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;
}
$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 {
cgi_recentchanges($q);
return;
}
- elsif ($do eq 'hyperestraier') {
- cgi_hyperestraier();
- }
# Need to lock the wiki before getting a session.
lockwiki();
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);
}
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?"));
}