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 = $revision->get('summary');
41 if ($is_current = $revision->isCurrent()) {
43 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
44 'name' => 'edit[locked]',
45 'disabled' => !$user->isadmin(),
46 'checked' => $page->get('locked')));
48 // Not sure if I want to keep this... --Carsten
49 if ($user->isAdmin()) {
50 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
51 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
52 $clickcheckb = "location.href='$clickcheckbUrl'";
53 $LOCKED_CB->setAttr('onclick', $clickcheckb);
56 $label['date'] = _("Last Modified").':';
57 $label['author'] = _("Last Author").':';
58 $label['summary'] = _("Last Summary").':';
61 $label['date'] = _("Saved on:");
62 $label['author'] = _("Author").':';
63 $label['summary'] = _("Summary").':';
66 $tableSummary = fmt("Statistics about %s.", $page->getName());
67 $Sep = $WikiTheme->getButtonSeparator();
69 $perm_tree = pagePermissions($page->getName());
70 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
71 if ($type == 'inherited') {
72 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
73 } elseif ($type == 'page') {
74 $type = _("individual page permission");
75 } elseif ($type == 'default') {
76 $type = _("default page permission");
80 <!-- FIXME: move table formatting to css -->
81 <table summary="<?= $tableSummary ?>" class="pageinfo"
82 border="0" cellspacing="0" cellpadding="3">
84 <?php if (!$is_current) { ?>
86 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
87 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
92 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
93 <td><?= $modifed ?><?= $minor_flag ?></td>
96 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
97 <td><?= $authorLink ?>
98 <?php if (! ($author == $authorId)) {
99 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
100 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
104 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
105 <td><?= $version ?></td>
108 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
109 <td><?= $markupVersion ?></td>
112 <td align="right" class="pageinfo"><?=_("Size:")?></td>
113 <td><?= $wordcount ?>, <?= $size ?></td>
115 <?php if ($is_current) { ?>
117 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
118 <td><?= $hits ?></td>
122 <td align="right" nowrap="nowrap" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
123 <td><?= $summary ?></td>
125 <?php if ($is_current) { ?>
127 <td align="right"><?= $LOCKED_CB ?></td>
128 <td class="pageinfo"><?=_("Locked")?></td>
130 <?php if (ENABLE_EXTERNAL_PAGES) { ?>
132 <td align="right" class="pageinfo">Is External:</td>
133 <td><?= $page->get('external') ? _("Yes") : _("No") ?></td>
137 <td align="right" class="pageinfo">ACL type</td>
138 <td><?= $type ?></td>
141 <td align="right" valign="top" class="pageinfo">ACL</td>
142 <td><?= $perm->asAclGroupLines() ?></td>
146 <?php // determine page type
147 if (HOME_PAGE == $page->getName()) {
148 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
150 if ($page->isUserPage($include_empty=true)) {
151 $pagetype []= _("User page");
153 if (@$request->isActionPage($page->getName())) {
154 $pagetype []= _("Action page");
156 if ($page->get('pagetype') == 'wikiblog') {
157 $pagetype []= _("Blog page");
159 if ($page->getName() == _("InterWikiMap")) {
160 $pagetype []= _("InterWikiMap");
162 if (isSubPage($page->getName())) {
163 $pagetype []= _("Subpage");
166 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
168 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
169 <td align="left"><?=$pagetype?></td>