MediaWiki  REL1_31
Preferences Class Reference

This class has been replaced by the PreferencesFactory service. More...

Static Public Member Functions

static cleanSignature ( $signature, $alldata, $form)
 
static datetimePreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static editingPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static filesPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static filterIntval ( $value, $alldata)
 
static filterTimezoneInput ( $tz, $alldata)
 
static generateSkinOptions ( $user, IContextSource $context)
 
static getDateOptions (IContextSource $context)
 
static getFormObject ( $user, IContextSource $context, $formClass=PreferencesForm::class, array $remove=[])
 
static getImageSizes (IContextSource $context)
 
static getOptionFromUser ( $name, $info, $user)
 Pull option from a user account. More...
 
static getPreferences ( $user, IContextSource $context)
 
static getSaveBlacklist ()
 
static getThumbSizes (IContextSource $context)
 
static getTimeZoneList (Language $language)
 Get a list of all time zones. More...
 
static getTimezoneOptions (IContextSource $context)
 
static loadPreferenceValues ( $user, $context, &$defaultPreferences)
 Loads existing values for a given array of preferences. More...
 
static miscPreferences ( $user, IContextSource $context, &$defaultPreferences)
 Dummy, kept for backwards-compatibility. More...
 
static profilePreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static rcPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static renderingPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static searchPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static skinPreferences ( $user, IContextSource $context, &$defaultPreferences)
 
static tryFormSubmit ( $formData, $form)
 Handle the form submission if everything validated properly. More...
 
static tryUISubmit ( $formData, $form)
 
static validateSignature ( $signature, $alldata, $form)
 
static watchlistPreferences ( $user, IContextSource $context, &$defaultPreferences)
 

Static Protected Member Functions

static getDefaultPreferencesFactory ()
 A shim to maintain backwards-compatibility of this class, basically replicating the default behaviour of the PreferencesFactory service but not permitting overriding. More...
 

Detailed Description

This class has been replaced by the PreferencesFactory service.

Deprecated:
since 1.31 use the PreferencesFactory service instead.

Definition at line 30 of file Preferences.php.

Member Function Documentation

◆ cleanSignature()

static Preferences::cleanSignature (   $signature,
  $alldata,
  $form 
)
static
Parameters
string$signature
array$alldata
HTMLForm$form
Returns
string

Definition at line 256 of file Preferences.php.

◆ datetimePreferences()

static Preferences::datetimePreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences
Returns
void

Definition at line 132 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ editingPreferences()

static Preferences::editingPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 156 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ filesPreferences()

static Preferences::filesPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 119 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ filterIntval()

static Preferences::filterIntval (   $value,
  $alldata 
)
static
Parameters
string$value
array$alldata
Returns
int

Definition at line 290 of file Preferences.php.

◆ filterTimezoneInput()

static Preferences::filterTimezoneInput (   $tz,
  $alldata 
)
static
Parameters
string$tz
array$alldata
Returns
string

Definition at line 299 of file Preferences.php.

◆ generateSkinOptions()

static Preferences::generateSkinOptions (   $user,
IContextSource  $context 
)
static
Parameters
User$user
IContextSource$context
Returns
array Text/links to display as key; $skinkey as value

Definition at line 211 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ getDateOptions()

static Preferences::getDateOptions ( IContextSource  $context)
static
Parameters
IContextSource$context
Returns
array

Definition at line 220 of file Preferences.php.

◆ getDefaultPreferencesFactory()

static Preferences::getDefaultPreferencesFactory ( )
staticprotected

A shim to maintain backwards-compatibility of this class, basically replicating the default behaviour of the PreferencesFactory service but not permitting overriding.

Returns
DefaultPreferencesFactory

Definition at line 37 of file Preferences.php.

References $linkRenderer, $wgContLang, and global.

Referenced by getFormObject(), getPreferences(), tryFormSubmit(), and tryUISubmit().

