When hiding things on WhatLinksHere, generated URLs should hide them too. Note that...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 16 Apr 2008 14:43:38 +0000 (14:43 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 16 Apr 2008 14:43:38 +0000 (14:43 +0000)
Also, it might be nice if it didn't let you hide *everything*.  That's kind of silly.

RELEASE-NOTES
includes/SpecialWhatlinkshere.php

index 6aa1e70..57359ef 100644 (file)
@@ -185,10 +185,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13736) Don't show MediaWiki:Anontalkpagetext on non-existant IP addresses
 * (bug 13728) Don't trim initial whitespace during section edits
 * (bug 13727) Don't delete log entries from recentchanges on page deletion
-* (bug 13752) Section redirects now works again
+* (bug 13752) Redirects to sections now work again
 * (bug 13725) Upload form watch checkbox state set correctly with wpDestFile
 * (bug 13756) Don't show the form and navigation links of Special:Newpages if
   the page is included
+* When hiding things on WhatLinksHere, generated URLs should hide them too
 
 
 === API changes in 1.13 ===
index 111d82b..53b9b7a 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 /**
+ * @TODO: Use some variant of Pager or something; the pagination here is lousy.
  *
  * @addtogroup SpecialPage
  */
@@ -275,6 +276,13 @@ class WhatLinksHerePage {
                return $this->skin->makeKnownLinkObj( $this->selfTitle, $text, $query );
        }
 
+       /** Get a query string to append to hide appropriate entries */
+       function getHideParams() {
+               return ($this->hidetrans  ? '&hidetrans=1'  : '')
+            . ($this->hidelinks  ? '&hidelinks=1'  : '')
+                    . ($this->hideredirs ? '&hideredirs=1' : '');
+       }
+
        function getPrevNext( $limit, $prevId, $nextId ) {
                global $wgLang;
                $fmtLimit = $wgLang->formatNum( $limit );
@@ -286,13 +294,15 @@ class WhatLinksHerePage {
                        $nsText = "&namespace={$this->namespace}";
                }
 
+               $hideParams = $this->getHideParams();
+
                if ( 0 != $prevId ) {
-                       $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}{$nsText}" );
+                       $prevLink = $this->makeSelfLink( $prev, "limit={$limit}&from={$this->back}{$nsText}{$hideParams}" );
                } else {
                        $prevLink = $prev;
                }
                if ( 0 != $nextId ) {
-                       $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}{$nsText}" );
+                       $nextLink = $this->makeSelfLink( $next, "limit={$limit}&from={$nextId}&back={$prevId}{$nsText}{$hideParams}" );
                } else {
                        $nextLink = $next;
                }
@@ -310,7 +320,7 @@ class WhatLinksHerePage {
                $query = "limit={$limit}&from={$from}";
                if( is_int($this->namespace) ) { $query .= "&namespace={$this->namespace}";}
                $fmtLimit = $wgLang->formatNum( $limit );
-               return $this->makeSelfLink( $fmtLimit, $query );
+               return $this->makeSelfLink( $fmtLimit, $query.$this->getHideParams() );
        }
 
        function whatlinkshereForm( $options = array( 'target' => '', 'namespace' => '' ) ) {