better fix for empty actions list issue

master
joey 2006-05-26 15:18:12 +00:00
parent 2e95062df8
commit 526044e1da
2 changed files with 11 additions and 7 deletions

View File

@ -160,22 +160,30 @@ sub genpage ($$$) { #{{{
my $template=HTML::Template->new(blind_cache => 1,
filename => "$config{templatedir}/page.tmpl");
my $actions=0;
if (length $config{cgiurl}) {
$template->param(editurl => cgiurl(do => "edit", page => $page));
$template->param(prefsurl => cgiurl(do => "prefs"));
if ($config{rcs}) {
$template->param(recentchangesurl => cgiurl(do => "recentchanges"));
}
$actions++;
}
if (length $config{historyurl}) {
my $u=$config{historyurl};
$u=~s/\[\[file\]\]/$pagesources{$page}/g;
$template->param(historyurl => $u);
$actions++;
}
if ($config{discussion}) {
$template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
$actions++;
}
if ($actions) {
$template->param(have_actions => 1);
}
if (exists $hooks{pagetemplate}) {

View File

@ -20,31 +20,27 @@
</TMPL_IF>
</div>
<TMPL_IF NAME="HAVE_ACTIONS">
<div id="actions">
<ul>
<TMPL_IF NAME="EDITURL">
<li><a href="<TMPL_VAR EDITURL>">Edit</a></li>
</TMPL_IF>
<TMPL_IF NAME="RECENTCHANGESURL">
<li><a href="<TMPL_VAR RECENTCHANGESURL>">RecentChanges</a></li>
</TMPL_IF>
<TMPL_IF NAME="HISTORYURL">
<li><a href="<TMPL_VAR HISTORYURL>">History</a></li>
</TMPL_IF>
<TMPL_IF NAME="PREFSURL">
<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
</TMPL_IF>
<TMPL_IF NAME="DISCUSSIONLINK">
<li><TMPL_VAR DISCUSSIONLINK><br /></li>
</TMPL_IF>
<li></li>
</ul>
</div>
</TMPL_IF>
<div id="content">
<TMPL_VAR CONTENT>