r111086 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111085‎ | r111086 | r111087 >
Date:20:50, 9 February 2012
Author:werdna
Status:reverted
Tags:
Comment:
ACW: Add preference to enable/disable. Currently just exposed in JS
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,6 +59,8 @@
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)',
6365 );
6466
6567 $messages['qqq'] = array(
@@ -97,4 +99,6 @@
98100
99101 'ac-create-help' => 'Link text for article creation help, goes in tooltip above text.',
100102 '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',
101105 );
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php
@@ -27,6 +27,7 @@
2828 $wgHooks['BeforeDisplayNoArticleText'][] = 'ArticleCreationHooks::BeforeDisplayNoArticleText';
2929 $wgHooks['BeforeWelcomeCreation'][] = 'ArticleCreationHooks::BeforeWelcomeCreation';
3030 $wgHooks['AlternateEdit'][] = 'ArticleCreationHooks::AlternateEdit';
 31+$wgHooks['GetPreferences'][] = 'ArticleCreationHooks::getPreferences';
3132
3233 $wgHooks['ResourceLoaderGetConfigVars'][] = 'ArticleCreationHooks::resourceLoaderGetConfigVars';
3334
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php
@@ -63,13 +63,27 @@
6464 }
6565
6666 public static function resourceLoaderGetConfigVars( &$vars ) {
67 - global $wgArticleCreationConfig;
 67+ global $wgArticleCreationConfig, $wgUser;
6868
6969 $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+ );
7275
7376 return true;
7477 }
7578
 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+
7690 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r111096Revert r111086 and try something else. Set a cutoff, and only send the init s...werdna21:19, 9 February 2012

Status & tagging log