comments: Use a checkconfig hook to get the default value of comments_pagename

master
Simon McVittie 2008-11-23 17:42:50 +00:00
parent 8ead8ac857
commit e66e2c2a7e
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ use constant POST_COMMENT => "Post comment";
use constant CANCEL => "Cancel";
sub import { #{{{
hook(type => "checkconfig", id => 'comments', call => \&checkconfig);
hook(type => "getsetup", id => 'comments', call => \&getsetup);
hook(type => "preprocess", id => 'comments', call => \&preprocess);
hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
@ -83,6 +84,12 @@ sub getsetup () { #{{{
},
} #}}}
sub checkconfig () { #{{{
$config{comments_commit} = 1 unless defined $config{comments_commit};
$config{comments_pagename} = 'comment_'
unless defined $config{comments_pagename};
} #}}}
# Somewhat based on IkiWiki::Plugin::inline blog posting support
sub preprocess (@) { #{{{
my %params=@_;