r111096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111095‎ | r111096 | r111097 >
Date:21:19, 9 February 2012
Author:werdna
Status:ok
Tags:
Comment:
Revert r111086 and try something else. Set a cutoff, and only send the init script if the user is anonymous or registered after a configurable cutoff
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.i18n.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.i18n.php
@@ -59,8 +59,6 @@
6060
6161 'ac-create-help' => 'Learn more',
6262 'ac-click-tip-title-create' => 'I know that…',
63 -
64 - 'ac-preference-enable' => 'Enable new article creation workflow (experimental)',
6563 );
6664
6765 $messages['qqq'] = array(
@@ -99,6 +97,4 @@
10098
10199 'ac-create-help' => 'Link text for article creation help, goes in tooltip above text.',
102100 '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',
105101 );
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php
@@ -27,7 +27,6 @@
2828 $wgHooks['BeforeDisplayNoArticleText'][] = 'ArticleCreationHooks::BeforeDisplayNoArticleText';
2929 $wgHooks['BeforeWelcomeCreation'][] = 'ArticleCreationHooks::BeforeWelcomeCreation';
3030 $wgHooks['AlternateEdit'][] = 'ArticleCreationHooks::AlternateEdit';
31 -$wgHooks['GetPreferences'][] = 'ArticleCreationHooks::getPreferences';
3231
3332 $wgHooks['ResourceLoaderGetConfigVars'][] = 'ArticleCreationHooks::resourceLoaderGetConfigVars';
3433
@@ -173,3 +172,5 @@
174173 ),
175174 'buttons' => $wgArticleCreationButtons,
176175 );
 176+
 177+$wgArticleCreationCutoff = '20110205';
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php
@@ -55,10 +55,14 @@
5656
5757 // return false;
5858
59 - global $wgOut;
 59+ global $wgOut, $wgUser, $wgArticleCreationRegistrationCutoff;
6060
61 - $wgOut->addModules( array( 'ext.articleCreation.init' ) );
 61+ $userRegistration = wfTimestamp( TS_MW, $wgUser->getRegistration() );
6262
 63+ if ( !$userRegistration || $userRegistration > $wgArticleCreationRegistrationCutoff ) {
 64+ $wgOut->addModules( array( 'ext.articleCreation.init' ) );
 65+ }
 66+
6367 return true;
6468 }
6569
@@ -69,21 +73,9 @@
7074 array(
7175 'tracking-turned-on' => ArticleCreationUtil::trackingEnabled(),
7276 'tracking-code-prefix' => ArticleCreationUtil::trackingCodePrefix(),
73 - 'enabled' => $wgUser->getOption('ac-enable'),
7477 );
7578
7679 return true;
7780 }
7881
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 -
9082 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r111114Reimplement bucketing using the new PHPBucket interface. Sadly, it works better.werdna22:32, 9 February 2012
r111129followup to -r111096 - correct the global variable name for cutoff timebsitu00:00, 10 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111086ACW: Add preference to enable/disable. Currently just exposed in JSwerdna20:50, 9 February 2012

Status & tagging log