r72043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72042‎ | r72043 | r72044 >
Date:20:13, 31 August 2010
Author:catrope
Status:deferred
Tags:
Comment:
PrefSwitch: Reorganize global opt-out as a checkbox per Brandon. The implementation is a little bit hacky but whatever.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php
@@ -18,7 +18,6 @@
1919 'prefswitch-survey-true' => 'Yes',
2020 'prefswitch-survey-false' => 'No',
2121 'prefswitch-survey-submit-off' => 'Turn new features off',
22 - 'prefswitch-survey-submit-global-off' => 'Turn new features off on all wikis',
2322 'prefswitch-survey-cancel-off' => 'If you would like to continue using the new features, you can return to $1.',
2423 'prefswitch-survey-submit-feedback' => 'Send feedback',
2524 'prefswitch-survey-cancel-feedback' => 'If you do not want to provide feedback, you can return to $1.',
@@ -26,6 +25,7 @@
2726 'prefswitch-survey-question-dislike' => 'What did you dislike about the features?',
2827 'prefswitch-survey-question-whyoff' => 'Why are you turning off the new features?
2928 Please select all that apply.',
 29+ 'prefswitch-survey-question-globaloff' => 'Do you want the features turned off globally?',
3030 'prefswitch-survey-answer-whyoff-hard' => 'The features were too hard to use.',
3131 'prefswitch-survey-answer-whyoff-didntwork' => 'The features did not function properly.',
3232 'prefswitch-survey-answer-whyoff-notpredictable' => 'The features did not perform predictably.',
@@ -65,6 +65,7 @@
6666 'prefswitch-survey-answer-os-ios' => 'iOS',
6767 'prefswitch-survey-answer-os-linux' => 'Linux',
6868 'prefswitch-survey-answer-os-other' => 'Other operating system:',
 69+ 'prefswitch-survey-answer-globaloff-yes' => 'Yes, turn the features off on all wikis',
6970 'prefswitch-survey-question-res' => 'What is the resolution of your screen?',
7071 'prefswitch-title-on' => 'New features',
7172 'prefswitch-title-switched-on' => 'Enjoy!',
Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.php
@@ -65,7 +65,6 @@
6666 $wgPrefSwitchSurveys['feedback'] = array(
6767 'submit-msg' => 'prefswitch-survey-submit-feedback',
6868 'updatable' => true,
69 - 'global' => false,
7069 'questions' => array(
7170 'like' => array(
7271 'question' => 'prefswitch-survey-question-like',
@@ -80,8 +79,6 @@
8180 $wgPrefSwitchSurveys['off'] = array(
8281 'submit-msg' => 'prefswitch-survey-submit-off',
8382 'updatable' => false,
84 - 'global' => true,
85 - 'submit-global-msg' => 'prefswitch-survey-submit-global-off',
8683 'questions' => array_merge(
8784 $wgPrefSwitchSurveys['feedback']['questions'],
8885 array(
@@ -152,6 +149,15 @@
153150 }
154151 unset( $survey );
155152
 153+// Question for global opt out
 154+$wgPrefSwitchSurveys['off']['questions']['global'] = array(
 155+ 'question' => 'prefswitch-survey-question-globaloff',
 156+ 'type' => 'checks',
 157+ 'answers' => array(
 158+ 'yes' => 'prefswitch-survey-answer-globaloff-yes',
 159+ ),
 160+);
 161+
156162 /* Setup */
157163
158164 // Credits
Index: trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php
@@ -146,7 +146,7 @@
147147 case 'off':
148148 // Switch off
149149 if ( self::checkToken() && self::isSwitchedOn( $wgUser ) && $wgRequest->wasPosted() ) {
150 - self::switchOff( $wgUser, $wgRequest->getCheck( 'global' ) && $wgPrefSwitchGlobalOptOut );
 150+ self::switchOff( $wgUser, $wgPrefSwitchGlobalOptOut && in_array( 'yes', $wgRequest->getArray( 'prefswitch-survey-global', array() ) ) );
151151 PrefSwitchSurvey::save( 'off', $wgPrefSwitchSurveys['feedback'] );
152152 $wgOut->addWikiMsg( 'prefswitch-success-off' );
153153 } else if ( !self::isSwitchedOn( $wgUser ) ) {
@@ -249,15 +249,6 @@
250250 wfMsg( $wgPrefSwitchSurveys[$mode]['submit-msg'] ),
251251 array( 'id' => "prefswitch-survey-submit-{$mode}", 'class' => 'prefswitch-survey-submit' )
252252 );
253 - if ( $wgPrefSwitchSurveys[$mode]['global'] && $wgPrefSwitchGlobalOptOut ) {
254 - $html .= Xml::submitButton(
255 - wfMsg( $wgPrefSwitchSurveys[$mode]['submit-global-msg'] ),
256 - array( 'id' => "prefswitch-survey-submit-global-{$mode}",
257 - 'class' => 'prefswitch-survey-submit',
258 - 'name' => 'global',
259 - )
260 - );
261 - }
262253 $html .= Xml::closeElement( 'dt' );
263254 $html .= Xml::closeElement( 'form' );
264255 $wgOut->addHtml( $html );

Follow-up revisions

RevisionCommit summaryAuthorDate
r721271.16wmf4: Merge r70633, r72043, r72055, r72059 from trunkcatrope17:52, 1 September 2010

Status & tagging log