r75094 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75093‎ | r75094 | r75095 >
Date:18:36, 20 October 2010
Author:kaldari
Status:deferred
Tags:
Comment:
new table format
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php
@@ -18,9 +18,7 @@
1919 $form = parent::generateBannerHeader();
2020
2121 $form .= Xml::openElement( 'table', array( 'width' => '100%', 'cellspacing' => 0, 'cellpadding' => 0, 'border' => 0));
22 -
2322 $form .= Xml::openElement( 'tr' );
24 -
2523 $form .= Xml::openElement( 'td', array( 'id' => 'appeal', 'valign' => 'top' ) );
2624
2725 $text_template = $wgRequest->getText( 'text_template', '2010/JimmyAppealLong' );
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php
@@ -20,11 +20,29 @@
2121 $this->paypal = $wgRequest->getBool( 'paypal', false );
2222
2323 $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' ];
2432
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' );
2839
 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+
2947 // provide a place at the top of the form for displaying general messages
3048 if ( $this->form_errors['general'] ) {
3149 $form .= Xml::openElement( 'div', array( 'id' => 'mw-payflow-general-error' ));
@@ -38,9 +56,6 @@
3957 $form .= Xml::closeElement( 'div' ); // close div#mw-payflow-general-error
4058 }
4159
42 - // add noscript tags for javascript disabled browsers
43 - $form .= $this->getNoScript();
44 -
4560 // Xml::element seems to convert html to htmlentities
4661 $form .= "<p class='creditcard-error-msg'>" . $this->form_errors['retryMsg'] . "</p>";
4762 $form .= Xml::openElement( 'form', array( 'name' => 'payment', 'method' => 'post', 'action' => $this->getNoCacheAction(), 'onsubmit' => 'return validate_form(this)', 'autocomplete' => 'off' ) );
@@ -50,33 +65,14 @@
5166 }
5267
5368 public function generateFormEnd() {
54 - global $wgRequest, $wgOut;
5569 $form = '';
56 -
5770 $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
7471 return $form;
7572 }
7673
7774 protected function generateBillingContainer() {
7875 $form = '';
7976 $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' ));
8177 $form .= Xml::openElement( 'table', array( 'id' => 'payflow-table-donor' ) );
8278 $form .= $this->generateBillingFields();
8379 $form .= Xml::closeElement( 'table' ); // close table#payflow-table-donor
@@ -168,11 +164,9 @@
169165
170166 $form .= Xml::closeElement( 'form' ); // close form 'payment'
171167 $form .= $this->generateDonationFooter();
172 - if ( $this->paypal ) {
173 - $form .= Xml::tags( 'div', array( 'style' => 'margin-bottom: 8em;' ), '&nbsp;');
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' );
177171 return $form;
178172 }
179173 }

Status & tagging log