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 = HTML::textarea(array('name' => 'summary',
42 'cols' => intval($request->getPref('editWidth')/2),
43 'readonly' => 'readonly'
45 $revision->get('summary'));
47 if ($is_current = $revision->isCurrent()) {
49 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
50 'name' => 'edit[locked]',
51 'disabled' => !$user->isadmin(),
52 'checked' => $page->get('locked')));
54 // Not sure if I want to keep this... --Carsten
55 if ($user->isAdmin()) {
56 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
57 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
58 $clickcheckb = "location.href='$clickcheckbUrl'";
60 $LOCKED_CB->setAttr('onclick', $clickcheckb);
63 $label['date'] = _("Last Modified").':';
64 $label['author'] = _("Last Author").':';
65 $label['summary'] = _("Last Summary").':';
68 $label['date'] = _("Saved on:");
69 $label['author'] = _("Author").':';
70 $label['summary'] = _("Summary").':';
73 $tableSummary = fmt("Statistics about %s.", $page->getName());
74 $Sep = $WikiTheme->getButtonSeparator();
76 $perm_tree = pagePermissions($page->getName());
77 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
78 if ($type == 'inherited') {
79 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
80 } elseif ($type == 'page') {
81 $type = _("invidual page permission");
82 } elseif ($type == 'default') {
83 $type = _("default page permission");
87 <!-- FIXME: move table formatting to css -->
88 <table summary="<?= $tableSummary ?>" class="pageinfo"
89 border="0" cellspacing="0" cellpadding="3">
91 <?php if (!$is_current) { ?>
93 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
94 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
99 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
100 <td><?= $modifed ?><?= $minor_flag ?></td>
103 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
104 <td><?= $authorLink ?>
105 <?php if (! ($author == $authorId)) {
106 if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
107 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
111 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
112 <td><?= $version ?></td>
115 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
116 <td><?= $markupVersion ?></td>
119 <td align="right" class="pageinfo"><?=_("Size:")?></td>
120 <td><?= $wordcount ?>, <?= $size ?></td>
122 <?php if ($is_current) { ?>
124 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
125 <td><?= $hits ?></td>
129 <td align="right" nowrap="nowrap" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
130 <td><?= $summary ?></td>
132 <?php if ($is_current) { ?>
134 <td align="right"><?= $LOCKED_CB ?></td>
135 <td class="pageinfo"><?=_("Locked")?></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->asAclLines() ?></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 (@$request->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>