From bbec26a3cef5a75053edb1a9e3bdc50b717e7371 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 12 Jun 2008 17:23:24 +0000 Subject: [PATCH] patch #1987593 [interface] Table list pagination in navi --- ChangeLog | 4 ++++ navigation.php | 49 ++++++++++++++++++++++++++++++++++++------------- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45f2e92e01..a70c6ed473 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog $Id$ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyAdmin/ChangeLog $ +2.11.8.0 (not yet released) +- patch #1987593 [interface] Table list pagination in navi, + thanks to Jason Day - jday29 + 2.11.7.0 (not yet released) - bug #1908719 [interface] New field cannot be auto-increment and primary key - [dbi] Incorrect interpretation for some mysqli field flags diff --git a/navigation.php b/navigation.php index e8f70fa9d3..80bff4cab6 100644 --- a/navigation.php +++ b/navigation.php @@ -76,10 +76,19 @@ function PMA_exitNavigationFrame() if (! isset($_SESSION['userconf']['navi_limit_offset'])) { $_SESSION['userconf']['navi_limit_offset'] = 0; } +if (! isset($_SESSION['userconf']['table_limit_offset'])) { + $_SESSION['userconf']['table_limit_offset'] = 0; +} if (isset($_REQUEST['pos'])) { - $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos']; + if (isset($_REQUEST['tpos'])) { + $_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos']; + } + else { + $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos']; + } } -$pos = $_SESSION['userconf']['navi_limit_offset']; +$pos = $_SESSION['userconf']['navi_limit_offset']; +$tpos = $_SESSION['userconf']['table_limit_offset']; // free the session file, for the other frames to be loaded session_write_close(); @@ -115,10 +124,19 @@ require_once './libraries/header_http.inc.php'; if (! isset($_SESSION['userconf']['navi_limit_offset'])) { $_SESSION['userconf']['navi_limit_offset'] = 0; } +if (! isset($_SESSION['userconf']['table_limit_offset'])) { + $_SESSION['userconf']['table_limit_offset'] = 0; +} if (isset($_REQUEST['pos'])) { - $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos']; + if (isset($_REQUEST['tpos'])) { + $_SESSION['userconf']['table_limit_offset'] = (int) $_REQUEST['pos']; + } + else { + $_SESSION['userconf']['navi_limit_offset'] = (int) $_REQUEST['pos']; + } } -$pos = $_SESSION['userconf']['navi_limit_offset']; +$pos = $_SESSION['userconf']['navi_limit_offset']; +$tpos = $_SESSION['userconf']['table_limit_offset']; /* * Displays the frame @@ -305,18 +323,23 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) { * This helps reducing the navi panel size; in the right panel, * user can find a navigator to page thru all tables. * - * @todo instead of the 0 parameter, keep track of the - * offset in the list of tables ($_SESSION['userconf']['table_limit_offset']) - * and use PMA_listNavigator(); do not just check pos in REQUEST - * but add another hidden param to see if it's the pos of databases - * or the pos of tables. */ - $table_list = PMA_getTableList($GLOBALS['db'], null, 0, $cfg['MaxTableList']); + $table_list = PMA_getTableList($GLOBALS['db'], null, $tpos, $cfg['MaxTableList']); if (! empty($table_list)) { + $table_count = PMA_getTableCount($GLOBALS['db']); + if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) { + $_url_params = array( + 'tpos' => 'true', + 'pos' => $tpos, + 'db' => $GLOBALS['db'] + ); + PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']); + } PMA_displayTableList($table_list, true, '', $GLOBALS['db']); - // hint user that the table list is larger, until the todo is done - if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && PMA_getTableCount($GLOBALS['db']) > $GLOBALS['cfg']['MaxTableList']) { - echo '  ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', PMA_getTableCount($GLOBALS['db']), ' )'; + // hint user that the table list is larger + if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) { + echo '  ( ', $tpos, ' .. ', ($tpos+$GLOBALS['cfg']['MaxTableList']), ' / ', $table_count, ' )'; + PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']); } } else { echo $GLOBALS['strNoTablesFound']; -- 2.11.4.GIT