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' ) ) {
33 require_once 'GlobalFunctions.php';
35 require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
37 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 # initialize various variables and generate the template
68 function outputPage( &$out ) {
69 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
70 global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
71 global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
72 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
73 global $wgMaxCredits, $wgShowCreditsIfMax;
75 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
77 $this->initPage( $out );
78 $tpl = new PHPTAL($this->template
. '.pt', 'templates');
80 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
81 $tpl->setTranslator(new MediaWiki_I18N());
84 $this->thispage
= $wgTitle->getPrefixedDbKey();
85 $this->thisurl
= $wgTitle->getPrefixedURL();
86 $this->loggedin
= $wgUser->getID() != 0;
87 $this->iscontent
= ($wgTitle->getNamespace() != Namespace::getSpecial() );
88 $this->iseditable
= ($this->iscontent
and !($action == 'edit' or $action == 'submit'));
89 $this->username
= $wgUser->getName();
90 $this->userpage
= $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
91 $this->userpageUrlDetails
= $this->makeUrlDetails($this->userpage
);
93 $this->usercss
= $this->userjs
= $this->userjsprev
= false;
94 $this->setupUserCssJs();
96 $this->titletxt
= $wgTitle->getPrefixedText();
98 $tpl->set( 'title', $wgOut->getPageTitle() );
99 $tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
101 $tpl->setRef( "thispage", $this->thispage
);
102 $subpagestr = $this->subPageSubtitle();
104 'subtitle', !empty($subpagestr)?
105 '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
108 $undelete = $this->getUndeleteLink();
110 "undelete", !empty($undelete)?
111 '<span class="subpages">'.$undelete.'</span>':
115 $tpl->set( 'catlinks', $this->getCategories());
116 if( $wgOut->isSyndicated() ) {
118 foreach( $wgFeedClasses as $format => $class ) {
119 $feeds[$format] = array(
121 'href' => $wgRequest->appendQuery( "feed=$format" ),
122 'ttip' => wfMsg('tooltip-'.$format)
125 $tpl->setRef( 'feeds', $feeds );
127 $tpl->setRef( 'mimetype', $wgMimeType );
128 $tpl->setRef( 'charset', $wgOutputEncoding );
129 $tpl->set( 'headlinks', $out->getHeadLinks() );
130 $tpl->setRef( 'skinname', $this->skinname
);
131 $tpl->setRef( 'loggedin', $this->loggedin
);
132 $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
133 /* XXX currently unused, might get useful later
134 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
135 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
136 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
137 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
138 $tpl->set( "helppage", wfMsg('helppage'));
139 $tpl->set( "sysop", $wgUser->isSysop() );
141 $tpl->set( 'searchaction', $this->escapeSearchLink() );
142 $tpl->setRef( 'stylepath', $wgStylePath );
143 $tpl->setRef( 'logopath', $wgLogo );
144 $tpl->setRef( "lang", $wgLanguageCode );
145 $tpl->set( 'dir', $wgLang->isRTL() ?
"rtl" : "ltr" );
146 $tpl->set( 'rtl', $wgLang->isRTL() );
147 $tpl->set( 'langname', $wgLang->getLanguageName( $wgLanguageCode ) );
148 $tpl->setRef( 'username', $this->username
);
149 $tpl->setRef( 'userpage', $this->userpage
);
150 $tpl->setRef( 'userpageurl', $this->userpageUrlDetails
['href']);
151 $tpl->setRef( 'usercss', $this->usercss
);
152 $tpl->setRef( 'userjs', $this->userjs
);
153 $tpl->setRef( 'userjsprev', $this->userjsprev
);
154 if($this->loggedin
) {
155 $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&smaxage=0&gen=js') );
157 $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&gen=js') );
159 if( $wgUser->getNewtalk() ) {
160 $usertitle = Title
::newFromText( $this->userpage
);
161 $usertalktitle = $usertitle->getTalkPage();
162 if($usertalktitle->getPrefixedDbKey() != $this->thispage
){
164 $ntl = wfMsg( 'newmessages',
165 $this->makeKnownLink(
166 $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) )
167 . ':' . $this->username
,
168 wfMsg('newmessageslink') )
175 $tpl->setRef( 'newtalk', $ntl );
176 $tpl->setRef( 'skin', $this);
177 $tpl->set( 'logo', $this->logoText() );
178 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
179 if ( !$wgDisableCounters ) {
180 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
182 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
185 $tpl->set('lastmod', $this->lastModified());
186 $tpl->set('copyright',$this->getCopyright());
188 $this->credits
= false;
190 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
191 require_once("Credits.php");
192 $this->credits
= getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
195 $tpl->setRef( 'credits', $this->credits
);
197 } elseif ( isset( $oldid ) && !isset( $diff ) ) {
198 $tpl->set('copyright', $this->getCopyright());
201 $tpl->set( 'copyrightico', $this->getCopyrightIcon() );
202 $tpl->set( 'poweredbyico', $this->getPoweredBy() );
203 $tpl->set( 'disclaimer', $this->disclaimerLink() );
204 $tpl->set( 'about', $this->aboutLink() );
206 $tpl->setRef( 'debug', $out->mDebugtext
);
207 $tpl->set( 'reporttime', $out->reportTime() );
208 $tpl->set( 'sitenotice', $wgSiteNotice );
210 $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
211 $out->mBodytext
.= $printfooter ;
212 $tpl->setRef( 'bodytext', $out->mBodytext
);
214 $language_urls = array();
215 foreach( $wgOut->getLanguageLinks() as $l ) {
216 $nt = Title
::newFromText( $l );
217 $language_urls[] = array('href' => $nt->getFullURL(),
218 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?
$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
219 'class' => $wgLang->isRTL() ?
'rtl' : 'ltr');
221 if(count($language_urls)) {
222 $tpl->setRef( 'language_urls', $language_urls);
224 $tpl->set('language_urls', false);
226 $tpl->set('personal_urls', $this->buildPersonalUrls());
227 $content_actions = $this->buildContentActionUrls();
228 $tpl->setRef('content_actions', $content_actions);
229 // XXX: attach this from javascript, same with section editing
230 if($this->iseditable
&& $wgUser->getOption("editondblclick") )
232 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
234 $tpl->set('body-ondblclick', false);
236 $tpl->set( 'nav_urls', $this->buildNavUrls() );
239 $res = $tpl->execute();
240 // result may be an error
241 if (PEAR
::isError($res)) {
242 echo $res->toString(), "\n";
249 # build array of urls for personal toolbar
250 function buildPersonalUrls() {
251 /* set up the default links for the personal toolbar */
252 global $wgShowIPinHeader;
253 $personal_urls = array();
254 if ($this->loggedin
) {
255 $personal_urls['userpage'] = array(
256 'text' => $this->username
,
257 'href' => &$this->userpageUrlDetails
['href'],
258 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
260 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
261 $personal_urls['mytalk'] = array(
262 'text' => wfMsg('mytalk'),
263 'href' => &$usertalkUrlDetails['href'],
264 'class' => $usertalkUrlDetails['exists']?
false:'new'
266 $personal_urls['preferences'] = array(
267 'text' => wfMsg('preferences'),
268 'href' => $this->makeSpecialUrl('Preferences')
270 $personal_urls['watchlist'] = array(
271 'text' => wfMsg('watchlist'),
272 'href' => $this->makeSpecialUrl('Watchlist')
274 $personal_urls['mycontris'] = array(
275 'text' => wfMsg('mycontris'),
276 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username
) )
278 $personal_urls['logout'] = array(
279 'text' => wfMsg('userlogout'),
280 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl
)
283 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
284 $personal_urls['anonuserpage'] = array(
285 'text' => $this->username
,
286 'href' => &$this->userpageUrlDetails
['href'],
287 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
289 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
290 $personal_urls['anontalk'] = array(
291 'text' => wfMsg('anontalk'),
292 'href' => &$usertalkUrlDetails['href'],
293 'class' => $usertalkUrlDetails['exists']?
false:'new'
295 $personal_urls['anonlogin'] = array(
296 'text' => wfMsg('userlogin'),
297 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
301 $personal_urls['login'] = array(
302 'text' => wfMsg('userlogin'),
303 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
308 return $personal_urls;
311 # an array of edit links by default used for the tabs
312 function buildContentActionUrls () {
313 global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
314 $action = $wgRequest->getText( 'action' );
315 $section = $wgRequest->getText( 'section' );
316 $oldid = $wgRequest->getVal( 'oldid' );
317 $diff = $wgRequest->getVal( 'diff' );
318 $content_actions = array();
320 if( $this->iscontent
) {
322 $nskey = $this->getNameSpaceKey();
323 $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
324 if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
325 $content_actions[$nskey] = array('class' => ($is_active) ?
'selected' : false,
326 'text' => wfMsg($nskey),
327 'href' => $this->makeArticleUrl($this->thispage
));
329 /* set up the classes for the talk link */
330 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ?
'selected' : false);
331 $talktitle = Title
::newFromText( $this->titletxt
);
332 $talktitle = $talktitle->getTalkPage();
333 $this->checkTitle($talktitle, $this->titletxt
);
334 if($talktitle->getArticleId() != 0) {
335 $content_actions['talk'] = array(
336 'class' => $talk_class,
337 'text' => wfMsg('talk'),
338 'href' => $this->makeTalkUrl($this->titletxt
)
341 $content_actions['talk'] = array(
342 'class' => $talk_class?
$talk_class.' new':'new',
343 'text' => wfMsg('talk'),
344 'href' => $this->makeTalkUrl($this->titletxt
,'action=edit')
348 if ( $wgTitle->userCanEdit() ) {
349 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : false;
350 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
351 $istalkclass = $istalk?
' istalk':'';
352 $content_actions['edit'] = array(
353 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ?
'selected' : '').$istalkclass,
354 'text' => wfMsg('edit'),
355 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid)
358 $content_actions['addsection'] = array(
359 'class' => $section == 'new'?
'selected':false,
360 'text' => wfMsg('addsection'),
361 'href' => $this->makeUrl($this->thispage
, 'action=edit§ion=new')
365 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : '';
366 $content_actions['viewsource'] = array('class' => ($action == 'edit') ?
'selected' : false,
367 'text' => wfMsg('viewsource'),
368 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid));
371 if ( $wgTitle->getArticleId() ) {
373 $content_actions['history'] = array('class' => ($action == 'history') ?
'selected' : false,
374 'text' => wfMsg('history_short'),
375 'href' => $this->makeUrl($this->thispage
, 'action=history'));
377 # XXX: is there a rollback action anywhere or is it planned?
378 # Don't recall where i got this from...
379 /*if( $wgUser->getNewtalk() ) {
380 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
381 'text' => wfMsg('rollback_short'),
382 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
383 'ttip' => wfMsg('tooltip-rollback'),
384 'akey' => wfMsg('accesskey-rollback'));
387 if($wgUser->isSysop()){
388 if(!$wgTitle->isProtected()){
389 $content_actions['protect'] = array(
390 'class' => ($action == 'protect') ?
'selected' : false,
391 'text' => wfMsg('protect'),
392 'href' => $this->makeUrl($this->thispage
, 'action=protect')
396 $content_actions['unprotect'] = array(
397 'class' => ($action == 'unprotect') ?
'selected' : false,
398 'text' => wfMsg('unprotect'),
399 'href' => $this->makeUrl($this->thispage
, 'action=unprotect')
402 $content_actions['delete'] = array(
403 'class' => ($action == 'delete') ?
'selected' : false,
404 'text' => wfMsg('delete'),
405 'href' => $this->makeUrl($this->thispage
, 'action=delete')
408 if ( $wgUser->getID() != 0 ) {
409 if ( $wgTitle->userCanEdit()) {
410 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace
== Namespace::getSpecial()) ?
'selected' : false,
411 'text' => wfMsg('move'),
412 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage
))
415 $content_actions['move'] = array('class' => 'inactive',
416 'text' => wfMsg('move'),
422 //article doesn't exist or is deleted
423 if($wgUser->isSysop()){
424 if( $n = $wgTitle->isDeleted() ) {
425 $content_actions['delete'] = array(
427 'text' => wfMsg( "undelete_short", $n ),
428 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage
)
434 if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) {
435 if( !$wgTitle->userIsWatching()) {
436 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ?
'selected' : false,
437 'text' => wfMsg('watch'),
438 'href' => $this->makeUrl($this->thispage
, 'action=watch'));
440 $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ?
'selected' : false,
441 'text' => wfMsg('unwatch'),
442 'href' => $this->makeUrl($this->thispage
, 'action=unwatch'));
447 if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
449 $article_time = "×tamp=" . $wgArticle->mTimestamp
;
450 $content_actions['validate'] = array('class' => ($action == 'validate') ?
'selected' : false ,
451 'text' => wfMsg('val_tab'),
452 'href' => $this->makeUrl($this->thispage
, 'action=validate'.$article_time));
456 /* show special page tab */
458 $content_actions['article'] = array('class' => 'selected',
459 'text' => wfMsg('specialpage'),
463 return $content_actions;
466 # build array of common navigation links
467 function buildNavUrls () {
468 global $wgTitle, $wgUser, $wgRequest;
469 global $wgSiteSupportPage, $wgDisableUploads;
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
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='.urlencode( $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='.urlencode( $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 if( $this->loggedin
&& !$wgDisableUploads ) {
488 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
490 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
492 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
493 $id = User
::idFromName($wgTitle->getText());
494 $ip = User
::isIP($wgTitle->getText());
500 if($id ||
$ip) { # both anons and non-anons have contri list
501 $nav_urls['contributions'] = array(
502 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
505 if ( 0 != $wgUser->getID() ) { # show only to signed in users
506 if($id) { # can only email non-anons
507 $nav_urls['emailuser'] = array(
508 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
517 # Generate strings used for xml 'id' names
518 function getNameSpaceKey () {
520 switch ($wgTitle->getNamespace()) {
528 return 'nstab-media';
530 return 'nstab-special';
532 case NS_PROJECT_TALK
:
536 return 'nstab-image';
538 case NS_MEDIAWIKI_TALK
:
539 return 'nstab-mediawiki';
541 case NS_TEMPLATE_TALK
:
542 return 'nstab-template';
547 case NS_CATEGORY_TALK
:
548 return 'nstab-category';
555 /* private */ function setupUserCssJs () {
556 global $wgRequest, $wgTitle;
557 $action = $wgRequest->getText('action');
559 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&gen=css').'";'."\n";
561 if( $this->loggedin
) {
562 if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
564 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&maxage=0&gen=css').'";'."\n";
566 $this->usercss
.= $wgRequest->getText('wpTextbox1');
569 $this->usercss
.= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&gen=css').'";'."\n";
570 # import user stylesheet
571 $this->usercss
.= '@import "'.
572 $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.css', 'action=raw&ctype=text/css').'";'."\n";
574 if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
575 # XXX: additional security check/prompt?
576 $this->userjsprev
= $wgRequest->getText('wpTextbox1');
578 $this->userjs
= $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
583 # returns css with user-specific options
584 function getUserStylesheet() {
585 global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
586 $action = $wgRequest->getText('action');
587 $maxage = $wgRequest->getText('maxage');
588 $s = "/* generated user stylesheet */\n";
589 if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname
.'/rtl.css";'."\n";
591 $this->makeNSUrl(ucfirst($this->skinname
).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI
)."\";\n";
592 if($wgUser->getID() != 0) {
593 if ( 1 == $wgUser->getOption( "underline" ) ) {
594 $s .= "a { text-decoration: underline; }\n";
596 $s .= "a { text-decoration: none; }\n";
599 if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
600 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
602 if ( 1 == $wgUser->getOption( "justify" ) ) {
603 $s .= "#bodyContent { text-align: justify; }\n";
608 function getUserJs() {
609 global $wgUser, $wgStylePath;
610 $s = '/* generated javascript */';
611 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
612 $s .= '/* MediaWiki:'.ucfirst($this->skinname
)." */\n";
613 $s .= wfMsg(ucfirst($this->skinname
).'.js');
618 class SkinDaVinci
extends SkinPHPTal
{
619 function initPage( &$out ) {
620 SkinPHPTal
::initPage( $out );
621 $this->skinname
= 'davinci';
625 class SkinMono
extends SkinPHPTal
{
626 function initPage( &$out ) {
627 SkinPHPTal
::initPage( $out );
628 $this->skinname
= 'mono';
632 class SkinMonoBook
extends SkinPHPTal
{
633 function initPage( &$out ) {
634 SkinPHPTal
::initPage( $out );
635 $this->skinname
= 'monobook';
639 class SkinMySkin
extends SkinPHPTal
{
640 function initPage( &$out ) {
641 SkinPHPTal
::initPage( $out );
642 $this->skinname
= 'myskin';
646 class SkinChick
extends SkinPHPTal
{
647 function initPage( &$out ) {
648 SkinPHPTal
::initPage( $out );
649 $this->skinname
= 'chick';
650 $this->template
= 'xhtml_minimal';
652 function suppressUrlExpansion() { return true; }
653 function printSource() { return ''; }
657 } // end of if( defined( 'MEDIAWIKI' ) )