Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter3.php |
— | — | @@ -260,4 +260,31 @@ |
261 | 261 | $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info |
262 | 262 | return $form; |
263 | 263 | } |
| 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 | + } |
264 | 291 | } |