static $defaultPreferences = null;
static $saveFilters = array(
'timecorrection' => array( 'Preferences', 'filterTimezoneInput' ),
+ 'cols' => array( 'Preferences', 'filterIntval' ),
'rows' => array( 'Preferences', 'filterIntval' ),
'rclimit' => array( 'Preferences', 'filterIntval' ),
'wllimit' => array( 'Preferences', 'filterIntval' ),
/**
* @throws MWException
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @return array|null
*/
- public static function getPreferences( $user, ContextSource $context ) {
+ static function getPreferences( $user, IContextSource $context ) {
if ( self::$defaultPreferences ) {
return self::$defaultPreferences;
}
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences
* @return void
*/
- static function profilePreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function profilePreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgAuth, $wgContLang, $wgParser, $wgCookieExpiration, $wgLanguageCode,
$wgDisableTitleConversion, $wgDisableLangConversion, $wgMaxSigChars,
$wgEnableEmail, $wgEmailConfirmToEdit, $wgEnableUserEmail, $wgEmailAuthentication,
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences
* @return void
*/
- static function skinPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function skinPreferences( $user, IContextSource $context, &$defaultPreferences ) {
## Skin #####################################
global $wgAllowUserCss, $wgAllowUserJs;
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences Array
*/
- static function renderingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function renderingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
## Page Rendering ##############################
global $wgAllowUserCssPrefs;
if ( $wgAllowUserCssPrefs ) {
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences Array
*/
- static function editingPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function editingPreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgUseExternalEditor, $wgAllowUserCssPrefs;
## Editing #####################################
-
+ $defaultPreferences['cols'] = array(
+ 'type' => 'int',
+ 'label-message' => 'columns',
+ 'section' => 'editing/textboxsize',
+ 'min' => 4,
+ 'max' => 1000,
+ );
$defaultPreferences['rows'] = array(
'type' => 'int',
'label-message' => 'rows',
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences Array
*/
- static function rcPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function rcPreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgRCMaxAge, $wgRCShowWatchingUsers;
## RecentChanges #####################################
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences
*/
- static function watchlistPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function watchlistPreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgUseRCPatrol, $wgEnableAPI, $wgRCMaxAge;
$watchlistdaysMax = ceil( $wgRCMaxAge / ( 3600 * 24 ) );
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences Array
*/
- static function searchPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgContLang, $wgEnableMWSuggest, $wgVectorUseSimpleSearch;
## Search #####################################
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $defaultPreferences Array
*/
- static function miscPreferences( $user, ContextSource $context, &$defaultPreferences ) {
+ static function miscPreferences( $user, IContextSource $context, &$defaultPreferences ) {
global $wgContLang;
## Misc #####################################
/**
* @param $user User The User object
- * @param $context ContextSource
+ * @param $context IContextSource
* @return Array: text/links to display as key; $skinkey as value
*/
- static function generateSkinOptions( $user, ContextSource $context ) {
+ static function generateSkinOptions( $user, IContextSource $context ) {
global $wgDefaultSkin, $wgAllowUserCss, $wgAllowUserJs;
$ret = array();
}
/**
- * @param $context ContextSource
+ * @param $context IContextSource
* @return array
*/
- static function getDateOptions( ContextSource $context ) {
+ static function getDateOptions( IContextSource $context ) {
$lang = $context->getLanguage();
$dateopts = $lang->getDatePreferences();
}
/**
- * @param $context ContextSource
+ * @param $context IContextSource
* @return array
*/
- static function getImageSizes( ContextSource $context ) {
+ static function getImageSizes( IContextSource $context ) {
global $wgImageLimits;
$ret = array();
}
/**
- * @param $context ContextSource
+ * @param $context IContextSource
* @return array
*/
- static function getThumbSizes( ContextSource $context ) {
+ static function getThumbSizes( IContextSource $context ) {
global $wgThumbLimits;
$ret = array();
/**
* @param $user User
- * @param $context ContextSource
+ * @param $context IContextSource
* @param $formClass string
* @param $remove Array: array of items to remove
* @return HtmlForm
*/
- static function getFormObject( $user, ContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
+ static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm', array $remove = array() ) {
$formDescriptor = Preferences::getPreferences( $user, $context );
if ( count( $remove ) ) {
$removeKeys = array_flip( $remove );
}
/**
- * @param $context ContextSource
* @return array
*/
- static function getTimezoneOptions( ContextSource $context ) {
+ static function getTimezoneOptions( IContextSource $context ) {
$opt = array();
global $wgLocalTZoffset, $wgLocaltimezone;
return array( true, $info );
}
-
- /**
- * @param $user User
- * @return array
- */
- public static function loadOldSearchNs( $user ) {
- $searchableNamespaces = SearchEngine::searchableNamespaces();
- // Back compat with old format
- $arr = array();
-
- foreach ( $searchableNamespaces as $ns => $name ) {
- if ( $user->getOption( 'searchNs' . $ns ) ) {
- $arr[] = $ns;
- }
- }
-
- return $arr;
- }
}
/** Some tweaks to allow js prefs to work */