r93272 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93271‎ | r93272 | r93273 >
Date:14:41, 27 July 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
added option to silentily set wikitext
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizard.config.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php (modified) (history)
  • /trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaign.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizard.config.php
@@ -24,6 +24,9 @@
2525 // Categories to list by default in the list of cats to add.
2626 'defaultCategories' => array( 'Foobar', 'Locations' ),
2727
 28+ // WikiText to automatically (and silently) add to all uploaded images.
 29+ 'autoWikiText' => '',
 30+
2831 // 'licenses' is a list of licenses you could possibly use elsewhere, for instance in
2932 // licensesOwnWork or licensesThirdParty.
3033 // It just describes what licenses go with what wikitext, and how to display them in
Index: trunk/extensions/UploadWizard/includes/specials/SpecialUploadCampaign.php
@@ -69,16 +69,17 @@
7070 // Special handling for lists of values per input type.
7171 if ( is_array( $data['default'] ) ) {
7272 switch ( $data['type'] ) {
73 - case 'text':
 73+ case 'text': case 'textarea':
7474 $data['default'] = implode( ', ', $data['default'] );
7575 break;
7676 }
77 -
78 - $fields[$name] = $data;
7977 }
80 - else {
81 - $fields[$name] = $data;
 78+
 79+ if ( $data['type'] == 'textarea' ) {
 80+ $data['rows'] = 4;
8281 }
 82+
 83+ $fields[$name] = $data;
8384 }
8485
8586 return $fields;
Index: trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php
@@ -154,6 +154,7 @@
155155 'skipTutorial' => 'check',
156156 'autoCategories' => 'text',
157157 'defaultCategories' => 'text',
 158+ 'autoWikiText' => 'textarea',
158159 );
159160 }
160161
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -301,6 +301,7 @@
302302 'mwe-upwiz-campaign-conf-skipTutorial' => 'Skip the licensing tutorial',
303303 'mwe-upwiz-campaign-conf-autoCategories' => 'Categories to add the files to automatically and silently',
304304 'mwe-upwiz-campaign-conf-defaultCategories' => 'Default categories to list in the describe tab',
 305+ 'mwe-upwiz-campaign-conf-autoWikiText' => 'WikiText to automatically add to all uploaded images',
305306
306307 // Coolcats
307308 'mw-coolcats-confirm-new-title' => 'Confirm new category',
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -688,6 +688,10 @@
689689 wikiText += "=={{int:license-header}}==\n";
690690 wikiText += deed.getLicenseWikiText() + "\n\n";
691691
 692+ if ( mw.isDefined( mw.UploadWizard.config.autoWikiText ) ) {
 693+ wikiText += mw.UploadWizard.config.autoWikiText;
 694+ }
 695+
692696 // add categories
693697 wikiText += _this.div.find( '.categoryInput' ).get(0).getWikiText() + "\n\n";
694698

Comments

#Comment by NeilK (talk | contribs)   13:13, 22 August 2011

Where did 4 come from? That seems rather arbitrary. But this is removed later so I assume that was demo data or a temporary idea.

Status & tagging log