4282a95ba3e240cd3abeaf3812b5c98254f13ace
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
= 'monobook';
64 $this->template
= 'MonoBook';
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', 'skins');
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') )
171 $wgOut->setSquidMaxage(0);
177 $tpl->setRef( 'newtalk', $ntl );
178 $tpl->setRef( 'skin', $this);
179 $tpl->set( 'logo', $this->logoText() );
180 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
181 if ( !$wgDisableCounters ) {
182 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
184 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
187 $tpl->set('lastmod', $this->lastModified());
188 $tpl->set('copyright',$this->getCopyright());
190 $this->credits
= false;
192 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
193 require_once("Credits.php");
194 $this->credits
= getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
197 $tpl->setRef( 'credits', $this->credits
);
199 } elseif ( isset( $oldid ) && !isset( $diff ) ) {
200 $tpl->set('copyright', $this->getCopyright());
203 $tpl->set( 'copyrightico', $this->getCopyrightIcon() );
204 $tpl->set( 'poweredbyico', $this->getPoweredBy() );
205 $tpl->set( 'disclaimer', $this->disclaimerLink() );
206 $tpl->set( 'about', $this->aboutLink() );
208 $tpl->setRef( 'debug', $out->mDebugtext
);
209 $tpl->set( 'reporttime', $out->reportTime() );
210 $tpl->set( 'sitenotice', $wgSiteNotice );
212 $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
213 $out->mBodytext
.= $printfooter ;
214 $tpl->setRef( 'bodytext', $out->mBodytext
);
216 $language_urls = array();
217 foreach( $wgOut->getLanguageLinks() as $l ) {
218 $nt = Title
::newFromText( $l );
219 $language_urls[] = array('href' => $nt->getFullURL(),
220 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?
$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
221 'class' => $wgLang->isRTL() ?
'rtl' : 'ltr');
223 if(count($language_urls)) {
224 $tpl->setRef( 'language_urls', $language_urls);
226 $tpl->set('language_urls', false);
228 $tpl->set('personal_urls', $this->buildPersonalUrls());
229 $content_actions = $this->buildContentActionUrls();
230 $tpl->setRef('content_actions', $content_actions);
231 // XXX: attach this from javascript, same with section editing
232 if($this->iseditable
&& $wgUser->getOption("editondblclick") )
234 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
236 $tpl->set('body-ondblclick', false);
238 $tpl->set( 'nav_urls', $this->buildNavUrls() );
241 $res = $tpl->execute();
242 // result may be an error
243 if (PEAR
::isError($res)) {
244 echo $res->toString(), "\n";
251 # build array of urls for personal toolbar
252 function buildPersonalUrls() {
253 /* set up the default links for the personal toolbar */
254 global $wgShowIPinHeader;
255 $personal_urls = array();
256 if ($this->loggedin
) {
257 $personal_urls['userpage'] = array(
258 'text' => $this->username
,
259 'href' => &$this->userpageUrlDetails
['href'],
260 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
262 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
263 $personal_urls['mytalk'] = array(
264 'text' => wfMsg('mytalk'),
265 'href' => &$usertalkUrlDetails['href'],
266 'class' => $usertalkUrlDetails['exists']?
false:'new'
268 $personal_urls['preferences'] = array(
269 'text' => wfMsg('preferences'),
270 'href' => $this->makeSpecialUrl('Preferences')
272 $personal_urls['watchlist'] = array(
273 'text' => wfMsg('watchlist'),
274 'href' => $this->makeSpecialUrl('Watchlist')
276 $personal_urls['mycontris'] = array(
277 'text' => wfMsg('mycontris'),
278 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username
) )
280 $personal_urls['logout'] = array(
281 'text' => wfMsg('userlogout'),
282 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl
)
285 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
286 $personal_urls['anonuserpage'] = array(
287 'text' => $this->username
,
288 'href' => &$this->userpageUrlDetails
['href'],
289 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
291 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
292 $personal_urls['anontalk'] = array(
293 'text' => wfMsg('anontalk'),
294 'href' => &$usertalkUrlDetails['href'],
295 'class' => $usertalkUrlDetails['exists']?
false:'new'
297 $personal_urls['anonlogin'] = array(
298 'text' => wfMsg('userlogin'),
299 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
303 $personal_urls['login'] = array(
304 'text' => wfMsg('userlogin'),
305 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
310 return $personal_urls;
313 # an array of edit links by default used for the tabs
314 function buildContentActionUrls () {
315 global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
316 $action = $wgRequest->getText( 'action' );
317 $section = $wgRequest->getText( 'section' );
318 $oldid = $wgRequest->getVal( 'oldid' );
319 $diff = $wgRequest->getVal( 'diff' );
320 $content_actions = array();
322 if( $this->iscontent
) {
324 $nskey = $this->getNameSpaceKey();
325 $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
326 if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
327 $content_actions[$nskey] = array('class' => ($is_active) ?
'selected' : false,
328 'text' => wfMsg($nskey),
329 'href' => $this->makeArticleUrl($this->thispage
));
331 /* set up the classes for the talk link */
332 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ?
'selected' : false);
333 $talktitle = Title
::newFromText( $this->titletxt
);
334 $talktitle = $talktitle->getTalkPage();
335 $this->checkTitle($talktitle, $this->titletxt
);
336 if($talktitle->getArticleId() != 0) {
337 $content_actions['talk'] = array(
338 'class' => $talk_class,
339 'text' => wfMsg('talk'),
340 'href' => $this->makeTalkUrl($this->titletxt
)
343 $content_actions['talk'] = array(
344 'class' => $talk_class?
$talk_class.' new':'new',
345 'text' => wfMsg('talk'),
346 'href' => $this->makeTalkUrl($this->titletxt
,'action=edit')
350 if ( $wgTitle->userCanEdit() ) {
351 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : false;
352 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
353 $istalkclass = $istalk?
' istalk':'';
354 $content_actions['edit'] = array(
355 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ?
'selected' : '').$istalkclass,
356 'text' => wfMsg('edit'),
357 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid)
360 $content_actions['addsection'] = array(
361 'class' => $section == 'new'?
'selected':false,
362 'text' => wfMsg('addsection'),
363 'href' => $this->makeUrl($this->thispage
, 'action=edit§ion=new')
367 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : '';
368 $content_actions['viewsource'] = array('class' => ($action == 'edit') ?
'selected' : false,
369 'text' => wfMsg('viewsource'),
370 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid));
373 if ( $wgTitle->getArticleId() ) {
375 $content_actions['history'] = array('class' => ($action == 'history') ?
'selected' : false,
376 'text' => wfMsg('history_short'),
377 'href' => $this->makeUrl($this->thispage
, 'action=history'));
379 # XXX: is there a rollback action anywhere or is it planned?
380 # Don't recall where i got this from...
381 /*if( $wgUser->getNewtalk() ) {
382 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
383 'text' => wfMsg('rollback_short'),
384 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
385 'ttip' => wfMsg('tooltip-rollback'),
386 'akey' => wfMsg('accesskey-rollback'));
389 if($wgUser->isSysop()){
390 if(!$wgTitle->isProtected()){
391 $content_actions['protect'] = array(
392 'class' => ($action == 'protect') ?
'selected' : false,
393 'text' => wfMsg('protect'),
394 'href' => $this->makeUrl($this->thispage
, 'action=protect')
398 $content_actions['unprotect'] = array(
399 'class' => ($action == 'unprotect') ?
'selected' : false,
400 'text' => wfMsg('unprotect'),
401 'href' => $this->makeUrl($this->thispage
, 'action=unprotect')
404 $content_actions['delete'] = array(
405 'class' => ($action == 'delete') ?
'selected' : false,
406 'text' => wfMsg('delete'),
407 'href' => $this->makeUrl($this->thispage
, 'action=delete')
410 if ( $wgUser->getID() != 0 ) {
411 if ( $wgTitle->userCanEdit()) {
412 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace
== Namespace::getSpecial()) ?
'selected' : false,
413 'text' => wfMsg('move'),
414 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage
))
417 $content_actions['move'] = array('class' => 'inactive',
418 'text' => wfMsg('move'),
424 //article doesn't exist or is deleted
425 if($wgUser->isSysop()){
426 if( $n = $wgTitle->isDeleted() ) {
427 $content_actions['delete'] = array(
429 'text' => wfMsg( "undelete_short", $n ),
430 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage
)
436 if ( $wgUser->getID() != 0 and $action != 'edit' and $action != 'submit' ) {
437 if( !$wgTitle->userIsWatching()) {
438 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ?
'selected' : false,
439 'text' => wfMsg('watch'),
440 'href' => $this->makeUrl($this->thispage
, 'action=watch'));
442 $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ?
'selected' : false,
443 'text' => wfMsg('unwatch'),
444 'href' => $this->makeUrl($this->thispage
, 'action=unwatch'));
449 if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
451 $article_time = "×tamp=" . $wgArticle->mTimestamp
;
452 $content_actions['validate'] = array('class' => ($action == 'validate') ?
'selected' : false ,
453 'text' => wfMsg('val_tab'),
454 'href' => $this->makeUrl($this->thispage
, 'action=validate'.$article_time));
458 /* show special page tab */
460 $content_actions['article'] = array('class' => 'selected',
461 'text' => wfMsg('specialpage'),
465 return $content_actions;
468 # build array of common navigation links
469 function buildNavUrls () {
470 global $wgTitle, $wgUser, $wgRequest;
471 global $wgSiteSupportPage, $wgDisableUploads;
473 $action = $wgRequest->getText( 'action' );
474 $oldid = $wgRequest->getVal( 'oldid' );
475 $diff = $wgRequest->getVal( 'diff' );
476 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
478 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
479 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
480 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
481 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
482 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
483 $nav_urls['portal'] = (wfMsg('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
484 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
485 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
486 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
487 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
488 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
489 if( $this->loggedin
&& !$wgDisableUploads ) {
490 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
492 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
494 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
495 $id = User
::idFromName($wgTitle->getText());
496 $ip = User
::isIP($wgTitle->getText());
502 if($id ||
$ip) { # both anons and non-anons have contri list
503 $nav_urls['contributions'] = array(
504 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
507 if ( 0 != $wgUser->getID() ) { # show only to signed in users
508 if($id) { # can only email non-anons
509 $nav_urls['emailuser'] = array(
510 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
519 # Generate strings used for xml 'id' names
520 function getNameSpaceKey () {
522 switch ($wgTitle->getNamespace()) {
530 return 'nstab-media';
532 return 'nstab-special';
534 case NS_PROJECT_TALK
:
538 return 'nstab-image';
540 case NS_MEDIAWIKI_TALK
:
541 return 'nstab-mediawiki';
543 case NS_TEMPLATE_TALK
:
544 return 'nstab-template';
549 case NS_CATEGORY_TALK
:
550 return 'nstab-category';
557 /* private */ function setupUserCssJs () {
558 global $wgRequest, $wgTitle;
559 $action = $wgRequest->getText('action');
561 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&gen=css').'";'."\n";
563 if( $this->loggedin
) {
564 if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
566 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&maxage=0&gen=css').'";'."\n";
568 $this->usercss
.= $wgRequest->getText('wpTextbox1');
571 $this->usercss
.= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&gen=css').'";'."\n";
572 # import user stylesheet
573 $this->usercss
.= '@import "'.
574 $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.css', 'action=raw&ctype=text/css').'";'."\n";
576 if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
577 # XXX: additional security check/prompt?
578 $this->userjsprev
= $wgRequest->getText('wpTextbox1');
580 $this->userjs
= $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
585 # returns css with user-specific options
586 function getUserStylesheet() {
587 global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
588 $action = $wgRequest->getText('action');
589 $maxage = $wgRequest->getText('maxage');
590 $s = "/* generated user stylesheet */\n";
591 if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname
.'/rtl.css";'."\n";
593 $this->makeNSUrl(ucfirst($this->skinname
).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI
)."\";\n";
594 if($wgUser->getID() != 0) {
595 if ( 1 == $wgUser->getOption( "underline" ) ) {
596 $s .= "a { text-decoration: underline; }\n";
598 $s .= "a { text-decoration: none; }\n";
601 if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
602 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
604 if ( 1 == $wgUser->getOption( "justify" ) ) {
605 $s .= "#bodyContent { text-align: justify; }\n";
610 function getUserJs() {
611 global $wgUser, $wgStylePath;
612 $s = '/* generated javascript */';
613 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
614 $s .= '/* MediaWiki:'.ucfirst($this->skinname
)." */\n";
615 $s .= wfMsg(ucfirst($this->skinname
).'.js');
620 } // end of if( defined( 'MEDIAWIKI' ) )