2 <!-- $Id: info.tmpl,v 1.12 2003-01-11 22:54:28 carstenklapp Exp $ -->
5 $modifed = $Theme->formatDateTime($revision->get('mtime'));
7 global $WikiNameRegexp;
8 $dbi = $request->getDbh();
9 $author = $revision->get('author');
10 $authorLink = $author;
11 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
12 $authorLink = WikiLink($author);
14 $authorId = $revision->get('author_id');
15 $version = $revision->getVersion();
16 $hits = $page->get('hits');
18 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
19 if ($minor_flag = $is_minor_edit) {
20 $minor_flag = HTML(" ",
21 HTML::span(array('class' => 'pageinfo-minoredit'),
22 "(" . _("minor edit") . ")"));
25 /* better way to do this? */
26 $data = &$revision->_data;
27 $bytes = strlen(&$data['%content']);
29 $size = fmt("%s bytes", $bytes);
31 $kb = round($bytes / 1024, 1);
32 $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
35 preg_match_all('/\\w+\\W*/', &$data['%content'], $whitespacematches);
36 if (1 == $c = count_all($whitespacematches))
37 $wordcount = fmt("1 word");
39 $wordcount = fmt("%s words", $c);
42 $markupVersion = ($markupVersion = $revision->get('markup'))
43 ? fmt("Version %s", $markupVersion)
44 : _("Original (1.2 or 1.0)");
46 $summary = HTML::textarea(array('name' => 'summary',
48 /* use fixed dimensions? */
49 'rows' => $request->getPref('editHeight')/4,
50 'cols' => $request->getPref('editWidth')/2,
51 'readonly' => 'readonly',
52 'wrap' => 'virtual'), /* for Netscape 4 */
53 $revision->get('summary'));
55 if ($is_current = $revision->isCurrent()) {
57 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
58 'name' => 'edit[locked]',
59 'disabled' => !$user->isadmin(),
60 'checked' => $page->get('locked')));
62 // Not sure if I want to keep this... --Carsten
63 if ($user->isadmin()) {
64 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
65 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
66 $clickcheckb = "location.href='$clickcheckbUrl'";
68 $LOCKED_CB->setAttr('onclick', $clickcheckb);
71 $label['date'] = _("Last Modified:");
72 $label['author'] = _("Last Author:");
73 $label['summary'] = _("Last Summary:");
76 $label['date'] = _("Saved on:");
77 $label['author'] = _("Author:");
78 $label['summary'] = _("Summary:");
81 $tableSummary = fmt("Statistics about %s.", $page->getName());
82 $Sep = $Theme->getButtonSeparator();
86 <!-- FIXME: move table formatting to css -->
87 <table summary="<?= $tableSummary ?>" class="pageinfo"
88 border="0" cellspacing="0" cellpadding="3">
90 <?php if (!$is_current) { ?>
92 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
93 <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
98 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
99 <td><?= $modifed ?><?= $minor_flag ?></td>
101 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
102 <td><?= $authorLink ?>
103 <?php if (! ($author == $authorId)) { ?>
104 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
107 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
108 <td><?= $version ?></td>
110 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
111 <td><?= $markupVersion ?></td>
113 <td align="right" class="pageinfo"><?=_("Size:")?></td>
114 <td><?= $wordcount ?>, <?= $size ?></td>
116 <?php if ($is_current) { ?>
118 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
119 <td><?= $hits ?></td>
123 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
124 <td><?= $summary ?></td>
126 <?php if ($is_current) { ?>
128 <td align="right"><?= $LOCKED_CB ?></td>
129 <td class="pageinfo"><?=_("Locked")?></td>
132 <?php // determine page type
133 if (HOME_PAGE == $page->getName()) {
134 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
136 if ($page->isUserPage($include_empty=true)) {
137 $pagetype []= _("User page");
139 if (@$request->isActionPage($page->getName())) {
140 $pagetype []= _("Action page");
142 if ($page->get('pagetype') == 'wikiblog') {
143 $pagetype []= _("Blog page");
145 if ($page->getName() == _("InterWikiMap")) {
146 $pagetype []= _("InterWikiMap");
148 if (isSubPage($page->getName())) {
149 $pagetype []= _("Subpage");
152 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
154 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
155 <td align="left"><?=$pagetype?></td>
162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
163 // $Log: not supported by cvs2svn $