]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/templates/actionbar.tmpl
fix revision can be empty, simplify some variables, added AuthorHistory to toolbox
[SourceForge/phpwiki.git] / themes / MonoBook / templates / actionbar.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id: actionbar.tmpl,v 1.11 2007-01-02 13:29:59 rurban Exp $ -->
3 <?php
4 $dbh = $request->getDbh();
5 $isActionPage = $request->isActionPage($request->getArg("action"));
6 $isAdmin = $user->isAdmin();
7 $pagename = $page->getName();
8 /*if (empty($revision))
9   $revision = $page->getCurrentRevision(false);*/
10 ?>
11 <div class="portlet" id="p-cactions">
12   <h5>Views</h5>
13   <ul>
14     <?php if (!string_ends_with($pagename, _("Discussion"))) { ?>
15     <?php $talk = new WikiPageName('Talk:'.$pagename); ?>
16       <?= ActionButton(array(),
17                        $isActionPage ? _("ActionPage") : _("Article"), 
18                        $talk->getParent(), array('class'=>"selected")) ?>
19       <?php if (!$isActionPage) { ?>
20         <?php if ($dbh->isWikiPage($talk->getName())) { ?>
21           <?= ActionButton(array('action'=>'browse'), _("Discussion"), $talk->getName()) ?>
22         <?php } else { ?>
23           <?= ActionButton(array('action'=>'create',
24                                  'template'=>_("TemplateTalk")),
25                            _("Discussion"), $talk->getName()) ?>
26         <?php } ?>
27       <?php } ?>
28     <?php } else {
29       $talk = new WikiPageName($pagename); ?>
30       <?= ActionButton(array(),$isActionPage ? _("ActionPage") : _("Article"), $talk->getParent()) ?>
31       <?= ActionButton(array(),_("Discussion"), $talk->getParent(), array('class'=>"selected")) ?>
32     <?php } ?>
33     <?php if ((!$page->get('locked') || $isAdmin) and !$revision) { ?>
34       <?= ActionButton("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?>
35     <?php } else { ?>
36       <?= ActionButton("viewsource", _("View Source")) ?>
37     <?php } ?>
38     <?= ActionButton(_("PageHistory")) ?>
39     <?= ActionButton("diff") ?> 
40     <? if ( $user->isSignedIn() ) { ?>
41       <?= ActionButton("WatchPage", _("Watch")) ?>
42     <?php } ?>
43   </ul>
44 </div>
45 <div class="portlet" id="p-tbx">
46   <h5>Special Actions</h5>
47   <div class="pBody">
48   <ul>
49     <? if ( $user->isSignedIn() ) { ?>
50      <?php if ($isAdmin or mayAccessPage('change', $pagename)) { ?>
51       <?= ActionButton($page->get('locked') ? 'unlock' : 'lock') ?>
52       <?= ActionButton('rename') ?>
53       <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $pagename)) { ?>
54        <?= ActionButton('chown') ?>
55        <?= ActionButton('setacl') ?>
56      <?php }} ?>
57      <?php if (!empty($revision) and ($isAdmin or mayAccessPage('remove', $pagename))) { ?>
58       <?= ActionButton('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?>
59       <?= ActionButton('remove') ?>
60      <?php } ?>
61     <?php } ?>
62     <?= ActionButton(array('action'=>_("PageInfo")),
63                         _("Info"), $pagename) ?>
64     <?= ActionButton(_("PageHistory")) ?>
65     <?= ActionButton(_("AuthorHistory")) ?>
66     <?= ActionButton("diff") ?> 
67     <?= ActionButton(_("PageDump")) ?>
68     <?php if (DEBUG & _DEBUG_SQL and USECACHE) {
69       $PurgeCache = Button(array('nocache' => 'purge'),
70                      _("PurgeHtmlCache"), $pagename);
71       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed.")); ?>
72       <?= $PurgeCache ?>
73     <?php } ?>
74   </div>
75   </ul>
76 </div>