Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -50,6 +50,8 @@ |
51 | 51 | * Adds JavaScript |
52 | 52 | */ |
53 | 53 | public static function addJS(){ |
| 54 | + global $wgOut; |
| 55 | + |
54 | 56 | UsabilityInitiativeHooks::initialize(); |
55 | 57 | UsabilityInitiativeHooks::addScript( 'ClickTracking/ClickTracking.js' ); |
56 | 58 | UsabilityInitiativeHooks::addVariables( |
— | — | @@ -57,11 +59,9 @@ |
58 | 60 | 'wgTrackingToken' => ClickTrackingHooks::get_session_id() |
59 | 61 | ) |
60 | 62 | ); |
61 | | - UsabilityInitiativeHooks::addVariables( |
62 | | - array( |
63 | | - 'wgClickTrackingIsThrottled' => ClickTrackingHooks::isUserThrottled() |
64 | | - ) |
65 | | - ); |
| 63 | + //need a literal false, not "false" to be output, to work prperly |
| 64 | + $userThrottle = ClickTrackingHooks::isUserThrottled(); |
| 65 | + $wgOut->addScript("<script> var wgClickTrackingIsThrottled = $userThrottle; </script>"); |
66 | 66 | |
67 | 67 | return true; |
68 | 68 | |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php |
— | — | @@ -18,13 +18,10 @@ |
19 | 19 | |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | | -// functions should check if this is set before logging clicktrack events |
23 | | -$wgClickTrackEnabled = true; |
24 | | - |
25 | 22 | // click throttle, should be seen as "1 out of every $wgClickTrackThrottle users will have it enabled" |
26 | 23 | // setting this to 1 means all users will have it enabled |
27 | 24 | // setting to a negative number will disable it for all users |
28 | | -$wgClickTrackThrottle = 1; |
| 25 | +$wgClickTrackThrottle = -1; |
29 | 26 | |
30 | 27 | // set the time window for what we consider 'recent' contributions, in days |
31 | 28 | $wgClickTrackContribGranularity1 = 60 * 60 * 24 * 365 / 2; // half a year |
— | — | @@ -61,7 +58,7 @@ |
62 | 59 | |
63 | 60 | //Special page setup |
64 | 61 | $wgSpecialPages['ClickTracking'] = 'SpecialClickTracking'; |
65 | | -$wgSpecialPageGroups['ClickTracking'] = 'admin'; |
| 62 | +$wgGroupPermissions['sysop']['clicktrack'] = true; |
66 | 63 | |
67 | 64 | // Adds Internationalized Messages |
68 | 65 | $wgExtensionMessagesFiles['ClickTracking'] = $dir . 'ClickTracking.i18n.php'; |