5 if (empty($revision)) $revision = $page->getCurrentRevision(false);
6 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
8 $dbi = $request->getDbh();
9 $author = $revision->get('author');
10 $authorLink = $author;
11 if ($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 = $revision->get('summary');
42 if ($is_current = $revision->isCurrent()) {
44 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
45 'name' => 'edit[locked]',
46 'disabled' => !$user->isadmin(),
47 'checked' => $page->get('locked')));
49 // Not sure if I want to keep this... --Carsten
50 if ($user->isAdmin()) {
51 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
52 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
53 $clickcheckb = "location.href='$clickcheckbUrl'";
54 $LOCKED_CB->setAttr('onclick', $clickcheckb);
57 $label['date'] = _("Last Modified").':';
58 $label['author'] = _("Last Author").':';
59 $label['summary'] = _("Last Summary").':';
62 $label['date'] = _("Saved on:");
63 $label['author'] = _("Author").':';
64 $label['summary'] = _("Summary").':';
67 $tableSummary = fmt("Statistics about %s.", $page->getName());
68 $Sep = $WikiTheme->getButtonSeparator();
70 $perm_tree = pagePermissions($page->getName());
71 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
72 if ($type == 'inherited') {
73 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
74 } elseif ($type == 'page') {
75 $type = _("individual page permission");
76 } elseif ($type == 'default') {
77 $type = _("default page permission");
81 <!-- FIXME: move table formatting to css -->
82 <table summary="<?= $tableSummary ?>" class="pageinfo"
83 border="0" cellspacing="0" cellpadding="3">
85 <?php if (!$is_current) { ?>
87 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
88 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
93 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
94 <td><?= $modifed ?><?= $minor_flag ?></td>
97 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
98 <td><?= $authorLink ?>
99 <?php if (! ($author == $authorId)) {
100 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
101 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
105 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
106 <td><?= $version ?></td>
109 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
110 <td><?= $markupVersion ?></td>
113 <td align="right" class="pageinfo"><?=_("Size:")?></td>
114 <td><?= $wordcount ?>, <?= $size ?></td>
116 <?php if ($is_current) { ?>
118 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
119 <td><?= $hits ?></td>
123 <td align="right" nowrap="nowrap" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
124 <td><?= $summary ?></td>
126 <?php if ($is_current) { ?>
128 <td align="right"><?= $LOCKED_CB ?></td>
129 <td class="pageinfo"><?=_("Locked")?></td>
131 <?php if (ENABLE_EXTERNAL_PAGES) { ?>
133 <td align="right" class="pageinfo">Is External:</td>
134 <td><?= $page->get('external') ? _("Yes") : _("No") ?></td>
138 <td align="right" class="pageinfo">ACL type</td>
139 <td><?= $type ?></td>
142 <td align="right" valign="top" class="pageinfo">ACL</td>
143 <td><?= $perm->asAclGroupLines() ?></td>
147 <?php // determine page type
148 if (HOME_PAGE == $page->getName()) {
149 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
151 if ($page->isUserPage($include_empty=true)) {
152 $pagetype []= _("User page");
154 if (isActionPage($page->getName())) {
155 $pagetype []= _("Action page");
157 if ($page->get('pagetype') == 'wikiblog') {
158 $pagetype []= _("Blog page");
160 if ($page->getName() == _("InterWikiMap")) {
161 $pagetype []= _("InterWikiMap");
163 if (isSubPage($page->getName())) {
164 $pagetype []= _("Subpage");
167 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
169 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
170 <td align="left"><?=$pagetype?></td>