MediaWiki REL1_34
|
This is the default implementation of PreferencesFactory. More...
Public Member Functions | |
__construct (ServiceOptions $options, Language $contLang, AuthManager $authManager, LinkRenderer $linkRenderer, NamespaceInfo $nsInfo, PermissionManager $permissionManager) | |
Do not call this directly. | |
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, 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. | |
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. | |
This is the default implementation of PreferencesFactory.
Definition at line 62 of file DefaultPreferencesFactory.php.
MediaWiki\Preferences\DefaultPreferencesFactory::__construct | ( | ServiceOptions | $options, |
Language | $contLang, | ||
AuthManager | $authManager, | ||
LinkRenderer | $linkRenderer, | ||
NamespaceInfo | $nsInfo, | ||
PermissionManager | $permissionManager | ||
) |
Do not call this directly.
Get it from MediaWikiServices.
ServiceOptions | $options | |
Language | $contLang | |
AuthManager | $authManager | |
LinkRenderer | $linkRenderer | |
NamespaceInfo | $nsInfo | |
PermissionManager | $permissionManager |
Definition at line 126 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$authManager, MediaWiki\Preferences\DefaultPreferencesFactory\$contLang, MediaWiki\Preferences\DefaultPreferencesFactory\$linkRenderer, MediaWiki\Preferences\DefaultPreferencesFactory\$nsInfo, MediaWiki\Preferences\DefaultPreferencesFactory\$options, MediaWiki\Preferences\DefaultPreferencesFactory\$permissionManager, and MediaWiki\Config\ServiceOptions\assertRequiredOptions().
|
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 1684 of file DefaultPreferencesFactory.php.
References $filter.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1483 of file DefaultPreferencesFactory.php.
References Parser\cleanSigInSig(), and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 786 of file DefaultPreferencesFactory.php.
References $context, $lang, Xml\element(), HTMLFormField\flattenOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getDateOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions(), and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 939 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 764 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 1293 of file DefaultPreferencesFactory.php.
References $context, Skin\getAllowedSkins(), User\getName(), User\getOption(), Skin\getSkinNames(), and NS_USER.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences().
|
protected |
IContextSource | $context |
Definition at line 1389 of file DefaultPreferencesFactory.php.
References $context, $lang, $wgDefaultUserOptions, 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 1502 of file DefaultPreferencesFactory.php.
References $context, MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor(), 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 161 of file DefaultPreferencesFactory.php.
References $context, MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\editingPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences(), 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 1423 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 250 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$options, and HTMLFormField\flattenOptions().
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 148 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1440 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Get a list of all time zones.
Definition at line 1749 of file DefaultPreferencesFactory.php.
References wfMessage().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions().
|
protected |
IContextSource | $context |
Definition at line 1561 of file DefaultPreferencesFactory.php.
References $context, IContextSource\getLanguage(), MWTimestamp\getLocalInstance(), and MediaWiki\Preferences\DefaultPreferencesFactory\getTimeZoneList().
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 195 of file DefaultPreferencesFactory.php.
References $context, 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 296 of file DefaultPreferencesFactory.php.
References $context, $lang, $languages, LanguageConverter\$languagesWithVariants, MediaWiki\Preferences\DefaultPreferencesFactory\$options, $t, LanguageCode\bcp47(), MediaWiki\Preferences\DefaultPreferencesFactory\cleanSignature(), User\getEditCount(), User\getEffectiveGroups(), User\getEmail(), User\getEmailAuthenticationTimestamp(), UserGroupMembership\getExpiry(), User\getGroupMemberships(), MediaWiki\MediaWikiServices\getInstance(), UserGroupMembership\getLink(), User\getName(), User\getRealName(), User\getRegistration(), Parser\stripOuterParagraph(), and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 1006 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 865 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 1609 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 1280 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 716 of file DefaultPreferencesFactory.php.
References $context, MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions(), User\getName(), 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 1713 of file DefaultPreferencesFactory.php.
References $context, $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 1458 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 1105 of file DefaultPreferencesFactory.php.
References $context, MediaWiki\Preferences\DefaultPreferencesFactory\$options, SpecialWatchlist\checkStructuredFilterUiEnabled(), and User\useRCPatrol().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Definition at line 72 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
The wiki's content language.
Definition at line 69 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 78 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 66 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 81 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().