This change is meant to improve the layout of Special:Preferences in
particular, but it will affect any OOUI form using help messages. It
should be a harmless or beneficial change for most of them.
Previous behavior can be restored by passing `'help-inline' => false`
to the HTMLForm factory after 'help-message'/'help-messages'/'help'.
For example:
* Special:Preferences?ooui=1#mw-prefsection-watchlist
* Before: https://phabricator.wikimedia.org/
F25025213
* After: https://phabricator.wikimedia.org/
F25025181
* Special:ChangeEmail
* Before: https://phabricator.wikimedia.org/
F25073327
* After: https://phabricator.wikimedia.org/
F25073328
* Special:BotPasswords/foo
* Before: https://phabricator.wikimedia.org/
F25073324
* After: https://phabricator.wikimedia.org/
F25073326
Bug: T181854
Change-Id: Ica67fe4081dfaa8eb9e8f56fdb93530750e47012
* (T198811) The following tables have had their UNIQUE indexes turned into
proper PRIMARY KEYs for increased maintainability: interwiki, page_props,
protected_titles and site_identifiers.
* (T198811) The following tables have had their UNIQUE indexes turned into
proper PRIMARY KEYs for increased maintainability: interwiki, page_props,
protected_titles and site_identifiers.
+* OOUI HTMLForm will now display help text inline after the input field,
+ rather than in a popup. Previous behavior can be restored by using
+ `'help-inline' => false`.
* 'help-messages' -- array of message keys/objects. As above, each item can
* be an array of msg key and then parameters.
* Overwrites 'help'.
* 'help-messages' -- array of message keys/objects. As above, each item can
* be an array of msg key and then parameters.
* Overwrites 'help'.
+ * 'help-inline' -- Whether help text (defined using options above) will be shown
+ * inline after the input field, rather than in a popup.
+ * Defaults to true. Only used by OOUI form fields.
* 'notice' -- message text for a message to use as a notice in the field.
* Currently used by OOUI form fields only.
* 'notice-messages' -- array of message keys/objects to use for notice.
* 'notice' -- message text for a message to use as a notice in the field.
* Currently used by OOUI form fields only.
* 'notice-messages' -- array of message keys/objects to use for notice.
'errors' => $errors,
'notices' => $notices,
'infusable' => $infusable,
'errors' => $errors,
'notices' => $notices,
'infusable' => $infusable,
+ 'helpInline' => $this->isHelpInline(),
];
$preloadModules = false;
];
$preloadModules = false;
* @return bool
*/
protected function shouldInfuseOOUI() {
* @return bool
*/
protected function shouldInfuseOOUI() {
- // Always infuse fields with help text, since the interface for it is nicer with JS
- return $this->getHelpText() !== null;
+ // Always infuse fields with popup help text, since the interface for it is nicer with JS
+ return $this->getHelpText() !== null && !$this->isHelpInline();
+ /**
+ * Determine if the help text should be displayed inline.
+ *
+ * Only applies to OOUI forms.
+ *
+ * @since 1.31
+ * @return bool
+ */
+ public function isHelpInline() {
+ return isset( $this->mParams['help-inline'] ) ? $this->mParams['help-inline'] : true;
+ }
+
/**
* Determine form errors to display and their classes
* @since 1.20
/**
* Determine form errors to display and their classes
* @since 1.20