Index: trunk/extensions/MoodBar/include/MoodBarHTMLEmailNotification.php |
— | — | @@ -240,20 +240,20 @@ |
241 | 241 | * @return array - the links to be tracked in email |
242 | 242 | */ |
243 | 243 | protected function buildEmailLink() { |
244 | | - $pageObject = array( 'feedbackPage' => SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback ), |
245 | | - 'editorTalkPage' => $this->editor->getTalkPage(), |
246 | | - 'targetUserTalkPage' => $this->targetUser->getTalkPage() ); |
| 244 | + $pageObject = array( 'feedbackPage' => array( 'obj' => SpecialPage::getTitleFor( 'FeedbackDashboard', $this->feedback ), 'clicktracking' => false ), |
| 245 | + 'editorTalkPage' => array( 'obj' => $this->editor->getTalkPage(), 'clicktracking' => false ), |
| 246 | + 'targetUserTalkPage' => array( 'obj' => $this->targetUser->getTalkPage(), 'clicktracking' => true ) ); |
247 | 247 | |
248 | 248 | $links = array(); |
249 | 249 | |
250 | 250 | // if clickTracking is not enabled, return the full canonical url for email |
251 | 251 | if ( !class_exists( 'ApiClickTracking' ) ) { |
252 | 252 | foreach ( $pageObject as $key => $value ) { |
253 | | - $links[$key.'Url'] = $value->getCanonicalURL(); |
| 253 | + $links[$key.'Url'] = $value['obj']->getCanonicalURL(); |
254 | 254 | } |
255 | 255 | } |
256 | 256 | else { |
257 | | - global $wgServer, $wgScriptPath, $wgMoodBarConfig; |
| 257 | + global $wgMoodBarConfig; |
258 | 258 | |
259 | 259 | $token = wfGenerateToken(); |
260 | 260 | $eventid = 'ext.feedbackDashboard@' . $wgMoodBarConfig['bucketConfig']['version'] . |
— | — | @@ -262,10 +262,15 @@ |
263 | 263 | $clickTrackingLink = wfAppendQuery( wfScript( 'api' ), |
264 | 264 | array( 'action' => 'clicktracking', 'eventid' => $eventid, 'token' => $token ) ); |
265 | 265 | |
266 | | - foreach ( $pageObject as $key => $value ) { |
267 | | - $links[$key.'Url'] = wfExpandUrl( wfAppendQuery( $clickTrackingLink, |
268 | | - array( 'redirectto' => $value->getLinkURL(), |
269 | | - 'namespacenumber' => $value->getNamespace() ) ), PROTO_CANONICAL ); |
| 266 | + foreach ( $pageObject as $key => $value ) { |
| 267 | + if ( $value['clicktracking'] ) { |
| 268 | + $links[$key.'Url'] = wfExpandUrl( wfAppendQuery( $clickTrackingLink, |
| 269 | + array( 'redirectto' => $value['obj']->getLinkURL(), |
| 270 | + 'namespacenumber' => $value['obj']->getNamespace() ) ), PROTO_CANONICAL ); |
| 271 | + } |
| 272 | + else { |
| 273 | + $links[$key.'Url'] = $value['obj']->getCanonicalURL(); |
| 274 | + } |
270 | 275 | } |
271 | 276 | } |
272 | 277 | |