]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - themes/MonoBook/themeinfo.php
update comment: buttons and comment is solved
[SourceForge/phpwiki.git] / themes / MonoBook / themeinfo.php
1 <?php
2 rcs_id('$Id: themeinfo.php,v 1.7 2006-12-06 22:10:15 rurban Exp $');
3 /**
4  * The new mediawiki (Wikipedia.org) default style.
5  * Mediawiki 'monobook' style sheet for CSS2-capable browsers.
6  * Copyright Gabriel Wicke - http://www.aulinx.de/
7  * See main.css for more.
8  *
9  * Problems with IE: signin is at the left.
10  *
11  * We don't (yet) support all mediawiki UI options, but we try to.
12  * Besides that, maybe the mediawiki folks will see how much better phpwiki 
13  * will scale, esp. with a true database, not just mysql.
14  * Technically phpwiki has about 2-3 years advantage and our plugins 
15  * cannot destroy the layout.
16  * Anyway, the WikiParser perl module (and our php version) will be able to import
17  * and convert back and forth.
18  */
19 require_once('lib/Theme.php');
20 if (!defined("ENABLE_MARKUP_TEMPLATE"))
21     define("ENABLE_MARKUP_TEMPLATE", true);
22
23 function ActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
24     global $WikiTheme;
25     global $request;
26     if (is_array($action)) {
27         $attr = $action;
28         $act = isset($attr['action']) ? $attr['action'] : 'browse';
29     } else 
30         $act = $action;
31     $class = is_safe_action($act) ? 'named-wiki' : 'wikiadmin';
32     /* if selected action is current then prepend selected */
33     $curract = $request->getArg("action");
34     if ($curract == $act and $curract != 'browse')
35         $class = "selected $class";
36     if (!empty($options['class'])) {
37         if ($curract == 'browse')
38             $class = "$class ".$options['class'];
39         else
40             $class = $options['class'];
41     }
42     return HTML::li(array('class' => $class), 
43                     $WikiTheme->makeActionButton($action, $label, $page_or_rev, $options));
44 }
45
46 class Theme_MonoBook extends Theme {
47
48     function makeActionButton ($action, $label = false, $page_or_rev = false, $options = false) {
49         extract($this->_get_name_and_rev($page_or_rev));
50
51         if (is_array($action)) {
52             $attr = $action;
53             $action = isset($attr['action']) ? $attr['action'] : 'browse';
54         }
55         else
56             $attr['action'] = $action;
57
58         $class = is_safe_action($action) ? /*'named-wiki'*/'new' : 'wikiadmin';
59         /* if selected action is current then prepend selected */
60         global $request;
61         if ($request->getArg("action") == $action)
62             $class = "selected $class";
63             //$class = "selected";
64         if (!empty($options['class']))
65             $class = $options['class'];
66         if (!$label)
67             $label = $this->_labelForAction($action);
68
69         if ($version)
70             $attr['version'] = $version;
71
72         if ($action == 'browse')
73             unset($attr['action']);
74
75         return $this->makeButton($label, WikiURL($pagename, $attr), $class);
76     }
77 }
78
79 $WikiTheme = new Theme_MonoBook('MonoBook');
80 $WikiTheme->addMoreHeaders(JavaScript('',array('src' => $WikiTheme->_findData("wikibits.js"))));
81 if (isBrowserIE()) {
82     $WikiTheme->addMoreHeaders($WikiTheme->_CSSlink(0,
83         $WikiTheme->_findFile('IEFixes.css'),'all'));
84     $WikiTheme->addMoreHeaders("\n");
85     $WikiTheme->addMoreHeaders(JavaScript('',array('src' => $WikiTheme->_findData("IEFixes.js"))));
86     $WikiTheme->addMoreHeaders("\n");
87     $WikiTheme->addMoreHeaders(HTML::Raw('<meta http-equiv="imagetoolbar" content="no" />'));
88 }
89 $WikiTheme->addMoreAttr('body', "class-ns-0", HTML::Raw('class="ns-0"'));
90
91 // CSS file defines fonts, colors and background images for this
92 // style.  The companion '*-heavy.css' file isn't defined, it's just
93 // expected to be in the same directory that the base style is in.
94
95 // This should result in phpwiki-printer.css being used when
96 // printing or print-previewing with style "PhpWiki" or "MacOSX" selected.
97 $WikiTheme->setDefaultCSS('PhpWiki',
98                        array(''      => 'monobook.css',
99                              'print' => 'commonPrint.css'));
100
101 // This allows one to manually select "Printer" style (when browsing page)
102 // to see what the printer style looks like.
103 $WikiTheme->addAlternateCSS(_("Printer"), 'commonPrint.css', 'print, screen');
104 $WikiTheme->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
105 $WikiTheme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
106
107 /**
108  * The logo image appears on every page and links to the HomePage.
109  */
110 $WikiTheme->addImageAlias('logo', 'MonoBook-Logo.png');
111 //$WikiTheme->addImageAlias('logo', WIKI_NAME . 'Logo.png');
112
113 /**
114  * The Signature image is shown after saving an edited page. If this
115  * is set to false then the "Thank you for editing..." screen will
116  * be omitted.
117  */
118
119 $WikiTheme->addImageAlias('signature', "Signature.png");
120 // Uncomment this next line to disable the signature.
121 $WikiTheme->addImageAlias('signature', false);
122
123 /*
124  * Link icons.
125  */
126 /*
127 $WikiTheme->setLinkIcon('http');
128 $WikiTheme->setLinkIcon('https');
129 $WikiTheme->setLinkIcon('ftp');
130 $WikiTheme->setLinkIcon('mailto');
131 //$WikiTheme->setLinkIcon('interwiki');
132 */
133 $WikiTheme->setLinkIcon('wikiuser');
134 //$WikiTheme->setLinkIcon('*', 'url');
135 // front or after
136 //$WikiTheme->setLinkIconAttr('after');
137
138 //$WikiTheme->setButtonSeparator("\n | ");
139
140 /**
141  * WikiWords can automatically be split by inserting spaces between
142  * the words. The default is to leave WordsSmashedTogetherLikeSo.
143  */
144 //$WikiTheme->setAutosplitWikiWords(false);
145
146 /**
147  * Layout improvement with dangling links for mostly closed wiki's:
148  * If false, only users with edit permissions will be presented the 
149  * special wikiunknown class with "?" and Tooltip.
150  * If true (default), any user will see the ?, but will be presented 
151  * the PrintLoginForm on a click.
152  */
153 $WikiTheme->setAnonEditUnknownLinks(false);
154
155 /*
156  * You may adjust the formats used for formatting dates and times
157  * below.  (These examples give the default formats.)
158  * Formats are given as format strings to PHP strftime() function See
159  * http://www.php.net/manual/en/function.strftime.php for details.
160  * Do not include the server's zone (%Z), times are converted to the
161  * user's time zone.
162  */
163 $WikiTheme->setDateFormat("%B %d, %Y");
164 $WikiTheme->setTimeFormat("%H:%M");
165
166 /*
167  * To suppress times in the "Last edited on" messages, give a
168  * give a second argument of false:
169  */
170 //$WikiTheme->setDateFormat("%B %d, %Y", false); 
171
172 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
173 // (c-file-style: "gnu")
174 // Local Variables:
175 // mode: php
176 // tab-width: 8
177 // c-basic-offset: 4
178 // c-hanging-comment-ender-p: nil
179 // indent-tabs-mode: nil
180 // End:   
181 ?>