Adamw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/125057

Change subject: Stop using $wgOut.  Non-essential fix.
......................................................................

Stop using $wgOut.  Non-essential fix.

Change-Id: Ic70065b757bf3b7933c9ad1975b2ae8f6edfb2ea
---
M gateway_common/GatewayForm.php
1 file changed, 22 insertions(+), 28 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/57/125057/1

diff --git a/gateway_common/GatewayForm.php b/gateway_common/GatewayForm.php
index 17a0b6b..2a28b1c 100644
--- a/gateway_common/GatewayForm.php
+++ b/gateway_common/GatewayForm.php
@@ -128,14 +128,12 @@
         * The message at the top of the form can be edited in the 
payflow_gateway.i18n.php file
         */
        public function displayForm() {
-               global $wgOut;
-
                $form_class = $this->getFormClass();
                // TODO: use interface.  static ctor.
                if ( $form_class && class_exists( $form_class ) ){
                        $form_obj = new $form_class( $this->adapter );
                        $form = $form_obj->getForm();
-                       $wgOut->addHTML( $form );
+                       $this->getOutput()->addHTML( $form );
                } else {
 
                        $page = $this->adapter->getGlobal( "FailPage" );
@@ -149,7 +147,7 @@
                                $page = wfAppendQuery( $page, array( 'uselang' 
=> $language ) );
                        }
 
-                       $wgOut->redirect( $page );
+                       $this->getOutput()->redirect( $page );
                }
        }
 
@@ -170,58 +168,56 @@
         * @return null
         */
        protected function displayResultsForDebug( $results = array() ) {
-               global $wgOut;
-               
                $results = empty( $results ) ? 
$this->adapter->getTransactionAllResults() : $results;
                
                if ( $this->adapter->getGlobal( 'DisplayDebug' ) !== true ){
                        return;
                }
-               $wgOut->addHTML( HTML::element( 'span', null, 
$results['message'] ) );
+               $this->getOutput()->addHTML( HTML::element( 'span', null, 
$results['message'] ) );
 
                if ( !empty( $results['errors'] ) ) {
-                       $wgOut->addHTML( HTML::openElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::openElement( 'ul' ) 
);
                        foreach ( $results['errors'] as $code => $value ) {
-                               $wgOut->addHTML( HTML::element('li', null, 
"Error $code: $value" ) );
+                               $this->getOutput()->addHTML( 
HTML::element('li', null, "Error $code: $value" ) );
                        }
-                       $wgOut->addHTML( HTML::closeElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::closeElement( 'ul' ) 
);
                }
 
                if ( !empty( $results['data'] ) ) {
-                       $wgOut->addHTML( HTML::openElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::openElement( 'ul' ) 
);
                        foreach ( $results['data'] as $key => $value ) {
                                if ( is_array( $value ) ) {
-                                       $wgOut->addHTML( 
HTML::openElement('li', null, $key ) . HTML::openElement( 'ul' ) );
+                                       $this->getOutput()->addHTML( 
HTML::openElement('li', null, $key ) . HTML::openElement( 'ul' ) );
                                        foreach ( $value as $key2 => $val2 ) {
-                                               $wgOut->addHTML( 
HTML::element('li', null, "$key2: $val2" ) );
+                                               $this->getOutput()->addHTML( 
HTML::element('li', null, "$key2: $val2" ) );
                                        }
-                                       $wgOut->addHTML( HTML::closeElement( 
'ul' ) . HTML::closeElement( 'li' ) );
+                                       $this->getOutput()->addHTML( 
HTML::closeElement( 'ul' ) . HTML::closeElement( 'li' ) );
                                } else {
-                                       $wgOut->addHTML( HTML::element('li', 
null, "$key: $value" ) );
+                                       $this->getOutput()->addHTML( 
HTML::element('li', null, "$key: $value" ) );
                                }
                        }
-                       $wgOut->addHTML( HTML::closeElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::closeElement( 'ul' ) 
);
                } else {
-                       $wgOut->addHTML( "Empty Results" );
+                       $this->getOutput()->addHTML( "Empty Results" );
                }
                if ( array_key_exists( 'Donor', $_SESSION ) ) {
-                       $wgOut->addHTML( "Session Donor Vars:" . 
HTML::openElement( 'ul' ));
+                       $this->getOutput()->addHTML( "Session Donor Vars:" . 
HTML::openElement( 'ul' ));
                        foreach ( $_SESSION['Donor'] as $key => $val ) {
-                               $wgOut->addHTML( HTML::element('li', null, 
"$key: $val" ) );
+                               $this->getOutput()->addHTML( 
HTML::element('li', null, "$key: $val" ) );
                        }
-                       $wgOut->addHTML( HTML::closeElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::closeElement( 'ul' ) 
);
                } else {
-                       $wgOut->addHTML( "No Session Donor Vars:" );
+                       $this->getOutput()->addHTML( "No Session Donor Vars:" );
                }
 
                if ( is_array( $this->adapter->debugarray ) ) {
-                       $wgOut->addHTML( "Debug Array:" . HTML::openElement( 
'ul' ) );
+                       $this->getOutput()->addHTML( "Debug Array:" . 
HTML::openElement( 'ul' ) );
                        foreach ( $this->adapter->debugarray as $val ) {
-                               $wgOut->addHTML( HTML::element('li', null, $val 
) );
+                               $this->getOutput()->addHTML( 
HTML::element('li', null, $val ) );
                        }
-                       $wgOut->addHTML( HTML::closeElement( 'ul' ) );
+                       $this->getOutput()->addHTML( HTML::closeElement( 'ul' ) 
);
                } else {
-                       $wgOut->addHTML( "No Debug Array" );
+                       $this->getOutput()->addHTML( "No Debug Array" );
                }
        }
 
@@ -256,8 +252,6 @@
         * @return null
         */
        protected function resultHandler() {
-               
-               global $wgOut;
 
                // If transaction is anything, except failed, go to the thank 
you page.
                
@@ -269,7 +263,7 @@
                                
                                $queryString = '?payment_method=' . 
$this->adapter->getPaymentMethod() . '&payment_submethod=' . 
$this->adapter->getPaymentSubmethod();
                                
-                               return $wgOut->redirect( $thankyoupage . 
$queryString );
+                               return $this->getOutput()->redirect( 
$thankyoupage . $queryString );
                        }
                }
                

-- 
To view, visit https://gerrit.wikimedia.org/r/125057
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic70065b757bf3b7933c9ad1975b2ae8f6edfb2ea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Adamw <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to