r110895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110894‎ | r110895 | r110896 >
Date:23:20, 7 February 2012
Author:werdna
Status:ok
Tags:
Comment:
Add ext.articleCreation.init hook stub for Ian to fill in
Modified paths:
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php (modified) (history)
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init (added) (history)
  • /trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js (added) (history)

Diff [purge]

Index: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
@@ -0,0 +1,3 @@
 2+(function($,mw) {
 3+
 4+})( jQuery, window.mediaWiki );
\ No newline at end of file
Property changes on: trunk/extensions/ArticleCreationWorkflow/modules/ext.articleCreation.init/ext.articleCreation.init.js
___________________________________________________________________
Added: svn:eol-style
15 + native
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.php
@@ -38,6 +38,10 @@
3939 'remoteExtPath' => 'ArticleCreationWorkflow/modules'
4040 );
4141
 42+$wgResourceModules['ext.articleCreation.init'] = $acResourceTemplate + array(
 43+ 'scripts' => 'ext.articleCreation.init/ext.articleCreation.init.js',
 44+);
 45+
4246 $wgResourceModules['ext.articleCreation.core'] = $acResourceTemplate + array (
4347 'styles' => 'ext.articleCreation.core/ext.articleCreation.core.css',
4448 'scripts' => 'ext.articleCreation.core/ext.articleCreation.core.js',
Index: trunk/extensions/ArticleCreationWorkflow/ArticleCreationWorkflow.hooks.php
@@ -41,16 +41,22 @@
4242 * Customized html that shows an article doesn't exist
4343 */
4444 public static function BeforeDisplayNoArticleText( $article, &$text, $errors, $wgUser, &$wikiText ) {
45 - global $wgGroupPermissions;
 45+ // global $wgGroupPermissions;
 46+ //
 47+ // // Show the custom page if there is no error or the user is not loggin and anonmyous edit
 48+ // // is not allowed
 49+ // if ( !count( $errors ) || ( $wgUser->isAnon() && !$wgGroupPermissions['*']['edit'] ) ) {
 50+ // $text = ArticleCreationTemplates::showMissingPage( $article );
 51+ // $wikiText = false;
 52+ // }
4653
47 - // Show the custom page if there is no error or the user is not loggin and anonmyous edit
48 - // is not allowed
49 - if ( !count( $errors ) || ( $wgUser->isAnon() && !$wgGroupPermissions['*']['edit'] ) ) {
50 - $text = ArticleCreationTemplates::showMissingPage( $article );
51 - $wikiText = false;
52 - }
 54+ // return false;
5355
54 - return false;
 56+ global $wgOut;
 57+
 58+ $wgOut->addModules( array( 'ext.articleCreation.init' ) );
 59+
 60+ return true;
5561 }
5662
5763 public static function resourceLoaderGetConfigVars( &$vars ) {

Status & tagging log