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