Follow-ups to r84258
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchangeslinked.php
index 387679f..873055c 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 /**
+ * Implements Special:Recentchangeslinked
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup SpecialPage
  */
 
 /**
  * This is to display changes made to all articles linked in an article.
+ *
  * @ingroup SpecialPage
  */
-class SpecialRecentchangeslinked extends SpecialRecentchanges {
+class SpecialRecentchangeslinked extends SpecialRecentChanges {
        var $rclTargetTitle;
 
        function __construct(){
@@ -51,7 +56,8 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $feed = new ChangesFeed( $feedFormat, false );
                $feedObj = $feed->getFeedObject(
                        wfMsgForContent( 'recentchangeslinked-title', $this->getTargetTitle()->getPrefixedText() ),
-                       wfMsgForContent( 'recentchangeslinked-feed' )
+                       wfMsgForContent( 'recentchangeslinked-feed' ),
+                       $this->getTitle()->getFullUrl()
                );
                return array( $feed, $feedObj );
        }
@@ -94,7 +100,8 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $query_options = array();
 
                // left join with watchlist table to highlight watched rows
-               if( $uid = $wgUser->getId() ) {
+               $uid = $wgUser->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" );
@@ -109,8 +116,8 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                                $query_options, $opts['tagfilter'] );
                }
 
-               // XXX: parent class does this, should we too?
-               // wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
+               if ( !wfRunHooks( 'SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts, &$query_options, &$select ) ) )
+                       return false;
 
                if( $ns == NS_CATEGORY && !$showlinkedto ) {
                        // special handling for categories
@@ -165,16 +172,16 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                        else
                                $order = array();
 
-                       
-                       $query = $dbr->selectSQLText( 
-                               array_merge( $tables, array( $link_table ) ), 
-                               $select, 
+
+                       $query = $dbr->selectSQLText(
+                               array_merge( $tables, array( $link_table ) ),
+                               $select,
                                $conds + $subconds,
-                               __METHOD__, 
+                               __METHOD__,
                                $order + $query_options,
                                $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) )
                        );
-                       
+
                        if( $dbr->unionSupportsOrderAndLimit())
                                $query = $dbr->limitResult( $query, $limit );
 
@@ -190,7 +197,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                        $sql = $dbr->unionQueries($subsql, false).' ORDER BY rc_timestamp DESC';
                        $sql = $dbr->limitResult($sql, $limit, false);
                }
-               
+
                $res = $dbr->query( $sql, __METHOD__ );
 
                if( $res->numRows() == 0 )
@@ -198,7 +205,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
 
                return $res;
        }
-       
+
        function getExtraOptions( $opts ){
                $opts->consumeValues( array( 'showlinkedto', 'target', 'tagfilter' ) );
                $extraOpts = array();
@@ -245,7 +252,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
 
        function setBottomText( OutputPage $out, FormOptions $opts ) {
                if( isset( $this->mResultEmpty ) && $this->mResultEmpty ){
-                       $out->addWikiMsg( 'recentchangeslinked-noresult' );     
+                       $out->addWikiMsg( 'recentchangeslinked-noresult' );
                }
        }
 }