2 <!-- $Id: info.tmpl,v 1.8 2002-09-15 20:21:16 rurban 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 preg_match_all('/\\w+\\W*/', &$data['%content'], $whitespacematches);
35 if (1 == $c = count_all($whitespacematches))
36 $wordcount = fmt("1 word");
38 $wordcount = fmt("%s words", $c);
41 $markupVersion = ($markupVersion = $revision->get('markup'))
42 ? fmt("Version %s", $markupVersion)
43 : _("Original (1.2 or 1.0)");
45 $summary = HTML::textarea(array('name' => 'summary',
47 /* use fixed dimensions? */
48 'rows' => $request->getPref('editHeight')/4,
49 'cols' => $request->getPref('editWidth')/2,
50 'readonly' => 'readonly',
51 'wrap' => 'virtual'), /* for Netscape 4 */
52 $revision->get('summary'));
54 if ($is_current = $revision->isCurrent()) {
56 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
57 'name' => 'edit[locked]',
58 'disabled' => !$user->isadmin(),
59 'checked' => $page->get('locked')));
61 // Not sure if I want to keep this... --Carsten
62 if ($user->isadmin()) {
63 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
64 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
65 $clickcheckb = "location.href='$clickcheckbUrl'";
67 $LOCKED_CB->setAttr('onclick', $clickcheckb);
70 $label['date'] = _("Last Modified") . ':';
71 $label['author'] = _("Last Author") . ':';
72 $label['summary'] = _("Last Summary") . ':';
75 $label['date'] = _("Saved on") . ':';
76 $label['author'] = _("Author") . ':';
77 $label['summary'] = _("Summary") . ':';
80 $tableSummary = fmt("Statistics about %s.", $page->getName());
81 $Sep = $Theme->getButtonSeparator();
85 <!-- FIXME: move table formatting to css -->
86 <table summary="<?= $tableSummary ?>" class="pageinfo"
87 border="0" cellspacing="0" cellpadding="3">
89 <?php if (!$is_current) { ?>
91 <td align="right" class="pageinfo"><?=_("Supplanted on")?>:</td>
92 <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
97 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
98 <td><?= $modifed ?><?= $minor_flag ?></td>
100 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
101 <td><?= $author ?> <span class="pageinfo-authorid">(<?= $authorId ?>)</span></td>
103 <td align="right" class="pageinfo"><?=_("Page Version")?>:</td>
104 <td><?= $version ?></td>
106 <td align="right" class="pageinfo"><?=_("Markup")?>:</td>
107 <td><?= $markupVersion ?></td>
109 <td align="right" class="pageinfo"><?=_("Size")?>:</td>
110 <td><?= $wordcount ?>, <?= $size ?></td>
112 <?php if ($is_current) { ?>
114 <td align="right" class="pageinfo"><?= _("Hits") ?>:</td>
115 <td><?= $hits ?></td>
119 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
120 <td><?= $summary ?></td>
122 <?php if ($is_current) { ?>
124 <td align="right"><?= $LOCKED_CB ?></td>
125 <td class="pageinfo"><?=_("Locked")?></td>
131 <?= Button(_("PageHistory")) ?>
132 <?=$Sep?><?= Button("diff") ?>
133 <?php if (defined('DEBUG') || $user->isAdmin()) { ?>
134 <?=$Sep?><?= Button(_("DebugInfo")) ?> <!-- For debugging only, really -->