]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MacOSX/templates/actionbar.tmpl
Combine and refactor editpage.php and savepage.php.
[SourceForge/phpwiki.git] / themes / MacOSX / templates / actionbar.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: actionbar.tmpl,v 1.15 2002-01-30 01:33:20 dairiki Exp $ -->
3 <?php
4   if (!$page->get('locked') || $user->isAdmin())
5       $EditB = $Theme->makeActionButton("edit",
6                                      $revision->isCurrent() ? _("Edit") : _("Edit Old Revision"));
7   else
8       $EditB = $Theme->makeActionButton("viewsource", _("View Source"));
9
10   $LockPageB = $Theme->makeActionButton($page->get('locked') ? 'unlock' : 'lock');
11   $RemovePageB = $Theme->makeActionButton('remove');
12
13   $PageHistoryB = $Theme->makeActionButton(_("PageHistory"));
14   $DiffB = $Theme->makeActionButton(array('action' => 'diff', 'previous' => 'major'));
15
16   $DebugInfoB = $Theme->makeActionButton(_("DebugInfo"));
17
18   $SignInB = $Theme->makeActionButton($user->isSignedIn() ? 'logout' : 'login');
19
20   $s = $Theme->getButtonSeparator();
21 ?>
22
23 <!-- I would like not to have to use these tables, and managed to
24      get this stuff to work more or less correctly using
25      CSSs float:left; and float:right;.  However float:right; seems
26      to cause MSIE4.01/NT to hang. 
27      So, we use tables...  -->
28 <table summary="Toolbar 1: Page actions and login."
29        class="toolbar" width="100%"
30        cellpadding="0" cellspacing="0" border="0"
31        id="actionbar">
32 <tr valign="middle">
33   <td>
34     <?= $EditB ?> 
35     <?php if ($user->isAdmin()) { ?>
36      <?=$s?><?= $LockPageB ?>
37      <?=$s?><?= $RemovePageB ?>
38     <?php } ?>
39    <?=$s?><?= $PageHistoryB ?>
40    <?=$s?><?= $DiffB ?> 
41    <?=$s?><?= $DebugInfoB ?> <!-- For debugging only, really -->
42   </td>
43
44   <td align="right">
45     <?php if ($user->isSignedIn()) { ?>
46       <form method="post" action="<?=BASE_URL?>" accept-charset="<?=CHARSET?>" name="signin">
47         <input type="hidden" name="action" value="<?=$request->getArg('action')?>" />
48         <input type="hidden" name="pagename" value="HomePage" />
49         <!-- This extra table data is required to properly align an image
50           -- button next to text. With text-only buttons, it would take up
51           -- too much room on small screens to align text this way, so the
52           -- default browse template is overridden for this theme.
53           -->
54         <table cellspacing="0" cellpadding="0" border="0"><tr>
55         <td>
56           <?=fmt("You are signed in as %s", LinkWikiWord($user->getId()))?>&nbsp;
57         </td>
58         <td>
59           <?=$s?>
60           <?=$Theme->makeButton(_("Sign Out"), "submit:auth[logout]", "wikiaction")?>
61         </td>
62         </tr></table>
63       </form>
64     <?php } else { ?>
65       <?= Template('signin') ?>
66     <?php } ?>
67   </td>
68 </tr></table>