Reimplement r49941 as an overridable method, as suggested by Tim (hiding navigation...
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 20 Jun 2009 06:41:59 +0000 (06:41 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sat, 20 Jun 2009 06:41:59 +0000 (06:41 +0000)
RELEASE-NOTES
includes/Pager.php

index 64b3893..58bd9f2 100644 (file)
@@ -144,8 +144,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   for it.
 * (bug 17020) Adding fallback encodings for Traditional and Simplified Chinese
   languages while the the text is typed as URLs.
-* (bug 17614) Prev / Next links not need on ImagePage file history if less than
-  limit
+* (bug 17614) Prev / Next links are not shown if all results are shown
 * (bug 18207) Strange spacing before [[irc:...]] links
 * Removed float from the user login form in RTL interface - caused display
   problems in FF2
index 8271f18..6a8e670 100644 (file)
@@ -417,6 +417,14 @@ abstract class IndexPager implements Pager {
                return array( 'prev' => $prev, 'next' => $next, 'first' => $first, 'last' => $last );
        }
 
+       function isNavigationBarShown() {
+               if ( !$this->mQueryDone ) {
+                       $this->doQuery();
+               }
+               // Hide navigation by default if there is nothing to page
+               return !($this->mIsFirst && $this->mIsLast);
+       }
+
        /**
         * Get paging links. If a link is disabled, the item from $disabledTexts
         * will be used. If there is no such item, the unlinked text from
@@ -517,6 +525,8 @@ abstract class AlphabeticPager extends IndexPager {
        function getNavigationBar() {
                global $wgLang;
 
+               if ( !$this->isNavigationBarShown() ) return '';
+
                if( isset( $this->mNavigationBar ) ) {
                        return $this->mNavigationBar;
                }
@@ -598,6 +608,8 @@ abstract class ReverseChronologicalPager extends IndexPager {
        function getNavigationBar() {
                global $wgLang;
 
+               if ( !$this->isNavigationBarShown() ) return '';
+
                if ( isset( $this->mNavigationBar ) ) {
                        return $this->mNavigationBar;
                }
@@ -811,6 +823,9 @@ abstract class TablePager extends IndexPager {
         */
        function getNavigationBar() {
                global $wgStylePath, $wgContLang;
+
+               if ( !$this->isNavigationBarShown() ) return '';
+
                $path = "$wgStylePath/common/images";
                $labels = array(
                        'first' => 'table_pager_first',