Correct the address of the FSF in some of the GPL headers
[lhc/web/wiklou.git] / includes / specials / SpecialWhatlinkshere.php
index af1115f..c7fee57 100644 (file)
@@ -1,9 +1,22 @@
 <?php
 /**
  * @todo Use some variant of Pager or something; the pagination here is lousy.
- *
  * @file
- * @ingroup SpecialPage
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * 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
  */
 
 /**
@@ -334,18 +347,18 @@ class SpecialWhatLinksHere extends SpecialPage {
 
                if ( 0 != $prevId ) {
                        $overrides = array( 'from' => $this->opts->getValue( 'back' ) );
-                       $prev = $this->makeSelfLink( $prev, array_merge( $overrides, $changed ) );
+                       $prev = $this->makeSelfLink( $prev, array_merge( $changed, $overrides ) );
                }
                if ( 0 != $nextId ) {
                        $overrides = array( 'from' => $nextId, 'back' => $prevId );
-                       $next = $this->makeSelfLink( $next, array_merge( $overrides, $changed ) );
+                       $next = $this->makeSelfLink( $next, array_merge( $changed, $overrides ) );
                }
 
                $limitLinks = array();
                foreach ( $this->limits as $limit ) {
                        $prettyLimit = $wgLang->formatNum( $limit );
                        $overrides = array( 'limit' => $limit );
-                       $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $overrides, $changed ) );
+                       $limitLinks[] = $this->makeSelfLink( $prettyLimit, array_merge( $changed, $overrides ) );
                }
 
                $nums = $wgLang->pipeList( $limitLinks );
@@ -382,7 +395,7 @@ class SpecialWhatLinksHere extends SpecialPage {
                $f .= ' ';
 
                # Namespace selector
-               $f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&nbsp;' .
+               $f .= Xml::label( wfMsg( 'namespace' ), 'namespace' ) . '&#160;' .
                        Xml::namespaceSelector( $namespace, '' );
 
                $f .= ' ';
@@ -396,6 +409,11 @@ class SpecialWhatLinksHere extends SpecialPage {
                return $f;
        }
 
+       /**
+        * Create filter panel
+        * 
+        * @return string HTML fieldset and filter panel with the show/hide links
+        */
        function getFilterPanel() {
                global $wgLang;
                $show = wfMsgHtml( 'show' );
@@ -408,11 +426,14 @@ class SpecialWhatLinksHere extends SpecialPage {
                $types = array( 'hidetrans', 'hidelinks', 'hideredirs' );
                if( $this->target->getNamespace() == NS_FILE )
                        $types[] = 'hideimages';
+
+               // Combined message keys: 'whatlinkshere-hideredirs', 'whatlinkshere-hidetrans', 'whatlinkshere-hidelinks', 'whatlinkshere-hideimages'
+               // To be sure they will be find by grep
                foreach( $types as $type ) {
                        $chosen = $this->opts->getValue( $type );
-                       $msg = wfMsgHtml( "whatlinkshere-{$type}", $chosen ? $show : $hide );
+                       $msg = $chosen ? $show : $hide;
                        $overrides = array( $type => !$chosen );
-                       $links[] = $this->makeSelfLink( $msg, array_merge( $overrides, $changed ) );
+                       $links[] =  wfMsgHtml( "whatlinkshere-{$type}", $this->makeSelfLink( $msg, array_merge( $changed, $overrides ) ) );
                }
                return Xml::fieldset( wfMsg( 'whatlinkshere-filters' ), $wgLang->pipeList( $links ) );
        }