diff options
author | intrigeri <intrigeri@boum.org> | 2010-07-11 10:46:18 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2010-07-11 10:46:18 +0200 |
commit | c99d26030e6ddd7a21932e98e40a8df7d896886d (patch) | |
tree | 26056e3e2a5c7c81ebe7baf243a0bb4ae765e76e /IkiWiki/Plugin/comments.pm | |
parent | c9b1a4dd7d826b5e8e2d0a757ba5ecbba8d832b2 (diff) | |
parent | 1bb9157f2ab94b8306e1e2fb1a5b3ac9bbfe5772 (diff) |
Merge remote branch 'upstream/master' into prv/po
Conflicts:
IkiWiki/Plugin/po.pm
doc/plugins/po.mdwn
Diffstat (limited to 'IkiWiki/Plugin/comments.pm')
-rw-r--r-- | IkiWiki/Plugin/comments.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index d34951570..f0eec9ace 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -22,6 +22,7 @@ sub import { hook(type => "checkconfig", id => 'comments', call => \&checkconfig); hook(type => "getsetup", id => 'comments', call => \&getsetup); hook(type => "preprocess", id => 'comment', call => \&preprocess); + hook(type => "preprocess", id => 'commentmoderation', call => \&preprocess_moderation); # here for backwards compatability with old comments hook(type => "preprocess", id => '_comment', call => \&preprocess); hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi); @@ -251,6 +252,22 @@ sub preprocess { return $content; } +sub preprocess_moderation { + my %params = @_; + + $params{desc}=gettext("Comment Moderation") + unless defined $params{desc}; + + if (length $config{cgiurl}) { + return '<a href="'. + IkiWiki::cgiurl(do => 'commentmoderation'). + '">'.$params{desc}.'</a>'; + } + else { + return $params{desc}; + } +} + sub sessioncgi ($$) { my $cgi=shift; my $session=shift; @@ -569,6 +586,7 @@ sub commentmoderation ($$) { my $added=0; foreach my $id (keys %vars) { if ($id =~ /(.*)\._comment(?:_pending)?$/) { + $id=decode_utf8($id); my $action=$cgi->param($id); next if $action eq 'Defer' && ! $rejectalldefer; |