r74839 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74838‎ | r74839 | r74840 >
Date:17:17, 16 October 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Removed trailing whitespace and updated files to tabbed indentation where spaces were used.
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/SingleColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnPayPal.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php
@@ -2,207 +2,207 @@
33
44 class PayflowProGateway_Form_TwoStepTwoColumn extends PayflowProGateway_Form {
55
6 - public function __construct( &$form_data, &$form_errors ) {
7 - global $wgOut, $wgScriptPath;
 6+ public function __construct( &$form_data, &$form_errors ) {
 7+ global $wgOut, $wgScriptPath;
88
9 - parent::__construct( $form_data, $form_errors );
 9+ parent::__construct( $form_data, $form_errors );
1010
11 - // we only want to load this JS if the form is being rendered
12 - $this->loadValidateJs(); // validation JS
 11+ // we only want to load this JS if the form is being rendered
 12+ $this->loadValidateJs(); // validation JS
1313
14 - $first = wfMsg( 'payflowpro_gateway-first' );
15 - $last = wfMsg( 'payflowpro_gateway-last' );
16 - $js = <<<EOT
 14+ $first = wfMsg( 'payflowpro_gateway-first' );
 15+ $last = wfMsg( 'payflowpro_gateway-last' );
 16+ $js = <<<EOT
1717 <script type="text/javascript">
1818 function loadPlaceholders() {
19 - var fname = document.getElementById('fname');
20 - var lname = document.getElementById('lname');
21 - var amountOther = document.getElementById('amountOther');
22 - if (fname.value == '') {
23 - fname.style.color = '#999999';
24 - fname.value = '$first';
25 - }
26 - if (lname.value == '') {
27 - lname.style.color = '#999999';
28 - lname.value = '$last';
29 - }
 19+ var fname = document.getElementById('fname');
 20+ var lname = document.getElementById('lname');
 21+ var amountOther = document.getElementById('amountOther');
 22+ if (fname.value == '') {
 23+ fname.style.color = '#999999';
 24+ fname.value = '$first';
 25+ }
 26+ if (lname.value == '') {
 27+ lname.style.color = '#999999';
 28+ lname.value = '$last';
 29+ }
3030 }
3131 addEvent( window, 'load', loadPlaceholders );
3232 </script>
3333 EOT;
34 - $wgOut->addHeadItem( 'placeholders', $js );
35 - }
 34+ $wgOut->addHeadItem( 'placeholders', $js );
 35+ }
3636
37 - /**
38 - * Required method for constructing the entire form
39 - *
40 - * This can of course be overloaded by a child class.
41 - * @return string The entire form HTML
42 - */
43 - public function getForm() {
44 - $form = $this->generateFormStart();
45 - $form .= $this->getCaptchaHTML();
46 - $form .= $this->generateFormSubmit();
47 - $form .= $this->generateFormEnd();
48 - return $form;
49 - }
 37+ /**
 38+ * Required method for constructing the entire form
 39+ *
 40+ * This can of course be overloaded by a child class.
 41+ * @return string The entire form HTML
 42+ */
 43+ public function getForm() {
 44+ $form = $this->generateFormStart();
 45+ $form .= $this->getCaptchaHTML();
 46+ $form .= $this->generateFormSubmit();
 47+ $form .= $this->generateFormEnd();
 48+ return $form;
 49+ }
5050
51 - public function generateFormStart() {
52 - global $wgPayflowGatewayHeader, $wgPayflwGatewayTest, $wgOut;
53 - $form = $this->generateBannerHeader();
 51+ public function generateFormStart() {
 52+ global $wgPayflowGatewayHeader, $wgPayflwGatewayTest, $wgOut;
 53+ $form = $this->generateBannerHeader();
5454
55 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
 55+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
5656
57 - // provide a place at the top of the form for displaying general messages
58 - if ( $this->form_errors['general'] ) {
59 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
60 - if ( is_array( $this->form_errors['general'] )) {
61 - foreach ( $this->form_errors['general'] as $this->form_errors_msg ) {
62 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
63 - }
64 - } else {
65 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
66 - }
67 - $form .= Xml::closeElement( 'div' );
68 - }
 57+ // provide a place at the top of the form for displaying general messages
 58+ if ( $this->form_errors['general'] ) {
 59+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
 60+ if ( is_array( $this->form_errors['general'] )) {
 61+ foreach ( $this->form_errors['general'] as $this->form_errors_msg ) {
 62+ $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
 63+ }
 64+ } else {
 65+ $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
 66+ }
 67+ $form .= Xml::closeElement( 'div' );
 68+ }
6969
70 - // add noscript tags for javascript disabled browsers
71 - $form .= $this->getNoScript();
72 -
73 - // open form
74 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
 70+ // add noscript tags for javascript disabled browsers
 71+ $form .= $this->getNoScript();
7572
76 - // Xml::element seems to convert html to htmlentities
77 - $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
78 - $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
 73+ // open form
 74+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
7975
80 - $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payflow-cc-form-section'));
81 - $form .= $this->generatePersonalContainer();
82 - $form .= Xml::closeElement( 'div' ); // close div#left-column
 76+ // Xml::element seems to convert html to htmlentities
 77+ $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
 78+ $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
8379
84 - $form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payflow-cc-form-section' ));
85 - $form .= $this->generatePaymentContainer();
 80+ $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payflow-cc-form-section'));
 81+ $form .= $this->generatePersonalContainer();
 82+ $form .= Xml::closeElement( 'div' ); // close div#left-column
8683
87 - return $form;
88 - }
 84+ $form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payflow-cc-form-section' ));
 85+ $form .= $this->generatePaymentContainer();
8986
90 - public function generateFormSubmit() {
91 - // submit button
92 - $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit'));
93 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ));
94 - //$form .= Xml::submitButton( wfMsg( 'payflowpro_gateway-submit-button' ));
95 - $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-cc-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit'));
96 - $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
97 - $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
98 - wfMsg( 'payflowpro_gateway-donate-click' );
99 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
100 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
101 - return $form;
102 - }
 87+ return $form;
 88+ }
10389
104 - public function generateFormEnd() {
105 - $form = '';
106 - // add hidden fields
107 - $hidden_fields = $this->getHiddenFields();
108 - foreach ( $hidden_fields as $field => $value ) {
109 - $form .= Xml::hidden( $field, $value );
110 - }
111 - $form .= Xml::closeElement( 'div' ); // close div#right-column
112 - $form .= Xml::closeElement( 'form' );
113 - $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form
114 - $form .= $this->generateDonationFooter();
115 - $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard
116 - return $form;
117 - }
 90+ public function generateFormSubmit() {
 91+ // submit button
 92+ $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit'));
 93+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ));
 94+ //$form .= Xml::submitButton( wfMsg( 'payflowpro_gateway-submit-button' ));
 95+ $form .= Xml::element( 'input', array( 'class' => 'button-plain', 'value' => wfMsg( 'payflowpro_gateway-cc-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit'));
 96+ $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
 97+ $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
 98+ wfMsg( 'payflowpro_gateway-donate-click' );
 99+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
 100+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
 101+ return $form;
 102+ }
