Ticket #100: index_map.diff

File index_map.diff, 1.2 kB (added by bob, 22 months ago)

patch to add an index_map macro

  • Utils.pm

     
    128128                  my $link_title = $_[2] || "View all pages in $_[0] $_[1]"; 
    129129                  return qq(<a href="$script_name?action=index;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>); 
    130130                }, 
     131        qr/\@INDEX_MAP\s+\[\[(Category|Locale)\s+([^\]|]+)\|?([^\]]+)?\]\]/ => 
     132            sub { 
     133                  # We may be being called by Wiki::Toolkit::Plugin::Diff, 
     134                  # which doesn't know it has to pass us $wiki - and 
     135                  # we don't use it anyway. 
     136                  if ( UNIVERSAL::isa( $_[0], "Wiki::Toolkit" ) ) { 
     137                      shift; # just throw it away 
     138                  } 
     139                  my $link_title = $_[2] || "View map of stuff in $_[0] $_[1]"; 
     140                  return qq(<a href="$script_name?action=index;format=map;index_type=) . uri_escape(lc($_[0])) . qq(;index_value=) . uri_escape($_[1]) . qq(">$link_title</a>); 
     141                }, 
    131142        qr/\@INDEX_LIST\s+\[\[(Category|Locale)\s+([^\]]+)]]/ => 
    132143             sub { 
    133144                   my ($wiki, $type, $value) = @_;