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

Revision: 98818
Author:   pgehres
Date:     2011-10-03 22:41:02 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
Adding support for country-localized pages in RapidHTML similar to LandingCheck 
functionality

Modified Paths:
--------------
    trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php

Modified: 
trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php
===================================================================
--- trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php   
2011-10-03 22:10:33 UTC (rev 98817)
+++ trunk/extensions/DonationInterface/payflowpro_gateway/forms/RapidHtml.php   
2011-10-03 22:41:02 UTC (rev 98818)
@@ -84,10 +84,22 @@
                parent::__construct( $form_data, $form_errors );
 
                $this->loadValidateJs();
+               $country = $wgRequest->getText( 'country', '' );
+
+               if ( $country != '' ){
+                       try{
+                               $country_based = $wgRequest->getText( 'ffname', 
'default' ) . '-' . $country;
+                               // set html-escaped filename.
+                               $this->set_html_file_path( htmlspecialchars( 
$country_based ));
+                       } catch ( MWException $mwe ) {
+                               // country-specific file does not exist, set 
html-escaped filename.
+                               $this->set_html_file_path( htmlspecialchars( 
$wgRequest->getText( 'ffname', 'default' )));
+                       }
+               } else {
+                       // set html-escaped filename.
+                       $this->set_html_file_path( htmlspecialchars( 
$wgRequest->getText( 'ffname', 'default' )));
+               }
                
-               // set html-escaped filename.
-               $this->set_html_file_path( htmlspecialchars( 
$wgRequest->getText( 'ffname', 'default' )));
-               
                // fix general form error messages so it's not an array of msgs
                if ( is_array( $form_errors[ 'general' ] ) && count( 
$form_errors[ 'general' ] )) {
                        $general_errors = "";


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to