MediaWiki
1.23.0
|
We're now using the HTMLForm object with some customisation to generate the Preferences form. More...
Static Public Member Functions | |
static | cleanSignature ( $signature, $alldata, $form) |
static | datetimePreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | editingPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | filesPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | filterIntval ( $value, $alldata) |
static | filterTimezoneInput ( $tz, $alldata) |
static | generateSkinOptions ( $user, IContextSource $context) |
static | getDateOptions (IContextSource $context) |
static | getFormObject ( $user, IContextSource $context, $formClass='PreferencesForm', array $remove=array()) |
static | getImageSizes (IContextSource $context) |
static | getOptionFromUser ( $name, $info, $user) |
Pull option from a user account. More... | |
static | getPreferences ( $user, IContextSource $context) |
static | getSaveBlacklist () |
static | getThumbSizes (IContextSource $context) |
static | getTimezoneOptions (IContextSource $context) |
static | loadOldSearchNs ( $user) |
static | miscPreferences ( $user, IContextSource $context, &$defaultPreferences) |
Dummy, kept for backwards-compatibility. More... | |
static | profilePreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | rcPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | renderingPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | searchPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | skinPreferences ( $user, IContextSource $context, &$defaultPreferences) |
static | tryFormSubmit ( $formData, $form) |
Handle the form submission if everything validated properly. More... | |
static | trySetUserEmail (User $user, $newaddr) |
Try to set a user's email address. More... | |
static | tryUISubmit ( $formData, $form) |
static | validateSignature ( $signature, $alldata, $form) |
static | watchlistPreferences ( $user, IContextSource $context, &$defaultPreferences) |
Static Public Attributes | |
static | $defaultPreferences = null |
static | $saveFilters |
Static Private Attributes | |
static | $saveBlacklist |
We're now using the HTMLForm object with some customisation to generate the Preferences form.
This object handles generic submission, CSRF protection, layout and other logic in a reusable manner. We subclass it as a PreferencesForm to make some minor customisations.
In order to generate the form, the HTMLForm object needs an array structure detailing the form fields available, and that's what this class is for. Each element of the array is a basic property-list, including the type of field, the label it is to be given in the form, callbacks for validation and 'filtering', and other pertinent information. Note that the 'default' field is named for generic forms, and does not represent the preference's default (which is stored in $wgDefaultUserOptions), but the default for the form field, which should be whatever the user has set for that preference. There is no need to override it unless you have some special storage logic (for instance, those not presently stored as options, but which are best set from the user preferences view).
Field types are implemented as subclasses of the generic HTMLFormField object, and typically implement at least getInputHTML, which generates the HTML for the input field to be placed in the table.
Once fields have been retrieved and validated, submission logic is handed over to the tryUISubmit static method of this class.
Definition at line 48 of file Preferences.php.
|
static |
$signature | string |
$alldata | array |
$form | HTMLForm |
Definition at line 1208 of file Preferences.php.
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences |
Definition at line 635 of file Preferences.php.
References $defaultPreferences, $user, array(), Xml\element(), HTMLFormField\flattenOptions(), getDateOptions(), IContextSource\getLanguage(), getTimezoneOptions(), Html\hidden(), and wfTimestampNow().
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences | Array |
Definition at line 767 of file Preferences.php.
References $defaultPreferences, $user, array(), global, and IContextSource\msg().
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences | Array |
Definition at line 613 of file Preferences.php.
References $defaultPreferences, and array().
Referenced by getPreferences().
|
static |
$value | |
$alldata |
Definition at line 1341 of file Preferences.php.
References $value.
|
static |
|
static |
$user | User The User object |
$context | IContextSource |
Definition at line 1053 of file Preferences.php.
References $ret, $user, array(), as, Skin\getAllowedSkins(), IContextSource\getLanguage(), global, Linker\link(), Title\makeTitleSafe(), IContextSource\msg(), Title\newMainPage(), NS_USER, and text.
|
static |
$context | IContextSource |
Definition at line 1110 of file Preferences.php.
References $ret, array(), as, IContextSource\getLanguage(), global, IContextSource\msg(), and wfTimestampNow().
Referenced by datetimePreferences().
|
static |
$user | User | |
$context | IContextSource | |
$formClass | string | |
array | $remove | array of items to remove |
Definition at line 1227 of file Preferences.php.
References $name, $user, array(), as, getPreferences(), and IContextSource\msg().
Referenced by SpecialPreferences\execute().
|
static |
$context | IContextSource |
Definition at line 1145 of file Preferences.php.
References $ret, array(), as, global, and IContextSource\msg().
|
static |
Pull option from a user account.
Handles stuff like array-type preferences.
$name | |
$info | |
$user | User |
Definition at line 151 of file Preferences.php.
References $columns, $name, $options, $user, $value, array(), as, and HTMLFormField\flattenOptions().
Referenced by getPreferences().
|
static |
MWException |
$user | User |
$context | IContextSource |
Definition at line 78 of file Preferences.php.
References $defaultOptions, $defaultPreferences, $name, $user, array(), as, datetimePreferences(), editingPreferences(), filesPreferences(), User\getDefaultOptions(), getOptionFromUser(), global, HTMLForm\loadInputFromParameters(), miscPreferences(), profilePreferences(), rcPreferences(), renderingPreferences(), searchPreferences(), skinPreferences(), watchlistPreferences(), and wfRunHooks().
Referenced by ApiOptions\execute(), getFormObject(), and User\getOptionKinds().
|
static |
Definition at line 68 of file Preferences.php.
References $saveBlacklist.
Referenced by User\getOptionKinds().
|
static |
$context | IContextSource |
Definition at line 1163 of file Preferences.php.
References $ret, $size, array(), as, global, and IContextSource\msg().
|
static |
$context | IContextSource |
Definition at line 1266 of file Preferences.php.
References $timestamp, $value, array(), as, MWTimestamp\getLocalInstance(), global, IContextSource\msg(), and text.
Referenced by datetimePreferences().
|
static |
$user | User |
Definition at line 1491 of file Preferences.php.
References $name, $user, array(), as, SearchEngine\searchableNamespaces(), and wfDeprecated().
|
static |
Dummy, kept for backwards-compatibility.
Definition at line 1045 of file Preferences.php.
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences |
Definition at line 194 of file Preferences.php.
References $defaultPreferences, $languages, $link, $name, $options, $t, $time, $user, $wgContLang, $wgParser, array(), as, below, Language\fetchLanguageNames(), User\getGroupMember(), User\getGroupName(), IContextSource\getLanguage(), IContextSource\getOutput(), IContextSource\getRequest(), IContextSource\getTitle(), SpecialPage\getTitleFor(), IContextSource\getUser(), global, Linker\link(), Linker\linkKnown(), User\makeGroupLinkHTML(), message, IContextSource\msg(), ParserOptions\newFromContext(), on, text, used, wfBCP47(), and wfCanIPUseHTTPS().
Referenced by getPreferences(), and PreferencesTest\prefsFor().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences | Array |
Definition at line 855 of file Preferences.php.
References $defaultPreferences, $user, array(), global, and IContextSource\msg().
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences | Array |
Definition at line 707 of file Preferences.php.
References $defaultPreferences, $value, array(), as, global, and IContextSource\msg().
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences | Array |
Definition at line 1016 of file Preferences.php.
References $defaultPreferences, $name, $wgContLang, array(), as, global, and IContextSource\msg().
Referenced by getPreferences().
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences |
Definition at line 570 of file Preferences.php.
References $defaultPreferences, $user, array(), IContextSource\getLanguage(), global, Linker\link(), Title\makeTitleSafe(), IContextSource\msg(), and NS_USER.
Referenced by getPreferences().
|
static |
Handle the form submission if everything validated properly.
$formData | |
$form | PreferencesForm |
Definition at line 1384 of file Preferences.php.
References $form, $name, $user, $value, array(), as, global, Status\newFatal(), and wfRunHooks().
Referenced by tryUISubmit().
|
static |
Try to set a user's email address.
This does not try to validate the address. Caller is responsible for checking $wgAuth and 'editmyprivateinfo' right.
$user | User | |
string | $newaddr | New email address |
Definition at line 1475 of file Preferences.php.
References $user, array(), and wfDeprecated().
|
static |
$formData | |
$form | PreferencesForm |
Definition at line 1444 of file Preferences.php.
References $form, $res, array(), MediaWiki\getTitle(), Status\newGood(), and tryFormSubmit().
|
static |
$signature | string |
$alldata | array |
$form | HTMLForm |
Definition at line 1183 of file Preferences.php.
References $form, $wgParser, array(), Xml\element(), false, and global.
|
static |
$user | User |
$context | IContextSource |
$defaultPreferences |
Definition at line 912 of file Preferences.php.
References $defaultPreferences, $user, array(), as, global, and IContextSource\msg().
Referenced by getPreferences().
|
static |
Definition at line 49 of file Preferences.php.
Referenced by datetimePreferences(), editingPreferences(), filesPreferences(), getPreferences(), profilePreferences(), rcPreferences(), renderingPreferences(), searchPreferences(), skinPreferences(), and watchlistPreferences().
|
staticprivate |
Definition at line 60 of file Preferences.php.
Referenced by getSaveBlacklist().
|
static |
Definition at line 50 of file Preferences.php.