MediaWiki REL1_35
|
This is the default implementation of PreferencesFactory. More...
Public Member Functions | |
__construct (ServiceOptions $options, Language $contLang, AuthManager $authManager, LinkRenderer $linkRenderer, NamespaceInfo $nsInfo, PermissionManager $permissionManager, ILanguageConverter $languageConverter=null, LanguageNameUtils $languageNameUtils=null, HookContainer $hookContainer=null) | |
getForm (User $user, IContextSource $context, $formClass=PreferencesFormOOUI::class, array $remove=[]) | |
getFormDescriptor (User $user, IContextSource $context) | |
getSaveBlacklist () | |
Get the names of preferences that should never be saved (such as 'realname' and 'emailaddress').
| |
Protected Member Functions | |
applyFilters (array &$preferences, array $formDescriptor, $verb) | |
Applies filters to preferences either before or after form usage. | |
cleanSignature ( $signature, $alldata, HTMLForm $form) | |
datetimePreferences (User $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. | |
getThumbSizes (MessageLocalizer $l10n) | |
getTimeZoneList (Language $language) | |
Get a list of all time zones. | |
getTimezoneOptions (IContextSource $context) | |
profilePreferences (User $user, IContextSource $context, &$defaultPreferences, $canIPUseHTTPS) | |
rcPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
renderingPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
saveFormData ( $formData, PreferencesFormOOUI $form, array $formDescriptor) | |
Handle the form submission if everything validated properly. | |
searchPreferences (&$defaultPreferences) | |
skinPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
submitForm (array $formData, PreferencesFormOOUI $form, array $formDescriptor) | |
Save the form data and reload the page. | |
validateSignature ( $signature, $alldata, HTMLForm $form) | |
watchlistPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
Protected Attributes | |
AuthManager | $authManager |
Language | $contLang |
The wiki's content language. | |
LanguageNameUtils | $languageNameUtils |
LinkRenderer | $linkRenderer |
NamespaceInfo | $nsInfo |
ServiceOptions | $options |
PermissionManager | $permissionManager |
Private Member Functions | |
loadPreferenceValues (User $user, IContextSource $context, &$defaultPreferences) | |
Loads existing values for a given array of preferences. | |
Private Attributes | |
HookRunner | $hookRunner |
ILanguageConverter | $languageConverter |
This is the default implementation of PreferencesFactory.
Definition at line 65 of file DefaultPreferencesFactory.php.
MediaWiki\Preferences\DefaultPreferencesFactory::__construct | ( | ServiceOptions | $options, |
Language | $contLang, | ||
AuthManager | $authManager, | ||
LinkRenderer | $linkRenderer, | ||
NamespaceInfo | $nsInfo, | ||
PermissionManager | $permissionManager, | ||
ILanguageConverter | $languageConverter = null , |
||
LanguageNameUtils | $languageNameUtils = null , |
||
HookContainer | $hookContainer = null |
||
) |
ServiceOptions | $options | |
Language | $contLang | |
AuthManager | $authManager | |
LinkRenderer | $linkRenderer | |
NamespaceInfo | $nsInfo | |
PermissionManager | $permissionManager | |
ILanguageConverter | null | $languageConverter | |
LanguageNameUtils | null | $languageNameUtils | |
HookContainer | null | $hookContainer |
Definition at line 142 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$authManager, MediaWiki\Preferences\DefaultPreferencesFactory\$contLang, MediaWiki\Preferences\DefaultPreferencesFactory\$languageConverter, MediaWiki\Preferences\DefaultPreferencesFactory\$languageNameUtils, MediaWiki\Preferences\DefaultPreferencesFactory\$linkRenderer, MediaWiki\Preferences\DefaultPreferencesFactory\$nsInfo, MediaWiki\Preferences\DefaultPreferencesFactory\$options, MediaWiki\Preferences\DefaultPreferencesFactory\$permissionManager, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\MediaWikiServices\getInstance(), and wfDeprecated().
|
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 1836 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1636 of file DefaultPreferencesFactory.php.
References MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 888 of file DefaultPreferencesFactory.php.
References $lang, Xml\element(), MediaWiki\Preferences\DefaultPreferencesFactory\getDateOptions(), IContextSource\getLanguage(), User\getOption(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions(), and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 1042 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 867 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\getImageSizes(), and MediaWiki\Preferences\DefaultPreferencesFactory\getThumbSizes().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context |
Definition at line 1406 of file DefaultPreferencesFactory.php.
References IContextSource\getLanguage(), User\getName(), User\getOption(), IContextSource\getRequest(), MessageLocalizer\msg(), and NS_USER.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences().
|
protected |
IContextSource | $context |
Definition at line 1503 of file DefaultPreferencesFactory.php.
References $lang, $wgDefaultUserOptions, IContextSource\getLanguage(), MessageLocalizer\msg(), and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
MediaWiki\Preferences\DefaultPreferencesFactory::getForm | ( | User | $user, |
IContextSource | $context, | ||
$formClass = PreferencesFormOOUI::class , |
|||
array | $remove = [] |
||
) |
User | $user | |
IContextSource | $context | |
string | $formClass | |
array | $remove | Array of items to remove |
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 1655 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor(), IContextSource\getOutput(), IContextSource\getRequest(), IContextSource\getTitle(), MessageLocalizer\msg(), and MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
MediaWiki\Preferences\DefaultPreferencesFactory::getFormDescriptor | ( | User | $user, |
IContextSource | $context | ||
) |
MWException |
User | $user | |
IContextSource | $context |
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 199 of file DefaultPreferencesFactory.php.
References 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(), 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 1537 of file DefaultPreferencesFactory.php.
References 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 286 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$options.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues().
MediaWiki\Preferences\DefaultPreferencesFactory::getSaveBlacklist | ( | ) |
Get the names of preferences that should never be saved (such as 'realname' and 'emailaddress').
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 186 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1554 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Get a list of all time zones.
Definition at line 1897 of file DefaultPreferencesFactory.php.
References wfMessage().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions().
|
protected |
IContextSource | $context |
Definition at line 1715 of file DefaultPreferencesFactory.php.
References IContextSource\getLanguage(), 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 233 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\applyFilters(), User\getDefaultOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getOptionFromUser(), User\getOptions(), and MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist().
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 332 of file DefaultPreferencesFactory.php.
References $lang, MediaWiki\Preferences\DefaultPreferencesFactory\$options, $t, MediaWiki\Preferences\DefaultPreferencesFactory\cleanSignature(), User\getBoolOption(), User\getEditCount(), User\getEffectiveGroups(), User\getEmail(), User\getEmailAuthenticationTimestamp(), UserGroupMembership\getExpiry(), User\getGroupMemberships(), MediaWiki\MediaWikiServices\getInstance(), IContextSource\getLanguage(), User\getName(), User\getOption(), IContextSource\getOutput(), User\getRealName(), User\getRegistration(), IContextSource\getRequest(), IContextSource\getTitle(), SpecialPage\getTitleFor(), User\getTitleKey(), IContextSource\getUser(), MessageLocalizer\msg(), and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 1108 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg(), User\useNPPatrol(), and User\useRCPatrol().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 968 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Handle the form submission if everything validated properly.
array | $formData | |
PreferencesFormOOUI | $form | |
array[] | $formDescriptor |
Definition at line 1763 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\applyFilters(), ContextSource\getContext(), PreferencesFormOOUI\getModifiedUser(), and MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
|
protected |
array | &$defaultPreferences |
Definition at line 1380 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 821 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), IContextSource\getLanguage(), User\getName(), MessageLocalizer\msg(), and NS_USER.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Save the form data and reload the page.
array | $formData | |
PreferencesFormOOUI | $form | |
array | $formDescriptor |
Definition at line 1865 of file DefaultPreferencesFactory.php.
References $res, ContextSource\getContext(), PreferencesFormOOUI\getExtraSuccessRedirectParameters(), HTMLForm\getTitle(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1572 of file DefaultPreferencesFactory.php.
References ContextSource\getContext(), MediaWiki\MediaWikiServices\getInstance(), ContextSource\getUser(), and ContextSource\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 1206 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$options, SpecialWatchlist\checkStructuredFilterUiEnabled(), SpecialPage\getTitleFor(), MessageLocalizer\msg(), and User\useRCPatrol().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Definition at line 78 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
The wiki's content language.
Definition at line 72 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
private |
Definition at line 93 of file DefaultPreferencesFactory.php.
|
private |
Definition at line 90 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 75 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 81 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 84 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 69 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct(), MediaWiki\Preferences\DefaultPreferencesFactory\getOptionFromUser(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
|
protected |
Definition at line 87 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().