4 if (empty($revision)) $revision = $page->getCurrentRevision(false);
5 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
7 $dbi = $request->getDbh();
8 $author = $revision->get('author');
10 if ($dbi->isWikiPage($author))
11 $authorLink = 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 $bytes = strlen($revision->_data['%content']);
26 $size = ByteFormatter($bytes, /* $longformat = */true);
28 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
29 if (1 == ($c = count_all($whitespacematches)))
30 $wordcount = fmt("1 word");
32 $wordcount = fmt("%s words", $c);
35 $markupVersion = ($markupVersion = $revision->get('markup'))
36 ? fmt("Version %s", $markupVersion)
37 : _("Original (1.2 or 1.0)");
39 $summary = HTML::textarea(array('name' => 'summary',
42 'cols' => intval($request->getPref('editWidth')/2),
43 'readonly' => 'readonly'
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());
74 $Sep = $WikiTheme->getButtonSeparator();
78 <!-- FIXME: move table formatting to css -->
79 <table summary="<?= $tableSummary ?>" class="pageinfo"
80 border="0" cellspacing="0" cellpadding="3">
82 <?php if (!$is_current) { ?>
84 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
85 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
90 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
91 <td><?= $modifed ?><?= $minor_flag ?></td>
94 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
95 <td><?= $authorLink ?>
96 <?php if (! ($author == $authorId)) {
97 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
98 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
102 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
103 <td><?= $version ?></td>
106 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
107 <td><?= $markupVersion ?></td>
110 <td align="right" class="pageinfo"><?=_("Size:")?></td>
111 <td><?= $wordcount ?>, <?= $size ?></td>
113 <?php if ($is_current) { ?>
115 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
116 <td><?= $hits ?></td>
120 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
121 <td><?= $summary ?></td>
123 <?php if ($is_current) { ?>
125 <td align="right"><?= $LOCKED_CB ?></td>
126 <td class="pageinfo"><?=_("Locked")?></td>
130 <?php // determine page type
131 if (HOME_PAGE == $page->getName()) {
132 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
134 if ($page->isUserPage($include_empty=true)) {
135 $pagetype []= _("User page");
137 if (@$request->isActionPage($page->getName())) {
138 $pagetype []= _("Action page");
140 if ($page->get('pagetype') == 'wikiblog') {
141 $pagetype []= _("Blog page");
143 if ($page->getName() == _("InterWikiMap")) {
144 $pagetype []= _("InterWikiMap");
146 if (isSubPage($page->getName())) {
147 $pagetype []= _("Subpage");
150 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
152 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
153 <td align="left"><?=$pagetype?></td>
160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
161 // $Log: not supported by cvs2svn $
162 // Revision 1.19 2007/01/02 13:30:36 rurban
163 // bring in revision, use fixed summary height
165 // Revision 1.18 2005/02/02 19:02:10 rurban
168 // Revision 1.17 2004/06/14 11:26:52 rurban
169 // renamed global $Theme to $WikiTheme (gforge nameclash)
171 // Revision 1.16 2004/05/18 14:47:21 rurban
172 // Simplified strings for easier translation
174 // Revision 1.15 2003/12/11 19:38:29 carstenklapp
175 // Internal change: Fix PHP Warning: Call-time pass-by-reference has been deprecated
177 // Revision 1.14 2003/11/29 20:13:38 carstenklapp
178 // Internal change: Refactored ByteFormatter code into a new function in
179 // stdlib (now used by PageList too).
181 // Revision 1.13 2003/02/21 04:24:48 dairiki
182 // Fix <td> </td> nesting. (Was generating invalid HTML.)
184 // Revision 1.12 2003/01/11 22:54:28 carstenklapp
185 // Added Page type field displayed for special pages.