Remove dead code for preprocessing [[!comments]]
authorSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Wed, 10 Dec 2008 22:18:26 +0000 (22:18 +0000)
committerSimon McVittie <smcv@ http://smcv.pseudorandom.co.uk/>
Thu, 11 Dec 2008 21:14:05 +0000 (21:14 +0000)
IkiWiki/Plugin/comments.pm

index 8b82341c078503b724db14b0dd1ecd113a2d9ff4..73f8d6140c7f2455ffd539153f09712438d40195 100644 (file)
@@ -16,7 +16,6 @@ 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);
        hook(type => "htmlize", id => "_comment", call => \&htmlize);
        hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
@@ -91,64 +90,6 @@ sub checkconfig () { #{{{
                unless defined $config{comments_pagename};
 } #}}}
 
-# Somewhat based on IkiWiki::Plugin::inline blog posting support
-sub preprocess (@) { #{{{
-       my %params=@_;
-
-       return "";
-
-       my $page = $params{page};
-       $pagestate{$page}{comments}{comments} = defined $params{closed}
-               ? (not IkiWiki::yesno($params{closed}))
-               : 1;
-       $pagestate{$page}{comments}{allowdirectives} = IkiWiki::yesno($params{allowdirectives});
-       $pagestate{$page}{comments}{commit} = defined $params{commit}
-               ? IkiWiki::yesno($params{commit})
-               : 1;
-
-       my $formtemplate = IkiWiki::template("comments_embed.tmpl",
-               blind_cache => 1);
-       $formtemplate->param(cgiurl => $config{cgiurl});
-       $formtemplate->param(page => $params{page});
-
-       if (not $pagestate{$page}{comments}{comments}) {
-               $formtemplate->param("disabled" =>
-                       gettext('comments are closed'));
-       }
-       elsif ($params{preview}) {
-               $formtemplate->param("disabled" =>
-                       gettext('not available during Preview'));
-       }
-
-       debug("page $params{page} => destpage $params{destpage}");
-
-       unless (defined $params{inline} && !IkiWiki::yesno($params{inline})) {
-               my $posts = '';
-               eval q{use IkiWiki::Plugin::inline};
-               error($@) if ($@);
-               my @args = (
-                       pages => "internal($params{page}/_comment_*)",
-                       template => "comments_display",
-                       show => 0,
-                       reverse => "yes",
-                       # special stuff passed through
-                       page => $params{page},
-                       destpage => $params{destpage},
-                       preview => $params{preview},
-               );
-               push @args, atom => $params{atom} if defined $params{atom};
-               push @args, rss => $params{rss} if defined $params{rss};
-               push @args, feeds => $params{feeds} if defined $params{feeds};
-               push @args, feedshow => $params{feedshow} if defined $params{feedshow};
-               push @args, timeformat => $params{timeformat} if defined $params{timeformat};
-               push @args, feedonly => $params{feedonly} if defined $params{feedonly};
-               $posts = IkiWiki::preprocess_inline(@args);
-               $formtemplate->param("comments" => $posts);
-       }
-
-       return $formtemplate->output;
-} # }}}
-
 # FIXME: logic taken from editpage, should be common code?
 sub getcgiuser ($) { # {{{
        my $session = shift;