]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/gforge/templates/actionbar.tmpl
Added Gforge theme
[SourceForge/phpwiki.git] / themes / gforge / templates / actionbar.tmpl
1 <?php // -*-php-*-
2 rcs_id('$Id$');
3 ?>
4
5 <?php 
6 $curuserprefs = $user->getPreferences();
7 $dbh = $request->getDbh();
8 $isAdmin = $user->isAdmin();
9 $pagename = $page->getName();
10 $isActionPage = $request->_isActionPage($pagename, false);
11 $isBrowse = $request->getArg('action') == 'browse';
12 ?>
13
14   <div id="actionbuttons">
15     <table cellpadding="0" cellspacing="0">
16     <tr>
17
18     <?php if (!string_ends_with($pagename, _("/Discussion"))) { ?>
19     <?php $talk = new WikiPageName('Talk:'.$pagename); ?>
20       <td class="bold">
21       <?= Button(array(),
22                        $isActionPage ? _("Action Page") : _("Page"), 
23                        $talk->getParent(), array('title' => "Page")) ?>
24       </td>
25       <td class="spacer">&nbsp;</td>
26       <?php if (!$isActionPage) { ?>
27         <?php if ($dbh->isWikiPage($talk->getName())) { ?>
28           <td>
29           <?= Button(array('action'=>'browse'), _("Discussion"), $talk->getName()) ?>
30           </td>
31         <?php } else { ?>
32           <td>
33           <?= Button(array('action'=>'create',
34                                  'template'=>_("TemplateTalk")),
35                            _("Discussion"), $talk->getName()) ?>
36           </td>
37         <?php } ?>
38       <?php } ?>
39     <?php } else {
40       $talk = new WikiPageName($pagename); ?>
41       <td>
42       <?= Button(array(),$isActionPage ? _("Action Page") : _("Page"), $talk->getParent(), array('title' => "View the page")) ?>
43       </td>
44       <td class="spacer">&nbsp;</td>
45       <td class="bold">
46       <?= Button(array(),_("Discussion"), $talk->getName()) ?>
47       </td>
48     <?php } ?>
49
50     <td class="spacer">&nbsp;</td>
51     <td class="spacer">&nbsp;</td>
52
53     <?php if ((mayAccessPage('edit', $page->getName())) and $revision) { ?>
54       <td class="bold"><?= Button("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?></td>
55     <?php } else { ?>
56       <td><?= Button("viewsource", _("View Source")) ?></td>
57     <?php } ?>
58
59     <td class="spacer">&nbsp;</td>
60
61     <td><?= Button("PageHistory", _("History")) ?></td>
62
63     <?php if ($curuserprefs->get('diffMenuItem')) { ?>
64       <td class="spacer">&nbsp;</td>
65       <td><?= Button("diff", _("Last Difference")) ?> </td>
66     <?php } ?>
67
68     <?php if ($curuserprefs->get('revertMenuItem')) { ?>
69       <td class="spacer">&nbsp;</td>
70       <td><?= Button('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?></td>
71     <?php } ?>
72
73       <td class="spacer">&nbsp;</td>
74       <td><?= Button("PageInfo", _("Page Info")) ?></td>
75
76       <td class="spacer">&nbsp;</td>
77       <td><?= Button(array('action'=>'BackLinks'), _("Back Links"),$page->getName()) ?></td>
78
79     <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?> 
80       <?php if ($curuserprefs->get('pdfMenuItem')) { ?>
81         <td class="spacer">&nbsp;</td>
82         <td><?= Button("pdf") ?></td>
83       <?php } ?>
84     <?php } ?>
85
86     <td class="spacer">&nbsp;</td>
87     <td class="spacer">&nbsp;</td>
88
89     <?php if ($user->isAdmin() or mayAccessPage('change', $page->getName())) { ?>
90       <?php if ($curuserprefs->get('lockMenuItem')) { ?>
91         <?php if ($page->get('locked')) { ?>
92           <td><?= Button('unlock', _("Unlock")) ?></td>
93         <?php } else { ?>
94           <td><?= Button('lock', _("Lock")) ?></td>
95         <?php } ?>
96         <td class="spacer">&nbsp;</td>
97       <?php } ?>
98
99       <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $page->getName())) { ?>
100         <?php if ($curuserprefs->get('chownMenuItem')) { ?>
101           <td><?= Button('chown', _("Change Owner")) ?></td>
102           <td class="spacer">&nbsp;</td>
103         <?php } ?>
104
105         <?php if ($curuserprefs->get('setaclMenuItem')) { ?>
106           <td><?= Button('setacl', _("Access Rights")) ?></td>
107           <td class="spacer">&nbsp;</td>
108         <?php } ?>
109       <?php } ?>
110     <?php } ?>
111
112     <?php if (($user->isAdmin() or mayAccessPage('rename', $page->getName())) && $revision) { ?>
113         <td><?= Button('rename', _("Rename")) ?></td>
114         <td class="spacer">&nbsp;</td>
115     <?php } ?>
116
117     <?php if (($user->isAdmin() or mayAccessPage('remove', $page->getName())) && $revision) { ?>
118         <td><?= Button('remove', _("Remove")) ?></td>
119         <td class="spacer">&nbsp;</td>
120     <?php } ?>
121
122 <?php if ((DEBUG and $request->getArg('action') == 'browse') || $user->isAdmin()) { ?> 
123     <!-- Buttons really only for debugging -->
124 <?php
125     if (DEBUG & _DEBUG_SQL and USECACHE) {
126       $PurgeCache = Button(array('nocache' => 'purge'),
127                      _("PurgeHtmlCache"), $page->getName());
128       $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
129 ?>
130       <td><?= $PurgeCache ?></td>
131 <?php } ?>
132     <!-- End debugging buttons -->
133 <?php } ?>
134   </tr>
135   </table>
136   </div>