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