diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-01-25 19:04:45 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-01-25 19:04:45 -0500 |
commit | 7a7e28c55f1ffa64eedbaf36ee1729c6bbd27762 (patch) | |
tree | 539ce3221f97c1d23061e5c6782f205b0b7964bc /IkiWiki/Plugin | |
parent | 9a5085e5126d1f76d28a4438b1527659183477b5 (diff) |
add a button to prefs page for comment moderation
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index ad5395a82..c95f77a42 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -26,6 +26,7 @@ sub import { hook(type => "htmlize", id => "_comment", call => \&htmlize); hook(type => "pagetemplate", id => "comments", call => \&pagetemplate); hook(type => "cgi", id => "comments", call => \&linkcgi); + hook(type => "formbuilder_setup", id => "comments", call => \&formbuilder_setup); IkiWiki::loadplugin("inline"); } @@ -618,6 +619,18 @@ sub commentmoderation ($$) { exit; } +sub formbuilder_setup (@) { + my %params=@_; + + my $form=$params{form}; + if ($form->title eq "preferences") { + push @{$params{buttons}}, "Comment Moderation"; + if ($form->submitted && $form->submitted eq "Comment Moderation") { + commentmoderation($params{cgi}, $params{session}); + } + } +} + sub comments_pending () { my $dir="$config{wikistatedir}/comments_pending/"; return unless -d $dir; |