summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/opendiscussion.pm
blob: 4517ff88b6086964421324216d0a536b1bda771f (plain)
  1. #!/usr/bin/perl
  2. package IkiWiki::Plugin::opendiscussion;
  3. use warnings;
  4. use strict;
  5. use IkiWiki 3.00;
  6. sub import {
  7. hook(type => "getsetup", id => "opendiscussion", call => \&getsetup);
  8. hook(type => "canedit", id => "opendiscussion", call => \&canedit);
  9. }
  10. sub getsetup () {
  11. return
  12. plugin => {
  13. safe => 1,
  14. rebuild => 0,
  15. },
  16. }
  17. sub canedit ($$) {
  18. my $page=shift;
  19. my $cgi=shift;
  20. my $session=shift;
  21. return "" if $page=~/(\/|^)\Q$config{discussionpage}\E$/i;
  22. return undef;
  23. }
  24. 1