2 <!-- $Id: info.tmpl,v 1.5 2002-02-21 06:43:04 carstenklapp Exp $ -->
5 $modifed = $Theme->formatDateTime($revision->get('mtime'));
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);
13 $authorId = $revision->get('author_id');
14 $version = $revision->getVersion();
15 $hits = $page->get('hits');
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") . ")"));
24 /* better way to do this? */
25 $data = &$revision->_data;
26 $bytes = strlen(&$data['%content']);
28 $size = fmt("%s bytes", $bytes);
30 $kb = round($bytes / 1024, 1);
31 $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
34 $markupVersion = ($markupVersion = $revision->get('markup'))
35 ? fmt("Version %s", $markupVersion)
36 : _("Original (1.2 or 1.0)");
38 $summary = HTML::textarea(array('name' => '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'));
47 if ($is_current = $revision->isCurrent()) {
49 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
50 'name' => 'edit[locked]',
51 'disabled' => !$user->isadmin(),
52 'checked' => $page->get('locked')));
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'";
60 $LOCKED_CB->setAttr('onclick', $clickcheckb);
63 $label['date'] = _("Last Modified:");
64 $label['author'] = _("Last Author:");
65 $label['summary'] = _("Last Summary:");
68 $label['date'] = _("Saved on:");
69 $label['author'] = _("Author:");
70 $label['summary'] = _("Summary:");
73 $tableSummary = fmt("Statistics about %s.", $page->getName());
77 <!-- FIXME: move table formatting to css -->
78 <table summary="<?= $tableSummary ?>" class="pageinfo"
79 border="0" cellspacing="0" cellpadding="3">
81 <?php if (!$is_current) { ?>
83 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
84 <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
89 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
90 <td><?= $modifed ?><?= $minor_flag ?></td>
92 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
93 <td><?= $author ?> <span class="pageinfo-authorid">(<?= $authorId ?>)</span></td>
95 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
96 <td><?= $version ?></td>
98 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
99 <td><?= $markupVersion ?></td>
101 <td align="right" class="pageinfo"><?=_("Size:")?></td>
102 <td><?= $size ?></td>
104 <?php if ($is_current) { ?>
106 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
107 <td><?= $hits ?></td>
111 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
112 <td><?= $summary ?></td>
114 <?php if ($is_current) { ?>
116 <td align="right"><?= $LOCKED_CB ?></td>
117 <td class="pageinfo"><?=_("Locked")?></td>