MediaWiki REL1_39
|
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, LanguageNameUtils $languageNameUtils, HookContainer $hookContainer, UserOptionsLookup $userOptionsLookup, LanguageConverterFactory $languageConverterFactory=null, Parser $parser=null, SkinFactory $skinFactory=null, UserGroupManager $userGroupManager=null, SignatureValidatorFactory $signatureValidatorFactory=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').
| |
Static Public Member Functions | |
static | simplifyFormDescriptor (array $descriptor) |
Simplify form descriptor for validation or something similar. | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
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) | |
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 ( $context, &$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 |
This is the default implementation of PreferencesFactory.
Definition at line 72 of file DefaultPreferencesFactory.php.
MediaWiki\Preferences\DefaultPreferencesFactory::__construct | ( | ServiceOptions | $options, |
Language | $contLang, | ||
AuthManager | $authManager, | ||
LinkRenderer | $linkRenderer, | ||
NamespaceInfo | $nsInfo, | ||
PermissionManager | $permissionManager, | ||
ILanguageConverter | $languageConverter, | ||
LanguageNameUtils | $languageNameUtils, | ||
HookContainer | $hookContainer, | ||
UserOptionsLookup | $userOptionsLookup, | ||
LanguageConverterFactory | $languageConverterFactory = null, | ||
Parser | $parser = null, | ||
SkinFactory | $skinFactory = null, | ||
UserGroupManager | $userGroupManager = null, | ||
SignatureValidatorFactory | $signatureValidatorFactory = null ) |
ServiceOptions | $options | |
Language | $contLang | |
AuthManager | $authManager | |
LinkRenderer | $linkRenderer | |
NamespaceInfo | $nsInfo | |
PermissionManager | $permissionManager | |
ILanguageConverter | $languageConverter | |
LanguageNameUtils | $languageNameUtils | |
HookContainer | $hookContainer | |
UserOptionsLookup | $userOptionsLookup | Should be an instance of UserOptionsManager |
LanguageConverterFactory | null | $languageConverterFactory | |
Parser | null | $parser | |
SkinFactory | null | $skinFactory | |
UserGroupManager | null | $userGroupManager | |
SignatureValidatorFactory | null | $signatureValidatorFactory |
Definition at line 171 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$authManager, MediaWiki\Preferences\DefaultPreferencesFactory\$contLang, MediaWiki\Preferences\DefaultPreferencesFactory\$languageNameUtils, MediaWiki\Preferences\DefaultPreferencesFactory\$linkRenderer, MediaWiki\Preferences\DefaultPreferencesFactory\$nsInfo, MediaWiki\Preferences\DefaultPreferencesFactory\$options, MediaWiki\Preferences\DefaultPreferencesFactory\$permissionManager, MediaWiki\Config\ServiceOptions\assertRequiredOptions(), and MediaWiki\MediaWikiServices\getInstance().
|
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 1968 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1772 of file DefaultPreferencesFactory.php.
References Parser\cleanSigInSig().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 989 of file DefaultPreferencesFactory.php.
References $lang, Xml\element(), 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 1122 of file DefaultPreferencesFactory.php.
References MediaWiki\MainConfigNames\AllowUserCssPrefs, User\isAllowed(), and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 968 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 1542 of file DefaultPreferencesFactory.php.
References MediaWiki\MainConfigNames\AllowUserCss, MediaWiki\MainConfigNames\AllowUserJs, MediaWiki\MainConfigNames\DefaultSkin, MediaWiki\MediaWikiServices\getInstance(), IContextSource\getLanguage(), User\getName(), IContextSource\getRequest(), MessageLocalizer\msg(), NS_USER, and MediaWiki\MainConfigNames\SkinsPreferred.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences().
|
protected |
IContextSource | $context |
Definition at line 1639 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 1790 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor(), IContextSource\getOutput(), IContextSource\getRequest(), IContextSource\getTitle(), User\isAllowed(), 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 240 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\editingPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences(), IContextSource\getLanguage(), IContextSource\getSkin(), MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\rcPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\renderingPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\searchPreferences(), MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences(), and MediaWiki\Preferences\DefaultPreferencesFactory\watchlistPreferences().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1673 of file DefaultPreferencesFactory.php.
References MediaWiki\MainConfigNames\ImageLimits, 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 368 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$options.
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 227 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1690 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg(), and MediaWiki\MainConfigNames\ThumbLimits.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Get a list of all time zones.
Definition at line 2029 of file DefaultPreferencesFactory.php.
References wfMessage().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions().
|
protected |
IContextSource | $context |
Definition at line 1848 of file DefaultPreferencesFactory.php.
References IContextSource\getLanguage(), MediaWiki\Preferences\DefaultPreferencesFactory\getTimeZoneList(), MediaWiki\MainConfigNames\LocalTZoffset, and MessageLocalizer\msg().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 412 of file DefaultPreferencesFactory.php.
References $lang, MediaWiki\Preferences\DefaultPreferencesFactory\$options, $t, MediaWiki\MainConfigNames\AllowRequiringEmailForResets, MediaWiki\Preferences\DefaultPreferencesFactory\cleanSignature(), MediaWiki\MainConfigNames\EmailAuthentication, MediaWiki\MainConfigNames\EmailConfirmToEdit, MediaWiki\MainConfigNames\EnableEmail, MediaWiki\MainConfigNames\EnableUserEmail, MediaWiki\MainConfigNames\EnableUserEmailMuteList, MediaWiki\MainConfigNames\EnotifMinorEdits, MediaWiki\MainConfigNames\EnotifRevealEditorAddress, MediaWiki\MainConfigNames\EnotifUserTalk, MediaWiki\MainConfigNames\EnotifWatchlist, MediaWiki\MainConfigNames\ForceHTTPS, User\getEditCount(), User\getEmail(), User\getEmailAuthenticationTimestamp(), UserGroupMembership\getExpiry(), IContextSource\getLanguage(), User\getName(), IContextSource\getOutput(), User\getRealName(), User\getRegistration(), IContextSource\getRequest(), IContextSource\getTitle(), SpecialPage\getTitleFor(), User\getTitleKey(), IContextSource\getUser(), User\isAllowed(), MediaWiki\MainConfigNames\LanguageCode, MediaWiki\MainConfigNames\MaxSigChars, MessageLocalizer\msg(), MediaWiki\MainConfigNames\ScriptPath, MediaWiki\MainConfigNames\SecureLogin, MediaWiki\MainConfigNames\SignatureValidation, Parser\stripOuterParagraph(), and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 1188 of file DefaultPreferencesFactory.php.
References Message\numParam(), MediaWiki\MainConfigNames\RCMaxAge, MediaWiki\MainConfigNames\RCShowWatchingUsers, MediaWiki\MainConfigNames\RCWatchCategoryMembership, User\useNPPatrol(), and User\useRCPatrol().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 1071 of file DefaultPreferencesFactory.php.
References MediaWiki\MainConfigNames\AllowUserCssPrefs, User\isAllowed(), and 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 1896 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\applyFilters(), ContextSource\getContext(), PreferencesFormOOUI\getModifiedUser(), MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist(), MediaWiki\MainConfigNames\HiddenPrefs, User\isAllowed(), User\isAllowedAny(), User\saveSettings(), and User\setRealName().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 1463 of file DefaultPreferencesFactory.php.
References MessageLocalizer\msg(), and MediaWiki\MainConfigNames\SearchMatchRedirectPreference.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
static |
Simplify form descriptor for validation or something similar.
array | $descriptor | HTML form descriptor. |
Definition at line 271 of file DefaultPreferencesFactory.php.
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 915 of file DefaultPreferencesFactory.php.
References MediaWiki\MainConfigNames\AllowUserCss, MediaWiki\MainConfigNames\AllowUserJs, 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 1997 of file DefaultPreferencesFactory.php.
References $res, ContextSource\getContext(), PreferencesFormOOUI\getExtraSuccessRedirectParameters(), IContextSource\getOutput(), IContextSource\getRequest(), HTMLForm\getTitle(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm().
|
protected |
mixed | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1708 of file DefaultPreferencesFactory.php.
References ContextSource\getContext(), ContextSource\getUser(), MediaWiki\MainConfigNames\MaxSigChars, ContextSource\msg(), and MediaWiki\MainConfigNames\SignatureValidation.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 1289 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\$options, SpecialWatchlist\checkStructuredFilterUiEnabled(), SpecialPage\getTitleFor(), User\isAllowed(), User\isAllowedAny(), MessageLocalizer\msg(), Message\numParam(), MediaWiki\MainConfigNames\RCMaxAge, MediaWiki\MainConfigNames\RCWatchCategoryMembership, and User\useRCPatrol().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Definition at line 85 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
The wiki's content language.
Definition at line 79 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 82 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 88 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 91 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
|
protected |
Definition at line 76 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 94 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\__construct().
const MediaWiki\Preferences\DefaultPreferencesFactory::CONSTRUCTOR_OPTIONS |
Definition at line 123 of file DefaultPreferencesFactory.php.