2 <!-- $Id: info.tmpl,v 1.1 2004-12-19 17:34:19 rurban Exp $ -->
5 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
7 $author = $revision->get('author');
8 global $WikiNameRegexp;
9 $dbi = $request->getDbh();
10 $author = $revision->get('author');
11 $authorLink = $author;
12 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
13 $authorLink = WikiLink($author);
15 $authorId = $revision->get('author_id');
16 $version = $revision->getVersion();
17 $hits = $page->get('hits');
19 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
20 if ($minor_flag = $is_minor_edit) {
21 $minor_flag = HTML(" ",
22 HTML::span(array('class' => 'pageinfo-minoredit'),
23 "(" . _("minor edit") . ")"));
26 /* better way to do this? */
27 $bytes = strlen($revision->_data['%content']);
29 $size = fmt("%s bytes", $bytes);
31 $kb = round($bytes / 1024, 1);
32 $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
35 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
36 if (1 == $c = count_all($whitespacematches))
37 $wordcount = fmt("1 word");
39 $wordcount = fmt("%s words", $c);
42 $markupVersion = ($markupVersion = $revision->get('markup'))
43 ? fmt("Version %s", $markupVersion)
44 : _("Original (1.2 or 1.0)");
46 $summary = HTML::textarea(array('name' => 'summary',
49 'cols' => $request->getPref('editWidth')/2,
50 'readonly' => 'readonly',
51 'wrap' => 'virtual'), /* for Netscape 4 */
52 $revision->get('summary'));
54 if ($is_current = $revision->isCurrent()) {
56 $LOCKED_CB = HTML::input(array('type' => 'checkbox',
57 'name' => 'edit[locked]',
58 'disabled' => !$user->isadmin(),
59 'checked' => $page->get('locked')));
61 // Not sure if I want to keep this... --Carsten
62 if ($user->isadmin()) {
63 $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
64 $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
65 $clickcheckb = "location.href='$clickcheckbUrl'";
67 $LOCKED_CB->setAttr('onclick', $clickcheckb);
70 $label['date'] = _("Last Modified").':';
71 $label['author'] = _("Last Author").':';
72 $label['summary'] = _("Last Summary").':';
75 $label['date'] = _("Saved on:");
76 $label['author'] = _("Author").':';
77 $label['summary'] = _("Summary").':';
80 $tableSummary = fmt("Statistics about %s.", $page->getName());
81 $Sep = $WikiTheme->getButtonSeparator();
85 <!-- FIXME: move table formatting to css -->
86 <table summary="<?= $tableSummary ?>" class="pageinfo"
87 border="0" cellspacing="0" cellpadding="3">
89 <?php if (!$is_current) { ?>
91 <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
92 <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
97 <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
98 <td><?= $modifed ?><?= $minor_flag ?></td>
101 <td align="right" class="pageinfo"><?= $label['author'] ?></td>
102 <td><?= $authorLink ?>
103 <?php if (! ($author == $authorId)) { ?>
104 <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
108 <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
109 <td><?= $version ?></td>
112 <td align="right" class="pageinfo"><?=_("Markup:")?></td>
113 <td><?= $markupVersion ?></td>
116 <td align="right" class="pageinfo"><?=_("Size:")?></td>
117 <td><?= $wordcount ?>, <?= $size ?></td>
119 <?php if ($is_current) { ?>
121 <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
122 <td><?= $hits ?></td>
126 <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
127 <td><?= $summary ?></td>
129 <?php if ($is_current) { ?>
131 <td align="right"><?= $LOCKED_CB ?></td>
132 <td class="pageinfo"><?=_("Locked")?></td>
136 <?php // determine page type
137 if (HOME_PAGE == $page->getName()) {
138 $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
140 if (0 && $page->isUserPage($include_empty=true)) {
141 $pagetype []= _("User page");
143 if (@$request->isActionPage($page->getName())) {
144 $pagetype []= _("Action page");
146 if ($page->get('pagetype') == 'wikiblog') {
147 $pagetype []= _("Blog page");
149 if ($page->getName() == _("InterWikiMap")) {
150 $pagetype []= _("InterWikiMap");
152 if (0 and isSubPage($page->getName())) {
153 $pagetype []= _("Subpage");
156 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
158 <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
159 <td align="left"><?=$pagetype?></td>
163 <div id="actionbuttons">
164 <?= Button("edit", $revision->isCurrent() ? _("Edit") : _("Edit Old Revision")) ?>
165 <?=$Sep?><?= Button("viewsource", _("View Source")) ?>
166 <?=$Sep?><?= Button("PageHistory", _("PageHistory")) ?>
167 <?=$Sep?><?= Button("AuthorHistory", _("AuthorHistory")) ?>
168 <?=$Sep?><?= Button(_("PageDump")) ?>
169 <?=$Sep?><?= Button("Diff") ?>
170 <?=$Sep?><?= Button(array('action'=>'diff','previous' => 'minor'),_("Diff previous Revision"),$page->getName()) ?>
171 <?=$Sep?><?= Button(array('action'=>'diff','previous' => 'author'),_("Diff previous Author"),$page->getName()) ?>
172 <?php if ((defined('DEBUG') && DEBUG) || $user->isAdmin()) { ?>
173 <!-- Buttons really only for debugging -->
174 <?=$Sep?><?= Button("DebugInfo", _("DebugInfo")) ?>
176 $PurgeCache = Button(array('nocache' => 'purge'),
177 _("PurgeHtmlCache"), $page->getName());
178 $PurgeCache->addTooltip(_("Purge HTML cache for this page. Regenerate from WikiMarkup when next accessed."));
180 <?=$Sep?><?= $PurgeCache ?>
181 <!-- End debugging buttons -->
186 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
187 // $Log: not supported by cvs2svn $
188 // Revision 1.3 2004/06/14 11:26:53 rurban
189 // renamed global $Theme to $WikiTheme (gforge nameclash)
191 // Revision 1.2 2004/05/18 14:47:21 rurban
192 // Simplified strings for easier translation
194 // Revision 1.1 2004/03/01 09:38:01 rurban
195 // Theme with less buttons and shorter descriptions:
196 // More behind "Info"
198 // Revision 1.15 2003/12/11 19:38:29 carstenklapp
199 // Internal change: Fix PHP Warning: Call-time pass-by-reference has been deprecated
201 // Revision 1.14 2003/11/29 20:13:38 carstenklapp
202 // Internal change: Refactored ByteFormatter code into a new function in
203 // stdlib (now used by PageList too).
205 // Revision 1.13 2003/02/21 04:24:48 dairiki
206 // Fix <td> </td> nesting. (Was generating invalid HTML.)
208 // Revision 1.12 2003/01/11 22:54:28 carstenklapp
209 // Added Page type field displayed for special pages.