r64534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64533‎ | r64534 | r64535 >
Date:21:19, 2 April 2010
Author:tparscal
Status:ok
Tags:
Comment:
Titles are working well now. Important, title processing needs to be AFTER the form processing.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php
@@ -56,6 +56,11 @@
5757 'prefswitch-survey-answer-os-linux' => 'Linux',
5858 'prefswitch-survey-answer-os-other' => 'Other operating system:',
5959 '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',
6065 'prefswitch-return' => '<hr>
6166 Return to <span class="plainlinks">[$1 $2]</span>.',
6267 '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 @@
102102 UsabilityInitiativeHooks::initialize();
103103 UsabilityInitiativeHooks::addScript( 'PrefSwitch/PrefSwitch.js', $wgPrefSwitchStyleVersion );
104104 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 - */
139105 // Handle various modes
140106 if ( $wgRequest->getCheck( 'mode' ) && $wgUser->isLoggedIn() ) {
141107 switch ( $wgRequest->getVal( 'mode' ) ) {
@@ -175,9 +141,46 @@
176142 } else {
177143 $this->render( 'main' );
178144 }
 145+ // Always show a way back
179146 $wgOut->addWikiMsgArray(
180147 'prefswitch-return', array( $this->originFullUrl, $this->originTitle ), array( 'parse' )
181148 );
 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+ }
182185 }
183186
184187 /* Private Functions */

Status & tagging log