From: Timo Tijhof Date: Wed, 4 Jun 2014 19:25:55 +0000 (+0200) Subject: Installer: Simplify css request X-Git-Tag: 1.31.0-rc.0~15472^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=81e74e8d6943be0ed5dfb0bf9248d9f5573cc091;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 66e8bd9715..46348f917c 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -180,9 +180,9 @@ class WebInstaller extends Installer { 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 @@ class WebInstaller extends Installer { } /** - * @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 c3fd51de76..fd6ed00994 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -125,11 +125,9 @@ class WebInstallerOutput { * 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 @@ class WebInstallerOutput { $css = $prepend . $css; - if ( $dir == 'rtl' ) { + if ( $this->getDir() == 'rtl' ) { $css = CSSJanus::transform( $css, true ); } @@ -208,12 +206,12 @@ class WebInstallerOutput { } /** - * "" to index.php?css=foobar for the "" + * "" to index.php?css=1 for the "" * * @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 ) {