Step 3: Balance the quotes directly on $text
[lhc/web/wiklou.git] / includes / Skin.php
index 0777292..d00d762 100644 (file)
@@ -24,7 +24,7 @@ class Skin extends Linker {
        /**#@-*/
        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 */
@@ -303,12 +303,6 @@ class Skin extends Linker {
 
                $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" );
@@ -384,7 +378,7 @@ class Skin extends Linker {
                $vars = array(
                        'skin' => $skinName,
                        'stylepath' => $wgStylePath,
-                       'urlprotocols' => wfUrlProtocols(),
+                       'wgUrlProtocols' => wfUrlProtocols(),
                        'wgArticlePath' => $wgArticlePath,
                        'wgScriptPath' => $wgScriptPath,
                        'wgScriptExtension' => $wgScriptExtension,
@@ -498,14 +492,14 @@ class Skin extends Linker {
 
                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;
                }
@@ -514,7 +508,7 @@ class Skin extends Linker {
                // 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;
                }
@@ -657,30 +651,6 @@ CSS;
                $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 ) {
@@ -1127,7 +1097,7 @@ CSS;
                global $wgOut;
 
                $sub = $wgOut->getSubtitle();
-               if ( '' == $sub ) {
+               if ( $sub == '' ) {
                        global $wgExtraSubtitle;
                        $sub = wfMsgExt( 'tagline', 'parsemag' ) . $wgExtraSubtitle;
                }
@@ -1530,7 +1500,7 @@ CSS;
        }
 
        function logoText( $align = '' ) {
-               if ( '' != $align ) {
+               if ( $align != '' ) {
                        $a = " align='{$align}'";
                } else {
                        $a = '';
@@ -1839,7 +1809,7 @@ CSS;
                        $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>";
                }