5 if (empty($revision)) $revision = $page->getCurrentRevision(false);
6 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
8 $author = $revision->get('author');
9 global $WikiNameRegexp;
10 $dbi = $request->getDbh();
11 $author = $revision->get('author');
12 $authorLink = $author;
13 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
14 $authorLink = WikiLink($author);
16 $authorId = $revision->get('author_id');
17 $version = $revision->getVersion();
18 $hits = $page->get('hits');
20 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
21 if ($minor_flag = $is_minor_edit) {
22 $minor_flag = HTML(" ",
23 HTML::span(array('class' => 'pageinfo-minoredit'),
24 "(" . _("minor edit") . ")"));
27 /* better way to do this? */
28 $bytes = strlen($revision->_data['%content']);
30 $size = fmt("%s bytes", $bytes);
32 $kb = round($bytes / 1024, 1);
33 $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
36 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
37 if (1 == $c = count_all($whitespacematches))
38 $wordcount = fmt("1 word");
40 $wordcount = fmt("%s words", $c);
43 $markupVersion = ($markupVersion = $revision->get('markup'))
44 ? fmt("Version %s", $markupVersion)
45 : _("Original (1.2 or 1.0)");
47 $summary = HTML::textarea(array('name' => 'summary',
49 /* use fixed dimensions? */
50 'rows' => intval($request->getPref('editHeight')/4),
51 'cols' => intval($request->getPref('editWidth')/2),
52 'readonly' => 'readonly',
54 $revision->get('summary'));
56 if ($is_current = $revision->isCurrent()) {
58 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
59 'name' => 'edit[locked]',
60 'disabled' => !$user->isadmin(),
61 'checked' => $page->get('locked')));
63 // Not sure if I want to keep this... --Carsten
64 if ($user->isadmin()) {
65 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
66 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
67 $clickcheckb = "location.href='$clickcheckbUrl'";
69 $LOCKED_CB->setAttr('onclick', $clickcheckb);
72 $label['date'] = _("Last Modified").':';
73 $label['author'] = _("Last Author").':';
74 $label['summary'] = _("Last Summary").':';
77 $label['date'] = _("Saved on:");
78 $label['author'] = _("Author").':';
79 $label['summary'] = _("Summary").':';
82 $tableSummary = fmt("Statistics about %s.", $page->getName());
84 $perm_tree = pagePermissions($page->getName());
85 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
86 if ($type == 'inherited') {
87 $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
88 } elseif ($type == 'page') {
89 $type = _("individual page permission");
90 } elseif ($type == 'default') {
91 $type = _("default page permission");
96 <!-- FIXME: move table formatting to css -->
97 <table summary="<?php echo $tableSummary ?>" class="pageinfo"
98 border="0" cellspacing="0" cellpadding="3">
100 <?php if (!$is_current) { ?>
102 <td align="right" class="pageinfo"><?php echo _("Supplanted on:")?></td>
103 <td><?php echo $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
108 <td align="right" nowrap="nowrap" class="pageinfo"><?php echo $label['date'] ?></td>
109 <td><?php echo $modifed ?><?php echo $minor_flag ?></td>
112 <td align="right" class="pageinfo"><?php echo $label['author'] ?></td>
113 <td><?php echo $authorLink ?>
114 <?php if (! ($author == $authorId)) { ?>
115 <span class="pageinfo-authorid">(<?php echo $authorId ?>)</span>
119 <td align="right" class="pageinfo"><?php echo _("Page Version:")?></td>
120 <td><?php echo $version ?></td>
123 <td align="right" class="pageinfo"><?php echo _("Markup:")?></td>
124 <td><?php echo $markupVersion ?></td>
127 <td align="right" class="pageinfo"><?php echo _("Size:")?></td>
128 <td><?php echo $wordcount ?>, <?php echo $size ?></td>
130 <?php if ($is_current) { ?>
132 <td align="right" class="pageinfo"><?php echo _("Hits:") ?></td>
133 <td><?php echo $hits ?></td>
137 <td align="right" valign="top" class="pageinfo"><?php echo $label['summary'] ?></td>
138 <td><?php echo $summary ?></td>
140 <?php if ($is_current) { ?>
142 <td align="right"><?php echo $LOCKED_CB ?></td>
143 <td class="pageinfo"><?php echo _("Locked")?></td>
146 <td align="right" class="pageinfo">ACL type</td>
147 <td><?php echo $type ?></td>
150 <td align="right" valign="top" class="pageinfo">ACL</td>
151 <td><?php echo $perm->asAclLines() ?></td>
155 <?php // determine page type
156 if (HOME_PAGE == $page->getName()) {
157 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
159 if (0 && $page->isUserPage($include_empty=true)) {
160 $pagetype []= _("User page");
162 if (isActionPage($page->getName())) {
163 $pagetype []= _("Action page");
165 if ($page->get('pagetype') == 'wikiblog') {
166 $pagetype []= _("Blog page");
168 if ($page->getName() == _("InterWikiMap")) {
169 $pagetype []= _("InterWikiMap");
171 if (0 and isSubPage($page->getName())) {
172 $pagetype []= _("Subpage");
175 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
177 <td align="right" class="pageinfo"><?php echo _("Page Type:")?></td>
178 <td align="left"><?php echo $pagetype?></td>
184 <div id="actionbuttons">
185 <?php echo Button("viewsource", _("View Source")) ?>
186 <?php echo $SEP?><?php echo Button("PageHistory", _("PageHistory")) ?>
187 <?php echo $SEP?><?php echo Button("AuthorHistory", _("AuthorHistory")) ?>
188 <?php echo $SEP?><?php echo Button("Diff") ?>
189 <?php echo $SEP?><?php echo Button(array('action'=>'diff','previous' => 'minor'),_("Diff previous Revision"),$page->getName()) ?>
190 <?php echo $SEP?><?php echo Button(array('action'=>'diff','previous' => 'author'),_("Diff previous Author"),$page->getName()) ?>
191 <?php if ((defined('DEBUG') && DEBUG) || $user->isAdmin()) { ?>
192 <!-- Buttons really only for debugging -->
193 <?php echo $SEP?><?php echo Button("DebugInfo", _("DebugInfo")) ?>
195 $PurgeCache = Button(array('nocache' => 'purge'),
196 _("PurgeHtmlCache"), $page->getName());
197 $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
199 <?php echo $SEP?><?php echo $PurgeCache ?>
201 <!-- End debugging buttons -->