}
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function filesPreferences( $user, &$defaultPreferences ) {
## Files #####################################
$defaultPreferences['imagesize'] = array(
);
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function renderingPreferences( $user, &$defaultPreferences ) {
## Page Rendering ##############################
global $wgAllowUserCssPrefs;
);
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function editingPreferences( $user, &$defaultPreferences ) {
global $wgUseExternalEditor, $wgAllowUserCssPrefs;
);
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function rcPreferences( $user, &$defaultPreferences ) {
global $wgRCMaxAge, $wgUseRCPatrol, $wgLang;
/**
* @param $user User
* @param $defaultPreferences
- * @return void
*/
static function watchlistPreferences( $user, &$defaultPreferences ) {
global $wgUseRCPatrol, $wgEnableAPI;
}
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function searchPreferences( $user, &$defaultPreferences ) {
global $wgContLang;
);
}
+ /**
+ * @param $user User
+ * @param $defaultPreferences Array
+ */
static function miscPreferences( $user, &$defaultPreferences ) {
## Misc #####################################
$defaultPreferences['diffonly'] = array(
return $ret;
}
+ /**
+ * @return array
+ */
static function getDateOptions() {
global $wgLang;
$dateopts = $wgLang->getDatePreferences();
return $ret;
}
+ /**
+ * @return array
+ */
static function getImageSizes() {
global $wgImageLimits;
return $ret;
}
+ /**
+ * @return array
+ */
static function getThumbSizes() {
global $wgThumbLimits;
return $ret;
}
+ /**
+ * @param $signature
+ * @param $alldata
+ * @return bool|string
+ */
static function validateSignature( $signature, $alldata ) {
global $wgParser, $wgMaxSigChars, $wgLang;
if ( mb_strlen( $signature ) > $wgMaxSigChars ) {
}
}
+ /**
+ * @param $signature
+ * @param $alldata
+ * @return
+ */
static function cleanSignature( $signature, $alldata ) {
global $wgParser;
if ( isset( $alldata['fancysig'] ) && $alldata['fancysig'] ) {
return $signature;
}
+ /**
+ * @param $email
+ * @param $alldata
+ * @return bool|String
+ */
static function validateEmail( $email, $alldata ) {
if ( $email && !Sanitizer::validateEmail( $email ) ) {
return wfMsgExt( 'invalidemailaddress', 'parseinline' );
return true;
}
+ /**
+ * @param $user User
+ * @param $formClass string
+ * @return HtmlForm
+ */
static function getFormObject( $user, $formClass = 'PreferencesForm' ) {
$formDescriptor = Preferences::getPreferences( $user );
$htmlForm = new $formClass( $formDescriptor, 'prefs' );
return $htmlForm;
}
+ /**
+ * @return array
+ */
static function getTimezoneOptions() {
$opt = array();
return $opt;
}
+ /**
+ * @param $value
+ * @param $alldata
+ * @return int
+ */
static function filterIntval( $value, $alldata ){
return intval( $value );
}
+ /**
+ * @param $tz
+ * @param $alldata
+ * @return string
+ */
static function filterTimezoneInput( $tz, $alldata ) {
$data = explode( '|', $tz, 3 );
switch ( $data[0] ) {
}
}
+ /**
+ * @param $formData
+ * @param $entryPoint string
+ * @return bool|Status|string
+ */
static function tryFormSubmit( $formData, $entryPoint = 'internal' ) {
global $wgUser, $wgEmailAuthentication, $wgEnableEmail;
return $result;
}
+ /**
+ * @param $formData
+ * @return Status
+ */
public static function tryUISubmit( $formData ) {
$res = self::tryFormSubmit( $formData, 'ui' );
/** Some tweaks to allow js prefs to work */
class PreferencesForm extends HTMLForm {
+
+ /**
+ * @param $html string
+ * @return String
+ */
function wrapForm( $html ) {
$html = Xml::tags( 'div', array( 'id' => 'preferences' ), $html );
return parent::wrapForm( $html );
}
+ /**
+ * @return String
+ */
function getButtons() {
$html = parent::getButtons();
return $html;
}
+ /**
+ * @param $data array
+ * @return array
+ */
function filterDataForSubmit( $data ) {
// Support for separating MultiSelect preferences into multiple preferences
// Due to lack of array support.
*/
class RequestContext {
- private $mRequest; // / WebRequest object
- private $mTitle; // / Title object
- private $mOutput; // / OutputPage object
- private $mUser; // / User object
- private $mLang; // / Language object
- private $mSkin; // / Skin object
+
+ /**
+ * @var WebRequest
+ */
+ private $mRequest;
+
+ /**
+ * @var Title
+ */
+ private $mTitle;
+
+ /**
+ * @var OutputPage
+ */
+ private $mOutput;
+
+ /**
+ * @var User
+ */
+ private $mUser;
+
+ /**
+ * @var Language
+ */
+ private $mLang;
+
+ /**
+ * @var Skin
+ */
+ private $mSkin;
/**
* Set the WebRequest object
* Make these C#-style accessors, so you can do $context->user->getName() which is
* internally mapped to $context->__get('user')->getName() which is mapped to
* $context->getUser()->getName()
+ *
+ * @param $name string
+ *
+ * @return string
*/
public function __get( $name ) {
if ( in_array( $name, array( 'request', 'title', 'output', 'user', 'lang', 'skin' ) ) ) {
trigger_error( "Undefined property {$name}", E_NOTICE );
}
+ /**
+ * @param $name string
+ * @param $value
+ * @return string
+ */
public function __set( $name, $value ) {
if ( in_array( $name, array( 'request', 'title', 'output', 'user', 'lang', 'skin' ) ) ) {
$fname = 'set' . ucfirst( $name );