From 41b92f33438ad8cd757de2336658cea6cba846a7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 6 Dec 2010 07:08:31 +0000 Subject: [PATCH] Reverted r75832 per my comments on CR, unanswered for 19 days. Moving all help information into tooltips is a step backwards for usability. Reverted followups r75836, r75866, r76314 and r76315. --- includes/installer/DatabaseInstaller.php | 68 +++---- includes/installer/Installer.i18n.php | 2 + includes/installer/MysqlInstaller.php | 29 +-- includes/installer/OracleInstaller.php | 11 +- includes/installer/PostgresInstaller.php | 13 +- includes/installer/SqliteInstaller.php | 8 +- includes/installer/WebInstaller.php | 60 +++--- includes/installer/WebInstallerOutput.php | 31 +-- includes/installer/WebInstallerPage.php | 66 +++---- resources/jquery/jquery.tipsy.js | 202 -------------------- skins/common/config.css | 47 +++-- skins/common/config.js | 18 +- skins/common/images/help-22.png | Bin 0 -> 4373 bytes skins/common/images/help-question-hover.gif | Bin 1246 -> 0 bytes skins/common/images/help-question.gif | Bin 126 -> 0 bytes skins/common/images/tipsy-arrow.gif | Bin 205 -> 0 bytes skins/common/shared.css | 20 -- 17 files changed, 190 insertions(+), 385 deletions(-) delete mode 100644 resources/jquery/jquery.tipsy.js create mode 100644 skins/common/images/help-22.png delete mode 100644 skins/common/images/help-question-hover.gif delete mode 100644 skins/common/images/help-question.gif delete mode 100644 skins/common/images/tipsy-arrow.gif diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 26cf53c316..14e1fd2c6c 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -8,7 +8,7 @@ /** * Base class for DBMS-specific installation helper classes. - * + * * @ingroup Deployment * @since 1.17 */ @@ -16,30 +16,30 @@ abstract class DatabaseInstaller { /** * The Installer object. - * + * * TODO: naming this parent is confusing, 'installer' would be clearer. - * + * * @var Installer */ public $parent; /** * The database connection. - * + * * @var DatabaseBase */ public $db; /** * Internal variables for installation. - * + * * @var array */ protected $internalDefaults = array(); /** * Array of MW configuration globals this class uses. - * + * * @var array */ protected $globalNames = array(); @@ -56,7 +56,7 @@ abstract class DatabaseInstaller { /** * Get HTML for a web form that configures this database. Configuration - * at this time should be the minimum needed to connect and test + * at this time should be the minimum needed to connect and test * whether install or upgrade is required. * * If this is called, $this->parent can be assumed to be a WebInstaller. @@ -65,7 +65,7 @@ abstract class DatabaseInstaller { /** * Set variables based on the request array, assuming it was submitted - * via the form returned by getConnectForm(). Validate the connection + * via the form returned by getConnectForm(). Validate the connection * settings by attempting to connect with them. * * If this is called, $this->parent can be assumed to be a WebInstaller. @@ -77,7 +77,7 @@ abstract class DatabaseInstaller { /** * Get HTML for a web form that retrieves settings used for installation. * $this->parent can be assumed to be a WebInstaller. - * If the DB type has no settings beyond those already configured with + * If the DB type has no settings beyond those already configured with * getConnectForm(), this should return false. */ public function getSettingsForm() { @@ -87,7 +87,7 @@ abstract class DatabaseInstaller { /** * Set variables based on the request array, assuming it was submitted via * the form return by getSettingsForm(). - * + * * @return Status */ public function submitSettingsForm() { @@ -96,7 +96,7 @@ abstract class DatabaseInstaller { /** * Connect to the database using the administrative user/password currently - * defined in the session. On success, return the connection, on failure, + * defined in the session. On success, return the connection, on failure, * * This may be called multiple times, so the result should be cached. * @@ -114,7 +114,7 @@ abstract class DatabaseInstaller { /** * Create database tables from scratch. - * + * * @return Status */ public function createTables() { @@ -139,7 +139,7 @@ abstract class DatabaseInstaller { /** * Get the DBMS-specific options for LocalSettings.php generation. - * + * * @return String */ public abstract function getLocalSettings(); @@ -188,19 +188,19 @@ abstract class DatabaseInstaller { */ public function getGlobalNames() { return $this->globalNames; - } + } /** * Return any table options to be applied to all tables that don't * override them. - * + * * @return Array */ public function getTableOptions() { return array(); } - /** + /** * Construct and initialise parent. * This is typically only called from Installer::getDBInstaller() */ @@ -211,7 +211,7 @@ abstract class DatabaseInstaller { /** * Convenience function. * Check if a named extension is present. - * + * * @see wfDl */ protected static function checkExtension( $name ) { @@ -267,19 +267,15 @@ abstract class DatabaseInstaller { /** * Get a labelled text box to configure a local variable. */ - public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) { + public function getTextBox( $var, $label, $attribs = array() ) { $name = $this->getName() . '_' . $var; $value = $this->getVar( $var ); - if ( !isset( $attribs ) ) { - $attribs = array(); - } return $this->parent->getTextBox( array( 'var' => $var, 'label' => $label, 'attribs' => $attribs, 'controlName' => $name, - 'value' => $value, - 'help' => $helpData + 'value' => $value ) ); } @@ -287,26 +283,22 @@ abstract class DatabaseInstaller { * Get a labelled password box to configure a local variable. * Implements password hiding. */ - public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) { + public function getPasswordBox( $var, $label, $attribs = array() ) { $name = $this->getName() . '_' . $var; $value = $this->getVar( $var ); - if ( !isset( $attribs ) ) { - $attribs = array(); - } return $this->parent->getPasswordBox( array( 'var' => $var, 'label' => $label, 'attribs' => $attribs, 'controlName' => $name, - 'value' => $value, - 'help' => $helpData + 'value' => $value ) ); } /** * Get a labelled checkbox to configure a local boolean variable. */ - public function getCheckBox( $var, $label, $attribs = array(), $helpData = "" ) { + public function getCheckBox( $var, $label, $attribs = array() ) { $name = $this->getName() . '_' . $var; $value = $this->getVar( $var ); return $this->parent->getCheckBox( array( @@ -315,7 +307,6 @@ abstract class DatabaseInstaller { 'attribs' => $attribs, 'controlName' => $name, 'value' => $value, - 'help' => $helpData )); } @@ -348,11 +339,11 @@ abstract class DatabaseInstaller { } /** - * Determine whether an existing installation of MediaWiki is present in - * the configured administrative connection. Returns true if there is + * Determine whether an existing installation of MediaWiki is present in + * the configured administrative connection. Returns true if there is * such a wiki, false if the database doesn't exist. * - * Traditionally, this is done by testing for the existence of either + * Traditionally, this is done by testing for the existence of either * the revision table or the cur table. * * @return Boolean @@ -376,8 +367,9 @@ abstract class DatabaseInstaller { return Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) . - $this->getTextBox( '_InstallUser', 'config-db-username', array(), $this->parent->getHelpBox( 'config-db-install-username' ) ) . - $this->getPasswordBox( '_InstallPassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-install-password' ) ) . + $this->getTextBox( '_InstallUser', 'config-db-username' ) . + $this->getPasswordBox( '_InstallPassword', 'config-db-password' ) . + $this->parent->getHelpBox( 'config-db-install-help' ) . Html::closeElement( 'fieldset' ); } @@ -397,7 +389,7 @@ abstract class DatabaseInstaller { public function getWebUserBox( $noCreateMsg = false ) { $s = Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . - $this->getCheckBox( + $this->getCheckBox( '_SameAccount', 'config-db-web-account-same', array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' ) ) . @@ -416,7 +408,7 @@ abstract class DatabaseInstaller { /** * Submit the form from getWebUserBox(). - * + * * @return Status */ public function submitWebUserBox() { diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index b6fa715872..d9f76fe368 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -31,6 +31,8 @@ Restart the installation process.', 'config-no-session' => 'Your session data was lost! Check your php.ini and make sure session.save_path is set to an appropriate directory.', 'config-session-path-bad' => 'Your session.save_path ($1) seems to be invalid or unwritable.', + 'config-show-help' => 'Help', + 'config-hide-help' => 'Hide help', 'config-your-language' => 'Your language:', 'config-your-language-help' => 'Select a language to use during the installation process.', 'config-wiki-language' => 'Wiki language:', diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 033875a298..c87b71b99d 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -8,7 +8,7 @@ /** * Class for setting up the MediaWiki database using MySQL. - * + * * @ingroup Deployment * @since 1.17 */ @@ -59,11 +59,14 @@ class MysqlInstaller extends DatabaseInstaller { public function getConnectForm() { return - $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . + $this->getTextBox( 'wgDBserver', 'config-db-host' ) . + $this->parent->getHelpBox( 'config-db-host-help' ) . Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . - $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . - $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array(), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) . + $this->getTextBox( 'wgDBname', 'config-db-name' ) . + $this->parent->getHelpBox( 'config-db-name-help' ) . + $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . + $this->parent->getHelpBox( 'config-db-prefix-help' ) . Html::closeElement( 'fieldset' ) . $this->getInstallUserBox(); } @@ -117,7 +120,7 @@ class MysqlInstaller extends DatabaseInstaller { $this->getVar( '_InstallPassword' ), false, false, - 0, + 0, $this->getVar( 'wgDBprefix' ) ); $status->value = $this->db; @@ -249,12 +252,12 @@ class MysqlInstaller extends DatabaseInstaller { if ( count( $parts ) != 2 ) { return false; } - $quotedUser = $conn->addQuotes( $parts[0] ) . + $quotedUser = $conn->addQuotes( $parts[0] ) . '@' . $conn->addQuotes( $parts[1] ); // The user needs to have INSERT on mysql.* to be able to CREATE USER // The grantee will be double-quoted in this query, as required - $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', + $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', array( 'GRANTEE' => $quotedUser ), __METHOD__ ); $insertMysql = false; $grantOptions = array_flip( $this->webUserPrivs ); @@ -270,7 +273,7 @@ class MysqlInstaller extends DatabaseInstaller { // Check for DB-specific privs for mysql.* if ( !$insertMysql ) { $row = $conn->selectRow( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', - array( + array( 'GRANTEE' => $quotedUser, 'TABLE_SCHEMA' => 'mysql', 'PRIVILEGE_TYPE' => 'INSERT', @@ -285,7 +288,7 @@ class MysqlInstaller extends DatabaseInstaller { } // Check for DB-level grant options - $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', + $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', array( 'GRANTEE' => $quotedUser, 'IS_GRANTABLE' => 1, @@ -319,9 +322,9 @@ class MysqlInstaller extends DatabaseInstaller { } if ( count( $engines ) >= 2 ) { $s .= $this->getRadioSet( array( - 'var' => '_MysqlEngine', - 'label' => 'config-mysql-engine', - 'itemLabelPrefix' => 'config-mysql-', + 'var' => '_MysqlEngine', + 'label' => 'config-mysql-engine', + 'itemLabelPrefix' => 'config-mysql-', 'values' => $engines )); $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' ); @@ -372,7 +375,7 @@ class MysqlInstaller extends DatabaseInstaller { $this->getVar( 'wgDBpassword' ), false, false, - 0, + 0, $this->getVar( 'wgDBprefix' ) ); } catch ( DBConnectionError $e ) { diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index d9bc098a0b..cc5c6c778e 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -8,7 +8,7 @@ /** * Class for setting up the MediaWiki database using Oracle. - * + * * @ingroup Deployment * @since 1.17 */ @@ -46,7 +46,8 @@ class OracleInstaller extends DatabaseInstaller { Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . Html::openElement( 'div', array( 'id' => 'dbOtherAccount' ) ) . $this->getTextBox( 'wgDBuser', 'config-db-username' ) . - $this->getPasswordBox( 'wgDBpassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-web-help' ) ) . + $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) . + $this->parent->getHelpBox( 'config-db-web-help' ). $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create', array( 'disabled' => true ) ). Html::closeElement( 'div' ) . Html::closeElement( 'fieldset' ); } @@ -55,12 +56,14 @@ class OracleInstaller extends DatabaseInstaller { $this->parent->setVar( '_InstallUser', 'sys' ); $this->parent->setVar( 'wgDBserver', '' ); return - $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) . + $this->getTextBox( 'wgDBserver', 'config-db-host-oracle' ) . + $this->parent->getHelpBox( 'config-db-host-oracle-help' ) . Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . $this->getTextBox( '_OracleDefTS', 'config-oracle-def-ts' ) . - $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts', array(), $this->parent->getHelpBox( 'config-db-oracle-help' ) ) . + $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts' ) . + $this->parent->getHelpBox( 'config-db-oracle-help' ) . Html::closeElement( 'fieldset' ) . $this->getInstallUserBox(). $this->getWebUserBox(); diff --git a/includes/installer/PostgresInstaller.php b/includes/installer/PostgresInstaller.php index 9d832f94ab..9a0a233b39 100644 --- a/includes/installer/PostgresInstaller.php +++ b/includes/installer/PostgresInstaller.php @@ -8,7 +8,7 @@ /** * Class for setting up the MediaWiki database using Postgres. - * + * * @ingroup Deployment * @since 1.17 */ @@ -36,20 +36,23 @@ class PostgresInstaller extends DatabaseInstaller { function getConnectForm() { return - $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . + $this->getTextBox( 'wgDBserver', 'config-db-host' ) . + $this->parent->getHelpBox( 'config-db-host-help' ) . $this->getTextBox( 'wgDBport', 'config-db-port' ) . Html::openElement( 'fieldset' ) . Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . - $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . - $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) . + $this->getTextBox( 'wgDBname', 'config-db-name' ) . + $this->parent->getHelpBox( 'config-db-name-help' ) . + $this->getTextBox( 'wgDBmwschema', 'config-db-schema' ) . $this->getTextBox( 'wgDBts2schema', 'config-db-ts2-schema' ) . + $this->parent->getHelpBox( 'config-db-schema-help' ) . Html::closeElement( 'fieldset' ) . $this->getInstallUserBox(); } function submitConnectForm() { // Get variables from the request - $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', + $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', 'wgDBname', 'wgDBmwschema', 'wgDBts2schema' ) ); // Validate them diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index d191f6e0cb..4dccdd1a4c 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -8,7 +8,7 @@ /** * Class for setting up the MediaWiki database using SQLLite. - * + * * @ingroup Deployment * @since 1.17 */ @@ -41,8 +41,10 @@ class SqliteInstaller extends DatabaseInstaller { } public function getConnectForm() { - return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir', array(), $this->parent->getHelpBox( 'config-sqlite-dir-help' ) ) . - $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) ); + return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) . + $this->parent->getHelpBox( 'config-sqlite-dir-help' ) . + $this->getTextBox( 'wgDBname', 'config-db-name' ) . + $this->parent->getHelpBox( 'config-sqlite-name-help' ); } public function submitConnectForm() { diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 7abe688e14..fa1a12abd4 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -613,12 +613,21 @@ class WebInstaller extends CoreInstaller { array_shift( $args ); $args = array_map( 'htmlspecialchars', $args ); $text = wfMsgReal( $msg, $args, false, false, false ); - $html = htmlspecialchars( $text ); - //$html = $this->parse( $text, true ); + $html = $this->parse( $text, true ); + return - "\n"; + "
\n" . + "
\n" . + $html . + "
\n" . + "\n" . + "\n
\n"; } /** @@ -661,7 +670,7 @@ class WebInstaller extends CoreInstaller { * Label a control by wrapping a config-input div around it and putting a * label before it. */ - public function label( $msg, $forId, $contents, $helpData = "" ) { + public function label( $msg, $forId, $contents ) { if ( strval( $msg ) == '' ) { $labelText = ' '; } else { @@ -675,16 +684,11 @@ class WebInstaller extends CoreInstaller { } return - "
\n" . - "
\n" . + "
\n" . Xml::tags( 'label', $attributes, $labelText ) . "\n" . - $helpData . - "
\n" . - "
\n" . - $contents . - "
\n" . + $contents . "
\n"; } @@ -698,7 +702,6 @@ class WebInstaller extends CoreInstaller { * attribs: Additional attributes for the input element (optional) * controlName: The name for the input element (optional) * value: The current value of the variable (optional) - * help: The html for the help text (optional) */ public function getTextBox( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -712,9 +715,7 @@ class WebInstaller extends CoreInstaller { if ( !isset( $params['attribs'] ) ) { $params['attribs'] = array(); } - if ( !isset( $params['help'] ) ) { - $params['help'] = ""; - } + return $this->label( $params['label'], @@ -728,8 +729,7 @@ class WebInstaller extends CoreInstaller { 'class' => 'config-input-text', 'tabindex' => $this->nextTabIndex() ) - ), - $params['help'] + ) ); } @@ -744,7 +744,6 @@ class WebInstaller extends CoreInstaller { * attribs: Additional attributes for the input element (optional) * controlName: The name for the input element (optional) * value: The current value of the variable (optional) - * help: The html for the help text (optional) */ public function getPasswordBox( $params ) { if ( !isset( $params['value'] ) ) { @@ -771,7 +770,6 @@ class WebInstaller extends CoreInstaller { * attribs: Additional attributes for the input element (optional) * controlName: The name for the input element (optional) * value: The current value of the variable (optional) - * help: The html for the help text (optional) */ public function getCheckBox( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -785,9 +783,7 @@ class WebInstaller extends CoreInstaller { if ( !isset( $params['attribs'] ) ) { $params['attribs'] = array(); } - if ( !isset( $params['help'] ) ) { - $params['help'] = ""; - } + if( isset( $params['rawtext'] ) ) { $labelText = $params['rawtext']; } else { @@ -807,7 +803,6 @@ class WebInstaller extends CoreInstaller { ) . $labelText . "\n" . "\n" . - $params['help'] . "
\n"; } @@ -824,7 +819,6 @@ class WebInstaller extends CoreInstaller { * commonAttribs Attribute array applied to all items * controlName: The name for the input element (optional) * value: The current value of the variable (optional) - * help: The html for the help text (optional) */ public function getRadioSet( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -838,12 +832,13 @@ class WebInstaller extends CoreInstaller { if ( !isset( $params['label'] ) ) { $label = ''; } else { - $label = $params['label']; - } - if ( !isset( $params['help'] ) ) { - $params['help'] = ""; + $label = $this->parse( wfMsgNoTrans( $params['label'] ) ); } - $s = "