/**
* @throws MWException
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @return array|null
*/
- static function getPreferences( $user, IContextSource $context ) {
+ public static function getPreferences( $user, ContextSource $context ) {
if ( self::$defaultPreferences ) {
return self::$defaultPreferences;
}
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences
* @return void
*/
- static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function profilePreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
$wgDisableTitleConversion, $wgDisableLangConversion, $wgMaxSigChars,
$wgEnableEmail, $wgEmailConfirmToEdit, $wgEnableUserEmail, $wgEmailAuthentication,
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences
* @return void
*/
- static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function skinPreferences( $user, ContextSource $context, &$defaultPreferences ) {
## Skin #####################################
global $wgAllowUserCss, $wgAllowUserJs;
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences Array
*/
- static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function renderingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
## Page Rendering ##############################
global $wgAllowUserCssPrefs;
if ( $wgAllowUserCssPrefs ) {
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences Array
*/
- static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function editingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgUseExternalEditor, $wgAllowUserCssPrefs;
## Editing #####################################
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences Array
*/
- static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function rcPreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgRCMaxAge, $wgRCShowWatchingUsers;
## RecentChanges #####################################
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences
*/
- static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function watchlistPreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
$watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) );
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences Array
*/
- static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function searchPreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgContLang, $wgEnableMWSuggest, $wgVectorUseSimpleSearch;
## Search #####################################
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $defaultPreferences Array
*/
- static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
+ static function miscPreferences( $user, ContextSource $context, &$defaultPreferences ) {
global $wgContLang;
## Misc #####################################
/**
* @param $user User The User object
- * @param $context IContextSource
+ * @param $context ContextSource
* @return Array: text/links to display as key; $skinkey as value
*/
- static function generateSkinOptions( $user, IContextSource $context ) {
+ static function generateSkinOptions( $user, ContextSource $context ) {
global $wgDefaultSkin, $wgAllowUserCss, $wgAllowUserJs;
$ret = array();
}
/**
- * @param $context IContextSource
+ * @param $context ContextSource
* @return array
*/
- static function getDateOptions( IContextSource $context ) {
+ static function getDateOptions( ContextSource $context ) {
$lang = $context->getLanguage();
$dateopts = $lang->getDatePreferences();
}
/**
- * @param $context IContextSource
+ * @param $context ContextSource
* @return array
*/
- static function getImageSizes( IContextSource $context ) {
+ static function getImageSizes( ContextSource $context ) {
global $wgImageLimits;
$ret = array();
}
/**
- * @param $context IContextSource
+ * @param $context ContextSource
* @return array
*/
- static function getThumbSizes( IContextSource $context ) {
+ static function getThumbSizes( ContextSource $context ) {
global $wgThumbLimits;
$ret = array();
/**
* @param $user User
- * @param $context IContextSource
+ * @param $context ContextSource
* @param $formClass string
* @param $remove Array: array of items to remove
* @return HtmlForm
*/
- static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
+ static function getFormObject( $user, ContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
$formDescriptor = Preferences::getPreferences( $user, $context );
if ( count( $remove ) ) {
$removeKeys = array_flip( $remove );
$formDescriptor = array_diff_key( $formDescriptor, $removeKeys );
}
+
+ /**
+ * @var $htmlForm PreferencesForm
+ */
$htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
$htmlForm->setModifiedUser( $user );
}
/**
+ * @param $context ContextSource
* @return array
*/
- static function getTimezoneOptions( IContextSource $context ) {
+ static function getTimezoneOptions( ContextSource $context ) {
$opt = array();
global $wgLocalTZoffset, $wgLocaltimezone;
/**
* @param $formData
- * @param $form HTMLForm
+ * @param $form PreferencesForm
* @param $entryPoint string
* @return bool|Status|string
*/
/**
* @param $formData
+ * @param $form PreferencesForm
* @return Status
*/
public static function tryUISubmit( $formData, $form ) {
private $modifiedUser;
+ /**
+ * @param $user User
+ */
public function setModifiedUser( $user ) {
$this->modifiedUser = $user;
}
+ /**
+ * @return User
+ */
public function getModifiedUser() {
if ( $this->modifiedUser === null ) {
return $this->getUser();
return $data;
}
+
/**
* Get the whole body of the form.
+ * @return string
*/
function getBody() {
return $this->displaySection( $this->mFieldTree, '', 'mw-prefsection-' );
/**
* Get the <legend> for a given section key. Normally this is the
* prefs-$key message but we'll allow extensions to override it.
+ * @param $key string
+ * @return string
*/
function getLegend( $key ) {
$legend = parent::getLegend( $key );