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