118103
119 - protected function generatePersonalContainer() {
120 - $form = '';
121 - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' )); ;
122 - $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-cc-form-header-personal' ));
123 - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
 104+ public function generateFormEnd() {
 105+ $form = '';
 106+ // add hidden fields
 107+ $hidden_fields = $this->getHiddenFields();
 108+ foreach ( $hidden_fields as $field => $value ) {
 109+ $form .= Xml::hidden( $field, $value );
 110+ }
 111+ $form .= Xml::closeElement( 'div' ); // close div#right-column
 112+ $form .= Xml::closeElement( 'form' );
 113+ $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form
 114+ $form .= $this->generateDonationFooter();
 115+ $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard
 116+ return $form;
 117+ }
124118
125 - $form .= $this->generatePersonalFields();
 119+ protected function generatePersonalContainer() {
 120+ $form = '';
 121+ $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' )); ;
 122+ $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-cc-form-header-personal' ));
 123+ $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
126124
127 - $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
128 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-personal-info
 125+ $form .= $this->generatePersonalFields();
129126
130 - return $form;
131 - }
 127+ $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
 128+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-personal-info
132129
133 - protected function generatePersonalFields() {
134 - // first name
135 - $form = $this->getNameField();
 130+ return $form;
 131+ }
136132
137 - // country
138 - $form .= $this->getCountryField();
 133+ protected function generatePersonalFields() {
 134+ // first name
 135+ $form = $this->getNameField();
139136
140 - // street
141 - $form .= $this->getStreetField();
 137+ // country
 138+ $form .= $this->getCountryField();
142139
 140+ // street
 141+ $form .= $this->getStreetField();
143142
144 - // city
145 - $form .= $this->getCityField();
146143
147 - // state
148 - $form .= $this->getStateField();
 144+ // city
 145+ $form .= $this->getCityField();
149146
150 - // zip
151 - $form .= $this->getZipField();
 147+ // state
 148+ $form .= $this->getStateField();
152149
153 - // email
154 - $form .= $this->getEmailField();
 150+ // zip
 151+ $form .= $this->getZipField();
155152
156 - return $form;
157 - }
 153+ // email
 154+ $form .= $this->getEmailField();
158155
159 - protected function generatePaymentContainer() {
160 - $form = '';
161 - // credit card info
162 - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-payment-info' ));
163 - $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header', 'id' => 'payflow-cc-form-header-payment' ), wfMsg( 'payflowpro_gateway-cc-form-header-payment' ));
164 - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
 156+ return $form;
 157+ }
165158
166 - $form .= $this->generatePaymentFields();
 159+ protected function generatePaymentContainer() {
 160+ $form = '';
 161+ // credit card info
 162+ $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-payment-info' ));
 163+ $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header', 'id' => 'payflow-cc-form-header-payment' ), wfMsg( 'payflowpro_gateway-cc-form-header-payment' ));
 164+ $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
167165
168 - $form .= Xml::closeElement( 'table' ); // close table#payflow-table-cc
169 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-payment-info
 166+ $form .= $this->generatePaymentFields();
170167
171 - return $form;
172 - }
 168+ $form .= Xml::closeElement( 'table' ); // close table#payflow-table-cc
 169+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-payment-info
173170
174 - protected function generatePaymentFields() {
175 - global $wgScriptPath, $wgPayflowGatewayTest;
 171+ return $form;
 172+ }
176173
177 - $form = '';
 174+ protected function generatePaymentFields() {
 175+ global $wgScriptPath, $wgPayflowGatewayTest;
178176
179 - // amount
180 - $form = '<tr>';
181 - $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
182 - $form .= '</tr>';
183 - $form .= '<tr>';
184 - $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>';
185 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
186 - ' ' . $this->generateCurrencyDropdown() . '</td>';
187 - $form .= '</tr>';
 177+ $form = '';
188178
189 - // card logos
190 - $form .= '<tr>';
191 - $form .= '<td />';
192 - $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
193 - $form .= '</tr>';
 179+ // amount
 180+ $form = '<tr>';
 181+ $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
 182+ $form .= '</tr>';
 183+ $form .= '<tr>';
 184+ $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>';
 185+ $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 186+ ' ' . $this->generateCurrencyDropdown() . '</td>';
 187+ $form .= '</tr>';
194188
195 - // credit card type
196 - $form .= $this->getCreditCardTypeField();
 189+ // card logos
 190+ $form .= '<tr>';
 191+ $form .= '<td />';
 192+ $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
 193+ $form .= '</tr>';
197194
198 - // card number
199 - $form .= $this->getCardnumberField();
 195+ // credit card type
 196+ $form .= $this->getCreditCardTypeField();
200197
201 - // expiry
202 - $form .= $this->getExpiryField();
 198+ // card number
 199+ $form .= $this->getCardnumberField();
203200
204 - // cvv
205 - $form .= $this->getCvvField();
 201+ // expiry
 202+ $form .= $this->getExpiryField();
206203
207 - return $form;
208 - }
 204+ // cvv
 205+ $form .= $this->getCvvField();
 206+
 207+ return $form;
 208+ }
209209 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php
@@ -3,44 +3,44 @@
44 class PayflowProGateway_Form_TwoStepTwoColumnLetter extends PayflowProGateway_Form_TwoStepTwoColumn {
55 public function __construct( &$form_data, &$form_errors ) {
66 global $wgOut, $wgScriptPath;
7 -
 7+
88 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
99 if ( !strlen( $this->getStylePath())) {
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoStepTwoColumnLetter.css' );
1111 }
12 -
 12+
1313 parent::__construct( $form_data, $form_errors );
1414 }
1515
1616 public function generateFormStart() {
1717 global $wgOut, $wgRequest;
18 -
 18+
1919 $form = parent::generateBannerHeader();
20 -
 20+
2121 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0));
22 -
 22+
2323 $form .= Xml::openElement( 'tr' );
24 -
 24+
2525 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
26 -
 26+
2727 $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
2828 // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
2929 if ( $wgRequest->getText( 'language' )) $text_template .= '/' . $this->form_data[ 'language' ];
30 -
 30+
3131 $template = ( strlen( $text_template )) ? $wgOut->parse( '{{'.$text_template.'}}' ) : '';
3232 // if the template doesn't exist, prevent the display of the red link
3333 if ( preg_match( '/redlink\=1/', $template )) $template = NULL;
3434 $form .= $template;
35 -
 35+
3636 $form .= Xml::closeElement( 'td' );
37 -
 37+
3838 $form .= Xml::openElement( 'td', array( 'id' => 'donate', 'valign' => 'top' ) );
39 -
 39+
4040 // add noscript tags for javascript disabled browsers
4141 $form .= $this->getNoScript();
42 -
 42+
4343 $form .= Xml::tags( 'h2', array( 'id' => 'donate-head' ), wfMsg( 'payflowpro_gateway-make-your-donation' ));
44 -
 44+
4545 // provide a place at the top of the form for displaying general messages
4646 if ( $this->form_errors['general'] ) {
4747 $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
@@ -57,17 +57,17 @@
5858 // Xml::element seems to convert html to htmlentities
5959 $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
6060 $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
61 -
 61+
6262 $form .= $this->generateBillingContainer();
6363 return $form;
6464 }
65 -
 65+
6666 public function generateFormEnd() {
6767 $form = '';
6868 $form .= $this->generateFormClose();
6969 return $form;
7070 }
71 -
 71+
