sub getsetup () { #{{{
return
+ plugin => {
+ safe => 1,
+ rebuild => undef,
+ },
rss => {
type => "boolean",
example => 0,
$q->param('page', $page.$add);
# now go create the page
$q->param('do', 'create');
- IkiWiki::cgi_editpage($q, $session);
+ # make sure the editpage plugin in loaded
+ if (IkiWiki->can("cgi_editpage")) {
+ IkiWiki::cgi_editpage($q, $session);
+ }
+ else {
+ error(gettext("page editing not allowed"));
+ }
exit;
}
}
}
if (exists $params{sort} && $params{sort} eq 'title') {
- @list=sort @list;
+ @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list;
}
elsif (exists $params{sort} && $params{sort} eq 'mtime') {
@list=sort { $pagemtime{$b} <=> $pagemtime{$a} } @list;
my $ret="";
if (length $config{cgiurl} && ! $params{preview} && (exists $params{rootpage} ||
- (exists $params{postform} && yesno($params{postform})))) {
+ (exists $params{postform} && yesno($params{postform}))) &&
+ IkiWiki->can("cgi_editpage")) {
# Add a blog post form, with feed buttons.
my $formtemplate=template("blogpost.tmpl", blind_cache => 1);
$formtemplate->param(cgiurl => $config{cgiurl});
$title, $url);
my $res = $client->send_request($req);
if (! ref $res) {
- debug("Did not receive response to ping");
+ error("Did not receive response to ping");
}
my $r=$res->value;
if (! exists $r->{flerror} || $r->{flerror}) {
- debug("Ping rejected: ".(exists $r->{message} ? $r->{message} : "[unknown reason]"));
+ error("Ping rejected: ".(exists $r->{message} ? $r->{message} : "[unknown reason]"));
}
};
if ($@) {
- debug "Ping failed: $@";
+ error "Ping failed: $@";
}
}
}