From dd7cdfd8247a9940d2dc4a9693c50ce57e6a8306 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 25 Mar 2011 17:36:58 +0100 Subject: [PATCH] Only show pagination info when there are items to paginate --- main/inc/lib/sortabletable.class.php | 38 ++++++++++++++++------------ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/main/inc/lib/sortabletable.class.php b/main/inc/lib/sortabletable.class.php index 261a7c9ddb..a66b7932e8 100755 --- a/main/inc/lib/sortabletable.class.php +++ b/main/inc/lib/sortabletable.class.php @@ -181,7 +181,7 @@ class SortableTable extends HTML_Table { $params['prevImg'] = Display :: return_icon('action_prev.png', get_lang('PreviousPage'), $icon_attributes); $params['nextImg'] = Display :: return_icon('action_next.png', get_lang('NextPage'), $icon_attributes); $params['firstPageText'] = Display :: return_icon('action_first.png', get_lang('FirstPage'), $icon_attributes); - $params['lastPageText'] = Display :: return_icon('action_last.png', get_lang('LastPage'), $icon_attributes); + $params['lastPageText'] = Display :: return_icon('action_last.png', get_lang('LastPage'), $icon_attributes); $params['firstPagePre'] = ''; $params['lastPagePre'] = ''; $params['firstPagePost'] = ''; @@ -215,21 +215,27 @@ class SortableTable extends HTML_Table { } $html = ''; if (!$empty_table) { - $form = $this->get_page_select_form(); - $nav = $this->get_navigation_html(); - $html = ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= ''; - $html .= '
'; - $html .= $form; - $html .= ''; - $html .= $this->get_table_title(); - $html .= ''; - $html .= $nav; - $html .= '
'; + $form = $this->get_page_select_form(); + $nav = $this->get_navigation_html(); + + //Only show pagination info when there are items to paginate + + if ($this->total_number_of_items > $this->default_items_per_page) { + $html = ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= '
'; + $html .= $form; + $html .= ''; + $html .= $this->get_table_title(); + $html .= ''; + $html .= $nav; + $html .= '
'; + } + if (count($this->form_actions) > 0) { $html .= '