Don't show header if including
[lhc/web/wiklou.git] / includes / specials / SpecialPreferences.php
1 <?php
2 /**
3 * Hold things related to displaying and saving user preferences.
4 * @file
5 * @ingroup SpecialPage
6 */
7
8 /**
9 * Entry point that create the "Preferences" object
10 */
11 function wfSpecialPreferences() {
12 global $wgRequest;
13
14 $form = new PreferencesForm( $wgRequest );
15 $form->execute();
16 }
17
18 /**
19 * Preferences form handling
20 * This object will show the preferences form and can save it as well.
21 * @ingroup SpecialPage
22 */
23 class PreferencesForm {
24 var $mQuickbar, $mOldpass, $mNewpass, $mRetypePass, $mStubs;
25 var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick;
26 var $mUserLanguage, $mUserVariant;
27 var $mSearch, $mRecent, $mRecentDays, $mHourDiff, $mSearchLines, $mSearchChars, $mAction;
28 var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize;
29 var $mUnderline, $mWatchlistEdits;
30
31 /**
32 * Constructor
33 * Load some values
34 */
35 function PreferencesForm( &$request ) {
36 global $wgContLang, $wgUser, $wgAllowRealName;
37
38 $this->mQuickbar = $request->getVal( 'wpQuickbar' );
39 $this->mOldpass = $request->getVal( 'wpOldpass' );
40 $this->mNewpass = $request->getVal( 'wpNewpass' );
41 $this->mRetypePass =$request->getVal( 'wpRetypePass' );
42 $this->mStubs = $request->getVal( 'wpStubs' );
43 $this->mRows = $request->getVal( 'wpRows' );
44 $this->mCols = $request->getVal( 'wpCols' );
45 $this->mSkin = $request->getVal( 'wpSkin' );
46 $this->mMath = $request->getVal( 'wpMath' );
47 $this->mDate = $request->getVal( 'wpDate' );
48 $this->mUserEmail = $request->getVal( 'wpUserEmail' );
49 $this->mRealName = $wgAllowRealName ? $request->getVal( 'wpRealName' ) : '';
50 $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 0 : 1;
51 $this->mNick = $request->getVal( 'wpNick' );
52 $this->mUserLanguage = $request->getVal( 'wpUserLanguage' );
53 $this->mUserVariant = $request->getVal( 'wpUserVariant' );
54 $this->mSearch = $request->getVal( 'wpSearch' );
55 $this->mRecent = $request->getVal( 'wpRecent' );
56 $this->mRecentDays = $request->getVal( 'wpRecentDays' );
57 $this->mHourDiff = $request->getVal( 'wpHourDiff' );
58 $this->mSearchLines = $request->getVal( 'wpSearchLines' );
59 $this->mSearchChars = $request->getVal( 'wpSearchChars' );
60 $this->mImageSize = $request->getVal( 'wpImageSize' );
61 $this->mThumbSize = $request->getInt( 'wpThumbSize' );
62 $this->mUnderline = $request->getInt( 'wpOpunderline' );
63 $this->mAction = $request->getVal( 'action' );
64 $this->mReset = $request->getCheck( 'wpReset' );
65 $this->mPosted = $request->wasPosted();
66 $this->mSuccess = $request->getCheck( 'success' );
67 $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' );
68 $this->mWatchlistEdits = $request->getVal( 'wpWatchlistEdits' );
69 $this->mDisableMWSuggest = $request->getCheck( 'wpDisableMWSuggest' );
70
71 $this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) &&
72 $this->mPosted &&
73 $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) );
74
75 # User toggles (the big ugly unsorted list of checkboxes)
76 $this->mToggles = array();
77 if ( $this->mPosted ) {
78 $togs = User::getToggles();
79 foreach ( $togs as $tname ) {
80 $this->mToggles[$tname] = $request->getCheck( "wpOp$tname" ) ? 1 : 0;
81 }
82 }
83
84 $this->mUsedToggles = array();
85
86 # Search namespace options
87 # Note: namespaces don't necessarily have consecutive keys
88 $this->mSearchNs = array();
89 if ( $this->mPosted ) {
90 $namespaces = $wgContLang->getNamespaces();
91 foreach ( $namespaces as $i => $namespace ) {
92 if ( $i >= 0 ) {
93 $this->mSearchNs[$i] = $request->getCheck( "wpNs$i" ) ? 1 : 0;
94 }
95 }
96 }
97
98 # Validate language
99 if ( !preg_match( '/^[a-z\-]*$/', $this->mUserLanguage ) ) {
100 $this->mUserLanguage = 'nolanguage';
101 }
102
103 wfRunHooks( 'InitPreferencesForm', array( $this, $request ) );
104 }
105
106 function execute() {
107 global $wgUser, $wgOut, $wgTitle;
108
109 if ( $wgUser->isAnon() ) {
110 $wgOut->showErrorPage( 'prefsnologin', 'prefsnologintext', array($wgTitle->getPrefixedDBkey()) );
111 return;
112 }
113 if ( wfReadOnly() ) {
114 $wgOut->readOnlyPage();
115 return;
116 }
117 if ( $this->mReset ) {
118 $this->resetPrefs();
119 $this->mainPrefsForm( 'reset', wfMsg( 'prefsreset' ) );
120 } else if ( $this->mSaveprefs ) {
121 $this->savePreferences();
122 } else {
123 $this->resetPrefs();
124 $this->mainPrefsForm( '' );
125 }
126 }
127
128 /**
129 * @access private
130 */
131 function savePreferences() {
132 global $wgUser, $wgOut, $wgParser;
133 global $wgEnableUserEmail, $wgEnableEmail;
134 global $wgEmailAuthentication, $wgRCMaxAge;
135 global $wgAuth, $wgEmailConfirmToEdit;
136
137
138 if ( ($this->mNewpass !== '' || $this->mOldpass !== '' ) && $wgAuth->allowPasswordChange() ) {
139 if ( $this->mNewpass != $this->mRetypePass ) {
140 wfRunHooks( 'PrefsPasswordAudit', array( $wgUser, $this->mNewpass, 'badretype' ) );
141 $this->mainPrefsForm( 'error', wfMsg( 'badretype' ) );
142 return;
143 }
144
145 if (!$wgUser->checkPassword( $this->mOldpass )) {
146 wfRunHooks( 'PrefsPasswordAudit', array( $wgUser, $this->mNewpass, 'wrongpassword' ) );
147 $this->mainPrefsForm( 'error', wfMsg( 'wrongpassword' ) );
148 return;
149 }
150
151 try {
152 $wgUser->setPassword( $this->mNewpass );
153 wfRunHooks( 'PrefsPasswordAudit', array( $wgUser, $this->mNewpass, 'success' ) );
154 $this->mNewpass = $this->mOldpass = $this->mRetypePass = '';
155 } catch( PasswordError $e ) {
156 wfRunHooks( 'PrefsPasswordAudit', array( $wgUser, $this->mNewpass, 'error' ) );
157 $this->mainPrefsForm( 'error', $e->getMessage() );
158 return;
159 }
160 }
161 $wgUser->setRealName( $this->mRealName );
162 $oldOptions = $wgUser->mOptions;
163
164 if( $wgUser->getOption( 'language' ) !== $this->mUserLanguage ) {
165 $needRedirect = true;
166 } else {
167 $needRedirect = false;
168 }
169
170 # Validate the signature and clean it up as needed
171 global $wgMaxSigChars;
172 if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) {
173 global $wgLang;
174 $this->mainPrefsForm( 'error',
175 wfMsgExt( 'badsiglength', 'parsemag', $wgLang->formatNum( $wgMaxSigChars ) ) );
176 return;
177 } elseif( $this->mToggles['fancysig'] ) {
178 if( $wgParser->validateSig( $this->mNick ) !== false ) {
179 $this->mNick = $wgParser->cleanSig( $this->mNick );
180 } else {
181 $this->mainPrefsForm( 'error', wfMsg( 'badsig' ) );
182 return;
183 }
184 } else {
185 // When no fancy sig used, make sure ~{3,5} get removed.
186 $this->mNick = $wgParser->cleanSigInSig( $this->mNick );
187 }
188
189 $wgUser->setOption( 'language', $this->mUserLanguage );
190 $wgUser->setOption( 'variant', $this->mUserVariant );
191 $wgUser->setOption( 'nickname', $this->mNick );
192 $wgUser->setOption( 'quickbar', $this->mQuickbar );
193 $wgUser->setOption( 'skin', $this->mSkin );
194 global $wgUseTeX;
195 if( $wgUseTeX ) {
196 $wgUser->setOption( 'math', $this->mMath );
197 }
198 $wgUser->setOption( 'date', Validate::dateFormat( $this->mDate ) );
199 $wgUser->setOption( 'searchlimit', Validate::intOrNull( $this->mSearch ) );
200 $wgUser->setOption( 'contextlines', Validate::intOrNull( $this->mSearchLines ) );
201 $wgUser->setOption( 'contextchars', Validate::intOrNull( $this->mSearchChars ) );
202 $wgUser->setOption( 'rclimit', Validate::intOrNull( $this->mRecent ) );
203 $wgUser->setOption( 'rcdays', Validate::int($this->mRecentDays, 1, ceil($wgRCMaxAge / (3600*24))));
204 $wgUser->setOption( 'wllimit', Validate::intOrNull( $this->mWatchlistEdits, 0, 1000 ) );
205 $wgUser->setOption( 'rows', Validate::int( $this->mRows, 4, 1000 ) );
206 $wgUser->setOption( 'cols', Validate::int( $this->mCols, 4, 1000 ) );
207 $wgUser->setOption( 'stubthreshold', Validate::intOrNull( $this->mStubs ) );
208 $wgUser->setOption( 'timecorrection', Validate::timeZone( $this->mHourDiff, -12, 14 ) );
209 $wgUser->setOption( 'imagesize', $this->mImageSize );
210 $wgUser->setOption( 'thumbsize', $this->mThumbSize );
211 $wgUser->setOption( 'underline', Validate::int($this->mUnderline, 0, 2) );
212 $wgUser->setOption( 'watchlistdays', Validate::float( $this->mWatchlistDays, 0, 7 ) );
213 $wgUser->setOption( 'disablesuggest', $this->mDisableMWSuggest );
214
215 # Set search namespace options
216 foreach( $this->mSearchNs as $i => $value ) {
217 $wgUser->setOption( "searchNs{$i}", $value );
218 }
219
220 if( $wgEnableEmail && $wgEnableUserEmail ) {
221 $wgUser->setOption( 'disablemail', $this->mEmailFlag );
222 }
223
224 # Set user toggles
225 foreach ( $this->mToggles as $tname => $tvalue ) {
226 $wgUser->setOption( $tname, $tvalue );
227 }
228
229 $error = false;
230 if( $wgEnableEmail ) {
231 $newadr = $this->mUserEmail;
232 $oldadr = $wgUser->getEmail();
233 if( ($newadr != '') && ($newadr != $oldadr) ) {
234 # the user has supplied a new email address on the login page
235 if( $wgUser->isValidEmailAddr( $newadr ) ) {
236 # new behaviour: set this new emailaddr from login-page into user database record
237 $wgUser->setEmail( $newadr );
238 # but flag as "dirty" = unauthenticated
239 $wgUser->invalidateEmail();
240 if ($wgEmailAuthentication) {
241 # Mail a temporary password to the dirty address.
242 # User can come back through the confirmation URL to re-enable email.
243 $result = $wgUser->sendConfirmationMail();
244 if( WikiError::isError( $result ) ) {
245 $error = wfMsg( 'mailerror', htmlspecialchars( $result->getMessage() ) );
246 } else {
247 $error = wfMsg( 'eauthentsent', $wgUser->getName() );
248 }
249 }
250 } else {
251 $error = wfMsg( 'invalidemailaddress' );
252 }
253 } else {
254 if( $wgEmailConfirmToEdit && empty( $newadr ) ) {
255 $this->mainPrefsForm( 'error', wfMsg( 'noemailtitle' ) );
256 return;
257 }
258 $wgUser->setEmail( $this->mUserEmail );
259 }
260 if( $oldadr != $newadr ) {
261 wfRunHooks( 'PrefsEmailAudit', array( $wgUser, $oldadr, $newadr ) );
262 }
263 }
264
265 if( !$wgAuth->updateExternalDB( $wgUser ) ){
266 $this->mainPrefsForm( 'error', wfMsg( 'externaldberror' ) );
267 return;
268 }
269
270 $msg = '';
271 if ( !wfRunHooks( 'SavePreferences', array( $this, $wgUser, &$msg, $oldOptions ) ) ) {
272 $this->mainPrefsForm( 'error', $msg );
273 return;
274 }
275
276 $wgUser->setCookies();
277 $wgUser->saveSettings();
278
279 if( $needRedirect && $error === false ) {
280 $title = SpecialPage::getTitleFor( 'Preferences' );
281 $wgOut->redirect( $title->getFullURL( 'success' ) );
282 return;
283 }
284
285 $wgOut->parserOptions( ParserOptions::newFromUser( $wgUser ) );
286 $this->mainPrefsForm( $error === false ? 'success' : 'error', $error);
287 }
288
289 /**
290 * @access private
291 */
292 function resetPrefs() {
293 global $wgUser, $wgLang, $wgContLang, $wgContLanguageCode, $wgAllowRealName;
294
295 $this->mOldpass = $this->mNewpass = $this->mRetypePass = '';
296 $this->mUserEmail = $wgUser->getEmail();
297 $this->mUserEmailAuthenticationtimestamp = $wgUser->getEmailAuthenticationtimestamp();
298 $this->mRealName = ($wgAllowRealName) ? $wgUser->getRealName() : '';
299
300 # language value might be blank, default to content language
301 $this->mUserLanguage = $wgUser->getOption( 'language', $wgContLanguageCode );
302
303 $this->mUserVariant = $wgUser->getOption( 'variant');
304 $this->mEmailFlag = $wgUser->getOption( 'disablemail' ) == 1 ? 1 : 0;
305 $this->mNick = $wgUser->getOption( 'nickname' );
306
307 $this->mQuickbar = $wgUser->getOption( 'quickbar' );
308 $this->mSkin = Skin::normalizeKey( $wgUser->getOption( 'skin' ) );
309 $this->mMath = $wgUser->getOption( 'math' );
310 $this->mDate = $wgUser->getDatePreference();
311 $this->mRows = $wgUser->getOption( 'rows' );
312 $this->mCols = $wgUser->getOption( 'cols' );
313 $this->mStubs = $wgUser->getOption( 'stubthreshold' );
314 $this->mHourDiff = $wgUser->getOption( 'timecorrection' );
315 $this->mSearch = $wgUser->getOption( 'searchlimit' );
316 $this->mSearchLines = $wgUser->getOption( 'contextlines' );
317 $this->mSearchChars = $wgUser->getOption( 'contextchars' );
318 $this->mImageSize = $wgUser->getOption( 'imagesize' );
319 $this->mThumbSize = $wgUser->getOption( 'thumbsize' );
320 $this->mRecent = $wgUser->getOption( 'rclimit' );
321 $this->mRecentDays = $wgUser->getOption( 'rcdays' );
322 $this->mWatchlistEdits = $wgUser->getOption( 'wllimit' );
323 $this->mUnderline = $wgUser->getOption( 'underline' );
324 $this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' );
325 $this->mDisableMWSuggest = $wgUser->getBoolOption( 'disablesuggest' );
326
327 $togs = User::getToggles();
328 foreach ( $togs as $tname ) {
329 $this->mToggles[$tname] = $wgUser->getOption( $tname );
330 }
331
332 $namespaces = $wgContLang->getNamespaces();
333 foreach ( $namespaces as $i => $namespace ) {
334 if ( $i >= NS_MAIN ) {
335 $this->mSearchNs[$i] = $wgUser->getOption( 'searchNs'.$i );
336 }
337 }
338
339 wfRunHooks( 'ResetPreferences', array( $this, $wgUser ) );
340 }
341
342 /**
343 * @access private
344 */
345 function namespacesCheckboxes() {
346 global $wgContLang;
347
348 # Determine namespace checkboxes
349 $namespaces = $wgContLang->getNamespaces();
350 $r1 = null;
351
352 foreach ( $namespaces as $i => $name ) {
353 if ($i < 0)
354 continue;
355 $checked = $this->mSearchNs[$i] ? "checked='checked'" : '';
356 $name = str_replace( '_', ' ', $namespaces[$i] );
357
358 if ( empty($name) )
359 $name = wfMsg( 'blanknamespace' );
360
361 $r1 .= "<input type='checkbox' value='1' name='wpNs$i' id='wpNs$i' {$checked}/> <label for='wpNs$i'>{$name}</label><br />\n";
362 }
363 return $r1;
364 }
365
366
367 function getToggle( $tname, $trailer = false, $disabled = false ) {
368 global $wgUser, $wgLang;
369
370 $this->mUsedToggles[$tname] = true;
371 $ttext = $wgLang->getUserToggle( $tname );
372
373 $checked = $wgUser->getOption( $tname ) == 1 ? ' checked="checked"' : '';
374 $disabled = $disabled ? ' disabled="disabled"' : '';
375 $trailer = $trailer ? $trailer : '';
376 return "<div class='toggle'><input type='checkbox' value='1' id=\"$tname\" name=\"wpOp$tname\"$checked$disabled />" .
377 " <span class='toggletext'><label for=\"$tname\">$ttext</label>$trailer</span></div>\n";
378 }
379
380 function getToggles( $items ) {
381 $out = "";
382 foreach( $items as $item ) {
383 if( $item === false )
384 continue;
385 if( is_array( $item ) ) {
386 list( $key, $trailer ) = $item;
387 } else {
388 $key = $item;
389 $trailer = false;
390 }
391 $out .= $this->getToggle( $key, $trailer );
392 }
393 return $out;
394 }
395
396 function addRow($td1, $td2) {
397 return "<tr><td class='mw-label'>$td1</td><td class='mw-input'>$td2</td></tr>";
398 }
399
400 /**
401 * Helper function for user information panel
402 * @param $td1 label for an item
403 * @param $td2 item or null
404 * @param $td3 optional help or null
405 * @return xhtml block
406 */
407 function tableRow( $td1, $td2 = null, $td3 = null ) {
408
409 if ( is_null( $td3 ) ) {
410 $td3 = '';
411 } else {
412 $td3 = Xml::tags( 'tr', null,
413 Xml::tags( 'td', array( 'class' => 'pref-label', 'colspan' => '2' ), $td3 )
414 );
415 }
416
417 if ( is_null( $td2 ) ) {
418 $td1 = Xml::tags( 'td', array( 'class' => 'pref-label', 'colspan' => '2' ), $td1 );
419 $td2 = '';
420 } else {
421 $td1 = Xml::tags( 'td', array( 'class' => 'pref-label' ), $td1 );
422 $td2 = Xml::tags( 'td', array( 'class' => 'pref-input' ), $td2 );
423 }
424
425 return Xml::tags( 'tr', null, $td1 . $td2 ). $td3 . "\n";
426
427 }
428
429 /**
430 * @access private
431 */
432 function mainPrefsForm( $status , $message = '' ) {
433 global $wgUser, $wgOut, $wgLang, $wgContLang, $wgAuth;
434 global $wgAllowRealName, $wgImageLimits, $wgThumbLimits;
435 global $wgDisableLangConversion, $wgDisableTitleConversion;
436 global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits;
437 global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress;
438 global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication;
439 global $wgContLanguageCode, $wgDefaultSkin, $wgCookieExpiration;
440 global $wgEmailConfirmToEdit, $wgEnableMWSuggest;
441
442 $wgOut->setPageTitle( wfMsg( 'preferences' ) );
443 $wgOut->setArticleRelated( false );
444 $wgOut->setRobotPolicy( 'noindex,nofollow' );
445 $wgOut->addScriptFile( 'prefs.js' );
446
447 $wgOut->disallowUserJs(); # Prevent hijacked user scripts from sniffing passwords etc.
448
449 if ( $this->mSuccess || 'success' == $status ) {
450 $wgOut->wrapWikiMsg( '<div class="successbox"><strong>$1</strong></div>', 'savedprefs' );
451 } else if ( 'error' == $status ) {
452 $wgOut->addWikiText( '<div class="errorbox"><strong>' . $message . '</strong></div>' );
453 } else if ( '' != $status ) {
454 $wgOut->addWikiText( $message . "\n----" );
455 }
456
457 $qbs = $wgLang->getQuickbarSettings();
458 $skinNames = $wgLang->getSkinNames();
459 $mathopts = $wgLang->getMathNames();
460 $dateopts = $wgLang->getDatePreferences();
461 $togs = User::getToggles();
462
463 $titleObj = SpecialPage::getTitleFor( 'Preferences' );
464
465 # Pre-expire some toggles so they won't show if disabled
466 $this->mUsedToggles[ 'shownumberswatching' ] = true;
467 $this->mUsedToggles[ 'showupdated' ] = true;
468 $this->mUsedToggles[ 'enotifwatchlistpages' ] = true;
469 $this->mUsedToggles[ 'enotifusertalkpages' ] = true;
470 $this->mUsedToggles[ 'enotifminoredits' ] = true;
471 $this->mUsedToggles[ 'enotifrevealaddr' ] = true;
472 $this->mUsedToggles[ 'ccmeonemails' ] = true;
473 $this->mUsedToggles[ 'uselivepreview' ] = true;
474 $this->mUsedToggles[ 'noconvertlink' ] = true;
475
476
477 if ( !$this->mEmailFlag ) { $emfc = 'checked="checked"'; }
478 else { $emfc = ''; }
479
480
481 if ($wgEmailAuthentication && ($this->mUserEmail != '') ) {
482 if( $wgUser->getEmailAuthenticationTimestamp() ) {
483 // date and time are separate parameters to facilitate localisation.
484 // $time is kept for backward compat reasons.
485 // 'emailauthenticated' is also used in SpecialConfirmemail.php
486 $time = $wgLang->timeAndDate( $wgUser->getEmailAuthenticationTimestamp(), true );
487 $d = $wgLang->date( $wgUser->getEmailAuthenticationTimestamp(), true );
488 $t = $wgLang->time( $wgUser->getEmailAuthenticationTimestamp(), true );
489 $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'<br />';
490 $disableEmailPrefs = false;
491 } else {
492 $disableEmailPrefs = true;
493 $skin = $wgUser->getSkin();
494 $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
495 $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
496 wfMsg( 'emailconfirmlink' ) ) . '<br />';
497 }
498 } else {
499 $emailauthenticated = '';
500 $disableEmailPrefs = false;
501 }
502
503 if ($this->mUserEmail == '') {
504 $emailauthenticated = wfMsg( 'noemailprefs' ) . '<br />';
505 }
506
507 $ps = $this->namespacesCheckboxes();
508
509 $enotifwatchlistpages = ($wgEnotifWatchlist) ? $this->getToggle( 'enotifwatchlistpages', false, $disableEmailPrefs ) : '';
510 $enotifusertalkpages = ($wgEnotifUserTalk) ? $this->getToggle( 'enotifusertalkpages', false, $disableEmailPrefs ) : '';
511 $enotifminoredits = ($wgEnotifWatchlist && $wgEnotifMinorEdits) ? $this->getToggle( 'enotifminoredits', false, $disableEmailPrefs ) : '';
512 $enotifrevealaddr = (($wgEnotifWatchlist || $wgEnotifUserTalk) && $wgEnotifRevealEditorAddress) ? $this->getToggle( 'enotifrevealaddr', false, $disableEmailPrefs ) : '';
513
514 # </FIXME>
515
516 $wgOut->addHTML(
517 Xml::openElement( 'form', array(
518 'action' => $titleObj->getLocalUrl(),
519 'method' => 'post',
520 'id' => 'mw-preferences-form',
521 ) ) .
522 Xml::openElement( 'div', array( 'id' => 'preferences' ) )
523 );
524
525 # User data
526
527 $wgOut->addHTML(
528 Xml::fieldset( wfMsg('prefs-personal') ) .
529 Xml::openElement( 'table' ) .
530 $this->tableRow( Xml::element( 'h2', null, wfMsg( 'prefs-personal' ) ) )
531 );
532
533 # Get groups to which the user belongs
534 $userEffectiveGroups = $wgUser->getEffectiveGroups();
535 $userEffectiveGroupsArray = array();
536 foreach( $userEffectiveGroups as $ueg ) {
537 if( $ueg == '*' ) {
538 // Skip the default * group, seems useless here
539 continue;
540 }
541 $userEffectiveGroupsArray[] = User::makeGroupLinkHTML( $ueg );
542 }
543 asort( $userEffectiveGroupsArray );
544
545 $sk = $wgUser->getSkin();
546 $toolLinks = array();
547 $toolLinks[] = $sk->makeKnownLinkObj( SpecialPage::getTitleFor( 'ListGroupRights' ), wfMsg( 'listgrouprights' ) );
548 # At the moment one tool link only but be prepared for the future...
549 # FIXME: Add a link to Special:Userrights for users who are allowed to use it.
550 # $wgUser->isAllowed( 'userrights' ) seems to strict in some cases
551
552 $userInformationHtml =
553 $this->tableRow( wfMsgHtml( 'username' ), htmlspecialchars( $wgUser->getName() ) ) .
554 $this->tableRow( wfMsgHtml( 'uid' ), $wgLang->formatNum( htmlspecialchars( $wgUser->getId() ) ) ).
555
556 $this->tableRow(
557 wfMsgExt( 'prefs-memberingroups', array( 'parseinline' ), count( $userEffectiveGroupsArray ) ),
558 $wgLang->commaList( $userEffectiveGroupsArray ) .
559 '<br />(' . implode( ' | ', $toolLinks ) . ')'
560 ) .
561
562 $this->tableRow(
563 wfMsgHtml( 'prefs-edits' ),
564 $wgLang->formatNum( $wgUser->getEditCount() )
565 );
566
567 if( wfRunHooks( 'PreferencesUserInformationPanel', array( $this, &$userInformationHtml ) ) ) {
568 $wgOut->addHtml( $userInformationHtml );
569 }
570
571 if ( $wgAllowRealName ) {
572 $wgOut->addHTML(
573 $this->tableRow(
574 Xml::label( wfMsg('yourrealname'), 'wpRealName' ),
575 Xml::input( 'wpRealName', 25, $this->mRealName, array( 'id' => 'wpRealName' ) ),
576 Xml::tags('div', array( 'class' => 'prefsectiontip' ),
577 wfMsgExt( 'prefs-help-realname', 'parseinline' )
578 )
579 )
580 );
581 }
582 if ( $wgEnableEmail ) {
583 $wgOut->addHTML(
584 $this->tableRow(
585 Xml::label( wfMsg('youremail'), 'wpUserEmail' ),
586 Xml::input( 'wpUserEmail', 25, $this->mUserEmail, array( 'id' => 'wpUserEmail' ) ),
587 Xml::tags('div', array( 'class' => 'prefsectiontip' ),
588 wfMsgExt( $wgEmailConfirmToEdit ? 'prefs-help-email-required' : 'prefs-help-email', 'parseinline' )
589 )
590 )
591 );
592 }
593
594 global $wgParser, $wgMaxSigChars;
595 if( mb_strlen( $this->mNick ) > $wgMaxSigChars ) {
596 $invalidSig = $this->tableRow(
597 '&nbsp;',
598 Xml::element( 'span', array( 'class' => 'error' ),
599 wfMsgExt( 'badsiglength', 'parsemag', $wgLang->formatNum( $wgMaxSigChars ) ) )
600 );
601 } elseif( !empty( $this->mToggles['fancysig'] ) &&
602 false === $wgParser->validateSig( $this->mNick ) ) {
603 $invalidSig = $this->tableRow(
604 '&nbsp;',
605 Xml::element( 'span', array( 'class' => 'error' ), wfMsg( 'badsig' ) )
606 );
607 } else {
608 $invalidSig = '';
609 }
610
611 $wgOut->addHTML(
612 $this->tableRow(
613 Xml::label( wfMsg( 'yournick' ), 'wpNick' ),
614 Xml::input( 'wpNick', 25, $this->mNick,
615 array(
616 'id' => 'wpNick',
617 // Note: $wgMaxSigChars is enforced in Unicode characters,
618 // both on the backend and now in the browser.
619 // Badly-behaved requests may still try to submit
620 // an overlong string, however.
621 'maxlength' => $wgMaxSigChars ) )
622 ) .
623 $invalidSig .
624 $this->tableRow( '&nbsp;', $this->getToggle( 'fancysig' ) )
625 );
626
627 list( $lsLabel, $lsSelect) = Xml::languageSelector( $this->mUserLanguage );
628 $wgOut->addHTML(
629 $this->tableRow( $lsLabel, $lsSelect )
630 );
631
632 /* see if there are multiple language variants to choose from*/
633 if(!$wgDisableLangConversion) {
634 $variants = $wgContLang->getVariants();
635 $variantArray = array();
636
637 $languages = Language::getLanguageNames( true );
638 foreach($variants as $v) {
639 $v = str_replace( '_', '-', strtolower($v));
640 if( array_key_exists( $v, $languages ) ) {
641 // If it doesn't have a name, we'll pretend it doesn't exist
642 $variantArray[$v] = $languages[$v];
643 }
644 }
645
646 $options = "\n";
647 foreach( $variantArray as $code => $name ) {
648 $selected = ($code == $this->mUserVariant);
649 $options .= Xml::option( "$code - $name", $code, $selected ) . "\n";
650 }
651
652 if(count($variantArray) > 1) {
653 $wgOut->addHtml(
654 $this->tableRow(
655 Xml::label( wfMsg( 'yourvariant' ), 'wpUserVariant' ),
656 Xml::tags( 'select',
657 array( 'name' => 'wpUserVariant', 'id' => 'wpUserVariant' ),
658 $options
659 )
660 )
661 );
662 }
663
664 if(count($variantArray) > 1 && !$wgDisableLangConversion && !$wgDisableTitleConversion) {
665 $wgOut->addHtml(
666 Xml::tags( 'tr', null,
667 Xml::tags( 'td', array( 'colspan' => '2' ),
668 $this->getToggle( "noconvertlink" )
669 )
670 )
671 );
672 }
673 }
674
675 # Password
676 if( $wgAuth->allowPasswordChange() ) {
677 $wgOut->addHTML(
678 $this->tableRow( Xml::element( 'h2', null, wfMsg( 'changepassword' ) ) ) .
679 $this->tableRow(
680 Xml::label( wfMsg( 'oldpassword' ), 'wpOldpass' ),
681 Xml::password( 'wpOldpass', 25, $this->mOldpass, array( 'id' => 'wpOldpass' ) )
682 ) .
683 $this->tableRow(
684 Xml::label( wfMsg( 'newpassword' ), 'wpNewpass' ),
685 Xml::password( 'wpNewpass', 25, $this->mNewpass, array( 'id' => 'wpNewpass' ) )
686 ) .
687 $this->tableRow(
688 Xml::label( wfMsg( 'retypenew' ), 'wpRetypePass' ),
689 Xml::password( 'wpRetypePass', 25, $this->mRetypePass, array( 'id' => 'wpRetypePass' ) )
690 )
691 );
692 if( $wgCookieExpiration > 0 ){
693 $wgOut->addHTML(
694 Xml::tags( 'tr', null,
695 Xml::tags( 'td', array( 'colspan' => '2' ),
696 $this->getToggle( "rememberpassword" )
697 )
698 )
699 );
700 } else {
701 $this->mUsedToggles['rememberpassword'] = true;
702 }
703 }
704
705 # <FIXME>
706 # Enotif
707 if ( $wgEnableEmail ) {
708
709 $moreEmail = '';
710 if ($wgEnableUserEmail) {
711 // fixme -- the "allowemail" pseudotoggle is a hacked-together
712 // inversion for the "disableemail" preference.
713 $emf = wfMsg( 'allowemail' );
714 $disabled = $disableEmailPrefs ? ' disabled="disabled"' : '';
715 $moreEmail =
716 "<input type='checkbox' $emfc $disabled value='1' name='wpEmailFlag' id='wpEmailFlag' /> <label for='wpEmailFlag'>$emf</label>" .
717 $this->getToggle( 'ccmeonemails', '', $disableEmailPrefs );
718 }
719
720
721 $wgOut->addHTML(
722 $this->tableRow( Xml::element( 'h2', null, wfMsg( 'email' ) ) ) .
723 $this->tableRow(
724 $emailauthenticated.
725 $enotifrevealaddr.
726 $enotifwatchlistpages.
727 $enotifusertalkpages.
728 $enotifminoredits.
729 $moreEmail
730 )
731 );
732 }
733 # </FIXME>
734
735 $wgOut->addHTML(
736 Xml::closeElement( 'table' ) .
737 Xml::closeElement( 'fieldset' )
738 );
739
740
741 # Quickbar
742 #
743 if ($this->mSkin == 'cologneblue' || $this->mSkin == 'standard') {
744 $wgOut->addHtml( "<fieldset>\n<legend>" . wfMsg( 'qbsettings' ) . "</legend>\n" );
745 for ( $i = 0; $i < count( $qbs ); ++$i ) {
746 if ( $i == $this->mQuickbar ) { $checked = ' checked="checked"'; }
747 else { $checked = ""; }
748 $wgOut->addHTML( "<div><label><input type='radio' name='wpQuickbar' value=\"$i\"$checked />{$qbs[$i]}</label></div>\n" );
749 }
750 $wgOut->addHtml( "</fieldset>\n\n" );
751 } else {
752 # Need to output a hidden option even if the relevant skin is not in use,
753 # otherwise the preference will get reset to 0 on submit
754 $wgOut->addHtml( wfHidden( 'wpQuickbar', $this->mQuickbar ) );
755 }
756
757 # Skin
758 #
759 $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\n" );
760 $mptitle = Title::newMainPage();
761 $previewtext = wfMsg('skin-preview');
762 # Only show members of Skin::getSkinNames() rather than
763 # $skinNames (skins is all skin names from Language.php)
764 $validSkinNames = Skin::getUsableSkins();
765 # Sort by UI skin name. First though need to update validSkinNames as sometimes
766 # the skinkey & UI skinname differ (e.g. "standard" skinkey is "Classic" in the UI).
767 foreach ($validSkinNames as $skinkey => & $skinname ) {
768 if ( isset( $skinNames[$skinkey] ) ) {
769 $skinname = $skinNames[$skinkey];
770 }
771 }
772 asort($validSkinNames);
773 foreach ($validSkinNames as $skinkey => $sn ) {
774 $checked = $skinkey == $this->mSkin ? ' checked="checked"' : '';
775
776 $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey"));
777 $previewlink = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
778 if( $skinkey == $wgDefaultSkin )
779 $sn .= ' (' . wfMsg( 'default' ) . ')';
780 $wgOut->addHTML( "<input type='radio' name='wpSkin' id=\"wpSkin$skinkey\" value=\"$skinkey\"$checked /> <label for=\"wpSkin$skinkey\">{$sn}</label> $previewlink<br />\n" );
781 }
782 $wgOut->addHTML( "</fieldset>\n\n" );
783
784 # Math
785 #
786 global $wgUseTeX;
787 if( $wgUseTeX ) {
788 $wgOut->addHTML( "<fieldset>\n<legend>" . wfMsg('math') . '</legend>' );
789 foreach ( $mathopts as $k => $v ) {
790 $checked = ($k == $this->mMath);
791 $wgOut->addHTML(
792 Xml::openElement( 'div' ) .
793 Xml::radioLabel( wfMsg( $v ), 'wpMath', $k, "mw-sp-math-$k", $checked ) .
794 Xml::closeElement( 'div' ) . "\n"
795 );
796 }
797 $wgOut->addHTML( "</fieldset>\n\n" );
798 }
799
800 # Files
801 #
802 $wgOut->addHTML(
803 "<fieldset>\n" . Xml::element( 'legend', null, wfMsg( 'files' ) ) . "\n"
804 );
805
806 $imageLimitOptions = null;
807 foreach ( $wgImageLimits as $index => $limits ) {
808 $selected = ($index == $this->mImageSize);
809 $imageLimitOptions .= Xml::option( "{$limits[0]}×{$limits[1]}" .
810 wfMsg('unit-pixel'), $index, $selected );
811 }
812
813 $imageSizeId = 'wpImageSize';
814 $wgOut->addHTML(
815 "<div>" . Xml::label( wfMsg('imagemaxsize'), $imageSizeId ) . " " .
816 Xml::openElement( 'select', array( 'name' => $imageSizeId, 'id' => $imageSizeId ) ) .
817 $imageLimitOptions .
818 Xml::closeElement( 'select' ) . "</div>\n"
819 );
820
821 $imageThumbOptions = null;
822 foreach ( $wgThumbLimits as $index => $size ) {
823 $selected = ($index == $this->mThumbSize);
824 $imageThumbOptions .= Xml::option($size . wfMsg('unit-pixel'), $index,
825 $selected);
826 }
827
828 $thumbSizeId = 'wpThumbSize';
829 $wgOut->addHTML(
830 "<div>" . Xml::label( wfMsg('thumbsize'), $thumbSizeId ) . " " .
831 Xml::openElement( 'select', array( 'name' => $thumbSizeId, 'id' => $thumbSizeId ) ) .
832 $imageThumbOptions .
833 Xml::closeElement( 'select' ) . "</div>\n"
834 );
835
836 $wgOut->addHTML( "</fieldset>\n\n" );
837
838 # Date format
839 #
840 # Date/Time
841 #
842
843 $wgOut->addHTML(
844 Xml::openElement( 'fieldset' ) .
845 Xml::element( 'legend', null, wfMsg( 'datetime' ) ) . "\n"
846 );
847
848 if ($dateopts) {
849 $wgOut->addHTML(
850 Xml::openElement( 'fieldset' ) .
851 Xml::element( 'legend', null, wfMsg( 'dateformat' ) ) . "\n"
852 );
853 $idCnt = 0;
854 $epoch = '20010115161234'; # Wikipedia day
855 foreach( $dateopts as $key ) {
856 if( $key == 'default' ) {
857 $formatted = wfMsg( 'datedefault' );
858 } else {
859 $formatted = $wgLang->timeanddate( $epoch, false, $key );
860 }
861 $wgOut->addHTML(
862 Xml::tags( 'div', null,
863 Xml::radioLabel( $formatted, 'wpDate', $key, "wpDate$idCnt", $key == $this->mDate )
864 ) . "\n"
865 );
866 $idCnt++;
867 }
868 $wgOut->addHTML( Xml::closeElement( 'fieldset' ) . "\n" );
869 }
870
871 $nowlocal = $wgLang->time( $now = wfTimestampNow(), true );
872 $nowserver = $wgLang->time( $now, false );
873
874 $wgOut->addHTML(
875 Xml::openElement( 'fieldset' ) .
876 Xml::element( 'legend', null, wfMsg( 'timezonelegend' ) ) .
877 Xml::openElement( 'table' ) .
878 $this->addRow( wfMsg( 'servertime' ), $nowserver ) .
879 $this->addRow( wfMsg( 'localtime' ), $nowlocal ) .
880 $this->addRow(
881 Xml::label( wfMsg( 'timezoneoffset' ), 'wpHourDiff' ),
882 Xml::input( 'wpHourDiff', 6, $this->mHourDiff, array( 'id' => 'wpHourDiff' ) ) ) .
883 "<tr>
884 <td></td>
885 <td class='mw-submit'>" .
886 Xml::element( 'input',
887 array( 'type' => 'button',
888 'value' => wfMsg( 'guesstimezone' ),
889 'onclick' => 'javascript:guessTimezone()',
890 'id' => 'guesstimezonebutton',
891 'style' => 'display:none;' ) ) .
892 "</td>
893 </tr>" .
894 Xml::closeElement( 'table' ) .
895 Xml::tags( 'div', array( 'class' => 'prefsectiontip' ), wfMsgExt( 'timezonetext', 'parseinline' ) ).
896 Xml::closeElement( 'fieldset' ) .
897 Xml::closeElement( 'fieldset' ) . "\n\n"
898 );
899
900 # Editing
901 #
902 global $wgLivePreview;
903 $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'textboxsize' ) . '</legend>
904 <div>' .
905 wfInputLabel( wfMsg( 'rows' ), 'wpRows', 'wpRows', 3, $this->mRows ) .
906 ' ' .
907 wfInputLabel( wfMsg( 'columns' ), 'wpCols', 'wpCols', 3, $this->mCols ) .
908 "</div>" .
909 $this->getToggles( array(
910 'editsection',
911 'editsectiononrightclick',
912 'editondblclick',
913 'editwidth',
914 'showtoolbar',
915 'previewonfirst',
916 'previewontop',
917 'minordefault',
918 'externaleditor',
919 'externaldiff',
920 $wgLivePreview ? 'uselivepreview' : false,
921 'forceeditsummary',
922 ) ) . '</fieldset>'
923 );
924
925 # Recent changes
926 $wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'prefs-rc' ) . '</legend>' );
927
928 $rc = '<table><tr>';
929 $rc .= '<td>' . Xml::label( wfMsg( 'recentchangesdays' ), 'wpRecentDays' ) . '</td>';
930 $rc .= '<td>' . Xml::input( 'wpRecentDays', 3, $this->mRecentDays, array( 'id' => 'wpRecentDays' ) ) . '</td>';
931 $rc .= '</tr><tr>';
932 $rc .= '<td>' . Xml::label( wfMsg( 'recentchangescount' ), 'wpRecent' ) . '</td>';
933 $rc .= '<td>' . Xml::input( 'wpRecent', 3, $this->mRecent, array( 'id' => 'wpRecent' ) ) . '</td>';
934 $rc .= '</tr></table>';
935 $wgOut->addHtml( $rc );
936
937 $wgOut->addHtml( '<br />' );
938
939 $toggles[] = 'hideminor';
940 if( $wgRCShowWatchingUsers )
941 $toggles[] = 'shownumberswatching';
942 $toggles[] = 'usenewrc';
943 $wgOut->addHtml( $this->getToggles( $toggles ) );
944
945 $wgOut->addHtml( '</fieldset>' );
946
947 # Watchlist
948 $wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'prefs-watchlist' ) . '</legend>' );
949
950 $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-days' ), 'wpWatchlistDays', 'wpWatchlistDays', 3, $this->mWatchlistDays ) );
951 $wgOut->addHtml( '<br /><br />' );
952
953 $wgOut->addHtml( $this->getToggle( 'extendwatchlist' ) );
954 $wgOut->addHtml( wfInputLabel( wfMsg( 'prefs-watchlist-edits' ), 'wpWatchlistEdits', 'wpWatchlistEdits', 3, $this->mWatchlistEdits ) );
955 $wgOut->addHtml( '<br /><br />' );
956
957 $wgOut->addHtml( $this->getToggles( array( 'watchlisthideminor', 'watchlisthidebots', 'watchlisthideown', 'watchlisthideanons', 'watchlisthideliu' ) ) );
958
959 if( $wgUser->isAllowed( 'createpage' ) || $wgUser->isAllowed( 'createtalk' ) )
960 $wgOut->addHtml( $this->getToggle( 'watchcreations' ) );
961 foreach( array( 'edit' => 'watchdefault', 'move' => 'watchmoves', 'delete' => 'watchdeletion' ) as $action => $toggle ) {
962 if( $wgUser->isAllowed( $action ) )
963 $wgOut->addHtml( $this->getToggle( $toggle ) );
964 }
965 $this->mUsedToggles['watchcreations'] = true;
966 $this->mUsedToggles['watchdefault'] = true;
967 $this->mUsedToggles['watchmoves'] = true;
968 $this->mUsedToggles['watchdeletion'] = true;
969
970 $wgOut->addHtml( '</fieldset>' );
971
972 # Search
973 $mwsuggest = $wgEnableMWSuggest ?
974 $this->addRow(
975 Xml::label( wfMsg( 'mwsuggest-disable' ), 'wpDisableMWSuggest' ),
976 Xml::check( 'wpDisableMWSuggest', $this->mDisableMWSuggest, array( 'id' => 'wpDisableMWSuggest' ) )
977 ) : '';
978 $wgOut->addHTML(
979 // Elements for the search tab itself
980 Xml::openElement( 'fieldset' ) .
981 Xml::element( 'legend', null, wfMsg( 'searchresultshead' ) ) .
982 // Elements for the search options in the search tab
983 Xml::openElement( 'fieldset' ) .
984 Xml::element( 'legend', null, wfMsg( 'prefs-searchoptions' ) ) .
985 Xml::openElement( 'table' ) .
986 $this->addRow(
987 Xml::label( wfMsg( 'resultsperpage' ), 'wpSearch' ),
988 Xml::input( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) )
989 ) .
990 $this->addRow(
991 Xml::label( wfMsg( 'contextlines' ), 'wpSearchLines' ),
992 Xml::input( 'wpSearchLines', 4, $this->mSearchLines, array( 'id' => 'wpSearchLines' ) )
993 ) .
994 $this->addRow(
995 Xml::label( wfMsg( 'contextchars' ), 'wpSearchChars' ),
996 Xml::input( 'wpSearchChars', 4, $this->mSearchChars, array( 'id' => 'wpSearchChars' ) )
997 ) .
998 $mwsuggest .
999 Xml::closeElement( 'table' ) .
1000 Xml::closeElement( 'fieldset' ) .
1001 // Elements for the namespace options in the search tab
1002 Xml::openElement( 'fieldset' ) .
1003 Xml::element( 'legend', null, wfMsg( 'prefs-namespaces' ) ) .
1004 wfMsgExt( 'defaultns', array( 'parse' ) ) .
1005 $ps .
1006 Xml::closeElement( 'fieldset' ) .
1007 // End of the search tab
1008 Xml::closeElement( 'fieldset' )
1009 );
1010
1011 # Misc
1012 #
1013 $wgOut->addHTML('<fieldset><legend>' . wfMsg('prefs-misc') . '</legend>');
1014 $wgOut->addHtml( '<label for="wpStubs">' . wfMsg( 'stub-threshold' ) . '</label>&nbsp;' );
1015 $wgOut->addHtml( Xml::input( 'wpStubs', 6, $this->mStubs, array( 'id' => 'wpStubs' ) ) );
1016 $msgUnderline = htmlspecialchars( wfMsg ( 'tog-underline' ) );
1017 $msgUnderlinenever = htmlspecialchars( wfMsg ( 'underline-never' ) );
1018 $msgUnderlinealways = htmlspecialchars( wfMsg ( 'underline-always' ) );
1019 $msgUnderlinedefault = htmlspecialchars( wfMsg ( 'underline-default' ) );
1020 $uopt = $wgUser->getOption("underline");
1021 $s0 = $uopt == 0 ? ' selected="selected"' : '';
1022 $s1 = $uopt == 1 ? ' selected="selected"' : '';
1023 $s2 = $uopt == 2 ? ' selected="selected"' : '';
1024 $wgOut->addHTML("
1025 <div class='toggle'><p><label for='wpOpunderline'>$msgUnderline</label>
1026 <select name='wpOpunderline' id='wpOpunderline'>
1027 <option value=\"0\"$s0>$msgUnderlinenever</option>
1028 <option value=\"1\"$s1>$msgUnderlinealways</option>
1029 <option value=\"2\"$s2>$msgUnderlinedefault</option>
1030 </select></p></div>");
1031
1032 foreach ( $togs as $tname ) {
1033 if( !array_key_exists( $tname, $this->mUsedToggles ) ) {
1034 $wgOut->addHTML( $this->getToggle( $tname ) );
1035 }
1036 }
1037 $wgOut->addHTML( '</fieldset>' );
1038
1039 wfRunHooks( 'RenderPreferencesForm', array( $this, $wgOut ) );
1040
1041 $token = htmlspecialchars( $wgUser->editToken() );
1042 $skin = $wgUser->getSkin();
1043 $wgOut->addHTML( "
1044 <div id='prefsubmit'>
1045 <div>
1046 <input type='submit' name='wpSaveprefs' class='btnSavePrefs' value=\"" . wfMsgHtml( 'saveprefs' ) . '"'.$skin->tooltipAndAccesskey('save')." />
1047 <input type='submit' name='wpReset' value=\"" . wfMsgHtml( 'resetprefs' ) . "\" />
1048 </div>
1049
1050 </div>
1051
1052 <input type='hidden' name='wpEditToken' value=\"{$token}\" />
1053 </div></form>\n" );
1054
1055 $wgOut->addHtml( Xml::tags( 'div', array( 'class' => "prefcache" ),
1056 wfMsgExt( 'clearyourcache', 'parseinline' ) )
1057 );
1058 }
1059 }