patch #1987593 [interface] Table list pagination in navi

This commit is contained in:
Marc Delisle
2008-06-12 17:23:24 +00:00
parent 5904aecd05
commit de460bb5f7
2 changed files with 35 additions and 10 deletions

View File

@@ -61,6 +61,10 @@ danbarry
see http://store.swekey.com/index.php?promo=pma
(todo: Documentation.html, improve code formatting)
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

View File

@@ -63,11 +63,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'];
$tpos = $_SESSION['userconf']['table_limit_offset'];
// free the session file, for the other frames to be loaded
// but only if debugging is not enabled
if (empty($_SESSION['debug'])) {
@@ -105,10 +113,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'];
$tpos = $_SESSION['userconf']['table_limit_offset'];
/*
* Displays the frame
@@ -299,18 +316,22 @@ 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 = array_slice($table_list, 0, $cfg['MaxTableList']);
$table_list = array_slice($table_list, $tpos, $cfg['MaxTableList']);
if (! empty($table_list)) {
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
// hint user that the table list is larger
if (count($table_list) <= $GLOBALS['cfg']['MaxTableList'] && $table_count > $GLOBALS['cfg']['MaxTableList']) {
echo '&nbsp; ( 1 .. ', $GLOBALS['cfg']['MaxTableList'], ' / ', $table_count, ' )';
PMA_listNavigator($table_count, $tpos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxTableList']);
}
} else {
echo $GLOBALS['strNoTablesFound'];