http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95159

Revision: 95159
Author:   jeroendedauw
Date:     2011-08-21 17:40:12 +0000 (Sun, 21 Aug 2011)
Log Message:
-----------
added setting to change the thanks message on use page

Modified Paths:
--------------
    trunk/extensions/UploadWizard/UploadWizard.config.php
    trunk/extensions/UploadWizard/UploadWizard.i18n.php
    trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php
    trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php
    trunk/extensions/UploadWizard/resources/mw.UploadWizard.js

Modified: trunk/extensions/UploadWizard/UploadWizard.config.php
===================================================================
--- trunk/extensions/UploadWizard/UploadWizard.config.php       2011-08-21 
17:20:58 UTC (rev 95158)
+++ trunk/extensions/UploadWizard/UploadWizard.config.php       2011-08-21 
17:40:12 UTC (rev 95159)
@@ -31,6 +31,11 @@
        // $1 is replaced by the language code.
        'headerLabelPage' => '',
 
+       // Page containing the (wiki)text to display on top of the "use" page.
+       // $1 is replaced by the language code.
+       // When not provided, the message mwe-upwiz-thanks-intro will be used.
+       'thanksLabelPage' => '',
+
        // Should the own work option be shown, and if not, what option should 
be set?
        // Possible values: choice, own, notown
        'ownWorkOption' => 'choice',

Modified: trunk/extensions/UploadWizard/UploadWizard.i18n.php
===================================================================
--- trunk/extensions/UploadWizard/UploadWizard.i18n.php 2011-08-21 17:20:58 UTC 
(rev 95158)
+++ trunk/extensions/UploadWizard/UploadWizard.i18n.php 2011-08-21 17:40:12 UTC 
(rev 95159)
@@ -327,6 +327,7 @@
        'mwe-upwiz-campaign-conf-idFieldLabel' => 'Id field label text',
        'mwe-upwiz-campaign-conf-idFieldLabelPage' => 'Page name with text for 
the id field label. $1 is replaced with the language code',
        'mwe-upwiz-campaign-conf-headerLabelPage' => 'Page containing text to 
display above the UploadWizard interface. $1 is replaced with the language 
code',
+       'mwe-upwiz-campaign-conf-thanksLabelPage' => 'Page containing text to 
display on top of the "Use" page. $1 is replaced with the language code',
 
        // Coolcats
        'mw-coolcats-confirm-new-title' => 'Confirm new category',

Modified: trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php
===================================================================
--- trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php     
2011-08-21 17:20:58 UTC (rev 95158)
+++ trunk/extensions/UploadWizard/includes/UploadWizardCampaign.php     
2011-08-21 17:40:12 UTC (rev 95159)
@@ -199,12 +199,15 @@
                                'type' => 'text'
                        ),
                        'autoCategories' => array( 
-                               'type' => 'text' 
+                               'type' => 'text'
                        ),
                        'autoWikiText' => array( 
                                'type' => 'textarea',
                                'rows' => 4
                        ),
+                       'thanksLabelPage' => array(
+                               'type' => 'text'
+                       ),
                );
                
                foreach ( $globalConfig['licensesOwnWork']['licenses'] as 
$license ) {

Modified: 
trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php
===================================================================
--- trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php     
2011-08-21 17:20:58 UTC (rev 95158)
+++ trunk/extensions/UploadWizard/includes/specials/SpecialUploadWizard.php     
2011-08-21 17:40:12 UTC (rev 95159)
@@ -139,6 +139,8 @@
                        $config['idFieldLabel'] = $labelPageContent;
                }
                
+               $config['thanksLabel'] = $this->getPageContent( 
$config['thanksLabelPage'], true );
+               
                $wgOut->addScript( 
                        Skin::makeVariablesScript( 
                                array(
@@ -159,10 +161,11 @@
         * @since 1.2
         * 
         * @param string $pageName
+        * @param boolean $parse
         * 
         * @return string|false
         */
-       protected function getPageContent( $pageName ) {
+       protected function getPageContent( $pageName, $parse = false ) {
                $content = false;
                
                if ( trim( $pageName ) != '' ) {
@@ -172,6 +175,11 @@
                        if ( !is_null( $page ) && $page->exists() ) {
                                $article = new Article( $page, 0 );
                                $content = $article->getContent();
+                               
+                               if ( $parse ) {
+                                       global $wgOut;
+                                       $content = $wgOut->parse( $content );
+                               }
                        }
                }
                

Modified: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
===================================================================
--- trunk/extensions/UploadWizard/resources/mw.UploadWizard.js  2011-08-21 
17:20:58 UTC (rev 95158)
+++ trunk/extensions/UploadWizard/resources/mw.UploadWizard.js  2011-08-21 
17:40:12 UTC (rev 95159)
@@ -1721,10 +1721,21 @@
        prefillThanksPage: function() {
                var _this = this;
 
+               var thnxHeader = $j( '<h3 style="text-align: center;"></h3>' );
+               
+               if ( mw.UploadWizard.config.thanksLabel === false ) {
+                       thnxHeader.msg( 'mwe-upwiz-thanks-intro' );
+               }
+               else {
+                       thnxHeader.html( mw.UploadWizard.config.thanksLabel );
+               }
+               
                $j( '#mwe-upwiz-thanks' )
-                       .append( $j( '<h3 style="text-align: center;"></h3>' 
).msg( 'mwe-upwiz-thanks-intro' ),
-                                $j( '<p style="margin-bottom: 2em; text-align: 
center;">' )
-                                       .msg( 'mwe-upwiz-thanks-explain', 
_this.uploads.length ) );
+                       .append(
+                               thnxHeader,
+                               $j( '<p style="margin-bottom: 2em; text-align: 
center;">' )
+                                       .msg( 'mwe-upwiz-thanks-explain', 
_this.uploads.length )
+                       );
 
                $j.each( _this.uploads, function(i, upload) {
                        var id = 'thanksDiv' + i;


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

Reply via email to