getCurrentRevision(false); $modifed = $WikiTheme->formatDateTime($revision->get('mtime')); $author = $revision->get('author'); global $WikiNameRegexp; $dbi = $request->getDbh(); $author = $revision->get('author'); $authorLink = $author; if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author)) $authorLink = WikiLink($author); $authorId = $revision->get('author_id'); $version = $revision->getVersion(); $hits = $page->get('hits'); $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false; if ($minor_flag = $is_minor_edit) { $minor_flag = HTML(" ", HTML::span(array('class' => 'pageinfo-minoredit'), "(" . _("minor edit") . ")")); } /* better way to do this? */ $bytes = strlen($revision->_data['%content']); if ($bytes < 1024 ) $size = fmt("%s bytes", $bytes); else { $kb = round($bytes / 1024, 1); $size = fmt("%s Kb (%s bytes)", $kb, $bytes); } // Count words preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches); if (1 == $c = count_all($whitespacematches)) $wordcount = fmt("1 word"); else $wordcount = fmt("%s words", $c); $markupVersion = ($markupVersion = $revision->get('markup')) ? fmt("Version %s", $markupVersion) : _("Original (1.2 or 1.0)"); $summary = HTML::textarea(array('name' => 'summary', 'class' => 'summary', /* use fixed dimensions? */ 'rows' => intval($request->getPref('editHeight')/4), 'cols' => intval($request->getPref('editWidth')/2), 'readonly' => 'readonly', ), $revision->get('summary')); if ($is_current = $revision->isCurrent()) { $LOCKED_CB = HTML::input(array('type' => 'checkbox', 'name' => 'edit[locked]', 'disabled' => !$user->isadmin(), 'checked' => $page->get('locked'))); // Not sure if I want to keep this... --Carsten if ($user->isadmin()) { $lockunlock = $page->get('locked') ? 'unlock' : 'lock'; $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock)); $clickcheckb = "location.href='$clickcheckbUrl'"; $LOCKED_CB->setAttr('onclick', $clickcheckb); } $label['date'] = _("Last Modified").':'; $label['author'] = _("Last Author").':'; $label['summary'] = _("Last Summary").':'; } else { $label['date'] = _("Saved on:"); $label['author'] = _("Author").':'; $label['summary'] = _("Summary").':'; } $tableSummary = fmt("Statistics about %s.", $page->getName()); $perm_tree = pagePermissions($page->getName()); list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree); if ($type == 'inherited') { $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]); } elseif ($type == 'page') { $type = _("individual page permission"); } elseif ($type == 'default') { $type = _("default page permission"); } ?>
=_("Supplanted on:")?> | = $WikiTheme->formatDateTime($revision->get('_supplanted')) ?> |
= $label['date'] ?> | = $modifed ?>= $minor_flag ?> |
= $label['author'] ?> | = $authorLink ?> |
=_("Page Version:")?> | = $version ?> |
=_("Markup:")?> | = $markupVersion ?> |
=_("Size:")?> | = $wordcount ?>, = $size ?> |
= _("Hits:") ?> | = $hits ?> |
= $label['summary'] ?> | = $summary ?> |
= $LOCKED_CB ?> | =_("Locked")?> |
ACL type | = $type ?> |
ACL | = $perm->asAclGroupLines() ?> |
=_("Page Type:")?> | =$pagetype?> |