◆ getFormObject()

static Preferences::getFormObject (   $user,
IContextSource  $context,
  $formClass = PreferencesForm::class,
array  $remove = [] 
)
static
Parameters
User$user
IContextSource$context
string$formClass
array$removeArray of items to remove
Returns
PreferencesForm|HTMLForm

Definition at line 267 of file Preferences.php.

References $context, $user, and getDefaultPreferencesFactory().

◆ getImageSizes()

static Preferences::getImageSizes ( IContextSource  $context)
static
Parameters
IContextSource$context
Returns
array

Definition at line 228 of file Preferences.php.

◆ getOptionFromUser()

static Preferences::getOptionFromUser (   $name,
  $info,
  $user 
)
static

Pull option from a user account.

Handles stuff like array-type preferences.

Parameters
string$name
array$info
User$user
Returns
array|string

Definition at line 86 of file Preferences.php.

◆ getPreferences()

static Preferences::getPreferences (   $user,
IContextSource  $context 
)
static

◆ getSaveBlacklist()

static Preferences::getSaveBlacklist ( )
static
Returns
array

Definition at line 51 of file Preferences.php.

◆ getThumbSizes()

static Preferences::getThumbSizes ( IContextSource  $context)
static
Parameters
IContextSource$context
Returns
array

Definition at line 236 of file Preferences.php.

◆ getTimeZoneList()

static Preferences::getTimeZoneList ( Language  $language)
static

Get a list of all time zones.

Parameters
Language$languageLanguage used for the localized names
Returns
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

Definition at line 335 of file Preferences.php.

◆ getTimezoneOptions()

static Preferences::getTimezoneOptions ( IContextSource  $context)
static
Parameters
IContextSource$context
Returns
array

Definition at line 281 of file Preferences.php.

◆ loadPreferenceValues()

static Preferences::loadPreferenceValues (   $user,
  $context,
$defaultPreferences 
)
static

Loads existing values for a given array of preferences.

Exceptions
MWException
Parameters
User$user
IContextSource$context
array&$defaultPreferencesArray to load values for
Returns
array|null

Definition at line 74 of file Preferences.php.

◆ miscPreferences()

static Preferences::miscPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static

Dummy, kept for backwards-compatibility.

Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 203 of file Preferences.php.

◆ profilePreferences()

static Preferences::profilePreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences
Returns
void

Definition at line 96 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ rcPreferences()

static Preferences::rcPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 168 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ renderingPreferences()

static Preferences::renderingPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 144 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ searchPreferences()

static Preferences::searchPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 190 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ skinPreferences()

static Preferences::skinPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences
Returns
void

Definition at line 109 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().

◆ tryFormSubmit()

static Preferences::tryFormSubmit (   $formData,
  $form 
)
static

Handle the form submission if everything validated properly.

Deprecated:
since 1.31, use PreferencesFactory
Parameters
array$formData
PreferencesForm$form
Returns
bool|Status|string

Definition at line 312 of file Preferences.php.

References getDefaultPreferencesFactory().

◆ tryUISubmit()

static Preferences::tryUISubmit (   $formData,
  $form 
)
static
Parameters
array$formData
PreferencesForm$form
Returns
Status

Definition at line 322 of file Preferences.php.

References getDefaultPreferencesFactory().

◆ validateSignature()

static Preferences::validateSignature (   $signature,
  $alldata,
  $form 
)
static
Parameters
string$signature
array$alldata
HTMLForm$form
Returns
bool|string

Definition at line 246 of file Preferences.php.

◆ watchlistPreferences()

static Preferences::watchlistPreferences (   $user,
IContextSource  $context,
$defaultPreferences 
)
static
Parameters
User$user
IContextSource$context
array&$defaultPreferences

Definition at line 178 of file Preferences.php.

References $context, $user, getPreferences(), and wfDeprecated().


The documentation for this class was generated from the following file: