]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/gforge/templates/actionbar.tmpl
<?= --> <?php echo
[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 = isActionPage($pagename);
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       <?php echo 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           <?php echo Button(array('action'=>'browse'), _("Discussion"), $talk->getName()) ?>
30           </td>
31         <?php } else { ?>
32           <td>
33           <?php echo 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       <?php echo 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       <?php echo 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"><?php echo Button("edit", $dbh->isWikiPage($page->getName()) ? ($revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) : _("Create Page")) ?></td>
55     <?php } else if ($dbh->isWikiPage($page->getName())) { ?>
56       <td><?php echo Button("viewsource", _("View Source")) ?></td>
57     <?php } ?>
58
59     <?php if ($dbh->isWikiPage($page->getName())) { ?>
60
61     <td class="spacer">&nbsp;</td>
62     <td><?php echo Button("PageHistory", _("History")) ?></td>
63
64     <?php if ($curuserprefs->get('diffMenuItem')) { ?>
65       <td class="spacer">&nbsp;</td>
66       <td><?php echo Button("diff", _("Last Difference")) ?> </td>
67     <?php } ?>
68
69     <?php if ($curuserprefs->get('revertMenuItem')) { ?>
70       <td class="spacer">&nbsp;</td>
71       <td><?php echo Button('revert',_("Revert"), $revision->isCurrent() ? $page->GetRevisionBefore() : $revision) ?></td>
72     <?php } ?>
73
74       <td class="spacer">&nbsp;</td>
75       <td><?php echo Button("PageInfo", _("Page Info")) ?></td>
76
77       <td class="spacer">&nbsp;</td>
78       <td><?php echo Button(array('action'=>'BackLinks'), _("Back Links"),$page->getName()) ?></td>
79
80     <?php if (defined('USE_EXTERNAL_HTML2PDF') and USE_EXTERNAL_HTML2PDF) { ?> 
81       <?php if ($curuserprefs->get('pdfMenuItem')) { ?>
82         <td class="spacer">&nbsp;</td>
83         <td><?php echo Button("pdf") ?></td>
84       <?php } ?>
85     <?php } ?>
86
87     <td class="spacer">&nbsp;</td>
88     <td class="spacer">&nbsp;</td>
89
90     <?php if ($user->isAdmin() or mayAccessPage('change', $page->getName())) { ?>
91       <?php if ($curuserprefs->get('lockMenuItem')) { ?>
92         <?php if ($page->get('locked')) { ?>
93           <td><?php echo Button('unlock', _("Unlock")) ?></td>
94         <?php } else { ?>
95           <td><?php echo Button('lock', _("Lock")) ?></td>
96         <?php } ?>
97         <td class="spacer">&nbsp;</td>
98       <?php } ?>
99
100       <?php if (ENABLE_PAGEPERM and mayAccessPage('change', $page->getName())) { ?>
101         <?php if ($curuserprefs->get('chownMenuItem')) { ?>
102           <td><?php echo Button('chown', _("Change Owner")) ?></td>
103           <td class="spacer">&nbsp;</td>
104         <?php } ?>
105
106         <?php if ($curuserprefs->get('setaclMenuItem')) { ?>
107           <td><?php echo Button('setacl', _("Access Rights")) ?></td>
108           <td class="spacer">&nbsp;</td>
109         <?php } ?>
110       <?php } ?>
111     <?php } ?>
112
113     <?php if (($user->isAdmin() or mayAccessPage('rename', $page->getName())) && $revision) { ?>
114         <td><?php echo Button('rename', _("Rename")) ?></td>
115         <td class="spacer">&nbsp;</td>
116     <?php } ?>
117
118     <?php if (($user->isAdmin() or mayAccessPage('purge', $page->getName())) && $revision) { ?>
119         <td><?php echo Button('purge', _("Purge")) ?></td>
120         <td class="spacer">&nbsp;</td>
121     <?php } ?>
122
123     <?php } ?>
124
125     <td class="spacer">&nbsp;</td>
126     <td><?php echo Button("WatchPage", _("Watch Page")) ?></td>
127
128   </tr>
129   </table>
130   </div>