public function getImageLimitsFromOption( $user, $optionName ) {
global $wgImageLimits;
- $option = intval( $user->getOption( $optionName ) );
+ $option = $user->getIntOption( $optionName );
if ( !isset( $wgImageLimits[$option] ) ) {
$option = User::getDefaultOption( $optionName );
}
$this->mOffset = $this->mRequest->getText( 'offset' );
# Use consistent behavior for the limit options
- $this->mDefaultLimit = intval( $this->getUser()->getOption( 'rclimit' ) );
+ $this->mDefaultLimit = $this->getUser()->getIntOption( 'rclimit' );
if ( !$this->mLimit ) {
// Don't override if a subclass calls $this->setLimit() in its constructor.
list( $this->mLimit, /* $offset */ ) = $this->mRequest->getLimitOffset();
*/
public function getStubThreshold() {
global $wgMaxArticleSize; # Maximum article size, in Kb
- $threshold = intval( $this->getOption( 'stubthreshold' ) );
+ $threshold = $this->getIntOption( 'stubthreshold' );
if ( $threshold > $wgMaxArticleSize * 1024 ) {
# If they have set an impossible value, disable the preference
# so we can use the parser cache again.
$limit = 0;
}
if( ( $limit == 0 ) && ( $optionname != '' ) ) {
- $limit = (int)$wgUser->getOption( $optionname );
+ $limit = $wgUser->getIntOption( $optionname );
}
if( $limit <= 0 ) {
$limit = $deflimit;
? 'watchdefault' : 'watchcreations';
}
# Watch the article based on the user preference
- return (bool)$this->getUser()->getOption( $userOption );
+ return $this->getUser()->getBoolOption( $userOption );
case 'nochange':
return $userWatching;
$opts->add( 'hidepatrolled', $this->getUser()->getBoolOption( 'newpageshidepatrolled' ) );
$opts->add( 'hidebots', false );
$opts->add( 'hideredirs', true );
- $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) );
+ $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
$opts->add( 'offset', '' );
$opts->add( 'namespace', '0' );
$opts->add( 'username', '' );
public function getDefaultOptions() {
$opts = new FormOptions();
- $opts->add( 'days', (int)$this->getUser()->getOption( 'rcdays' ) );
- $opts->add( 'limit', (int)$this->getUser()->getOption( 'rclimit' ) );
+ $opts->add( 'days', $this->getUser()->getIntOption( 'rcdays' ) );
+ $opts->add( 'limit', $this->getUser()->getIntOption( 'rclimit' ) );
$opts->add( 'from', '' );
$opts->add( 'hideminor', $this->getUser()->getBoolOption( 'hideminor' ) );
// source view for textual content
$sourceView = Xml::element( 'textarea', array(
'readonly' => 'readonly',
- 'cols' => intval( $user->getOption( 'cols' ) ),
- 'rows' => intval( $user->getOption( 'rows' ) ) ),
+ 'cols' => $user->getIntOption( 'cols' ),
+ 'rows' => $user->getIntOption( 'rows' ) ),
$content->getNativeData() . "\n" );
$previewButton = Xml::element( 'input', array(
? 'filereuploadsummary'
: 'fileuploadsummary',
'default' => $this->mComment,
- 'cols' => intval( $this->getUser()->getOption( 'cols' ) ),
+ 'cols' => $this->getUser()->getIntOption( 'cols' ),
'rows' => 8,
)
);
case self::SUCCESS:
# We've verified now, update the real record
$user = $this->getUser();
- if( (bool)$this->mRemember != (bool)$user->getOption( 'rememberpassword' ) ) {
+ if( (bool)$this->mRemember != $user->getBoolOption( 'rememberpassword' ) ) {
$user->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
$user->saveSettings();
} else {
# Toggle watchlist content (all recent edits or just the latest)
if( $values['extended'] ) {
- $limitWatchlist = intval( $user->getOption( 'wllimit' ) );
+ $limitWatchlist = $user->getIntOption( 'wllimit' );
$usePage = false;
} else {
# Top log Ids for a page are not stored