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