3 * Hold things related to displaying and saving user preferences.
9 * Entry point that create the "Preferences" object
11 function wfSpecialPreferences() {
14 $form = new PreferencesForm( $wgRequest );
19 * Preferences form handling
20 * This object will show the preferences form and can save it as well.
21 * @ingroup SpecialPage
23 class PreferencesForm
{
24 var $mQuickbar, $mStubs;
25 var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick;
26 var $mUserLanguage, $mUserVariant;
27 var $mSearch, $mRecent, $mRecentDays, $mTimeZone, $mHourDiff, $mSearchLines, $mSearchChars, $mAction;
28 var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize;
29 var $mUnderline, $mWatchlistEdits;
35 function __construct( &$request ) {
36 global $wgContLang, $wgUser, $wgAllowRealName;
38 $this->mQuickbar
= $request->getVal( 'wpQuickbar' );
39 $this->mStubs
= $request->getVal( 'wpStubs' );
40 $this->mRows
= $request->getVal( 'wpRows' );
41 $this->mCols
= $request->getVal( 'wpCols' );
42 $this->mSkin
= Skin
::normalizeKey( $request->getVal( 'wpSkin' ) );
43 $this->mMath
= $request->getVal( 'wpMath' );
44 $this->mDate
= $request->getVal( 'wpDate' );
45 $this->mUserEmail
= $request->getVal( 'wpUserEmail' );
46 $this->mRealName
= $wgAllowRealName ?
$request->getVal( 'wpRealName' ) : '';
47 $this->mEmailFlag
= $request->getCheck( 'wpEmailFlag' ) ?
0 : 1;
48 $this->mNick
= $request->getVal( 'wpNick' );
49 $this->mUserLanguage
= $request->getVal( 'wpUserLanguage' );
50 $this->mUserVariant
= $request->getVal( 'wpUserVariant' );
51 $this->mSearch
= $request->getVal( 'wpSearch' );
52 $this->mRecent
= $request->getVal( 'wpRecent' );
53 $this->mRecentDays
= $request->getVal( 'wpRecentDays' );
54 $this->mTimeZone
= $request->getVal( 'wpTimeZone' );
55 $this->mHourDiff
= $request->getVal( 'wpHourDiff' );
56 $this->mSearchLines
= $request->getVal( 'wpSearchLines' );
57 $this->mSearchChars
= $request->getVal( 'wpSearchChars' );
58 $this->mImageSize
= $request->getVal( 'wpImageSize' );
59 $this->mThumbSize
= $request->getInt( 'wpThumbSize' );
60 $this->mUnderline
= $request->getInt( 'wpOpunderline' );
61 $this->mAction
= $request->getVal( 'action' );
62 $this->mReset
= $request->getCheck( 'wpReset' );
63 $this->mRestoreprefs
= $request->getCheck( 'wpRestore' );
64 $this->mPosted
= $request->wasPosted();
65 $this->mSuccess
= $request->getCheck( 'success' );
66 $this->mWatchlistDays
= $request->getVal( 'wpWatchlistDays' );
67 $this->mWatchlistEdits
= $request->getVal( 'wpWatchlistEdits' );
68 $this->mDisableMWSuggest
= $request->getCheck( 'wpDisableMWSuggest' );
70 $this->mSaveprefs
= $request->getCheck( 'wpSaveprefs' ) &&
72 $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) );
74 # User toggles (the big ugly unsorted list of checkboxes)
75 $this->mToggles
= array();
76 if ( $this->mPosted
) {
77 $togs = User
::getToggles();
78 foreach ( $togs as $tname ) {
79 $this->mToggles
[$tname] = $request->getCheck( "wpOp$tname" ) ?
1 : 0;
83 $this->mUsedToggles
= array();
85 # Search namespace options
86 # Note: namespaces don't necessarily have consecutive keys
87 $this->mSearchNs
= array();
88 if ( $this->mPosted
) {
89 $namespaces = $wgContLang->getNamespaces();
90 foreach ( $namespaces as $i => $namespace ) {
92 $this->mSearchNs
[$i] = $request->getCheck( "wpNs$i" ) ?
1 : 0;
98 if ( !preg_match( '/^[a-z\-]*$/', $this->mUserLanguage
) ) {
99 $this->mUserLanguage
= 'nolanguage';
102 wfRunHooks( 'InitPreferencesForm', array( $this, $request ) );
106 global $wgUser, $wgOut, $wgTitle;
108 if ( $wgUser->isAnon() ) {
109 $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext', array($wgTitle->getPrefixedDBkey()) );
112 if ( wfReadOnly() ) {
113 $wgOut->readOnlyPage();
116 if ( $this->mReset
) {
118 $this->mainPrefsForm( 'reset', wfMsg( 'prefsreset' ) );
119 } else if ( $this->mSaveprefs
) {
120 $this->savePreferences();
121 } else if ( $this->mRestoreprefs
) {
122 $this->restorePreferences();
125 $this->mainPrefsForm( '' );
131 function validateInt( &$val, $min=0, $max=0x7fffffff ) {
133 $val = min($val, $max);
134 $val = max($val, $min);
141 function validateFloat( &$val, $min, $max=0x7fffffff ) {
142 $val = floatval( $val );
143 $val = min( $val, $max );
144 $val = max( $val, $min );
151 function validateIntOrNull( &$val, $min=0, $max=0x7fffffff ) {
156 return $this->validateInt( $val, $min, $max );
163 function validateDate( $val ) {
164 global $wgLang, $wgContLang;
165 if ( $val !== false && (
166 in_array( $val, (array)$wgLang->getDatePreferences() ) ||
167 in_array( $val, (array)$wgContLang->getDatePreferences() ) ) )
171 return $wgLang->getDefaultDateFormat();
176 * Used to validate the user inputed timezone before saving it as
177 * 'timecorrection', will return 'System' if fed bogus data.
179 * @param string $tz the user input Zoneinfo timezone
180 * @param string $s the user input offset string
183 function validateTimeZone( $tz, $s ) {
184 $data = explode( '|', $tz, 3 );
185 switch ( $data[0] ) {
191 $data = explode( ':', $s, 2 );
193 if( count( $data ) == 2 ) {
194 $data[0] = intval( $data[0] );
195 $data[1] = intval( $data[1] );
196 $minDiff = abs( $data[0] ) * 60 +
$data[1];
197 if ( $data[0] < 0 ) $minDiff = -$minDiff;
199 $minDiff = intval( $data[0] ) * 60;
202 # Max is +14:00 and min is -12:00, see:
203 # http://en.wikipedia.org/wiki/Timezone
204 $minDiff = min( $minDiff, 840 ); # 14:00
205 $minDiff = max( $minDiff, -720 ); # -12:00
206 return 'Offset|'.$minDiff;
213 function savePreferences() {
214 global $wgUser, $wgOut, $wgParser;
215 global $wgEnableUserEmail, $wgEnableEmail;
216 global $wgEmailAuthentication, $wgRCMaxAge;
217 global $wgAuth, $wgEmailConfirmToEdit;
219 $wgUser->setRealName( $this->mRealName
);
220 $oldOptions = $wgUser->mOptions
;
222 if( $wgUser->getOption( 'language' ) !== $this->mUserLanguage
) {
223 $needRedirect = true;
225 $needRedirect = false;
228 # Validate the signature and clean it up as needed
229 global $wgMaxSigChars;
230 if( mb_strlen( $this->mNick
) > $wgMaxSigChars ) {
232 $this->mainPrefsForm( 'error',
233 wfMsgExt( 'badsiglength', 'parsemag', $wgLang->formatNum( $wgMaxSigChars ) ) );
235 } elseif( $this->mToggles
['fancysig'] ) {
236 if( $wgParser->validateSig( $this->mNick
) !== false ) {
237 $this->mNick
= $wgParser->cleanSig( $this->mNick
);
239 $this->mainPrefsForm( 'error', wfMsg( 'badsig' ) );
243 // When no fancy sig used, make sure ~{3,5} get removed.
244 $this->mNick
= $wgParser->cleanSigInSig( $this->mNick
);
247 $wgUser->setOption( 'language', $this->mUserLanguage
);
248 $wgUser->setOption( 'variant', $this->mUserVariant
);
249 $wgUser->setOption( 'nickname', $this->mNick
);
250 $wgUser->setOption( 'quickbar', $this->mQuickbar
);
251 global $wgAllowUserSkin;
252 if( $wgAllowUserSkin ) {
253 $wgUser->setOption( 'skin', $this->mSkin
);
257 $wgUser->setOption( 'math', $this->mMath
);
259 $wgUser->setOption( 'date', $this->validateDate( $this->mDate
) );
260 $wgUser->setOption( 'searchlimit', $this->validateIntOrNull( $this->mSearch
) );
261 $wgUser->setOption( 'contextlines', $this->validateIntOrNull( $this->mSearchLines
) );
262 $wgUser->setOption( 'contextchars', $this->validateIntOrNull( $this->mSearchChars
) );
263 $wgUser->setOption( 'rclimit', $this->validateIntOrNull( $this->mRecent
) );
264 $wgUser->setOption( 'rcdays', $this->validateInt($this->mRecentDays
, 1, ceil($wgRCMaxAge / (3600*24))));
265 $wgUser->setOption( 'wllimit', $this->validateIntOrNull( $this->mWatchlistEdits
, 0, 1000 ) );
266 $wgUser->setOption( 'rows', $this->validateInt( $this->mRows
, 4, 1000 ) );
267 $wgUser->setOption( 'cols', $this->validateInt( $this->mCols
, 4, 1000 ) );
268 $wgUser->setOption( 'stubthreshold', $this->validateIntOrNull( $this->mStubs
) );
269 $wgUser->setOption( 'timecorrection', $this->validateTimeZone( $this->mTimeZone
, $this->mHourDiff
) );
270 $wgUser->setOption( 'imagesize', $this->mImageSize
);
271 $wgUser->setOption( 'thumbsize', $this->mThumbSize
);
272 $wgUser->setOption( 'underline', $this->validateInt($this->mUnderline
, 0, 2) );
273 $wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays
, 0, 7 ) );
274 $wgUser->setOption( 'disablesuggest', $this->mDisableMWSuggest
);
276 # Set search namespace options
277 foreach( $this->mSearchNs
as $i => $value ) {
278 $wgUser->setOption( "searchNs{$i}", $value );
281 if( $wgEnableEmail && $wgEnableUserEmail ) {
282 $wgUser->setOption( 'disablemail', $this->mEmailFlag
);
286 foreach ( $this->mToggles
as $tname => $tvalue ) {
287 $wgUser->setOption( $tname, $tvalue );
291 if( $wgEnableEmail ) {
292 $newadr = $this->mUserEmail
;
293 $oldadr = $wgUser->getEmail();
294 if( ($newadr != '') && ($newadr != $oldadr) ) {
295 # the user has supplied a new email address on the login page
296 if( $wgUser->isValidEmailAddr( $newadr ) ) {
297 # new behaviour: set this new emailaddr from login-page into user database record
298 $wgUser->setEmail( $newadr );
299 # but flag as "dirty" = unauthenticated
300 $wgUser->invalidateEmail();
301 if ($wgEmailAuthentication) {
302 # Mail a temporary password to the dirty address.
303 # User can come back through the confirmation URL to re-enable email.
304 $result = $wgUser->sendConfirmationMail();
305 if( WikiError
::isError( $result ) ) {
306 $error = wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
308 $error = wfMsg( 'eauthentsent', $wgUser->getName() );
312 $error = wfMsg( 'invalidemailaddress' );
315 if( $wgEmailConfirmToEdit && empty( $newadr ) ) {
316 $this->mainPrefsForm( 'error', wfMsg( 'noemailtitle' ) );
319 $wgUser->setEmail( $this->mUserEmail
);
321 if( $oldadr != $newadr ) {
322 wfRunHooks( 'PrefsEmailAudit', array( $wgUser, $oldadr, $newadr ) );
326 if( !$wgAuth->updateExternalDB( $wgUser ) ){
327 $this->mainPrefsForm( 'error', wfMsg( 'externaldberror' ) );
332 if ( !wfRunHooks( 'SavePreferences', array( $this, $wgUser, &$msg, $oldOptions ) ) ) {
333 $this->mainPrefsForm( 'error', $msg );
337 $wgUser->setCookies();
338 $wgUser->saveSettings();
340 if( $needRedirect && $error === false ) {
341 $title = SpecialPage
::getTitleFor( 'Preferences' );
342 $wgOut->redirect( $title->getFullURL( 'success' ) );
346 $wgOut->parserOptions( ParserOptions
::newFromUser( $wgUser ) );
347 $this->mainPrefsForm( $error === false ?
'success' : 'error', $error);
353 function resetPrefs() {
354 global $wgUser, $wgLang, $wgContLang, $wgContLanguageCode, $wgAllowRealName, $wgLocalTZoffset;
356 $this->mUserEmail
= $wgUser->getEmail();
357 $this->mUserEmailAuthenticationtimestamp
= $wgUser->getEmailAuthenticationtimestamp();
358 $this->mRealName
= ($wgAllowRealName) ?
$wgUser->getRealName() : '';
360 # language value might be blank, default to content language
361 $this->mUserLanguage
= $wgUser->getOption( 'language', $wgContLanguageCode );
363 $this->mUserVariant
= $wgUser->getOption( 'variant');
364 $this->mEmailFlag
= $wgUser->getOption( 'disablemail' ) == 1 ?
1 : 0;
365 $this->mNick
= $wgUser->getOption( 'nickname' );
367 $this->mQuickbar
= $wgUser->getOption( 'quickbar' );
368 $this->mSkin
= Skin
::normalizeKey( $wgUser->getOption( 'skin' ) );
369 $this->mMath
= $wgUser->getOption( 'math' );
370 $this->mDate
= $wgUser->getDatePreference();
371 $this->mRows
= $wgUser->getOption( 'rows' );
372 $this->mCols
= $wgUser->getOption( 'cols' );
373 $this->mStubs
= $wgUser->getOption( 'stubthreshold' );
375 $tz = $wgUser->getOption( 'timecorrection' );
376 $data = explode( '|', $tz, 3 );
378 switch ( $data[0] ) {
380 $this->mTimeZone
= $tz;
381 # Check if the specified TZ exists, and change to 'Offset' if
383 if ( !function_exists('timezone_open') || @timezone_open
( $data[2] ) === false ) {
384 $this->mTimeZone
= 'Offset';
385 $minDiff = intval( $data[1] );
390 $this->mTimeZone
= 'System|'.$wgLocalTZoffset;
393 $this->mTimeZone
= 'Offset';
394 $minDiff = intval( $data[1] );
397 $this->mTimeZone
= 'Offset';
398 $data = explode( ':', $tz, 2 );
399 if( count( $data ) == 2 ) {
400 $data[0] = intval( $data[0] );
401 $data[1] = intval( $data[1] );
402 $minDiff = abs( $data[0] ) * 60 +
$data[1];
403 if ( $data[0] < 0 ) $minDiff = -$minDiff;
405 $minDiff = intval( $data[0] ) * 60;
409 if ( is_null( $minDiff ) ) {
410 $this->mHourDiff
= '';
412 $this->mHourDiff
= sprintf( '%+03d:%02d', floor($minDiff/60), abs($minDiff)%60
);
415 $this->mSearch
= $wgUser->getOption( 'searchlimit' );
416 $this->mSearchLines
= $wgUser->getOption( 'contextlines' );
417 $this->mSearchChars
= $wgUser->getOption( 'contextchars' );
418 $this->mImageSize
= $wgUser->getOption( 'imagesize' );
419 $this->mThumbSize
= $wgUser->getOption( 'thumbsize' );
420 $this->mRecent
= $wgUser->getOption( 'rclimit' );
421 $this->mRecentDays
= $wgUser->getOption( 'rcdays' );
422 $this->mWatchlistEdits
= $wgUser->getOption( 'wllimit' );
423 $this->mUnderline
= $wgUser->getOption( 'underline' );
424 $this->mWatchlistDays
= $wgUser->getOption( 'watchlistdays' );
425 $this->mDisableMWSuggest
= $wgUser->getBoolOption( 'disablesuggest' );
427 $togs = User
::getToggles();
428 foreach ( $togs as $tname ) {
429 $this->mToggles
[$tname] = $wgUser->getOption( $tname );
432 $namespaces = $wgContLang->getNamespaces();
433 foreach ( $namespaces as $i => $namespace ) {
434 if ( $i >= NS_MAIN
) {
435 $this->mSearchNs
[$i] = $wgUser->getOption( 'searchNs'.$i );
439 wfRunHooks( 'ResetPreferences', array( $this, $wgUser ) );
445 function restorePreferences() {
446 global $wgUser, $wgOut;
447 $wgUser->restoreOptions();
448 $wgUser->setCookies();
449 $wgUser->saveSettings();
450 $title = SpecialPage
::getTitleFor( 'Preferences' );
451 $wgOut->redirect( $title->getFullURL( 'success' ) );
457 function namespacesCheckboxes() {
460 # Determine namespace checkboxes
461 $namespaces = $wgContLang->getNamespaces();
464 foreach ( $namespaces as $i => $name ) {
467 $checked = $this->mSearchNs
[$i] ?
"checked='checked'" : '';
468 $name = str_replace( '_', ' ', $namespaces[$i] );
471 $name = wfMsg( 'blanknamespace' );
473 $r1 .= "<input type='checkbox' value='1' name='wpNs$i' id='wpNs$i' {$checked}/> <label for='wpNs$i'>{$name}</label><br />\n";
479 function getToggle( $tname, $trailer = false, $disabled = false ) {
480 global $wgUser, $wgLang;
482 $this->mUsedToggles
[$tname] = true;
483 $ttext = $wgLang->getUserToggle( $tname );
485 $checked = $wgUser->getOption( $tname ) == 1 ?
' checked="checked"' : '';
486 $disabled = $disabled ?
' disabled="disabled"' : '';
487 $trailer = $trailer ?
$trailer : '';
488 return "<div class='toggle'><input type='checkbox' value='1' id=\"$tname\" name=\"wpOp$tname\"$checked$disabled />" .
489 " <span class='toggletext'><label for=\"$tname\">$ttext</label>$trailer</span></div>\n";
492 function getToggles( $items ) {
494 foreach( $items as $item ) {
495 if( $item === false )
497 if( is_array( $item ) ) {
498 list( $key, $trailer ) = $item;
503 $out .= $this->getToggle( $key, $trailer );
508 function addRow($td1, $td2) {
509 return "<tr><td class='mw-label'>$td1</td><td class='mw-input'>$td2</td></tr>";
513 * Helper function for user information panel
514 * @param $td1 label for an item
515 * @param $td2 item or null
516 * @param $td3 optional help or null
517 * @return xhtml block
519 function tableRow( $td1, $td2 = null, $td3 = null ) {
521 if ( is_null( $td3 ) ) {
524 $td3 = Xml
::tags( 'tr', null,
525 Xml
::tags( 'td', array( 'class' => 'pref-label', 'colspan' => '2' ), $td3 )
529 if ( is_null( $td2 ) ) {
530 $td1 = Xml
::tags( 'td', array( 'class' => 'pref-label', 'colspan' => '2' ), $td1 );
533 $td1 = Xml
::tags( 'td', array( 'class' => 'pref-label' ), $td1 );
534 $td2 = Xml
::tags( 'td', array( 'class' => 'pref-input' ), $td2 );
537 return Xml
::tags( 'tr', null, $td1 . $td2 ). $td3 . "\n";
544 function mainPrefsForm( $status , $message = '' ) {
545 global $wgUser, $wgOut, $wgLang, $wgContLang, $wgAuth;
546 global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
547 global $wgDisableLangConversion, $wgDisableTitleConversion;
548 global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
549 global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress;
550 global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
551 global $wgContLanguageCode, $wgDefaultSkin, $wgCookieExpiration;
552 global $wgEmailConfirmToEdit, $wgEnableMWSuggest, $wgLocalTZoffset;
554 $wgOut->setPageTitle( wfMsg( 'preferences' ) );
555 $wgOut->setArticleRelated( false );
556 $wgOut->setRobotPolicy( 'noindex,nofollow' );
557 $wgOut->addScriptFile( 'prefs.js' );
559 $wgOut->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc.
561 if ( $this->mSuccess ||
'success' == $status ) {
562 $wgOut->wrapWikiMsg( '<div class="successbox"><strong>$1</strong></div>', 'savedprefs' );
563 } else if ( 'error' == $status ) {
564 $wgOut->addWikiText( '<div class="errorbox"><strong>' . $message . '</strong></div>' );
565 } else if ( '' != $status ) {
566 $wgOut->addWikiText( $message . "\n----" );
569 $qbs = $wgLang->getQuickbarSettings();
570 $mathopts = $wgLang->getMathNames();
571 $dateopts = $wgLang->getDatePreferences();
572 $togs = User
::getToggles();
574 $titleObj = SpecialPage
::getTitleFor( 'Preferences' );
576 # Pre-expire some toggles so they won't show if disabled
577 $this->mUsedToggles
[ 'shownumberswatching' ] = true;
578 $this->mUsedToggles
[ 'showupdated' ] = true;
579 $this->mUsedToggles
[ 'enotifwatchlistpages' ] = true;
580 $this->mUsedToggles
[ 'enotifusertalkpages' ] = true;
581 $this->mUsedToggles
[ 'enotifminoredits' ] = true;
582 $this->mUsedToggles
[ 'enotifrevealaddr' ] = true;
583 $this->mUsedToggles
[ 'ccmeonemails' ] = true;
584 $this->mUsedToggles
[ 'uselivepreview' ] = true;
585 $this->mUsedToggles
[ 'noconvertlink' ] = true;
588 if ( !$this->mEmailFlag
) { $emfc = 'checked="checked"'; }
592 if ($wgEmailAuthentication && ($this->mUserEmail
!= '') ) {
593 if( $wgUser->getEmailAuthenticationTimestamp() ) {
594 // date and time are separate parameters to facilitate localisation.
595 // $time is kept for backward compat reasons.
596 // 'emailauthenticated' is also used in SpecialConfirmemail.php
597 $time = $wgLang->timeAndDate( $wgUser->getEmailAuthenticationTimestamp(), true );
598 $d = $wgLang->date( $wgUser->getEmailAuthenticationTimestamp(), true );
599 $t = $wgLang->time( $wgUser->getEmailAuthenticationTimestamp(), true );
600 $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'<br />';
601 $disableEmailPrefs = false;
603 $disableEmailPrefs = true;
604 $skin = $wgUser->getSkin();
605 $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
606 $skin->makeKnownLinkObj( SpecialPage
::getTitleFor( 'Confirmemail' ),
607 wfMsg( 'emailconfirmlink' ) ) . '<br />';
610 $emailauthenticated = '';
611 $disableEmailPrefs = false;
614 if ($this->mUserEmail
== '') {
615 $emailauthenticated = wfMsg( 'noemailprefs' ) . '<br />';
618 $ps = $this->namespacesCheckboxes();
620 $enotifwatchlistpages = ($wgEnotifWatchlist) ?
$this->getToggle( 'enotifwatchlistpages', false, $disableEmailPrefs ) : '';
621 $enotifusertalkpages = ($wgEnotifUserTalk) ?
$this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : '';
622 $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ?
$this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : '';
623 $enotifrevealaddr = (($wgEnotifWatchlist ||
$wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ?
$this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : '';
628 Xml
::openElement( 'form', array(
629 'action' => $titleObj->getLocalUrl(),
631 'id' => 'mw-preferences-form',
633 Xml
::openElement( 'div', array( 'id' => 'preferences' ) )
639 Xml
::fieldset( wfMsg('prefs-personal') ) .
640 Xml
::openElement( 'table' ) .
641 $this->tableRow( Xml
::element( 'h2', null, wfMsg( 'prefs-personal' ) ) )
644 # Get groups to which the user belongs
645 $userEffectiveGroups = $wgUser->getEffectiveGroups();
646 $userEffectiveGroupsArray = array();
647 foreach( $userEffectiveGroups as $ueg ) {
649 // Skip the default * group, seems useless here
652 $userEffectiveGroupsArray[] = User
::makeGroupLinkHTML( $ueg );
654 asort( $userEffectiveGroupsArray );
656 $sk = $wgUser->getSkin();
657 $toolLinks = array();
658 $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage
::getTitleFor( 'ListGroupRights' ), wfMsg( 'listgrouprights' ) );
659 # At the moment one tool link only but be prepared for the future...
660 # FIXME: Add a link to Special:Userrights for users who are allowed to use it.
661 # $wgUser->isAllowed( 'userrights' ) seems to strict in some cases
663 $userInformationHtml =
664 $this->tableRow( wfMsgHtml( 'username' ), htmlspecialchars( $wgUser->getName() ) ) .
665 $this->tableRow( wfMsgHtml( 'uid' ), $wgLang->formatNum( htmlspecialchars( $wgUser->getId() ) ) ).
668 wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ),
669 $wgLang->commaList( $userEffectiveGroupsArray ) .
670 '<br />(' . implode( ' | ', $toolLinks ) . ')'
674 wfMsgHtml( 'prefs-edits' ),
675 $wgLang->formatNum( $wgUser->getEditCount() )
678 if( wfRunHooks( 'PreferencesUserInformationPanel', array( $this, &$userInformationHtml ) ) ) {
679 $wgOut->addHTML( $userInformationHtml );
682 if ( $wgAllowRealName ) {
685 Xml
::label( wfMsg('yourrealname'), 'wpRealName' ),
686 Xml
::input( 'wpRealName', 25, $this->mRealName
, array( 'id' => 'wpRealName' ) ),
687 Xml
::tags('div', array( 'class' => 'prefsectiontip' ),
688 wfMsgExt( 'prefs-help-realname', 'parseinline' )
693 if ( $wgEnableEmail ) {
696 Xml
::label( wfMsg('youremail'), 'wpUserEmail' ),
697 Xml
::input( 'wpUserEmail', 25, $this->mUserEmail
, array( 'id' => 'wpUserEmail' ) ),
698 Xml
::tags('div', array( 'class' => 'prefsectiontip' ),
699 wfMsgExt( $wgEmailConfirmToEdit ?
'prefs-help-email-required' : 'prefs-help-email', 'parseinline' )
705 global $wgParser, $wgMaxSigChars;
706 if( mb_strlen( $this->mNick
) > $wgMaxSigChars ) {
707 $invalidSig = $this->tableRow(
709 Xml
::element( 'span', array( 'class' => 'error' ),
710 wfMsgExt( 'badsiglength', 'parsemag', $wgLang->formatNum( $wgMaxSigChars ) ) )
712 } elseif( !empty( $this->mToggles
['fancysig'] ) &&
713 false === $wgParser->validateSig( $this->mNick
) ) {
714 $invalidSig = $this->tableRow(
716 Xml
::element( 'span', array( 'class' => 'error' ), wfMsg( 'badsig' ) )
724 Xml
::label( wfMsg( 'yournick' ), 'wpNick' ),
725 Xml
::input( 'wpNick', 25, $this->mNick
,
728 // Note: $wgMaxSigChars is enforced in Unicode characters,
729 // both on the backend and now in the browser.
730 // Badly-behaved requests may still try to submit
731 // an overlong string, however.
732 'maxlength' => $wgMaxSigChars ) )
735 $this->tableRow( ' ', $this->getToggle( 'fancysig' ) )
738 list( $lsLabel, $lsSelect) = Xml
::languageSelector( $this->mUserLanguage
);
740 $this->tableRow( $lsLabel, $lsSelect )
743 /* see if there are multiple language variants to choose from*/
744 if(!$wgDisableLangConversion) {
745 $variants = $wgContLang->getVariants();
746 $variantArray = array();
748 $languages = Language
::getLanguageNames( true );
749 foreach($variants as $v) {
750 $v = str_replace( '_', '-', strtolower($v));
751 if( array_key_exists( $v, $languages ) ) {
752 // If it doesn't have a name, we'll pretend it doesn't exist
753 $variantArray[$v] = $languages[$v];
758 foreach( $variantArray as $code => $name ) {
759 $selected = ($code == $this->mUserVariant
);
760 $options .= Xml
::option( "$code - $name", $code, $selected ) . "\n";
763 if(count($variantArray) > 1) {
766 Xml
::label( wfMsg( 'yourvariant' ), 'wpUserVariant' ),
768 array( 'name' => 'wpUserVariant', 'id' => 'wpUserVariant' ),
775 if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) {
777 Xml
::tags( 'tr', null,
778 Xml
::tags( 'td', array( 'colspan' => '2' ),
779 $this->getToggle( "noconvertlink" )
787 if( $wgAuth->allowPasswordChange() ) {
788 $link = $wgUser->getSkin()->link( SpecialPage
::getTitleFor( 'ResetPass' ), wfMsgHtml( 'prefs-resetpass' ),
789 array() , array('returnto' => SpecialPage
::getTitleFor( 'Preferences') ) );
791 $this->tableRow( Xml
::element( 'h2', null, wfMsg( 'changepassword' ) ) ) .
792 $this->tableRow( '<ul><li>' . $link . '</li></ul>' ) );
797 if ( $wgEnableEmail ) {
800 if ($wgEnableUserEmail) {
801 // fixme -- the "allowemail" pseudotoggle is a hacked-together
802 // inversion for the "disableemail" preference.
803 $emf = wfMsg( 'allowemail' );
804 $disabled = $disableEmailPrefs ?
' disabled="disabled"' : '';
806 "<input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label>" .
807 $this->getToggle( 'ccmeonemails', '', $disableEmailPrefs );
812 $this->tableRow( Xml
::element( 'h2', null, wfMsg( 'email' ) ) ) .
816 $enotifwatchlistpages.
817 $enotifusertalkpages.
826 Xml
::closeElement( 'table' ) .
827 Xml
::closeElement( 'fieldset' )
833 if ($this->mSkin
== 'cologneblue' ||
$this->mSkin
== 'standard') {
834 $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg( 'qbsettings' ) . "</legend>\n" );
835 for ( $i = 0; $i < count( $qbs ); ++
$i ) {
836 if ( $i == $this->mQuickbar
) { $checked = ' checked="checked"'; }
837 else { $checked = ""; }
838 $wgOut->addHTML( "<div><label><input type='radio' name='wpQuickbar' value=\"$i\"$checked />{$qbs[$i]}</label></div>\n" );
840 $wgOut->addHTML( "</fieldset>\n\n" );
842 # Need to output a hidden option even if the relevant skin is not in use,
843 # otherwise the preference will get reset to 0 on submit
844 $wgOut->addHTML( Xml
::hidden( 'wpQuickbar', $this->mQuickbar
) );
849 global $wgAllowUserSkin;
850 if( $wgAllowUserSkin ) {
851 $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg( 'skin' ) . "</legend>\n" );
852 $mptitle = Title
::newMainPage();
853 $previewtext = wfMsg( 'skin-preview' );
854 # Only show members of Skin::getSkinNames() rather than
855 # $skinNames (skins is all skin names from Language.php)
856 $validSkinNames = Skin
::getUsableSkins();
857 # Sort by UI skin name. First though need to update validSkinNames as sometimes
858 # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI).
859 foreach ( $validSkinNames as $skinkey => &$skinname ) {
860 $msgName = "skinname-{$skinkey}";
861 $localisedSkinName = wfMsg( $msgName );
862 if ( !wfEmptyMsg( $msgName, $localisedSkinName ) ) {
863 $skinname = $localisedSkinName;
866 asort($validSkinNames);
867 foreach ($validSkinNames as $skinkey => $sn ) {
868 $checked = $skinkey == $this->mSkin ?
' checked="checked"' : '';
869 $mplink = htmlspecialchars( $mptitle->getLocalURL( "useskin=$skinkey" ) );
870 $previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
871 if( $skinkey == $wgDefaultSkin )
872 $sn .= ' (' . wfMsg( 'default' ) . ')';
873 $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink<br />\n" );
875 $wgOut->addHTML( "</fieldset>\n\n" );
882 $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg('math') . '</legend>' );
883 foreach ( $mathopts as $k => $v ) {
884 $checked = ($k == $this->mMath
);
886 Xml
::openElement( 'div' ) .
887 Xml
::radioLabel( wfMsg( $v ), 'wpMath', $k, "mw-sp-math-$k", $checked ) .
888 Xml
::closeElement( 'div' ) . "\n"
891 $wgOut->addHTML( "</fieldset>\n\n" );
896 $imageLimitOptions = null;
897 foreach ( $wgImageLimits as $index => $limits ) {
898 $selected = ($index == $this->mImageSize
);
899 $imageLimitOptions .= Xml
::option( "{$limits[0]}×{$limits[1]}" .
900 wfMsg('unit-pixel'), $index, $selected );
903 $imageThumbOptions = null;
904 foreach ( $wgThumbLimits as $index => $size ) {
905 $selected = ($index == $this->mThumbSize
);
906 $imageThumbOptions .= Xml
::option($size . wfMsg('unit-pixel'), $index,
910 $imageSizeId = 'wpImageSize';
911 $thumbSizeId = 'wpThumbSize';
913 Xml
::fieldset( wfMsg( 'files' ) ) . "\n" .
914 Xml
::openElement( 'table' ) .
916 <td class="mw-label">' .
917 Xml
::label( wfMsg( 'imagemaxsize' ), $imageSizeId ) .
919 <td class="mw-input">' .
920 Xml
::openElement( 'select', array( 'name' => $imageSizeId, 'id' => $imageSizeId ) ) .
922 Xml
::closeElement( 'select' ) .
925 <td class="mw-label">' .
926 Xml
::label( wfMsg( 'thumbsize' ), $thumbSizeId ) .
928 <td class="mw-input">' .
929 Xml
::openElement( 'select', array( 'name' => $thumbSizeId, 'id' => $thumbSizeId ) ) .
931 Xml
::closeElement( 'select' ) .
934 Xml
::closeElement( 'table' ) .
935 Xml
::closeElement( 'fieldset' )
944 Xml
::openElement( 'fieldset' ) .
945 Xml
::element( 'legend', null, wfMsg( 'datetime' ) ) . "\n"
950 Xml
::openElement( 'fieldset' ) .
951 Xml
::element( 'legend', null, wfMsg( 'dateformat' ) ) . "\n"
954 $epoch = '20010115161234'; # Wikipedia day
955 foreach( $dateopts as $key ) {
956 if( $key == 'default' ) {
957 $formatted = wfMsg( 'datedefault' );
959 $formatted = $wgLang->timeanddate( $epoch, false, $key );
962 Xml
::tags( 'div', null,
963 Xml
::radioLabel( $formatted, 'wpDate', $key, "wpDate$idCnt", $key == $this->mDate
)
968 $wgOut->addHTML( Xml
::closeElement( 'fieldset' ) . "\n" );
971 $nowlocal = Xml
::openElement( 'span', array( 'id' => 'wpLocalTime' ) ) .
972 $wgLang->time( $now = wfTimestampNow(), true ) .
973 Xml
::closeElement( 'span' );
974 $nowserver = $wgLang->time( $now, false ) .
975 Xml
::hidden( 'wpServerTime', substr( $now, 8, 2 ) * 60 +
substr( $now, 10, 2 ) );
978 Xml
::openElement( 'fieldset' ) .
979 Xml
::element( 'legend', null, wfMsg( 'timezonelegend' ) ) .
980 Xml
::openElement( 'table' ) .
981 $this->addRow( wfMsg( 'servertime' ), $nowserver ) .
982 $this->addRow( wfMsg( 'localtime' ), $nowlocal )
984 $opt = Xml
::openElement( 'select', array(
985 'name' => 'wpTimeZone',
986 'id' => 'wpTimeZone',
987 'onchange' => 'javascript:updateTimezoneSelection(false)' ) );
988 $opt .= Xml
::option( wfMsg( 'timezoneuseserverdefault' ), "System|$wgLocalTZoffset", $this->mTimeZone
=== "System|$wgLocalTZoffset" );
989 $opt .= Xml
::option( wfMsg( 'timezoneuseoffset' ), 'Offset', $this->mTimeZone
=== 'Offset' );
990 if ( function_exists( 'timezone_identifiers_list' ) ) {
992 $tzs = timezone_identifiers_list();
994 $selZone = explode( '|', $this->mTimeZone
, 3);
995 $selZone = ( $selZone[0] == 'ZoneInfo' ) ?
$selZone[2] : null;
996 $now = date_create( 'now' );
997 foreach ( $tzs as $tz ) {
998 $z = explode( '/', $tz, 2 );
999 # timezone_identifiers_list() returns a number of
1000 # backwards-compatibility entries. This filters them out of the
1001 # list presented to the user.
1002 if ( count( $z ) != 2 ||
!in_array( $z[0], array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' ) ) ) continue;
1003 if ( $optgroup != $z[0] ) {
1004 if ( $optgroup !== '' ) $opt .= Xml
::closeElement( 'optgroup' );
1006 $opt .= Xml
::openElement( 'optgroup', array( 'label' => $z[0] ) );
1008 $minDiff = floor( timezone_offset_get( timezone_open( $tz ), $now ) / 60 );
1009 $opt .= Xml
::option( str_replace( '_', ' ', $tz ), "ZoneInfo|$minDiff|$tz", $selZone === $tz, array( 'label' => $z[1] ) );
1011 if ( $optgroup !== '' ) $opt .= Xml
::closeElement( 'optgroup' );
1013 $opt .= Xml
::closeElement( 'select' );
1016 Xml
::label( wfMsg( 'timezoneselect' ), 'wpTimeZone' ),
1021 Xml
::label( wfMsg( 'timezoneoffset' ), 'wpHourDiff' ),
1022 Xml
::input( 'wpHourDiff', 6, $this->mHourDiff
, array(
1023 'id' => 'wpHourDiff',
1024 'onfocus' => 'javascript:updateTimezoneSelection(true)',
1025 'onblur' => 'javascript:updateTimezoneSelection(false)' ) ) ) .
1028 <td class='mw-submit'>" .
1029 Xml
::element( 'input',
1030 array( 'type' => 'button',
1031 'value' => wfMsg( 'guesstimezone' ),
1032 'onclick' => 'javascript:guessTimezone()',
1033 'id' => 'guesstimezonebutton',
1034 'style' => 'display:none;' ) ) .
1037 Xml
::closeElement( 'table' ) .
1038 Xml
::tags( 'div', array( 'class' => 'prefsectiontip' ), wfMsgExt( 'timezonetext', 'parseinline' ) ).
1039 Xml
::closeElement( 'fieldset' ) .
1040 Xml
::closeElement( 'fieldset' ) . "\n\n"
1045 global $wgLivePreview;
1047 Xml
::fieldset( wfMsg( 'textboxsize' ) ) .
1048 wfMsgHTML( 'prefs-edit-boxsize' ) . ' ' .
1049 Xml
::inputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows
) . ' ' .
1050 Xml
::inputLabel( wfMsg( 'columns' ), 'wpCols', 'wpCols', 3, $this->mCols
) .
1051 $this->getToggles( array(
1053 'editsectiononrightclick',
1062 $wgLivePreview ?
'uselivepreview' : false,
1067 $wgOut->addHTML( Xml
::closeElement( 'fieldset' ) );
1070 global $wgRCMaxAge, $wgUseRCPatrol;
1072 Xml
::fieldset( wfMsg( 'prefs-rc' ) ) .
1073 Xml
::openElement( 'table' ) .
1075 <td class="mw-label">' .
1076 Xml
::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) .
1078 <td class="mw-input">' .
1079 Xml
::input( 'wpRecentDays', 3, $this->mRecentDays
, array( 'id' => 'wpRecentDays' ) ) . ' ' .
1080 wfMsgExt( 'recentchangesdays-max', 'parsemag',
1081 $wgLang->formatNum( ceil( $wgRCMaxAge / ( 3600 * 24 ) ) ) ) .
1084 <td class="mw-label">' .
1085 Xml
::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) .
1087 <td class="mw-input">' .
1088 Xml
::input( 'wpRecent', 3, $this->mRecent
, array( 'id' => 'wpRecent' ) ) .
1091 Xml
::closeElement( 'table' ) .
1095 $toggles[] = 'hideminor';
1096 if( $wgUseRCPatrol ) {
1097 $toggles[] = 'hidepatrolled';
1098 $toggles[] = 'newpageshidepatrolled';
1100 if( $wgRCShowWatchingUsers ) $toggles[] = 'shownumberswatching';
1101 $toggles[] = 'usenewrc';
1104 $this->getToggles( $toggles ) .
1105 Xml
::closeElement( 'fieldset' )
1109 $watchlistToggles = array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown',
1110 'watchlisthideanons', 'watchlisthideliu' );
1111 if( $wgUseRCPatrol ) $watchlistToggles[] = 'watchlisthidepatrolled';
1114 Xml
::fieldset( wfMsg( 'prefs-watchlist' ) ) .
1115 Xml
::inputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays
) . ' ' .
1116 wfMsgHTML( 'prefs-watchlist-days-max' ) .
1118 $this->getToggle( 'extendwatchlist' ) .
1119 Xml
::inputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits
) . ' ' .
1120 wfMsgHTML( 'prefs-watchlist-edits-max' ) .
1122 $this->getToggles( $watchlistToggles )
1125 if( $wgUser->isAllowed( 'createpage' ) ||
$wgUser->isAllowed( 'createtalk' ) ) {
1126 $wgOut->addHTML( $this->getToggle( 'watchcreations' ) );
1129 foreach( array( 'edit' => 'watchdefault', 'move' => 'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) {
1130 if( $wgUser->isAllowed( $action ) )
1131 $wgOut->addHTML( $this->getToggle( $toggle ) );
1133 $this->mUsedToggles
['watchcreations'] = true;
1134 $this->mUsedToggles
['watchdefault'] = true;
1135 $this->mUsedToggles
['watchmoves'] = true;
1136 $this->mUsedToggles
['watchdeletion'] = true;
1138 $wgOut->addHTML( Xml
::closeElement( 'fieldset' ) );
1141 $mwsuggest = $wgEnableMWSuggest ?
1143 Xml
::label( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ),
1144 Xml
::check( 'wpDisableMWSuggest', $this->mDisableMWSuggest
, array( 'id' => 'wpDisableMWSuggest' ) )
1147 // Elements for the search tab itself
1148 Xml
::openElement( 'fieldset' ) .
1149 Xml
::element( 'legend', null, wfMsg( 'searchresultshead' ) ) .
1150 // Elements for the search options in the search tab
1151 Xml
::openElement( 'fieldset' ) .
1152 Xml
::element( 'legend', null, wfMsg( 'prefs-searchoptions' ) ) .
1153 Xml
::openElement( 'table' ) .
1155 Xml
::label( wfMsg( 'resultsperpage' ), 'wpSearch' ),
1156 Xml
::input( 'wpSearch', 4, $this->mSearch
, array( 'id' => 'wpSearch' ) )
1159 Xml
::label( wfMsg( 'contextlines' ), 'wpSearchLines' ),
1160 Xml
::input( 'wpSearchLines', 4, $this->mSearchLines
, array( 'id' => 'wpSearchLines' ) )
1163 Xml
::label( wfMsg( 'contextchars' ), 'wpSearchChars' ),
1164 Xml
::input( 'wpSearchChars', 4, $this->mSearchChars
, array( 'id' => 'wpSearchChars' ) )
1167 Xml
::closeElement( 'table' ) .
1168 Xml
::closeElement( 'fieldset' ) .
1169 // Elements for the namespace options in the search tab
1170 Xml
::openElement( 'fieldset' ) .
1171 Xml
::element( 'legend', null, wfMsg( 'prefs-namespaces' ) ) .
1172 wfMsgExt( 'defaultns', array( 'parse' ) ) .
1174 Xml
::closeElement( 'fieldset' ) .
1175 // End of the search tab
1176 Xml
::closeElement( 'fieldset' )
1181 $wgOut->addHTML('<fieldset><legend>' . wfMsg('prefs-misc') . '</legend>');
1182 $wgOut->addHTML( '<label for="wpStubs">' . wfMsg( 'stub-threshold' ) . '</label> ' );
1183 $wgOut->addHTML( Xml
::input( 'wpStubs', 6, $this->mStubs
, array( 'id' => 'wpStubs' ) ) );
1184 $msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) );
1185 $msgUnderlinenever = htmlspecialchars( wfMsg ( 'underline-never' ) );
1186 $msgUnderlinealways = htmlspecialchars( wfMsg ( 'underline-always' ) );
1187 $msgUnderlinedefault = htmlspecialchars( wfMsg ( 'underline-default' ) );
1188 $uopt = $wgUser->getOption("underline");
1189 $s0 = $uopt == 0 ?
' selected="selected"' : '';
1190 $s1 = $uopt == 1 ?
' selected="selected"' : '';
1191 $s2 = $uopt == 2 ?
' selected="selected"' : '';
1193 <div class='toggle'><p><label for='wpOpunderline'>$msgUnderline</label>
1194 <select name='wpOpunderline' id='wpOpunderline'>
1195 <option value=\"0\"$s0>$msgUnderlinenever</option>
1196 <option value=\"1\"$s1>$msgUnderlinealways</option>
1197 <option value=\"2\"$s2>$msgUnderlinedefault</option>
1198 </select></p></div>");
1200 foreach ( $togs as $tname ) {
1201 if( !array_key_exists( $tname, $this->mUsedToggles
) ) {
1202 if( $tname == 'norollbackdiff' && $wgUser->isAllowed( 'rollback' ) )
1203 $wgOut->addHTML( $this->getToggle( $tname ) );
1205 $wgOut->addHTML( $this->getToggle( $tname ) );
1209 $wgOut->addHTML( '</fieldset>' );
1211 wfRunHooks( 'RenderPreferencesForm', array( $this, $wgOut ) );
1213 $token = htmlspecialchars( $wgUser->editToken() );
1214 $skin = $wgUser->getSkin();
1215 $rtl = $wgContLang->isRTL() ?
'left' : 'right';
1217 <table id='prefsubmit' cellpadding='0' width='100%' style='background:none;'><tr>
1218 <td><input type='submit' name='wpSaveprefs' class='btnSavePrefs' value=\"" . wfMsgHtml( 'saveprefs' ) .
1219 '"'.$skin->tooltipAndAccesskey('save')." />
1220 <input type='submit' name='wpReset' value=\"" . wfMsgHtml( 'resetprefs' ) . "\" /></td>
1221 <td align='$rtl'><input type='submit' name='wpRestore' value=\"" . wfMsgHtml( 'restoreprefs' ) . "\" /></td>
1224 <input type='hidden' name='wpEditToken' value=\"{$token}\" />
1227 $wgOut->addHTML( Xml
::tags( 'div', array( 'class' => "prefcache" ),
1228 wfMsgExt( 'clearyourcache', 'parseinline' ) )