r76909 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76908‎ | r76909 | r76910 >
Date:22:24, 17 November 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Merging from r76904 thru r76908 of trunk
Modified paths:
  • /branches/fundraising/deployment/DonationInterface (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/Form.php (modified) (history)
  • /branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetterCA.php (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetterCA.php
@@ -186,4 +186,38 @@
187187
188188 return $state_menu;
189189 }
 190+
 191+ public function generateCountryDropdown( $defaultCountry = 124 ) {
 192+ $country_options = '';
 193+
 194+ // create a new array of countries with potentially translated country names for alphabetizing later
 195+ foreach ( $this->getCountries() as $iso_value => $full_name ) {
 196+ $countries[ $iso_value ] = wfMsg( 'payflowpro_gateway-country-dropdown-' . $iso_value );
 197+ }
 198+
 199+ // alphabetically sort the country names
 200+ asort( $countries, SORT_STRING );
 201+
 202+ // generate a dropdown option for each country
 203+ foreach ( $countries as $iso_value => $full_name ) {
 204+ if ( $this->form_data[ 'country' ] ) {
 205+ $selected = ( $iso_value == $this->form_data[ 'country' ] ) ? true : false;
 206+ } else {
 207+ $selected = ( $iso_value == $defaultCountry ) ? true : false; // Select default
 208+ }
 209+ $country_options .= Xml::option( $full_name, $iso_value, $selected );
 210+ }
 211+
 212+ // build the actual select
 213+ $country_menu = Xml::openElement(
 214+ 'select',
 215+ array(
 216+ 'name' => 'country',
 217+ 'id' => 'country'
 218+ ) );
 219+ $country_menu .= $country_options;
 220+ $country_menu .= Xml::closeElement( 'select' );
 221+
 222+ return $country_menu;
 223+ }
190224 }
Index: branches/fundraising/deployment/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -153,7 +153,7 @@
154154 if ( $this->form_data[ 'country' ] ) {
155155 $selected = ( $iso_value == $this->form_data[ 'country' ] ) ? true : false;
156156 } else {
157 - $selected = ( $iso_value == $defaultCountry ) ? true : false; // Default to United States
 157+ $selected = ( $iso_value == $defaultCountry ) ? true : false; // Select default
158158 }
159159 $country_options .= Xml::option( $full_name, $iso_value, $selected );
160160 }
Property changes on: branches/fundraising/deployment/DonationInterface
___________________________________________________________________
Modified: svn:mergeinfo
161161 Merged /trunk/extensions/DonationInterface:r76904-76908

Follow-up revisions

RevisionCommit summaryAuthorDate
r76950Merging from r76909 thru r76949 of trunkawjrichards18:32, 18 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76904Merging from r76840 thru r76903 of trunkawjrichards20:58, 17 November 2010
r76908Tiny style & doc cleanupsaaron21:35, 17 November 2010

Status & tagging log