r74779 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74778‎ | r74779 | r74780 >
Date:16:26, 14 October 2010
Author:awjrichards
Status:deferred
Tags:
Comment:
Added noscript tags to donation forms; Added i18n messages for noscript; Added configurable link to display to users viewing noscript content
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/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)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php
@@ -67,6 +67,9 @@
6868 $form .= Xml::closeElement( 'div' );
6969 }
7070
 71+ // add noscript tags for javascript disabled browsers
 72+ $form .= $this->getNoScript();
 73+
7174 // open form
7275 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
7376
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php
@@ -36,6 +36,9 @@
3737
3838 $form .= Xml::openElement( 'td', array( 'id' => 'donate', 'valign' => 'top' ) );
3939
 40+ // add noscript tags for javascript disabled browsers
 41+ $form .= $this->getNoScript();
 42+
4043 $form .= Xml::tags( 'h2', array( 'id' => 'donate-head' ), wfMsg( 'payflowpro_gateway-make-your-donation' ));
4144
4245 // provide a place at the top of the form for displaying general messages
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnPayPal.php
@@ -26,6 +26,9 @@
2727 $form .= Xml::closeElement( 'div' );
2828 }
2929
 30+ // add noscript tags for javascript disabled browsers
 31+ $form .= $this->getNoScript();
 32+
3033 // open form
3134 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
3235
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php
@@ -650,6 +650,26 @@
651651 }
652652
653653 /**
 654+ * Generate HTML for <noscript> tags
 655+ *
 656+ * For displaying when a user does not have Javascript enabled in their browser.
 657+ */
 658+ protected function getNoScript() {
 659+ global $wgPayflowGatewayNoScriptRedirect;
 660+
 661+ $form = '<noscript>';
 662+ $form .= '<div id="noscript">';
 663+ $form .= '<p id="noscript-msg">' . wfMsg( 'payflowpro_gateway-noscript-msg' ) . '</p>';
 664+ if ( $wgPayflowGatewayNoScriptRedirect ) {
 665+ $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>';
 667+ }
 668+ $form .= '</div>';
 669+ $form .= '</noscript>';
 670+ return $form;
 671+ }
 672+
 673+ /**
654674 * Determine the 'no cache' form action
655675 *
656676 * This mostly exists to ensure that the form does not try to use AJAX to
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/OneStepTwoColumn.php
@@ -53,6 +53,9 @@
5454 $form .= Xml::closeElement( 'div' );
5555 }
5656
 57+ // add noscript tags for javascript disabled browsers
 58+ $form .= $this->getNoScript();
 59+
5760 // open form
5861 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
5962
@@ -108,7 +111,6 @@
109112
110113 protected function generateBannerHeader() {
111114 global $wgPayflowGatewayHeader, $wgOut, $wgRequest;
112 -
113115 $template = '';
114116
115117 // intro text
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php
@@ -39,7 +39,10 @@
4040 }
4141 $form .= Xml::closeElement( 'div' ); // close div#mw-payflow-general-error
4242 }
43 -
 43+
 44+ // add noscript tags for javascript disabled browsers
 45+ $form .= $this->getNoScript();
 46+
4447 // open form
4548 $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) );
4649
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php
@@ -108,6 +108,8 @@
109109 'payflowpro_gateway-comment' => 'Comment',
110110 'payflowpro_gateway-first' => 'First',
111111 'payflowpro_gateway-last' => 'Last',
 112+ 'payflowpro_gateway-noscript-msg' => 'It appears that you do not have Javascript enabled, or your browser does not support it. In order to provide a safe, secure and pleasant experience, our donation form requires Javascript.',
 113+ 'payflowpro_gateway-noscript-redirect-msg' => 'If you cannot or do not wish to enable Javascript, you may still contribute by visiting:'
112114 );
113115
114116 /** Message documentation (Message documentation)
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -79,6 +79,11 @@
8080 $wgPayflowGatewayHeader = NULL;
8181
8282 /**
 83+ * A string containing full URL for Javascript-disabled credit card form redirect
 84+ */
 85+$wgPayflowGatewayNoScriptRedirect = null;
 86+
 87+/**
8388 * Proxy settings
8489 *
8590 * If you need to use an HTTP proxy for outgoing traffic,

Follow-up revisions

RevisionCommit summaryAuthorDate
r74781Follow-up r74779: Javascript -> JavaScript for consistency in MediaWikiraymond16:41, 14 October 2010

Status & tagging log