Static Public Member Functions | |
static | getPreferences ($user) |
static | getOptionFromUser ($name, $info, $user) |
static | profilePreferences ($user, &$defaultPreferences) |
static | skinPreferences ($user, &$defaultPreferences) |
static | mathPreferences ($user, &$defaultPreferences) |
static | filesPreferences ($user, &$defaultPreferences) |
static | datetimePreferences ($user, &$defaultPreferences) |
static | renderingPreferences ($user, &$defaultPreferences) |
static | editingPreferences ($user, &$defaultPreferences) |
static | rcPreferences ($user, &$defaultPreferences) |
static | watchlistPreferences ($user, &$defaultPreferences) |
static | searchPreferences ($user, &$defaultPreferences) |
static | miscPreferences ($user, &$defaultPreferences) |
static | generateSkinOptions ($user) |
static | getDateOptions () |
static | getImageSizes () |
static | getThumbSizes () |
static | validateSignature ($signature, $alldata) |
static | cleanSignature ($signature, $alldata) |
static | validateEmail ($email, $alldata) |
static | getFormObject ($user) |
static | getTimezoneOptions () |
static | filterTimezoneInput ($tz, $alldata) |
static | tryFormSubmit ($formData, $entryPoint= 'internal') |
static | tryUISubmit ($formData) |
static | loadOldSearchNs ($user) |
Static Public Attributes | |
static | $defaultPreferences = null |
static | $saveFilters |
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 28 of file Preferences.php.
static Preferences::cleanSignature | ( | $ | signature, | |
$ | alldata | |||
) | [static] |
static Preferences::datetimePreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 505 of file Preferences.php.
References $defaultPreferences, $wgLang, Xml::element(), getDateOptions(), Xml::hidden(), and wfTimestampNow().
Referenced by getPreferences().
static Preferences::editingPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 637 of file Preferences.php.
References $defaultPreferences, $wgUseExternalEditor, and wfMsg().
Referenced by getPreferences().
static Preferences::filesPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 487 of file Preferences.php.
References $defaultPreferences.
Referenced by getPreferences().
static Preferences::filterTimezoneInput | ( | $ | tz, | |
$ | alldata | |||
) | [static] |
Definition at line 1218 of file Preferences.php.
static Preferences::generateSkinOptions | ( | $ | user | ) | [static] |
object | $user The user object |
Definition at line 1008 of file Preferences.php.
References $wgAllowUserCss, $wgAllowUserJs, $wgDefaultSkin, $wgLang, Skin::getUsableSkins(), Title::makeTitleSafe(), Title::newMainPage(), wfEmptyMsg(), wfMsg(), and wfMsgHtml().
static Preferences::getDateOptions | ( | ) | [static] |
Definition at line 1058 of file Preferences.php.
References $wgLang, wfMsgHtml(), and wfTimestampNow().
Referenced by datetimePreferences().
static Preferences::getFormObject | ( | $ | user | ) | [static] |
Definition at line 1151 of file Preferences.php.
References getPreferences(), SpecialPage::getTitleFor(), and wfMsg().
Referenced by SpecialPreferences::execute().
static Preferences::getImageSizes | ( | ) | [static] |
static Preferences::getOptionFromUser | ( | $ | name, | |
$ | info, | |||
$ | user | |||
) | [static] |
Definition at line 95 of file Preferences.php.
References $name, $options, and HTMLFormField::flattenOptions().
Referenced by getPreferences().
static Preferences::getPreferences | ( | $ | user | ) | [static] |
Definition at line 35 of file Preferences.php.
References $defaultPreferences, $name, $wgDefaultUserOptions, $wgHiddenPrefs, $wgRCMaxAge, datetimePreferences(), editingPreferences(), filesPreferences(), User::getDefaultOptions(), getOptionFromUser(), mathPreferences(), miscPreferences(), profilePreferences(), rcPreferences(), renderingPreferences(), searchPreferences(), skinPreferences(), watchlistPreferences(), and wfRunHooks().
Referenced by getFormObject().
static Preferences::getThumbSizes | ( | ) | [static] |
static Preferences::getTimezoneOptions | ( | ) | [static] |
static Preferences::loadOldSearchNs | ( | $ | user | ) | [static] |
Definition at line 1331 of file Preferences.php.
References $name, and SearchEngine::searchableNamespaces().
Referenced by SearchEngine::userNamespaces().
static Preferences::mathPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 472 of file Preferences.php.
References $defaultPreferences, $wgLang, and $wgUseTeX.
Referenced by getPreferences().
static Preferences::miscPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 974 of file Preferences.php.
References $defaultPreferences, and $wgContLang.
Referenced by getPreferences().
static Preferences::profilePreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 116 of file Preferences.php.
References $code, $defaultPreferences, $name, $options, $t, $wgAuth, $wgContLang, $wgContLanguageCode, $wgDisableLangConversion, $wgDisableTitleConversion, $wgEmailAuthentication, $wgEmailConfirmToEdit, $wgEnableEmail, $wgEnableUserEmail, $wgEnotifUserTalk, $wgEnotifWatchlist, $wgLang, $wgMaxSigChars, $wgOut, $wgParser, $wgUser, User::getGroupMember(), User::getGroupName(), Language::getLanguageNames(), SpecialPage::getTitleFor(), User::makeGroupLinkHTML(), wfBCP47(), wfMsg(), wfMsgExt(), and wfMsgHtml().
Referenced by getPreferences().
static Preferences::rcPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 750 of file Preferences.php.
References $defaultPreferences, $wgLang, $wgRCMaxAge, $wgRCShowWatchingUsers, $wgUseRCPatrol, and wfMsgExt().
Referenced by getPreferences().
static Preferences::renderingPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 565 of file Preferences.php.
References $defaultPreferences, and wfMsg().
Referenced by getPreferences().
static Preferences::searchPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 908 of file Preferences.php.
References $defaultPreferences, $name, $wgContLang, $wgEnableMWSuggest, SearchEngine::searchableNamespaces(), and wfMsg().
Referenced by getPreferences().
static Preferences::skinPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 447 of file Preferences.php.
References $defaultPreferences, and $wgLang.
Referenced by getPreferences().
static Preferences::tryFormSubmit | ( | $ | formData, | |
$ | entryPoint = 'internal' | |||
) | [static] |
Definition at line 1244 of file Preferences.php.
References $name, $result, $wgEmailAuthentication, $wgEnableEmail, $wgHiddenPrefs, $wgUser, WikiError::isError(), wfMsg(), and wfRunHooks().
Referenced by tryUISubmit().
static Preferences::tryUISubmit | ( | $ | formData | ) | [static] |
Definition at line 1313 of file Preferences.php.
References $res, $url, $wgOut, SpecialPage::getTitleFor(), and tryFormSubmit().
static Preferences::validateEmail | ( | $ | email, | |
$ | alldata | |||
) | [static] |
Definition at line 1139 of file Preferences.php.
References $wgEmailConfirmToEdit, User::isValidEmailAddr(), and wfMsgExt().
static Preferences::validateSignature | ( | $ | signature, | |
$ | alldata | |||
) | [static] |
Definition at line 1110 of file Preferences.php.
References $wgLang, $wgMaxSigChars, $wgParser, Xml::element(), wfMsg(), and wfMsgExt().
static Preferences::watchlistPreferences | ( | $ | user, | |
&$ | defaultPreferences | |||
) | [static] |
Definition at line 808 of file Preferences.php.
References $action, $defaultPreferences, $wgEnableAPI, $wgUseRCPatrol, and wfMsgHtml().
Referenced by getPreferences().
Preferences::$defaultPreferences = null [static] |
Definition at line 29 of file Preferences.php.
Referenced by datetimePreferences(), editingPreferences(), filesPreferences(), getPreferences(), mathPreferences(), miscPreferences(), profilePreferences(), rcPreferences(), renderingPreferences(), searchPreferences(), skinPreferences(), and watchlistPreferences().
Preferences::$saveFilters [static] |
Initial value:
array( 'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ), )
Definition at line 30 of file Preferences.php.