Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -632,21 +632,12 @@ |
633 | 633 | array_shift( $args ); |
634 | 634 | $args = array_map( 'htmlspecialchars', $args ); |
635 | 635 | $text = wfMsgReal( $msg, $args, false, false, false ); |
636 | | - $html = $this->parse( $text, true ); |
637 | | - |
| 636 | + $html = htmlspecialchars( $text ); |
| 637 | + //$html = $this->parse( $text, true ); |
638 | 638 | return |
639 | | - "<div class=\"config-help-wrapper\">\n" . |
640 | | - "<div class=\"config-help-message\">\n" . |
641 | | - $html . |
642 | | - "</div>\n" . |
643 | | - "<div class=\"config-show-help\">\n" . |
644 | | - "<a href=\"#\">" . |
645 | | - wfMsgHtml( 'config-show-help' ) . |
646 | | - "</a></div>\n" . |
647 | | - "<div class=\"config-hide-help\">\n" . |
648 | | - "<a href=\"#\">" . |
649 | | - wfMsgHtml( 'config-hide-help' ) . |
650 | | - "</a></div>\n</div>\n"; |
| 639 | + "<span class=\"mw-help-field-hint\"\n" . |
| 640 | + " title=\"" . $html . "\"\n" . |
| 641 | + " original-title=\"" . $html . "\"></span>\n"; |
651 | 642 | } |
652 | 643 | |
653 | 644 | /** |
— | — | @@ -689,7 +680,7 @@ |
690 | 681 | * Label a control by wrapping a config-input div around it and putting a |
691 | 682 | * label before it. |
692 | 683 | */ |
693 | | - public function label( $msg, $forId, $contents ) { |
| 684 | + public function label( $msg, $forId, $contents, $helpData = "" ) { |
694 | 685 | if ( strval( $msg ) == '' ) { |
695 | 686 | $labelText = ' '; |
696 | 687 | } else { |
— | — | @@ -703,11 +694,16 @@ |
704 | 695 | } |
705 | 696 | |
706 | 697 | return |
707 | | - "<div class=\"config-input\">\n" . |
| 698 | + "<div class=\"config-block\">\n" . |
| 699 | + " <div class=\"config-block-label\">\n" . |
708 | 700 | Xml::tags( 'label', |
709 | 701 | $attributes, |
710 | 702 | $labelText ) . "\n" . |
711 | | - $contents . |
| 703 | + $helpData . |
| 704 | + " </div>\n" . |
| 705 | + " <div class=\"config-block-elements\">\n" . |
| 706 | + $contents . |
| 707 | + " </div>\n" . |
712 | 708 | "</div>\n"; |
713 | 709 | } |
714 | 710 | |
— | — | @@ -721,6 +717,7 @@ |
722 | 718 | * attribs: Additional attributes for the input element (optional) |
723 | 719 | * controlName: The name for the input element (optional) |
724 | 720 | * value: The current value of the variable (optional) |
| 721 | + * help: The html for the help text (optional) |
725 | 722 | */ |
726 | 723 | public function getTextBox( $params ) { |
727 | 724 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -734,7 +731,9 @@ |
735 | 732 | if ( !isset( $params['attribs'] ) ) { |
736 | 733 | $params['attribs'] = array(); |
737 | 734 | } |
738 | | - |
| 735 | + if ( !isset( $params['help'] ) ) { |
| 736 | + $params['help'] = ""; |
| 737 | + } |
739 | 738 | return |
740 | 739 | $this->label( |
741 | 740 | $params['label'], |
— | — | @@ -748,7 +747,8 @@ |
749 | 748 | 'class' => 'config-input-text', |
750 | 749 | 'tabindex' => $this->nextTabIndex() |
751 | 750 | ) |
752 | | - ) |
| 751 | + ), |
| 752 | + $params['help'] |
753 | 753 | ); |
754 | 754 | } |
755 | 755 | |
— | — | @@ -763,6 +763,7 @@ |
764 | 764 | * attribs: Additional attributes for the input element (optional) |
765 | 765 | * controlName: The name for the input element (optional) |
766 | 766 | * value: The current value of the variable (optional) |
| 767 | + * help: The html for the help text (optional) |
767 | 768 | */ |
768 | 769 | public function getPasswordBox( $params ) { |
769 | 770 | if ( !isset( $params['value'] ) ) { |
— | — | @@ -789,6 +790,7 @@ |
790 | 791 | * attribs: Additional attributes for the input element (optional) |
791 | 792 | * controlName: The name for the input element (optional) |
792 | 793 | * value: The current value of the variable (optional) |
| 794 | + * help: The html for the help text (optional) |
793 | 795 | */ |
794 | 796 | public function getCheckBox( $params ) { |
795 | 797 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -802,7 +804,9 @@ |
803 | 805 | if ( !isset( $params['attribs'] ) ) { |
804 | 806 | $params['attribs'] = array(); |
805 | 807 | } |
806 | | - |
| 808 | + if ( !isset( $params['help'] ) ) { |
| 809 | + $params['help'] = ""; |
| 810 | + } |
807 | 811 | if( isset( $params['rawtext'] ) ) { |
808 | 812 | $labelText = $params['rawtext']; |
809 | 813 | } else { |
— | — | @@ -811,7 +815,8 @@ |
812 | 816 | |
813 | 817 | return |
814 | 818 | "<div class=\"config-input-check\">\n" . |
815 | | - "<label>\n" . |
| 819 | + $params['help'] . |
| 820 | + "<label>\n" . |
816 | 821 | Xml::check( |
817 | 822 | $params['controlName'], |
818 | 823 | $params['value'], |
— | — | @@ -822,6 +827,7 @@ |
823 | 828 | ) . |
824 | 829 | $labelText . "\n" . |
825 | 830 | "</label>\n" . |
| 831 | + $params['help'] . |
826 | 832 | "</div>\n"; |
827 | 833 | } |
828 | 834 | |
— | — | @@ -838,6 +844,7 @@ |
839 | 845 | * commonAttribs Attribute array applied to all items |
840 | 846 | * controlName: The name for the input element (optional) |
841 | 847 | * value: The current value of the variable (optional) |
| 848 | + * help: The html for the help text (optional) |
842 | 849 | */ |
843 | 850 | public function getRadioSet( $params ) { |
844 | 851 | if ( !isset( $params['controlName'] ) ) { |
— | — | @@ -851,13 +858,12 @@ |
852 | 859 | if ( !isset( $params['label'] ) ) { |
853 | 860 | $label = ''; |
854 | 861 | } else { |
855 | | - $label = $this->parse( wfMsgNoTrans( $params['label'] ) ); |
| 862 | + $label = $params['label']; |
856 | 863 | } |
857 | | - |
858 | | - $s = "<label class=\"config-label\">\n" . |
859 | | - $label . |
860 | | - "</label>\n" . |
861 | | - "<ul class=\"config-settings-block\">\n"; |
| 864 | + if ( !isset( $params['help'] ) ) { |
| 865 | + $params['help'] = ""; |
| 866 | + } |
| 867 | + $s = "<ul>\n"; |
862 | 868 | foreach ( $params['values'] as $value ) { |
863 | 869 | $itemAttribs = array(); |
864 | 870 | |
— | — | @@ -885,7 +891,8 @@ |
886 | 892 | } |
887 | 893 | |
888 | 894 | $s .= "</ul>\n"; |
889 | | - return $s; |
| 895 | + |
| 896 | + return $this->label( $label, $params['controlName'], $s, $params['help'] ); |
890 | 897 | } |
891 | 898 | |
892 | 899 | /** |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -31,8 +31,6 @@ |
32 | 32 | 'config-no-session' => 'Your session data was lost! |
33 | 33 | Check your php.ini and make sure <code>session.save_path</code> is set to an appropriate directory.', |
34 | 34 | 'config-session-path-bad' => 'Your <code>session.save_path</code> (<code>$1</code>) seems to be invalid or unwritable.', |
35 | | - 'config-show-help' => 'Help', |
36 | | - 'config-hide-help' => 'Hide help', |
37 | 35 | 'config-your-language' => 'Your language:', |
38 | 36 | 'config-your-language-help' => 'Select a language to use during the installation process.', |
39 | 37 | 'config-wiki-language' => 'Wiki language:', |
Index: trunk/phase3/includes/installer/WebInstallerOutput.php |
— | — | @@ -9,20 +9,20 @@ |
10 | 10 | /** |
11 | 11 | * Output class modelled on OutputPage. |
12 | 12 | * |
13 | | - * I've opted to use a distinct class rather than derive from OutputPage here in |
14 | | - * the interests of separation of concerns: if we used a subclass, there would be |
15 | | - * quite a lot of things you could do in OutputPage that would break the installer, |
16 | | - * that wouldn't be immediately obvious. |
17 | | - * |
| 13 | + * I've opted to use a distinct class rather than derive from OutputPage here in |
| 14 | + * the interests of separation of concerns: if we used a subclass, there would be |
| 15 | + * quite a lot of things you could do in OutputPage that would break the installer, |
| 16 | + * that wouldn't be immediately obvious. |
| 17 | + * |
18 | 18 | * @ingroup Deployment |
19 | 19 | * @since 1.17 |
20 | 20 | */ |
21 | 21 | class WebInstallerOutput { |
22 | 22 | /** |
23 | 23 | * The WebInstaller object this WebInstallerOutput is used by. |
24 | | - * |
| 24 | + * |
25 | 25 | * @var WebInstaller |
26 | | - */ |
| 26 | + */ |
27 | 27 | public $parent; |
28 | 28 | |
29 | 29 | /** |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Constructor. |
51 | | - * |
| 51 | + * |
52 | 52 | * @param $parent WebInstaller |
53 | 53 | */ |
54 | 54 | public function __construct( WebInstaller $parent ) { |
— | — | @@ -182,16 +182,11 @@ |
183 | 183 | <?php echo Html::linkedStyle( $this->getCssUrl() ) . "\n"; ?> |
184 | 184 | <?php echo Html::inlineScript( "var dbTypes = " . Xml::encodeJsVar( $dbTypes ) ) . "\n"; ?> |
185 | 185 | <?php echo $this->getJQuery() . "\n"; ?> |
| 186 | + <?php echo $this->getJQueryTipsy() . "\n"; ?> |
186 | 187 | <?php echo Html::linkedScript( '../skins/common/config.js' ) . "\n"; ?> |
187 | 188 | </head> |
188 | 189 | |
189 | 190 | <?php echo Html::openElement( 'body', array( 'class' => $this->getDir() ) ) . "\n"; ?> |
190 | | -<noscript> |
191 | | -<style type="text/css"> |
192 | | -.config-help-message { display: block; } |
193 | | -.config-show-help { display: none; } |
194 | | -</style> |
195 | | -</noscript> |
196 | 191 | <div id="mw-page-base"></div> |
197 | 192 | <div id="mw-head-base"></div> |
198 | 193 | <div id="content"> |
— | — | @@ -241,6 +236,7 @@ |
242 | 237 | <title><?php $this->outputTitle(); ?></title> |
243 | 238 | <?php echo Html::linkedStyle( $this->getCssUrl() ) . "\n"; ?> |
244 | 239 | <?php echo $this->getJQuery(); ?> |
| 240 | + <?php echo $this->getJQueryTipsy() . "\n"; ?> |
245 | 241 | <?php echo Html::linkedScript( '../skins/common/config.js' ); ?> |
246 | 242 | </head> |
247 | 243 | |
— | — | @@ -256,10 +252,7 @@ |
257 | 253 | public function getJQuery() { |
258 | 254 | return Html::linkedScript( "../resources/jquery/jquery.js" ); |
259 | 255 | } |
260 | | - |
261 | | - public function outputWarnings() { |
262 | | - $this->addHTML( $this->warnings ); |
263 | | - $this->warnings = ''; |
| 256 | + public function getJQueryTipsy() { |
| 257 | + return Html::linkedScript( "../resources/jquery/jquery.tipsy.js" ); |
264 | 258 | } |
265 | | - |
266 | 259 | } |
Index: trunk/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using SQLLite. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -41,10 +41,8 @@ |
42 | 42 | } |
43 | 43 | |
44 | 44 | public function getConnectForm() { |
45 | | - return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) . |
46 | | - $this->parent->getHelpBox( 'config-sqlite-dir-help' ) . |
47 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
48 | | - $this->parent->getHelpBox( 'config-sqlite-name-help' ); |
| 45 | + return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir', array(), $this->parent->getHelpBox( 'config-sqlite-dir-help' ) ) . |
| 46 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) ); |
49 | 47 | } |
50 | 48 | |
51 | 49 | public function submitConnectForm() { |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Base class for DBMS-specific installation helper classes. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -16,30 +16,30 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The Installer object. |
20 | | - * |
| 20 | + * |
21 | 21 | * TODO: naming this parent is confusing, 'installer' would be clearer. |
22 | | - * |
| 22 | + * |
23 | 23 | * @var Installer |
24 | 24 | */ |
25 | 25 | public $parent; |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * The database connection. |
29 | | - * |
| 29 | + * |
30 | 30 | * @var DatabaseBase |
31 | 31 | */ |
32 | 32 | public $db; |
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Internal variables for installation. |
36 | | - * |
| 36 | + * |
37 | 37 | * @var array |
38 | 38 | */ |
39 | 39 | protected $internalDefaults = array(); |
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Array of MW configuration globals this class uses. |
43 | | - * |
| 43 | + * |
44 | 44 | * @var array |
45 | 45 | */ |
46 | 46 | protected $globalNames = array(); |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * Get HTML for a web form that configures this database. Configuration |
60 | | - * at this time should be the minimum needed to connect and test |
| 60 | + * at this time should be the minimum needed to connect and test |
61 | 61 | * whether install or upgrade is required. |
62 | 62 | * |
63 | 63 | * If this is called, $this->parent can be assumed to be a WebInstaller. |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | |
67 | 67 | /** |
68 | 68 | * Set variables based on the request array, assuming it was submitted |
69 | | - * via the form returned by getConnectForm(). Validate the connection |
| 69 | + * via the form returned by getConnectForm(). Validate the connection |
70 | 70 | * settings by attempting to connect with them. |
71 | 71 | * |
72 | 72 | * If this is called, $this->parent can be assumed to be a WebInstaller. |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | /** |
79 | 79 | * Get HTML for a web form that retrieves settings used for installation. |
80 | 80 | * $this->parent can be assumed to be a WebInstaller. |
81 | | - * If the DB type has no settings beyond those already configured with |
| 81 | + * If the DB type has no settings beyond those already configured with |
82 | 82 | * getConnectForm(), this should return false. |
83 | 83 | */ |
84 | 84 | public function getSettingsForm() { |
— | — | @@ -87,7 +87,7 @@ |
88 | 88 | /** |
89 | 89 | * Set variables based on the request array, assuming it was submitted via |
90 | 90 | * the form return by getSettingsForm(). |
91 | | - * |
| 91 | + * |
92 | 92 | * @return Status |
93 | 93 | */ |
94 | 94 | public function submitSettingsForm() { |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | /** |
99 | 99 | * Connect to the database using the administrative user/password currently |
100 | | - * defined in the session. On success, return the connection, on failure, |
| 100 | + * defined in the session. On success, return the connection, on failure, |
101 | 101 | * |
102 | 102 | * This may be called multiple times, so the result should be cached. |
103 | 103 | * |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | |
116 | 116 | /** |
117 | 117 | * Create database tables from scratch. |
118 | | - * |
| 118 | + * |
119 | 119 | * @return Status |
120 | 120 | */ |
121 | 121 | public function createTables() { |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | |
141 | 141 | /** |
142 | 142 | * Get the DBMS-specific options for LocalSettings.php generation. |
143 | | - * |
| 143 | + * |
144 | 144 | * @return String |
145 | 145 | */ |
146 | 146 | public abstract function getLocalSettings(); |
— | — | @@ -188,19 +188,19 @@ |
189 | 189 | */ |
190 | 190 | public function getGlobalNames() { |
191 | 191 | return $this->globalNames; |
192 | | - } |
| 192 | + } |
193 | 193 | |
194 | 194 | /** |
195 | 195 | * Return any table options to be applied to all tables that don't |
196 | 196 | * override them. |
197 | | - * |
| 197 | + * |
198 | 198 | * @return Array |
199 | 199 | */ |
200 | 200 | public function getTableOptions() { |
201 | 201 | return array(); |
202 | 202 | } |
203 | 203 | |
204 | | - /** |
| 204 | + /** |
205 | 205 | * Construct and initialise parent. |
206 | 206 | * This is typically only called from Installer::getDBInstaller() |
207 | 207 | */ |
— | — | @@ -211,7 +211,7 @@ |
212 | 212 | /** |
213 | 213 | * Convenience function. |
214 | 214 | * Check if a named extension is present. |
215 | | - * |
| 215 | + * |
216 | 216 | * @see wfDl |
217 | 217 | */ |
218 | 218 | protected static function checkExtension( $name ) { |
— | — | @@ -267,15 +267,19 @@ |
268 | 268 | /** |
269 | 269 | * Get a labelled text box to configure a local variable. |
270 | 270 | */ |
271 | | - public function getTextBox( $var, $label, $attribs = array() ) { |
| 271 | + public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) { |
272 | 272 | $name = $this->getName() . '_' . $var; |
273 | 273 | $value = $this->getVar( $var ); |
| 274 | + if ( !isset( $attribs ) ) { |
| 275 | + $attribs = array(); |
| 276 | + } |
274 | 277 | return $this->parent->getTextBox( array( |
275 | 278 | 'var' => $var, |
276 | 279 | 'label' => $label, |
277 | 280 | 'attribs' => $attribs, |
278 | 281 | 'controlName' => $name, |
279 | | - 'value' => $value |
| 282 | + 'value' => $value, |
| 283 | + 'help' => $helpData |
280 | 284 | ) ); |
281 | 285 | } |
282 | 286 | |
— | — | @@ -283,22 +287,26 @@ |
284 | 288 | * Get a labelled password box to configure a local variable. |
285 | 289 | * Implements password hiding. |
286 | 290 | */ |
287 | | - public function getPasswordBox( $var, $label, $attribs = array() ) { |
| 291 | + public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) { |
288 | 292 | $name = $this->getName() . '_' . $var; |
289 | 293 | $value = $this->getVar( $var ); |
| 294 | + if ( !isset( $attribs ) ) { |
| 295 | + $attribs = array(); |
| 296 | + } |
290 | 297 | return $this->parent->getPasswordBox( array( |
291 | 298 | 'var' => $var, |
292 | 299 | 'label' => $label, |
293 | 300 | 'attribs' => $attribs, |
294 | 301 | 'controlName' => $name, |
295 | | - 'value' => $value |
| 302 | + 'value' => $value, |
| 303 | + 'help' => $helpData |
296 | 304 | ) ); |
297 | 305 | } |
298 | 306 | |
299 | 307 | /** |
300 | 308 | * Get a labelled checkbox to configure a local boolean variable. |
301 | 309 | */ |
302 | | - public function getCheckBox( $var, $label, $attribs = array() ) { |
| 310 | + public function getCheckBox( $var, $label, $attribs = array(), $helpData = "" ) { |
303 | 311 | $name = $this->getName() . '_' . $var; |
304 | 312 | $value = $this->getVar( $var ); |
305 | 313 | return $this->parent->getCheckBox( array( |
— | — | @@ -307,6 +315,7 @@ |
308 | 316 | 'attribs' => $attribs, |
309 | 317 | 'controlName' => $name, |
310 | 318 | 'value' => $value, |
| 319 | + 'help' => $helpData |
311 | 320 | )); |
312 | 321 | } |
313 | 322 | |
— | — | @@ -339,11 +348,11 @@ |
340 | 349 | } |
341 | 350 | |
342 | 351 | /** |
343 | | - * Determine whether an existing installation of MediaWiki is present in |
344 | | - * the configured administrative connection. Returns true if there is |
| 352 | + * Determine whether an existing installation of MediaWiki is present in |
| 353 | + * the configured administrative connection. Returns true if there is |
345 | 354 | * such a wiki, false if the database doesn't exist. |
346 | 355 | * |
347 | | - * Traditionally, this is done by testing for the existence of either |
| 356 | + * Traditionally, this is done by testing for the existence of either |
348 | 357 | * the revision table or the cur table. |
349 | 358 | * |
350 | 359 | * @return Boolean |
— | — | @@ -367,9 +376,8 @@ |
368 | 377 | return |
369 | 378 | Html::openElement( 'fieldset' ) . |
370 | 379 | Html::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) . |
371 | | - $this->getTextBox( '_InstallUser', 'config-db-username' ) . |
372 | | - $this->getPasswordBox( '_InstallPassword', 'config-db-password' ) . |
373 | | - $this->parent->getHelpBox( 'config-db-install-help' ) . |
| 380 | + $this->getTextBox( '_InstallUser', 'config-db-username', array(), $this->parent->getHelpBox( 'config-db-install-username' ) ) . |
| 381 | + $this->getPasswordBox( '_InstallPassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-install-password' ) ) . |
374 | 382 | Html::closeElement( 'fieldset' ); |
375 | 383 | } |
376 | 384 | |
— | — | @@ -389,7 +397,7 @@ |
390 | 398 | public function getWebUserBox( $noCreateMsg = false ) { |
391 | 399 | $s = Html::openElement( 'fieldset' ) . |
392 | 400 | Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
393 | | - $this->getCheckBox( |
| 401 | + $this->getCheckBox( |
394 | 402 | '_SameAccount', 'config-db-web-account-same', |
395 | 403 | array( 'class' => 'hideShowRadio', 'rel' => 'dbOtherAccount' ) |
396 | 404 | ) . |
— | — | @@ -408,7 +416,7 @@ |
409 | 417 | |
410 | 418 | /** |
411 | 419 | * Submit the form from getWebUserBox(). |
412 | | - * |
| 420 | + * |
413 | 421 | * @return Status |
414 | 422 | */ |
415 | 423 | public function submitWebUserBox() { |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using MySQL. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -59,14 +59,11 @@ |
60 | 60 | |
61 | 61 | public function getConnectForm() { |
62 | 62 | return |
63 | | - $this->getTextBox( 'wgDBserver', 'config-db-host' ) . |
64 | | - $this->parent->getHelpBox( 'config-db-host-help' ) . |
| 63 | + $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . |
65 | 64 | Html::openElement( 'fieldset' ) . |
66 | 65 | Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
67 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
68 | | - $this->parent->getHelpBox( 'config-db-name-help' ) . |
69 | | - $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . |
70 | | - $this->parent->getHelpBox( 'config-db-prefix-help' ) . |
| 66 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . |
| 67 | + $this->getTextBox( 'wgDBprefix', 'config-db-prefix', array(), $this->parent->getHelpBox( 'config-db-prefix-help' ) ) . |
71 | 68 | Html::closeElement( 'fieldset' ) . |
72 | 69 | $this->getInstallUserBox(); |
73 | 70 | } |
— | — | @@ -120,7 +117,7 @@ |
121 | 118 | $this->getVar( '_InstallPassword' ), |
122 | 119 | false, |
123 | 120 | false, |
124 | | - 0, |
| 121 | + 0, |
125 | 122 | $this->getVar( 'wgDBprefix' ) |
126 | 123 | ); |
127 | 124 | $status->value = $this->db; |
— | — | @@ -252,12 +249,12 @@ |
253 | 250 | if ( count( $parts ) != 2 ) { |
254 | 251 | return false; |
255 | 252 | } |
256 | | - $quotedUser = $conn->addQuotes( $parts[0] ) . |
| 253 | + $quotedUser = $conn->addQuotes( $parts[0] ) . |
257 | 254 | '@' . $conn->addQuotes( $parts[1] ); |
258 | 255 | |
259 | 256 | // The user needs to have INSERT on mysql.* to be able to CREATE USER |
260 | 257 | // The grantee will be double-quoted in this query, as required |
261 | | - $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', |
| 258 | + $res = $conn->select( 'INFORMATION_SCHEMA.USER_PRIVILEGES', '*', |
262 | 259 | array( 'GRANTEE' => $quotedUser ), __METHOD__ ); |
263 | 260 | $insertMysql = false; |
264 | 261 | $grantOptions = array_flip( $this->webUserPrivs ); |
— | — | @@ -273,7 +270,7 @@ |
274 | 271 | // Check for DB-specific privs for mysql.* |
275 | 272 | if ( !$insertMysql ) { |
276 | 273 | $row = $conn->selectRow( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
277 | | - array( |
| 274 | + array( |
278 | 275 | 'GRANTEE' => $quotedUser, |
279 | 276 | 'TABLE_SCHEMA' => 'mysql', |
280 | 277 | 'PRIVILEGE_TYPE' => 'INSERT', |
— | — | @@ -288,7 +285,7 @@ |
289 | 286 | } |
290 | 287 | |
291 | 288 | // Check for DB-level grant options |
292 | | - $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
| 289 | + $res = $conn->select( 'INFORMATION_SCHEMA.SCHEMA_PRIVILEGES', '*', |
293 | 290 | array( |
294 | 291 | 'GRANTEE' => $quotedUser, |
295 | 292 | 'IS_GRANTABLE' => 1, |
— | — | @@ -322,9 +319,9 @@ |
323 | 320 | } |
324 | 321 | if ( count( $engines ) >= 2 ) { |
325 | 322 | $s .= $this->getRadioSet( array( |
326 | | - 'var' => '_MysqlEngine', |
327 | | - 'label' => 'config-mysql-engine', |
328 | | - 'itemLabelPrefix' => 'config-mysql-', |
| 323 | + 'var' => '_MysqlEngine', |
| 324 | + 'label' => 'config-mysql-engine', |
| 325 | + 'itemLabelPrefix' => 'config-mysql-', |
329 | 326 | 'values' => $engines |
330 | 327 | )); |
331 | 328 | $s .= $this->parent->getHelpBox( 'config-mysql-engine-help' ); |
— | — | @@ -375,7 +372,7 @@ |
376 | 373 | $this->getVar( 'wgDBpassword' ), |
377 | 374 | false, |
378 | 375 | false, |
379 | | - 0, |
| 376 | + 0, |
380 | 377 | $this->getVar( 'wgDBprefix' ) |
381 | 378 | ); |
382 | 379 | } catch ( DBConnectionError $e ) { |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using Oracle. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -46,8 +46,7 @@ |
47 | 47 | Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
48 | 48 | Html::openElement( 'div', array( 'id' => 'dbOtherAccount' ) ) . |
49 | 49 | $this->getTextBox( 'wgDBuser', 'config-db-username' ) . |
50 | | - $this->getPasswordBox( 'wgDBpassword', 'config-db-password' ) . |
51 | | - $this->parent->getHelpBox( 'config-db-web-help' ). |
| 50 | + $this->getPasswordBox( 'wgDBpassword', 'config-db-password', array(), $this->parent->getHelpBox( 'config-db-web-help' ) ) . |
52 | 51 | $this->getCheckBox( '_CreateDBAccount', 'config-db-web-create', array( 'disabled' => true ) ). |
53 | 52 | Html::closeElement( 'div' ) . Html::closeElement( 'fieldset' ); |
54 | 53 | } |
— | — | @@ -56,14 +55,12 @@ |
57 | 56 | $this->parent->setVar( '_InstallUser', 'sys' ); |
58 | 57 | $this->parent->setVar( 'wgDBserver', '' ); |
59 | 58 | return |
60 | | - $this->getTextBox( 'wgDBserver', 'config-db-host-oracle' ) . |
61 | | - $this->parent->getHelpBox( 'config-db-host-oracle-help' ) . |
| 59 | + $this->getTextBox( 'wgDBserver', 'config-db-host-oracle', array(), $this->parent->getHelpBox( 'config-db-host-oracle-help' ) ) . |
62 | 60 | Html::openElement( 'fieldset' ) . |
63 | 61 | Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
64 | 62 | $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . |
65 | 63 | $this->getTextBox( '_OracleDefTS', 'config-oracle-def-ts' ) . |
66 | | - $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts' ) . |
67 | | - $this->parent->getHelpBox( 'config-db-oracle-help' ) . |
| 64 | + $this->getTextBox( '_OracleTempTS', 'config-oracle-temp-ts', array(), $this->parent->getHelpBox( 'config-db-oracle-help' ) ) . |
68 | 65 | Html::closeElement( 'fieldset' ) . |
69 | 66 | $this->getInstallUserBox(). |
70 | 67 | $this->getWebUserBox(); |
Index: trunk/phase3/includes/installer/PostgresInstaller.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Class for setting up the MediaWiki database using Postgres. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -36,23 +36,20 @@ |
37 | 37 | |
38 | 38 | function getConnectForm() { |
39 | 39 | return |
40 | | - $this->getTextBox( 'wgDBserver', 'config-db-host' ) . |
41 | | - $this->parent->getHelpBox( 'config-db-host-help' ) . |
| 40 | + $this->getTextBox( 'wgDBserver', 'config-db-host', array(), $this->parent->getHelpBox( 'config-db-host-help' ) ) . |
42 | 41 | $this->getTextBox( 'wgDBport', 'config-db-port' ) . |
43 | 42 | Html::openElement( 'fieldset' ) . |
44 | 43 | Html::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
45 | | - $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
46 | | - $this->parent->getHelpBox( 'config-db-name-help' ) . |
47 | | - $this->getTextBox( 'wgDBmwschema', 'config-db-schema' ) . |
| 44 | + $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-db-name-help' ) ) . |
| 45 | + $this->getTextBox( 'wgDBmwschema', 'config-db-schema', array(), $this->parent->getHelpBox( 'config-db-schema-help' ) ) . |
48 | 46 | $this->getTextBox( 'wgDBts2schema', 'config-db-ts2-schema' ) . |
49 | | - $this->parent->getHelpBox( 'config-db-schema-help' ) . |
50 | 47 | Html::closeElement( 'fieldset' ) . |
51 | 48 | $this->getInstallUserBox(); |
52 | 49 | } |
53 | 50 | |
54 | 51 | function submitConnectForm() { |
55 | 52 | // Get variables from the request |
56 | | - $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', |
| 53 | + $newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBport', |
57 | 54 | 'wgDBname', 'wgDBmwschema', 'wgDBts2schema' ) ); |
58 | 55 | |
59 | 56 | // Validate them |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Abstract class to define pages for the web installer. |
12 | | - * |
| 12 | + * |
13 | 13 | * @ingroup Deployment |
14 | 14 | * @since 1.17 |
15 | 15 | */ |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * The WebInstaller object this WebInstallerPage belongs to. |
20 | | - * |
| 20 | + * |
21 | 21 | * @var WebInstaller |
22 | 22 | */ |
23 | 23 | public $parent; |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Constructor. |
29 | | - * |
| 29 | + * |
30 | 30 | * @param $parent WebInstaller |
31 | 31 | */ |
32 | 32 | public function __construct( WebInstaller $parent ) { |
— | — | @@ -220,13 +220,15 @@ |
221 | 221 | } |
222 | 222 | $this->startForm(); |
223 | 223 | $s = Html::hidden( 'LanguageRequestTime', time() ) . |
224 | | - $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang ) . |
225 | | - $this->parent->getHelpBox( 'config-your-language-help' ) . |
226 | | - $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang ) . |
227 | | - $this->parent->getHelpBox( 'config-wiki-language-help' ) . |
228 | | - $this->parent->getCheckBox( |
229 | | - array( 'var' => '_ExternalHTTP', 'label' => 'config-allow-requests' ) |
230 | | - ) . $this->parent->getHelpBox( 'config-allow-requests-help' ); |
| 224 | + $this->getLanguageSelector( 'UserLang', 'config-your-language', $userLang, $this->parent->getHelpBox( 'config-your-language-help' ) ) . |
| 225 | + $this->getLanguageSelector( 'ContLang', 'config-wiki-language', $contLang, $this->parent->getHelpBox( 'config-wiki-language-help' ) ) . |
| 226 | + $this->parent->getCheckBox( |
| 227 | + array( |
| 228 | + 'var' => '_ExternalHTTP', |
| 229 | + 'label' => 'config-allow-requests', |
| 230 | + 'help' => $this->parent->getHelpBox( 'config-allow-requests-help' ) |
| 231 | + ) |
| 232 | + ); |
231 | 233 | |
232 | 234 | $this->addHTML( $s ); |
233 | 235 | $this->endForm(); |
— | — | @@ -263,7 +265,7 @@ |
264 | 266 | $this->parent->output->addWikiText( wfMsgNoTrans( 'config-welcome' ) ); |
265 | 267 | $status = $this->parent->doEnvironmentChecks(); |
266 | 268 | if ( $status ) { |
267 | | - $this->parent->output->addWikiText( wfMsgNoTrans( 'config-copyright', |
| 269 | + $this->parent->output->addWikiText( wfMsgNoTrans( 'config-copyright', |
268 | 270 | SpecialVersion::getCopyrightAndAuthorList() ) ); |
269 | 271 | $this->startForm(); |
270 | 272 | $this->endForm(); |
— | — | @@ -295,7 +297,7 @@ |
296 | 298 | $dbSupport = ''; |
297 | 299 | foreach( $this->parent->getDBTypes() as $type ) { |
298 | 300 | $db = 'Database' . ucfirst( $type ); |
299 | | - $dbSupport .= wfMsgNoTrans( "config-support-$type", |
| 301 | + $dbSupport .= wfMsgNoTrans( "config-support-$type", |
300 | 302 | call_user_func( array( $db, 'getSoftwareLink' ) ) ) . "\n"; |
301 | 303 | } |
302 | 304 | $this->addHTML( $this->parent->getInfoBox( |
— | — | @@ -464,21 +466,22 @@ |
465 | 467 | $this->parent->getTextBox( array( |
466 | 468 | 'var' => 'wgSitename', |
467 | 469 | 'label' => 'config-site-name', |
| 470 | + 'help' => $this->parent->getHelpBox( 'config-site-name-help' ) |
468 | 471 | ) ) . |
469 | | - $this->parent->getHelpBox( 'config-site-name-help' ) . |
470 | 472 | $this->parent->getRadioSet( array( |
471 | 473 | 'var' => '_NamespaceType', |
472 | 474 | 'label' => 'config-project-namespace', |
473 | 475 | 'itemLabelPrefix' => 'config-ns-', |
474 | 476 | 'values' => array( 'site-name', 'generic', 'other' ), |
475 | 477 | 'commonAttribs' => array( 'class' => 'enableForOther', 'rel' => 'config_wgMetaNamespace' ), |
| 478 | + 'help' => $this->parent->getHelpBox( 'config-project-namespace-help' ) |
476 | 479 | ) ) . |
477 | 480 | $this->parent->getTextBox( array( |
478 | 481 | 'var' => 'wgMetaNamespace', |
479 | 482 | 'label' => '', //TODO: Needs a label? |
480 | 483 | 'attribs' => array( 'readonly' => 'readonly', 'class' => 'enabledByOther' ), |
| 484 | + |
481 | 485 | ) ) . |
482 | | - $this->parent->getHelpBox( 'config-project-namespace-help' ) . |
483 | 486 | $this->getFieldSetStart( 'config-admin-box' ) . |
484 | 487 | $this->parent->getTextBox( array( |
485 | 488 | 'var' => '_AdminName', |
— | — | @@ -493,17 +496,16 @@ |
494 | 497 | 'var' => '_AdminPassword2', |
495 | 498 | 'label' => 'config-admin-password-confirm' |
496 | 499 | ) ) . |
497 | | - $this->parent->getHelpBox( 'config-admin-help' ) . |
498 | 500 | $this->parent->getTextBox( array( |
499 | 501 | 'var' => '_AdminEmail', |
500 | | - 'label' => 'config-admin-email' |
| 502 | + 'label' => 'config-admin-email', |
| 503 | + 'help' => $this->parent->getHelpBox( 'config-admin-email-help' ) |
501 | 504 | ) ) . |
502 | | - $this->parent->getHelpBox( 'config-admin-email-help' ) . |
503 | 505 | $this->parent->getCheckBox( array( |
504 | 506 | 'var' => '_Subscribe', |
505 | | - 'label' => 'config-subscribe' |
| 507 | + 'label' => 'config-subscribe', |
| 508 | + 'help' => $this->parent->getHelpBox( 'config-subscribe-help' ) |
506 | 509 | ) ) . |
507 | | - $this->parent->getHelpBox( 'config-subscribe-help' ) . |
508 | 510 | $this->getFieldSetEnd() . |
509 | 511 | $this->parent->getInfoBox( wfMsg( 'config-almost-done' ) ) . |
510 | 512 | $this->parent->getRadioSet( array( |
— | — | @@ -585,6 +587,7 @@ |
586 | 588 | |
587 | 589 | // Validate password |
588 | 590 | $msg = false; |
| 591 | + $valid = false; |
589 | 592 | $pwd = $this->getVar( '_AdminPassword' ); |
590 | 593 | $user = User::newFromName( $cname ); |
591 | 594 | $valid = $user && $user->getPasswordValidity( $pwd ); |
— | — | @@ -695,31 +698,31 @@ |
696 | 699 | } |
697 | 700 | |
698 | 701 | $extHtml .= $this->parent->getHelpBox( 'config-extensions-help' ) . |
699 | | - $this->getFieldSetEnd(); |
| 702 | + $this->getFieldSetEnd(); |
700 | 703 | $this->addHTML( $extHtml ); |
701 | 704 | } |
702 | 705 | |
703 | 706 | $this->addHTML( |
704 | 707 | # Uploading |
705 | 708 | $this->getFieldSetStart( 'config-upload-settings' ) . |
706 | | - $this->parent->getCheckBox( array( |
| 709 | + $this->parent->getCheckBox( array( |
707 | 710 | 'var' => 'wgEnableUploads', |
708 | 711 | 'label' => 'config-upload-enable', |
709 | 712 | 'attribs' => array( 'class' => 'showHideRadio', 'rel' => 'uploadwrapper' ), |
| 713 | + 'help' => $this->parent->getHelpBox( 'config-upload-help' ) |
710 | 714 | ) ) . |
711 | | - $this->parent->getHelpBox( 'config-upload-help' ) . |
712 | 715 | '<div id="uploadwrapper" style="display: none;">' . |
713 | | - $this->parent->getTextBox( array( |
| 716 | + $this->parent->getTextBox( array( |
714 | 717 | 'var' => 'wgDeletedDirectory', |
715 | 718 | 'label' => 'config-upload-deleted', |
| 719 | + 'help' => $this->parent->getHelpBox( 'config-upload-deleted-help' ) |
716 | 720 | ) ) . |
717 | | - $this->parent->getHelpBox( 'config-upload-deleted-help' ) . |
718 | 721 | '</div>' . |
719 | 722 | $this->parent->getTextBox( array( |
720 | 723 | 'var' => 'wgLogo', |
721 | | - 'label' => 'config-logo' |
722 | | - ) ) . |
723 | | - $this->parent->getHelpBox( 'config-logo-help' ) |
| 724 | + 'label' => 'config-logo', |
| 725 | + 'help' => $this->parent->getHelpBox( 'config-logo-help' ) |
| 726 | + ) ) |
724 | 727 | ); |
725 | 728 | $canUse = $this->getVar( '_ExternalHTTP' ) ? |
726 | 729 | 'config-instantcommons-good' : 'config-instantcommons-bad'; |
— | — | @@ -727,8 +730,8 @@ |
728 | 731 | $this->parent->getCheckBox( array( |
729 | 732 | 'var' => 'wgUseInstantCommons', |
730 | 733 | 'label' => 'config-instantcommons', |
| 734 | + 'help' => $this->parent->getHelpBox( 'config-instantcommons-help', wfMsgNoTrans( $canUse ) ) |
731 | 735 | ) ) . |
732 | | - $this->parent->getHelpBox( 'config-instantcommons-help', wfMsgNoTrans( $canUse ) ) . |
733 | 736 | $this->getFieldSetEnd() |
734 | 737 | ); |
735 | 738 | |
— | — | @@ -754,8 +757,9 @@ |
755 | 758 | $this->parent->getTextBox( array( |
756 | 759 | 'var' => '_MemCachedServers', |
757 | 760 | 'label' => 'config-memcached-servers', |
| 761 | + 'help' => $this->parent->getHelpBox( 'config-memcached-help' ) |
758 | 762 | ) ) . |
759 | | - $this->parent->getHelpBox( 'config-memcached-help' ) . '</div>' . |
| 763 | + '</div>' . |
760 | 764 | $this->getFieldSetEnd() |
761 | 765 | ); |
762 | 766 | $this->endForm(); |