aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-28 19:43:07 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-08-28 19:43:07 +0000
commit1aeb64e14858dc7dbce6ac553fc6dc43efb29fae (patch)
tree38b6b82ff8efe60ccc3bad9a93d4e72e4b121003 /IkiWiki/Plugin
parent4895955ceaf264c5f17b10c4009e1ab1afcc55ee (diff)
downloadikiwiki-1aeb64e14858dc7dbce6ac553fc6dc43efb29fae.tar
ikiwiki-1aeb64e14858dc7dbce6ac553fc6dc43efb29fae.tar.gz
* Patch from James Westby to add an actions option to inline; this
adds Edit and Discussion links at the end of blog entries.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/inline.pm13
1 files changed, 13 insertions, 0 deletions
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,);