2 if (empty($revision)) $revision = $page->getCurrentRevision(false);
3 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
5 $dbi = $request->getDbh();
6 $author = $revision->get('author');
8 if ($dbi->isWikiPage($author))
9 $authorLink = WikiLink($author);
11 $authorId = $revision->get('author_id');
12 $version = $revision->getVersion();
13 $hits = $page->get('hits');
15 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
16 if ($minor_flag = $is_minor_edit) {
17 $minor_flag = HTML(" ",
18 HTML::span(array('class' => 'pageinfo-minoredit'),
19 "(" . _("minor edit") . ")"));
22 /* better way to do this? */
23 $bytes = strlen($revision->_data['%content']);
24 $size = ByteFormatter($bytes, /* $longformat = */true);
26 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
27 if (1 == ($c = count_all($whitespacematches)))
28 $wordcount = fmt("1 word");
30 $wordcount = fmt("%s words", $c);
33 $summary = $revision->get('summary');
35 if ($is_current = $revision->isCurrent()) {
37 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
38 'name' => 'edit[locked]',
39 'disabled' => !$user->isadmin(),
40 'checked' => $page->get('locked')));
42 // Not sure if I want to keep this... --Carsten
43 if ($user->isAdmin()) {
44 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
45 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
46 $clickcheckb = "location.href='$clickcheckbUrl'";
47 $LOCKED_CB->setAttr('onclick', $clickcheckb);
50 $label['date'] = _("Last Modified") . _(":");
51 $label['author'] = _("Last Author") . _(":");
52 $label['summary'] = _("Last Summary") . _(":");
55 $label['date'] = _("Saved on") . _(":");
56 $label['author'] = _("Author") . _(":");
57 $label['summary'] = _("Summary") . _(":");
60 $Sep = $WikiTheme->getButtonSeparator();
62 $perm_tree = pagePermissions($page->getName());
63 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
64 if ($type == 'inherited') {
65 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
66 } elseif ($type == 'page') {
67 $type = _("individual page permission");
68 } elseif ($type == 'default') {
69 $type = _("default page permission");
73 <table class="pageinfo">
75 <?php if (!$is_current) { ?>
77 <td class="align-right pageinfo"><?php echo _("Supplanted on") . _(":") ?></td>
78 <td><?php echo $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
83 <td class="align-right nowrap pageinfo"><?php echo $label['date'] ?></td>
84 <td><?php echo $modifed ?><?php echo $minor_flag ?></td>
87 <td class="align-right pageinfo"><?php echo $label['author'] ?></td>
88 <td><?php echo $authorLink ?>
89 <?php if (! ($author == $authorId)) {
90 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
91 <span class="pageinfo-authorid">(<?php echo $authorId ?>)</span>
95 <td class="align-right pageinfo"><?php echo _("Page Version") . _(":") ?></td>
96 <td><?php echo $version ?></td>
99 <td class="align-right pageinfo"><?php echo _("Size") . _(":") ?></td>
100 <td><?php echo $wordcount ?>, <?php echo $size ?></td>
102 <?php if ($is_current) { ?>
104 <td class="align-right pageinfo"><?php echo _("Hits") . _(":") ?></td>
105 <td><?php echo $hits ?></td>
109 <td class="align-right nowrap top pageinfo"><?php echo $label['summary'] ?></td>
110 <td><?php echo $summary ?></td>
112 <?php if ($is_current) { ?>
114 <td class="align-right"><?php echo $LOCKED_CB ?></td>
115 <td class="pageinfo"><?php echo _("Locked")?></td>
117 <?php if (ENABLE_EXTERNAL_PAGES) { ?>
119 <td class="align-right pageinfo"><?php echo _("Is External") . _(":") ?></td>
120 <td><?php echo $page->get('external') ? _("Yes") : _("No") ?></td>
124 <td class="align-right pageinfo"><?php echo _("ACL type") . _(":") ?></td>
125 <td><?php echo $type ?></td>
128 <td class="align-right top pageinfo"><?php echo _("ACL") . _(":") ?></td>
129 <td><?php echo $perm->asAclLines() ?></td>
133 <?php // determine page type
134 if (HOME_PAGE == $page->getName()) {
135 $pagetype []= sprintf('%s %s', WIKI_NAME, _("Home Page"));
137 if ($page->isUserPage($include_empty=true)) {
138 $pagetype []= _("User page");
140 if (isActionPage($page->getName())) {
141 $pagetype []= _("Action Page");
143 if ($page->get('pagetype') == 'wikiblog') {
144 $pagetype []= _("Blog page");
146 if ($page->getName() == __("InterWikiMap")) {
147 $pagetype []= _("InterWikiMap");
149 if (isSubPage($page->getName())) {
150 $pagetype []= _("Subpage");
153 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
155 <td class="align-right pageinfo"><?php echo _("Page Type") . _(":") ?></td>
156 <td><?php echo $pagetype?></td>