]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/specials/SpecialRecentchangeslinked.php
MediaWiki 1.15.0
[autoinstallsdev/mediawiki.git] / includes / specials / SpecialRecentchangeslinked.php
index c07343540a54d5a517b93e263ab0332deb152be2..c58ffff076def3d76ae73d9b88d2287030f92edf 100644 (file)
@@ -15,6 +15,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $opts = parent::getDefaultOptions();
                $opts->add( 'target', '' );
                $opts->add( 'showlinkedto', false );
+               $opts->add( 'tagfilter', '' );
                return $opts;
        }
 
@@ -22,9 +23,10 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $opts['target'] = $par;
        }
 
-       public function feedSetup(){
+       public function feedSetup() {
                global $wgRequest;
                $opts = parent::feedSetup();
+               # Feed is cached on limit,hideminor,target; other params would randomly not work
                $opts['target'] = $wgRequest->getVal( 'target' );
                return $opts;
        }
@@ -74,6 +76,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                $tables = array( 'recentchanges' );
                $select = array( $dbr->tableName( 'recentchanges' ) . '.*' );
                $join_conds = array();
+               $query_options = array();
 
                // left join with watchlist table to highlight watched rows
                if( $uid = $wgUser->getId() ) {
@@ -82,6 +85,9 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                        $join_conds['watchlist'] = array( 'LEFT JOIN', "wl_user={$uid} AND wl_title=rc_title AND wl_namespace=rc_namespace" );
                }
 
+               ChangeTags::modifyDisplayQuery( $tables, $select, $conds, $join_conds,
+                       $query_options, $opts['tagfilter'] );
+
                // XXX: parent class does this, should we too?
                // wfRunHooks('SpecialRecentChangesQuery', array( &$conds, &$tables, &$join_conds, $opts ) );
 
@@ -133,9 +139,14 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                                }
                        }
 
-                       $subsql[] = $dbr->selectSQLText( array_merge( $tables, array( $link_table ) ), $select, $conds + $subconds,
-                                                        __METHOD__, array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ),
-                                                        $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) ) );
+                       $subsql[] = $dbr->selectSQLText( 
+                               array_merge( $tables, array( $link_table ) ), 
+                               $select, 
+                               $conds + $subconds,
+                               __METHOD__, 
+                               array( 'ORDER BY' => 'rc_timestamp DESC', 'LIMIT' => $limit ) + $query_options,
+                               $join_conds + array( $link_table => array( 'INNER JOIN', $subjoin ) )
+                       );
                }
 
                if( count($subsql) == 0 )
@@ -163,6 +174,9 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges {
                        Xml::input( 'target', 40, str_replace('_',' ',$opts['target']) ) .
                        Xml::check( 'showlinkedto', $opts['showlinkedto'], array('id' => 'showlinkedto') ) . ' ' .
                        Xml::label( wfMsg("recentchangeslinked-to"), 'showlinkedto' ) );
+               $tagFilter = ChangeTags::buildTagFilterSelector( $opts['tagfilter'] );
+               if ($tagFilter)
+                       $extraOpts['tagfilter'] = $tagFilter;
                return $extraOpts;
        }