Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -42,9 +42,9 @@ |
43 | 43 | public static function addJS(){ |
44 | 44 | UsabilityInitiativeHooks::initialize(); |
45 | 45 | UsabilityInitiativeHooks::addScript('ClickTracking/ClickTracking.js'); |
46 | | - UsabilityInitiativeHooks::addVariables(array( |
47 | | - 'wgEditId' => ClickTrackingHooks::get_session_id() |
48 | | - )); |
| 46 | + UsabilityInitiativeHooks::addVariables( |
| 47 | + array( 'wgTrackingToken' => ClickTrackingHooks::get_session_id() ) |
| 48 | + ); |
49 | 49 | return true; |
50 | 50 | } |
51 | 51 | |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.js |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | |
5 | 5 | // creates 'track action' function to call the clicktracking API and send the ID |
6 | 6 | $.trackAction = function ( id ){ |
7 | | - $j.post( wgScriptPath + '/api.php', { 'action': 'clicktracking', 'eventid': id, 'editid': wgEditId } ); |
| 7 | + $j.post( wgScriptPath + '/api.php', { 'action': 'clicktracking', 'eventid': id, 'token': wgTrackingToken } ); |
8 | 8 | }; |
9 | 9 | |
10 | 10 | return $(this); |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ApiClickTracking.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | class ApiClickTracking extends ApiBase { |
11 | 11 | |
12 | 12 | /** |
13 | | - * runs when the api is called with "clicktracking", takes in "eventid" and an edit token given to the user, "editid" |
| 13 | + * runs when the api is called with "clicktracking", takes in "eventid" and an edit token given to the user, "token" |
14 | 14 | * @see includes/api/ApiBase#execute() |
15 | 15 | */ |
16 | 16 | public function execute(){ |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | $params = $this->extractRequestParams(); |
20 | 20 | $this->validateParams( $params ); |
21 | 21 | $eventid_to_lookup = $params['eventid']; |
22 | | - $session_id = $params['editid']; |
| 22 | + $session_id = $params['token']; |
23 | 23 | |
24 | 24 | //Event ID lookup table |
25 | 25 | $event_id = ClickTrackingHooks::getEventIDFromName(urldecode($eventid_to_lookup)); |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | * @return unknown_type |
46 | 46 | */ |
47 | 47 | protected function validateParams( $params ) { |
48 | | - $required = array( 'eventid', 'editid'); |
| 48 | + $required = array( 'eventid', 'token'); |
49 | 49 | foreach( $required as $arg ) { |
50 | 50 | if ( !isset( $params[$arg] ) ) { |
51 | 51 | $this->dieUsageMsg( array( 'missingparam', $arg ) ); |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | public function getParamDescription() { |
59 | 59 | return array( |
60 | 60 | 'eventid' => 'string of eventID', |
61 | | - 'editid' => 'unique edit ID for this edit session' |
| 61 | + 'token' => 'unique edit ID for this edit session' |
62 | 62 | ); |
63 | 63 | } |
64 | 64 | |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | 'eventid' => array( |
73 | 73 | ApiBase::PARAM_TYPE => 'string' |
74 | 74 | ), |
75 | | - 'editid' => array( |
| 75 | + 'token' => array( |
76 | 76 | ApiBase::PARAM_TYPE => 'string' |
77 | 77 | ) |
78 | 78 | ); |