7272 protected function generateBillingContainer() {
7373 $form = '';
7474 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ));
@@ -82,37 +82,37 @@
8383 protected function generateBillingFields() {
8484 global $wgScriptPath;
8585 $scriptPath = "$wgScriptPath/extensions/DonationInterface/payflowpro_gateway/includes";
86 -
 86+
8787 $form = '';
88 -
89 - // name
 88+
 89+ // name
9090 $form .= $this->getNameField();
91 -
 91+
9292 // email
9393 $form .= $this->getEmailField();
94 -
 94+
9595 // amount
9696 $form .= '<tr>';
9797 $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
9898 $form .= '</tr>';
9999 $form .= '<tr>';
100100 $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>';
101 - $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
 101+ $form .= '<td>' . Xml::input( 'amount', '7', $this->form_data['amount'], array( 'type' => 'text', 'maxlength' => '10', 'id' => 'amount' ) ) .
102102 ' ' . $this->generateCurrencyDropdown() . '</td>';
103103 $form .= '</tr>';
104 -
 104+
105105 // card logos
106106 $form .= '<tr>';
107107 $form .= '<td />';
108108 $form .= '<td>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
109109 $form .= '</tr>';
110 -
 110+
111111 // card number
112112 $form .= $this->getCardNumberField();
113 -
 113+
114114 // cvv
115115 $form .= $this->getCvvField();
116 -
 116+
117117 // expiry
118118 $form .= $this->getExpiryField();
119119
@@ -126,7 +126,7 @@
127127 $form .= $this->getStateField();
128128 // zip
129129 $form .= $this->getZipField();
130 -
 130+
131131 // country
132132 $form .= $this->getCountryField();
133133
@@ -138,12 +138,12 @@
139139 */
140140 public function generateFormClose() {
141141 $form = '';
142 - // add hidden fields
 142+ // add hidden fields
143143 $hidden_fields = $this->getHiddenFields();
144144 foreach ( $hidden_fields as $field => $value ) {
145145 $form .= Xml::hidden( $field, $value );
146146 }
147 -
 147+
148148 $form .= Xml::closeElement( 'form' ); // close form 'payment'
149149 $form .= $this->generateDonationFooter();
150150 $form .= Xml::closeElement( 'td' );
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnPayPal.php
@@ -1,18 +1,17 @@
22 <?php
33
44 class PayflowProGateway_Form_TwoColumnPayPal extends PayflowProGateway_Form_OneStepTwoColumn {
5 -
65 public function __construct( &$form_data, &$form_errors ) {
7 -
 6+
87 parent::__construct( $form_data, $form_errors );
98 }
10 -
 9+
1110 public function generateFormStart() {
1211 global $wgPayflowGatewayHeader, $wgPayflwGatewayTest, $wgOut;
1312 $form = $this->generateBannerHeader();
14 -
15 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
16 -
 13+
 14+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
 15+
1716 // provide a place at the top of the form for displaying general messages
1817 if ( $this->form_errors['general'] ) {
1918 $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
@@ -28,33 +27,33 @@
2928
3029 // add noscript tags for javascript disabled browsers
3130 $form .= $this->getNoScript();
32 -
 31+
3332 // open form
3433 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
35 -
 34+
3635 // Xml::element seems to convert html to htmlentities
3736 $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
3837 $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
39 -
 38+
4039 $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payflow-cc-form-section'));
4140 $form .= $this->generatePersonalContainer();
4241 $form .= Xml::closeElement( 'div' ); // close div#left-column
43 -
 42+
4443 $form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payflow-cc-form-section' ));
4544 $form .= $this->generatePaymentContainer();
46 -
 45+
4746 return $form;
4847 }
49 -
 48+
5049 protected function generatePersonalContainer() {
5150 global $wgRequest;
5251 $form = '';
5352 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' )); ;
5453 $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-make-your-donation' ));
5554 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
56 -
 55+
5756 $form .= $this->generatePersonalFields();
58 -
 57+
5958 $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
6059 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-personal-info
6160
@@ -64,34 +63,33 @@
6564 protected function generatePersonalFields() {
6665 global $wgPayflowGatewayPaypalURL;
6766 $form = '';
68 -
69 - // name
 67+
 68+ // name
7069 $form .= $this->getNameField();
71 -
 70+
7271 // email
7372 $form .= $this->getEmailField();
74 -
 73+
7574 //comment message
7675 $form .= $this->getCommentMessageField();
77 -
 76+
7877 //comment
7978 $form .= $this->getCommentField();
80 -
 79+
8180 // anonymous
8281 $form .= $this->getCommentOptionField();
8382
8483 // email agreement
8584 $form .= $this->getEmailOptField();
86 -
 85+
8786 // amount
8887 $form .= $this->getAmountField();
89 -
 88+
9089 // PayPal button
9190 if ( strlen( $wgPayflowGatewayPaypalURL )) {
9291 $form .= $this->getPaypalButton();
9392 }
94 -
 93+
9594 return $form;
9695 }
97 -
98 -}
\ No newline at end of file
 96+}
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/SingleColumn.php
@@ -1,19 +1,19 @@
22 <?php
33
44 class PayflowProGateway_Form_SingleColumn extends PayflowProGateway_Form_TwoColumnLetter {
5 -
 5+
66 public function __construct( &$form_data, &$form_errors ) {
77 global $wgOut, $wgScriptPath;
8 -
 8+
99 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
1010 if ( !strlen( $this->getStylePath())) {
1111 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/payflowpro_gateway/forms/css/SingleColumn.css' );
1212 }
13 -
14 - parent::__construct( $form_data, $form_errors );
 13+
 14+ parent::__construct( $form_data, $form_errors );
1515 }
16 -
 16+
1717 public function generateFormEnd() {
1818 return $this->generateFormClose();
1919 }
20 -}
\ No newline at end of file
 20+}
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -7,7 +7,7 @@
88 * @var bool
99 */
1010 public $test = false;
11 -
 11+
1212 /**
1313 * An array of hidden fields, name => value
1414 * @var array
@@ -31,34 +31,34 @@
3232 * @var string
3333 */
3434 protected $style_path;
35 -
 35+
3636 /**
3737 * A string to hold the HTML to display a cpatcha
3838 * @var string
3939 */
4040 protected $captcha_html;
41 -
 41+
4242 /**
4343 * Required method for returning the full HTML for a form.
44 - *
 44+ *
4545 * Code invoking forms will expect this method to be set. Requiring only
4646 * this method allows for flexible form generation inside of child classes
47 - * while also providing a unified method for returning the full HTML for
 47+ * while also providing a unified method for returning the full HTML for
4848 * a form.
4949 * @return string The entire form HTML
5050 */
5151 abstract function getForm();
52 -
 52+
5353 public function __construct( &$data, &$error ) {
5454 global $wgPayflowGatewayTest, $wgOut;
5555
5656 $this->test = $wgPayflowGatewayTest;
5757 $this->form_data =& $data;
5858 $this->form_errors =& $error;
59 -
 59+
6060 /**
61 - * add form-specific css - the path can be set in child classes
62 - * using $this->setStylePath, which should be called before
 61+ * add form-specific css - the path can be set in child classes
 62+ * using $this->setStylePath, which should be called before
6363 * calling parent::__construct()
6464 */
6565 if ( !strlen( $this->getStylePath())) {
@@ -66,10 +66,10 @@
6767 }
6868 $wgOut->addExtensionStyle( $this->getStylePath() );
6969 }
70 -
 70+
7171 /**
7272 * Set the path to the CSS file for the form
73 - *
 73+ *
7474 * This should be a full path, perhaps taking advantage of $wgScriptPath.
7575 * If you do not pass the path to the method, the style path will default
7676 * to the default css in css/Form.css
@@ -83,7 +83,7 @@
8484 }
8585 $this->style_path = $style_path;
8686 }
87 -
 87+
8888 /**
8989 * Get the path to CSS
9090 * @return String
@@ -91,7 +91,7 @@
9292 public function getStylePath() {
9393 return $this->style_path;
9494 }
95 -
 95+
9696 /**
9797 * Generates the donation footer ("There are other ways to give...")
9898 * @returns string of HTML
@@ -101,7 +101,7 @@
102102 $form = '';
103103 $form .= Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-donate-addl-info' ));
104104 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-donate-addl-info-secure-logos' ));
105 - $form .= Xml::tags( 'p', array( 'class' => '' ), Xml::openElement( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/rapidssl_ssl_certificate.gif" )));
 105+ $form .= Xml::tags( 'p', array( 'class' => '' ), Xml::openElement( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/rapidssl_ssl_certificate.gif" )));
106106 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info-secure-logos
107107 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-donate-addl-info-text' ));
108108 $form .= Xml::tags( 'p', array( 'class' => '' ), wfMsg( 'payflowpro_gateway-otherways' ));
@@ -111,7 +111,7 @@
112112 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-addl-info
113113 return $form;
114114 }
115 -
 115+
116116 /**
117117 * Fetch the array of iso country codes => country names
118118 * @return array
@@ -135,10 +135,10 @@
136136 foreach ( $this->getCountries() as $iso_value => $full_name ) {
137137 $countries[ $iso_value ] = wfMsg( 'payflowpro_gateway-country-dropdown-' . $iso_value );
138138 }
139 -
 139+
140140 // alphabetically sort the country names
141141 asort( $countries, SORT_STRING );
142 -
 142+
143143 // generate a dropdown option for each country
144144 foreach ( $countries as $iso_value => $full_name ) {
145145 if ( $this->form_data[ 'country' ] ) {
@@ -150,10 +150,10 @@
151151 }
152152
153153 // build the actual select
154 - $country_menu = Xml::openElement(
155 - 'select',
156 - array(
157 - 'name' => 'country',
 154+ $country_menu = Xml::openElement(
 155+ 'select',
 156+ array(
 157+ 'name' => 'country',
158158 'id' => 'country',
159159 'onchange' => 'return disableStates( this )'
160160 ));
@@ -213,15 +213,15 @@
214214 // generate a dropdown opt for each month
215215 for ( $i = 1; $i < 13; $i++ ) {
216216 $selected = ( $i == $month && $this->test ) ? true : false;
217 - $expiry_months .= Xml::option(
218 - $wgLang->getMonthName( $i ),
219 - str_pad( $i, 2, '0', STR_PAD_LEFT ),
 217+ $expiry_months .= Xml::option(
 218+ $wgLang->getMonthName( $i ),
 219+ str_pad( $i, 2, '0', STR_PAD_LEFT ),
220220 $selected );
221221 }
222222
223223 $expiry_month_menu = Xml::openElement(
224224 'select',
225 - array(
 225+ array(
226226 'name' => 'mos',
227227 'id' => 'expiration'
228228 ));
@@ -241,7 +241,7 @@
242242
243243 // generate a dropdown of year opts
244244 for ( $i = 0; $i < 11; $i++ ) {
245 - $selected = ( date( 'Y' ) + $i == substr( date( 'Y' ), 0, 2 ) . $year
 245+ $selected = ( date( 'Y' ) + $i == substr( date( 'Y' ), 0, 2 ) . $year
246246 && $this->test ) ? true : false;
247247 $expiry_years .= Xml::option( date( 'Y' ) + $i, date( 'Y' ) + $i, $selected );
248248 }
@@ -290,7 +290,7 @@
291291
292292 /**
293293 * Generates the dropdown list for available currencies
294 - *
 294+ *
295295 * @fixme The list of available currencies should NOT be defined here but rather
296296 * be customizable
297297 * @fixme It would be great to default the currency to a locale's currency
@@ -370,10 +370,10 @@
371371 }
372372 return $this->hidden_fields;
373373 }
374 -
 374+
375375 /**
376376 * Get the HTML set to display a captcha
377 - *
 377+ *
378378 * If $this->captcha_html has no string length, an empty string is returned.
379379 * @return string The HTML to display the captcha or an empty string
380380 */
@@ -383,39 +383,39 @@
384384 }
385385 return $this->captcha_html;
386386 }
387 -
 387+
