2 # This program is free software; you can redistribute it and/or modify
3 # it under the terms of the GNU General Public License as published by
4 # the Free Software Foundation; either version 2 of the License, or
5 # (at your option) any later version.
7 # This program is distributed in the hope that it will be useful,
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 # GNU General Public License for more details.
12 # You should have received a copy of the GNU General Public License along
13 # with this program; if not, write to the Free Software Foundation, Inc.,
14 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 # http://www.gnu.org/copyleft/gpl.html
18 * Generic PHPTal (http://phptal.sourceforge.net/) skin
19 * Based on Brion's smarty skin
20 * Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
22 * Todo: Needs some serious refactoring into functions that correspond
23 * to the computations individual esi snippets need. Most importantly no body
24 * parsing for most of those of course.
26 * Set this in LocalSettings to enable phptal:
27 * set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
28 * $wgUsePHPTal = true;
34 * This is not a valid entry point, perform no further processing unless
35 * MEDIAWIKI is defined
37 if( defined( 'MEDIAWIKI' ) ) {
39 require_once 'GlobalFunctions.php';
41 require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
47 class MediaWiki_I18N
extends PHPTAL_I18N
{
48 var $_context = array();
50 function set($varName, $value) {
51 $this->_context
[$varName] = $value;
54 function translate($value) {
55 $value = wfMsg( $value );
56 // interpolate variables
57 while (preg_match('/\$([0-9]*?)/sm', $value, $m)) {
58 list($src, $var) = $m;
60 $varValue = $this->_context
[$var];
62 $value = str_replace($src, $varValue, $value);
72 class SkinPHPTal
extends Skin
{
75 function initPage( &$out ) {
76 parent
::initPage( $out );
77 $this->skinname
= 'monobook';
78 $this->template
= 'MonoBook';
82 * initialize various variables and generate the template
84 function outputPage( &$out ) {
85 global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgOut;
86 global $wgScript, $wgStylePath, $wgLanguageCode, $wgUseNewInterlanguage;
87 global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
88 global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses, $wgSiteNotice;
89 global $wgMaxCredits, $wgShowCreditsIfMax;
91 extract( $wgRequest->getValues( 'oldid', 'diff' ) );
93 $this->initPage( $out );
94 $tpl = new PHPTAL($this->template
. '.pt', 'skins');
96 #if ( $wgUseDatabaseMessages ) { // uncomment this to fall back to GetText
97 $tpl->setTranslator(new MediaWiki_I18N());
100 $this->thispage
= $wgTitle->getPrefixedDbKey();
101 $this->thisurl
= $wgTitle->getPrefixedURL();
102 $this->loggedin
= $wgUser->getID() != 0;
103 $this->iscontent
= ($wgTitle->getNamespace() != Namespace::getSpecial() );
104 $this->iseditable
= ($this->iscontent
and !($action == 'edit' or $action == 'submit'));
105 $this->username
= $wgUser->getName();
106 $this->userpage
= $wgLang->getNsText( Namespace::getUser() ) . ":" . $wgUser->getName();
107 $this->userpageUrlDetails
= $this->makeUrlDetails($this->userpage
);
109 $this->usercss
= $this->userjs
= $this->userjsprev
= false;
110 $this->setupUserCssJs();
112 $this->titletxt
= $wgTitle->getPrefixedText();
114 $tpl->set( 'title', $wgOut->getPageTitle() );
115 $tpl->set( 'pagetitle', $wgOut->getHTMLTitle() );
117 $tpl->setRef( "thispage", $this->thispage
);
118 $subpagestr = $this->subPageSubtitle();
120 'subtitle', !empty($subpagestr)?
121 '<span class="subpages">'.$subpagestr.'</span>'.$out->getSubtitle():
124 $undelete = $this->getUndeleteLink();
126 "undelete", !empty($undelete)?
127 '<span class="subpages">'.$undelete.'</span>':
131 $tpl->set( 'catlinks', $this->getCategories());
132 if( $wgOut->isSyndicated() ) {
134 foreach( $wgFeedClasses as $format => $class ) {
135 $feeds[$format] = array(
137 'href' => $wgRequest->appendQuery( "feed=$format" ),
138 'ttip' => wfMsg('tooltip-'.$format)
141 $tpl->setRef( 'feeds', $feeds );
143 $tpl->setRef( 'mimetype', $wgMimeType );
144 $tpl->setRef( 'charset', $wgOutputEncoding );
145 $tpl->set( 'headlinks', $out->getHeadLinks() );
146 $tpl->setRef( 'skinname', $this->skinname
);
147 $tpl->setRef( 'loggedin', $this->loggedin
);
148 $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
149 /* XXX currently unused, might get useful later
150 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
151 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
152 $tpl->set( "watch", $wgTitle->userIsWatching() ? "unwatch" : "watch" );
153 $tpl->set( "protect", count($wgTitle->getRestrictions()) ? "unprotect" : "protect" );
154 $tpl->set( "helppage", wfMsg('helppage'));
155 $tpl->set( "sysop", $wgUser->isSysop() );
157 $tpl->set( 'searchaction', $this->escapeSearchLink() );
158 $tpl->setRef( 'stylepath', $wgStylePath );
159 $tpl->setRef( 'logopath', $wgLogo );
160 $tpl->setRef( "lang", $wgLanguageCode );
161 $tpl->set( 'dir', $wgLang->isRTL() ?
"rtl" : "ltr" );
162 $tpl->set( 'rtl', $wgLang->isRTL() );
163 $tpl->set( 'langname', $wgLang->getLanguageName( $wgLanguageCode ) );
164 $tpl->setRef( 'username', $this->username
);
165 $tpl->setRef( 'userpage', $this->userpage
);
166 $tpl->setRef( 'userpageurl', $this->userpageUrlDetails
['href']);
167 $tpl->setRef( 'usercss', $this->usercss
);
168 $tpl->setRef( 'userjs', $this->userjs
);
169 $tpl->setRef( 'userjsprev', $this->userjsprev
);
170 if($this->loggedin
) {
171 $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&smaxage=0&gen=js') );
173 $tpl->set( 'jsvarurl', $this->makeUrl('-','action=raw&gen=js') );
175 if( $wgUser->getNewtalk() ) {
176 $usertitle = Title
::newFromText( $this->userpage
);
177 $usertalktitle = $usertitle->getTalkPage();
178 if($usertalktitle->getPrefixedDbKey() != $this->thispage
){
180 $ntl = wfMsg( 'newmessages',
181 $this->makeKnownLink(
182 $wgLang->getNsText( Namespace::getTalk( Namespace::getUser() ) )
183 . ':' . $this->username
,
184 wfMsg('newmessageslink') )
187 $wgOut->setSquidMaxage(0);
193 $tpl->setRef( 'newtalk', $ntl );
194 $tpl->setRef( 'skin', $this);
195 $tpl->set( 'logo', $this->logoText() );
196 if ( $wgOut->isArticle() and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID() ) {
197 if ( !$wgDisableCounters ) {
198 $viewcount = $wgLang->formatNum( $wgArticle->getCount() );
200 $tpl->set('viewcount', wfMsg( "viewcount", $viewcount ));
203 $tpl->set('lastmod', $this->lastModified());
204 $tpl->set('copyright',$this->getCopyright());
206 $this->credits
= false;
208 if (isset($wgMaxCredits) && $wgMaxCredits != 0) {
209 require_once("Credits.php");
210 $this->credits
= getCredits($wgArticle, $wgMaxCredits, $wgShowCreditsIfMax);
213 $tpl->setRef( 'credits', $this->credits
);
215 } elseif ( isset( $oldid ) && !isset( $diff ) ) {
216 $tpl->set('copyright', $this->getCopyright());
219 $tpl->set( 'copyrightico', $this->getCopyrightIcon() );
220 $tpl->set( 'poweredbyico', $this->getPoweredBy() );
221 $tpl->set( 'disclaimer', $this->disclaimerLink() );
222 $tpl->set( 'about', $this->aboutLink() );
224 $tpl->setRef( 'debug', $out->mDebugtext
);
225 $tpl->set( 'reporttime', $out->reportTime() );
226 $tpl->set( 'sitenotice', $wgSiteNotice );
228 $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n";
229 $out->mBodytext
.= $printfooter ;
230 $tpl->setRef( 'bodytext', $out->mBodytext
);
232 $language_urls = array();
233 foreach( $wgOut->getLanguageLinks() as $l ) {
234 $nt = Title
::newFromText( $l );
235 $language_urls[] = array('href' => $nt->getFullURL(),
236 'text' => ($wgLang->getLanguageName( $nt->getInterwiki()) != ''?
$wgLang->getLanguageName( $nt->getInterwiki()) : $l),
237 'class' => $wgLang->isRTL() ?
'rtl' : 'ltr');
239 if(count($language_urls)) {
240 $tpl->setRef( 'language_urls', $language_urls);
242 $tpl->set('language_urls', false);
244 $tpl->set('personal_urls', $this->buildPersonalUrls());
245 $content_actions = $this->buildContentActionUrls();
246 $tpl->setRef('content_actions', $content_actions);
247 // XXX: attach this from javascript, same with section editing
248 if($this->iseditable
&& $wgUser->getOption("editondblclick") )
250 $tpl->set('body-ondblclick', 'document.location = "' .$content_actions['edit']['href'] .'";');
252 $tpl->set('body-ondblclick', false);
254 $tpl->set( 'nav_urls', $this->buildNavUrls() );
257 $res = $tpl->execute();
258 // result may be an error
259 if (PEAR
::isError($res)) {
260 echo $res->toString(), "\n";
268 * build array of urls for personal toolbar
270 function buildPersonalUrls() {
271 /* set up the default links for the personal toolbar */
272 global $wgShowIPinHeader;
273 $personal_urls = array();
274 if ($this->loggedin
) {
275 $personal_urls['userpage'] = array(
276 'text' => $this->username
,
277 'href' => &$this->userpageUrlDetails
['href'],
278 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
280 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
281 $personal_urls['mytalk'] = array(
282 'text' => wfMsg('mytalk'),
283 'href' => &$usertalkUrlDetails['href'],
284 'class' => $usertalkUrlDetails['exists']?
false:'new'
286 $personal_urls['preferences'] = array(
287 'text' => wfMsg('preferences'),
288 'href' => $this->makeSpecialUrl('Preferences')
290 $personal_urls['watchlist'] = array(
291 'text' => wfMsg('watchlist'),
292 'href' => $this->makeSpecialUrl('Watchlist')
294 $personal_urls['mycontris'] = array(
295 'text' => wfMsg('mycontris'),
296 'href' => $this->makeSpecialUrl('Contributions','target=' . urlencode( $this->username
) )
298 $personal_urls['logout'] = array(
299 'text' => wfMsg('userlogout'),
300 'href' => $this->makeSpecialUrl('Userlogout','returnto=' . $this->thisurl
)
303 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
304 $personal_urls['anonuserpage'] = array(
305 'text' => $this->username
,
306 'href' => &$this->userpageUrlDetails
['href'],
307 'class' => $this->userpageUrlDetails
['exists']?
false:'new'
309 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage
);
310 $personal_urls['anontalk'] = array(
311 'text' => wfMsg('anontalk'),
312 'href' => &$usertalkUrlDetails['href'],
313 'class' => $usertalkUrlDetails['exists']?
false:'new'
315 $personal_urls['anonlogin'] = array(
316 'text' => wfMsg('userlogin'),
317 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
321 $personal_urls['login'] = array(
322 'text' => wfMsg('userlogin'),
323 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl
)
328 return $personal_urls;
332 * an array of edit links by default used for the tabs
334 function buildContentActionUrls () {
335 global $wgTitle, $wgUser, $wgRequest, $wgUseValidation;
336 $action = $wgRequest->getText( 'action' );
337 $section = $wgRequest->getText( 'section' );
338 $oldid = $wgRequest->getVal( 'oldid' );
339 $diff = $wgRequest->getVal( 'diff' );
340 $content_actions = array();
342 if( $this->iscontent
) {
344 $nskey = $this->getNameSpaceKey();
345 $is_active = !Namespace::isTalk( $wgTitle->getNamespace()) ;
346 if ( $action == 'validate' ) $is_active = false ; # Show article tab deselected when validating
347 $content_actions[$nskey] = array('class' => ($is_active) ?
'selected' : false,
348 'text' => wfMsg($nskey),
349 'href' => $this->makeArticleUrl($this->thispage
));
351 /* set up the classes for the talk link */
352 $talk_class = (Namespace::isTalk( $wgTitle->getNamespace()) ?
'selected' : false);
353 $talktitle = Title
::newFromText( $this->titletxt
);
354 $talktitle = $talktitle->getTalkPage();
355 $this->checkTitle($talktitle, $this->titletxt
);
356 if($talktitle->getArticleId() != 0) {
357 $content_actions['talk'] = array(
358 'class' => $talk_class,
359 'text' => wfMsg('talk'),
360 'href' => $this->makeTalkUrl($this->titletxt
)
363 $content_actions['talk'] = array(
364 'class' => $talk_class?
$talk_class.' new':'new',
365 'text' => wfMsg('talk'),
366 'href' => $this->makeTalkUrl($this->titletxt
,'action=edit')
370 if ( $wgTitle->userCanEdit() ) {
371 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : false;
372 $istalk = ( Namespace::isTalk( $wgTitle->getNamespace()) );
373 $istalkclass = $istalk?
' istalk':'';
374 $content_actions['edit'] = array(
375 'class' => ((($action == 'edit' or $action == 'submit') and $section != 'new') ?
'selected' : '').$istalkclass,
376 'text' => wfMsg('edit'),
377 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid)
380 $content_actions['addsection'] = array(
381 'class' => $section == 'new'?
'selected':false,
382 'text' => wfMsg('addsection'),
383 'href' => $this->makeUrl($this->thispage
, 'action=edit§ion=new')
387 $oid = ( $oldid && ! isset( $diff ) ) ?
'&oldid='.$oldid : '';
388 $content_actions['viewsource'] = array('class' => ($action == 'edit') ?
'selected' : false,
389 'text' => wfMsg('viewsource'),
390 'href' => $this->makeUrl($this->thispage
, 'action=edit'.$oid));
393 if ( $wgTitle->getArticleId() ) {
395 $content_actions['history'] = array('class' => ($action == 'history') ?
'selected' : false,
396 'text' => wfMsg('history_short'),
397 'href' => $this->makeUrl($this->thispage
, 'action=history'));
399 # XXX: is there a rollback action anywhere or is it planned?
400 # Don't recall where i got this from...
401 /*if( $wgUser->getNewtalk() ) {
402 $content_actions['rollback'] = array('class' => ($action == 'rollback') ? 'selected' : false,
403 'text' => wfMsg('rollback_short'),
404 'href' => $this->makeUrl($this->thispage, 'action=rollback'),
405 'ttip' => wfMsg('tooltip-rollback'),
406 'akey' => wfMsg('accesskey-rollback'));
409 if($wgUser->isSysop()){
410 if(!$wgTitle->isProtected()){
411 $content_actions['protect'] = array(
412 'class' => ($action == 'protect') ?
'selected' : false,
413 'text' => wfMsg('protect'),
414 'href' => $this->makeUrl($this->thispage
, 'action=protect')
418 $content_actions['unprotect'] = array(
419 'class' => ($action == 'unprotect') ?
'selected' : false,
420 'text' => wfMsg('unprotect'),
421 'href' => $this->makeUrl($this->thispage
, 'action=unprotect')
424 $content_actions['delete'] = array(
425 'class' => ($action == 'delete') ?
'selected' : false,
426 'text' => wfMsg('delete'),
427 'href' => $this->makeUrl($this->thispage
, 'action=delete')
430 if ( $wgUser->getID() != 0 ) {
431 if ( $wgTitle->userCanEdit()) {
432 $content_actions['move'] = array('class' => ($wgTitle->getDbKey() == 'Movepage' and $wgTitle->getNamespace
== Namespace::getSpecial()) ?
'selected' : false,
433 'text' => wfMsg('move'),
434 'href' => $this->makeSpecialUrl('Movepage', 'target='. urlencode( $this->thispage
))
437 $content_actions['move'] = array('class' => 'inactive',
438 'text' => wfMsg('move'),
444 //article doesn't exist or is deleted
445 if($wgUser->isSysop()){
446 if( $n = $wgTitle->isDeleted() ) {
447 $content_actions['delete'] = array(
449 'text' => wfMsg( "undelete_short", $n ),
450 'href' => $this->makeSpecialUrl('Undelete/'.$this->thispage
)
456 if ( $wgUser->getID() != 0 and $action != 'submit' ) {
457 if( !$wgTitle->userIsWatching()) {
458 $content_actions['watch'] = array('class' => ($action == 'watch' or $action == 'unwatch') ?
'selected' : false,
459 'text' => wfMsg('watch'),
460 'href' => $this->makeUrl($this->thispage
, 'action=watch'));
462 $content_actions['unwatch'] = array('class' => ($action == 'unwatch' or $action == 'watch') ?
'selected' : false,
463 'text' => wfMsg('unwatch'),
464 'href' => $this->makeUrl($this->thispage
, 'action=unwatch'));
469 if ( $wgUseValidation && $wgTitle->getArticleId() && $wgTitle->getNamespace() == 0 ) {
471 $article_time = "×tamp=" . $wgArticle->mTimestamp
;
472 $content_actions['validate'] = array('class' => ($action == 'validate') ?
'selected' : false ,
473 'text' => wfMsg('val_tab'),
474 'href' => $this->makeUrl($this->thispage
, 'action=validate'.$article_time));
478 /* show special page tab */
480 $content_actions['article'] = array('class' => 'selected',
481 'text' => wfMsg('specialpage'),
485 return $content_actions;
489 * build array of common navigation links
491 function buildNavUrls () {
492 global $wgTitle, $wgUser, $wgRequest;
493 global $wgSiteSupportPage, $wgDisableUploads;
495 $action = $wgRequest->getText( 'action' );
496 $oldid = $wgRequest->getVal( 'oldid' );
497 $diff = $wgRequest->getVal( 'diff' );
498 // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes
500 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
501 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
502 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
503 $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage
))));
504 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
505 $nav_urls['portal'] = (wfMsg('portal') != '-') ?
array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
506 $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage
))));
507 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
508 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
509 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
510 $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage')));
511 if( $this->loggedin
&& !$wgDisableUploads ) {
512 $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload')));
514 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
516 if( $wgTitle->getNamespace() == NS_USER ||
$wgTitle->getNamespace() == NS_USER_TALK
) {
517 $id = User
::idFromName($wgTitle->getText());
518 $ip = User
::isIP($wgTitle->getText());
524 if($id ||
$ip) { # both anons and non-anons have contri list
525 $nav_urls['contributions'] = array(
526 'href' => htmlspecialchars( $this->makeSpecialUrl('Contributions', "target=" . $wgTitle->getPartialURL() ) )
529 if ( 0 != $wgUser->getID() ) { # show only to signed in users
530 if($id) { # can only email non-anons
531 $nav_urls['emailuser'] = array(
532 'href' => htmlspecialchars( $this->makeSpecialUrl('Emailuser', "target=" . $wgTitle->getPartialURL() ) )
542 * Generate strings used for xml 'id' names
544 function getNameSpaceKey () {
546 switch ($wgTitle->getNamespace()) {
554 return 'nstab-media';
556 return 'nstab-special';
558 case NS_PROJECT_TALK
:
562 return 'nstab-image';
564 case NS_MEDIAWIKI_TALK
:
565 return 'nstab-mediawiki';
567 case NS_TEMPLATE_TALK
:
568 return 'nstab-template';
573 case NS_CATEGORY_TALK
:
574 return 'nstab-category';
584 function setupUserCssJs () {
585 global $wgRequest, $wgTitle;
586 $action = $wgRequest->getText('action');
588 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&gen=css').'";'."\n";
590 if( $this->loggedin
) {
591 if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
593 $this->usercss
= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&maxage=0&gen=css').'";'."\n";
595 $this->usercss
.= $wgRequest->getText('wpTextbox1');
598 $this->usercss
.= '@import "'.$this->makeUrl('-','action=raw&smaxage=0&gen=css').'";'."\n";
599 # import user stylesheet
600 $this->usercss
.= '@import "'.
601 $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.css', 'action=raw&ctype=text/css').'";'."\n";
603 if($wgTitle->isJsSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) {
604 # XXX: additional security check/prompt?
605 $this->userjsprev
= $wgRequest->getText('wpTextbox1');
607 $this->userjs
= $this->makeUrl($this->userpage
.'/'.$this->skinname
.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
613 * returns css with user-specific options
615 function getUserStylesheet() {
616 global $wgUser, $wgRequest, $wgTitle, $wgLang, $wgSquidMaxage, $wgStylePath;
617 $action = $wgRequest->getText('action');
618 $maxage = $wgRequest->getText('maxage');
619 $s = "/* generated user stylesheet */\n";
620 if($wgLang->isRTL()) $s .= '@import "'.$wgStylePath.'/'.$this->skinname
.'/rtl.css";'."\n";
622 $this->makeNSUrl(ucfirst($this->skinname
).'.css', 'action=raw&ctype=text/css&smaxage='.$wgSquidMaxage, NS_MEDIAWIKI
)."\";\n";
623 if($wgUser->getID() != 0) {
624 if ( 1 == $wgUser->getOption( "underline" ) ) {
625 $s .= "a { text-decoration: underline; }\n";
627 $s .= "a { text-decoration: none; }\n";
630 if ( 1 != $wgUser->getOption( "highlightbroken" ) ) {
631 $s .= "a.new, #quickbar a.new { color: #CC2200; }\n";
633 if ( 1 == $wgUser->getOption( "justify" ) ) {
634 $s .= "#bodyContent { text-align: justify; }\n";
642 function getUserJs() {
643 global $wgUser, $wgStylePath;
644 $s = '/* generated javascript */';
645 $s .= "var skin = '{$this->skinname}';\nvar stylepath = '{$wgStylePath}';";
646 $s .= '/* MediaWiki:'.ucfirst($this->skinname
)." */\n";
647 $s .= wfMsg(ucfirst($this->skinname
).'.js');
652 } // end of if( defined( 'MEDIAWIKI' ) )