Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php |
— | — | @@ -67,6 +67,9 @@ |
68 | 68 | $form .= Xml::closeElement( 'div' ); |
69 | 69 | } |
70 | 70 | |
| 71 | + // add noscript tags for javascript disabled browsers |
| 72 | + $form .= $this->getNoScript(); |
| 73 | + |
71 | 74 | // open form |
72 | 75 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) ); |
73 | 76 | |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter.php |
— | — | @@ -36,6 +36,9 @@ |
37 | 37 | |
38 | 38 | $form .= Xml::openElement( 'td', array( 'id' => 'donate', 'valign' => 'top' ) ); |
39 | 39 | |
| 40 | + // add noscript tags for javascript disabled browsers |
| 41 | + $form .= $this->getNoScript(); |
| 42 | + |
40 | 43 | $form .= Xml::tags( 'h2', array( 'id' => 'donate-head' ), wfMsg( 'payflowpro_gateway-make-your-donation' )); |
41 | 44 | |
42 | 45 | // 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 @@ |
27 | 27 | $form .= Xml::closeElement( 'div' ); |
28 | 28 | } |
29 | 29 | |
| 30 | + // add noscript tags for javascript disabled browsers |
| 31 | + $form .= $this->getNoScript(); |
| 32 | + |
30 | 33 | // open form |
31 | 34 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) ); |
32 | 35 | |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/Form.php |
— | — | @@ -650,6 +650,26 @@ |
651 | 651 | } |
652 | 652 | |
653 | 653 | /** |
| 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 | + /** |
654 | 674 | * Determine the 'no cache' form action |
655 | 675 | * |
656 | 676 | * 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 @@ |
54 | 54 | $form .= Xml::closeElement( 'div' ); |
55 | 55 | } |
56 | 56 | |
| 57 | + // add noscript tags for javascript disabled browsers |
| 58 | + $form .= $this->getNoScript(); |
| 59 | + |
57 | 60 | // open form |
58 | 61 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) ); |
59 | 62 | |
— | — | @@ -108,7 +111,6 @@ |
109 | 112 | |
110 | 113 | protected function generateBannerHeader() { |
111 | 114 | global $wgPayflowGatewayHeader, $wgOut, $wgRequest; |
112 | | - |
113 | 115 | $template = ''; |
114 | 116 | |
115 | 117 | // intro text |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoColumnLetter.php |
— | — | @@ -39,7 +39,10 @@ |
40 | 40 | } |
41 | 41 | $form .= Xml::closeElement( 'div' ); // close div#mw-payflow-general-error |
42 | 42 | } |
43 | | - |
| 43 | + |
| 44 | + // add noscript tags for javascript disabled browsers |
| 45 | + $form .= $this->getNoScript(); |
| 46 | + |
44 | 47 | // open form |
45 | 48 | $form .= Xml::openElement( 'div', array( 'id' => 'mw-creditcard-form' ) ); |
46 | 49 | |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.i18n.php |
— | — | @@ -108,6 +108,8 @@ |
109 | 109 | 'payflowpro_gateway-comment' => 'Comment', |
110 | 110 | 'payflowpro_gateway-first' => 'First', |
111 | 111 | '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:' |
112 | 114 | ); |
113 | 115 | |
114 | 116 | /** Message documentation (Message documentation) |
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php |
— | — | @@ -79,6 +79,11 @@ |
80 | 80 | $wgPayflowGatewayHeader = NULL; |
81 | 81 | |
82 | 82 | /** |
| 83 | + * A string containing full URL for Javascript-disabled credit card form redirect |
| 84 | + */ |
| 85 | +$wgPayflowGatewayNoScriptRedirect = null; |
| 86 | + |
| 87 | +/** |
83 | 88 | * Proxy settings |
84 | 89 | * |
85 | 90 | * If you need to use an HTTP proxy for outgoing traffic, |