Merge "User#getOption: Check ignoreHidden before $wgHiddenPrefs"
[lhc/web/wiklou.git] / includes / specials / SpecialRecentchanges.php
index 1b406d1..d263202 100644 (file)
@@ -393,7 +393,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                $fields = RecentChange::selectFields();
                // JOIN on watchlist for users
-               if ( $uid ) {
+               if ( $uid && $this->getUser()->isAllowed( 'viewmywatchlist' ) ) {
                        $tables[] = 'watchlist';
                        $fields[] = 'wl_user';
                        $fields[] = 'wl_notificationtimestamp';
@@ -516,6 +516,13 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $counter = 1;
                $list = ChangesList::newFromContext( $this->getContext() );
 
+               if ( $rows->numRows() === 0 ) {
+                       $this->getOutput()->wrapWikiMsg(
+                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+                       );
+                       return;
+               }
+
                $s = $list->beginRecentChangesList();
                foreach ( $rows as $obj ) {
                        if ( $limit == 0 ) {
@@ -592,10 +599,6 @@ class SpecialRecentChanges extends IncludableSpecialPage {
 
                $defaults = $opts->getAllValues();
                $nondefaults = $opts->getChangedValues();
-               $opts->consumeValues( array(
-                       'namespace', 'invert', 'associated', 'tagfilter',
-                       'categories', 'categories_any'
-               ) );
 
                $panel = array();
                $panel[] = $this->optionsPanel( $defaults, $nondefaults );
@@ -664,6 +667,10 @@ class SpecialRecentChanges extends IncludableSpecialPage {
         * @return array
         */
        function getExtraOptions( $opts ) {
+               $opts->consumeValues( array(
+                       'namespace', 'invert', 'associated', 'tagfilter', 'categories', 'categories_any'
+               ) );
+
                $extraOpts = array();
                $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
 
@@ -677,7 +684,10 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        $extraOpts['tagfilter'] = $tagFilter;
                }
 
-               wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
+               // Don't fire the hook for subclasses. (Or should we?)
+               if ( $this->getName() === 'Recentchanges' ) {
+                       wfRunHooks( 'SpecialRecentChangesPanel', array( &$extraOpts, $opts ) );
+               }
 
                return $extraOpts;
        }
@@ -704,8 +714,7 @@ class SpecialRecentChanges extends IncludableSpecialPage {
        }
 
        /**
-        * Send the text to be displayed after the options, for use in
-        * Recentchangeslinked
+        * Send the text to be displayed after the options, for use in subclasses.
         *
         * @param FormOptions $opts
         */