]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/info.tmpl
Activated Id substitution for Subversion
[SourceForge/phpwiki.git] / themes / default / templates / info.tmpl
1 <?php // -*-php-*- ?>
2 <!-- $Id$ -->
3 <?php
4 if (empty($revision)) $revision = $page->getCurrentRevision(false);
5 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
6
7 $dbi = $request->getDbh();
8 $author = $revision->get('author');
9 $authorLink = $author;
10 if ($dbi->isWikiPage($author))
11     $authorLink = 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 $bytes = strlen($revision->_data['%content']);
26 $size = ByteFormatter($bytes, /* $longformat = */true);
27 // Count words
28 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
29 if (1 == ($c = count_all($whitespacematches)))
30   $wordcount = fmt("1 word");
31 else
32   $wordcount = fmt("%s words", $c);
33
34
35 $markupVersion = ($markupVersion = $revision->get('markup'))
36                ? fmt("Version %s", $markupVersion)
37                : _("Original (1.2 or 1.0)");
38
39 $summary = HTML::textarea(array('name' => 'summary',
40                                 'class' => 'summary',
41                                 'rows' => 3,
42                                 'cols' => intval($request->getPref('editWidth')/2),
43                                 'readonly' => 'readonly'
44                                 ),
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     // 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'";
59
60         $LOCKED_CB->setAttr('onclick', $clickcheckb);
61     }
62
63     $label['date'] = _("Last Modified").':';
64     $label['author'] = _("Last Author").':';
65     $label['summary'] = _("Last Summary").':';
66
67 } else {
68     $label['date'] = _("Saved on:");
69     $label['author'] = _("Author").':';
70     $label['summary'] = _("Summary").':';
71 }
72
73 $tableSummary = fmt("Statistics about %s.", $page->getName());
74 $Sep = $WikiTheme->getButtonSeparator();
75
76 ?>
77
78 <!-- FIXME: move table formatting to css -->
79 <table summary="<?= $tableSummary ?>" class="pageinfo"
80        border="0" cellspacing="0" cellpadding="3">
81
82 <?php if (!$is_current) { ?>
83   <tr>
84     <td align="right" class="pageinfo"><?=_("Supplanted on:")?></td>
85     <td><?= $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
86   </tr>
87 <?php } ?>
88
89   <tr>
90     <td align="right" nowrap="nowrap" class="pageinfo"><?= $label['date'] ?></td>
91     <td><?= $modifed ?><?= $minor_flag ?></td>
92   </tr>
93   <tr>
94     <td align="right" class="pageinfo"><?= $label['author'] ?></td>
95     <td><?= $authorLink ?>
96 <?php if (! ($author == $authorId)) { 
97     if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
98         <span class="pageinfo-authorid">(<?= $authorId ?>)</span>
99       <?php } ?></td>
100   </tr>
101   <tr>
102     <td align="right" class="pageinfo"><?=_("Page Version:")?></td>
103     <td><?= $version ?></td>
104   </tr>
105   <tr>
106     <td align="right" class="pageinfo"><?=_("Markup:")?></td>
107     <td><?= $markupVersion ?></td>
108   </tr>
109   <tr>
110     <td align="right" class="pageinfo"><?=_("Size:")?></td>
111     <td><?= $wordcount ?>, <?= $size ?></td>
112   </tr>
113 <?php if ($is_current) { ?>
114   <tr>
115     <td align="right" class="pageinfo"><?= _("Hits:") ?></td>
116     <td><?= $hits ?></td>
117   </tr>
118 <?php } ?>
119   <tr>
120     <td align="right" valign="top" class="pageinfo"><?= $label['summary'] ?></td>
121     <td><?= $summary ?></td>
122   </tr>
123 <?php if ($is_current) { ?>
124   <tr>
125     <td align="right"><?= $LOCKED_CB ?></td>
126     <td class="pageinfo"><?=_("Locked")?></td>
127   </tr>
128 <?php } ?>
129
130 <?php // determine page type
131 if (HOME_PAGE == $page->getName()) {
132     $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
133 }
134 if ($page->isUserPage($include_empty=true)) {
135     $pagetype []= _("User page");
136 }
137 if (@$request->isActionPage($page->getName())) {
138     $pagetype []= _("Action page");
139 }
140 if ($page->get('pagetype') == 'wikiblog') {
141     $pagetype []= _("Blog page");
142 }
143 if ($page->getName() == _("InterWikiMap")) {
144     $pagetype []= _("InterWikiMap");
145 }
146 if (isSubPage($page->getName())) {
147     $pagetype []= _("Subpage");
148 } ?>
149
150 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
151   <tr>
152     <td align="right" class="pageinfo"><?=_("Page Type:")?></td>
153     <td align="left"><?=$pagetype?></td>
154   </tr>
155 <?php } ?>
156
157 </table>
158
159 <?php
160 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -                         
161 // $Log: not supported by cvs2svn $
162 // Revision 1.19  2007/01/02 13:30:36  rurban
163 // bring in revision, use fixed summary height
164 //
165 // Revision 1.18  2005/02/02 19:02:10  rurban
166 // link author
167 //
168 // Revision 1.17  2004/06/14 11:26:52  rurban
169 // renamed global $Theme to $WikiTheme (gforge nameclash)
170 //
171 // Revision 1.16  2004/05/18 14:47:21  rurban
172 // Simplified strings for easier translation
173 //
174 // Revision 1.15  2003/12/11 19:38:29  carstenklapp
175 // Internal change: Fix PHP Warning: Call-time pass-by-reference has been deprecated
176 //
177 // Revision 1.14  2003/11/29 20:13:38  carstenklapp
178 // Internal change: Refactored ByteFormatter code into a new function in
179 // stdlib (now used by PageList too).
180 //
181 // Revision 1.13  2003/02/21 04:24:48  dairiki
182 // Fix <td> </td> nesting. (Was generating invalid HTML.)
183 //
184 // Revision 1.12  2003/01/11 22:54:28  carstenklapp
185 // Added Page type field displayed for special pages.
186 //
187 ?>