]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - IkiWiki/Plugin/opendiscussion.pm
ensure opendiscussion hook is always called before lockedit
[git.ikiwiki.info.git] / IkiWiki / Plugin / opendiscussion.pm
1 #!/usr/bin/perl
2 package IkiWiki::Plugin::opendiscussion;
4 use warnings;
5 use strict;
6 use IkiWiki 3.00;
8 sub import {
9         hook(type => "getsetup", id => "opendiscussion", call => \&getsetup);
10         hook(type => "canedit", id => "opendiscussion", call => \&canedit,
11                 first => 1);
12 }
14 sub getsetup () {
15         return 
16                 plugin => {
17                         safe => 1,
18                         rebuild => 0,
19                 },
20 }
22 sub canedit ($$) {
23         my $page=shift;
24         my $cgi=shift;
25         my $session=shift;
27         return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/i;
28         return undef;
29 }
31 1