MediaWiki REL1_31
|
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=PreferencesForm::class, array $remove=[]) | |
getFormDescriptor (User $user, IContextSource $context) | |
getSaveBlacklist () | |
@inheritDoc | |
legacySaveFormData ( $formData, PreferencesForm $form) | |
DO NOT USE. | |
legacySubmitForm (array $formData, PreferencesForm $form) | |
DO NOT USE. | |
Protected Member Functions | |
cleanSignature ( $signature, $alldata, HTMLForm $form) | |
datetimePreferences ( $user, IContextSource $context, &$defaultPreferences) | |
editingPreferences (User $user, MessageLocalizer $l10n, &$defaultPreferences) | |
filesPreferences (IContextSource $context, &$defaultPreferences) | |
filterTimezoneInput ( $tz, array $alldata) | |
generateSkinOptions (User $user, IContextSource $context) | |
getDateOptions (IContextSource $context) | |
getImageSizes (MessageLocalizer $l10n) | |
getOptionFromUser ( $name, $info, User $user) | |
Pull option from a user account. | |
getSaveFilters () | |
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 (MessageLocalizer $l10n, &$defaultPreferences) | |
saveFormData ( $formData, PreferencesForm $form) | |
Handle the form submission if everything validated properly. | |
searchPreferences (&$defaultPreferences) | |
skinPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
submitForm (array $formData, PreferencesForm $form) | |
Save the form data and reload the page. | |
validateSignature ( $signature, $alldata, HTMLForm $form) | |
watchlistPreferences (User $user, IContextSource $context, &$defaultPreferences) | |
Protected Attributes | |
AuthManager | $authManager |
Config | $config |
Language | $contLang |
The wiki's content language, equivalent to $wgContLang. | |
LinkRenderer | $linkRenderer |
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 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 |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1397 of file DefaultPreferencesFactory.php.
References $parser, Parser\cleanSigInSig(), and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 748 of file DefaultPreferencesFactory.php.
References $context, $e, $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 885 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 726 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\getImageSizes(), and MediaWiki\Preferences\DefaultPreferencesFactory\getThumbSizes().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
string | $tz | |
array | $alldata |
Definition at line 1503 of file DefaultPreferencesFactory.php.
References $e.
|
protected |
User | $user | The User object |
IContextSource | $context |
Definition at line 1224 of file DefaultPreferencesFactory.php.
References $context, $ret, and Skin\getAllowedSkins().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\skinPreferences().
|
protected |
IContextSource | $context |
Definition at line 1303 of file DefaultPreferencesFactory.php.
References $context, $lang, $ret, $wgDefaultUserOptions, and wfTimestampNow().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
MediaWiki\Preferences\DefaultPreferencesFactory::getForm | ( | User | $user, |
IContextSource | $context, | ||
$formClass = PreferencesForm::class, | |||
array | $remove = [] ) |
User | $user | |
IContextSource | $context | |
string | $formClass | |
array | $remove | Array of items to remove |
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 1416 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 127 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 1337 of file DefaultPreferencesFactory.php.
References $ret.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Pull option from a user account.
Handles stuff like array-type preferences.
string | $name | |
array | $info | |
User | $user |
Definition at line 208 of file DefaultPreferencesFactory.php.
References $name, $options, $rows, $value, and HTMLFormField\flattenOptions().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues().
MediaWiki\Preferences\DefaultPreferencesFactory::getSaveBlacklist | ( | ) |
@inheritDoc
Implements MediaWiki\Preferences\PreferencesFactory.
Definition at line 114 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\loadPreferenceValues(), and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
Definition at line 98 of file DefaultPreferencesFactory.php.
References $value.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
|
protected |
MessageLocalizer | $l10n |
Definition at line 1354 of file DefaultPreferencesFactory.php.
References $ret.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\filesPreferences().
|
protected |
Get a list of all time zones.
Definition at line 1691 of file DefaultPreferencesFactory.php.
References $value, and wfMessage().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getTimezoneOptions().
|
protected |
IContextSource | $context |
Definition at line 1458 of file DefaultPreferencesFactory.php.
References $context, $opt, IContextSource\getLanguage(), MWTimestamp\getLocalInstance(), and MediaWiki\Preferences\DefaultPreferencesFactory\getTimeZoneList().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences().
MediaWiki\Preferences\DefaultPreferencesFactory::legacySaveFormData | ( | $formData, | |
PreferencesForm | $form ) |
DO NOT USE.
Temporary function to punch hole for the Preferences class.
array | $formData | |
PreferencesForm | $form |
Definition at line 1635 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
MediaWiki\Preferences\DefaultPreferencesFactory::legacySubmitForm | ( | array | $formData, |
PreferencesForm | $form ) |
DO NOT USE.
Temporary function to punch hole for the Preferences class.
array | $formData | |
PreferencesForm | $form |
Definition at line 1679 of file DefaultPreferencesFactory.php.
References MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
|
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 156 of file DefaultPreferencesFactory.php.
References $context, $name, User\getDefaultOptions(), MediaWiki\Preferences\DefaultPreferencesFactory\getOptionFromUser(), 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 254 of file DefaultPreferencesFactory.php.
References $code, $context, $lang, $languages, LanguageConverter\$languagesWithVariants, $link, $name, $options, $t, $time, LanguageCode\bcp47(), MediaWiki\Preferences\DefaultPreferencesFactory\cleanSignature(), CentralIdLookup\factory(), UserGroupMembership\getExpiry(), MediaWiki\MediaWikiServices\getInstance(), UserGroupMembership\getLink(), SpecialPage\getTitleFor(), text, and MediaWiki\Preferences\DefaultPreferencesFactory\validateSignature().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 957 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
MessageLocalizer | $l10n | |
array | &$defaultPreferences |
Definition at line 823 of file DefaultPreferencesFactory.php.
References $value.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Handle the form submission if everything validated properly.
array | $formData | |
PreferencesForm | $form |
Definition at line 1555 of file DefaultPreferencesFactory.php.
References $name, $result, $value, MediaWiki\Preferences\DefaultPreferencesFactory\getSaveBlacklist(), and MediaWiki\Preferences\DefaultPreferencesFactory\getSaveFilters().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\legacySaveFormData(), and MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
|
protected |
array | &$defaultPreferences |
Definition at line 1211 of file DefaultPreferencesFactory.php.
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 678 of file DefaultPreferencesFactory.php.
References $context, and MediaWiki\Preferences\DefaultPreferencesFactory\generateSkinOptions().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getFormDescriptor().
|
protected |
Save the form data and reload the page.
array | $formData | |
PreferencesForm | $form |
Definition at line 1646 of file DefaultPreferencesFactory.php.
References $context, $res, and MediaWiki\Preferences\DefaultPreferencesFactory\saveFormData().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\getForm(), and MediaWiki\Preferences\DefaultPreferencesFactory\legacySubmitForm().
|
protected |
string | $signature | |
array | $alldata | |
HTMLForm | $form |
Definition at line 1372 of file DefaultPreferencesFactory.php.
References Xml\element(), and MediaWiki\MediaWikiServices\getInstance().
Referenced by MediaWiki\Preferences\DefaultPreferencesFactory\profilePreferences().
|
protected |
User | $user | |
IContextSource | $context | |
array | &$defaultPreferences |
Definition at line 1051 of file DefaultPreferencesFactory.php.
References $context, SpecialWatchlist\checkStructuredFilterUiEnabled(), false, and SpecialPage\getTitleFor().
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, equivalent to $wgContLang.
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().