Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.i18n.php |
— | — | @@ -59,6 +59,8 @@ |
60 | 60 | |
61 | 61 | 'ac-create-help' => 'Learn more', |
62 | 62 | 'ac-click-tip-title-create' => 'I know that…', |
| 63 | + |
| 64 | + 'ac-preference-enable' => 'Enable new article creation workflow (experimental)', |
63 | 65 | ); |
64 | 66 | |
65 | 67 | $messages['qqq'] = array( |
— | — | @@ -97,4 +99,6 @@ |
98 | 100 | |
99 | 101 | 'ac-create-help' => 'Link text for article creation help, goes in tooltip above text.', |
100 | 102 | 'ac-click-tip-title-create' => 'Title for reasons that an article might be deleted', |
| 103 | + |
| 104 | + 'ac-preference-enable' => 'Name of preference for enabling this extension for a user', |
101 | 105 | ); |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | $wgHooks['BeforeDisplayNoArticleText'][] = 'ArticleCreationHooks::BeforeDisplayNoArticleText'; |
29 | 29 | $wgHooks['BeforeWelcomeCreation'][] = 'ArticleCreationHooks::BeforeWelcomeCreation'; |
30 | 30 | $wgHooks['AlternateEdit'][] = 'ArticleCreationHooks::AlternateEdit'; |
| 31 | +$wgHooks['GetPreferences'][] = 'ArticleCreationHooks::getPreferences'; |
31 | 32 | |
32 | 33 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'ArticleCreationHooks::resourceLoaderGetConfigVars'; |
33 | 34 | |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php |
— | — | @@ -63,13 +63,27 @@ |
64 | 64 | } |
65 | 65 | |
66 | 66 | public static function resourceLoaderGetConfigVars( &$vars ) { |
67 | | - global $wgArticleCreationConfig; |
| 67 | + global $wgArticleCreationConfig, $wgUser; |
68 | 68 | |
69 | 69 | $vars['acConfig'] = $wgArticleCreationConfig + |
70 | | - array('tracking-turned-on' => ArticleCreationUtil::trackingEnabled(), |
71 | | - 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix() ); |
| 70 | + array( |
| 71 | + 'tracking-turned-on' => ArticleCreationUtil::trackingEnabled(), |
| 72 | + 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix(), |
| 73 | + 'enabled' => $wgUser->getOption('ac-enable'), |
| 74 | + ); |
72 | 75 | |
73 | 76 | return true; |
74 | 77 | } |
75 | 78 | |
| 79 | + public static function getPreferences( $user, &$preferences ) { |
| 80 | + $preferences['ac-enable'] = array( |
| 81 | + 'section' => 'editing/labs', |
| 82 | + 'label-message' => 'ac-preference-enable', |
| 83 | + 'type' => 'toggle', |
| 84 | + 'default' => 0, |
| 85 | + ); |
| 86 | + |
| 87 | + return true; |
| 88 | + } |
| 89 | + |
76 | 90 | } |