Also set the queue types map when rebuilding the ready queue map
[lhc/web/wiklou.git] / includes / Preferences.php
index 493626a..081315e 100644 (file)
  * over to the tryUISubmit static method of this class.
  */
 class Preferences {
-       static $defaultPreferences = null;
-       static $saveFilters = array(
-                       'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
-                       'cols' => array( 'Preferences', 'filterIntval' ),
-                       'rows' => array( 'Preferences', 'filterIntval' ),
-                       'rclimit' => array( 'Preferences', 'filterIntval' ),
-                       'wllimit' => array( 'Preferences', 'filterIntval' ),
-                       'searchlimit' => array( 'Preferences', 'filterIntval' ),
+       /** @var array */
+       protected static $defaultPreferences = null;
+
+       /** @var array */
+       protected static $saveFilters = array(
+               'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
+               'cols' => array( 'Preferences', 'filterIntval' ),
+               'rows' => array( 'Preferences', 'filterIntval' ),
+               'rclimit' => array( 'Preferences', 'filterIntval' ),
+               'wllimit' => array( 'Preferences', 'filterIntval' ),
+               'searchlimit' => array( 'Preferences', 'filterIntval' ),
        );
 
        // Stuff that shouldn't be saved as a preference.
@@ -210,13 +213,6 @@ class Preferences {
                        'section' => 'personal/info',
                );
 
-               $defaultPreferences['userid'] = array(
-                       'type' => 'info',
-                       'label-message' => array( 'uid', $userName ),
-                       'default' => $user->getId(),
-                       'section' => 'personal/info',
-               );
-
                # Get groups to which the user belongs
                $userEffectiveGroups = $user->getEffectiveGroups();
                $userGroups = $userMembers = array();
@@ -1014,29 +1010,11 @@ class Preferences {
         * @param array $defaultPreferences
         */
        static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
-               global $wgContLang;
-
-               $defaultPreferences['searcheverything'] = array(
-                       'type' => 'toggle',
-                       'label-message' => 'searcheverything-enable',
-                       'section' => 'searchoptions/advancedsearchoptions',
-               );
-
-               $nsOptions = $wgContLang->getFormattedNamespaces();
-               $nsOptions[0] = $context->msg( 'blanknamespace' )->text();
-               foreach ( $nsOptions as $ns => $name ) {
-                       if ( $ns < 0 ) {
-                               unset( $nsOptions[$ns] );
-                       }
+               foreach ( MWNamespace::getValidNamespaces() as $n ) {
+                       $defaultPreferences[ 'searchNs' . $n ] = array(
+                               'type' => 'api',
+                       );
                }
-
-               $defaultPreferences['searchnamespaces'] = array(
-                       'type' => 'multiselect',
-                       'label-message' => 'defaultns',
-                       'options' => array_flip( $nsOptions ),
-                       'section' => 'searchoptions/advancedsearchoptions',
-                       'prefix' => 'searchNs',
-               );
        }
 
        /**
@@ -1401,7 +1379,10 @@ class Preferences {
 
                // Fortunately, the realname field is MUCH simpler
                // (not really "private", but still shouldn't be edited without permission)
-               if ( !in_array( 'realname', $wgHiddenPrefs ) && $user->isAllowed( 'editmyprivateinfo' ) && array_key_exists( 'realname', $formData ) ) {
+               if ( !in_array( 'realname', $wgHiddenPrefs )
+                       && $user->isAllowed( 'editmyprivateinfo' )
+                       && array_key_exists( 'realname', $formData )
+               ) {
                        $realName = $formData['realname'];
                        $user->setRealName( $realName );
                }