]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/map.pm
* Improve handling of edits of locked pages by users who are not yet signed
[ikiwiki.git] / IkiWiki / Plugin / map.pm
index 27ae0c6a37eb6dce47ec37460b63243bb176c2af..5aa2852de0926e8dd1bd50fe36f6699a5bc1a60d 100644 (file)
@@ -9,11 +9,10 @@ package IkiWiki::Plugin::map;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 2.00;
 
 sub import { #{{{
-       IkiWiki::hook(type => "preprocess", id => "map",
-               call => \&preprocess);
+       hook(type => "preprocess", id => "map", call => \&preprocess);
 } # }}}
 
 sub preprocess (@) { #{{{
@@ -22,12 +21,12 @@ sub preprocess (@) { #{{{
        
        # Needs to update whenever a page is added or removed, so
        # register a dependency.
-       IkiWiki::add_depends($params{page}, $params{pages});
+       add_depends($params{page}, $params{pages});
        
        # Get all the items to map.
        my @mapitems = ();
-       foreach my $page (keys %IkiWiki::links) {
-               if (IkiWiki::pagespec_match($page, $params{pages})) {
+       foreach my $page (keys %links) {
+               if (pagespec_match($page, $params{pages}, location => $params{page})) {
                        push @mapitems, $page;
                }
        }
@@ -50,7 +49,8 @@ sub preprocess (@) { #{{{
                }
                $map .= "</li>\n" if $openli;
                $map .= "<li>"
-                       .IkiWiki::htmllink($params{page}, $params{destpage}, $item) ."\n";
+                       .htmllink($params{page}, $params{destpage}, $item)
+                       ."\n";
                $openli=1;
        }
        while ($indent > 0) {