Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php |
— | — | @@ -56,6 +56,11 @@ |
57 | 57 | 'prefswitch-survey-answer-os-linux' => 'Linux', |
58 | 58 | 'prefswitch-survey-answer-os-other' => 'Other operating system:', |
59 | 59 | 'prefswitch-survey-question-res' => 'What is the resolution of your screen?', |
| 60 | + 'prefswitch-title-on' => 'What\'s New?', |
| 61 | + 'prefswitch-title-switched-on' => 'Enjoy!', |
| 62 | + 'prefswitch-title-off' => 'Turn New Features Off', |
| 63 | + 'prefswitch-title-switched-off' => 'Thanks', |
| 64 | + 'prefswitch-title-feedback' => 'Give Feedback', |
60 | 65 | 'prefswitch-return' => '<hr> |
61 | 66 | Return to <span class="plainlinks">[$1 $2]</span>.', |
62 | 67 | 'prefswitch-main' => 'We\'ve been working hard to make things easier for our users. We\'re excited to share some improvements, including a new look and feel and simplified editing features. Improving the usability of the site is an ongoing effort here at Wikimedia and we\'ll be sharing more updates in the future. |
Index: trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php |
— | — | @@ -101,40 +101,6 @@ |
102 | 102 | UsabilityInitiativeHooks::initialize(); |
103 | 103 | UsabilityInitiativeHooks::addScript( 'PrefSwitch/PrefSwitch.js', $wgPrefSwitchStyleVersion ); |
104 | 104 | UsabilityInitiativeHooks::addStyle( 'PrefSwitch/PrefSwitch.css', $wgPrefSwitchStyleVersion ); |
105 | | - /* |
106 | | - // Set page title |
107 | | - if ( self::isSwitchedOn( $wgUser ) ) { |
108 | | - switch ( $wgRequest->getVal( 'mode' ) ) { |
109 | | - case 'off': |
110 | | - // Just switched off |
111 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-off' ) ); |
112 | | - break; |
113 | | - case 'feedback': |
114 | | - // Giving feedback |
115 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-feedback' ) ); |
116 | | - break; |
117 | | - case 'on': |
118 | | - // Just switched on, and reloaded... or something |
119 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-on' ) ); |
120 | | - break; |
121 | | - default: |
122 | | - // About to switch off |
123 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-on' ) ); |
124 | | - break; |
125 | | - } |
126 | | - } else { |
127 | | - switch ( $wgRequest->getVal( 'mode' ) ) { |
128 | | - case 'on': |
129 | | - // Just switched on |
130 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-on' ) ); |
131 | | - break; |
132 | | - default: |
133 | | - // About to switch on |
134 | | - $wgOut->setPageTitle( wfMsg( 'prefswitch-title-off' ) ); |
135 | | - break; |
136 | | - } |
137 | | - } |
138 | | - */ |
139 | 105 | // Handle various modes |
140 | 106 | if ( $wgRequest->getCheck( 'mode' ) && $wgUser->isLoggedIn() ) { |
141 | 107 | switch ( $wgRequest->getVal( 'mode' ) ) { |
— | — | @@ -175,9 +141,46 @@ |
176 | 142 | } else { |
177 | 143 | $this->render( 'main' ); |
178 | 144 | } |
| 145 | + // Always show a way back |
179 | 146 | $wgOut->addWikiMsgArray( |
180 | 147 | 'prefswitch-return', array( $this->originFullUrl, $this->originTitle ), array( 'parse' ) |
181 | 148 | ); |
| 149 | + // Set page title |
| 150 | + if ( self::isSwitchedOn( $wgUser ) ) { |
| 151 | + switch ( $wgRequest->getVal( 'mode' ) ) { |
| 152 | + case 'off': |
| 153 | + // About to switch off |
| 154 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-off' ) ); |
| 155 | + break; |
| 156 | + case 'feedback': |
| 157 | + // Giving feedback |
| 158 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-feedback' ) ); |
| 159 | + break; |
| 160 | + case 'on': |
| 161 | + // Just switched on, and reloaded... or something |
| 162 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-on' ) ); |
| 163 | + break; |
| 164 | + default: |
| 165 | + // About to switch off |
| 166 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-on' ) ); |
| 167 | + break; |
| 168 | + } |
| 169 | + } else { |
| 170 | + switch ( $wgRequest->getVal( 'mode' ) ) { |
| 171 | + case 'on': |
| 172 | + // About to switch on |
| 173 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-on' ) ); |
| 174 | + break; |
| 175 | + case 'off': |
| 176 | + // Just switched off |
| 177 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-switched-off' ) ); |
| 178 | + break; |
| 179 | + default: |
| 180 | + // About to switch on |
| 181 | + $wgOut->setPageTitle( wfMsg( 'prefswitch-title-on' ) ); |
| 182 | + break; |
| 183 | + } |
| 184 | + } |
182 | 185 | } |
183 | 186 | |
184 | 187 | /* Private Functions */ |