From: Niklas Laxström Date: Sat, 20 Jun 2009 06:41:59 +0000 (+0000) Subject: Reimplement r49941 as an overridable method, as suggested by Tim (hiding navigation... X-Git-Tag: 1.31.0-rc.0~41280 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=35dff87821a6b9ba7fe248b07f23fcd4612dce58;p=lhc%2Fweb%2Fwiklou.git Reimplement r49941 as an overridable method, as suggested by Tim (hiding navigation bar when all results are shown) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 64b3893a34..58bd9f22a5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/Pager.php b/includes/Pager.php index 8271f1876a..6a8e670e68 100644 --- a/includes/Pager.php +++ b/includes/Pager.php @@ -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',