2 <!-- $Id: info.tmpl,v 1.15 2003-12-11 19:38:29 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 $bytes = strlen($revision->_data['%content']);
27 $size = ByteFormatter($bytes, /* $longformat = */true);
29 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
30 if (1 == $c = count_all($whitespacematches))
31 $wordcount = fmt("1 word");
33 $wordcount = fmt("%s words", $c);
36 $markupVersion = ($markupVersion = $revision->get('markup'))
37 ? fmt("Version %s", $markupVersion)
38 : _("Original (1.2 or 1.0)");
40 $summary = HTML::textarea(array('name' => 'summary',
42 /* use fixed dimensions? */
43 'rows' => $request->getPref('editHeight')/4,
44 'cols' => $request->getPref('editWidth')/2,
45 'readonly' => 'readonly',
46 'wrap' => 'virtual'), /* for Netscape 4 */
47 $revision->get('summary'));
49 if ($is_current = $revision->isCurrent()) {
51 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
52 'name' => 'edit[locked]',
53 'disabled' => !$user->isadmin(),
54 'checked' => $page->get('locked')));
56 // Not sure if I want to keep this... --Carsten
57 if ($user->isadmin()) {
58 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
59 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
60 $clickcheckb = "location.href='$clickcheckbUrl'";
62 $LOCKED_CB->setAttr('onclick', $clickcheckb);
65 $label['date'] = _("Last Modified:");
66 $label['author'] = _("Last Author:");
67 $label['summary'] = _("Last Summary:");
70 $label['date'] = _("Saved on:");
71 $label['author'] = _("Author:");
72 $label['summary'] = _("Summary:");
75 $tableSummary = fmt("Statistics about %s.", $page->getName());
76 $Sep = $Theme->getButtonSeparator();
80 <!-- FIXME: move table formatting to css -->
81 <table summary="<?= $tableSummary ?>" class="pageinfo"
82 border="0" cellspacing="0" cellpadding="3">
84 <?php if (!$is_current) { ?>
86 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
87 <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
92 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
93 <td><?= $modifed ?><?= $minor_flag ?></td>
96 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
97 <td><?= $authorLink ?>
98 <?php if (! ($author == $authorId)) { ?>
99 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
103 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
104 <td><?= $version ?></td>
107 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
108 <td><?= $markupVersion ?></td>
111 <td align="right" class="pageinfo"><?=_("Size:")?></td>
112 <td><?= $wordcount ?>, <?= $size ?></td>
114 <?php if ($is_current) { ?>
116 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
117 <td><?= $hits ?></td>
121 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
122 <td><?= $summary ?></td>
124 <?php if ($is_current) { ?>
126 <td align="right"><?= $LOCKED_CB ?></td>
127 <td class="pageinfo"><?=_("Locked")?></td>
131 <?php // determine page type
132 if (HOME_PAGE == $page->getName()) {
133 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
135 if ($page->isUserPage($include_empty=true)) {
136 $pagetype []= _("User page");
138 if (@$request->isActionPage($page->getName())) {
139 $pagetype []= _("Action page");
141 if ($page->get('pagetype') == 'wikiblog') {
142 $pagetype []= _("Blog page");
144 if ($page->getName() == _("InterWikiMap")) {
145 $pagetype []= _("InterWikiMap");
147 if (isSubPage($page->getName())) {
148 $pagetype []= _("Subpage");
151 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
153 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
154 <td align="left"><?=$pagetype?></td>
161 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
162 // $Log: not supported by cvs2svn $
163 // Revision 1.14 2003/11/29 20:13:38 carstenklapp
164 // Internal change: Refactored ByteFormatter code into a new function in
165 // stdlib (now used by PageList too).
167 // Revision 1.13 2003/02/21 04:24:48 dairiki
168 // Fix <td> </td> nesting. (Was generating invalid HTML.)
170 // Revision 1.12 2003/01/11 22:54:28 carstenklapp
171 // Added Page type field displayed for special pages.