MediaWiki
1.33.0
|
This is the default implementation of PreferencesFactory. More...
Public Member Functions | |
__construct (Config $config, Language $contLang, AuthManager $authManager, LinkRenderer $linkRenderer) | |
getForm (User $user, IContextSource $context, $formClass=PreferencesFormLegacy::class, array $remove=[]) | |
getFormDescriptor (User $user, IContextSource $context) | |
getSaveBlacklist () | |
@inheritDoc More... | |
Protected Member Functions | |
applyFilters (array &$preferences, array $formDescriptor, $verb) | |
Applies filters to preferences either before or after form usage. More... | |
cleanSignature ( $signature, $alldata, HTMLForm $form) | |
datetimePreferences ( $user, IContextSource $context, &$defaultPreferences) | |
editingPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
filesPreferences (IContextSource $context, &$defaultPreferences) | |
generateSkinOptions (User $user, IContextSource $context) | |
getDateOptions (IContextSource $context) | |
getImageSizes (MessageLocalizer $l10n) | |
getOptionFromUser ( $name, $info, array $userOptions) | |
Pull option from a user account. More... | |
getThumbSizes (MessageLocalizer $l10n) | |
getTimeZoneList (Language $language) | |
Get a list of all time zones. More... | |
getTimezoneOptions (IContextSource $context) | |
profilePreferences (User $user, IContextSource $context, &$defaultPreferences, $canIPUseHTTPS) | |
rcPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
renderingPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
saveFormData ( $formData, HTMLForm $form, array $formDescriptor) | |
Handle the form submission if everything validated properly. More... | |
searchPreferences (&$defaultPreferences) | |
skinPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
submitForm (array $formData, HTMLForm $form, array $formDescriptor) | |
Save the form data and reload the page. More... | |
validateSignature ( $signature, $alldata, HTMLForm $form) | |
watchlistPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
Protected Attributes | |
AuthManager | $authManager |
Config | $config |
Language | $contLang |
The wiki's content language. More... | |
LinkRenderer | $linkRenderer |
Private Member Functions | |
loadPreferenceValues (User $user, IContextSource $context, &$defaultPreferences) | |
Loads existing values for a given array of preferences. More... | |
This is the default implementation of PreferencesFactory.
Definition at line 61 of file DefaultPreferencesFactory.php.
MediaWiki\Preferences\DefaultPreferencesFactory::__construct | ( | Config | $config, |
Language | $contLang, | ||
AuthManager | $authManager, | ||
LinkRenderer | $linkRenderer | ||
) |
Definition at line 82 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$authManager, MediaWiki\Preferences\DefaultPreferencesFactory\$config, MediaWiki\Preferences\DefaultPreferencesFactory\$contLang, and MediaWiki\Preferences\DefaultPreferencesFactory\$linkRenderer.
|
protected |
Applies filters to preferences either before or after form usage.
array | &$preferences | |
array | $formDescriptor | |
string | $verb | Name of the filter method to call, either 'filterFromForm' or 'filterForForm' |
Definition at line 1599 of file DefaultPreferencesFactory.php.
References $filter, $formDescriptor, and as.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1411 of file DefaultPreferencesFactory.php.
References $parser, and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 728 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $e, $lang, $user, class, captcha-old\count, Xml\element(), HTMLFormField\flattenOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getDateOptions(), IContextSource\getLanguage(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions(), and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 881 of file DefaultPreferencesFactory.php.
References $user, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 706 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\getImageSizes(), and MediaWiki\Preferences\DefaultPreferencesFactory\getThumbSizes().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | The User object |
IContextSource | $context |
Definition at line 1238 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $ret, $user, as, Skin\getAllowedSkins(), IContextSource\getLanguage(), Title\makeTitleSafe(), MessageLocalizer\msg(), Title\newMainPage(), NS_USER, and use.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences().
|
protected |
IContextSource | $context |
Definition at line 1317 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $lang, $ret, $wgDefaultUserOptions, as, IContextSource\getLanguage(), MessageLocalizer\msg(), and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
MediaWiki\Preferences\DefaultPreferencesFactory::getForm | ( | User | $user, |
IContextSource | $context, | ||
$formClass = PreferencesFormLegacy::class , |
|||
array | $remove = [] |
||
) |
User | $user | |
IContextSource | $context | |
string | $formClass | |
array | $remove | Array of items to remove |
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 1430 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $formDescriptor, $name, $user, array(), as, captcha-old\count, MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor(), IContextSource\getOutput(), MessageLocalizer\msg(), MediaWiki\Preferences\DefaultPreferencesFactory\submitForm(), and use.
MediaWiki\Preferences\DefaultPreferencesFactory::getFormDescriptor | ( | User | $user, |
IContextSource | $context | ||
) |
MWException |
User | $user | |
IContextSource | $context |
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 111 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $user, MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\editingPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences(), IContextSource\getLanguage(), IContextSource\getRequest(), IContextSource\getSkin(), MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\renderingPreferences(), Hooks\run(), MediaWiki\Preferences\DefaultPreferencesFactory\searchPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences(), and wfCanIPUseHTTPS().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1351 of file DefaultPreferencesFactory.php.
References $ret, as, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Pull option from a user account.
Handles stuff like array-type preferences.
string | $name | |
array | $info | |
array | $userOptions |
Definition at line 197 of file DefaultPreferencesFactory.php.
References $name, $options, $rows, $value, as, class, and HTMLFormField\flattenOptions().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues().
MediaWiki\Preferences\DefaultPreferencesFactory::getSaveBlacklist | ( | ) |
@inheritDoc
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 98 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1368 of file DefaultPreferencesFactory.php.
References $ret, as, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Get a list of all time zones.
Definition at line 1660 of file DefaultPreferencesFactory.php.
References $value, as, captcha-old\count, and wfMessage().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions().
|
protected |
IContextSource | $context |
Definition at line 1477 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $opt, as, IContextSource\getLanguage(), MWTimestamp\getLocalInstance(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimeZoneList(), and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
|
private |
Loads existing values for a given array of preferences.
MWException |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences | Array to load values for |
Definition at line 145 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $name, $user, MediaWiki\Preferences\DefaultPreferencesFactory\applyFilters(), as, User\getDefaultOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getOptionFromUser(), MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist(), and HTMLForm\loadInputFromParameters().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences | |
bool | $canIPUseHTTPS | Whether the user's IP is likely to be able to access the wiki via HTTPS. |
Definition at line 243 of file DefaultPreferencesFactory.php.
References $code, MediaWiki\$context, $lang, $languages, $name, $options, $t, $time, $user, array(), as, LanguageCode\bcp47(), class, MediaWiki\Preferences\DefaultPreferencesFactory\cleanSignature(), captcha-old\count, Language\fetchLanguageNames(), UserGroupMembership\getExpiry(), MediaWiki\MediaWikiServices\getInstance(), IContextSource\getLanguage(), UserGroupMembership\getLink(), IContextSource\getOutput(), IContextSource\getTitle(), SpecialPage\getTitleFor(), IContextSource\getUser(), MessageLocalizer\msg(), ParserOptions\newFromContext(), string, text, and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 948 of file DefaultPreferencesFactory.php.
References $user, class, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 807 of file DefaultPreferencesFactory.php.
References $user, $value, as, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Handle the form submission if everything validated properly.
array | $formData | |
HTMLForm | $form | |
array[] | $formDescriptor |
Definition at line 1525 of file DefaultPreferencesFactory.php.
References $formDescriptor, $user, $value, MediaWiki\Preferences\DefaultPreferencesFactory\applyFilters(), as, ContextSource\getContext(), MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist(), StatusValue\newFatal(), and Hooks\run().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
|
protected |
array | &$defaultPreferences |
Definition at line 1225 of file DefaultPreferencesFactory.php.
References as, and MWNamespace\getValidNamespaces().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 658 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $user, MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), IContextSource\getLanguage(), Title\makeTitleSafe(), MessageLocalizer\msg(), and NS_USER.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Save the form data and reload the page.
array | $formData | |
HTMLForm | $form | |
array | $formDescriptor |
Definition at line 1628 of file DefaultPreferencesFactory.php.
References MediaWiki\$context, $formDescriptor, $res, ContextSource\getContext(), IContextSource\getOutput(), IContextSource\getRequest(), HTMLForm\getTitle(), StatusValue\newGood(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1386 of file DefaultPreferencesFactory.php.
References Xml\element(), MediaWiki\MediaWikiServices\getInstance(), and ContextSource\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 1047 of file DefaultPreferencesFactory.php.
References MediaWiki\$action, MediaWiki\$context, $options, $user, as, SpecialWatchlist\checkStructuredFilterUiEnabled(), class, SpecialPage\getTitleFor(), MessageLocalizer\msg(), and string.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Definition at line 71 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 65 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
The wiki's content language.
Definition at line 68 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 74 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().