X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPreferences.php;h=081315e2a29faa01a9832df8fd4d947d209a4578;hb=911d50b022587b966fadf8374b7bd739b7830732;hp=1f1b7dde813b88cfedcabfb8b3e892b7abe21a92;hpb=7fa77c2d52a8aa5c7c6fe7fd7af27770f1ecad12;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Preferences.php b/includes/Preferences.php index 1f1b7dde81..081315e2a2 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1010,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', - ); } /**