/** @todo document */
function makeImageLinkObj( $nt, $alt = '' ) {
global $wgContLang, $wgUseImageResize;
+ global $wgUser, $wgThumbLimits;
+
$img = new Image( $nt );
$url = $img->getViewURL();
# for right-to-left-languages ("Semitic languages")
#
# If thumbnail width has not been provided, it is set
- # here to 180 pixels
+ # to the default user option as specified in Language*.php
if ( $align == '' ) {
$align = $wgContLang->isRTL() ? 'left' : 'right';
}
+
+
if ( ! isset($width) ) {
- $width = 180;
+ $wopt = $wgUser->getOption( 'thumbsize' );
+
+ if( !isset( $wgThumbLimits[$wopt] ) ) {
+ $wopt = User::getDefaultOption( 'thumbsize' );
+ }
+
+ $width = $wgThumbLimits[$wopt];
}
+
return $prefix.$this->makeThumbLinkObj( $img, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix;
} elseif ( isset($width) ) {
$this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0;
$this->mNick = $request->getVal( 'wpNick' );
$this->mUserLanguage = $request->getVal( 'wpUserLanguage' );
- $this->mUserVariant = $request->getVal( 'wpUserVariant' );
+ $this->mUserVariant = $request->getVal( 'wpUserVariant' );
$this->mSearch = $request->getVal( 'wpSearch' );
$this->mRecent = $request->getVal( 'wpRecent' );
$this->mHourDiff = $request->getVal( 'wpHourDiff' );
$this->mSearchLines = $request->getVal( 'wpSearchLines' );
$this->mSearchChars = $request->getVal( 'wpSearchChars' );
$this->mImageSize = $request->getVal( 'wpImageSize' );
+ $this->mThumbSize = $request->getInt( 'wpThumbSize' );
$this->mAction = $request->getVal( 'action' );
$this->mReset = $request->getCheck( 'wpReset' );
$wgUser->setOption( 'stubthreshold', $this->validateIntOrNull( $this->mStubs ) );
$wgUser->setOption( 'timecorrection', $this->validateTimeZone( $this->mHourDiff, -12, 14 ) );
$wgUser->setOption( 'imagesize', $this->mImageSize );
+ $wgUser->setOption( 'thumbsize', $this->mThumbSize );
# Set search namespace options
foreach( $this->mSearchNs as $i => $value ) {
$this->mSearchLines = $wgUser->getOption( 'contextlines' );
$this->mSearchChars = $wgUser->getOption( 'contextchars' );
$this->mImageSize = $wgUser->getOption( 'imagesize' );
+ $this->mThumbSize = $wgUser->getOption( 'thumbsize' );
$this->mRecent = $wgUser->getOption( 'rclimit' );
$togs = $wgLang->getUserToggles();
*/
function mainPrefsForm( $err ) {
global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames;
- global $wgAllowRealName, $wgImageLimits;
+ global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
global $wgLanguageNames, $wgDisableLangConversion;
global $wgEmailNotificationForWatchlistPages, $wgEmailNotificationForUserTalkPages,$wgEmailNotificationForMinorEdits;
global $wgRCShowWatchingUsers, $wgEmailNotificationRevealPageEditorAddress;
$cp = wfMsg( 'changepassword' );
$sk = wfMsg( 'skin' );
$math = wfMsg( 'math' );
+ $files = wfMsg( 'files' );
$dateFormat = wfMsg('dateformat');
$opw = wfMsg( 'oldpassword' );
$npw = wfMsg( 'newpassword' );
value=\"$i\"$checked /> ".wfMsg($mathopts[$i])."</label></div>\n" );
}
$wgOut->addHTML( "</fieldset>\n\n" );
-
+
+ # Files
+ #
+ $wgOut->addHTML("<fieldset>
+ <legend>$files</legend>
+ <div><label>" . wfMsg('imagemaxsize') . "<select name=\"wpImageSize\">");
+
+ $imageLimitOptions = null;
+ foreach ( $wgImageLimits as $index => $limits ) {
+ $selected = ($index == $this->mImageSize) ? 'selected="selected"' : '';
+ $imageLimitOptions .= "<option value=\"{$index}\" {$selected}>{$limits[0]}x{$limits[1]}</option>\n";
+ }
+
+ $imageThumbOptions = null;
+ $wgOut->addHTML( "{$imageLimitOptions}</select></label></div>
+ <div><label>" . wfMsg('thumbsize') . "<select name=\"wpThumbSize\">");
+ foreach ( $wgThumbLimits as $index => $size ) {
+ $selected = ($index == $this->mThumbSize) ? 'selected="selected"' : '';
+ $imageThumbOptions .= "<option value=\"{$index}\" {$selected}>{$size}px</option>\n";
+ }
+ $wgOut->addHTML( "{$imageThumbOptions}</select></label></div></fieldset>\n\n");
+
# Date format
#
if ($dateopts) {
#
$wgOut->addHTML("<fieldset><legend>".wfMsg('prefs-misc')."</legend>");
- $wgOut->addHTML( '<div><label>' . wfMsg('imagemaxsize') . "<select name=\"wpImageSize\">");
-
- $imageLimitOptions='';
- foreach ( $wgImageLimits as $index => $limits ) {
- $selected = ($index == $this->mImageSize) ? 'selected="selected"' : '';
- $imageLimitOptions .= "<option value=\"{$index}\" {$selected}>{$limits[0]}x{$limits[1]}</option>\n";
- }
- $wgOut->addHTML( "{$imageLimitOptions}</select></label></div>" );
-
-
foreach ( $togs as $tname ) {
if( !array_key_exists( $tname, $this->mUsedToggles ) ) {
$wgOut->addHTML( $this->getToggle( $tname ) );
'showtoolbar' => 1,
'date' => 0,
'imagesize' => 2,
+ 'thumbsize' => 2,
'rememberpassword' => 0,
'enotifwatchlistpages' => 1,
'enotifusertalkpages' => 1,
'changepassword' => 'Change password',
'skin' => 'Skin',
'math' => 'Math',
-'dateformat' => 'Date format',
+'dateformat' => 'Date format',
'math_failure' => 'Failed to parse',
'math_unknown_error' => 'unknown error',
'math_unknown_function' => 'unknown function ',
'emailflag' => 'Disable e-mail from other users',
'defaultns' => 'Search in these namespaces by default:',
'default' => 'default',
+'files' => 'Files',
# User levels special page
#
'nextdiff' => 'Next diff →',
'imagemaxsize' => 'Limit images on image description pages to: ',
+'thumbsize' => 'Thumbnail size : ',
'showbigimage' => 'Download high resolution version ($1x$2, $3 KB)',
'newimages' => 'New images gallery',