PHP 4.1.2 compatibility fixes (based on patch submission by Asheesh Laroia)
[lhc/web/wiklou.git] / includes / SkinPHPTal.php
1 <?php
2 # Generic PHPTal (http://phptal.sourceforge.net/) skin
3 # Based on Brion's smarty skin
4 # Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
5 #
6 # Todo: Needs some serious refactoring into functions that correspond
7 # to the computations individual esi snippets need. Most importantly no body
8 # parsing for most of those of course.
9 #
10 # Set this in LocalSettings to enable phptal:
11 # set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
12 # $wgUsePHPTal = true;
13 #
14 # This program is free software; you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation; either version 2 of the License, or
17 # (at your option) any later version.
18 #
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License along
25 # with this program; if not, write to the Free Software Foundation, Inc.,
26 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 # http://www.gnu.org/copyleft/gpl.html
28
29 require_once "GlobalFunctions.php";
30 require_once "PHPTAL.php";
31
32 class MediaWiki_I18N extends PHPTAL_I18N
33 {
34 var $_context = array();
35
36 function set($varName, $value) {
37 $this->_context[$varName] = $value;
38 }
39
40 function translate($value) {
41 $value = wfMsg( $value );
42 // interpolate variables
43 while (preg_match('/\$([0-9]*?)/sm', $value, $m)) {
44 list($src, $var) = $m;
45 $varValue = @$this->_context[$var];
46 $value = str_replace($src, $varValue, $value);
47 }
48 return $value;
49 }
50 }
51
52 class SkinPHPTal extends Skin {
53 var $template;
54
55 function initPage( &$out ) {
56 parent::initPage( $out );
57 $this->skinname = "davinci";
58 $this->template = "xhtml_slim";
59 }
60
61 function outputPage( &$out ) {
62 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
63 global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
64 global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
65 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
66
67 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
68
69 $this->initPage( $out );
70 $tpl = new PHPTAL($this->template . '.pt', 'templates');
71
72 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
73 $tpl->setTranslator(new MediaWiki_I18N());
74 #}
75
76 $this->thispage = $wgTitle->getPrefixedDbKey();
77 $this->thisurl = $wgTitle->getPrefixedURL();
78 $this->loggedin = $wgUser->getID() != 0;
79 $this->iscontent = ($wgTitle->getNamespace() != Namespace::getSpecial() );
80 $this->iseditable = ($this->iscontent and !($action == 'edit' or $action == 'submit'));
81 $this->username = $wgUser->getName();
82 $this->userpage = $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
83 $this->userpageurl = $this->makeUrl($this->userpage);
84
85 if( $this->loggedin ) {
86 $this->usercss = $this->makeUrl($this->userpage.'/'.$this->skinname.'.css', 'action=raw&ctype=text/css');
87 $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript');
88 $this->userjse = htmlspecialchars($this->userjs);
89 } else {
90 $this->usercss = $this->userjs = $this->userjse = false;
91 }
92 $this->titletxt = $wgTitle->getPrefixedText();
93
94 $tpl->set( "title", $wgOut->getPageTitle() );
95 $tpl->set( "pagetitle", $wgOut->getHTMLTitle() );
96
97 $tpl->setRef( "thispage", &$this->thispage );
98 $subpagestr = $this->subPageSubtitle();
99 $tpl->set(
100 "subtitle", !empty($subpagestr)?
101 '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
102 $out->getSubtitle()
103 );
104 $tpl->set( 'catlinks', $this->getCategories());
105 if( $wgOut->isSyndicated() ) {
106 $feeds = array();
107 foreach( $wgFeedClasses as $format => $class ) {
108 $feeds[$format] = array(
109 'text' => $format,
110 'href' => $wgRequest->appendQuery( "feed=$format" ),
111 'ttip' => wfMsg('tooltip-'.$format)
112 );
113 }
114 $tpl->setRef( 'feeds', &$feeds );
115 }
116 $tpl->setRef( 'mimetype', &$wgMimeType );
117 $tpl->setRef( 'charset', &$wgOutputEncoding );
118 $tpl->set( 'headlinks', $out->getHeadLinks() );
119 $tpl->setRef( 'skinname', &$this->skinname );
120 $tpl->setRef( "loggedin", &$this->loggedin );
121 /* XXX currently unused, might get useful later
122 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
123 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
124 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
125 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
126 $tpl->set( "helppage", wfMsg('helppage'));
127 $tpl->set( "sysop", $wgUser->isSysop() );
128 */
129 $tpl->set( "searchaction", $this->escapeSearchLink() );
130 $tpl->setRef( "stylepath", &$wgStylePath );
131 $tpl->setRef( "logopath", &$wgLogo );
132 $tpl->setRef( "lang", &$wgLanguageCode );
133 $tpl->set( "dir", $wgLang->isRTL() ? "rtl" : "ltr" );
134 $tpl->set( "rtl", $wgLang->isRTL() );
135 $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) );
136 $tpl->setRef( "username", &$this->username );
137 $tpl->setRef( "userpage", &$this->userpage);
138 $tpl->setRef( "userpageurl", &$this->userpageurl);
139 $tpl->setRef( "usercss", &$this->usercss);
140 $tpl->setRef( "userjs", &$this->userjs);
141 $tpl->setRef( "userjse", &$this->userjse);
142 if( $wgUser->getNewtalk() ) {
143 $usertitle = Title::newFromText( $this->userpage );
144 $usertalktitle = $usertitle->getTalkPage();
145 if($usertalktitle->getPrefixedDbKey() != $this->thispage){
146
147 $ntl = wfMsg( "newmessages",
148 $this->makeKnownLink(
149 $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) )
150 . ":" . $this->username,
151 wfMsg("newmessageslink") )
152 );
153 }
154 } else {
155 $ntl = "";
156 }
157
158 $tpl->setRef( "newtalk", &$ntl );
159 $tpl->setRef( "skin", &$this);
160 $tpl->set( "logo", $this->logoText() );
161 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
162 if ( !$wgDisableCounters ) {
163 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
164 if ( $viewcount ) {
165 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
166 }
167 }
168 $tpl->set('lastmod', $this->lastModified());
169 $tpl->set('copyright',$this->getCopyright());
170 }
171 $tpl->set( "copyrightico", $this->getCopyrightIcon() );
172 $tpl->set( "poweredbyico", $this->getPoweredBy() );
173 $tpl->set( "disclaimer", $this->disclaimerLink() );
174 $tpl->set( "about", $this->aboutLink() );
175
176 $tpl->setRef( "debug", &$out->mDebugtext );
177 $tpl->set( "reporttime", $out->reportTime() );
178
179 $tpl->setRef( "bodytext", &$out->mBodytext );
180
181 $language_urls = array();
182 foreach( $wgOut->getLanguageLinks() as $l ) {
183 $nt = Title::newFromText( $l );
184 $language_urls[] = array('href' => $nt->getFullURL(),
185 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
186 'class' => $wgLang->isRTL() ? 'rtl' : 'ltr');
187 }
188 if(count($language_urls)) {
189 $tpl->setRef( 'language_urls', &$language_urls);
190 } else {
191 $tpl->set('language_urls', false);
192 }
193 $tpl->set('personal_urls', $this->buildPersonalUrls());
194 $content_actions = $this->buildContentActionUrls();
195 $tpl->setRef('content_actions', &$content_actions);
196 // XXX: attach this from javascript, same with section editing
197 if($this->iseditable && $wgUser->getOption("editondblclick") )
198 {
199 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
200 } else {
201 $tpl->set('body-ondblclick', false);
202 }
203 $tpl->set( "nav_urls", $this->buildNavUrls() );
204
205 // execute template
206 $res = $tpl->execute();
207 // result may be an error
208 if (PEAR::isError($res)) {
209 echo $res->toString(), "\n";
210 } else {
211 echo $res;
212 }
213
214 }
215
216 # build array of urls for personal toolbar
217 function buildPersonalUrls() {
218 /* set up the default links for the personal toolbar */
219 global $wgShowIPinHeader;
220 $personal_urls = array();
221 if ($this->loggedin) {
222 $personal_urls['userpage'] = array(
223 'text' => $this->username,
224 'href' => &$this->userpageurl,
225 'ttip' => wfMsg('tooltip-userpage'),
226 'akey' => wfMsg('accesskey-userpage')
227 );
228 $personal_urls['mytalk'] = array(
229 'text' => wfMsg('mytalk'),
230 'href' => $this->makeTalkUrl($this->userpage),
231 'ttip' => wfMsg('tooltip-mytalk'),
232 'akey' => wfMsg('accesskey-mytalk')
233 );
234 $personal_urls['preferences'] = array(
235 'text' => wfMsg('preferences'),
236 'href' => $this->makeSpecialUrl('Preferences'),
237 'ttip' => wfMsg('tooltip-preferences'),
238 'akey' => wfMsg('accesskey-preferences')
239 );
240 $personal_urls['watchlist'] = array(
241 'text' => wfMsg('watchlist'),
242 'href' => $this->makeSpecialUrl('Watchlist'),
243 'ttip' => wfMsg('tooltip-watchlist'),
244 'akey' => wfMsg('accesskey-watchlist')
245 );
246 $personal_urls['mycontris'] = array(
247 'text' => wfMsg('mycontris'),
248 'href' => $this->makeSpecialUrl('Contributions','target=' . $this->username),
249 'ttip' => wfMsg('tooltip-mycontris'),
250 'akey' => wfMsg('accesskey-mycontris')
251 );
252 $personal_urls['logout'] = array(
253 'text' => wfMsg('userlogout'),
254 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl),
255 'ttip' => wfMsg('tooltip-logout'),
256 'akey' => wfMsg('accesskey-logout')
257 );
258 } else {
259 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
260 $personal_urls['anonuserpage'] = array(
261 'text' => $this->username,
262 'href' => $this->makeUrl($this->userpage),
263 'ttip' => wfMsg('tooltip-anonuserpage'),
264 'akey' => wfMsg('accesskey-anonuserpage')
265 );
266 $personal_urls['anontalk'] = array(
267 'text' => wfMsg('anontalk'),
268 'href' => $this->makeTalkUrl($this->userpage),
269 'ttip' => wfMsg('tooltip-anontalk'),
270 'akey' => wfMsg('accesskey-anontalk')
271 );
272 $personal_urls['anonlogin'] = array(
273 'text' => wfMsg('userlogin'),
274 'href' => $this->makeSpecialUrl('Userlogin', 'returnto='.$this->thisurl),
275 'ttip' => wfMsg('tooltip-login'),
276 'akey' => wfMsg('accesskey-login')
277 );
278 } else {
279
280 $personal_urls['login'] = array(
281 'text' => wfMsg('userlogin'),
282 'href' => $this->makeSpecialUrl('Userlogin', 'returnto='.$this->thisurl),
283 'ttip' => wfMsg('tooltip-login'),
284 'akey' => wfMsg('accesskey-login')
285 );
286 }
287 }
288
289 return $personal_urls;
290 }
291
292 # an array of edit links by default used for the tabs
293 function buildContentActionUrls () {
294 global $wgTitle, $wgUser, $wgRequest;
295 $action = $wgRequest->getText( 'action' );
296 $section = $wgRequest->getText( 'section' );
297 $oldid = $wgRequest->getVal( 'oldid' );
298 $diff = $wgRequest->getVal( 'diff' );
299 $content_actions = array();
300
301 if( $this->iscontent ) {
302
303 $content_actions['article'] = array('class' => (!Namespace::isTalk( $wgTitle->getNamespace())) ? 'selected' : false,
304 'text' => $this->getNameSpaceWord(),
305 'href' => $this->makeArticleUrl($this->thispage),
306 'ttip' => wfMsg('tooltip-article'),
307 'akey' => wfMsg('accesskey-article'));
308
309 /* set up the classes for the talk link */
310 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ? 'selected' : false);
311 $talktitle = Title::newFromText( $this->titletxt );
312 $talktitle = $talktitle->getTalkPage();
313 $this->checkTitle(&$talktitle, &$this->titletxt);
314 if($talktitle->getArticleId() != 0) {
315 $content_actions['talk'] = array(
316 'class' => $talk_class,
317 'text' => wfMsg('talk'),
318 'href' => $this->makeTalkUrl($this->titletxt),
319 'ttip' => wfMsg('tooltip-talk'),
320 'akey' => wfMsg('accesskey-talk')
321 );
322 } else {
323 $content_actions['talk'] = array(
324 'class' => $talk_class?$talk_class.' new':'new',
325 'text' => wfMsg('talk'),
326 'href' => $this->makeTalkUrl($this->titletxt,'action=edit'),
327 'ttip' => wfMsg('tooltip-talk'),
328 'akey' => wfMsg('accesskey-talk')
329 );
330 }
331
332 if ( $wgTitle->userCanEdit() ) {
333 $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : false;
334 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
335 $istalkclass = $istalk?' istalk':'';
336 $content_actions['edit'] = array(
337 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ? 'selected' : '').$istalkclass,
338 'text' => wfMsg('edit'),
339 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid),
340 'ttip' => wfMsg('tooltip-edit'),
341 'akey' => wfMsg('accesskey-edit')
342 );
343 if ( $istalk ) {
344 $content_actions['addsection'] = array(
345 'class' => $section == 'new'?'selected':false,
346 'text' => wfMsg('addsection'),
347 'href' => $this->makeUrl($this->thispage, 'action=edit&section=new'),
348 'ttip' => wfMsg('tooltip-addsection'),
349 'akey' => wfMsg('accesskey-addsection')
350 );
351 }
352 } else {
353 $oid = ( $oldid && ! isset( $diff ) ) ? "&oldid={$oldid}" : '';
354 $content_actions['edit'] = array('class' => ($action == 'edit') ? 'selected' : false,
355 'text' => wfMsg('viewsource'),
356 'href' => $this->makeUrl($this->thispage, 'action=edit'.$oid),
357 'ttip' => wfMsg('tooltip-viewsource'),
358 'akey' => wfMsg('accesskey-viewsource'));
359 }
360
361 if ( $wgTitle->getArticleId() ) {
362
363 $content_actions['history'] = array('class' => ($action == 'history') ? 'selected' : false,
364 'text' => wfMsg('history_short'),
365 'href' => $this->makeUrl($this->thispage, 'action=history'),
366 'ttip' => wfMsg('tooltip-history'),
367 'akey' => wfMsg('accesskey-history'));
368
369 # XXX: is there a rollback action anywhere or is it planned?
370 # Don't recall where i got this from...
371 /*if( $wgUser->getNewtalk() ) {
372 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
373 'text' => wfMsg('rollback_short'),
374 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
375 'ttip' => wfMsg('tooltip-rollback'),
376 'akey' => wfMsg('accesskey-rollback'));
377 }*/
378
379 if($wgUser->isSysop()){
380 if(!$wgTitle->isProtected()){
381 $content_actions['protect'] = array(
382 'class' => ($action == 'protect') ? 'selected' : false,
383 'text' => wfMsg('protect'),
384 'href' => $this->makeUrl($this->thispage, 'action=protect'),
385 'ttip' => wfMsg('tooltip-protect'),
386 'akey' => wfMsg('accesskey-protect')
387 );
388
389 } else {
390 $content_actions['unprotect'] = array(
391 'class' => ($action == 'unprotect') ? 'selected' : false,
392 'text' => wfMsg('unprotect'),
393 'href' => $this->makeUrl($this->thispage, 'action=unprotect'),
394 'ttip' => wfMsg('tooltip-protect'),
395 'akey' => wfMsg('accesskey-protect')
396 );
397 }
398 $content_actions['delete'] = array(
399 'class' => ($action == 'delete') ? 'selected' : false,
400 'text' => wfMsg('delete'),
401 'href' => $this->makeUrl($this->thispage, 'action=delete'),
402 'ttip' => wfMsg('tooltip-delete'),
403 'akey' => wfMsg('accesskey-delete')
404 );
405 }
406 if ( $wgUser->getID() != 0 ) {
407 if ( $wgTitle->userCanEdit()) {
408 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace == Namespace::getSpecial()) ? 'selected' : false,
409 'text' => wfMsg('move'),
410 'href' => $this->makeSpecialUrl('Movepage', 'target='.$this->thispage),
411 'ttip' => wfMsg('tooltip-move'),
412 'akey' => wfMsg('accesskey-move'));
413 } else {
414 $content_actions['move'] = array('class' => 'inactive',
415 'text' => wfMsg('move'),
416 'href' => false,
417 'ttip' => wfMsg('tooltip-nomove'),
418 'akey' => false);
419
420 }
421 }
422 } else {
423 //article doesn't exist or is deleted
424 if($wgUser->isSysop()){
425 if( $n = $wgTitle->isDeleted() ) {
426 $content_actions['delete'] = array(
427 'class' => false,
428 'text' => wfMsg( "undelete_short", $n ),
429 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage),
430 'ttip' => wfMsg('tooltip-undelete', $n),
431 'akey' => wfMsg('accesskey-undelete')
432 );
433 }
434 }
435 }
436
437 if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) {
438 if( !$wgTitle->userIsWatching()) {
439 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ? 'selected' : false,
440 'text' => wfMsg('watch'),
441 'href' => $this->makeUrl($this->thispage, 'action=watch'),
442 'ttip' => wfMsg('tooltip-watch'),
443 'akey' => wfMsg('accesskey-watch'));
444 } else {
445 $content_actions['watch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ? 'selected' : false,
446 'text' => wfMsg('unwatch'),
447 'href' => $this->makeUrl($this->thispage, 'action=unwatch'),
448 'ttip' => wfMsg('tooltip-unwatch'),
449 'akey' => wfMsg('accesskey-unwatch'));
450
451 }
452 }
453 } else {
454 /* show special page tab */
455
456 $content_actions['article'] = array('class' => 'selected',
457 'text' => wfMsg('specialpage'),
458 'href' => false,
459 'ttip' => wfMsg('tooltip-specialpage'),
460 'akey' => false);
461 }
462
463 return $content_actions;
464 }
465
466 # build array of common navigation links
467 function buildNavUrls () {
468 global $wgTitle, $wgUser, $wgRequest;
469 global $wgSiteSupportPage;
470
471 $action = $wgRequest->getText( 'action' );
472 $oldid = $wgRequest->getVal( 'oldid' );
473 $diff = $wgRequest->getVal( 'diff' );
474 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
475 $nav_urls = array();
476 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
477 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
478 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
479 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.$this->thispage)));
480 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
481 $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
482 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.$this->thispage)));
483 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
484 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
485 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
486 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
487 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
488 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
489
490
491 $id=User::idFromName($wgTitle->getText());
492 $ip=User::isIP($wgTitle->getText());
493
494 if($id || $ip) { # both anons and non-anons have contri list
495 $nav_urls['contributions'] = array(
496 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
497 );
498 }
499 if ( 0 != $wgUser->getID() ) { # show only to signed in users
500 if($id) { # can only email non-anons
501 $nav_urls['emailuser'] = array(
502 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
503 );
504 }
505 }
506
507
508 return $nav_urls;
509 }
510
511 function getNameSpaceWord () {
512 global $wgTitle;
513 switch ($wgTitle->getNamespace()) {
514 case NS_MAIN:
515 case NS_TALK:
516 return wfMsg('nstab-main');
517 case NS_USER:
518 case NS_USER_TALK:
519 return wfMsg('nstab-user');
520 case NS_MEDIA:
521 return wfMsg('nstab-media');
522 case NS_SPECIAL:
523 return wfMsg('nstab-special');
524 case NS_WP:
525 case NS_WP_TALK:
526 return wfMsg('nstab-wp');
527 case NS_IMAGE:
528 case NS_IMAGE_TALK:
529 return wfMsg('nstab-image');
530 case NS_MEDIAWIKI:
531 case NS_MEDIAWIKI_TALK:
532 return wfMsg('nstab-mediawiki');
533 case NS_TEMPLATE:
534 case NS_TEMPLATE_TALK:
535 return wfMsg('nstab-template');
536 case NS_HELP:
537 case NS_HELP_TALK:
538 return wfMsg('nstab-help');
539 case NS_CATEGORY:
540 case NS_CATEGORY_TALK:
541 return wfMsg('nstab-category');
542 default:
543 return wfMsg('nstab-main');
544 }
545 }
546 }
547
548 class SkinDaVinci extends SkinPHPTal {
549 function initPage( &$out ) {
550 SkinPHPTal::initPage( $out );
551 $this->skinname = "davinci";
552 }
553 }
554
555 class SkinMono extends SkinPHPTal {
556 function initPage( &$out ) {
557 SkinPHPTal::initPage( $out );
558 $this->skinname = "mono";
559 }
560 }
561
562 class SkinMonoBook extends SkinPHPTal {
563 function initPage( &$out ) {
564 SkinPHPTal::initPage( $out );
565 $this->skinname = "monobook";
566 }
567 }
568
569 ?>