]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/default/templates/info.tmpl
Remove rcs_id
[SourceForge/phpwiki.git] / themes / default / templates / info.tmpl
1 <?php // -*-php-*-
2 // $Id$
3 ?>
4 <?php
5 if (empty($revision)) $revision = $page->getCurrentRevision(false);
6 $modifed = $WikiTheme->formatDateTime($revision->get('mtime'));
7
8 $dbi = $request->getDbh();
9 $author = $revision->get('author');
10 $authorLink = $author;
11 if ($dbi->isWikiPage($author))
12     $authorLink = WikiLink($author);
13
14 $authorId = $revision->get('author_id');
15 $version = $revision->getVersion();
16 $hits = $page->get('hits');
17
18 $is_minor_edit = $revision->get('is_minor_edit') ? _("minor edit") : false;
19 if ($minor_flag = $is_minor_edit) {
20     $minor_flag = HTML(" ",
21                        HTML::span(array('class' => 'pageinfo-minoredit'),
22                                   "(" . _("minor edit") . ")"));
23 }
24
25 /* better way to do this? */
26 $bytes = strlen($revision->_data['%content']);
27 $size = ByteFormatter($bytes, /* $longformat = */true);
28 // Count words
29 preg_match_all('/\\w+\\W*/', $revision->_data['%content'], $whitespacematches);
30 if (1 == ($c = count_all($whitespacematches)))
31   $wordcount = fmt("1 word");
32 else
33   $wordcount = fmt("%s words", $c);
34
35
36 $markupVersion = ($markupVersion = $revision->get('markup'))
37                ? fmt("Version %s", $markupVersion)
38                : _("Original (1.2 or 1.0)");
39
40 $summary = $revision->get('summary');
41
42 if ($is_current = $revision->isCurrent()) {
43
44     $LOCKED_CB = HTML::input(array('type' => 'checkbox',
45                                    'name' => 'edit[locked]',
46                                    'disabled' => !$user->isadmin(),
47                                    'checked'  => $page->get('locked')));
48
49     // Not sure if I want to keep this... --Carsten
50     if ($user->isAdmin()) {
51         $lockunlock = $page->get('locked') ? 'unlock' : 'lock';
52         $clickcheckbUrl = WikiURL($revision, array('action' => $lockunlock));
53         $clickcheckb = "location.href='$clickcheckbUrl'";
54         $LOCKED_CB->setAttr('onclick', $clickcheckb);
55     }
56
57     $label['date'] = _("Last Modified").':';
58     $label['author'] = _("Last Author").':';
59     $label['summary'] = _("Last Summary").':';
60
61 } else {
62     $label['date'] = _("Saved on:");
63     $label['author'] = _("Author").':';
64     $label['summary'] = _("Summary").':';
65 }
66
67 $tableSummary = fmt("Statistics about %s.", $page->getName());
68 $Sep = $WikiTheme->getButtonSeparator();
69
70 $perm_tree = pagePermissions($page->getName());
71 list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
72 if ($type == 'inherited') {
73     $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
74 } elseif ($type == 'page') {
75     $type = _("individual page permission");
76 } elseif ($type == 'default') {
77     $type = _("default page permission");
78 }
79 ?>
80
81 <!-- FIXME: move table formatting to css -->
82 <table summary="<?php echo $tableSummary ?>" class="pageinfo"
83        border="0" cellspacing="0" cellpadding="3">
84
85 <?php if (!$is_current) { ?>
86   <tr>
87     <td align="right" class="pageinfo"><?php echo _("Supplanted on:")?></td>
88     <td><?php echo $WikiTheme->formatDateTime($revision->get('_supplanted')) ?></td>
89   </tr>
90 <?php } ?>
91
92   <tr>
93     <td align="right" nowrap="nowrap" class="pageinfo"><?php echo $label['date'] ?></td>
94     <td><?php echo $modifed ?><?php echo $minor_flag ?></td>
95   </tr>
96   <tr>
97     <td align="right" class="pageinfo"><?php echo $label['author'] ?></td>
98     <td><?php echo $authorLink ?>
99 <?php if (! ($author == $authorId)) { 
100     if ($dbi->isWikiPage($authorId)) $authorId = WikiLink($authorId); ?>
101         <span class="pageinfo-authorid">(<?php echo $authorId ?>)</span>
102       <?php } ?></td>
103   </tr>
104   <tr>
105     <td align="right" class="pageinfo"><?php echo _("Page Version:")?></td>
106     <td><?php echo $version ?></td>
107   </tr>
108   <tr>
109     <td align="right" class="pageinfo"><?php echo _("Markup:")?></td>
110     <td><?php echo $markupVersion ?></td>
111   </tr>
112   <tr>
113     <td align="right" class="pageinfo"><?php echo _("Size:")?></td>
114     <td><?php echo $wordcount ?>, <?php echo $size ?></td>
115   </tr>
116 <?php if ($is_current) { ?>
117   <tr>
118     <td align="right" class="pageinfo"><?php echo _("Hits:") ?></td>
119     <td><?php echo $hits ?></td>
120   </tr>
121 <?php } ?>
122   <tr>
123     <td align="right" nowrap="nowrap" valign="top" class="pageinfo"><?php echo $label['summary'] ?></td>
124     <td><?php echo $summary ?></td>
125   </tr>
126 <?php if ($is_current) { ?>
127   <tr>
128     <td align="right"><?php echo $LOCKED_CB ?></td>
129     <td class="pageinfo"><?php echo _("Locked")?></td>
130   </tr>
131 <?php if (ENABLE_EXTERNAL_PAGES) { ?>
132   <tr>
133     <td align="right" class="pageinfo"><?php echo _("Is External:") ?></td>
134     <td><?php echo $page->get('external') ? _("Yes") : _("No") ?></td>
135   </tr>
136 <?php } ?>
137   <tr>
138     <td align="right" class="pageinfo"><?php echo _("ACL type:") ?></td>
139     <td><?php echo $type ?></td>
140   </tr>
141   <tr>
142     <td align="right" valign="top" class="pageinfo"><?php echo _("ACL:") ?></td>
143     <td><?php echo $perm->asAclLines() ?></td>
144   </tr>
145 <?php } ?>
146
147 <?php // determine page type
148 if (HOME_PAGE == $page->getName()) {
149     $pagetype []= sprintf('%s %s', WIKI_NAME, _("home page"));
150 }
151 if ($page->isUserPage($include_empty=true)) {
152     $pagetype []= _("User page");
153 }
154 if (isActionPage($page->getName())) {
155     $pagetype []= _("Action page");
156 }
157 if ($page->get('pagetype') == 'wikiblog') {
158     $pagetype []= _("Blog page");
159 }
160 if ($page->getName() == _("InterWikiMap")) {
161     $pagetype []= _("InterWikiMap");
162 }
163 if (isSubPage($page->getName())) {
164     $pagetype []= _("Subpage");
165 } ?>
166
167 <?php if (!empty($pagetype)) { $pagetype = implode(", ", $pagetype); ?>
168   <tr>
169     <td align="right" class="pageinfo"><?php echo _("Page Type:")?></td>
170     <td align="left"><?php echo $pagetype?></td>
171   </tr>
172 <?php } ?>
173
174 </table>