# Apply the same CSS class used on the input to the message:
'cssclass' => $emailauthenticationclass,
);
- $defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass;
}
}
'section' => 'watchlist/advancedwatchlist',
'label-message' => 'tog-watchlisthideliu',
);
+ $defaultPreferences['watchlistreloadautomatically'] = array(
+ 'type' => 'toggle',
+ 'section' => 'watchlist/advancedwatchlist',
+ 'label-message' => 'tog-watchlistreloadautomatically',
+ );
if ( $config->get( 'RCWatchCategoryMembership' ) ) {
$defaultPreferences['watchlisthidecategorization'] = array(
* @param IContextSource $context
* @param string $formClass
* @param array $remove Array of items to remove
- * @return HtmlForm
+ * @return PreferencesForm|HtmlForm
*/
static function getFormObject(
$user,
$res = self::tryFormSubmit( $formData, $form );
if ( $res ) {
- $urlOptions = array( 'success' => 1 );
+ $urlOptions = array();
if ( $res === 'eauth' ) {
$urlOptions['eauth'] = 1;
$url = $form->getTitle()->getFullURL( $urlOptions );
- $form->getContext()->getOutput()->redirect( $url );
+ $context = $form->getContext();
+ // Set session data for the success message
+ $context->getRequest()->setSessionData( 'specialPreferencesSaveSuccess', 1 );
+
+ $context->getOutput()->redirect( $url );
}
return Status::newGood();
Hooks::run( 'PreferencesGetLegend', array( $this, $key, &$legend ) );
return $legend;
}
+
+ /**
+ * Get the keys of each top level preference section.
+ * @return array of section keys
+ */
+ function getPreferenceSections() {
+ return array_keys( array_filter( $this->mFieldTree, 'is_array' ) );
+ }
}