Index: trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php |
— | — | @@ -223,25 +223,27 @@ |
224 | 224 | $wgOut->addWikiMsg( |
225 | 225 | 'prefswitch-main', array( 'parse' ) |
226 | 226 | ); |
227 | | - if ( self::isSwitchedOn( $wgUser ) && !$wgUser->isAnon() ) { |
228 | | - $wgOut->addWikiMsgArray( |
229 | | - 'prefswitch-main-on', |
230 | | - array( |
231 | | - $this->getTitle()->getFullURL( array_merge( $query, array( 'mode' => 'feedback' ) ) ), |
232 | | - $this->getTitle()->getFullURL( array_merge( $query, array( 'mode' => 'off' ) ) ) |
233 | | - ), |
234 | | - array( 'parse' ) |
235 | | - ); |
236 | | - } else if ( !$wgUser->isAnon() ) { |
237 | | - $wgOut->addWikiMsgArray( |
238 | | - 'prefswitch-main-off', |
239 | | - array( |
240 | | - $this->getTitle()->getFullURL( |
241 | | - array_merge( $query, array( 'mode' => 'on', 'token' => $wgUser->editToken() ) ) |
242 | | - ) |
243 | | - ), |
244 | | - array( 'parse' ) |
245 | | - ); |
| 227 | + if ( $wgUser->isLoggedIn() ) { |
| 228 | + if ( self::isSwitchedOn( $wgUser ) ) { |
| 229 | + $wgOut->addWikiMsgArray( |
| 230 | + 'prefswitch-main-on', |
| 231 | + array( |
| 232 | + $this->getTitle()->getFullURL( array_merge( $query, array( 'mode' => 'feedback' ) ) ), |
| 233 | + $this->getTitle()->getFullURL( array_merge( $query, array( 'mode' => 'off' ) ) ) |
| 234 | + ), |
| 235 | + array( 'parse' ) |
| 236 | + ); |
| 237 | + } else { |
| 238 | + $wgOut->addWikiMsgArray( |
| 239 | + 'prefswitch-main-off', |
| 240 | + array( |
| 241 | + $this->getTitle()->getFullURL( |
| 242 | + array_merge( $query, array( 'mode' => 'on', 'token' => $wgUser->editToken() ) ) |
| 243 | + ) |
| 244 | + ), |
| 245 | + array( 'parse' ) |
| 246 | + ); |
| 247 | + } |
246 | 248 | } |
247 | 249 | } |
248 | 250 | } |