]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/info.tmpl
Activated the "Locked" checkbox for the admin. Not sure if I like this...
[SourceForge/phpwiki.git] / themes / default / templates / info.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: info.tmpl,v 1.5 2002-02-21 06:43:04 carstenklapp Exp $ -->
3 <?php
4
5 $modifed = $Theme->formatDateTime($revision->get('mtime'));
6
7 $author = $revision->get('author');
8 global $WikiNameRegexp;
9 $dbi = $request->getDbh();
10 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
11     $author = WikiLink($author);
12
13 $authorId = $revision->get('author_id');
14 $version = $revision->getVersion();
15 $hits = $page->get('hits');
16
17 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
18 if ($minor_flag = $is_minor_edit) {
19     $minor_flag = HTML(" ",
20                        HTML::span(array('class' => 'pageinfo-minoredit'),
21                                   "(" . _("minor edit") . ")"));
22 }
23
24 /* better way to do this? */
25 $data = &$revision->_data;
26 $bytes = strlen(&$data['%content']);
27 if ($bytes < 1024 )
28     $size = fmt("%s bytes", $bytes);
29 else {
30     $kb = round($bytes / 1024, 1);
31     $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
32 }
33
34 $markupVersion = ($markupVersion = $revision->get('markup'))
35                ? fmt("Version %s", $markupVersion)
36                : _("Original (1.2 or 1.0)");
37
38 $summary = HTML::textarea(array('name' => 'summary',
39                                 'class' => 'summary',
40                                 /* use fixed dimensions? */
41                                 'rows' => $request->getPref('editHeight')/4,
42                                 'cols' => $request->getPref('editWidth')/2,
43                                 'readonly' => 'readonly',
44                                 'wrap' => 'virtual'), /* for Netscape 4 */
45                           $revision->get('summary'));
46
47 if ($is_current = $revision->isCurrent()) {
48
49     $LOCKED_CB = HTML::input(array('type' => 'checkbox',
50                                    'name' => 'edit[locked]',
51                                    'disabled' => !$user->isadmin(),
52                                    'checked'  => $page->get('locked')));
53
54     // Not sure if I want to keep this... --Carsten
55     if ($user->isadmin()) {
56         $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
57         $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
58         $clickcheckb = "location.href='$clickcheckbUrl'";
59
60         $LOCKED_CB->setAttr('onclick', $clickcheckb);
61     }
62
63     $label['date'] = _("Last Modified:");
64     $label['author'] = _("Last Author:");
65     $label['summary'] = _("Last Summary:");
66
67 } else {
68     $label['date'] = _("Saved on:");
69     $label['author'] = _("Author:");
70     $label['summary'] = _("Summary:");
71 }
72
73 $tableSummary = fmt("Statistics about %s.", $page->getName());
74
75 ?>
76
77 <!-- FIXME: move table formatting to css -->
78 <table summary="<?= $tableSummary ?>" class="pageinfo"
79        border="0" cellspacing="0" cellpadding="3">
80
81 <?php if (!$is_current) { ?>
82   <tr>
83     <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
84     <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
85   </tr>
86 <?php } ?>
87
88   <tr>
89     <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
90     <td><?= $modifed ?><?= $minor_flag ?></td>
91   </tr><tr>
92     <td align="right" class="pageinfo"><?= $label['author'] ?></td>
93     <td><?= $author ?> <span class="pageinfo-authorid">(<?= $authorId ?>)</span></td>
94   </tr><tr>
95     <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
96     <td><?= $version ?></td>
97   </tr><tr>
98     <td align="right" class="pageinfo"><?=_("Markup:")?></td>
99     <td><?= $markupVersion ?></td>
100   </tr><tr>
101     <td align="right" class="pageinfo"><?=_("Size:")?></td>
102     <td><?= $size ?></td>
103
104 <?php if ($is_current) { ?>
105   </tr><tr>
106     <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
107     <td><?= $hits ?></td>
108 <?php } ?>
109
110   </tr><tr>
111     <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
112     <td><?= $summary ?></td>
113
114 <?php if ($is_current) { ?>
115   </tr><tr>
116     <td align="right"><?= $LOCKED_CB ?></td>
117     <td class="pageinfo"><?=_("Locked")?></td>
118 <?php } ?>
119
120   </tr>
121 </table>