my $page=shift;
$content =~ s{(\\?)$config{wiki_link_regexp}}{
- $1 ? "[[$2]]" : htmllink($page, $2)
+ $2 ? ( $1 ? "[[$2|$3]]" : htmllink($page, titlepage($3), 0, 0, pagetitle($2)))
+ : ( $1 ? "[[$3]]" : htmllink($page, titlepage($3)))
}eg;
return $content;
$ret.=$template->output;
}
- return $ret;
+ return "</p>$ret<p>";
} #}}}
sub genpage ($$$) { #{{{
filename => "$config{templatedir}/page.tmpl");
if (length $config{cgiurl}) {
- $template->param(editurl => "$config{cgiurl}?do=edit&page=$page");
- $template->param(prefsurl => "$config{cgiurl}?do=prefs");
+ $template->param(editurl => cgiurl(do => "edit", page => $page));
+ $template->param(prefsurl => cgiurl(do => "prefs"));
if ($config{rcs}) {
- $template->param(recentchangesurl => "$config{cgiurl}?do=recentchanges");
+ $template->param(recentchangesurl => cgiurl(do => "recentchanges"));
}
}
}
if ($config{rss} && $inlinepages{$page}) {
- $template->param(rssurl => rsspage($page));
+ $template->param(rssurl => rsspage(basename($page)));
}
$template->param(
my $parentpage=shift;
my %params=@_;
- return "" if exists $params{archive} && $params{archive} eq 'yes';
-
if (! exists $params{show}) {
$params{show}=10;
}
} #}}}
sub mtime ($) { #{{{
- my $page=shift;
+ my $file=shift;
- return (stat($page))[9];
+ return (stat($file))[9];
} #}}}
sub findlinks ($$) { #{{{
my @links;
while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
- push @links, lc($1);
+ push @links, titlepage($2);
}
# Discussion links are a special case since they're not in the text
# of the page, but on its template.
push @add, $file;
$links{$page}=[];
$pagesources{$page}=$file;
- $pagectime{$page}=time unless exists $pagectime{$page};
+ $pagectime{$page}=mtime("$config{srcdir}/$file")
+ unless exists $pagectime{$page};
}
}
my @del;