Merge "Installer: output css correctly when session errors occur"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 27 May 2014 18:15:37 +0000 (18:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 27 May 2014 18:15:37 +0000 (18:15 +0000)
1  2 
includes/installer/WebInstaller.php

@@@ -61,7 -61,7 +61,7 @@@ class WebInstaller extends Installer 
         * To add a new installer page:
         *    * Add it to this WebInstaller::$pageSequence property
         *    * Add a "config-page-<name>" message
 -       *    * Add a "WebInstaller_<name>" class
 +       *    * Add a "WebInstaller<name>" class
         *
         * @var string[]
         */
  
                $cssDir = $this->request->getVal( 'css' );
                if ( $cssDir ) {
-                       $cssDir = ( $cssDir == 'rtl' ? 'rtl' : 'ltr' );
-                       $this->request->response()->header( 'Content-type: text/css' );
-                       echo $this->output->getCSS( $cssDir );
+                       $this->outputCss( $cssDir );
                        return $this->session;
                }
  
                restore_error_handler();
  
                if ( $this->phpErrors ) {
-                       $this->showError( 'config-session-error', $this->phpErrors[0] );
                        return false;
                }
  
         * @return WebInstallerPage
         */
        public function getPageByName( $pageName ) {
 -              $pageClass = 'WebInstaller_' . $pageName;
 +              $pageClass = 'WebInstaller' . $pageName;
  
                return new $pageClass( $this );
        }
                $html = $this->parse( $text, true );
  
                return "<div class=\"mw-help-field-container\">\n" .
 -                      "<span class=\"mw-help-field-hint\">" . wfMessage( 'config-help' )->escaped() .
 -                      "</span>\n" .
 +                      "<span class=\"mw-help-field-hint\" title=\"" .
 +                      wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
 +                      wfMessage( 'config-help' )->escaped() . "</span>\n" .
                        "<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
                        "</div>\n";
        }
         * @return string Html for download link
         */
        public function downloadLinkHook( $text, $attribs, $parser ) {
 -              $img = Html::element( 'img', array(
 -                      'src' => '../skins/common/images/download-32.png',
 -                      'width' => '32',
 -                      'height' => '32',
 -              ) );
                $anchor = Html::rawElement( 'a',
                        array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
 -                      $img . ' ' . wfMessage( 'config-download-localsettings' )->parse() );
 +                      wfMessage( 'config-download-localsettings' )->parse()
 +              );
  
                return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
        }
                return WebRequest::detectServer();
        }
  
+       /**
+        * @param string $dir CSS direction ( rtl or ltr )
+        */
+       public function outputCss( $dir ) {
+               $dir = ( $dir == 'rtl' ? 'rtl' : 'ltr' );
+               $this->request->response()->header( 'Content-type: text/css' );
+               echo $this->output->getCSS( $dir );
+       }
+       /**
+        * @return string[]
+        */
+       public function getPhpErrors() {
+               return $this->phpErrors;
+       }
  }