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
30 # This is not a valid entry point, perform no further processing unless MEDIAWIKI is defined
31 if( defined( "MEDIAWIKI" ) ) {
32 require_once "GlobalFunctions.php";
34 require_once $IP."/PHPTAL-NP-0.7.0/libs/PHPTAL.php";
36 class MediaWiki_I18N
extends PHPTAL_I18N
38 var $_context = array();
40 function set($varName, $value) {
41 $this->_context
[$varName] = $value;
44 function translate($value) {
45 $value = wfMsg( $value );
46 // interpolate variables
47 while (preg_match('/\$([0-9]*?)/sm', $value, $m)) {
48 list($src, $var) = $m;
50 $varValue = $this->_context
[$var];
52 $value = str_replace($src, $varValue, $value);
58 class SkinPHPTal
extends Skin
{
61 function initPage( &$out ) {
62 parent
::initPage( $out );
63 $this->skinname
= "davinci";
64 $this->template
= "xhtml_slim";
67 function outputPage( &$out ) {
68 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
69 global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
70 global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
71 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
72 global $wgMaxCredits, $wgShowCreditsIfMax;
74 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
76 $this->initPage( $out );
77 $tpl = new PHPTAL($this->template
. '.pt', 'templates');
79 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
80 $tpl->setTranslator(new MediaWiki_I18N());
83 $this->thispage
= $wgTitle->getPrefixedDbKey();
84 $this->thisurl
= $wgTitle->getPrefixedURL();
85 $this->loggedin
= $wgUser->getID() != 0;
86 $this->iscontent
= ($wgTitle->getNamespace() != Namespace::getSpecial() );
87 $this->iseditable
= ($this->iscontent
and !($action == 'edit' or $action == 'submit'));
88 $this->username
= $wgUser->getName();
89 $this->userpage
= $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
90 $this->userpageUrlDetails
= $this->makeUrlDetails($this->userpage
);
92 $this->usercss
= $this->userjs
= $this->userjsprev
= false;
93 $this->setupUserCssJs();
95 $this->titletxt
= $wgTitle->getPrefixedText();
97 $tpl->set( "title", $wgOut->getPageTitle() );
98 $tpl->set( "pagetitle", $wgOut->getHTMLTitle() );
100 $tpl->setRef( "thispage", $this->thispage
);
101 $subpagestr = $this->subPageSubtitle();
103 "subtitle", !empty($subpagestr)?
104 '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
107 $undelete = $this->getUndeleteLink();
109 "undelete", !empty($undelete)?
110 '<span class="subpages">'.$undelete.'</span>':
114 $tpl->set( 'catlinks', $this->getCategories());
115 if( $wgOut->isSyndicated() ) {
117 foreach( $wgFeedClasses as $format => $class ) {
118 $feeds[$format] = array(
120 'href' => $wgRequest->appendQuery( "feed=$format" ),
121 'ttip' => wfMsg('tooltip-'.$format)
124 $tpl->setRef( 'feeds', $feeds );
126 $tpl->setRef( 'mimetype', $wgMimeType );
127 $tpl->setRef( 'charset', $wgOutputEncoding );
128 $tpl->set( 'headlinks', $out->getHeadLinks() );
129 $tpl->setRef( 'skinname', $this->skinname
);
130 $tpl->setRef( "loggedin", $this->loggedin
);
131 $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
132 /* XXX currently unused, might get useful later
133 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
134 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
135 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
136 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
137 $tpl->set( "helppage", wfMsg('helppage'));
138 $tpl->set( "sysop", $wgUser->isSysop() );
140 $tpl->set( "searchaction", $this->escapeSearchLink() );
141 $tpl->setRef( "stylepath", $wgStylePath );
142 $tpl->setRef( "logopath", $wgLogo );
143 $tpl->setRef( "lang", $wgLanguageCode );
144 $tpl->set( "dir", $wgLang->isRTL() ?
"rtl" : "ltr" );
145 $tpl->set( "rtl", $wgLang->isRTL() );
146 $tpl->set( "langname", $wgLang->getLanguageName( $wgLanguageCode ) );
147 $tpl->setRef( "username", $this->username
);
148 $tpl->setRef( "userpage", $this->userpage
);
149 $tpl->setRef( "userpageurl", $this->userpageUrlDetails
['href']);
150 $tpl->setRef( "usercss", $this->usercss
);
151 $tpl->setRef( "userjs", $this->userjs
);
152 $tpl->setRef( "userjsprev", $this->userjsprev
);
153 if($this->loggedin
) {
154 $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&smaxage=0&gen=js') );
156 $tpl->set( "jsvarurl", $this->makeUrl('-','action=raw&gen=js') );
158 if( $wgUser->getNewtalk() ) {
159 $usertitle = Title
::newFromText( $this->userpage
);
160 $usertalktitle = $usertitle->getTalkPage();
161 if($usertalktitle->getPrefixedDbKey() != $this->thispage
){
163 $ntl = wfMsg( "newmessages",
164 $this->makeKnownLink(
165 $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) )
166 . ":" . $this->username
,
167 wfMsg("newmessageslink") )
174 $tpl->setRef( "newtalk", $ntl );
175 $tpl->setRef( "skin", $this);
176 $tpl->set( "logo", $this->logoText() );
177 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
178 if ( !$wgDisableCounters ) {
179 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
181 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
184 $tpl->set('lastmod', $this->lastModified());
185 $tpl->set('copyright',$this->getCopyright());
187 $this->credits
= false;
189 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
190 require_once("Credits.php");
191 $this->credits
= getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
194 $tpl->setRef( "credits", $this->credits
);
196 } elseif ( isset( $oldid ) && !isset( $diff ) ) {
197 $tpl->set('copyright', $this->getCopyright());
200 $tpl->set( "copyrightico", $this->getCopyrightIcon() );
201 $tpl->set( "poweredbyico", $this->getPoweredBy() );
202 $tpl->set( "disclaimer", $this->disclaimerLink() );
203 $tpl->set( "about", $this->aboutLink() );
205 $tpl->setRef( "debug", $out->mDebugtext
);
206 $tpl->set( "reporttime", $out->reportTime() );
207 $tpl->set( "sitenotice", $wgSiteNotice );
209 $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
210 $out->mBodytext
.= $printfooter ;
211 $tpl->setRef( "bodytext", $out->mBodytext
);
213 $language_urls = array();
214 foreach( $wgOut->getLanguageLinks() as $l ) {
215 $nt = Title
::newFromText( $l );
216 $language_urls[] = array('href' => $nt->getFullURL(),
217 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?
$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
218 'class' => $wgLang->isRTL() ?
'rtl' : 'ltr');
220 if(count($language_urls)) {
221 $tpl->setRef( 'language_urls', $language_urls);
223 $tpl->set('language_urls', false);
225 $tpl->set('personal_urls', $this->buildPersonalUrls());
226 $content_actions = $this->buildContentActionUrls();
227 $tpl->setRef('content_actions', $content_actions);
228 // XXX: attach this from javascript, same with section editing
229 if($this->iseditable
&& $wgUser->getOption("editondblclick") )
231 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
233 $tpl->set('body-ondblclick', false);
235 $tpl->set( "nav_urls", $this->buildNavUrls() );
238 $res = $tpl->execute();
239 // result may be an error
240 if (PEAR
::isError($res)) {
241 echo $res->toString(), "\n";
248 # build array of urls for personal toolbar
249 function buildPersonalUrls() {
250 /* set up the default links for the personal toolbar */
251 global $wgShowIPinHeader;
252 $personal_urls = array();
253 if ($this->loggedin
) {
254 $personal_urls['userpage'] = array(
255 'text' => $this->username
,
256 'href' => &$this->userpageUrlDetails
['href'],
257 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
259 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
260 $personal_urls['mytalk'] = array(
261 'text' => wfMsg('mytalk'),
262 'href' => &$usertalkUrlDetails['href'],
263 'class' => $usertalkUrlDetails['exists']?
false:'new'
265 $personal_urls['preferences'] = array(
266 'text' => wfMsg('preferences'),
267 'href' => $this->makeSpecialUrl('Preferences')
269 $personal_urls['watchlist'] = array(
270 'text' => wfMsg('watchlist'),
271 'href' => $this->makeSpecialUrl('Watchlist')
273 $personal_urls['mycontris'] = array(
274 'text' => wfMsg('mycontris'),
275 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username
) )
277 $personal_urls['logout'] = array(
278 'text' => wfMsg('userlogout'),
279 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl
)
282 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
283 $personal_urls['anonuserpage'] = array(
284 'text' => $this->username
,
285 'href' => &$this->userpageUrlDetails
['href'],
286 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
288 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
289 $personal_urls['anontalk'] = array(
290 'text' => wfMsg('anontalk'),
291 'href' => &$usertalkUrlDetails['href'],
292 'class' => $usertalkUrlDetails['exists']?
false:'new'
294 $personal_urls['anonlogin'] = array(
295 'text' => wfMsg('userlogin'),
296 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
300 $personal_urls['login'] = array(
301 'text' => wfMsg('userlogin'),
302 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
307 return $personal_urls;
310 # an array of edit links by default used for the tabs
311 function buildContentActionUrls () {
312 global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
313 $action = $wgRequest->getText( 'action' );
314 $section = $wgRequest->getText( 'section' );
315 $oldid = $wgRequest->getVal( 'oldid' );
316 $diff = $wgRequest->getVal( 'diff' );
317 $content_actions = array();
319 if( $this->iscontent
) {
321 $nskey = $this->getNameSpaceKey();
322 $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
323 if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
324 $content_actions[$nskey] = array('class' => ($is_active) ?
'selected' : false,
325 'text' => wfMsg($nskey),
326 'href' => $this->makeArticleUrl($this->thispage
));
328 /* set up the classes for the talk link */
329 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ?
'selected' : false);
330 $talktitle = Title
::newFromText( $this->titletxt
);
331 $talktitle = $talktitle->getTalkPage();
332 $this->checkTitle($talktitle, $this->titletxt
);
333 if($talktitle->getArticleId() != 0) {
334 $content_actions['talk'] = array(
335 'class' => $talk_class,
336 'text' => wfMsg('talk'),
337 'href' => $this->makeTalkUrl($this->titletxt
)
340 $content_actions['talk'] = array(
341 'class' => $talk_class?
$talk_class.' new':'new',
342 'text' => wfMsg('talk'),
343 'href' => $this->makeTalkUrl($this->titletxt
,'action=edit')
347 if ( $wgTitle->userCanEdit() ) {
348 $oid = ( $oldid && ! isset( $diff ) ) ?
"&oldid={$oldid}" : false;
349 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
350 $istalkclass = $istalk?
' istalk':'';
351 $content_actions['edit'] = array(
352 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ?
'selected' : '').$istalkclass,
353 'text' => wfMsg('edit'),
354 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid)
357 $content_actions['addsection'] = array(
358 'class' => $section == 'new'?
'selected':false,
359 'text' => wfMsg('addsection'),
360 'href' => $this->makeUrl($this->thispage
, 'action=edit§ion=new')
364 $oid = ( $oldid && ! isset( $diff ) ) ?
"&oldid={$oldid}" : '';
365 $content_actions['viewsource'] = array('class' => ($action == 'edit') ?
'selected' : false,
366 'text' => wfMsg('viewsource'),
367 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid));
370 if ( $wgTitle->getArticleId() ) {
372 $content_actions['history'] = array('class' => ($action == 'history') ?
'selected' : false,
373 'text' => wfMsg('history_short'),
374 'href' => $this->makeUrl($this->thispage
, 'action=history'));
376 # XXX: is there a rollback action anywhere or is it planned?
377 # Don't recall where i got this from...
378 /*if( $wgUser->getNewtalk() ) {
379 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
380 'text' => wfMsg('rollback_short'),
381 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
382 'ttip' => wfMsg('tooltip-rollback'),
383 'akey' => wfMsg('accesskey-rollback'));
386 if($wgUser->isSysop()){
387 if(!$wgTitle->isProtected()){
388 $content_actions['protect'] = array(
389 'class' => ($action == 'protect') ?
'selected' : false,
390 'text' => wfMsg('protect'),
391 'href' => $this->makeUrl($this->thispage
, 'action=protect')
395 $content_actions['unprotect'] = array(
396 'class' => ($action == 'unprotect') ?
'selected' : false,
397 'text' => wfMsg('unprotect'),
398 'href' => $this->makeUrl($this->thispage
, 'action=unprotect')
401 $content_actions['delete'] = array(
402 'class' => ($action == 'delete') ?
'selected' : false,
403 'text' => wfMsg('delete'),
404 'href' => $this->makeUrl($this->thispage
, 'action=delete')
407 if ( $wgUser->getID() != 0 ) {
408 if ( $wgTitle->userCanEdit()) {
409 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace
== Namespace::getSpecial()) ?
'selected' : false,
410 'text' => wfMsg('move'),
411 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage
))
414 $content_actions['move'] = array('class' => 'inactive',
415 'text' => wfMsg('move'),
421 //article doesn't exist or is deleted
422 if($wgUser->isSysop()){
423 if( $n = $wgTitle->isDeleted() ) {
424 $content_actions['delete'] = array(
426 'text' => wfMsg( "undelete_short", $n ),
427 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage
)
433 if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) {
434 if( !$wgTitle->userIsWatching()) {
435 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ?
'selected' : false,
436 'text' => wfMsg('watch'),
437 'href' => $this->makeUrl($this->thispage
, 'action=watch'));
439 $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ?
'selected' : false,
440 'text' => wfMsg('unwatch'),
441 'href' => $this->makeUrl($this->thispage
, 'action=unwatch'));
446 if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
448 $article_time = "×tamp=" . $wgArticle->mTimestamp
;
449 $content_actions['validate'] = array('class' => ($action == 'validate') ?
'selected' : false ,
450 'text' => wfMsg('val_tab'),
451 'href' => $this->makeUrl($this->thispage
, "action=validate{$article_time}"));
455 /* show special page tab */
457 $content_actions['article'] = array('class' => 'selected',
458 'text' => wfMsg('specialpage'),
462 return $content_actions;
465 # build array of common navigation links
466 function buildNavUrls () {
467 global $wgTitle, $wgUser, $wgRequest;
468 global $wgSiteSupportPage;
470 $action = $wgRequest->getText( 'action' );
471 $oldid = $wgRequest->getVal( 'oldid' );
472 $diff = $wgRequest->getVal( 'diff' );
473 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
475 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
476 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
477 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
478 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
479 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
480 $nav_urls['portal'] = (wfMsg('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
481 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
482 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
483 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
484 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
485 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
486 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
487 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
489 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
490 $id = User
::idFromName($wgTitle->getText());
491 $ip = User
::isIP($wgTitle->getText());
497 if($id ||
$ip) { # both anons and non-anons have contri list
498 $nav_urls['contributions'] = array(
499 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
502 if ( 0 != $wgUser->getID() ) { # show only to signed in users
503 if($id) { # can only email non-anons
504 $nav_urls['emailuser'] = array(
505 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
514 function getNameSpaceKey () {
516 switch ($wgTitle->getNamespace()) {
524 return 'nstab-media';
526 return 'nstab-special';
532 return 'nstab-image';
534 case NS_MEDIAWIKI_TALK
:
535 return 'nstab-mediawiki';
537 case NS_TEMPLATE_TALK
:
538 return 'nstab-template';
543 case NS_CATEGORY_TALK
:
544 return 'nstab-category';
549 /* private */ function setupUserCssJs () {
550 global $wgRequest, $wgTitle;
551 $action = $wgRequest->getText('action');
553 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&gen=css').'";'."\n";
555 if( $this->loggedin
) {
556 if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
558 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&maxage=0&gen=css').'";'."\n";
560 $this->usercss
.= $wgRequest->getText('wpTextbox1');
563 $this->usercss
.= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&gen=css').'";'."\n";
564 # import user stylesheet
565 $this->usercss
.= '@import "'.
566 $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.css', 'action=raw&ctype=text/css').'";'."\n";
568 if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
569 # XXX: additional security check/prompt?
570 $this->userjsprev
= $wgRequest->getText('wpTextbox1');
572 $this->userjs
= $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
576 # returns css with user-specific options
577 function getUserStylesheet() {
578 global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
579 $action = $wgRequest->getText('action');
580 $maxage = $wgRequest->getText('maxage');
581 $s = "/* generated user stylesheet */\n";
582 if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname
.'/rtl.css";'."\n";
584 $this->makeNSUrl(ucfirst($this->skinname
).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI
)."\";\n";
585 if($wgUser->getID() != 0) {
586 if ( 1 == $wgUser->getOption( "underline" ) ) {
587 $s .= "a { text-decoration: underline; }\n";
589 $s .= "a { text-decoration: none; }\n";
592 if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
593 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
595 if ( 1 == $wgUser->getOption( "justify" ) ) {
596 $s .= "#bodyContent { text-align: justify; }\n";
600 function getUserJs() {
601 global $wgUser, $wgStylePath;
602 $s = "/* generated javascript */";
603 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
604 $s .= '/* MediaWiki:'.ucfirst($this->skinname
)." */\n";
605 $s .= wfMsg(ucfirst($this->skinname
).'.js');
610 class SkinDaVinci
extends SkinPHPTal
{
611 function initPage( &$out ) {
612 SkinPHPTal
::initPage( $out );
613 $this->skinname
= "davinci";
617 class SkinMono
extends SkinPHPTal
{
618 function initPage( &$out ) {
619 SkinPHPTal
::initPage( $out );
620 $this->skinname
= "mono";
624 class SkinMonoBook
extends SkinPHPTal
{
625 function initPage( &$out ) {
626 SkinPHPTal
::initPage( $out );
627 $this->skinname
= "monobook";
631 class SkinMySkin
extends SkinPHPTal
{
632 function initPage( &$out ) {
633 SkinPHPTal
::initPage( $out );
634 $this->skinname
= "myskin";
638 class SkinChick
extends SkinPHPTal
{
639 function initPage( &$out ) {
640 SkinPHPTal
::initPage( $out );
641 $this->skinname
= "chick";
642 $this->template
= "xhtml_minimal";
644 function suppressUrlExpansion() { return true; }
645 function printSource() { return ""; }