]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/info.tmpl
add WikiLink for author name
[SourceForge/phpwiki.git] / themes / default / templates / info.tmpl
1 <?php // -*-html-*- ?>
2 <!-- $Id: info.tmpl,v 1.4 2002-02-16 23:38:13 carstenklapp Exp $ -->
3 <?php
4
5 $modifed = $Theme->formatDateTime($revision->get('mtime'));
6
7 $author = $revision->get('author');
8 global $WikiNameRegexp;
9 $dbi = $request->getDbh();
10 if (preg_match("/^$WikiNameRegexp\$/", $author) && $dbi->isWikiPage($author))
11     $author = WikiLink($author);
12
13 $authorId = $revision->get('author_id');
14 $version = $revision->getVersion();
15 $hits = $page->get('hits');
16
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") . ")"));
22 }
23
24 /* better way to do this? */
25 $data = &$revision->_data;
26 $bytes = strlen(&$data['%content']);
27 if ($bytes < 1024 )
28     $size = fmt("%s bytes", $bytes);
29 else {
30     $kb = round($bytes / 1024, 1);
31     $size = fmt("%s Kb (%s bytes)", $kb, $bytes);
32 }
33
34 $markupVersion = ($markupVersion = $revision->get('markup'))
35                ? fmt("Version %s", $markupVersion)
36                : _("Original (1.2 or 1.0)");
37
38 $summary = HTML::textarea(array('name' => 'summary',
39                                 'class' => 'summary',
40                                 /* use fixed dimensions? */
41                                 'rows' => $request->getPref('editHeight')/4,
42                                 'cols' => $request->getPref('editWidth')/2,
43                                 'readonly' => 'readonly',
44                                 'wrap' => 'virtual'), /* for Netscape 4 */
45                           $revision->get('summary'));
46
47 if ($is_current = $revision->isCurrent()) {
48
49     $LOCKED_CB = HTML::input(array('type' => 'checkbox',
50                                    'name' => 'edit[locked]',
51                                    'disabled' => !$user->isadmin(),
52                                    'checked'  => $page->get('locked')));
53
54     $label['date'] = _("Last Modified:");
55     $label['author'] = _("Last Author:");
56     $label['summary'] = _("Last Summary:");
57
58 } else {
59     $label['date'] = _("Saved on:");
60     $label['author'] = _("Author:");
61     $label['summary'] = _("Summary:");
62 }
63
64 $tableSummary = fmt("Statistics about %s.", $page->getName());
65
66 ?>
67
68 <!-- FIXME: move table formatting to css -->
69 <table summary="<?= $tableSummary ?>" class="pageinfo"
70        border="0" cellspacing="0" cellpadding="3">
71
72 <?php if (!$is_current) { ?>
73   <tr>
74     <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
75     <td><?= $Theme->formatDateTime($revision->get('_supplanted')) ?></td>
76   </tr>
77 <?php } ?>
78
79   <tr>
80     <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
81     <td><?= $modifed ?><?= $minor_flag ?></td>
82   </tr><tr>
83     <td align="right" class="pageinfo"><?= $label['author'] ?></td>
84     <td><?= $author ?> <span class="pageinfo-authorid">(<?= $authorId ?>)</span></td>
85   </tr><tr>
86     <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
87     <td><?= $version ?></td>
88   </tr><tr>
89     <td align="right" class="pageinfo"><?=_("Markup:")?></td>
90     <td><?= $markupVersion ?></td>
91   </tr><tr>
92     <td align="right" class="pageinfo"><?=_("Size:")?></td>
93     <td><?= $size ?></td>
94
95 <?php if ($is_current) { ?>
96   </tr><tr>
97     <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
98     <td><?= $hits ?></td>
99 <?php } ?>
100
101   </tr><tr>
102     <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
103     <td><?= $summary ?></td>
104
105 <?php if ($is_current) { ?>
106   </tr><tr>
107     <td align="right"><?= $LOCKED_CB ?></td>
108     <td class="pageinfo"><?=_("Locked")?></td>
109 <?php } ?>
110
111   </tr>
112 </table>