Yuvipanda has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/81162


Change subject: Use parsedConfig instead of rawConfig wherever possible
......................................................................

Use parsedConfig instead of rawConfig wherever possible

This centralizes wikitext parsing at one spot, than spread out

Change-Id: I56b0ad0361d1e22a300b4193f39869412c435372
---
M includes/UploadWizardConfig.php
M includes/specials/SpecialUploadWizard.php
2 files changed, 2 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/62/81162/1

diff --git a/includes/UploadWizardConfig.php b/includes/UploadWizardConfig.php
index 7d88006..5ab9961 100644
--- a/includes/UploadWizardConfig.php
+++ b/includes/UploadWizardConfig.php
@@ -147,7 +147,7 @@
                        $campaign = UploadWizardCampaign::newFromName( 
$campaignName );
 
                        if ( $campaign !== false && $campaign->getIsEnabled() ) 
{
-                               return $campaign->getConfig();
+                               return $campaign->getParsedConfig();
                        }
                }
 
diff --git a/includes/specials/SpecialUploadWizard.php 
b/includes/specials/SpecialUploadWizard.php
index 677bfce..df1837a 100644
--- a/includes/specials/SpecialUploadWizard.php
+++ b/includes/specials/SpecialUploadWizard.php
@@ -177,17 +177,6 @@
 
                $config = UploadWizardConfig::getConfig( $this->campaign );
 
-               if ( array_key_exists( 'fields', $config ) ) {
-                       foreach ( $config['fields'] as &$field ) {
-                               if ( array_key_exists( 'label', $field ) ) {
-                                       $labelContent = 
$this->getOutput()->parseInline( $field['label'] );
-                                       if ( $labelContent !== false ) {
-                                               $field['label'] = $labelContent;
-                                       }
-                               }
-                       }
-               }
-
                if ( array_key_exists( 'trackingCategory', $config )  ) {
                        if ( array_key_exists( 'campaign', 
$config['trackingCategory'] ) ) {
                                if ( $this->campaign !== null ) {
@@ -206,13 +195,6 @@
                        $config['UploadFromUrl'] = true;
                } else {
                        $config['UploadFromUrl'] = false;
-               }
-
-               if ( array_key_exists( 'display', $config ) && 
array_key_exists( 'thanksLabel', $config['display'] ) ) {
-                       $thanksLabelContent = $this->getOutput()->parseInline( 
$config['display']['thanksLabel'] );
-                       if ( $thanksLabelContent !== false ) {
-                               $config['display']['thanksLabel'] = 
$thanksLabelContent;
-                       }
                }
 
                // Get the user's default license. This will usually be 
'default', but
@@ -337,7 +319,7 @@
                $config = UploadWizardConfig::getConfig( $this->campaign );
 
                if ( array_key_exists( 'display', $config ) && 
array_key_exists( 'headerLabel', $config['display'] ) ) {
-                       $this->getOutput()->addWikiText( 
$config['display']['headerLabel'] );
+                       $this->getOutput()->addHtml( 
$config['display']['headerLabel'] );
                }
 
                if ( array_key_exists( 'fallbackToAltUploadForm', $config )

-- 
To view, visit https://gerrit.wikimedia.org/r/81162
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I56b0ad0361d1e22a300b4193f39869412c435372
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to