Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | 'prefswitch-survey-true' => 'Yes', |
20 | 20 | 'prefswitch-survey-false' => 'No', |
21 | 21 | 'prefswitch-survey-submit-off' => 'Turn new features off', |
22 | | - 'prefswitch-survey-submit-global-off' => 'Turn new features off on all wikis', |
23 | 22 | 'prefswitch-survey-cancel-off' => 'If you would like to continue using the new features, you can return to $1.', |
24 | 23 | 'prefswitch-survey-submit-feedback' => 'Send feedback', |
25 | 24 | 'prefswitch-survey-cancel-feedback' => 'If you do not want to provide feedback, you can return to $1.', |
— | — | @@ -26,6 +25,7 @@ |
27 | 26 | 'prefswitch-survey-question-dislike' => 'What did you dislike about the features?', |
28 | 27 | 'prefswitch-survey-question-whyoff' => 'Why are you turning off the new features? |
29 | 28 | Please select all that apply.', |
| 29 | + 'prefswitch-survey-question-globaloff' => 'Do you want the features turned off globally?', |
30 | 30 | 'prefswitch-survey-answer-whyoff-hard' => 'The features were too hard to use.', |
31 | 31 | 'prefswitch-survey-answer-whyoff-didntwork' => 'The features did not function properly.', |
32 | 32 | 'prefswitch-survey-answer-whyoff-notpredictable' => 'The features did not perform predictably.', |
— | — | @@ -65,6 +65,7 @@ |
66 | 66 | 'prefswitch-survey-answer-os-ios' => 'iOS', |
67 | 67 | 'prefswitch-survey-answer-os-linux' => 'Linux', |
68 | 68 | 'prefswitch-survey-answer-os-other' => 'Other operating system:', |
| 69 | + 'prefswitch-survey-answer-globaloff-yes' => 'Yes, turn the features off on all wikis', |
69 | 70 | 'prefswitch-survey-question-res' => 'What is the resolution of your screen?', |
70 | 71 | 'prefswitch-title-on' => 'New features', |
71 | 72 | 'prefswitch-title-switched-on' => 'Enjoy!', |
Index: trunk/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.php |
— | — | @@ -65,7 +65,6 @@ |
66 | 66 | $wgPrefSwitchSurveys['feedback'] = array( |
67 | 67 | 'submit-msg' => 'prefswitch-survey-submit-feedback', |
68 | 68 | 'updatable' => true, |
69 | | - 'global' => false, |
70 | 69 | 'questions' => array( |
71 | 70 | 'like' => array( |
72 | 71 | 'question' => 'prefswitch-survey-question-like', |
— | — | @@ -80,8 +79,6 @@ |
81 | 80 | $wgPrefSwitchSurveys['off'] = array( |
82 | 81 | 'submit-msg' => 'prefswitch-survey-submit-off', |
83 | 82 | 'updatable' => false, |
84 | | - 'global' => true, |
85 | | - 'submit-global-msg' => 'prefswitch-survey-submit-global-off', |
86 | 83 | 'questions' => array_merge( |
87 | 84 | $wgPrefSwitchSurveys['feedback']['questions'], |
88 | 85 | array( |
— | — | @@ -152,6 +149,15 @@ |
153 | 150 | } |
154 | 151 | unset( $survey ); |
155 | 152 | |
| 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 | + |
156 | 162 | /* Setup */ |
157 | 163 | |
158 | 164 | // Credits |
Index: trunk/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | case 'off': |
148 | 148 | // Switch off |
149 | 149 | 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() ) ) ); |
151 | 151 | PrefSwitchSurvey::save( 'off', $wgPrefSwitchSurveys['feedback'] ); |
152 | 152 | $wgOut->addWikiMsg( 'prefswitch-success-off' ); |
153 | 153 | } else if ( !self::isSwitchedOn( $wgUser ) ) { |
— | — | @@ -249,15 +249,6 @@ |
250 | 250 | wfMsg( $wgPrefSwitchSurveys[$mode]['submit-msg'] ), |
251 | 251 | array( 'id' => "prefswitch-survey-submit-{$mode}", 'class' => 'prefswitch-survey-submit' ) |
252 | 252 | ); |
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 | | - } |
262 | 253 | $html .= Xml::closeElement( 'dt' ); |
263 | 254 | $html .= Xml::closeElement( 'form' ); |
264 | 255 | $wgOut->addHtml( $html ); |