Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationUtil.php |
— | — | @@ -4,22 +4,24 @@ |
5 | 5 | * Utility class for Article Creation |
6 | 6 | */ |
7 | 7 | class ArticleCreationUtil { |
8 | | - |
| 8 | + |
9 | 9 | /** |
10 | | - * Check if tracking is enabled |
| 10 | + * Check if tracking is enabled, in this case - ClickTracking |
| 11 | + * @return bool |
11 | 12 | */ |
12 | 13 | public static function trackingEnabled() { |
13 | 14 | return class_exists( 'ApiClickTracking' ); |
14 | 15 | } |
15 | | - |
| 16 | + |
16 | 17 | /** |
17 | | - * Generate tracking code prefix |
| 18 | + * Generate tracking code prefix for this campaign |
| 19 | + * @return string - the prefix text for clickTracking |
18 | 20 | */ |
19 | 21 | public static function trackingCodePrefix() { |
20 | 22 | global $wgExtensionCredits; |
21 | | - return 'ext.articlecreationworkflow@' . $wgExtensionCredits['other'][0]['version'] . '-'; |
| 23 | + return 'ext.articlecreationworkflow@' . $wgExtensionCredits['other'][0]['version'] . '-'; |
22 | 24 | } |
23 | | - |
| 25 | + |
24 | 26 | /** |
25 | 27 | * Track the page stats to the special article creation landing page |
26 | 28 | * @param $request Object |
— | — | @@ -31,27 +33,27 @@ |
32 | 34 | $event = 'landingpage-anonymous'; |
33 | 35 | } else { |
34 | 36 | $event = 'landingpage-loggedin'; |
35 | | - |
| 37 | + |
36 | 38 | if ( $request->getBool( 'fromlogin' ) ) { |
37 | 39 | $event .= '-fromlogin'; |
38 | 40 | } elseif ( $request->getBool( 'fromsignup' ) ) { |
39 | | - $event .= '-fromsignup'; |
| 41 | + $event .= '-fromsignup'; |
40 | 42 | } |
41 | 43 | } |
42 | | - |
| 44 | + |
43 | 45 | self::clickTracking( $event, SpecialPage::getTitleFor( 'ArticleCreationLanding' ), $par ); |
44 | 46 | } |
45 | 47 | |
46 | 48 | /** |
47 | | - * Tracking code that calls ClickTracking |
| 49 | + * Tracking code that calls ClickTracking |
48 | 50 | * @param $event string the event name |
49 | 51 | * @param $title Object |
50 | 52 | * @param $info string - additional info for click tracking |
51 | 53 | */ |
52 | | - private static function clickTracking( $event, $title, $info = '' ) { |
| 54 | + private static function clickTracking( $event, $title, $info = '' ) { |
53 | 55 | // check if ClickTracking API is enabled |
54 | 56 | if ( !self::trackingEnabled() ) { |
55 | | - return; |
| 57 | + return; |
56 | 58 | } |
57 | 59 | |
58 | 60 | $params = new FauxRequest( array( |
— | — | @@ -64,6 +66,5 @@ |
65 | 67 | $api = new ApiMain( $params, true ); |
66 | 68 | $api->execute(); |
67 | 69 | } |
68 | | - |
| 70 | + |
69 | 71 | } |
70 | | - |
Index: trunk/extensions/ArticleCreationWorkflow/includes/ArticleCreationTemplates.php |
— | — | @@ -190,7 +190,7 @@ |
191 | 191 | </div> |
192 | 192 | HTML; |
193 | 193 | } |
194 | | - |
| 194 | + |
195 | 195 | /** |
196 | 196 | * Stub for a replacement Missing Page. |
197 | 197 | * @param $article Article object for the page that was requested. |
— | — | @@ -206,8 +206,5 @@ |
207 | 207 | </div> |
208 | 208 | HTML; |
209 | 209 | } |
210 | | - |
211 | | -} |
212 | 210 | |
213 | | - |
214 | | - |
| 211 | +} |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php |
— | — | @@ -4,6 +4,8 @@ |
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Redirect users to a page specified by returnto upon successful account creation |
| 8 | + * @param $welcome_creation_msg - string |
| 9 | + * @param $injected_html - html string |
8 | 10 | */ |
9 | 11 | public static function BeforeWelcomeCreation( &$welcome_creation_msg, &$injected_html ) { |
10 | 12 | global $wgRequest, $wgOut; |
— | — | @@ -24,6 +26,7 @@ |
25 | 27 | |
26 | 28 | /** |
27 | 29 | * If the edit page is coming from red link, redirect users to article-non-existing page |
| 30 | + * @param $editPage - Object |
28 | 31 | */ |
29 | 32 | public static function AlternateEdit( $editPage ) { |
30 | 33 | global $wgRequest, $wgOut; |