/**#@-*/
protected $mRevisionId; // The revision ID we're looking at, null if not applicable.
protected $skinname = 'standard';
- // @fixme Should be protected :-\
+ // @todo Fixme: should be protected :-\
var $mTitle = null;
/** Constructor, call parent constructor */
$out->out( $out->headElement( $this ) );
- $out->out( "\n<body" );
- $ops = $this->getBodyOptions();
- foreach ( $ops as $name => $val ) {
- $out->out( " $name='$val'" );
- }
- $out->out( ">\n" );
if ( $wgDebugComments ) {
$out->out( "<!-- Wiki debugging output:\n" .
$out->mDebugtext . "-->\n" );
$vars = array(
'skin' => $skinName,
'stylepath' => $wgStylePath,
- 'urlprotocols' => wfUrlProtocols(),
+ 'wgUrlProtocols' => wfUrlProtocols(),
'wgArticlePath' => $wgArticlePath,
'wgScriptPath' => $wgScriptPath,
'wgScriptExtension' => $wgScriptExtension,
wfProfileIn( __METHOD__ );
if( !$skinName ) {
- $skinName = $this->getSkinName();
+ $skinName = $this->getSkinName();
}
$s = "/* generated javascript */\n";
$s .= "var skin = '" . Xml::escapeJsString($skinName ) . "';\n";
$s .= "var stylepath = '" . Xml::escapeJsString( $wgStylePath ) . "';";
$s .= "\n\n/* MediaWiki:Common.js */\n";
- $commonJs = wfMsgForContent( 'common.js' );
+ $commonJs = wfMsgExt( 'common.js', 'content' );
if ( !wfEmptyMsg( 'common.js', $commonJs ) ) {
$s .= $commonJs;
}
// avoid inclusion of non defined user JavaScript (with custom skins only)
// by checking for default message content
$msgKey = ucfirst( $skinName ) . '.js';
- $userJS = wfMsgForContent( $msgKey );
+ $userJS = wfMsgExt( $msgKey, 'content' );
if ( !wfEmptyMsg( $msgKey, $userJS ) ) {
$s .= $userJS;
}
$out->addStyle( 'common/common_rtl.css', '', '', 'rtl' );
}
- function getBodyOptions() {
- global $wgUser, $wgOut, $wgRequest, $wgContLang;
-
- extract( $wgRequest->getValues( 'oldid', 'redirect', 'diff' ) );
-
- if ( 0 != $this->mTitle->getNamespace() ) {
- $a = array( 'bgcolor' => '#ffffec' );
- }
- else $a = array( 'bgcolor' => '#FFFFFF' );
- if( $wgOut->isArticle() && $wgUser->getOption( 'editondblclick' ) &&
- $this->mTitle->quickUserCan( 'edit' ) ) {
- $s = $this->mTitle->getFullURL( $this->editUrlOptions() );
- $s = 'document.location = "' .Xml::escapeJsString( $s ) .'";';
- $a += array( 'ondblclick' => $s );
- }
- $a['onload'] = $wgOut->getOnloadHandler();
- $a['class'] =
- 'mediawiki' .
- ' '.( $wgContLang->getDir() ).
- ' '.$this->getPageClasses( $this->mTitle ) .
- ' skin-'. Sanitizer::escapeClass( $this->getSkinName() );
- return $a;
- }
-
function getPageClasses( $title ) {
$numeric = 'ns-'.$title->getNamespace();
if( $title->getNamespace() == NS_SPECIAL ) {
global $wgOut;
$sub = $wgOut->getSubtitle();
- if ( '' == $sub ) {
+ if ( $sub == '' ) {
global $wgExtraSubtitle;
$sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
}
}
function logoText( $align = '' ) {
- if ( '' != $align ) {
+ if ( $align != '' ) {
$a = " align='{$align}'";
} else {
$a = '';
$url = $nt->escapeFullURL();
$text = $wgContLang->getLanguageName( $nt->getInterwiki() );
- if ( '' == $text ) { $text = $l; }
+ if ( $text == '' ) { $text = $l; }
$style = $this->getExternalLinkAttributes();
$s .= "<a href=\"{$url}\"{$style}>{$text}</a>";
}