MediaWiki master
|
Provides access to user options. More...
Inherited by MediaWiki\User\Options\DefaultOptionsLookup, MediaWiki\User\Options\StaticUserOptionsLookup, and MediaWiki\User\Options\UserOptionsManager.
Public Member Functions | |
getBoolOption (UserIdentity $user, string $oname, int $queryFlags=IDBAccessObject::READ_NORMAL) | |
Get the user's current setting for a given option, as a boolean value. | |
getDefaultOption (string $opt, ?UserIdentity $userIdentity=null) | |
Get a given default option value. | |
getDefaultOptions (?UserIdentity $userIdentity=null) | |
Combine the language default options with any site-specific and user-specific defaults and add the default language variants. | |
getIntOption (UserIdentity $user, string $oname, int $defaultOverride=0, int $queryFlags=IDBAccessObject::READ_NORMAL) | |
Get the user's current setting for a given option, as an integer value. | |
getOption (UserIdentity $user, string $oname, $defaultOverride=null, bool $ignoreHidden=false, int $queryFlags=IDBAccessObject::READ_NORMAL) | |
Get the user's current setting for a given option. | |
getOptions (UserIdentity $user, int $flags=0, int $queryFlags=IDBAccessObject::READ_NORMAL) | |
Get all user's options. | |
isOptionGlobal (UserIdentity $user, string $key) | |
Determine if a user option came from a source other than the local store or the defaults. | |
Public Attributes | |
const | EXCLUDE_DEFAULTS = 1 |
Exclude user options that are set to their default value. | |
const | LOCAL_EXCEPTION_SUFFIX = '-local-exception' |
The suffix appended to preference names for the associated preference that tracks whether they have a local override. | |
MediaWiki\User\Options\UserOptionsLookup::getBoolOption | ( | UserIdentity | $user, |
string | $oname, | ||
int | $queryFlags = IDBAccessObject::READ_NORMAL ) |
Get the user's current setting for a given option, as a boolean value.
UserIdentity | $user | The user to get the option for |
string | $oname | The option to check |
int | $queryFlags | A bit field composed of READ_XXX flags |
Definition at line 119 of file UserOptionsLookup.php.
Referenced by Skin\getCategories(), Skin\getCategoryLinks(), Skin\getDefaultModules(), Skin\isResponsive(), ChangesList\newFromContext(), and MediaWiki\Actions\ActionEntryPoint\performRequest().
MediaWiki\User\Options\UserOptionsLookup::getDefaultOption | ( | string | $opt, |
?UserIdentity | $userIdentity = null ) |
Get a given default option value.
string | $opt | Name of option to retrieve |
UserIdentity | null | $userIdentity | User to look the defaults up for; set to null to ignore any user-specific defaults (since 1.42) |
Reimplemented in MediaWiki\User\Options\UserOptionsManager.
Definition at line 62 of file UserOptionsLookup.php.
References MediaWiki\User\Options\UserOptionsLookup\getDefaultOptions().
Referenced by MediaWiki\Language\Language\dateFormat(), MediaWiki\Parser\CoreParserFunctions\gender(), and MediaWiki\Linker\Linker\makeImageLink().
|
abstract |
Combine the language default options with any site-specific and user-specific defaults and add the default language variants.
UserIdentity | null | $userIdentity | User to look the default up for; set to null to ignore any user-specific defaults (since 1.42) |
Reimplemented in MediaWiki\User\Options\DefaultOptionsLookup, MediaWiki\User\Options\StaticUserOptionsLookup, and MediaWiki\User\Options\UserOptionsManager.
Referenced by MediaWiki\User\Options\UserOptionsLookup\getDefaultOption().
MediaWiki\User\Options\UserOptionsLookup::getIntOption | ( | UserIdentity | $user, |
string | $oname, | ||
int | $defaultOverride = 0, | ||
int | $queryFlags = IDBAccessObject::READ_NORMAL ) |
Get the user's current setting for a given option, as an integer value.
UserIdentity | $user | The user to get the option for |
string | $oname | The option to check |
int | $defaultOverride | A default value returned if the option does not exist |
int | $queryFlags | A bit field composed of READ_XXX flags |
Definition at line 138 of file UserOptionsLookup.php.
|
abstract |
Get the user's current setting for a given option.
UserIdentity | $user | The user to get the option for |
string | $oname | The option to check |
mixed | null | $defaultOverride | A default value returned if the option does not exist |
bool | $ignoreHidden | Whether to ignore the effects of $wgHiddenPrefs |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented in MediaWiki\User\Options\DefaultOptionsLookup, MediaWiki\User\Options\StaticUserOptionsLookup, and MediaWiki\User\Options\UserOptionsManager.
Referenced by EmailNotification\actuallyNotifyOnPageChange(), MediaWiki\EditPage\TextboxBuilder\buildTextboxAttribs(), MediaWiki\User\User\canReceiveEmail(), MediaWiki\User\User\getDatePreference(), Skin\getDefaultModules(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), MediaWiki\Context\RequestContext\getLanguage(), and MediaWiki\User\User\getTokenFromOption().
|
abstract |
Get all user's options.
UserIdentity | $user | The user to get the option for |
int | $flags | Bitwise combination of: UserOptionsManager::EXCLUDE_DEFAULTS Exclude user options that are set to the default value. Options that are set to their conditionally default value are not excluded. |
int | $queryFlags | A bit field composed of READ_XXX flags |
Reimplemented in MediaWiki\User\Options\DefaultOptionsLookup, MediaWiki\User\Options\StaticUserOptionsLookup, and MediaWiki\User\Options\UserOptionsManager.
Referenced by MediaWiki\ResourceLoader\UserOptionsModule\getScript().
MediaWiki\User\Options\UserOptionsLookup::isOptionGlobal | ( | UserIdentity | $user, |
string | $key ) |
Determine if a user option came from a source other than the local store or the defaults.
If this is true, setting the option will be ignored unless GLOBAL_OVERRIDE or GLOBAL_UPDATE is passed to setOption().
UserIdentity | $user | |
string | $key |
Reimplemented in MediaWiki\User\Options\UserOptionsManager.
Definition at line 161 of file UserOptionsLookup.php.
const MediaWiki\User\Options\UserOptionsLookup::EXCLUDE_DEFAULTS = 1 |
Exclude user options that are set to their default value.
Definition at line 35 of file UserOptionsLookup.php.
const MediaWiki\User\Options\UserOptionsLookup::LOCAL_EXCEPTION_SUFFIX = '-local-exception' |
The suffix appended to preference names for the associated preference that tracks whether they have a local override.
Definition at line 42 of file UserOptionsLookup.php.