From: Tim Starling Date: Wed, 7 Apr 2004 13:58:14 +0000 (+0000) Subject: allowed changes in preferences, especially skin, to be immediately displayed in the... X-Git-Tag: 1.3.0beta1~569 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=52a63ea7ef8a373a1be2142e27d2cf59dd1c5f94;p=lhc%2Fweb%2Fwiklou.git allowed changes in preferences, especially skin, to be immediately displayed in the "preferences saved" confirmation screen --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index abd63f1a08..c353cb7758 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -125,7 +125,7 @@ class PreferencesForm { /* private */ function savePreferences() { - global $wgUser, $wgLang, $wgDeferredUpdateList; + global $wgUser, $wgLang, $wgDeferredUpdateList, $wgOut; if ( "" != $this->mNewpass ) { if ( $this->mNewpass != $this->mRetypePass ) { @@ -170,6 +170,11 @@ class PreferencesForm { $wgUser->setCookies(); $up = new UserUpdate(); array_push( $wgDeferredUpdateList, $up ); + $wgOut->setParserOptions( ParserOptions::newFromUser( $wgUser ) ); + $po = ParserOptions::newFromUser( $wgUser ); + print get_class( $wgUser->getSkin() ) . "
\n"; + print get_class( $po->mSkin ) . "
\n"; + print get_class( $wgOut->mParserOptions->mSkin ) . "
\n"; $this->mainPrefsForm( wfMsg( "savedprefs" ) ); } diff --git a/includes/User.php b/includes/User.php index 287c49c9e9..c1607e7824 100644 --- a/includes/User.php +++ b/includes/User.php @@ -379,6 +379,10 @@ class User { function setOption( $oname, $val ) { $this->loadFromDatabase(); + if ( $oname == 'skin' ) { + # Clear cached skin, so the new one displays immediately in Special:Preferences + unset( $this->mSkin ); + } $this->mOptions[$oname] = $val; $this->invalidateCache(); }