Add PreferencesFormPreSave hook
[lhc/web/wiklou.git] / includes / Preferences.php
index 3ff99fc..4e327b3 100644 (file)
@@ -748,7 +748,7 @@ class Preferences {
                }
 
                $defaultPreferences['stubthreshold'] = array(
-                       'type' => 'selectorother',
+                       'type' => 'select',
                        'section' => 'rendering/advancedrendering',
                        'options' => $stubThresholdOptions,
                        'size' => 20,
@@ -1047,14 +1047,6 @@ class Preferences {
        static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
                global $wgContLang, $wgVectorUseSimpleSearch;
 
-               ## Search #####################################
-               $defaultPreferences['searchlimit'] = array(
-                       'type' => 'int',
-                       'label-message' => 'resultsperpage',
-                       'section' => 'searchoptions/displaysearchoptions',
-                       'min' => 0,
-               );
-
                if ( $wgVectorUseSimpleSearch ) {
                        $defaultPreferences['vector-simplesearch'] = array(
                                'type' => 'toggle',
@@ -1463,7 +1455,6 @@ class Preferences {
                        # If users have saved a value for a preference which has subsequently been disabled
                        # via $wgHiddenPrefs, we don't want to destroy that setting in case the preference
                        # is subsequently re-enabled
-                       # TODO: maintenance script to actually delete these
                        foreach ( $wgHiddenPrefs as $pref ) {
                                # If the user has not set a non-default value here, the default will be returned
                                # and subsequently discarded
@@ -1477,6 +1468,7 @@ class Preferences {
                                $user->setOption( $key, $value );
                        }
 
+                       wfRunHooks( 'PreferencesFormPreSave', array( $formData, $form, $user, &$result ) );
                        $user->saveSettings();
                }