Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -12,12 +12,12 @@ |
13 | 13 | /* Static Functions */ |
14 | 14 | public static function schema() { |
15 | 15 | global $wgExtNewTables; |
16 | | - |
| 16 | + |
17 | 17 | $wgExtNewTables[] = array( |
18 | 18 | 'click_tracking', |
19 | 19 | dirname( __FILE__ ) . '/ClickTracking.sql' |
20 | 20 | ); |
21 | | - |
| 21 | + |
22 | 22 | return true; |
23 | 23 | } |
24 | 24 | |
— | — | @@ -29,23 +29,21 @@ |
30 | 30 | * @param $contribs contributions the user has made (or NULL if user not logged in) |
31 | 31 | * @return true if the event was stored in the DB |
32 | 32 | */ |
33 | | - public static function trackEvent($is_logged_in, $namespace, $event_id, $contribs=0){ |
34 | | - |
| 33 | + public static function trackEvent( $is_logged_in, $namespace, $event_id, $contribs = 0 ){ |
35 | 34 | $dbw = wfGetDB( DB_MASTER ); |
36 | | - |
| 35 | + |
37 | 36 | $dbw->begin(); |
| 37 | + |
38 | 38 | // Builds insert information |
39 | | - |
40 | 39 | $data = array( |
41 | 40 | 'is_logged_in' => (bool) $is_logged_in, |
42 | 41 | 'namespace' => (int) $namespace, |
43 | 42 | 'event_id' => (int) $event_id, |
44 | | - 'user_contribs' => ($is_logged_in?$contribs:null) |
| 43 | + 'user_contribs' => ( $is_logged_in? $contribs : null ) |
45 | 44 | ); |
46 | | - |
| 45 | + |
47 | 46 | $db_status = $dbw->insert('click_tracking', $data, __METHOD__); |
48 | 47 | $dbw->commit(); |
49 | 48 | return $db_status; |
50 | 49 | } |
51 | | - |
52 | | -} |
\ No newline at end of file |
| 50 | +} |