388388 /**
389389 * Set a string of HTML used to display a captcha
390 - *
 390+ *
391391 * This allows for a flexible way of inserting some kind of captcha
392 - * into a form, and for a form to flexibly insert captcha HTML
 392+ * into a form, and for a form to flexibly insert captcha HTML
393393 * wherever it needs to go.
394 - *
 394+ *
395395 * @param string The HTML to display the captcha
396396 */
397397 public function setCaptchaHTML( $html ) {
398 - $this->captcha_html = $html;
 398+ $this->captcha_html = $html;
399399 }
400 -
 400+
401401 protected function generateBannerHeader() {
402402 global $wgPayflowGatewayHeader, $wgOut, $wgRequest;
403 -
 403+
404404 $template = '';
405 -
 405+
406406 // intro text
407407 if ( $wgRequest->getText('masthead', false)) {
408408 $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data[ 'language' ] . '}}' );
409409 } elseif ( $wgPayflowGatewayHeader ) {
410410 $header = str_replace( '@language', $this->form_data[ 'language' ], $wgPayflowGatewayHeader );
411411 $template = $wgOut->parse( $header );
412 - }
413 -
 412+ }
 413+
414414 // make sure that we actually have a matching template to display so we don't display the 'redlink'
415415 if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template )) {
416416 $wgOut->addHtml( $template );
417417 }
418418 }
419 -
 419+
420420 protected function getEmailField() {
421421 // email
422422 $form = '<tr>';
@@ -428,7 +428,7 @@
429429 $form .= '</tr>';
430430 return $form;
431431 }
432 -
 432+
433433 protected function getAmountField() {
434434 $otherChecked = false;
435435 $amount = -1;
@@ -440,8 +440,8 @@
441441 $form .= '<td colspan="2"><span class="creditcard-error-msg">' . $this->form_errors['invalidamount'] . '</span></td>';
442442 $form .= '</tr>';
443443 $form .= '<tr>';
444 - $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>';
445 - $form .= '<td>' . Xml::radio( 'amount', 250, $this->form_data['amount'] == 250 ) . '250 ' .
 444+ $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>';
 445+ $form .= '<td>' . Xml::radio( 'amount', 250, $this->form_data['amount'] == 250 ) . '250 ' .
446446 Xml::radio( 'amount', 100, $this->form_data['amount'] == 100 ) . '100 ' .
447447 Xml::radio( 'amount', 75, $this->form_data['amount'] == 75 ) . '75 ' .
448448 Xml::radio( 'amount', 35, $this->form_data['amount'] == 35 ) . '35 ' .
@@ -449,16 +449,16 @@
450450 $form .= '</tr>';
451451 $form .= '<tr>';
452452 $form .= '<td class="label"></td>';
453 - $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField( this, "Other" )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) .
 453+ $form .= '<td>' . Xml::radio( 'amount', $amount, $otherChecked, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amountOther'], array( 'type' => 'text', 'onfocus' => 'clearField( this, "Other" )', 'onblur' => 'document.getElementById("otherRadio").value = this.value;if (this.value > 0) document.getElementById("otherRadio").checked=true;', 'maxlength' => '10', 'id' => 'amountOther' ) ) .
454454 ' ' . $this->generateCurrencyDropdown() . '</td>';
455455 $form .= '</tr>';
456456 return $form;
457457 }
458 -
 458+
