3 * Hold things related to displaying and saving user preferences.
5 * @subpackage SpecialPage
8 if( !defined( 'MEDIAWIKI' ) )
11 /* to get a list of languages in setting user's language preference */
12 require_once('languages/Names.php');
15 * Entry point that create the "Preferences" object
17 function wfSpecialPreferences() {
20 $form = new PreferencesForm( $wgRequest );
25 * Preferences form handling
26 * This object will show the preferences form and can save it as well.
28 * @subpackage SpecialPage
30 class PreferencesForm
{
31 var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs;
32 var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick;
33 var $mUserLanguage, $mUserVariant;
34 var $mSearch, $mRecent, $mHourDiff, $mSearchLines, $mSearchChars, $mAction;
35 var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize;
41 function PreferencesForm( &$request ) {
42 global $wgLang, $wgContLang, $wgAllowRealName;
44 $this->mQuickbar
= $request->getVal( 'wpQuickbar' );
45 $this->mOldpass
= $request->getVal( 'wpOldpass' );
46 $this->mNewpass
= $request->getVal( 'wpNewpass' );
47 $this->mRetypePass
=$request->getVal( 'wpRetypePass' );
48 $this->mStubs
= $request->getVal( 'wpStubs' );
49 $this->mRows
= $request->getVal( 'wpRows' );
50 $this->mCols
= $request->getVal( 'wpCols' );
51 $this->mSkin
= $request->getVal( 'wpSkin' );
52 $this->mMath
= $request->getVal( 'wpMath' );
53 $this->mDate
= $request->getVal( 'wpDate' );
54 $this->mUserEmail
= $request->getVal( 'wpUserEmail' );
55 $this->mRealName
= ($wgAllowRealName) ?
$request->getVal( 'wpRealName' ) : '';
56 $this->mEmailFlag
= $request->getCheck( 'wpEmailFlag' ) ?
1 : 0;
57 $this->mNick
= $request->getVal( 'wpNick' );
58 $this->mUserLanguage
= $request->getVal( 'wpUserLanguage' );
59 $this->mUserVariant
= $request->getVal( 'wpUserVariant' );
60 $this->mSearch
= $request->getVal( 'wpSearch' );
61 $this->mRecent
= $request->getVal( 'wpRecent' );
62 $this->mHourDiff
= $request->getVal( 'wpHourDiff' );
63 $this->mSearchLines
= $request->getVal( 'wpSearchLines' );
64 $this->mSearchChars
= $request->getVal( 'wpSearchChars' );
65 $this->mImageSize
= $request->getVal( 'wpImageSize' );
67 $this->mAction
= $request->getVal( 'action' );
68 $this->mReset
= $request->getCheck( 'wpReset' );
69 $this->mPosted
= $request->wasPosted();
70 $this->mSaveprefs
= $request->getCheck( 'wpSaveprefs' ) && $this->mPosted
;
72 # User toggles (the big ugly unsorted list of checkboxes)
73 $this->mToggles
= array();
74 if ( $this->mPosted
) {
75 $togs = $wgLang->getUserToggles();
76 foreach ( $togs as $tname ) {
77 $this->mToggles
[$tname] = $request->getCheck( "wpOp$tname" ) ?
1 : 0;
81 $this->mUsedToggles
= array();
83 # Search namespace options
84 # Note: namespaces don't necessarily have consecutive keys
85 $this->mSearchNs
= array();
86 if ( $this->mPosted
) {
87 $namespaces = $wgContLang->getNamespaces();
88 foreach ( $namespaces as $i => $namespace ) {
90 $this->mSearchNs
[$i] = $request->getCheck( "wpNs$i" ) ?
1 : 0;
97 global $wgUser, $wgOut, $wgUseDynamicDates;
99 if ( 0 == $wgUser->getID() ) {
100 $wgOut->errorpage( 'prefsnologin', 'prefsnologintext' );
103 if ( wfReadOnly() ) {
104 $wgOut->readOnlyPage();
107 if ( $this->mReset
) {
109 $this->mainPrefsForm( wfMsg( 'prefsreset' ) );
110 } else if ( $this->mSaveprefs
) {
111 $this->savePreferences();
114 $this->mainPrefsForm( '' );
121 function validateInt( &$val, $min=0, $max=0x7fffffff ) {
123 $val = min($val, $max);
124 $val = max($val, $min);
131 function validateIntOrNull( &$val, $min=0, $max=0x7fffffff ) {
136 return $this->validateInt( $val, $min, $max );
143 function validateTimeZone( $s ) {
145 if ( strpos( $s, ':' ) ) {
147 $array = explode( ':' , $s );
148 $hour = intval( $array[0] );
149 $minute = intval( $array[1] );
151 $minute = intval( $s * 60 );
152 $hour = intval( $minute / 60 );
153 $minute = abs( $minute ) %
60;
155 $hour = min( $hour, 15 );
156 $hour = max( $hour, -15 );
157 $minute = min( $minute, 59 );
158 $minute = max( $minute, 0 );
159 $s = sprintf( "%02d:%02d", $hour, $minute );
167 function savePreferences() {
168 global $wgUser, $wgLang, $wgOut;
169 global $wgEnableUserEmail, $wgEnableEmail;
170 global $wgEmailAuthentication;
172 if ( '' != $this->mNewpass
) {
173 if ( $this->mNewpass
!= $this->mRetypePass
) {
174 $this->mainPrefsForm( wfMsg( 'badretype' ) );
178 if (!$wgUser->checkPassword( $this->mOldpass
)) {
179 $this->mainPrefsForm( wfMsg( 'wrongpassword' ) );
182 $wgUser->setPassword( $this->mNewpass
);
184 $wgUser->setRealName( $this->mRealName
);
185 $wgUser->setOption( 'language', $this->mUserLanguage
);
186 $wgUser->setOption( 'variant', $this->mUserVariant
);
187 $wgUser->setOption( 'nickname', $this->mNick
);
188 $wgUser->setOption( 'quickbar', $this->mQuickbar
);
189 $wgUser->setOption( 'skin', $this->mSkin
);
190 $wgUser->setOption( 'math', $this->mMath
);
191 $wgUser->setOption( 'date', $this->mDate
);
192 $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch
) );
193 $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines
) );
194 $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars
) );
195 $wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent
) );
196 $wgUser->setOption( 'rows', $this->validateInt( $this->mRows
, 4, 1000 ) );
197 $wgUser->setOption( 'cols', $this->validateInt( $this->mCols
, 4, 1000 ) );
198 $wgUser->setOption( 'stubthreshold', $this->validateIntOrNull( $this->mStubs
) );
199 $wgUser->setOption( 'timecorrection', $this->validateTimeZone( $this->mHourDiff
, -12, 14 ) );
200 $wgUser->setOption( 'imagesize', $this->mImageSize
);
202 # Set search namespace options
203 foreach( $this->mSearchNs
as $i => $value ) {
204 $wgUser->setOption( "searchNs{$i}", $value );
207 if( $wgEnableEmail && $wgEnableUserEmail ) {
208 $wgUser->setOption( 'disablemail', $this->mEmailFlag
);
212 foreach ( $this->mToggles
as $tname => $tvalue ) {
213 $wgUser->setOption( $tname, $tvalue );
215 $wgUser->setCookies();
216 $wgUser->saveSettings();
218 if( $wgEnableEmail ) {
219 $newadr = strtolower( $this->mUserEmail
);
220 $oldadr = strtolower($wgUser->getEmail());
221 if (($newadr <> '') && ($newadr <> $oldadr)) { # the user has supplied a new email address on the login page
222 # prepare for authentication and mail a temporary password to newadr
223 require_once( 'SpecialUserlogin.php' );
224 if ( !$wgUser->isValidEmailAddr( $newadr ) ) {
225 $this->mainPrefsForm( wfMsg( 'invalidemailaddress' ) );
228 $wgUser->mEmail
= $newadr; # new behaviour: set this new emailaddr from login-page into user database record
229 $wgUser->mEmailAuthenticationtimestamp
= 0; # but flag as "dirty" = unauthenticated
230 $wgUser->saveSettings();
231 if ($wgEmailAuthentication) {
232 # mail a temporary password to the dirty address
233 # on "save options", this user will be logged-out automatically
234 $error = LoginForm
::mailPasswordInternal( $wgUser, true, $dummy );
236 return LoginForm
::mainLoginForm( wfMsg( 'passwordsentforemailauthentication', $wgUser->getName() ) );
238 return LoginForm
::mainLoginForm( wfMsg( 'mailerror', $error ) );
240 # if user returns, that new email address gets authenticated in checkpassword()
243 $wgUser->setEmail( strtolower($this->mUserEmail
) );
244 $wgUser->setCookies();
245 $wgUser->saveSettings();
249 $wgOut->setParserOptions( ParserOptions
::newFromUser( $wgUser ) );
250 $po = ParserOptions
::newFromUser( $wgUser );
251 $this->mainPrefsForm( wfMsg( 'savedprefs' ) );
257 function resetPrefs() {
258 global $wgUser, $wgLang, $wgContLang, $wgAllowRealName;
260 $this->mOldpass
= $this->mNewpass
= $this->mRetypePass
= '';
261 $this->mUserEmail
= $wgUser->getEmail();
262 $this->mUserEmailAuthenticationtimestamp
= $wgUser->getEmailAuthenticationtimestamp();
263 $this->mRealName
= ($wgAllowRealName) ?
$wgUser->getRealName() : '';
264 $this->mUserLanguage
= $wgUser->getOption( 'language' );
265 if( empty( $this->mUserLanguage
) ) {
266 # Quick hack for conversions, where this value is blank
267 global $wgContLanguageCode;
268 $this->mUserLanguage
= $wgContLanguageCode;
270 $this->mUserVariant
= $wgUser->getOption( 'variant');
271 if ( 1 == $wgUser->getOption( 'disablemail' ) ) { $this->mEmailFlag
= 1; }
272 else { $this->mEmailFlag
= 0; }
273 $this->mNick
= $wgUser->getOption( 'nickname' );
275 $this->mQuickbar
= $wgUser->getOption( 'quickbar' );
276 $this->mSkin
= $wgUser->getOption( 'skin' );
277 $this->mMath
= $wgUser->getOption( 'math' );
278 $this->mDate
= $wgUser->getOption( 'date' );
279 $this->mRows
= $wgUser->getOption( 'rows' );
280 $this->mCols
= $wgUser->getOption( 'cols' );
281 $this->mStubs
= $wgUser->getOption( 'stubthreshold' );
282 $this->mHourDiff
= $wgUser->getOption( 'timecorrection' );
283 $this->mSearch
= $wgUser->getOption( 'searchlimit' );
284 $this->mSearchLines
= $wgUser->getOption( 'contextlines' );
285 $this->mSearchChars
= $wgUser->getOption( 'contextchars' );
286 $this->mImageSize
= $wgUser->getOption( 'imagesize' );
287 $this->mRecent
= $wgUser->getOption( 'rclimit' );
289 $togs = $wgLang->getUserToggles();
290 foreach ( $togs as $tname ) {
291 $ttext = wfMsg('tog-'.$tname);
292 $this->mToggles
[$tname] = $wgUser->getOption( $tname );
295 $namespaces = $wgContLang->getNamespaces();
296 foreach ( $namespaces as $i => $namespace ) {
298 $this->mSearchNs
[$i] = $wgUser->getOption( 'searchNs'.$i );
306 function namespacesCheckboxes() {
307 global $wgContLang, $wgUser;
309 # Determine namespace checkboxes
310 $namespaces = $wgContLang->getNamespaces();
313 foreach ( $namespaces as $i => $name ) {
314 # Skip special or anything similar
317 if ( $this->mSearchNs
[$i] ) {
318 $checked = ' checked="checked"';
320 $name = str_replace( '_', ' ', $namespaces[$i] );
322 $name = wfMsg( 'blanknamespace' );
328 $r1 .= "<label><input type='checkbox' value=\"1\" name=\"" .
329 "wpNs$i\"{$checked} />{$name}</label>\n";
337 function getToggle( $tname, $trailer = false) {
338 global $wgUser, $wgLang;
340 $this->mUsedToggles
[$tname] = true;
341 $ttext = $wgLang->getUserToggle( $tname );
343 if ( 1 == $wgUser->getOption( $tname ) ) {
344 $checked = ' checked="checked"';
348 $trailer =($trailer) ?
$trailer : '';
349 return "<div><input type='checkbox' value=\"1\" "
350 . "id=\"$tname\" name=\"wpOp$tname\"$checked /><label for=\"$tname\">$ttext</label>$trailer</div>\n";
356 function mainPrefsForm( $err ) {
357 global $wgUser, $wgOut, $wgLang, $wgContLang, $wgUseDynamicDates, $wgValidSkinNames;
358 global $wgAllowRealName, $wgImageLimits;
359 global $wgLanguageNames, $wgDisableLangConversion;
360 global $wgEmailNotificationForWatchlistPages, $wgEmailNotificationForUserTalkPages,$wgEmailNotificationForMinorEdits;
361 global $wgRCShowWatchingUsers, $wgEmailNotificationRevealPageEditorAddress;
362 global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
363 global $wgContLanguageCode;
365 $wgOut->setPageTitle( wfMsg( 'preferences' ) );
366 $wgOut->setArticleRelated( false );
367 $wgOut->setRobotpolicy( 'noindex,nofollow' );
370 $wgOut->addHTML( "<p class='error'>" . htmlspecialchars( $err ) . "</p>\n" );
372 $uname = $wgUser->getName();
373 $uid = $wgUser->getID();
375 $wgOut->addWikiText( wfMsg( 'prefslogintext', $uname, $uid ) );
376 $wgOut->addWikiText( wfMsg('clearyourcache'));
378 $qbs = $wgLang->getQuickbarSettings();
379 $skinNames = $wgLang->getSkinNames();
380 $mathopts = $wgLang->getMathNames();
381 $dateopts = $wgLang->getDateFormats();
382 $togs = $wgLang->getUserToggles();
384 $titleObj = Title
::makeTitle( NS_SPECIAL
, 'Preferences' );
385 $action = $titleObj->escapeLocalURL();
387 $qb = wfMsg( 'qbsettings' );
388 $cp = wfMsg( 'changepassword' );
389 $sk = wfMsg( 'skin' );
390 $math = wfMsg( 'math' );
391 $dateFormat = wfMsg('dateformat');
392 $opw = wfMsg( 'oldpassword' );
393 $npw = wfMsg( 'newpassword' );
394 $rpw = wfMsg( 'retypenew' );
395 $svp = wfMsg( 'saveprefs' );
396 $rsp = wfMsg( 'resetprefs' );
397 $tbs = wfMsg( 'textboxsize' );
398 $tbr = wfMsg( 'rows' );
399 $tbc = wfMsg( 'columns' );
400 $ltz = wfMsg( 'localtime' );
401 $timezone = wfMsg( 'timezonelegend' );
402 $tzt = wfMsg( 'timezonetext' );
403 $tzo = wfMsg( 'timezoneoffset' );
404 $tzGuess = wfMsg( 'guesstimezone' );
405 $tzServerTime = wfMsg( 'servertime' );
406 $yem = wfMsg( 'youremail' );
407 $yrn = ($wgAllowRealName) ?
wfMsg( 'yourrealname' ) : '';
408 $yl = wfMsg( 'yourlanguage' );
409 $yv = wfMsg( 'yourvariant' );
410 $emf = wfMsg( 'emailflag' );
411 $ynn = wfMsg( 'yournick' );
412 $stt = wfMsg ( 'stubthreshold' ) ;
413 $srh = wfMsg( 'searchresultshead' );
414 $rpp = wfMsg( 'resultsperpage' );
415 $scl = wfMsg( 'contextlines' );
416 $scc = wfMsg( 'contextchars' );
417 $rcc = wfMsg( 'recentchangescount' );
418 $dsn = wfMsg( 'defaultns' );
420 $wgOut->addHTML( "<form id=\"preferences\" name=\"preferences\" action=\"$action\"
423 # First section: identity
426 $this->mUserEmail
= htmlspecialchars( $this->mUserEmail
);
427 $this->mRealName
= htmlspecialchars( $this->mRealName
);
428 $this->mNick
= htmlspecialchars( $this->mNick
);
429 if ( $this->mEmailFlag
) { $emfc = 'checked="checked"'; }
432 if ($wgEmailAuthentication && ($this->mUserEmail
!= '') ) {
433 if ($wgUser->getEmailAuthenticationtimestamp() != 0) {
434 $emailauthenticated = wfMsg('emailauthenticated',$wgLang->timeanddate($wgUser->getEmailAuthenticationtimestamp(), true ) ).'<br>';
437 $emailauthenticated = wfMsg('emailnotauthenticated').'<br>';
438 $disabled = ' '.wfMsg('disableduntilauthent');
441 $emailauthenticated = '';
444 if ($this->mUserEmail
== '') {
445 $disabled = ' '.wfMsg('disablednoemail');
448 $ps = $this->namespacesCheckboxes();
450 $enotifwatchlistpages = ($wgEmailNotificationForWatchlistPages) ?
$this->getToggle( 'enotifwatchlistpages', $disabled) : '';
451 $enotifusertalkpages = ($wgEmailNotificationForUserTalkPages) ?
$this->getToggle( 'enotifusertalkpages', $disabled) : '';
452 $enotifminoredits = ($wgEmailNotificationForMinorEdits) ?
$this->getToggle( 'enotifminoredits', $disabled) : '';
453 $enotifrevealaddr = ($wgEmailNotificationRevealPageEditorAddress) ?
$this->getToggle( 'enotifrevealaddr', $disabled) : '';
454 $prefs_help_email_enotif = ( $wgEmailNotificationForWatchlistPages ||
$wgEmailNotificationForUserTalkPages) ?
' ' . wfMsg('prefs-help-email-enotif') : '';
455 $prefs_help_realname = '';
457 $wgOut->addHTML( "<fieldset>
458 <legend>".wfMsg('prefs-personal')."</legend>");
460 if ($wgAllowRealName) {
461 $wgOut->addHTML("<div><label>$yrn: <input type='text' name=\"wpRealName\" value=\"{$this->mRealName}\" size='20' /></label></div>");
462 $prefs_help_realname = wfMsg('prefs-help-realname').'<br>';
465 if( $wgEnableEmail ) {
467 <div><label>$yem: <input type='text' name=\"wpUserEmail\" value=\"{$this->mUserEmail}\" size='20' /></label></div>" );
468 if( $wgEnableUserEmail ) {
472 $enotifwatchlistpages.
473 $enotifusertalkpages.
475 "<div><label><input type='checkbox' $emfc value=\"1\" name=\"wpEmailFlag\" />$emf.$disabled</label></div>" );
479 $fancysig = $this->getToggle( 'fancysig' );
481 <div><label>$ynn: <input type='text' name=\"wpNick\" value=\"{$this->mNick}\" size='12' /></label></div>
482 <div>$fancysig<br /></div>
483 <div><label>$yl: <select name=\"wpUserLanguage\">\n");
486 * If a bogus value is set, default to the content language.
487 * Otherwise, no default is selected and the user ends up
488 * with an Afrikaans interface since it's first in the list.
490 if( isset( $wgLanguageNames[$this->mUserLanguage
] ) ) {
491 $selectedLang = $this->mUserLanguage
;
493 $selectedLang = $wgContLanguageCode;
495 foreach($wgLanguageNames as $code => $name) {
497 /* only add languages that have a file */
498 $langfile="$IP/languages/Language".str_replace('-', '_', ucfirst($code)).".php";
499 if(file_exists($langfile) ||
$code == $wgContLanguageCode) {
500 $sel = ($code == $selectedLang)?
'selected="selected"' : '';
501 $wgOut->addHtml("\t<option value=\"$code\" $sel>$code - $name</option>\n");
504 $wgOut->addHtml("</select></label></div>\n" );
506 /* see if there are multiple language variants to choose from*/
507 if(!$wgDisableLangConversion) {
508 $variants = $wgContLang->getVariants();
509 $size=sizeof($variants);
511 $variantArray=array();
512 foreach($variants as $v) {
513 $v = str_replace( '_', '-', strtolower($v));
514 if($name=$wgLanguageNames[$v]) {
515 $variantArray[$v] = $name;
518 $size=sizeof($variantArray);
520 if(sizeof($variantArray) > 1) {
522 <div><label>$yv: <select name=\"wpUserVariant\">\n");
523 foreach($variantArray as $code => $name) {
524 $sel = ($code==$this->mUserVariant
)?
'selected="selected"' : '';
525 $wgOut->addHtml("\t<option value=\"$code\" $sel>$code - $name</option>\n");
529 # Fields for changing password
531 $this->mOldpass
= htmlspecialchars( $this->mOldpass
);
532 $this->mNewpass
= htmlspecialchars( $this->mNewpass
);
533 $this->mRetypePass
= htmlspecialchars( $this->mRetypePass
);
535 $wgOut->addHTML( "<fieldset>
537 <div><label>$opw: <input type='password' name=\"wpOldpass\" value=\"{$this->mOldpass}\" size='20' /></label></div>
538 <div><label>$npw: <input type='password' name=\"wpNewpass\" value=\"{$this->mNewpass}\" size='20' /></label></div>
539 <div><label>$rpw: <input type='password' name=\"wpRetypePass\" value=\"{$this->mRetypePass}\" size='20' /></label></div>
540 " . $this->getToggle( "rememberpassword" ) . "
542 <div class='prefsectiontip'>".$prefs_help_realname.wfMsg('prefs-help-email').$prefs_help_email_enotif."</div>\n</fieldset>\n" );
547 $wgOut->addHtml( "<fieldset>\n<legend>$qb</legend>\n" );
548 for ( $i = 0; $i < count( $qbs ); ++
$i ) {
549 if ( $i == $this->mQuickbar
) { $checked = ' checked="checked"'; }
550 else { $checked = ""; }
551 $wgOut->addHTML( "<div><label><input type='radio' name=\"wpQuickbar\"
552 value=\"$i\"$checked /> {$qbs[$i]}</label></div>\n" );
554 $wgOut->addHtml('<div class="prefsectiontip">'.wfMsg('qbsettingsnote').'</div>');
555 $wgOut->addHtml( "</fieldset>\n\n" );
559 $wgOut->addHTML( "<fieldset>\n<legend>$sk</legend>\n" );
560 # Only show members of $wgValidSkinNames rather than
561 # $skinNames (skins is all skin names from Language.php)
562 foreach ($wgValidSkinNames as $skinkey => $skinname ) {
563 if ( $skinkey == $this->mSkin
) {
564 $checked = ' checked="checked"';
568 if ( isset( $skinNames[$skinkey] ) ) {
569 $sn = $skinNames[$skinkey];
573 global $wgDefaultSkin;
574 if( $skinkey == $wgDefaultSkin ) {
575 $sn .= ' (' . wfMsg( 'default' ) . ')';
577 $wgOut->addHTML( "<div><label><input type='radio' name=\"wpSkin\"
578 value=\"$skinkey\"$checked /> {$sn}</label></div>\n" );
580 $wgOut->addHTML( "</fieldset>\n\n" );
584 $wgOut->addHTML( "<fieldset>\n<legend>$math</legend>\n" );
585 for ( $i = 0; $i < count( $mathopts ); ++
$i ) {
586 if ( $i == $this->mMath
) { $checked = ' checked="checked"'; }
587 else { $checked = ""; }
588 $wgOut->addHTML( "<div><label><input type='radio' name=\"wpMath\"
589 value=\"$i\"$checked /> ".wfMsg($mathopts[$i])."</label></div>\n" );
591 $wgOut->addHTML( "</fieldset>\n\n" );
595 if ( $wgUseDynamicDates ) {
596 $wgOut->addHTML( "<fieldset>\n<legend>$dateFormat</legend>\n" );
597 for ( $i = 0; $i < count( $dateopts ); ++
$i) {
598 if ( $i == $this->mDate
) {
599 $checked = ' checked="checked"';
603 $wgOut->addHTML( "<div><label><input type='radio' name=\"wpDate\" ".
604 "value=\"$i\"$checked /> {$dateopts[$i]}</label></div>\n" );
606 $wgOut->addHTML( "</fieldset>\n\n");
611 $nowlocal = $wgLang->time( $now = wfTimestampNow(), true );
612 $nowserver = $wgLang->time( $now, false );
613 $wgOut->addHTML( "<fieldset>
614 <legend>$tbs</legend>\n
616 <label>$tbr: <input type='text' name=\"wpRows\" value=\"{$this->mRows}\" size='6' /></label>
617 <label>$tbc: <input type='text' name=\"wpCols\" value=\"{$this->mCols}\" size='6' /></label>
619 $this->getToggle( "editwidth" ) .
620 $this->getToggle( "showtoolbar" ) .
621 $this->getToggle( "previewonfirst" ) .
622 $this->getToggle( "previewontop" ) .
623 $this->getToggle( "watchdefault" ) .
624 $this->getToggle( "minordefault" ) . "
628 <legend>$timezone</legend>
629 <div><b>$tzServerTime:</b> $nowserver</div>
630 <div><b>$ltz:</b> $nowlocal</div>
631 <div><label>$tzo*: <input type='text' name=\"wpHourDiff\" value=\"" . htmlspecialchars( $this->mHourDiff
) . "\" size='6' /></label></div>
632 <div><input type=\"button\" value=\"$tzGuess\" onclick=\"javascript:guessTimezone()\" id=\"guesstimezonebutton\" style=\"display:none\" /></div>
633 <div class='prefsectiontip'>* {$tzt}</div>
636 $shownumberswatching = ($wgRCShowWatchingUsers) ?
$this->getToggle('shownumberswatching') : '';
639 <fieldset><legend>".wfMsg('prefs-rc')."</legend>
640 <div><label>$rcc: <input type='text' name=\"wpRecent\" value=\"$this->mRecent\" size='6' /></label></div>" .
641 $this->getToggle( "hideminor" ) . $shownumberswatching .
642 $this->getToggle( "usenewrc" ) . $this->getToggle('showupdated', wfMsg('updatedmarker')) .
643 "<div><label>$stt: <input type='text' name=\"wpStubs\" value=\"$this->mStubs\" size='6' /></label></div>
644 <div><label>".wfMsg('imagemaxsize')."<select name=\"wpImageSize\">");
646 $imageLimitOptions='';
647 foreach ( $wgImageLimits as $index => $limits ) {
648 $selected = ($index == $this->mImageSize
) ?
'selected="selected"' : '';
649 $imageLimitOptions .= "<option value=\"{$index}\" {$selected}>{$limits[0]}x{$limits[1]}</option>\n";
651 $wgOut->addHTML( "{$imageLimitOptions}</select></label></div>
656 <legend>$srh</legend>
657 <div><label>$rpp: <input type='text' name=\"wpSearch\" value=\"$this->mSearch\" size='6' /></label></div>
658 <div><label>$scl: <input type='text' name=\"wpSearchLines\" value=\"$this->mSearchLines\" size='6' /></label></div>
659 <div><label>$scc: <input type='text' name=\"wpSearchChars\" value=\"$this->mSearchChars\" size='6' /></label></div>
662 <legend>$dsn</legend>
668 # Various checkbox options
670 $wgOut->addHTML("<fieldset><legend>".wfMsg('prefs-misc')."</legend>");
671 foreach ( $togs as $tname ) {
672 if( !array_key_exists( $tname, $this->mUsedToggles
) ) {
673 $wgOut->addHTML( $this->getToggle( $tname ) );
676 $wgOut->addHTML( "</fieldset>\n\n" );
679 <div id='prefsubmit'>
681 <input type='submit' name=\"wpSaveprefs\" value=\"$svp\" accesskey=\"".
682 wfMsg('accesskey-save')."\" title=\"[alt-".wfMsg('accesskey-save')."]\" />
683 <input type='submit' name=\"wpReset\" value=\"$rsp\" />