From ae603822a502d700628218b610bbaccc8f8fe757 Mon Sep 17 00:00:00 2001
From: Marc Delisle
Date: Mon, 9 Jul 2007 16:30:39 +0000
Subject: [PATCH] obey MaxTableList in navi also (Light mode only); move the
navigator near the database list
---
Documentation.html | 3 ++-
libraries/common.lib.php | 9 +++++----
navigation.php | 26 +++++++++++++++++++++-----
themes/original/css/theme_left.css.php | 3 +--
4 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/Documentation.html b/Documentation.html
index 423d7e894..57bc096b0 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -1094,7 +1094,8 @@ ALTER TABLE `pma_column_comments`
$cfg['MaxTableList'] integer
The maximum number of table names to be displayed in the
- right panel's list.
+ main panel's list. This limit is also enforced in the navigation panel
+ when in Light mode.
$cfg['MaxCharactersInDisplayedSQL'] integer
The maximum number of characters when a SQL query is displayed. The
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 070b86c88..6d8d463e5 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -717,7 +717,7 @@ function PMA_sendHeaderLocation($uri)
}
/**
- * returns array with tables of given db with extended infomation and grouped
+ * returns array with tables of given db with extended information and grouped
*
* @uses $cfg['LeftFrameTableSeparator']
* @uses $cfg['LeftFrameTableLevel']
@@ -730,14 +730,15 @@ function PMA_sendHeaderLocation($uri)
* @uses strstr()
* @uses explode()
* @param string $db name of db
- * return array (rekursive) grouped table list
+ * @param string $tables name of tables
+ * return array (recursive) grouped table list
*/
-function PMA_getTableList($db, $tables = null)
+function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count = false)
{
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
if (null === $tables) {
- $tables = PMA_DBI_get_tables_full($db);
+ $tables = PMA_DBI_get_tables_full($db, false, false, null, $limit_offset, $limit_count);
if ($GLOBALS['cfg']['NaturalOrder']) {
uksort($tables, 'strnatcasecmp');
}
diff --git a/navigation.php b/navigation.php
index 1d2043546..5cb7a4995 100644
--- a/navigation.php
+++ b/navigation.php
@@ -204,11 +204,14 @@ if (! $GLOBALS['server']) {
echo '' . "\n"
.' ' . "\n"
.' ' . "\n"
- .'' . "\n"
- .'' . "\n";
+ .'' . "\n";
} else {
+ echo '' . "\n";
echo $GLOBALS['PMA_List_Database']->getHtmlListGrouped(true, $_SESSION['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
}
+ $_url_params = array('pos' => $pos);
+ PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
+ echo '
' . "\n";
}
?>
@@ -269,7 +272,17 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
}
echo '
';
- $table_list = PMA_getTableList($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['navi_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']);
if (count($table_list) > 0) {
PMA_displayTableList($table_list, true, '', $GLOBALS['db']);
} else {
@@ -279,6 +292,11 @@ if ($GLOBALS['cfg']['LeftFrameLight'] && strlen($GLOBALS['db'])) {
} elseif ($GLOBALS['cfg']['LeftFrameLight']) {
echo '' . $GLOBALS['strSelectADb'] . '
' . "\n";
} else {
+ echo '' . "\n";
+ $_url_params = array('pos' => $pos);
+ PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
+ echo '
' . "\n";
+
$common_url_query = PMA_generate_common_url();
PMA_displayDbList($GLOBALS['PMA_List_Database']->getGroupedDetails($_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']), $_SESSION['navi_limit_offset'],$GLOBALS['cfg']['MaxDbList']);
}
@@ -588,7 +606,5 @@ function PMA_displayTableList($tables, $visible = false,
echo '' . "\n";
-$_url_params = array('pos' => $pos);
-PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']);
PMA_exitNavigationFrame();
?>
diff --git a/themes/original/css/theme_left.css.php b/themes/original/css/theme_left.css.php
index 91d525aaf..46c424242 100644
--- a/themes/original/css/theme_left.css.php
+++ b/themes/original/css/theme_left.css.php
@@ -72,7 +72,6 @@ div#pmalogo {
}
div#pmalogo,
div#leftframelinks,
-div#navidbpageselector,
div#databaseList {
text-align: center;
border-bottom: 0.05em solid ;
@@ -202,4 +201,4 @@ div#left_tableList ul ul {
border-: 0.1em solid ;
padding-bottom: 0.1em;
border-bottom: 0.1em solid ;
-}
\ No newline at end of file
+}