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 $markupVersion = ($markupVersion = $revision->get('markup'))
34 ? fmt("Version %s", $markupVersion)
35 : _("Original (1.2 or 1.0)");
37 $summary = $revision->get('summary');
39 if ($is_current = $revision->isCurrent()) {
41 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
42 'name' => 'edit[locked]',
43 'disabled' => !$user->isadmin(),
44 'checked' => $page->get('locked')));
46 // Not sure if I want to keep this... --Carsten
47 if ($user->isAdmin()) {
48 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
49 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
50 $clickcheckb = "location.href='$clickcheckbUrl'";
51 $LOCKED_CB->setAttr('onclick', $clickcheckb);
54 $label['date'] = _("Last Modified") . _(":");
55 $label['author'] = _("Last Author") . _(":");
56 $label['summary'] = _("Last Summary") . _(":");
59 $label['date'] = _("Saved on") . _(":");
60 $label['author'] = _("Author") . _(":");
61 $label['summary'] = _("Summary") . _(":");
64 $tableSummary = fmt("Statistics about %s.", $page->getName());
65 $Sep = $WikiTheme->getButtonSeparator();
67 $perm_tree = pagePermissions($page->getName());
68 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
69 if ($type == 'inherited') {
70 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
71 } elseif ($type == 'page') {
72 $type = _("individual page permission");
73 } elseif ($type == 'default') {
74 $type = _("default page permission");
78 <table summary="<?php echo $tableSummary ?>" class="pageinfo">
80 <?php if (!$is_current) { ?>
82 <td class="align-right pageinfo"><?php echo _("Supplanted on") . _(":") ?></td>
83 <td><?php echo $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
88 <td class="align-right nowrap pageinfo"><?php echo $label['date'] ?></td>
89 <td><?php echo $modifed ?><?php echo $minor_flag ?></td>
92 <td class="align-right pageinfo"><?php echo $label['author'] ?></td>
93 <td><?php echo $authorLink ?>
94 <?php if (! ($author == $authorId)) {
95 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
96 <span class="pageinfo-authorid">(<?php echo $authorId ?>)</span>
100 <td class="align-right pageinfo"><?php echo _("Page Version") . _(":") ?></td>
101 <td><?php echo $version ?></td>
104 <td class="align-right pageinfo"><?php echo _("Markup") . _(":") ?></td>
105 <td><?php echo $markupVersion ?></td>
108 <td class="align-right pageinfo"><?php echo _("Size") . _(":") ?></td>
109 <td><?php echo $wordcount ?>, <?php echo $size ?></td>
111 <?php if ($is_current) { ?>
113 <td class="align-right pageinfo"><?php echo _("Hits") . _(":") ?></td>
114 <td><?php echo $hits ?></td>
118 <td class="align-right nowrap top pageinfo"><?php echo $label['summary'] ?></td>
119 <td><?php echo $summary ?></td>
121 <?php if ($is_current) { ?>
123 <td class="align-right"><?php echo $LOCKED_CB ?></td>
124 <td class="pageinfo"><?php echo _("Locked")?></td>
126 <?php if (ENABLE_EXTERNAL_PAGES) { ?>
128 <td class="align-right pageinfo"><?php echo _("Is External") . _(":") ?></td>
129 <td><?php echo $page->get('external') ? _("Yes") : _("No") ?></td>
133 <td class="align-right pageinfo"><?php echo _("ACL type") . _(":") ?></td>
134 <td><?php echo $type ?></td>
137 <td class="align-right top pageinfo"><?php echo _("ACL") . _(":") ?></td>
138 <td><?php echo $perm->asAclLines() ?></td>
142 <?php // determine page type
143 if (HOME_PAGE == $page->getName()) {
144 $pagetype []= sprintf('%s %s', WIKI_NAME, _("Home Page"));
146 if ($page->isUserPage($include_empty=true)) {
147 $pagetype []= _("User page");
149 if (isActionPage($page->getName())) {
150 $pagetype []= _("Action Page");
152 if ($page->get('pagetype') == 'wikiblog') {
153 $pagetype []= _("Blog page");
155 if ($page->getName() == _("InterWikiMap")) {
156 $pagetype []= _("InterWikiMap");
158 if (isSubPage($page->getName())) {
159 $pagetype []= _("Subpage");
162 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
164 <td class="align-right pageinfo"><?php echo _("Page Type") . _(":") ?></td>
165 <td><?php echo $pagetype?></td>