Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php |
— | — | @@ -33,8 +33,6 @@ |
34 | 34 | $wgHooks['ArticleSaveComplete'][] = 'ArticleCreationHooks::trackEditSuccess'; |
35 | 35 | $wgHooks['EditPage::attemptSave'][] = 'ArticleCreationHooks::trackEditAttempt'; |
36 | 36 | |
37 | | -$wgHooks['MakeGlobalVariablesScript'][] = 'ArticleCreationHooks::getGlobalVariables'; |
38 | | - |
39 | 37 | /* Internationalization */ |
40 | 38 | $wgExtensionMessagesFiles['ArticleCreation'] = $articleCreationDir . 'ArticleCreationWorkflow.i18n.php'; |
41 | 39 | |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php |
— | — | @@ -61,25 +61,6 @@ |
62 | 62 | return true; |
63 | 63 | } |
64 | 64 | |
65 | | - public static function getGlobalVariables( &$vars ) { |
66 | | - global $wgArticleCreationConfig, $wgUser, $wgArticleCreationButtons, $wgTitle; |
67 | | - |
68 | | - if ( ! $wgTitle->isSpecial( 'ArticleCreationLanding' ) ) { |
69 | | - return true; |
70 | | - } |
71 | | - |
72 | | - $vars['acConfig'] = $wgArticleCreationConfig + |
73 | | - array( |
74 | | - 'enabled' => ArticleCreationUtil::isEnabled(), |
75 | | - 'tracking-turned-on' => ArticleCreationUtil::trackingEnabled(), |
76 | | - 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix(), |
77 | | - 'variant' => ArticleCreationTemplates::getLandingVariant( $wgTitle ), |
78 | | - 'acwbucket' => ArticleCreationUtil::trackingBucket(), |
79 | | - ); |
80 | | - |
81 | | - return true; |
82 | | - } |
83 | | - |
84 | 65 | public static function configSearchTitle( &$vars ) { |
85 | 66 | global $wgRequest; |
86 | 67 | |
Index: trunk/extensions/ArticleCreationWorkflow/SpecialArticleCreationLanding.php |
— | — | @@ -33,9 +33,27 @@ |
34 | 34 | $out->setRobotPolicy( 'noindex,nofollow' ); |
35 | 35 | $out->addModules( 'ext.articleCreation.core' ); |
36 | 36 | $out->addModules( 'ext.articleCreation.user' ); |
| 37 | + $out->addJsConfigVars( 'acConfig', $this->getConfigVars() ); |
37 | 38 | $out->addHtml( ArticleCreationTemplates::getLandingPage($par) ); |
38 | 39 | |
39 | 40 | ArticleCreationUtil::TrackSpecialLandingPage( $par ); |
40 | 41 | } |
| 42 | + |
| 43 | + /** |
| 44 | + * Returns the javascript configuration |
| 45 | + * |
| 46 | + * @return array |
| 47 | + */ |
| 48 | + protected function getConfigVars() { |
| 49 | + global $wgArticleCreationConfig; |
| 50 | + |
| 51 | + return $wgArticleCreationConfig + array( |
| 52 | + 'enabled' => ArticleCreationUtil::isEnabled(), |
| 53 | + 'tracking-turned-on' => ArticleCreationUtil::trackingEnabled(), |
| 54 | + 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix(), |
| 55 | + 'variant' => ArticleCreationTemplates::getLandingVariant( $this->getTitle() ), |
| 56 | + 'acwbucket' => ArticleCreationUtil::trackingBucket(), |
| 57 | + ); |
| 58 | + } |
41 | 59 | |
42 | 60 | } |