jenkins-bot has submitted this change and it was merged.

Change subject: Installer: Simplify css request
......................................................................


Installer: Simplify css request

Instead of passing around the direction in the request, just set
'css=1'. We already have the language code and directionality
available and even rely on it between requests to set other
localisation-related things.

Change-Id: I717cb299b3639024e79880039e0d1f2ff273ab44
---
M includes/installer/WebInstaller.php
M includes/installer/WebInstallerOutput.php
2 files changed, 10 insertions(+), 13 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/installer/WebInstaller.php 
b/includes/installer/WebInstaller.php
index 66e8bd9..46348f9 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -180,9 +180,9 @@
                        return $this->session;
                }
 
-               $cssDir = $this->request->getVal( 'css' );
-               if ( $cssDir ) {
-                       $this->outputCss( $cssDir );
+               $isCSS = $this->request->getVal( 'css' );
+               if ( $isCSS ) {
+                       $this->outputCss();
                        return $this->session;
                }
 
@@ -1154,12 +1154,11 @@
        }
 
        /**
-        * @param string $dir CSS direction ( rtl or ltr )
+        * Output stylesheet for web installer pages
         */
-       public function outputCss( $dir ) {
-               $dir = ( $dir == 'rtl' ? 'rtl' : 'ltr' );
+       public function outputCss() {
                $this->request->response()->header( 'Content-type: text/css' );
-               echo $this->output->getCSS( $dir );
+               echo $this->output->getCSS();
        }
 
        /**
diff --git a/includes/installer/WebInstallerOutput.php 
b/includes/installer/WebInstallerOutput.php
index c3fd51d..fd6ed00 100644
--- a/includes/installer/WebInstallerOutput.php
+++ b/includes/installer/WebInstallerOutput.php
@@ -125,11 +125,9 @@
         *   designed to be used in, rather than just grabbing a list of 
filenames from it,
         *   and not properly handling such details as media types in module 
definitions.
         *
-        * @param string $dir 'ltr' or 'rtl'
-        *
         * @return string
         */
-       public function getCSS( $dir ) {
+       public function getCSS() {
                // All CSS files these modules reference will be concatenated 
in sequence
                // and loaded as one file.
                $moduleNames = array(
@@ -200,7 +198,7 @@
 
                $css = $prepend . $css;
 
-               if ( $dir == 'rtl' ) {
+               if ( $this->getDir() == 'rtl' ) {
                        $css = CSSJanus::transform( $css, true );
                }
 
@@ -208,12 +206,12 @@
        }
 
        /**
-        * "<link>" to index.php?css=foobar for the "<head>"
+        * "<link>" to index.php?css=1 for the "<head>"
         *
         * @return string
         */
        private function getCssUrl() {
-               return Html::linkedStyle( $_SERVER['PHP_SELF'] . '?css=' . 
$this->getDir() );
+               return Html::linkedStyle( $_SERVER['PHP_SELF'] . '?css=1' );
        }
 
        public function useShortHeader( $use = true ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/137402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I717cb299b3639024e79880039e0d1f2ff273ab44
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Waldir <wal...@email.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to