http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97624

Revision: 97624
Author:   reedy
Date:     2011-09-20 13:23:41 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
MFT r93557, revert r97588 in 1.18wmf1 AND REL1_18

Modified Paths:
--------------
    branches/REL1_18/phase3/includes/OutputPage.php
    branches/wmf/1.18wmf1/includes/OutputPage.php

Property Changed:
----------------
    branches/REL1_18/phase3/includes/OutputPage.php
    branches/wmf/1.18wmf1/includes/OutputPage.php

Modified: branches/REL1_18/phase3/includes/OutputPage.php
===================================================================
--- branches/REL1_18/phase3/includes/OutputPage.php     2011-09-20 13:21:00 UTC 
(rev 97623)
+++ branches/REL1_18/phase3/includes/OutputPage.php     2011-09-20 13:23:41 UTC 
(rev 97624)
@@ -18,7 +18,7 @@
  *
  * @todo document
  */
-class OutputPage {
+class OutputPage extends ContextSource {
        /// Should be private. Used with addMeta() which adds <meta>
        var $mMetatags = array();
 
@@ -196,8 +196,6 @@
 
        var $mFileVersion = null;
 
-       private $mContext;
-
        /**
         * An array of stylesheet filenames (relative from skins path), with 
options
         * for CSS media, IE conditions, and RTL/LTR direction.
@@ -226,7 +224,7 @@
         * a OutputPage tied to that context.
         */
        function __construct( IContextSource $context = null ) {
-               $this->mContext = $context;
+               $this->setContext( $context );
        }
 
        /**
@@ -784,29 +782,6 @@
        }
 
        /**
-        * Get the RequestContext used in this instance
-        *
-        * @return RequestContext
-        */
-       private function getContext() {
-               if ( !isset($this->mContext) ) {
-                       wfDebug( __METHOD__ . " called and \$mContext is null. 
Using RequestContext::getMain(); for sanity\n" );
-                       $this->mContext = RequestContext::getMain();
-               }
-               return $this->mContext;
-       }
-
-       /**
-        * Get the WebRequest being used for this instance
-        *
-        * @return WebRequest
-        * @since 1.18
-        */
-       public function getRequest() {
-               return $this->getContext()->getRequest();
-       }
-
-       /**
         * Set the Title object to use
         *
         * @param $t Title object
@@ -815,36 +790,8 @@
                $this->getContext()->setTitle( $t );
        }
 
-       /**
-        * Get the Title object used in this instance
-        *
-        * @return Title
-        */
-       public function getTitle() {
-               return $this->getContext()->getTitle();
-       }
 
        /**
-        * Get the User object used in this instance
-        *
-        * @return User
-        * @since 1.18
-        */
-       public function getUser() {
-               return $this->getContext()->getUser();
-       }
-
-       /**
-        * Get the Skin object used to render this instance
-        *
-        * @return Skin
-        * @since 1.18
-        */
-       public function getSkin() {
-               return $this->getContext()->getSkin();
-       }
-
-       /**
         * Replace the subtile with $str
         *
         * @param $str String: new value of the subtitle
@@ -2257,8 +2204,8 @@
         * @return String: The doctype, opening <html>, and head element.
         */
        public function headElement( Skin $sk, $includeStyle = true ) {
-               global $wgLang, $wgContLang, $wgUseTrackbacks;
-               $userdir = $wgLang->getDir();
+               global $wgContLang, $wgUseTrackbacks;
+               $userdir = $this->getLang()->getDir();
                $sitedir = $wgContLang->getDir();
 
                if ( $sk->commonPrintStylesheet() ) {
@@ -2266,7 +2213,7 @@
                }
                $sk->setupUserCss( $this );
 
-               $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 
'dir' => $userdir ) );
+               $ret = Html::htmlHeader( array( 'lang' => 
$this->getLang()->getCode(), 'dir' => $userdir ) );
 
                if ( $this->getHTMLTitle() == '' ) {
                        $this->setHTMLTitle( wfMsg( 'pagetitle', 
$this->getPageTitle() ) );
@@ -2958,8 +2905,7 @@
         * @param $flip Boolean: Whether to flip the CSS if needed
         */
        public function addInlineStyle( $style_css, $flip = false ) {
-               global $wgLang;
-               if( $flip && $wgLang->isRTL() ) {
+               if( $flip && $this->getLang()->isRTL() ) {
                        # If wanted, and the interface is right-to-left, flip 
the CSS
                        $style_css = CSSJanus::transform( $style_css, true, 
false );
                }
@@ -3029,8 +2975,7 @@
         */
        protected function styleLink( $style, $options ) {
                if( isset( $options['dir'] ) ) {
-                       global $wgLang;
-                       if( $wgLang->getDir() != $options['dir'] ) {
+                       if( $this->getLang()->getDir() != $options['dir'] ) {
                                return '';
                        }
                }


Property changes on: branches/REL1_18/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/REL1_17/phase3/includes/OutputPage.php:81445
/branches/resourceloader/phase3/includes/OutputPage.php:68366-69676,69678-70682,70684-71999,72001-72255,72257-72305,72307-72342
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
/trunk/phase3/includes/OutputPage.php:92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92580-92581,92713,92765,92884,92886-92887,92894,92898,92907,92932,93149,93151,93233-93234,93258,93266,93288,93382-93383,93516-93518,93818-93822,93847,93858,93891,93935-93936,94068,94155,94212,94235-94236,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94728,94737-94738,94825,94862,94990,94995-94997,95000-95002,95006-95007,95010-95011,95023,95072-95073,95171,95327,95409,95422,95426,95436,95458,95467,95470,95475,95493,95521,95525,95540,95601,95655,95894,96227,96261,96263,96384,96386,96393,96405,96427,96460,96472,97159
   + /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/REL1_17/phase3/includes/OutputPage.php:81445
/branches/resourceloader/phase3/includes/OutputPage.php:68366-69676,69678-70682,70684-71999,72001-72255,72257-72305,72307-72342
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
/trunk/phase3/includes/OutputPage.php:92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92580-92581,92713,92765,92884,92886-92887,92894,92898,92907,92932,93149,93151,93233-93234,93258,93266,93288,93382-93383,93516-93518,93557,93818-93822,93847,93858,93891,93935-93936,94068,94155,94212,94235-94236,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94728,94737-94738,94825,94862,94990,94995-94997,95000-95002,95006-95007,95010-95011,95023,95072-95073,95171,95327,95409,95422,95426,95436,95458,95467,95470,95475,95493,95521,95525,95540,95601,95655,95894,96227,96261,96263,96384,96386,96393,96405,96427,96460,96472,97159

Modified: branches/wmf/1.18wmf1/includes/OutputPage.php
===================================================================
--- branches/wmf/1.18wmf1/includes/OutputPage.php       2011-09-20 13:21:00 UTC 
(rev 97623)
+++ branches/wmf/1.18wmf1/includes/OutputPage.php       2011-09-20 13:23:41 UTC 
(rev 97624)
@@ -18,7 +18,7 @@
  *
  * @todo document
  */
-class OutputPage {
+class OutputPage extends ContextSource {
        /// Should be private. Used with addMeta() which adds <meta>
        var $mMetatags = array();
 
@@ -196,8 +196,6 @@
 
        var $mFileVersion = null;
 
-       private $mContext;
-
        /**
         * An array of stylesheet filenames (relative from skins path), with 
options
         * for CSS media, IE conditions, and RTL/LTR direction.
@@ -226,7 +224,7 @@
         * a OutputPage tied to that context.
         */
        function __construct( IContextSource $context = null ) {
-               $this->mContext = $context;
+               $this->setContext( $context );
        }
 
        /**
@@ -784,29 +782,6 @@
        }
 
        /**
-        * Get the RequestContext used in this instance
-        *
-        * @return RequestContext
-        */
-       private function getContext() {
-               if ( !isset($this->mContext) ) {
-                       wfDebug( __METHOD__ . " called and \$mContext is null. 
Using RequestContext::getMain(); for sanity\n" );
-                       $this->mContext = RequestContext::getMain();
-               }
-               return $this->mContext;
-       }
-
-       /**
-        * Get the WebRequest being used for this instance
-        *
-        * @return WebRequest
-        * @since 1.18
-        */
-       public function getRequest() {
-               return $this->getContext()->getRequest();
-       }
-
-       /**
         * Set the Title object to use
         *
         * @param $t Title object
@@ -815,36 +790,8 @@
                $this->getContext()->setTitle( $t );
        }
 
-       /**
-        * Get the Title object used in this instance
-        *
-        * @return Title
-        */
-       public function getTitle() {
-               return $this->getContext()->getTitle();
-       }
 
        /**
-        * Get the User object used in this instance
-        *
-        * @return User
-        * @since 1.18
-        */
-       public function getUser() {
-               return $this->getContext()->getUser();
-       }
-
-       /**
-        * Get the Skin object used to render this instance
-        *
-        * @return Skin
-        * @since 1.18
-        */
-       public function getSkin() {
-               return $this->getContext()->getSkin();
-       }
-
-       /**
         * Replace the subtile with $str
         *
         * @param $str String: new value of the subtitle
@@ -2257,8 +2204,8 @@
         * @return String: The doctype, opening <html>, and head element.
         */
        public function headElement( Skin $sk, $includeStyle = true ) {
-               global $wgLang, $wgContLang, $wgUseTrackbacks;
-               $userdir = $wgLang->getDir();
+               global $wgContLang, $wgUseTrackbacks;
+               $userdir = $this->getLang()->getDir();
                $sitedir = $wgContLang->getDir();
 
                if ( $sk->commonPrintStylesheet() ) {
@@ -2266,7 +2213,7 @@
                }
                $sk->setupUserCss( $this );
 
-               $ret = Html::htmlHeader( array( 'lang' => $wgLang->getCode(), 
'dir' => $userdir ) );
+               $ret = Html::htmlHeader( array( 'lang' => 
$this->getLang()->getCode(), 'dir' => $userdir ) );
 
                if ( $this->getHTMLTitle() == '' ) {
                        $this->setHTMLTitle( wfMsg( 'pagetitle', 
$this->getPageTitle() ) );
@@ -2958,8 +2905,7 @@
         * @param $flip Boolean: Whether to flip the CSS if needed
         */
        public function addInlineStyle( $style_css, $flip = false ) {
-               global $wgLang;
-               if( $flip && $wgLang->isRTL() ) {
+               if( $flip && $this->getLang()->isRTL() ) {
                        # If wanted, and the interface is right-to-left, flip 
the CSS
                        $style_css = CSSJanus::transform( $style_css, true, 
false );
                }
@@ -3029,8 +2975,7 @@
         */
        protected function styleLink( $style, $options ) {
                if( isset( $options['dir'] ) ) {
-                       global $wgLang;
-                       if( $wgLang->getDir() != $options['dir'] ) {
+                       if( $this->getLang()->getDir() != $options['dir'] ) {
                                return '';
                        }
                }


Property changes on: branches/wmf/1.18wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/REL1_17/phase3/includes/OutputPage.php:81445
/branches/resourceloader/phase3/includes/OutputPage.php:68366-69676,69678-70682,70684-71999,72001-72255,72257-72305,72307-72342
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
/trunk/phase3/includes/OutputPage.php:92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92580-92581,92713,92765,92884,92886-92887,92894,92898,92907,92932,93149,93151,93233-93234,93258,93266,93288,93382-93383,93516-93518,93818-93822,93847,93858,93891,93935-93936,94068,94155,94212,94235-94236,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94728,94737-94738,94825,94862,94990,94995-94997,95000-95002,95006-95007,95010-95011,95023,95072-95073,95171,95327,95409,95422,95426,95436,95458,95467,95470,95475,95493,95521,95525,95540,95601,95655,95894,96227,96261,96263,96384,96386,96393,96405,96427,96460,96472,97159
   + /branches/REL1_15/phase3/includes/OutputPage.php:51646
/branches/REL1_17/phase3/includes/OutputPage.php:81445
/branches/resourceloader/phase3/includes/OutputPage.php:68366-69676,69678-70682,70684-71999,72001-72255,72257-72305,72307-72342
/branches/wmf-deployment/includes/OutputPage.php:53381,57468
/trunk/phase3/includes/OutputPage.php:92551-92552,92560,92563-92564,92568,92570,92573-92574,92576,92580-92581,92713,92765,92884,92886-92887,92894,92898,92907,92932,93149,93151,93233-93234,93258,93266,93288,93382-93383,93516-93518,93557,93818-93822,93847,93858,93891,93935-93936,94068,94155,94212,94235-94236,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94728,94737-94738,94825,94862,94990,94995-94997,95000-95002,95006-95007,95010-95011,95023,95072-95073,95171,95327,95409,95422,95426,95436,95458,95467,95470,95475,95493,95521,95525,95540,95601,95655,95894,96227,96261,96263,96384,96386,96393,96405,96427,96460,96472,97159


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to