]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/templates/actionbar.tmpl
improve actionbar layout: seperate actions box, forgot the first <li>
[SourceForge/phpwiki.git] / themes / MonoBook / templates / actionbar.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: actionbar.tmpl,v 1.7 2006-09-30 09:47:14 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       <?=$Sep?><?= Button("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?>
12     <?php } else { ?>
13       <?=$Sep?><?= 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     </ul>
30 </div>
31 <div class="portlet" id="p-tbx">
32   <h5>Actions</h5>
33   <div class="pBody">
34   <ul>
35     <? if ( $user->isSignedIn() ) { ?>
36      <?php if ($user->isAdmin() or mayAccessPage('change', $page->getName())) { ?>
37       <?=$Sep?><?= Button($page->get('locked') ? 'unlock' : 'lock') ?>
38      <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $page->getName())) { ?>
39       <?=$Sep?><?= Button('chown') ?>
40       <?=$Sep?><?= Button('setacl') ?>
41      <?php }} ?>
42      <?php if ($user->isAdmin() or mayAccessPage('remove', $page->getName())) { ?>
43       <?=$Sep?><?= Button('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?>
44       <?=$Sep?><?= Button('remove') ?>
45      <?php } ?>
46     <?php } ?>
47     <?=$Sep?><?= Button(array('action'=>'PageInfo'),
48                         _("Info"),$page->getName()) ?>
49 <?php 
50     if (((defined('DEBUG') and DEBUG and $request->getArg('action') == 'browse')) || $user->isAdmin()) { ?> 
51       <!-- Buttons really only for debugging -->
52       <?=$Sep?><?= Button(_("PageHistory")) ?>
53       <?=$Sep?><?= Button("diff") ?> 
54       <?=$Sep?><?= Button(_("PageDump")) ?>
55 <?php
56     if (DEBUG & _DEBUG_SQL and USECACHE) {
57       $PurgeCache = Button(array('nocache' => 'purge'),
58                      _("PurgeHtmlCache"), $page->getName());
59       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
60 ?>
61       <?=$Sep?><?= $PurgeCache ?>
62 <?php } ?>
63       <!-- End debugging buttons -->
64     <?php } ?>
65   <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?> 
66     <?=$Sep?><?= Button("pdf") ?>
67   <?php } ?>
68   </div>
69   </ul>
70 </div>