Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoColumnLetter.css |
— | — | @@ -32,10 +32,6 @@ |
33 | 33 | margin-right:0 !important; |
34 | 34 | } |
35 | 35 | |
36 | | -#payflowpro_gateway-form-submit { |
37 | | - margin-bottom: 5em; |
38 | | -} |
39 | | - |
40 | 36 | #payflowpro_gateway-donate-addl-info-secure-logos { |
41 | 37 | float: left; |
42 | 38 | margin-right: 2em; |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumn.php |
— | — | @@ -21,7 +21,6 @@ |
22 | 22 | */ |
23 | 23 | public function getForm() { |
24 | 24 | $form = $this->generateFormStart(); |
25 | | - $form .= $this->generateCommentFields(); |
26 | 25 | $form .= $this->getCaptchaHTML(); |
27 | 26 | $form .= $this->generateFormSubmit(); |
28 | 27 | $form .= $this->generateFormEnd(); |
— | — | @@ -88,6 +87,25 @@ |
89 | 88 | } |
90 | 89 | $form .= Xml::closeElement( 'div' ); // close div#right-column |
91 | 90 | $form .= Xml::closeElement( 'form' ); |
| 91 | + $form .= <<<EOT |
| 92 | +<script type="text/javascript"> |
| 93 | +var fname = document.getElementById('fname'); |
| 94 | +var lname = document.getElementById('lname'); |
| 95 | +var amountOther = document.getElementById('amountOther'); |
| 96 | +if (fname.value == '') { |
| 97 | + fname.style.color = '#999999'; |
| 98 | + fname.value = 'First'; |
| 99 | +} |
| 100 | +if (lname.value == '') { |
| 101 | + lname.style.color = '#999999'; |
| 102 | + lname.value = 'Last'; |
| 103 | +} |
| 104 | +if (amountOther.value == '') { |
| 105 | + amountOther.style.color = '#999999'; |
| 106 | + amountOther.value = 'Other'; |
| 107 | +} |
| 108 | +</script> |
| 109 | +EOT; |
92 | 110 | $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard-form |
93 | 111 | //$form .= $this->generateDonationFooter(); |
94 | 112 | $form .= Xml::closeElement( 'div' ); // div#close mw-creditcard |
— | — | @@ -124,6 +142,7 @@ |
125 | 143 | |
126 | 144 | protected function generatePersonalFields() { |
127 | 145 | global $wgScriptPath, $wgPayflowGatewayTest; |
| 146 | + $scriptPath = "$wgScriptPath/extensions/DonationInterface/payflowpro_gateway"; |
128 | 147 | $card_num = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'card_num' ] : ''; |
129 | 148 | $cvv = ( $wgPayflowGatewayTest ) ? $this->form_data[ 'cvv' ] : ''; |
130 | 149 | $form = ''; |
— | — | @@ -141,40 +160,56 @@ |
142 | 161 | $form .= '<td>' . Xml::input( 'emailAdd', '30', $this->form_data['email'], array( 'type' => 'text', 'maxlength' => '64', 'id' => 'emailAdd', 'class' => 'fullwidth' ) ) . |
143 | 162 | '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['emailAdd'] . '</span></td>'; |
144 | 163 | $form .= '</tr>'; |
145 | | - |
146 | | - // street |
| 164 | + |
| 165 | + //comment message |
147 | 166 | $form .= '<tr>'; |
148 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-street' ), 'street' ) . '</td>'; |
149 | | - $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'maxlength' => '30', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
150 | | - '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['street'] . '</span></td>'; |
| 167 | + $form .= '<td colspan="2">'; |
| 168 | + $form .= Xml::tags( 'p', array(), wfMsg( 'donate_interface-comment-message' )); |
| 169 | + $form .= '</td>'; |
151 | 170 | $form .= '</tr>'; |
152 | | - |
153 | | - // city |
| 171 | + |
| 172 | + //comment |
154 | 173 | $form .= '<tr>'; |
155 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-city' ), 'city' ) . '</td>'; |
156 | | - $form .= '<td>' . Xml::input( 'city', '30', $this->form_data['city'], array( 'type' => 'text', 'maxlength' => '20', 'id' => 'city', 'class' => 'fullwidth' ) ) . |
157 | | - '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['city'] . '</span></td>'; |
| 174 | + $form .= '<td class="label">' . Xml::label( wfMsg('payflowpro_gateway-comment'), 'comment' ) . '</td>'; |
| 175 | + $form .= '<td>' . Xml::input( 'comment', '30', $this->form_data[ 'comment' ], array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' )) . '</td>'; |
158 | 176 | $form .= '</tr>'; |
| 177 | + |
| 178 | + // anonymous |
| 179 | + $comment_opt_value = ( $this->form_data[ 'numAttempt' ] ) ? $this->form_data[ 'comment-option' ] : true; |
| 180 | + $form .= '<tr>'; |
| 181 | + $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
| 182 | + $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
| 183 | + $form .= '</tr>'; |
159 | 184 | |
160 | | - // state |
| 185 | + // email agreement |
| 186 | + $email_opt_value = ( $this->form_data[ 'numAttempt' ]) ? $this->form_data[ 'email-opt' ] : true; |
161 | 187 | $form .= '<tr>'; |
162 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-state' ), 'state' ) . '</td>'; |
163 | | - $form .= '<td>' . $this->generateStateDropdown() . ' ' . wfMsg( 'payflowpro_gateway-state-in-us' ) . '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['state'] . '</span></td>'; |
| 188 | + $form .= '<td class="check-option" colspan="2">' . Xml::check( 'email-opt', $email_opt_value ); |
| 189 | + $form .= ' '; |
| 190 | + // put the label inside Xml::openElement so any HTML in the msg might get rendered (right, Germany?) |
| 191 | + $form .= Xml::openElement( 'label', array( 'for' => 'email-opt' )); |
| 192 | + $form .= wfMsg( 'donate_interface-email-agreement' ); |
| 193 | + $form .= Xml::closeElement( 'label' ); |
| 194 | + $form .= '</td>'; |
164 | 195 | $form .= '</tr>'; |
165 | | - |
166 | | - // zip |
| 196 | + |
| 197 | + // amount |
167 | 198 | $form .= '<tr>'; |
168 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-postal' ), 'zip' ) . '</td>'; |
169 | | - $form .= '<td>' . Xml::input( 'zip', '30', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) . |
170 | | - '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['zip'] . '</span></td>'; |
| 199 | + $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>'; |
| 200 | + $form .= '<td>' . Xml::radio( 'amount', 250 ) . '250 ' . |
| 201 | + Xml::radio( 'amount', 100 ) . '100 ' . |
| 202 | + Xml::radio( 'amount', 75 ) . '75 ' . |
| 203 | + Xml::radio( 'amount', 35 ) . '35 ' . |
| 204 | + '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['invalidamount'] . '</span></td>'; |
171 | 205 | $form .= '</tr>'; |
172 | 206 | |
173 | | - // country |
| 207 | + // currency |
174 | 208 | $form .= '<tr>'; |
175 | | - $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-country' ), 'country' ) . '</td>'; |
176 | | - $form .= '<td>' . $this->generateCountryDropdown() . '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['country'] . '</span></td>'; |
177 | | - $form .= '</tr>'; |
178 | | - |
| 209 | + $form .= '<td class="label"></td>'; |
| 210 | + $form .= '<td>' . Xml::radio( 'amount', -1, null, 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', 'maxlength' => '10', 'id' => 'amountOther' ) ) . |
| 211 | + ' ' . $this->generateCurrencyDropdown() . '</td>'; |
| 212 | + $form .= '</tr>'; |
| 213 | + |
179 | 214 | return $form; |
180 | 215 | } |
181 | 216 | |
— | — | @@ -199,23 +234,6 @@ |
200 | 235 | |
201 | 236 | $form = ''; |
202 | 237 | |
203 | | - // amount |
204 | | - $form .= '<tr>'; |
205 | | - $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>'; |
206 | | - $form .= '<td>' . Xml::radio( 'amount', 250 ) . '250 ' . |
207 | | - Xml::radio( 'amount', 100 ) . '100 ' . |
208 | | - Xml::radio( 'amount', 75 ) . '75 ' . |
209 | | - Xml::radio( 'amount', 35 ) . '35 ' . |
210 | | - Xml::radio( 'amount', -1, null, array( 'id' => 'otherRadio' ) ) . Xml::input( 'amountOther', '7', $this->form_data['amount'], array( 'type' => 'text', 'onfocus' => 'clearField( this, "0.00" )', 'onblur' => 'document.getElementById("otherRadio").value = this.value', 'maxlength' => '10', 'id' => 'amount' ) ) . |
211 | | - '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['invalidamount'] . '</span></td>'; |
212 | | - $form .= '</tr>'; |
213 | | - |
214 | | - // currency |
215 | | - $form .= '<tr>'; |
216 | | - $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-currency-label' ), 'currency' ) . '</td>'; |
217 | | - $form .= '<td>' . $this->generateCurrencyDropdown() . '</td>'; |
218 | | - $form .= '</tr>'; |
219 | | - |
220 | 238 | // card logos |
221 | 239 | $form .= '<tr>'; |
222 | 240 | $form .= '<td />'; |
— | — | @@ -243,45 +261,40 @@ |
244 | 262 | $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-expiration' ), 'expiration' ) . '</td>'; |
245 | 263 | $form .= '<td>' . $this->generateExpiryMonthDropdown() . $this->generateExpiryYearDropdown() . '</td>'; |
246 | 264 | $form .= '</tr>'; |
247 | | - |
248 | | - return $form; |
249 | | - } |
250 | | - |
251 | | - public function generateCommentFields() { |
252 | | - global $wgRequest; |
253 | 265 | |
254 | | - $form = Xml::openElement( 'div', array( 'class' => 'payflow-cc-form-section', 'id' => 'payflowpro_gateway-comment_form' )); |
255 | | - $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header', 'id' => 'payflow-cc-form-header-comments' ), wfMsg( 'donate_interface-comment-title' )); |
256 | | - $form .= Xml::tags( 'p', array(), wfMsg( 'donate_interface-comment-message' )); |
257 | | - $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-comment' ) ); |
258 | | - |
259 | | - //comment |
| 266 | + // street |
260 | 267 | $form .= '<tr>'; |
261 | | - $form .= '<td class="label">' . Xml::label( wfMsg('payflowpro_gateway-comment'), 'comment' ) . '</td>'; |
262 | | - $form .= '<td class="comment-field">' . Xml::input( 'comment', '30', $this->form_data[ 'comment' ], array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' )) . '</td>'; |
| 268 | + $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-street' ), 'street' ) . '</td>'; |
| 269 | + $form .= '<td>' . Xml::input( 'street', '30', $this->form_data['street'], array( 'type' => 'text', 'maxlength' => '30', 'id' => 'street', 'class' => 'fullwidth' ) ) . |
| 270 | + '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['street'] . '</span></td>'; |
263 | 271 | $form .= '</tr>'; |
264 | | - |
265 | | - // anonymous |
266 | | - $comment_opt_value = ( $this->form_data[ 'numAttempt' ] ) ? $this->form_data[ 'comment-option' ] : true; |
| 272 | + |
| 273 | + // city |
267 | 274 | $form .= '<tr>'; |
268 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
269 | | - $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
| 275 | + $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-city' ), 'city' ) . '</td>'; |
| 276 | + $form .= '<td>' . Xml::input( 'city', '30', $this->form_data['city'], array( 'type' => 'text', 'maxlength' => '20', 'id' => 'city', 'class' => 'fullwidth' ) ) . |
| 277 | + '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['city'] . '</span></td>'; |
270 | 278 | $form .= '</tr>'; |
271 | 279 | |
272 | | - // email agreement |
273 | | - $email_opt_value = ( $this->form_data[ 'numAttempt' ]) ? $this->form_data[ 'email-opt' ] : true; |
| 280 | + // state |
274 | 281 | $form .= '<tr>'; |
275 | | - $form .= '<td class="check-option" colspan="2">' . Xml::check( 'email-opt', $email_opt_value ); |
276 | | - $form .= ' '; |
277 | | - // put the label inside Xml::openElement so any HTML in the msg might get rendered (right, Germany?) |
278 | | - $form .= Xml::openElement( 'label', array( 'for' => 'email-opt' )); |
279 | | - $form .= wfMsg( 'donate_interface-email-agreement' ); |
280 | | - $form .= Xml::closeElement( 'label' ); |
281 | | - $form .= '</td>'; |
| 282 | + $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-state' ), 'state' ) . '</td>'; |
| 283 | + $form .= '<td>' . $this->generateStateDropdown() . ' ' . wfMsg( 'payflowpro_gateway-state-in-us' ) . '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['state'] . '</span></td>'; |
282 | 284 | $form .= '</tr>'; |
| 285 | + |
| 286 | + // zip |
| 287 | + $form .= '<tr>'; |
| 288 | + $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-postal' ), 'zip' ) . '</td>'; |
| 289 | + $form .= '<td>' . Xml::input( 'zip', '30', $this->form_data['zip'], array( 'type' => 'text', 'maxlength' => '9', 'id' => 'zip', 'class' => 'fullwidth' ) ) . |
| 290 | + '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['zip'] . '</span></td>'; |
| 291 | + $form .= '</tr>'; |
| 292 | + |
| 293 | + // country |
| 294 | + $form .= '<tr>'; |
| 295 | + $form .= '<td class="label">' . Xml::label( wfMsg( 'payflowpro_gateway-donor-country' ), 'country' ) . '</td>'; |
| 296 | + $form .= '<td>' . $this->generateCountryDropdown() . '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['country'] . '</span></td>'; |
| 297 | + $form .= '</tr>'; |
283 | 298 | |
284 | | - $form .= Xml::closeElement( 'table' ); |
285 | | - $form .= Xml::closeElement( 'div' ); |
286 | 299 | return $form; |
287 | 300 | } |
288 | 301 | } |
\ No newline at end of file |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php |
— | — | @@ -108,6 +108,38 @@ |
109 | 109 | '<span class="creditcard-error-msg">' . ' ' . $this->form_errors['emailAdd'] . '</span></td>'; |
110 | 110 | $form .= '</tr>'; |
111 | 111 | |
| 112 | + //comment message |
| 113 | + $form .= '<tr>'; |
| 114 | + $form .= '<td colspan="2">'; |
| 115 | + $form .= Xml::tags( 'p', array(), wfMsg( 'donate_interface-comment-message' )); |
| 116 | + $form .= '</td>'; |
| 117 | + $form .= '</tr>'; |
| 118 | + |
| 119 | + //comment |
| 120 | + $form .= '<tr>'; |
| 121 | + $form .= '<td class="label">' . Xml::label( wfMsg('payflowpro_gateway-comment'), 'comment' ) . '</td>'; |
| 122 | + $form .= '<td>' . Xml::input( 'comment', '30', $this->form_data[ 'comment' ], array( 'type' => 'text', 'maxlength' => '200', 'class' => 'fullwidth' )) . '</td>'; |
| 123 | + $form .= '</tr>'; |
| 124 | + |
| 125 | + // anonymous |
| 126 | + $comment_opt_value = ( $this->form_data[ 'numAttempt' ] ) ? $this->form_data[ 'comment-option' ] : true; |
| 127 | + $form .= '<tr>'; |
| 128 | + $form .= '<td class="check-option" colspan="2">' . Xml::check( 'comment-option', $comment_opt_value ); |
| 129 | + $form .= ' ' . Xml::label( wfMsg( 'donate_interface-anon-message' ), 'comment-option' ) . '</td>'; |
| 130 | + $form .= '</tr>'; |
| 131 | + |
| 132 | + // email agreement |
| 133 | + $email_opt_value = ( $this->form_data[ 'numAttempt' ]) ? $this->form_data[ 'email-opt' ] : true; |
| 134 | + $form .= '<tr>'; |
| 135 | + $form .= '<td class="check-option" colspan="2">' . Xml::check( 'email-opt', $email_opt_value ); |
| 136 | + $form .= ' '; |
| 137 | + // put the label inside Xml::openElement so any HTML in the msg might get rendered (right, Germany?) |
| 138 | + $form .= Xml::openElement( 'label', array( 'for' => 'email-opt' )); |
| 139 | + $form .= wfMsg( 'donate_interface-email-agreement' ); |
| 140 | + $form .= Xml::closeElement( 'label' ); |
| 141 | + $form .= '</td>'; |
| 142 | + $form .= '</tr>'; |
| 143 | + |
112 | 144 | // amount |
113 | 145 | $form .= '<tr>'; |
114 | 146 | $form .= '<td class="label">' . Xml::label(wfMsg( 'payflowpro_gateway-donor-amount' ), 'amount') . '</td>'; |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | $wgAutoloadClasses['PayflowProGateway'] = $dir . 'payflowpro_gateway.body.php'; |
25 | 25 | $wgAutoloadClasses[ 'PayflowProGateway_Form' ] = $dir . 'forms/Form.php'; |
26 | 26 | $wgAutoloadClasses[ 'PayflowProGateway_Form_TwoColumn' ] = $dir . 'forms/TwoColumn.php'; |
| 27 | +$wgAutoloadClasses[ 'PayflowProGateway_Form_TwoColumnPayPal' ] = $dir . 'forms/TwoColumnPayPal.php'; |
27 | 28 | $wgAutoloadClasses[ 'PayflowProGateway_Form_TwoColumnLetter' ] = $dir . 'forms/TwoColumnLetter.php'; |
28 | 29 | $wgAutoloadClasses[ 'PayflowProGateway_Form_SingleColumn' ] = $dir . 'forms/SingleColumn.php'; |
29 | 30 | $wgExtensionMessagesFiles['PayflowProGateway'] = $dir . 'payflowpro_gateway.i18n.php'; |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.css |
— | — | @@ -28,6 +28,7 @@ |
29 | 29 | #payflowpro_gateway-form-submit { |
30 | 30 | margin-top: 1em; |
31 | 31 | text-align: center; |
| 32 | + margin-bottom: 5em; |
32 | 33 | } |
33 | 34 | |
34 | 35 | #payflowpro_gateway-donate-addl-info { |
— | — | @@ -41,17 +42,13 @@ |
42 | 43 | #payflow-table-donor { |
43 | 44 | } |
44 | 45 | |
45 | | -#payflow-table-donor td.label, #payflow-table-comment td.label { |
| 46 | +#payflow-table-donor td.label, #payflow-table-comment td.label, #payflow-table-cc td.label { |
46 | 47 | text-align: right; |
47 | 48 | display: block; |
48 | 49 | padding-right: 1em; |
49 | 50 | width: 90px; |
50 | 51 | } |
51 | 52 | |
52 | | -#payflow-table-comment td.comment-field { |
53 | | - width: 99%; |
54 | | -} |
55 | | - |
56 | 53 | #payflow-table-comment td.check-option { |
57 | 54 | padding-left: 3em; |
58 | 55 | } |