4 if (empty($revision)) $revision = $page->getCurrentRevision(false);
5 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
7 $author = $revision->get('author');
8 global $WikiNameRegexp;
9 $dbi = $request->getDbh();
10 $author = $revision->get('author');
11 $authorLink = $author;
12 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
13 $authorLink = WikiLink($author);
15 $authorId = $revision->get('author_id');
16 $version = $revision->getVersion();
17 $hits = $page->get('hits');
19 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
20 if ($minor_flag = $is_minor_edit) {
21 $minor_flag = HTML(" ",
22 HTML::span(array('class' => 'pageinfo-minoredit'),
23 "(" . _("minor edit") . ")"));
26 /* better way to do this? */
27 $bytes = strlen($revision->_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*/', $revision->_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' => intval($request->getPref('editHeight')/4),
50 'cols' => intval($request->getPref('editWidth')/2),
51 'readonly' => 'readonly',
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());
83 $perm_tree = pagePermissions($page->getName());
84 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
85 if ($type == 'inherited') {
86 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
87 } elseif ($type == 'page') {
88 $type = _("individual page permission");
89 } elseif ($type == 'default') {
90 $type = _("default page permission");
95 <!-- FIXME: move table formatting to css -->
96 <table summary="<?= $tableSummary ?>" class="pageinfo"
97 border="0" cellspacing="0" cellpadding="3">
99 <?php if (!$is_current) { ?>
101 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
102 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
107 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
108 <td><?= $modifed ?><?= $minor_flag ?></td>
111 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
112 <td><?= $authorLink ?>
113 <?php if (! ($author == $authorId)) { ?>
114 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
118 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
119 <td><?= $version ?></td>
122 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
123 <td><?= $markupVersion ?></td>
126 <td align="right" class="pageinfo"><?=_("Size:")?></td>
127 <td><?= $wordcount ?>, <?= $size ?></td>
129 <?php if ($is_current) { ?>
131 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
132 <td><?= $hits ?></td>
136 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
137 <td><?= $summary ?></td>
139 <?php if ($is_current) { ?>
141 <td align="right"><?= $LOCKED_CB ?></td>
142 <td class="pageinfo"><?=_("Locked")?></td>
145 <td align="right" class="pageinfo">ACL type</td>
146 <td><?= $type ?></td>
149 <td align="right" valign="top" class="pageinfo">ACL</td>
150 <td><?= $perm->asAclGroupLines() ?></td>
154 <?php // determine page type
155 if (HOME_PAGE == $page->getName()) {
156 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
158 if (0 && $page->isUserPage($include_empty=true)) {
159 $pagetype []= _("User page");
161 if (@$request->isActionPage($page->getName())) {
162 $pagetype []= _("Action page");
164 if ($page->get('pagetype') == 'wikiblog') {
165 $pagetype []= _("Blog page");
167 if ($page->getName() == _("InterWikiMap")) {
168 $pagetype []= _("InterWikiMap");
170 if (0 and isSubPage($page->getName())) {
171 $pagetype []= _("Subpage");
174 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
176 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
177 <td align="left"><?=$pagetype?></td>
183 <div id="actionbuttons">
184 <?= Button("viewsource", _("View Source")) ?>
185 <?=$SEP?><?= Button("PageHistory", _("PageHistory")) ?>
186 <?=$SEP?><?= Button("AuthorHistory", _("AuthorHistory")) ?>
187 <?=$SEP?><?= Button("Diff") ?>
188 <?=$SEP?><?= Button(array('action'=>'diff','previous' => 'minor'),_("Diff previous Revision"),$page->getName()) ?>
189 <?=$SEP?><?= Button(array('action'=>'diff','previous' => 'author'),_("Diff previous Author"),$page->getName()) ?>
190 <?php if ((defined('DEBUG') && DEBUG) || $user->isAdmin()) { ?>
191 <!-- Buttons really only for debugging -->
192 <?=$SEP?><?= Button("DebugInfo", _("DebugInfo")) ?>
194 $PurgeCache = Button(array('nocache' => 'purge'),
195 _("PurgeHtmlCache"), $page->getName());
196 $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
198 <?=$SEP?><?= $PurgeCache ?>
200 <!-- End debugging buttons -->