Preferences Class Reference

We're now using the HTMLForm object with some customisation to generate the Preferences form. More...

List of all members.

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


Detailed Description

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 28 of file Preferences.php.


Member Function Documentation

static Preferences::cleanSignature ( signature,
alldata 
) [static]

Definition at line 1127 of file Preferences.php.

References $wgParser.

static Preferences::datetimePreferences ( user,
&$  defaultPreferences 
) [static]

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]

Parameters:
object $user The user object
Returns:
array Text/links to display as key; $skinkey as value

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]

Definition at line 1084 of file Preferences.php.

References $wgImageLimits, and wfMsg().

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]

static Preferences::getThumbSizes (  )  [static]

Definition at line 1097 of file Preferences.php.

References $size, $wgThumbLimits, and wfMsg().

static Preferences::getTimezoneOptions (  )  [static]

Definition at line 1163 of file Preferences.php.

References $wgLocalTZoffset, and wfMsg().

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]

static Preferences::rcPreferences ( user,
&$  defaultPreferences 
) [static]

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]

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]

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().


Member Data Documentation

Preferences::$defaultPreferences = null [static]

Preferences::$saveFilters [static]

Initial value:

                array(
                        'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
                )

Definition at line 30 of file Preferences.php.


The documentation for this class was generated from the following file:

Generated on Sat Apr 30 22:57:46 2011 for MediaWiki by  doxygen 1.5.9