X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;ds=sidebyside;f=includes%2FPreferences.php;h=44995aca3513c7f0705634352f26ddcdb5c0d4c3;hb=2f0220a56ddf5528bff59aed8123515fad6920b0;hp=98fc936df46896f460d79fa5498110ea99eeae5d;hpb=e9c41b239cf67cc258f071586ed201d0bd9ee462;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Preferences.php b/includes/Preferences.php index 98fc936df4..44995aca35 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -96,7 +96,7 @@ class Preferences { self::searchPreferences( $user, $context, $defaultPreferences ); self::miscPreferences( $user, $context, $defaultPreferences ); - wfRunHooks( 'GetPreferences', array( $user, &$defaultPreferences ) ); + Hooks::run( 'GetPreferences', array( $user, &$defaultPreferences ) ); self::loadPreferenceValues( $user, $context, $defaultPreferences ); self::$defaultPreferences = $defaultPreferences; @@ -706,7 +706,6 @@ class Preferences { 'options' => $tzOptions, 'default' => $tzSetting, 'size' => 20, - 'maxlength' => 6, 'section' => 'rendering/timeoffset', ); } @@ -1434,7 +1433,7 @@ class Preferences { $user->setOption( $key, $value ); } - wfRunHooks( 'PreferencesFormPreSave', array( $formData, $form, $user, &$result ) ); + Hooks::run( 'PreferencesFormPreSave', array( $formData, $form, $user, &$result ) ); $user->saveSettings(); } @@ -1467,28 +1466,6 @@ class Preferences { return Status::newGood(); } - - /** - * Try to set a user's email address. - * This does *not* try to validate the address. - * Caller is responsible for checking $wgAuth and 'editmyprivateinfo' - * right. - * - * @deprecated since 1.20; use User::setEmailWithConfirmation() instead. - * @param User $user - * @param string $newaddr New email address - * @return array (true on success or Status on failure, info string) - */ - public static function trySetUserEmail( User $user, $newaddr ) { - wfDeprecated( __METHOD__, '1.20' ); - - $result = $user->setEmailWithConfirmation( $newaddr ); - if ( $result->isGood() ) { - return array( true, $result->value ); - } else { - return array( $result, 'mailerror' ); - } - } } /** Some tweaks to allow js prefs to work */ @@ -1540,12 +1517,8 @@ class PreferencesForm extends HTMLForm { * @return string */ function getButtons() { - global $wgUseMediaWikiUIEverywhere; $attrs = array( 'id' => 'mw-prefs-restoreprefs' ); - if ( $wgUseMediaWikiUIEverywhere ) { - $attrs['class'] = 'mw-ui-button mw-ui-quiet'; - } if ( !$this->getModifiedUser()->isAllowedAny( 'editmyprivateinfo', 'editmyoptions' ) ) { return ''; @@ -1557,7 +1530,7 @@ class PreferencesForm extends HTMLForm { $t = SpecialPage::getTitleFor( 'Preferences', 'reset' ); $html .= "\n" . Linker::link( $t, $this->msg( 'restoreprefs' )->escaped(), - $attrs ); + Html::buttonAttributes( $attrs, array( 'mw-ui-quiet' ) ) ); $html = Xml::tags( 'div', array( 'class' => 'mw-prefs-buttons' ), $html ); } @@ -1602,7 +1575,7 @@ class PreferencesForm extends HTMLForm { */ function getLegend( $key ) { $legend = parent::getLegend( $key ); - wfRunHooks( 'PreferencesGetLegend', array( $this, $key, &$legend ) ); + Hooks::run( 'PreferencesGetLegend', array( $this, $key, &$legend ) ); return $legend; } }