r75981 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75980‎ | r75981 | r75982 >
Date:02:55, 4 November 2010
Author:kaldari
Status:deferred
Tags:
Comment:
more stuff for TwoColumnLetter5.php
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/validate_input.js
@@ -22,6 +22,17 @@
2323 }
2424 }
2525
 26+function switchToPayPal() {
 27+ document.getElementById('payflow-table-cc').style.display = 'none';
 28+ document.getElementById('payflowpro_gateway-form-submit').style.display = 'none';
 29+ document.getElementById('payflowpro_gateway-form-submit-paypal').style.display = 'block';
 30+}
 31+function switchToCreditCard() {
 32+ document.getElementById('payflow-table-cc').style.display = 'table';
 33+ document.getElementById('payflowpro_gateway-form-submit').style.display = 'block';
 34+ document.getElementById('payflowpro_gateway-form-submit-paypal').style.display = 'none';
 35+}
 36+
2637 function validate_form( form ) {
2738 var msg = [ 'EmailAdd', 'Fname', 'Lname', 'Street', 'City', 'State', 'Zip', 'CardNum', 'Cvv' ];
2839
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter5.php
@@ -101,31 +101,16 @@
102102
103103 $form .= '<tr>';
104104 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-payment-type' ), 'payment_method' ) . '</td>';
105 - $form .= '<td>' . Xml::radio( 'payment_method', 1, $this->form_data['payment_method'] == 1, array( 'onclick' => 'document.getElementById(\'payflow-table-paypal\').style.display = \'none\';document.getElementById(\'payflow-table-cc\').style.display = \'table\';' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-visa.png" ) ) .
106 - Xml::radio( 'payment_method', 2, $this->form_data['payment_method'] == 2, array( 'onclick' => 'document.getElementById(\'payflow-table-paypal\').style.display = \'none\';document.getElementById(\'payflow-table-cc\').style.display = \'table\';' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-mastercard.png" ) ) .
107 - Xml::radio( 'payment_method', 3, $this->form_data['payment_method'] == 3, array( 'onclick' => 'document.getElementById(\'payflow-table-paypal\').style.display = \'none\';document.getElementById(\'payflow-table-cc\').style.display = \'table\';' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-amex.png" ) ) .
108 - Xml::radio( 'payment_method', 4, $this->form_data['payment_method'] == 4, array( 'onclick' => 'document.getElementById(\'payflow-table-paypal\').style.display = \'none\';document.getElementById(\'payflow-table-cc\').style.display = \'table\';' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-discover.png" ) ) .
109 - Xml::radio( 'payment_method', 5, $this->form_data['payment_method'] == 5, array( 'onclick' => 'document.getElementById(\'payflow-table-cc\').style.display = \'none\';document.getElementById(\'payflow-table-paypal\').style.display = \'table\';' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-paypal.png" ) ) .
 105+ $form .= '<td>' . Xml::radio( 'payment_method', 'cc1', $this->form_data['payment_method'] == 'cc1', array( 'onclick' => 'switchToCreditCard()' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-visa.png" ) ) .
 106+ Xml::radio( 'payment_method', 'cc2', $this->form_data['payment_method'] == 'cc2', array( 'onclick' => 'switchToCreditCard()' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-mastercard.png" ) ) .
 107+ Xml::radio( 'payment_method', 'cc3', $this->form_data['payment_method'] == 'cc3', array( 'onclick' => 'switchToCreditCard()' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-amex.png" ) ) .
 108+ Xml::radio( 'payment_method', 'cc4', $this->form_data['payment_method'] == 'cc4', array( 'onclick' => 'switchToCreditCard()' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-discover.png" ) ) .
 109+ Xml::radio( 'payment_method', 'pp', $this->form_data['payment_method'] == 'pp', array( 'onclick' => 'switchToPayPal()' ) ) . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/card-paypal.png" ) ) .
110110 '</td>';
111111 $form .= '</tr>';
112112
113113 $form .= '</table>';
114114
115 - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-paypal', 'style' => 'display:none;' ) );
116 - if ( strlen( $wgPayflowGatewayPaypalURL ) ) {
117 - $form .= '<tr>';
118 - $form .= '<td class="label"></td>';
119 - $form .= '<td>';
120 - $form .= Html::hidden( 'PaypalRedirect', false );
121 - $form .= Xml::tags( 'div',
122 - array(),
123 - 'test'
124 - );
125 - $form .= '</td>';
126 - $form .= '</tr>';
127 - }
128 - $form .= '</table>';
129 -
130115 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
131116
132117 // card number
@@ -165,20 +150,23 @@
166151 }
167152
168153 public function generateFormSubmit() {
169 - // submit button
 154+ // cc submit button
170155 $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit' ) );
171156 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
172 - if ( $this->paypal ) {
173 - $form .= Html::hidden( 'PaypalRedirect', false );
174 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit' ) );
175 - } else {
176 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'submit_form( this )', 'type' => 'submit' ) );
177 - $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
178 - $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
179 - wfMsg( 'payflowpro_gateway-donate-click' );
180 - }
 157+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-donor-submit' ), 'onclick' => 'submit_form( this )', 'type' => 'submit' ) );
 158+ $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
 159+ $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
 160+ wfMsg( 'payflowpro_gateway-donate-click' );
181161 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
182162 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
 163+
 164+ // paypal submit button
 165+ $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit-paypal' ) );
 166+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ) );
 167+ $form .= Html::hidden( 'PaypalRedirect', false );
 168+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-paypal-button' ), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit' ) );
 169+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
 170+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
183171
184172 return $form;
185173 }

Status & tagging log