]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/smaller/themeinfo.php
Remove $Id$
[SourceForge/phpwiki.git] / themes / smaller / themeinfo.php
1 <?php
2 // Avoid direct call to this file.
3 // PHPWIKI_VERSION is defined in lib/prepend.php
4 if (!defined('PHPWIKI_VERSION')) {
5     header("Location: /");
6     exit;
7 }
8
9 /**
10  * tiny actionbar, only Edit (if signed in) and Info => PageInfo,
11  *   all other Actionbars buttons in info.tmpl
12  * old-style Sign In button
13  * navbar also shorter labels and without buttons, just links
14  */
15
16 require_once 'lib/WikiTheme.php';
17
18 class WikiTheme_smaller extends WikiTheme {
19
20     function makeActionButton ($action, $label = false, $page_or_rev = false) {
21         extract($this->_get_name_and_rev($page_or_rev));
22
23         if (is_array($action)) {
24             $attr = $action;
25             $action = isset($attr['action']) ? $attr['action'] : 'browse';
26         }
27         else
28             $attr['action'] = $action;
29
30         $class = is_safe_action($action) ? 'named-wiki' : 'wikiadmin';
31         if (!$label)
32             $label = $this->_labelForAction($action);
33
34         if ($version)
35             $attr['version'] = $version;
36
37         if ($action == 'browse')
38             unset($attr['action']);
39
40         return $this->makeButton($label, WikiURL($pagename, $attr), $class);
41     }
42 }
43
44 $WikiTheme = new WikiTheme_smaller('smaller');
45
46 // Local Variables:
47 // mode: php
48 // tab-width: 8
49 // c-basic-offset: 4
50 // c-hanging-comment-ender-p: nil
51 // indent-tabs-mode: nil
52 // End: