Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.i18n.php |
— | — | @@ -59,8 +59,6 @@ |
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)', |
65 | 63 | ); |
66 | 64 | |
67 | 65 | $messages['qqq'] = array( |
— | — | @@ -99,6 +97,4 @@ |
100 | 98 | |
101 | 99 | 'ac-create-help' => 'Link text for article creation help, goes in tooltip above text.', |
102 | 100 | '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', |
105 | 101 | ); |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | $wgHooks['BeforeDisplayNoArticleText'][] = 'ArticleCreationHooks::BeforeDisplayNoArticleText'; |
29 | 29 | $wgHooks['BeforeWelcomeCreation'][] = 'ArticleCreationHooks::BeforeWelcomeCreation'; |
30 | 30 | $wgHooks['AlternateEdit'][] = 'ArticleCreationHooks::AlternateEdit'; |
31 | | -$wgHooks['GetPreferences'][] = 'ArticleCreationHooks::getPreferences'; |
32 | 31 | |
33 | 32 | $wgHooks['ResourceLoaderGetConfigVars'][] = 'ArticleCreationHooks::resourceLoaderGetConfigVars'; |
34 | 33 | |
— | — | @@ -173,3 +172,5 @@ |
174 | 173 | ), |
175 | 174 | 'buttons' => $wgArticleCreationButtons, |
176 | 175 | ); |
| 176 | + |
| 177 | +$wgArticleCreationCutoff = '20110205'; |
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php |
— | — | @@ -55,10 +55,14 @@ |
56 | 56 | |
57 | 57 | // return false; |
58 | 58 | |
59 | | - global $wgOut; |
| 59 | + global $wgOut, $wgUser, $wgArticleCreationRegistrationCutoff; |
60 | 60 | |
61 | | - $wgOut->addModules( array( 'ext.articleCreation.init' ) ); |
| 61 | + $userRegistration = wfTimestamp( TS_MW, $wgUser->getRegistration() ); |
62 | 62 | |
| 63 | + if ( !$userRegistration || $userRegistration > $wgArticleCreationRegistrationCutoff ) { |
| 64 | + $wgOut->addModules( array( 'ext.articleCreation.init' ) ); |
| 65 | + } |
| 66 | + |
63 | 67 | return true; |
64 | 68 | } |
65 | 69 | |
— | — | @@ -69,21 +73,9 @@ |
70 | 74 | array( |
71 | 75 | 'tracking-turned-on' => ArticleCreationUtil::trackingEnabled(), |
72 | 76 | 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix(), |
73 | | - 'enabled' => $wgUser->getOption('ac-enable'), |
74 | 77 | ); |
75 | 78 | |
76 | 79 | return true; |
77 | 80 | } |
78 | 81 | |
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 | | - |
90 | 82 | } |