459459 protected function getCardnumberField() {
460460 global $wgPayflowGatewayTest;
461461 $card_num = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'card_num' ] : '';
462 -
 462+
463463 $form = '<tr>';
464464 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['card_num'] . '</span></td>';
465465 $form .= '</tr>';
@@ -472,11 +472,11 @@
473473 $form .= '</tr>';
474474 return $form;
475475 }
476 -
 476+
477477 protected function getCvvField() {
478478 global $wgPayflowGatewayTest;
479479 $cvv = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'cvv' ] : '';
480 -
 480+
481481 $form = '<tr>';
482482 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['cvv'] . '</span></td>';
483483 $form .= '<tr>';
@@ -487,7 +487,7 @@
488488 $form .= '</tr>';
489489 return $form;
490490 }
491 -
 491+
492492 protected function getStreetField() {
493493 $form = '<tr>';
494494 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['street'] . '</span></td>';
@@ -499,7 +499,7 @@
500500 $form .= '</tr>';
501501 return $form;
502502 }
503 -
 503+
504504 protected function getCityField() {
505505 $form = '<tr>';
506506 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['city'] . '</span></td>';
@@ -511,7 +511,7 @@
512512 $form .= '</tr>';
513513 return $form;
514514 }
515 -
 515+
516516 protected function getZipField() {
517517 $form = '<tr>';
518518 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['zip'] . '</span></td>';
@@ -523,7 +523,7 @@
524524 $form .= '</tr>';
525525 return $form;
526526 }
527 -
 527+
528528 protected function getNameField() {
529529 $form = '<tr>';
530530 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['fname'] . '</span></td>';
@@ -538,7 +538,7 @@
539539 $form .= "</tr>";
540540 return $form;
541541 }
542 -
 542+
543543 protected function getCommentMessageField() {
544544 $form = '<tr>';
545545 $form .= '<td colspan="2">';
@@ -547,7 +547,7 @@
548548 $form .= '</tr>';
549549 return $form;
550550 }
551 -
 551+
552552 protected function getCommentField() {
553553 $form = '<tr>';
554554 $form .= '<td class="label">' . Xml::label( wfMsg('payflowpro_gateway-comment'), 'comment' ) . '</td>';
@@ -555,7 +555,7 @@
556556 $form .= '</tr>';
557557 return $form;
558558 }
559 -
 559+
560560 protected function getCommentOptionField() {
561561 global $wgRequest;
562562 $comment_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'comment-option' ] : true;
@@ -565,7 +565,7 @@
566566 $form .= '</tr>';
567567 return $form;
568568 }
569 -
 569+
570570 protected function getEmailOptField() {
571571 global $wgRequest;
572572 $email_opt_value = ( $wgRequest->wasPosted() ) ? $this->form_data[ 'email-opt' ] : true;
@@ -580,11 +580,11 @@
581581 $form .= '</tr>';
582582 return $form;
583583 }
584 -
 584+
585585 protected function getPaypalButton() {
586586 global $wgScriptPath;
587587 $scriptPath = "$wgScriptPath/extensions/DonationInterface/payflowpro_gateway/includes";
588 -
 588+
589589 $form = '<tr>';
590590 $form .= '<td class="paypal-button" colspan="2">';
591591 $form .= Xml::hidden( 'PaypalRedirect', false );
@@ -596,7 +596,7 @@
597597 $form .= '</tr>';
598598 return $form;
599599 }
600 -
 600+
601601 protected function getStateField() {
602602 $form = '<tr>';
603603 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['state'] . '</span></td>';
@@ -607,7 +607,7 @@
608608 $form .= '</tr>';
609609 return $form;
610610 }
611 -
 611+
612612 protected function getCountryField() {
613613 $form = '<tr>';
614614 $form .= '<td colspan=2><span class="creditcard-error-msg">' . $this->form_errors['country'] . '</span></td>';
@@ -618,7 +618,7 @@
619619 $form .= '</tr>';
620620 return $form;
621621 }
622 -
 622+
623623 protected function getCreditCardTypeField() {
624624 $form = '<tr>';
625625 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-card' ), 'card' ) . '</td>';
@@ -626,7 +626,7 @@
627627 $form .= '</tr>';
628628 return $form;
629629 }
630 -
 630+
631631 protected function getExpiryField() {
632632 $form = '<tr>';
633633 $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . '</td>';
@@ -634,45 +634,45 @@
635635 $form .= '</tr>';
636636 return $form;
637637 }
638 -
 638+
