Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php |
— | — | @@ -18,9 +18,7 @@ |
19 | 19 | $form = parent::generateBannerHeader(); |
20 | 20 | |
21 | 21 | $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0)); |
22 | | - |
23 | 22 | $form .= Xml::openElement( 'tr' ); |
24 | | - |
25 | 23 | $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
26 | 24 | |
27 | 25 | $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php |
— | — | @@ -20,11 +20,29 @@ |
21 | 21 | $this->paypal = $wgRequest->getBool( 'paypal', false ); |
22 | 22 | |
23 | 23 | $form = parent::generateBannerHeader(); |
| 24 | + |
| 25 | + $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0)); |
| 26 | + $form .= Xml::openElement( 'tr' ); |
| 27 | + $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) ); |
| 28 | + |
| 29 | + $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
| 30 | + // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
| 31 | + if ( $wgRequest->getText( 'language' )) $text_template .= '/' . $this->form_data[ 'language' ]; |
24 | 32 | |
25 | | - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_container')); |
26 | | - $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' ) ); |
| 33 | + $template = ( strlen( $text_template )) ? $wgOut->parse( '{{'.$text_template.'}}' ) : ''; |
| 34 | + // if the template doesn't exist, prevent the display of the red link |
| 35 | + if ( preg_match( '/redlink\=1/', $template )) $template = NULL; |
| 36 | + $form .= $template; |
| 37 | + |
| 38 | + $form .= Xml::closeElement( 'td' ); |
28 | 39 | |
| 40 | + $form .= Xml::openElement( 'td', array( 'id' => 'donate', 'valign' => 'top' ) ); |
| 41 | + |
| 42 | + // add noscript tags for javascript disabled browsers |
| 43 | + $form .= $this->getNoScript(); |
| 44 | + |
| 45 | + $form .= Xml::tags( 'h2', array( 'id' => 'donate-head' ), wfMsg( 'payflowpro_gateway-make-your-donation' )); |
| 46 | + |
29 | 47 | // provide a place at the top of the form for displaying general messages |
30 | 48 | if ( $this->form_errors['general'] ) { |
31 | 49 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' )); |
— | — | @@ -38,9 +56,6 @@ |
39 | 57 | $form .= Xml::closeElement( 'div' ); // close div#mw-payflow-general-error |
40 | 58 | } |
41 | 59 | |
42 | | - // add noscript tags for javascript disabled browsers |
43 | | - $form .= $this->getNoScript(); |
44 | | - |
45 | 60 | // Xml::element seems to convert html to htmlentities |
46 | 61 | $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>"; |
47 | 62 | $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) ); |
— | — | @@ -50,33 +65,14 @@ |
51 | 66 | } |
52 | 67 | |
53 | 68 | public function generateFormEnd() { |
54 | | - global $wgRequest, $wgOut; |
55 | 69 | $form = ''; |
56 | | - |
57 | 70 | $form .= $this->generateFormClose(); |
58 | | - |
59 | | - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_letter', 'class' => 'payflowpro_gateway-cc_form_column')); |
60 | | - $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-cc_form_letter_inside' )); |
61 | | - |
62 | | - $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' ); |
63 | | - // if the user has uselang set, honor that, otherwise default to the language set for the form defined by 'language' in the query string |
64 | | - if ( $wgRequest->getText( 'language' )) $text_template .= '/' . $this->form_data[ 'language' ]; |
65 | | - |
66 | | - $template = ( strlen( $text_template )) ? $wgOut->parse( '{{'.$text_template.'}}' ) : ''; |
67 | | - // if the template doesn't exist, prevent the display of the red link |
68 | | - if ( preg_match( '/redlink\=1/', $template )) $template = NULL; |
69 | | - $form .= $template; |
70 | | - |
71 | | - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_letter_inside |
72 | | - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_letter |
73 | | - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_container |
74 | 71 | return $form; |
75 | 72 | } |
76 | 73 | |
77 | 74 | protected function generateBillingContainer() { |
78 | 75 | $form = ''; |
79 | 76 | $form .= Xml::openElement( 'div', array( 'id' => 'payflowpro_gateway-personal-info' )); |
80 | | - $form .= Xml::tags( 'h3', array( 'class' => 'payflow-cc-form-header','id' => 'payflow-cc-form-header-personal' ), wfMsg( 'payflowpro_gateway-make-your-donation' )); |
81 | 77 | $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) ); |
82 | 78 | $form .= $this->generateBillingFields(); |
83 | 79 | $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor |
— | — | @@ -168,11 +164,9 @@ |
169 | 165 | |
170 | 166 | $form .= Xml::closeElement( 'form' ); // close form 'payment' |
171 | 167 | $form .= $this->generateDonationFooter(); |
172 | | - if ( $this->paypal ) { |
173 | | - $form .= Xml::tags( 'div', array( 'style' => 'margin-bottom: 8em;' ), ' '); |
174 | | - } |
175 | | - $form .= Xml::closeElement( 'div' ); // close div#mw-creditcard |
176 | | - $form .= Xml::closeElement( 'div' ); // close div#payflowpro_gateway-cc_form_form |
| 168 | + $form .= Xml::closeElement( 'td' ); |
| 169 | + $form .= Xml::closeElement( 'tr' ); |
| 170 | + $form .= Xml::closeElement( 'table' ); |
177 | 171 | return $form; |
178 | 172 | } |
179 | 173 | } |