]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/templates/actionbar.tmpl
use template only on create
[SourceForge/phpwiki.git] / themes / MonoBook / templates / actionbar.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: actionbar.tmpl,v 1.6 2005-08-28 11:10:15 rurban Exp $ -->
3 <?php
4 $dbh = $request->getDbh();
5 $Sep = HTML::raw("<li>");
6 ?>
7 <div id="p-cactions" class="portlet">
8     <h5>Views</h5>
9     <ul>
10     <?php if ((!$page->get('locked') || $user->isAdmin()) and $revision) { ?>
11       <?= Button("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?>
12     <?php } else { ?>
13       <?= Button("viewsource", _("View Source")) ?>
14     <?php } ?>
15     <?php if (!string_ends_with($page->getName(), _("Discussion"))) { ?>
16     <?php 
17         $talk = new WikiPageName('Talk:'.$page->getName());
18         if ($dbh->isWikiPage($talk->getName())) { ?>
19           <?=$Sep?><?= Button(array('action'=>'browse'), _("Discussion"), $talk->getName()) ?>
20         <?php } else { ?>
21           <?=$Sep?><?= Button(array('action'=>'create',
22                               'template'=>'TemplateTalk'),
23                           _("Discussion"), $talk->getName()) ?>
24         <?php } ?>
25     <?php } else { ?>
26       <?php $talk = new WikiPageName($page->getName()); ?>
27       <?=$Sep?><?= Button(array(),_("Article"), $talk->getParent()) ?>
28     <?php } ?>
29     <? if ( $user->isSignedIn() ) { ?>
30      <?php if ($user->isAdmin() or mayAccessPage('change', $page->getName())) { ?>
31       <?=$Sep?><?= Button($page->get('locked') ? 'unlock' : 'lock') ?>
32      <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $page->getName())) { ?>
33       <?=$Sep?><?= Button('chown') ?>
34       <?=$Sep?><?= Button('setacl') ?>
35      <?php }} ?>
36      <?php if ($user->isAdmin() or mayAccessPage('remove', $page->getName())) { ?>
37       <?=$Sep?><?= Button('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?>
38       <?=$Sep?><?= Button('remove') ?>
39      <?php } ?>
40     <?php } ?>
41     <?=$Sep?><?= Button(array('action'=>'PageInfo'),
42                         _("Info"),$page->getName()) ?>
43 <?php 
44     if (((defined('DEBUG') and DEBUG and $request->getArg('action') == 'browse')) || $user->isAdmin()) { ?> 
45       <!-- Buttons really only for debugging -->
46       <?=$Sep?><?= Button(_("PageHistory")) ?>
47       <?=$Sep?><?= Button("diff") ?> 
48       <?=$Sep?><?= Button(_("PageDump")) ?>
49 <?php
50     if (DEBUG & _DEBUG_SQL and USECACHE) {
51       $PurgeCache = Button(array('nocache' => 'purge'),
52                      _("PurgeHtmlCache"), $page->getName());
53       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
54 ?>
55       <?=$Sep?><?= $PurgeCache ?>
56 <?php } ?>
57       <!-- End debugging buttons -->
58     <?php } ?>
59   <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?> 
60     <?=$Sep?><?= Button("pdf") ?>
61   <?php } ?>
62 </div>