]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/templates/actionbar.tmpl
Update menus more like Mediawiki:
[SourceForge/phpwiki.git] / themes / MonoBook / templates / actionbar.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id$ -->
3 <?php
4   //$p = $WikiTheme->tooltipAccessKeyPrefix();
5   $dbh = $request->getDbh();
6   $isAdmin = $user->isAdmin();
7   $pagename = $page->getName();
8   $isActionPage = $request->_isActionPage($pagename, false);
9   $isBrowse = $request->getArg('action') == 'browse';
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'=>$isBrowse ? "selected" : "", 'title' => "View the page [alt-c]")) ?>
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(), array('title' => "View the page [alt-c]")) ?>
31       <?= ActionButton(array(),_("Discussion"), $talk->getName(), array('class'=>$isBrowse ? "selected" : "")) ?>
32     <?php } ?>
33     <?php if (($isAdmin or mayAccessPage('edit', $pagename)) and $revision) { ?>
34     <?= ActionButton("edit", $dbh->isWikiPage($page->getName()) ? ($revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) : _("Create Page"), false, 
35                      array('id' => 'btn-edit', 'title' => "You can edit this page. Please use the preview button before saving. [alt-e]")) ?>
36     <?php } else { ?>
37       <?= ActionButton("viewsource", _("View Source")) ?>
38     <?php } ?>
39
40     <?php if ($dbh->isWikiPage($page->getName())) { ?>
41
42       <?= ActionButton(_("PageHistory"),_("History"),false,array('title'=>"Past versions of this page. [alt-h]")) ?>
43
44       <?php if (!empty($revision) and ($isAdmin or mayAccessPage('purge', $pagename))) { ?>
45         <?= ActionButton("purge") ?>
46       <?php } ?>
47
48       <?php if ($isAdmin or mayAccessPage('change', $pagename)) { ?>
49         <?= ActionButton('rename') ?>
50         <?= ActionButton($page->get('locked') ? 'unlock' : 'lock') ?> 
51       <?php } ?>
52
53     <?php } ?>
54
55     <? if ( $user->isSignedIn() ) { ?>
56       <?= ActionButton("WatchPage", _("Watch"), false, 
57                        array('title'=>"Add/Remove this to/from the list of pages you're monitoring for changes [alt-l]")) ?>
58     <?php } ?>
59   </ul>
60 </div>
61 <div class="portlet" id="p-tbx">
62   <h5><?= _("Special Actions") ?></h5>
63   <div class="pBody">
64   <ul>
65     <?php if ( $user->isSignedIn() ) { ?>
66      <?php if ($isAdmin or mayAccessPage('change', $pagename)) { ?>
67       <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $pagename)) { ?>
68        <?= ActionButton('chown') ?>
69        <?= ActionButton('setacl') ?>
70      <?php }} ?>
71      <?php if (!empty($revision) and ($isAdmin or mayAccessPage('remove', $pagename))) { ?>
72       <?= ActionButton('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?>
73       <?= ActionButton('remove') ?>
74      <?php } ?>
75     <?php } ?>
76     <?= ActionButton(array('action'=>_("PageInfo")), _("Page info"), $pagename) ?>
77     <?= ActionButton(array('action'=>_("AuthorHistory")), _("Author history"), $pagename) ?>
78     <?= ActionButton("diff") ?> 
79     <?= ActionButton(array('action'=>_("PageDump")), _("Page dump"), $pagename) ?>
80     <?php if (DEBUG and USECACHE) {
81       $PurgeCache = ActionButton(array('nocache' => 'purge'),
82                      _("Purge HTML cache"), $pagename);
83       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed.")); ?>
84       <?= $PurgeCache ?>
85     <?php } ?>
86   </ul>
87   </div>
88 </div>