Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / installer / WebInstaller.php
index 42672ca..46348f9 100644 (file)
@@ -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[]
         */
@@ -180,12 +180,9 @@ class WebInstaller extends Installer {
                        return $this->session;
                }
 
-               $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 );
-
+               $isCSS = $this->request->getVal( 'css' );
+               if ( $isCSS ) {
+                       $this->outputCss();
                        return $this->session;
                }
 
@@ -354,8 +351,6 @@ class WebInstaller extends Installer {
                restore_error_handler();
 
                if ( $this->phpErrors ) {
-                       $this->showError( 'config-session-error', $this->phpErrors[0] );
-
                        return false;
                }
 
@@ -392,7 +387,7 @@ class WebInstaller extends Installer {
 
        /**
         * Show an error message in a box. Parameters are like wfMessage().
-        * @param $msg
+        * @param string $msg
         */
        public function showError( $msg /*...*/ ) {
                $args = func_get_args();
@@ -462,7 +457,7 @@ class WebInstaller extends Installer {
         * @return WebInstallerPage
         */
        public function getPageByName( $pageName ) {
-               $pageClass = 'WebInstaller_' . $pageName;
+               $pageClass = 'WebInstaller' . $pageName;
 
                return new $pageClass( $this );
        }
@@ -691,7 +686,7 @@ class WebInstaller extends Installer {
         * Get small text indented help for a preceding form field.
         * Parameters like wfMessage().
         *
-        * @param $msg
+        * @param string $msg
         * @return string
         */
        public function getHelpBox( $msg /*, ... */ ) {
@@ -702,8 +697,9 @@ class WebInstaller extends Installer {
                $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";
        }
@@ -747,9 +743,9 @@ class WebInstaller extends Installer {
         * Label a control by wrapping a config-input div around it and putting a
         * label before it.
         *
-        * @param $msg
-        * @param $forId
-        * @param $contents
+        * @param string $msg
+        * @param string $forId
+        * @param string $contents
         * @param string $helpData
         * @return string
         */
@@ -1117,14 +1113,10 @@ class WebInstaller extends Installer {
         * @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 );
        }
@@ -1155,10 +1147,25 @@ class WebInstaller extends Installer {
        }
 
        /**
-        * @return String
+        * @return string
         */
        protected function envGetDefaultServer() {
                return WebRequest::detectServer();
        }
 
+       /**
+        * Output stylesheet for web installer pages
+        */
+       public function outputCss() {
+               $this->request->response()->header( 'Content-type: text/css' );
+               echo $this->output->getCSS();
+       }
+
+       /**
+        * @return string[]
+        */
+       public function getPhpErrors() {
+               return $this->phpErrors;
+       }
+
 }