revert r106095, fix apparently not this simple
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchangeslinked.php
index 5583c26..6ad82f1 100644 (file)
@@ -46,9 +46,8 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
        }
 
        public function feedSetup() {
-               global $wgRequest;
                $opts = parent::feedSetup();
-               $opts['target'] = $wgRequest->getVal( 'target' );
+               $opts['target'] = $this->getRequest()->getVal( 'target' );
                return $opts;
        }
 
@@ -63,8 +62,6 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
        }
 
        public function doMainQuery( $conds, $opts ) {
-               global $wgUser, $wgOut;
-
                $target = $opts['target'];
                $showlinkedto = $opts['showlinkedto'];
                $limit = $opts['limit'];
@@ -74,11 +71,11 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                }
                $title = Title::newFromURL( $target );
                if( !$title || $title->getInterwiki() != '' ){
-                       $wgOut->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
+                       $this->getOutput()->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
                        return false;
                }
 
-               $wgOut->setPageTitle( wfMsg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
+               $this->getOutput()->setPageTitle( $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() ) );
 
                /*
                 * Ordinary links are in the pagelinks table, while transclusions are
@@ -100,13 +97,13 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                $query_options = array();
 
                // left join with watchlist table to highlight watched rows
-               $uid = $wgUser->getId();
+               $uid = $this->getUser()->getId();
                if( $uid ) {
                        $tables[] = 'watchlist';
                        $select[] = 'wl_user';
                        $join_conds['watchlist'] = array( 'LEFT JOIN', "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace" );
                }
-               if ( $wgUser->isAllowed( 'rollback' ) ) {
+               if ( $this->getUser()->isAllowed( 'rollback' ) ) {
                        $tables[] = 'page';
                        $join_conds['page'] = array('LEFT JOIN', 'rc_cur_id=page_id');
                        $select[] = 'page_latest';
@@ -144,7 +141,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
 
                        // imagelinks and categorylinks tables have no xx_namespace field, and have xx_to instead of xx_title
                        if( $link_table == 'imagelinks' ) $link_ns = NS_FILE;
-                       else if( $link_table == 'categorylinks' ) $link_ns = NS_CATEGORY;
+                       elseif( $link_table == 'categorylinks' ) $link_ns = NS_CATEGORY;
                        else $link_ns = 0;
 
                        if( $showlinkedto ) {
@@ -235,13 +232,11 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                return $this->rclTargetTitle;
        }
 
-       function setTopText( OutputPage $out, FormOptions $opts ) {
-               global $wgUser;
-               $skin = $wgUser->getSkin();
+       function setTopText( FormOptions $opts ) {
                $target = $this->getTargetTitle();
-               if( $target )
-                       $out->setSubtitle( wfMsg( 'recentchangeslinked-backlink', $skin->link( $target,
-                               $target->getPrefixedText(), array(), array( 'redirect' => 'no'  ) ) ) );
+               if( $target ) {
+                       $this->getOutput()->addBacklinkSubtitle( $target );
+               }
        }
 
        public function getFeedQuery() {
@@ -253,9 +248,9 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                }
        }
 
-       function setBottomText( OutputPage $out, FormOptions $opts ) {
-               if( isset( $this->mResultEmpty ) && $this->mResultEmpty ){
-                       $out->addWikiMsg( 'recentchangeslinked-noresult' );
+       function setBottomText( FormOptions $opts ) {
+               if( isset( $this->mResultEmpty ) && $this->mResultEmpty ) {
+                       $this->getOutput()->addWikiMsg( 'recentchangeslinked-noresult' );
                }
        }
 }