]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
* Patch from James Westby to add an actions option to inline; this
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 1cbde71045c51d761a30de8f4cdedb4bbb5f323f..6518be794f08f905a6bc154bc4e8080ac36143ac 100644 (file)
@@ -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,);