r75136 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75135‎ | r75136 | r75137 >
Date:01:02, 21 October 2010
Author:kaldari
Status:deferred
Tags:
Comment:
layout changes and changes to TwoColumnLetter2.php
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter2.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.css (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter2.php
@@ -1,6 +1,7 @@
22 <?php
33
44 class PayflowProGateway_Form_TwoColumnLetter2 extends PayflowProGateway_Form_OneStepTwoColumn {
 5+ public $paypal = false; // true for paypal only version
56
67 public function __construct( &$form_data, &$form_errors ) {
78 global $wgOut, $wgScriptPath;
@@ -16,6 +17,8 @@
1718 public function generateFormStart() {
1819 global $wgOut, $wgRequest;
1920
 21+ $this->paypal = $wgRequest->getBool( 'paypal', false );
 22+
2023 $form = parent::generateBannerHeader();
2124
2225 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0));
@@ -84,18 +87,11 @@
8588
8689 $form = '';
8790
88 - // PayPal button
89 - // make sure we have a paypal url set to redirect the user to before displaying the button
90 - if ( strlen( $wgPayflowGatewayPaypalURL )) {
 91+ if ( !$this->paypal ) {
 92+ // PayPal button
9193 $form .= '<tr>';
9294 $form .= '<td class="label"></td>';
93 - $form .= '<td class="paypal-button">';
94 - $form .= Xml::hidden( 'PaypalRedirect', false );
95 - $form .= Xml::tags( 'div',
96 - array(),
97 - '<a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';document.payment.submit();"><img src="'.$scriptPath.'/donate_with_paypal.gif"/></a>'
98 - );
99 - $form .= '</td>';
 95+ $form .= '<td><a href="#" onclick="document.payment.PaypalRedirect.value=\'true\';document.payment.submit();"><img src="'.$scriptPath.'/donate_with_paypal.gif"/></a></td>';
10096 $form .= '</tr>';
10197 }
10298
@@ -105,6 +101,49 @@
106102 // email
107103 $form .= $this->getEmailField();
108104
 105+ // amount
 106+ $form .= $this->getAmountField();
 107+
 108+ if ( !$this->paypal ) {
 109+ // PayPal button
 110+ // make sure we have a paypal url set to redirect the user to before displaying the button
 111+ if ( strlen( $wgPayflowGatewayPaypalURL )) {
 112+ $form .= '<tr>';
 113+ $form .= '<td class="label"></td>';
 114+ $form .= '<td>';
 115+ $form .= Xml::hidden( 'PaypalRedirect', false );
 116+ $form .= Xml::tags( 'div',
 117+ array(),
 118+ Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" ))
 119+ );
 120+ $form .= '</td>';
 121+ $form .= '</tr>';
 122+ }
 123+
 124+ // card number
 125+ $form .= $this->getCardNumberField();
 126+
 127+ // cvv
 128+ $form .= $this->getCvvField();
 129+
 130+ // expiry
 131+ $form .= $this->getExpiryField();
 132+
 133+ // street
 134+ $form .= $this->getStreetField();
 135+
 136+ // city
 137+ $form .= $this->getCityField();
 138+
 139+ // state
 140+ $form .= $this->getStateField();
 141+ // zip
 142+ $form .= $this->getZipField();
 143+
 144+ // country
 145+ $form .= $this->getCountryField();
 146+ }
 147+
109148 // anonymous
110149 $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
111150 $form .= '<tr>';
@@ -115,38 +154,6 @@
116155 // email agreement
117156 $form .= $this->getEmailOptField();
118157
119 - // amount
120 - $form .= $this->getAmountField();
121 -
122 - // card logos
123 - $form .= '<tr>';
124 - $form .= '<td />';
125 - $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
126 - $form .= '</tr>';
127 -
128 - // card number
129 - $form .= $this->getCardNumberField();
130 -
131 - // cvv
132 - $form .= $this->getCvvField();
133 -
134 - // expiry
135 - $form .= $this->getExpiryField();
136 -
137 - // street
138 - $form .= $this->getStreetField();
139 -
140 - // city
141 - $form .= $this->getCityField();
142 -
143 - // state
144 - $form .= $this->getStateField();
145 - // zip
146 - $form .= $this->getZipField();
147 -
148 - // country
149 - $form .= $this->getCountryField();
150 -
151158 return $form;
152159 }
153160
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -458,14 +458,18 @@
459459 protected function getCardnumberField() {
460460 global $wgPayflowGatewayTest;
461461 $card_num = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'card_num' ] : '';
462 -
463 - $form = '<tr>';
464 - $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card_num'] . '</span></td>';
465 - $form .= '</tr>';
 462+ $form = '';
 463+ if ( $this->form_errors['card_num'] ) {
 464+ $form .= '<tr>';
 465+ $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card_num'] . '</span></td>';
 466+ $form .= '</tr>';
 467+ }
 468+ if ( $this->form_errors['card'] ) {
 469+ $form .= '<tr>';
 470+ $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card'] . '</span></td>';
 471+ $form .= '</tr>';
 472+ }
466473 $form .= '<tr>';
467 - $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card'] . '</span></td>';
468 - $form .= '</tr>';
469 - $form .= '<tr>';
470474 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-card-num' ), 'card_num' ) . '</td>';
471475 $form .= '<td>' . Xml::input( 'card_num', '30', $card_num, array( 'type' => 'text', 'maxlength' => '100', 'id' => 'card_num', 'class' => 'fullwidth', 'autocomplete' => 'off' ) ) .
472476 '</td>';
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php
@@ -104,7 +104,7 @@
105105 $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ));
106106 if ( $this->paypal ) {
107107 $form .= Xml::hidden( 'PaypalRedirect', false );
108 - $form .= Xml::element( 'input', array( 'class' => 'input-button button-navyblue', 'value' => wfMsg( 'payflowpro_gateway-submit-button'), 'onclick' => 'document.payment.PaypalRedirect.value=\'true\';document.payment.submit();', 'type' => 'submit'));
 108+ $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'));
109109 } else {
110110 $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-cc-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit'));
111111 $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
@@ -98,7 +98,7 @@
9999 'payflowpro_gateway-question-comment' => 'Questions or comments? Contact: <a href="mailto:donate@wikimedia.org">donate@wikimedia.org</a>',
100100 'payflowpro_gateway-donate-click' => 'Your credit card will be securely processed.',
101101 'payflowpro_gateway-otherways' => 'There are <a href="http://wikimediafoundation.org/wiki/Ways_to_Give/en">other ways to give, including PayPal, check, or mail</a>.',
102 - 'payflowpro_gateway-paypal' => 'Have a PayPal account? <a href="$1/index.php/Special:PayflowProGateway?paypal=true&masthead=none&form_name=$2&text_template=2010/JimmyAppealLong&language=en&utm_source=$3&utm_medium=$4&utm_campaign=$5">Donate with PayPal</a>.',
 102+ 'payflowpro_gateway-paypal' => 'Have a PayPal account? <a href="$1/index.php/Special:PayflowProGateway?_cache_=true&paypal=true&masthead=none&form_name=$2&text_template=2010/JimmyAppealLong&language=en&utm_source=$3&utm_medium=$4&utm_campaign=$5">Donate with PayPal</a>.',
103103 'payflowpro_gateway-credit-storage-processing' => 'We do not store your credit card information, and your personal data is subject to our <a href="http://wikimediafoundation.org/wiki/Donor_Privacy_Policy">privacy policy</a>.',
104104 'payflowpro_gateway-token-mismatch' => 'Your session has expired. Please try filling out and submitting the form again.',
105105 'payflowpro_gateway-cc-form-header-personal' => 'Billing information',
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.css
@@ -30,7 +30,7 @@
3131 }
3232
3333 #payflowpro_gateway-form-submit {
34 - margin-top: 1.5em;
 34+ margin-top: 1.2em;
3535 text-align: center;
3636 margin-bottom: 1em;
3737 }

Status & tagging log