639639 protected function loadValidateJs() {
640640 global $wgOut, $wgScriptPath;
641 - $wgOut->addHeadItem( 'validatescript', '<script type="text/javascript" src="' .
642 - $wgScriptPath .
 641+ $wgOut->addHeadItem( 'validatescript', '<script type="text/javascript" src="' .
 642+ $wgScriptPath .
643643 '/extensions/DonationInterface/payflowpro_gateway/validate_input.js?284"></script>' );
644644 }
645 -
 645+
646646 protected function loadApiJs() {
647647 global $wgOut, $wgScriptPath;
648648 $wgOut->addHeadItem( 'pfp_api_call', '<script type="text/javascript" src="' .
649649 $wgScriptPath .
650650 '/extensions/DonationInterface/payflowpro_gateway/pfp_api_controller.js?284"></script>' );
651651 }
652 -
 652+
653653 /**
654654 * Generate HTML for <noscript> tags
655 - *
 655+ *
656656 * For displaying when a user does not have Javascript enabled in their browser.
657657 */
658658 protected function getNoScript() {
659659 global $wgPayflowGatewayNoScriptRedirect;
660 -
 660+
661661 $form = '<noscript>';
662662 $form .= '<div id="noscript">';
663663 $form .= '<p id="noscript-msg">' . wfMsg( 'payflowpro_gateway-noscript-msg' ) . '</p>';
664664 if ( $wgPayflowGatewayNoScriptRedirect ) {
665665 $form .= '<p id="noscript-redirect-msg">' . wfMsg( 'payflowpro_gateway-noscript-redirect-msg' ) . '</p>';
666 - $form .= '<p id="noscript-redirect-link"><a href="' . $wgPayflowGatewayNoScriptRedirect . '">' . $wgPayflowGatewayNoScriptRedirect . '</a></p>';
 666+ $form .= '<p id="noscript-redirect-link"><a href="' . $wgPayflowGatewayNoScriptRedirect . '">' . $wgPayflowGatewayNoScriptRedirect . '</a></p>';
667667 }
668668 $form .= '</div>';
669669 $form .= '</noscript>';
670670 return $form;
671671 }
672 -
 672+
673673 /**
674674 * Determine the 'no cache' form action
675 - *
676 - * This mostly exists to ensure that the form does not try to use AJAX to
 675+ *
 676+ * This mostly exists to ensure that the form does not try to use AJAX to
677677 * overwrite certain hidden form params that are normally overwitten for
678678 * cached versions of the form.
679679 * @return string $url The full URL for the form to post to
@@ -681,12 +681,12 @@
682682 global $wgRequest;
683683
684684 $url = $wgRequest->getFullRequestURL();
685 -
 685+
686686 // it the _nocache_ param != true, add it to the URL
687687 if ( !$wgRequest->getText( '_nocache_' )) {
688688 $url = wfAppendQuery( $url, array( '_nocache_' => 'true' ));
689689 }
690 -
 690+
691691 return $url;
692692 }
693 -}
\ No newline at end of file
 693+}
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php
@@ -1,246 +1,246 @@
22 <?php
33
44 class PayflowProGateway_Form_OneStepTwoColumn extends PayflowProGateway_Form {
5 - public $paypal = false; // true for paypal only version
 5+ public $paypal = false; // true for paypal only version
66
7 - public function __construct( &$form_data, &$form_errors ) {
8 - global $wgOut, $wgScriptPath;
 7+ public function __construct( &$form_data, &$form_errors ) {
 8+ global $wgOut, $wgScriptPath;
99
10 - parent::__construct( $form_data, $form_errors );
 10+ parent::__construct( $form_data, $form_errors );
1111
12 - // update the list of hidden fields we need to use in this form.
13 - $this->updateHiddenFields();
 12+ // update the list of hidden fields we need to use in this form.
 13+ $this->updateHiddenFields();
1414
15 - // we only want to load this JS if the form is being rendered
16 - $this->loadValidateJs(); // validation JS
17 -
18 - $this->loadApiJs(); // API/Ajax JS
19 - }
 15+ // we only want to load this JS if the form is being rendered
 16+ $this->loadValidateJs(); // validation JS
2017
21 - /**
22 - * Required method for constructing the entire form
23 - *
24 - * This can of course be overloaded by a child class.
25 - * @return string The entire form HTML
26 - */
27 - public function getForm() {
28 - $form = $this->generateFormStart();
29 - $form .= $this->getCaptchaHTML();
30 - $form .= $this->generateFormSubmit();
31 - $form .= $this->generateFormEnd();
32 - return $form;
33 - }
 18+ $this->loadApiJs(); // API/Ajax JS
 19+ }
3420
35 - public function generateFormStart() {
36 - global $wgPayflowGatewayHeader, $wgPayflwGatewayTest, $wgOut, $wgRequest;
 21+ /**
 22+ * Required method for constructing the entire form
 23+ *
 24+ * This can of course be overloaded by a child class.
 25+ * @return string The entire form HTML
 26+ */
 27+ public function getForm() {
 28+ $form = $this->generateFormStart();
 29+ $form .= $this->getCaptchaHTML();
 30+ $form .= $this->generateFormSubmit();
 31+ $form .= $this->generateFormEnd();
 32+ return $form;
 33+ }
3734
38 - $this->paypal = $wgRequest->getBool( 'paypal', false );
 35+ public function generateFormStart() {
 36+ global $wgPayflowGatewayHeader, $wgPayflwGatewayTest, $wgOut, $wgRequest;
3937
40 - $form = $this->generateBannerHeader();
 38+ $this->paypal = $wgRequest->getBool( 'paypal', false );
4139
42 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
 40+ $form = $this->generateBannerHeader();
4341
44 - // provide a place at the top of the form for displaying general messages
45 - if ( $this->form_errors['general'] ) {
46 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
47 - if ( is_array( $this->form_errors['general'] )) {
48 - foreach ( $this->form_errors['general'] as $this->form_errors_msg ) {
49 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
50 - }
51 - } else {
52 - $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
53 - }
54 - $form .= Xml::closeElement( 'div' );
55 - }
 42+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
5643
57 - // add noscript tags for javascript disabled browsers
58 - $form .= $this->getNoScript();
59 -
60 - // open form
61 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
 44+ // provide a place at the top of the form for displaying general messages
 45+ if ( $this->form_errors['general'] ) {
 46+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
 47+ if ( is_array( $this->form_errors['general'] )) {
 48+ foreach ( $this->form_errors['general'] as $this->form_errors_msg ) {
 49+ $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
 50+ }
 51+ } else {
 52+ $form .= Xml::tags( 'p', array( 'class' => 'creditcard-error-msg' ), $this->form_errors_msg );
 53+ }
 54+ $form .= Xml::closeElement( 'div' );
 55+ }
6256
63 - // Xml::element seems to convert html to htmlentities
64 - $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
65 - $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
 57+ // add noscript tags for javascript disabled browsers
 58+ $form .= $this->getNoScript();
6659
67 - $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payflow-cc-form-section'));
68 - $form .= $this->generatePersonalContainer();
 60+ // open form
 61+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
6962
70 - if ( !$this->paypal ) {
71 - $form .= Xml::closeElement( 'div' ); // close div#left-column
 63+ // Xml::element seems to convert html to htmlentities
 64+ $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
 65+ $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
7266
73 - $form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payflow-cc-form-section' ));
74 - $form .= $this->generatePaymentContainer();
75 - }
 67+ $form .= Xml::openElement( 'div', array( 'id' => 'left-column', 'class' => 'payflow-cc-form-section'));
 68+ $form .= $this->generatePersonalContainer();
7669
77 - return $form;
78 - }
79 - public function generateFormSubmit() {
80 - // submit button
81 - $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit'));
82 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ));
83 - if ( $this->paypal ) {
84 - $form .= Xml::hidden( 'PaypalRedirect', false );
85 - $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'));
86 - } else {
87 - $form .= Xml::element( 'input', array( 'class' => 'input-button button-navyblue', 'value' => wfMsg( 'payflowpro_gateway-submit-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit'));
88 - $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
89 - $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
90 - wfMsg( 'payflowpro_gateway-donate-click' );
91 - }
92 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
93 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
 70+ if ( !$this->paypal ) {
 71+ $form .= Xml::closeElement( 'div' ); // close div#left-column
9472
95 - return $form;
96 - }
 73+ $form .= Xml::openElement( 'div', array( 'id' => 'right-column', 'class' => 'payflow-cc-form-section' ));
 74+ $form .= $this->generatePaymentContainer();
 75+ }
