X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FPreferences.php;h=70f70609ae8c6ea3f867a9da13f69ea08bc402bd;hb=f38f88d0d39a69cff9a944f7e2d1848ba991291a;hp=26e28baf474b9021b1959522d71120809863b40f;hpb=11ee7f78da9776db26098642a151a288f98bea14;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Preferences.php b/includes/Preferences.php index 26e28baf47..70f70609ae 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -35,23 +35,17 @@ class Preferences { * @return DefaultPreferencesFactory */ protected static function getDefaultPreferencesFactory() { - global $wgContLang; + $services = MediaWikiServices::getInstance(); $authManager = AuthManager::singleton(); - $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer(); - $config = MediaWikiServices::getInstance()->getMainConfig(); + $linkRenderer = $services->getLinkRenderer(); + $config = $services->getMainConfig(); $preferencesFactory = new DefaultPreferencesFactory( - $config, $wgContLang, $authManager, $linkRenderer + $config, $services->getContentLanguage(), $authManager, + $linkRenderer ); return $preferencesFactory; } - /** - * @return array - */ - public static function getSaveBlacklist() { - throw new Exception( __METHOD__ . '() is deprecated and does nothing' ); - } - /** * @throws MWException * @param User $user @@ -59,6 +53,7 @@ class Preferences { * @return array|null */ public static function getPreferences( $user, IContextSource $context ) { + wfDeprecated( __METHOD__, '1.31' ); $preferencesFactory = self::getDefaultPreferencesFactory(); return $preferencesFactory->getFormDescriptor( $user, $context ); } @@ -201,6 +196,7 @@ class Preferences { * @param array &$defaultPreferences */ public static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) { + wfDeprecated( __METHOD__, '1.31' ); } /** @@ -262,77 +258,16 @@ class Preferences { * @param IContextSource $context * @param string $formClass * @param array $remove Array of items to remove - * @return PreferencesForm|HTMLForm + * @return PreferencesFormLegacy|HTMLForm */ public static function getFormObject( $user, IContextSource $context, - $formClass = PreferencesForm::class, + $formClass = PreferencesFormLegacy::class, array $remove = [] ) { + wfDeprecated( __METHOD__, '1.31' ); $preferencesFactory = self::getDefaultPreferencesFactory(); return $preferencesFactory->getForm( $user, $context, $formClass, $remove ); } - - /** - * @param IContextSource $context - * @return array - */ - public static function getTimezoneOptions( IContextSource $context ) { - throw new Exception( __METHOD__ . '() is deprecated and does nothing' ); - } - - /** - * @param string $value - * @param array $alldata - * @return int - */ - public static function filterIntval( $value, $alldata ) { - throw new Exception( __METHOD__ . '() is deprecated and does nothing' ); - } - - /** - * @param string $tz - * @param array $alldata - * @return string - */ - public static function filterTimezoneInput( $tz, $alldata ) { - throw new Exception( __METHOD__ . '() is deprecated and does nothing' ); - } - - /** - * Handle the form submission if everything validated properly - * - * @deprecated since 1.31, use PreferencesFactory - * - * @param array $formData - * @param PreferencesForm $form - * @return bool|Status|string - */ - public static function tryFormSubmit( $formData, $form ) { - $preferencesFactory = self::getDefaultPreferencesFactory(); - return $preferencesFactory->legacySaveFormData( $formData, $form ); - } - - /** - * @param array $formData - * @param PreferencesForm $form - * @return Status - */ - public static function tryUISubmit( $formData, $form ) { - $preferencesFactory = self::getDefaultPreferencesFactory(); - return $preferencesFactory->legacySubmitForm( $formData, $form ); - } - - /** - * Get a list of all time zones - * @param Language $language Language used for the localized names - * @return array A list of all time zones. The system name of the time zone is used as key and - * the value is an array which contains localized name, the timecorrection value used for - * preferences and the region - * @since 1.26 - */ - public static function getTimeZoneList( Language $language ) { - throw new Exception( __METHOD__ . '() is deprecated and does nothing' ); - } }