From 1aeb64e14858dc7dbce6ac553fc6dc43efb29fae Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 28 Aug 2006 19:43:07 +0000 Subject: * Patch from James Westby to add an actions option to inline; this adds Edit and Discussion links at the end of blog entries. --- IkiWiki/Plugin/inline.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'IkiWiki/Plugin/inline.pm') diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 1cbde7104..6518be794 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -46,6 +46,7 @@ sub preprocess_inline (@) { #{{{ } else { $desc = $config{wikiname}; } + my $actions=yesno($params{actions}); my @list; foreach my $page (keys %pagesources) { @@ -104,6 +105,18 @@ sub preprocess_inline (@) { #{{{ $template->param(content => $content); $template->param(ctime => displaytime($pagectime{$page})); + if ($actions) { + my $file = $pagesources{$page}; + my $type = pagetype($file); + $template->param(have_actions => 1); + if ($config{discussion}) { + $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1)); + } + if (length $config{cgiurl} && defined $type) { + $template->param(editurl => cgiurl(do => "edit", page => $page)); + } + } + run_hooks(pagetemplate => sub { shift->(page => $page, destpage => $params{page}, template => $template,); -- cgit v1.2.3