9776
98 - public function generateFormEnd() {
99 - $form = '';
100 - // add hidden fields
101 - $hidden_fields = $this->getHiddenFields();
102 - foreach ( $hidden_fields as $field => $value ) {
103 - $form .= Xml::hidden( $field, $value );
104 - }
105 - $form .= Xml::closeElement( 'div' ); // close div#right-column
106 - $form .= Xml::closeElement( 'form' );
107 - $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form
108 - $form .= $this->generateDonationFooter();
109 - $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard
110 - return $form;
111 - }
 77+ return $form;
 78+ }
 79+ public function generateFormSubmit() {
 80+ // submit button
 81+ $form = Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-form-submit'));
 82+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-donate-submit-button' ));
 83+ if ( $this->paypal ) {
 84+ $form .= Xml::hidden( 'PaypalRedirect', false );
 85+ $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'));
 86+ } else {
 87+ $form .= Xml::element( 'input', array( 'class' => 'input-button button-navyblue', 'value' => wfMsg( 'payflowpro_gateway-submit-button'), 'onclick' => 'submit_form( this )', 'type' => 'submit'));
 88+ $form .= Xml::closeElement( 'div' ); // close div#mw-donate-submit-button
 89+ $form .= Xml::openElement( 'div', array( 'class' => 'mw-donate-submessage', 'id' => 'payflowpro_gateway-donate-submessage' ) ) .
 90+ wfMsg( 'payflowpro_gateway-donate-click' );
 91+ }
 92+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-donate-submessage
 93+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-form-submit
11294
113 - protected function generateBannerHeader() {
114 - global $wgPayflowGatewayHeader, $wgOut, $wgRequest;
115 - $template = '';
 95+ return $form;
 96+ }
11697
117 - // intro text
118 - if ( $wgRequest->getText('masthead', false)) {
119 - $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data[ 'language' ] . '}}' );
120 - } elseif ( $wgPayflowGatewayHeader ) {
121 - $header = str_replace( '@language', $this->form_data[ 'language' ], $wgPayflowGatewayHeader );
122 - $template = $wgOut->parse( $header );
123 - }
 98+ public function generateFormEnd() {
 99+ $form = '';
 100+ // add hidden fields
 101+ $hidden_fields = $this->getHiddenFields();
 102+ foreach ( $hidden_fields as $field => $value ) {
 103+ $form .= Xml::hidden( $field, $value );
 104+ }
 105+ $form .= Xml::closeElement( 'div' ); // close div#right-column
 106+ $form .= Xml::closeElement( 'form' );
 107+ $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form
 108+ $form .= $this->generateDonationFooter();
 109+ $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard
 110+ return $form;
 111+ }
124112
125 - // make sure that we actually have a matching template to display so we don't display the 'redlink'
126 - if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template )) {
127 - $wgOut->addHtml( $template );
128 - }
129 - }
 113+ protected function generateBannerHeader() {
 114+ global $wgPayflowGatewayHeader, $wgOut, $wgRequest;
 115+ $template = '';
130116
131 - protected function generatePersonalContainer() {
132 - global $wgRequest, $wgScriptPath;
133 - $form = '';
134 - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' )); ;
135 - $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-make-your-donation' ));
136 - if ( !$this->paypal ) {
137 - $source = $wgRequest->getText( 'utm_source' );
138 - $medium = $wgRequest->getText( 'utm_medium' );
139 - $campaign = $wgRequest->getText( 'utm_campaign' );
140 - $formname = $wgRequest->getText( 'form_name' );
141 - $form .= Xml::Tags( 'p', array( 'id' => 'payflowpro_gateway-cc_otherways' ), wfMsg( 'payflowpro_gateway-paypal', $wgScriptPath, $formname, $source, $medium, $campaign ));
142 - }
143 - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
 117+ // intro text
 118+ if ( $wgRequest->getText('masthead', false)) {
 119+ $template = $wgOut->parse( '{{' . $wgRequest->getText( 'masthead' ) . '/' . $this->form_data[ 'language' ] . '}}' );
 120+ } elseif ( $wgPayflowGatewayHeader ) {
 121+ $header = str_replace( '@language', $this->form_data[ 'language' ], $wgPayflowGatewayHeader );
 122+ $template = $wgOut->parse( $header );
 123+ }
144124
145 - $form .= $this->generatePersonalFields();
 125+ // make sure that we actually have a matching template to display so we don't display the 'redlink'
 126+ if ( strlen( $template ) && !preg_match( '/redlink\=1/', $template )) {
 127+ $wgOut->addHtml( $template );
 128+ }
 129+ }
146130
147 - $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
148 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-personal-info
 131+ protected function generatePersonalContainer() {
 132+ global $wgRequest, $wgScriptPath;
 133+ $form = '';
 134+ $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ));
 135+ $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-make-your-donation' ));
 136+ if ( !$this->paypal ) {
 137+ $source = $wgRequest->getText( 'utm_source' );
 138+ $medium = $wgRequest->getText( 'utm_medium' );
 139+ $campaign = $wgRequest->getText( 'utm_campaign' );
 140+ $formname = $wgRequest->getText( 'form_name' );
 141+ $form .= Xml::Tags( 'p', array( 'id' => 'payflowpro_gateway-cc_otherways' ), wfMsg( 'payflowpro_gateway-paypal', $wgScriptPath, $formname, $source, $medium, $campaign ));
 142+ }
 143+ $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
149144
150 - return $form;
151 - }
 145+ $form .= $this->generatePersonalFields();
152146
153 - protected function generatePersonalFields() {
154 - $form = '';
 147+ $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
 148+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-personal-info
155149
156 - // name
157 - $form .= $this->getNameField();
 150+ return $form;
 151+ }
158152
159 - // email
160 - $form .= $this->getEmailField();
 153+ protected function generatePersonalFields() {
 154+ $form = '';
161155
162 - //comment message
163 - $form .= $this->getCommentMessageField();
 156+ // name
 157+ $form .= $this->getNameField();
164158
165 - //comment
166 - $form .= $this->getCommentField();
 159+ // email
 160+ $form .= $this->getEmailField();
167161
168 - // anonymous
169 - $form .= $this->getCommentOptionField();
 162+ //comment message
 163+ $form .= $this->getCommentMessageField();
170164
171 - // email agreement
172 - $form .= $this->getEmailOptField();
 165+ //comment
 166+ $form .= $this->getCommentField();
173167
174 - // amount
175 - $form .= $this->getAmountField();
 168+ // anonymous
 169+ $form .= $this->getCommentOptionField();
176170
177 - return $form;
178 - }
 171+ // email agreement
 172+ $form .= $this->getEmailOptField();
179173
180 - protected function generatePaymentContainer() {
181 - $form = '';
182 - // credit card info
183 - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-payment-info' ));
184 - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
 174+ // amount
 175+ $form .= $this->getAmountField();
185176
186 - $form .= $this->generatePaymentFields();
 177+ return $form;
 178+ }
187179
188 - $form .= Xml::closeElement( 'table' ); // close table#payflow-table-cc
189 - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-payment-info
 180+ protected function generatePaymentContainer() {
 181+ $form = '';
 182+ // credit card info
 183+ $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-payment-info' ));
 184+ $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-cc' ) );
190185
191 - return $form;
192 - }
 186+ $form .= $this->generatePaymentFields();
193187
194 - protected function generatePaymentFields() {
195 - global $wgScriptPath, $wgPayflowGatewayTest;
 188+ $form .= Xml::closeElement( 'table' ); // close table#payflow-table-cc
 189+ $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-payment-info
196190
197 - $form = '';
 191+ return $form;
 192+ }
