r76771 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76770‎ | r76771 | r76772 >
Date:03:43, 16 November 2010
Author:kaldari
Status:deferred
Tags:
Comment:
new state drop down
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter3.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter3.php
@@ -260,4 +260,31 @@
261261 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info
262262 return $form;
263263 }
 264+
 265+ public function generateStateDropdown() {
 266+ require_once( dirname( __FILE__ ) . '/../includes/stateAbbreviations.inc' );
 267+
 268+ $states = statesMenuXML();
 269+
 270+ $state_opts = Xml::option( '', ' ' );
 271+
 272+ // generate dropdown of state opts
 273+ foreach ( $states as $value => $state_name ) {
 274+ if ( $value !== 'YY' && $value !== 'XX' ) {
 275+ $selected = ( $this->form_data[ 'state' ] == $value ) ? true : false;
 276+ $state_opts .= Xml::option( $value, $value, $selected );
 277+ }
 278+ }
 279+
 280+ $state_menu = Xml::openElement(
 281+ 'select',
 282+ array(
 283+ 'name' => 'state',
 284+ 'id' => 'state'
 285+ ) );
 286+ $state_menu .= $state_opts;
 287+ $state_menu .= Xml::closeElement( 'select' );
 288+
 289+ return $state_menu;
 290+ }
264291 }

Status & tagging log