2 # Generic PHPTal (http://phptal.sourceforge.net/) skin
3 # Based on Brion's smarty skin
4 # Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
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.
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;
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.
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.
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
29 if( defined( "MEDIAWIKI" ) ) {
30 require_once "GlobalFunctions.php";
32 require_once $IP."/PHPTAL-NP-0.7.0/libs/PHPTAL.php";
34 class MediaWiki_I18N
extends PHPTAL_I18N
36 var $_context = array();
38 function set($varName, $value) {
39 $this->_context
[$varName] = $value;
42 function translate($value) {
43 $value = wfMsg( $value );
44 // interpolate variables
45 while (preg_match('/\$([0-9]*?)/sm', $value, $m)) {
46 list($src, $var) = $m;
48 $varValue = $this->_context
[$var];
50 $value = str_replace($src, $varValue, $value);
56 class SkinPHPTal
extends Skin
{
59 function initPage( &$out ) {
60 parent
::initPage( $out );
61 $this->skinname
= "davinci";
62 $this->template
= "xhtml_slim";
65 function outputPage( &$out ) {
66 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
67 global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
68 global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
69 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
70 global $wgMaxCredits, $wgShowCreditsIfMax;
72 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
74 $this->initPage( $out );
75 $tpl = new PHPTAL($this->template
. '.pt', 'templates');
77 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
78 $tpl->setTranslator(new MediaWiki_I18N());
81 $this->thispage
= $wgTitle->getPrefixedDbKey();
82 $this->thisurl
= $wgTitle->getPrefixedURL();
83 $this->loggedin
= $wgUser->getID() != 0;
84 $this->iscontent
= ($wgTitle->getNamespace() != Namespace::getSpecial() );
85 $this->iseditable
= ($this->iscontent
and !($action == 'edit' or $action == 'submit'));
86 $this->username
= $wgUser->getName();
87 $this->userpage
= $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
88 $this->userpageUrlDetails
= $this->makeUrlDetails($this->userpage
);
90 $this->usercss
= $this->userjs
= $this->userjsprev
= false;
91 $this->setupUserCssJs();
93 $this->titletxt
= $wgTitle->getPrefixedText();
95 $tpl->set( "title", $wgOut->getPageTitle() );
96 $tpl->set( "pagetitle", $wgOut->getHTMLTitle() );
98 $tpl->setRef( "thispage", $this->thispage
);
99 $subpagestr = $this->subPageSubtitle();
101 "subtitle", !empty($subpagestr)?
102 '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
105 $undelete = $this->getUndeleteLink();
107 "undelete", !empty($undelete)?
108 '<span class="subpages">'.$undelete.'</span>':
112 $tpl->set( 'catlinks', $this->getCategories());
113 if( $wgOut->isSyndicated() ) {
115 foreach( $wgFeedClasses as $format => $class ) {
116 $feeds[$format] = array(
118 'href' => $wgRequest->appendQuery( "feed=$format" ),
119 'ttip' => wfMsg('tooltip-'.$format)
122 $tpl->setRef( 'feeds', $feeds );
124 $tpl->setRef( 'mimetype', $wgMimeType );
125 $tpl->setRef( 'charset', $wgOutputEncoding );
126 $tpl->set( 'headlinks', $out->getHeadLinks() );
127 $tpl->setRef( 'skinname', $this->skinname
);
128 $tpl->setRef( "loggedin", $this->loggedin
);
129 $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
130 /* XXX currently unused, might get useful later
131 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
132 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
133 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
134 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
135 $tpl->set( "helppage", wfMsg('helppage'));
136 $tpl->set( "sysop", $wgUser->isSysop() );
138 $tpl->set( "searchaction", $this->escapeSearchLink() );
139 $tpl->setRef( "stylepath", $wgStylePath );
140 $tpl->setRef( "logopath", $wgLogo );
141 $tpl->setRef( "lang", $wgLanguageCode );
142 $tpl->set( "dir", $wgLang->isRTL() ?
"rtl" : "ltr" );
143 $tpl->set( "rtl", $wgLang->isRTL() );
144 $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) );
145 $tpl->setRef( "username", $this->username
);
146 $tpl->setRef( "userpage", $this->userpage
);
147 $tpl->setRef( "userpageurl", $this->userpageUrlDetails
['href']);
148 $tpl->setRef( "usercss", $this->usercss
);
149 $tpl->setRef( "userjs", $this->userjs
);
150 $tpl->setRef( "userjsprev", $this->userjsprev
);
151 if($this->loggedin
) {
152 $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&smaxage=0&gen=js') );
154 $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js') );
156 if( $wgUser->getNewtalk() ) {
157 $usertitle = Title
::newFromText( $this->userpage
);
158 $usertalktitle = $usertitle->getTalkPage();
159 if($usertalktitle->getPrefixedDbKey() != $this->thispage
){
161 $ntl = wfMsg( "newmessages",
162 $this->makeKnownLink(
163 $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) )
164 . ":" . $this->username
,
165 wfMsg("newmessageslink") )
172 $tpl->setRef( "newtalk", $ntl );
173 $tpl->setRef( "skin", $this);
174 $tpl->set( "logo", $this->logoText() );
175 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
176 if ( !$wgDisableCounters ) {
177 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
179 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
182 $tpl->set('lastmod', $this->lastModified());
183 $tpl->set('copyright',$this->getCopyright());
185 $this->credits
= false;
187 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
188 require_once("Credits.php");
189 $this->credits
= getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
192 $tpl->setRef( "credits", $this->credits
);
194 } elseif ( isset( $oldid ) && !isset( $diff ) ) {
195 $tpl->set('copyright', $this->getCopyright());
198 $tpl->set( "copyrightico", $this->getCopyrightIcon() );
199 $tpl->set( "poweredbyico", $this->getPoweredBy() );
200 $tpl->set( "disclaimer", $this->disclaimerLink() );
201 $tpl->set( "about", $this->aboutLink() );
203 $tpl->setRef( "debug", $out->mDebugtext
);
204 $tpl->set( "reporttime", $out->reportTime() );
205 $tpl->set( "sitenotice", $wgSiteNotice );
207 $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
208 $out->mBodytext
.= $printfooter ;
209 $tpl->setRef( "bodytext", $out->mBodytext
);
211 $language_urls = array();
212 foreach( $wgOut->getLanguageLinks() as $l ) {
213 $nt = Title
::newFromText( $l );
214 $language_urls[] = array('href' => $nt->getFullURL(),
215 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?
$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
216 'class' => $wgLang->isRTL() ?
'rtl' : 'ltr');
218 if(count($language_urls)) {
219 $tpl->setRef( 'language_urls', $language_urls);
221 $tpl->set('language_urls', false);
223 $tpl->set('personal_urls', $this->buildPersonalUrls());
224 $content_actions = $this->buildContentActionUrls();
225 $tpl->setRef('content_actions', $content_actions);
226 // XXX: attach this from javascript, same with section editing
227 if($this->iseditable
&& $wgUser->getOption("editondblclick") )
229 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
231 $tpl->set('body-ondblclick', false);
233 $tpl->set( "nav_urls", $this->buildNavUrls() );
236 $res = $tpl->execute();
237 // result may be an error
238 if (PEAR
::isError($res)) {
239 echo $res->toString(), "\n";
246 # build array of urls for personal toolbar
247 function buildPersonalUrls() {
248 /* set up the default links for the personal toolbar */
249 global $wgShowIPinHeader;
250 $personal_urls = array();
251 if ($this->loggedin
) {
252 $personal_urls['userpage'] = array(
253 'text' => $this->username
,
254 'href' => &$this->userpageUrlDetails
['href'],
255 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
257 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
258 $personal_urls['mytalk'] = array(
259 'text' => wfMsg('mytalk'),
260 'href' => &$usertalkUrlDetails['href'],
261 'class' => $usertalkUrlDetails['exists']?
false:'new'
263 $personal_urls['preferences'] = array(
264 'text' => wfMsg('preferences'),
265 'href' => $this->makeSpecialUrl('Preferences')
267 $personal_urls['watchlist'] = array(
268 'text' => wfMsg('watchlist'),
269 'href' => $this->makeSpecialUrl('Watchlist')
271 $personal_urls['mycontris'] = array(
272 'text' => wfMsg('mycontris'),
273 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username
) )
275 $personal_urls['logout'] = array(
276 'text' => wfMsg('userlogout'),
277 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl
)
280 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
281 $personal_urls['anonuserpage'] = array(
282 'text' => $this->username
,
283 'href' => &$this->userpageUrlDetails
['href'],
284 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
286 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
287 $personal_urls['anontalk'] = array(
288 'text' => wfMsg('anontalk'),
289 'href' => &$usertalkUrlDetails['href'],
290 'class' => $usertalkUrlDetails['exists']?
false:'new'
292 $personal_urls['anonlogin'] = array(
293 'text' => wfMsg('userlogin'),
294 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
298 $personal_urls['login'] = array(
299 'text' => wfMsg('userlogin'),
300 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
305 return $personal_urls;
308 # an array of edit links by default used for the tabs
309 function buildContentActionUrls () {
310 global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
311 $action = $wgRequest->getText( 'action' );
312 $section = $wgRequest->getText( 'section' );
313 $oldid = $wgRequest->getVal( 'oldid' );
314 $diff = $wgRequest->getVal( 'diff' );
315 $content_actions = array();
317 if( $this->iscontent
) {
319 $nskey = $this->getNameSpaceKey();
320 $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
321 if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
322 $content_actions[$nskey] = array('class' => ($is_active) ?
'selected' : false,
323 'text' => wfMsg($nskey),
324 'href' => $this->makeArticleUrl($this->thispage
));
326 /* set up the classes for the talk link */
327 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ?
'selected' : false);
328 $talktitle = Title
::newFromText( $this->titletxt
);
329 $talktitle = $talktitle->getTalkPage();
330 $this->checkTitle($talktitle, $this->titletxt
);
331 if($talktitle->getArticleId() != 0) {
332 $content_actions['talk'] = array(
333 'class' => $talk_class,
334 'text' => wfMsg('talk'),
335 'href' => $this->makeTalkUrl($this->titletxt
)
338 $content_actions['talk'] = array(
339 'class' => $talk_class?
$talk_class.' new':'new',
340 'text' => wfMsg('talk'),
341 'href' => $this->makeTalkUrl($this->titletxt
,'action=edit')
345 if ( $wgTitle->userCanEdit() ) {
346 $oid = ( $oldid && ! isset( $diff ) ) ?
"&oldid={$oldid}" : false;
347 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
348 $istalkclass = $istalk?
' istalk':'';
349 $content_actions['edit'] = array(
350 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ?
'selected' : '').$istalkclass,
351 'text' => wfMsg('edit'),
352 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid)
355 $content_actions['addsection'] = array(
356 'class' => $section == 'new'?
'selected':false,
357 'text' => wfMsg('addsection'),
358 'href' => $this->makeUrl($this->thispage
, 'action=edit§ion=new')
362 $oid = ( $oldid && ! isset( $diff ) ) ?
"&oldid={$oldid}" : '';
363 $content_actions['viewsource'] = array('class' => ($action == 'edit') ?
'selected' : false,
364 'text' => wfMsg('viewsource'),
365 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid));
368 if ( $wgTitle->getArticleId() ) {
370 $content_actions['history'] = array('class' => ($action == 'history') ?
'selected' : false,
371 'text' => wfMsg('history_short'),
372 'href' => $this->makeUrl($this->thispage
, 'action=history'));
374 # XXX: is there a rollback action anywhere or is it planned?
375 # Don't recall where i got this from...
376 /*if( $wgUser->getNewtalk() ) {
377 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
378 'text' => wfMsg('rollback_short'),
379 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
380 'ttip' => wfMsg('tooltip-rollback'),
381 'akey' => wfMsg('accesskey-rollback'));
384 if($wgUser->isSysop()){
385 if(!$wgTitle->isProtected()){
386 $content_actions['protect'] = array(
387 'class' => ($action == 'protect') ?
'selected' : false,
388 'text' => wfMsg('protect'),
389 'href' => $this->makeUrl($this->thispage
, 'action=protect')
393 $content_actions['unprotect'] = array(
394 'class' => ($action == 'unprotect') ?
'selected' : false,
395 'text' => wfMsg('unprotect'),
396 'href' => $this->makeUrl($this->thispage
, 'action=unprotect')
399 $content_actions['delete'] = array(
400 'class' => ($action == 'delete') ?
'selected' : false,
401 'text' => wfMsg('delete'),
402 'href' => $this->makeUrl($this->thispage
, 'action=delete')
405 if ( $wgUser->getID() != 0 ) {
406 if ( $wgTitle->userCanEdit()) {
407 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace
== Namespace::getSpecial()) ?
'selected' : false,
408 'text' => wfMsg('move'),
409 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage
))
412 $content_actions['move'] = array('class' => 'inactive',
413 'text' => wfMsg('move'),
419 //article doesn't exist or is deleted
420 if($wgUser->isSysop()){
421 if( $n = $wgTitle->isDeleted() ) {
422 $content_actions['delete'] = array(
424 'text' => wfMsg( "undelete_short", $n ),
425 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage
)
431 if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) {
432 if( !$wgTitle->userIsWatching()) {
433 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ?
'selected' : false,
434 'text' => wfMsg('watch'),
435 'href' => $this->makeUrl($this->thispage
, 'action=watch'));
437 $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ?
'selected' : false,
438 'text' => wfMsg('unwatch'),
439 'href' => $this->makeUrl($this->thispage
, 'action=unwatch'));
444 if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
446 $article_time = "×tamp=" . $wgArticle->mTimestamp
;
447 $content_actions['validate'] = array('class' => ($action == 'validate') ?
'selected' : false ,
448 'text' => wfMsg('val_tab'),
449 'href' => $this->makeUrl($this->thispage
, "action=validate{$article_time}"));
453 /* show special page tab */
455 $content_actions['article'] = array('class' => 'selected',
456 'text' => wfMsg('specialpage'),
460 return $content_actions;
463 # build array of common navigation links
464 function buildNavUrls () {
465 global $wgTitle, $wgUser, $wgRequest;
466 global $wgSiteSupportPage;
468 $action = $wgRequest->getText( 'action' );
469 $oldid = $wgRequest->getVal( 'oldid' );
470 $diff = $wgRequest->getVal( 'diff' );
471 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
473 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
474 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
475 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
476 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
477 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
478 $nav_urls['portal'] = (wfMsg('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
479 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
480 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
481 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
482 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
483 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
484 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
485 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
487 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
488 $id = User
::idFromName($wgTitle->getText());
489 $ip = User
::isIP($wgTitle->getText());
495 if($id ||
$ip) { # both anons and non-anons have contri list
496 $nav_urls['contributions'] = array(
497 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
500 if ( 0 != $wgUser->getID() ) { # show only to signed in users
501 if($id) { # can only email non-anons
502 $nav_urls['emailuser'] = array(
503 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
512 function getNameSpaceKey () {
514 switch ($wgTitle->getNamespace()) {
522 return 'nstab-media';
524 return 'nstab-special';
530 return 'nstab-image';
532 case NS_MEDIAWIKI_TALK
:
533 return 'nstab-mediawiki';
535 case NS_TEMPLATE_TALK
:
536 return 'nstab-template';
541 case NS_CATEGORY_TALK
:
542 return 'nstab-category';
547 /* private */ function setupUserCssJs () {
548 global $wgRequest, $wgTitle;
549 $action = $wgRequest->getText('action');
551 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&gen=css').'";'."\n";
553 if( $this->loggedin
) {
554 if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
556 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&maxage=0&gen=css').'";'."\n";
558 $this->usercss
.= $wgRequest->getText('wpTextbox1');
561 $this->usercss
.= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&gen=css').'";'."\n";
562 # import user stylesheet
563 $this->usercss
.= '@import "'.
564 $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.css', 'action=raw&ctype=text/css').'";'."\n";
566 if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
567 # XXX: additional security check/prompt?
568 $this->userjsprev
= $wgRequest->getText('wpTextbox1');
570 $this->userjs
= $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
574 # returns css with user-specific options
575 function getUserStylesheet() {
576 global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
577 $action = $wgRequest->getText('action');
578 $maxage = $wgRequest->getText('maxage');
579 $s = "/* generated user stylesheet */\n";
580 if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname
.'/rtl.css";'."\n";
582 $this->makeNSUrl(ucfirst($this->skinname
).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI
)."\";\n";
583 if($wgUser->getID() != 0) {
584 if ( 1 == $wgUser->getOption( "underline" ) ) {
585 $s .= "a { text-decoration: underline; }\n";
587 $s .= "a { text-decoration: none; }\n";
590 if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
591 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
593 if ( 1 == $wgUser->getOption( "justify" ) ) {
594 $s .= "#bodyContent { text-align: justify; }\n";
598 function getUserJs() {
599 global $wgUser, $wgStylePath;
600 $s = "/* generated javascript */";
601 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
602 $s .= '/* MediaWiki:'.ucfirst($this->skinname
)." */\n";
603 $s .= wfMsg(ucfirst($this->skinname
).'.js');
608 class SkinDaVinci
extends SkinPHPTal
{
609 function initPage( &$out ) {
610 SkinPHPTal
::initPage( $out );
611 $this->skinname
= "davinci";
615 class SkinMono
extends SkinPHPTal
{
616 function initPage( &$out ) {
617 SkinPHPTal
::initPage( $out );
618 $this->skinname
= "mono";
622 class SkinMonoBook
extends SkinPHPTal
{
623 function initPage( &$out ) {
624 SkinPHPTal
::initPage( $out );
625 $this->skinname
= "monobook";
629 class SkinMySkin
extends SkinPHPTal
{
630 function initPage( &$out ) {
631 SkinPHPTal
::initPage( $out );
632 $this->skinname
= "myskin";