Index: branches/wmf/1.16wmf4/skins/Vector.php |
— | — | @@ -93,11 +93,11 @@ |
94 | 94 | |
95 | 95 | // Adds namespace links |
96 | 96 | $links['namespaces'][$subjectId] = $this->tabAction( |
97 | | - $subjectPage, 'vector-namespace-' . $subjectId, !$isTalk, '', true |
| 97 | + $subjectPage, 'nstab-' . $subjectId, !$isTalk, '', true |
98 | 98 | ); |
99 | 99 | $links['namespaces'][$subjectId]['context'] = 'subject'; |
100 | 100 | $links['namespaces'][$talkId] = $this->tabAction( |
101 | | - $talkPage, 'vector-namespace-talk', $isTalk, '', true |
| 101 | + $talkPage, 'talk', $isTalk, '', true |
102 | 102 | ); |
103 | 103 | $links['namespaces'][$talkId]['context'] = 'talk'; |
104 | 104 | |
— | — | @@ -299,7 +299,7 @@ |
300 | 300 | } else { |
301 | 301 | $links['namespaces']['special'] = array( |
302 | 302 | 'class' => 'selected', |
303 | | - 'text' => wfMsg( 'vector-namespace-special' ), |
| 303 | + 'text' => wfMsg( 'nstab-special' ), |
304 | 304 | 'href' => $wgRequest->getRequestURL() |
305 | 305 | ); |
306 | 306 | } |
Property changes on: branches/wmf/1.16wmf4/skins/Vector.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
307 | 307 | Merged /trunk/phase3/skins/Vector.php:r72055,72059 |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.i18n.php |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | 'prefswitch-survey-question-dislike' => 'What did you dislike about the features?', |
27 | 27 | 'prefswitch-survey-question-whyoff' => 'Why are you turning off the new features? |
28 | 28 | Please select all that apply.', |
| 29 | + 'prefswitch-survey-question-globaloff' => 'Do you want the features turned off globally?', |
29 | 30 | 'prefswitch-survey-answer-whyoff-hard' => 'The features were too hard to use.', |
30 | 31 | 'prefswitch-survey-answer-whyoff-didntwork' => 'The features did not function properly.', |
31 | 32 | 'prefswitch-survey-answer-whyoff-notpredictable' => 'The features did not perform predictably.', |
— | — | @@ -62,6 +63,7 @@ |
63 | 64 | 'prefswitch-survey-answer-os-ios' => 'iOS', |
64 | 65 | 'prefswitch-survey-answer-os-linux' => 'Linux', |
65 | 66 | 'prefswitch-survey-answer-os-other' => 'Other operating system:', |
| 67 | + 'prefswitch-survey-answer-globaloff-yes' => 'Yes, turn the features off on all wikis', |
66 | 68 | 'prefswitch-survey-question-res' => 'What is the resolution of your screen?', |
67 | 69 | 'prefswitch-title-on' => 'New features', |
68 | 70 | 'prefswitch-title-switched-on' => 'Enjoy!', |
— | — | @@ -158,6 +160,7 @@ |
159 | 161 | 'prefswitch-main-feedback' => 'Entry asking for feedback in a local page.', |
160 | 162 | 'prefswitch-main-anon' => 'Is used on Special:UsabilityInitiativePrefSwitch at Wikimedia.org.', |
161 | 163 | 'prefswitch-feedbackpage' => '{{doc-important|The name of the user experience feedback page on this wiki. Should only be translated for ja, es, de, fr, it, ru, pl, pt, nl for now. Do not translate "Project:"}}', |
| 164 | + 'prefswitch-survey-submit-global-off' => 'This message may still change', |
162 | 165 | ); |
163 | 166 | |
164 | 167 | /** Afrikaans (Afrikaans) |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/PrefSwitch/PrefSwitch.php |
— | — | @@ -38,6 +38,9 @@ |
39 | 39 | ), |
40 | 40 | ); |
41 | 41 | |
| 42 | +// Allow global opt-outs. Depends on CentralAuth |
| 43 | +$wgPrefSwitchGlobalOptOut = false; |
| 44 | + |
42 | 45 | // Survey questions to ask when users switch prefs |
43 | 46 | // array( |
44 | 47 | // survey-id => array( |
— | — | @@ -144,6 +147,15 @@ |
145 | 148 | } |
146 | 149 | unset( $survey ); |
147 | 150 | |
| 151 | +// Question for global opt out |
| 152 | +$wgPrefSwitchSurveys['off']['questions']['global'] = array( |
| 153 | + 'question' => 'prefswitch-survey-question-globaloff', |
| 154 | + 'type' => 'checks', |
| 155 | + 'answers' => array( |
| 156 | + 'yes' => 'prefswitch-survey-answer-globaloff-yes', |
| 157 | + ), |
| 158 | +); |
| 159 | + |
148 | 160 | /* Setup */ |
149 | 161 | |
150 | 162 | // Credits |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/PrefSwitch/SpecialPrefSwitch.php |
— | — | @@ -67,10 +67,30 @@ |
68 | 68 | $user->saveSettings(); |
69 | 69 | } |
70 | 70 | /** |
71 | | - * Switches a user's prefernces off |
| 71 | + * Switches a user's preferences off |
72 | 72 | * @param $user User object to set preferences for |
| 73 | + * @param $global bool Whether to apply this change on all wikis in $wgPrefSwitchWikis |
73 | 74 | */ |
74 | | - public static function switchOff( $user ) { |
| 75 | + public static function switchOff( $user, $global = false ) { |
| 76 | + self::switchOffUser( $user ); |
| 77 | + if ( $global ) { |
| 78 | + $globalUser = new CentralAuthUser( $user->getName() ); |
| 79 | + if ( !$globalUser->exists() ) { |
| 80 | + return; |
| 81 | + } |
| 82 | + $accounts = $globalUser->queryAttached(); |
| 83 | + foreach ( $accounts as $account ) { |
| 84 | + $remoteUser = UserRightsProxy::newFromName( |
| 85 | + $account['wiki'], |
| 86 | + $globalUser->getName(), |
| 87 | + true |
| 88 | + ); |
| 89 | + self::switchOffUser( $remoteUser ); |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | + |
| 94 | + private static function switchOffUser( $user ) { |
75 | 95 | global $wgPrefSwitchPrefs; |
76 | 96 | foreach ( $wgPrefSwitchPrefs['off'] as $pref => $value ) { |
77 | 97 | $user->setOption( $pref, $value ); |
— | — | @@ -85,7 +105,7 @@ |
86 | 106 | wfLoadExtensionMessages( 'PrefSwitch' ); |
87 | 107 | } |
88 | 108 | public function execute( $par ) { |
89 | | - global $wgRequest, $wgOut, $wgUser, $wgPrefSwitchSurveys, $wgPrefSwitchStyleVersion; |
| 109 | + global $wgRequest, $wgOut, $wgUser, $wgPrefSwitchSurveys, $wgPrefSwitchStyleVersion, $wgPrefSwitchGlobalOptOut; |
90 | 110 | // Get the origin from the request |
91 | 111 | $par = $wgRequest->getVal( 'from', $par ); |
92 | 112 | $this->originTitle = Title::newFromText( $par ); |
— | — | @@ -126,7 +146,7 @@ |
127 | 147 | case 'off': |
128 | 148 | // Switch off |
129 | 149 | if ( self::checkToken() && self::isSwitchedOn( $wgUser ) && $wgRequest->wasPosted() ) { |
130 | | - self::switchOff( $wgUser ); |
| 150 | + self::switchOff( $wgUser, $wgPrefSwitchGlobalOptOut && in_array( 'yes', $wgRequest->getArray( 'prefswitch-survey-global', array() ) ) ); |
131 | 151 | PrefSwitchSurvey::save( 'off', $wgPrefSwitchSurveys['feedback'] ); |
132 | 152 | $wgOut->addWikiMsg( 'prefswitch-success-off' ); |
133 | 153 | } else if ( !self::isSwitchedOn( $wgUser ) ) { |
— | — | @@ -199,7 +219,7 @@ |
200 | 220 | /* Private Functions */ |
201 | 221 | |
202 | 222 | private function render( $mode = null ) { |
203 | | - global $wgUser, $wgOut, $wgPrefSwitchSurveys, $wgAllowUserCss, $wgAllowUserJs; |
| 223 | + global $wgUser, $wgOut, $wgPrefSwitchSurveys, $wgPrefSwitchGlobalOptOut, $wgAllowUserCss, $wgAllowUserJs; |
204 | 224 | // Make sure links will retain the origin |
205 | 225 | $query = array( 'from' => $this->origin, 'fromquery' => $this->originQuery ); |
206 | 226 | if ( isset( $wgPrefSwitchSurveys[$mode] ) ) { |
Property changes on: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/PrefSwitch |
___________________________________________________________________ |
Modified: svn:mergeinfo |
207 | 227 | Merged /trunk/extensions/UsabilityInitiative/PrefSwitch:r70633,72043 |