X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/49e86d2562dafdfcff4d3ba0d75f80ff0d734b95..dd349d69ea2361360b4534d9c77806345ff490ad:/IkiWiki/Plugin/inline.pm diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index f8150fd72..a6bb5d58f 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -47,39 +47,42 @@ sub getopt () { #{{{ sub getsetup () { #{{{ return + plugin => { + safe => 1, + rebuild => undef, + }, rss => { type => "boolean", - default => 0, + example => 0, description => "enable rss feeds by default?", safe => 1, rebuild => 1, }, atom => { type => "boolean", - default => 0, + example => 0, description => "enable atom feeds by default?", safe => 1, rebuild => 1, }, allowrss => { type => "boolean", - default => 0, + example => 0, description => "allow rss feeds to be used?", safe => 1, rebuild => 1, }, allowatom => { type => "boolean", - default => 0, + example => 0, description => "allow atom feeds to be used?", safe => 1, rebuild => 1, }, pingurl => { type => "string", - default => "", example => "http://rpc.technorati.com/rpc/ping", - description => "urls to ping (using XMP-RPC) on feed update", + description => "urls to ping (using XML-RPC) on feed update", safe => 1, rebuild => 0, }, @@ -128,7 +131,13 @@ sub sessioncgi () { #{{{ $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; } } @@ -183,7 +192,7 @@ sub preprocess_inline (@) { #{{{ } 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; @@ -248,8 +257,9 @@ sub preprocess_inline (@) { #{{{ my $atomurl=basename(atompage($params{destpage}).$feednum) if $feeds && $atom; my $ret=""; - if ($config{cgiurl} && ! $params{preview} && (exists $params{rootpage} || - (exists $params{postform} && yesno($params{postform})))) { + if (length $config{cgiurl} && ! $params{preview} && (exists $params{rootpage} || + (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}); @@ -576,15 +586,15 @@ sub pingurl (@) { #{{{ $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: $@"; } } }