198193
199 - // card logos
200 - $form .= '<tr>';
201 - $form .= '<td />';
202 - $form .= '<td>&nbsp;<br/>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
203 - $form .= '</tr>';
 194+ protected function generatePaymentFields() {
 195+ global $wgScriptPath, $wgPayflowGatewayTest;
204196
205 - // card number
206 - $form .= $this->getCardnumberField();
 197+ $form = '';
207198
208 - // cvv
209 - $form .= $this->getCvvField();
 199+ // card logos
 200+ $form .= '<tr>';
 201+ $form .= '<td />';
 202+ $form .= '<td>&nbsp;<br/>' . Xml::element( 'img', array( 'src' => $wgScriptPath . "/extensions/DonationInterface/payflowpro_gateway/includes/credit_card_logos.gif" )) . '</td>';
 203+ $form .= '</tr>';
210204
211 - // expiry
212 - $form .= $this->getExpiryField();
 205+ // card number
 206+ $form .= $this->getCardnumberField();
213207
214 - // street
215 - $form .= $this->getStreetField();
 208+ // cvv
 209+ $form .= $this->getCvvField();
216210
217 - // city
218 - $form .= $this->getCityField();
 211+ // expiry
 212+ $form .= $this->getExpiryField();
219213
220 - // state
221 - $form .= $this->getStateField();
 214+ // street
 215+ $form .= $this->getStreetField();
222216
223 - // zip
224 - $form .= $this->getZipField();
 217+ // city
 218+ $form .= $this->getCityField();
225219
226 - // country
227 - $form .= $this->getCountryField();
 220+ // state
 221+ $form .= $this->getStateField();
228222
229 - return $form;
230 - }
 223+ // zip
 224+ $form .= $this->getZipField();
231225
232 - /**
233 - * Update hidden fields to not set any comment-related fields
234 - */
235 - public function updateHiddenFields() {
236 - $hidden_fields = $this->getHiddenFields();
 226+ // country
 227+ $form .= $this->getCountryField();
237228
238 - // make sure that the below elements are not set in the hidden fields
239 - $not_needed = array( 'comment-option', 'email-opt', 'comment' );
 229+ return $form;
 230+ }
240231
241 - foreach ( $not_needed as $field ) {
242 - unset( $hidden_fields[ $field ] );
243 - }
244 -
245 - $this->setHiddenFields( $hidden_fields );
246 - }
 232+ /**
 233+ * Update hidden fields to not set any comment-related fields
 234+ */
 235+ public function updateHiddenFields() {
 236+ $hidden_fields = $this->getHiddenFields();
 237+
 238+ // make sure that the below elements are not set in the hidden fields
 239+ $not_needed = array( 'comment-option', 'email-opt', 'comment' );
 240+
 241+ foreach ( $not_needed as $field ) {
 242+ unset( $hidden_fields[ $field ] );
 243+ }
 244+
 245+ $this->setHiddenFields( $hidden_fields );
 246+ }
247247 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php
@@ -5,26 +5,26 @@
66
77 public function __construct( &$form_data, &$form_errors ) {
88 global $wgOut, $wgScriptPath;
9 -
 9+
1010 // set the path to css, before the parent constructor is called, checking to make sure some child class hasn't already set this
1111 if ( !strlen( $this->getStylePath())) {
1212 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter.css' );
1313 }
14 -
 14+
1515 parent::__construct( $form_data, $form_errors );
1616 }
1717
1818 public function generateFormStart() {
1919 global $wgOut, $wgRequest;
20 -
 20+
2121 $this->paypal = $wgRequest->getBool( 'paypal', false );
22 -
 22+
2323 $form = parent::generateBannerHeader();
24 -
 24+
2525 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_container'));
2626 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_form', 'class' => 'payflowpro_gateway-cc_form_column'));
27 - $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
28 -
 27+ $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard' ) );
 28+
2929 // provide a place at the top of the form for displaying general messages
3030 if ( $this->form_errors['general'] ) {
3131 $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
@@ -37,42 +37,42 @@
3838 }
3939 $form .= Xml::closeElement( 'div' ); // close div#mw-payflow-general-error
4040 }
41 -
 41+
4242 // add noscript tags for javascript disabled browsers
4343 $form .= $this->getNoScript();
44 -
 44+
4545 // Xml::element seems to convert html to htmlentities
4646 $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
4747 $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
48 -
 48+
4949 $form .= $this->generateBillingContainer();
5050 return $form;
5151 }
52 -
 52+
5353 public function generateFormEnd() {
5454 global $wgRequest, $wgOut;
5555 $form = '';
56 -
 56+
5757 $form .= $this->generateFormClose();
5858
5959 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_letter', 'class' => 'payflowpro_gateway-cc_form_column'));
6060 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_letter_inside' ));
61 -
 61+
6262 $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
6363 // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string
6464 if ( $wgRequest->getText( 'language' )) $text_template .= '/' . $this->form_data[ 'language' ];
65 -
 65+
6666 $template = ( strlen( $text_template )) ? $wgOut->parse( '{{'.$text_template.'}}' ) : '';
6767 // if the template doesn't exist, prevent the display of the red link
6868 if ( preg_match( '/redlink\=1/', $template )) $template = NULL;
6969 $form .= $template;
70 -
 70+
7171 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_letter_inside
7272 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_letter
7373 $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_container
7474 return $form;
7575 }
76 -
 76+
7777 protected function generateBillingContainer() {
7878 $form = '';
7979 $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' ));
@@ -88,30 +88,30 @@
8989 protected function generateBillingFields() {
9090 global $wgScriptPath, $wgPayflowGatewayPaypalURL;
9191 $scriptPath = "$wgScriptPath/extensions/DonationInterface/payflowpro_gateway/includes";
92 -
 92+
9393 $form = '';
94 -
95 - // name
 94+
 95+ // name
9696 $form .= $this->getNameField();
97 -
 97+
9898 // email
9999 $form .= $this->getEmailField();
100 -
 100+
101101 //comment message
102102 $form .= $this->getCommentMessageField();
103 -
 103+
104104 //comment
105105 $form .= $this->getCommentField();
106 -
 106+
107107 // anonymous
108108 $form .= $this->getCommentOptionField();
109109
110110 // email agreement
111111 $form .= $this->getEmailOptField();
112 -
 112+
113113 // amount
114114 $form .= $this->getAmountField();
115 -
 115+
116116 if ( !$this->paypal ) {
117117 // PayPal button
118118 // make sure we have a paypal url set to redirect the user to before displaying the button
@@ -127,27 +127,27 @@
128128 $form .= '</td>';
129129 $form .= '</tr>';
130130 }
131 -
 131+
132132 // card number
133133 $form .= $this->getCardNumberField();
134 -
 134+
135135 // cvv
136136 $form .= $this->getCvvField();
137 -
 137+
138138 // expiry
139139 $form .= $this->getExpiryField();
140 -
 140+
141141 // street
142142 $form .= $this->getStreetField();
143 -
 143+
144144 // city
145145 $form .= $this->getCityField();
146 -
 146+
147147 // state
148148 $form .= $this->getStateField();
149149 // zip
150150 $form .= $this->getZipField();
151 -
 151+
152152 // country
153153 $form .= $this->getCountryField();
154154 }
@@ -160,12 +160,12 @@
161161 */
162162 public function generateFormClose() {
163163 $form = '';
164 - // add hidden fields
 164+ // add hidden fields
165165 $hidden_fields = $this->getHiddenFields();
166166 foreach ( $hidden_fields as $field => $value ) {
167167 $form .= Xml::hidden( $field, $value );
168168 }
169 -
 169+
170170 $form .= Xml::closeElement( 'form' ); // close form 'payment'
171171 $form .= $this->generateDonationFooter();
172172 if ( $this->paypal ) {

Status & tagging log