diff --git a/ChangeLog b/ChangeLog index 5e1f5f9d5..58155ef72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -67,6 +67,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA but just at the end of a row + [gui] Query window: use verbose server name if any + [auth] patch #1712514 specify host for single signon, thanks to Thierry ++ [gui] Navigator for the db list in the navigation panel ++ [gui] Navigator for the table list in the content panel 2.10.3.0 (not yet released) diff --git a/Documentation.html b/Documentation.html index e4f72846e..dd5283407 100644 --- a/Documentation.html +++ b/Documentation.html @@ -1091,6 +1091,10 @@ ALTER TABLE `pma_column_comments`
$cfg['MaxDbList'] integer
The maximum number of database names to be displayed in the navigation frame and the database list.
+ +
$cfg['MaxTableList'] integer
+
The maximum number of table names to be displayed in the + right panel's list.
$cfg['OBGzip'] string/boolean
Defines whether to use GZip output buffering for increased diff --git a/db_structure.php b/db_structure.php index 52b5e259b..7e22f9534 100644 --- a/db_structure.php +++ b/db_structure.php @@ -160,6 +160,13 @@ if (true == $cfg['PropertiesIconic']) { /** * Displays the tables list */ + +$_url_params = array( + 'pos' => $pos, + 'db' => $db); + +PMA_listNavigator($total_num_tables, $pos, $_url_params, 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList']); + ?>
' . "\n"; } @@ -2142,7 +2142,7 @@ function PMA_dbPageSelector($databases_count, $pos, $_url_params, $script, $fram echo '' . $caption1 . ''; - $_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxDbList']; + $_url_params['pos'] = $pos - $max_count; echo '' . $caption2 . ''; @@ -2152,12 +2152,12 @@ function PMA_dbPageSelector($databases_count, $pos, $_url_params, $script, $fram echo PMA_generate_common_hidden_inputs($_url_params); echo PMA_pageselector( $script . PMA_generate_common_url($_url_params) . '&', - $GLOBALS['cfg']['MaxDbList'], - floor(($pos + 1) / $GLOBALS['cfg']['MaxDbList']) + 1, - ceil($databases_count / $GLOBALS['cfg']['MaxDbList'])); + $max_count, + floor(($pos + 1) / $max_count) + 1, + ceil($count / $max_count)); echo ''; - if ($pos + $GLOBALS['cfg']['MaxDbList'] < $databases_count) { + if ($pos + $max_count < $count) { if ($GLOBALS['cfg']['NavigationBarIconic']) { $caption3 = ' > '; $caption4 = '>>'; @@ -2169,11 +2169,11 @@ function PMA_dbPageSelector($databases_count, $pos, $_url_params, $script, $fram $title3 = ''; $title4 = ''; } // end if... else... - $_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxDbList']; + $_url_params['pos'] = $pos + $max_count; echo '' . $caption3 . ''; - $_url_params['pos'] = floor($databases_count / $GLOBALS['cfg']['MaxDbList']) * $GLOBALS['cfg']['MaxDbList']; + $_url_params['pos'] = floor($count / $max_count) * $max_count; echo '' . $caption4 . ''; diff --git a/libraries/config.default.php b/libraries/config.default.php index 22cfc5b2c..2b4d533e7 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -342,6 +342,13 @@ $cfg['ServerDefault'] = 1; */ $cfg['MaxDbList'] = 100; +/** + * maximum number of tables displayed in table list + * + * @global integer $cfg['MaxTableList'] + */ +$cfg['MaxTableList'] = 100; + /** * use GZIP output buffering if possible (true|false|'auto') * diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index e93ba65ed..7b01bf9c8 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -215,8 +215,12 @@ function PMA_DBI_get_tables($database, $link = null) * @return array list of tables in given db(s) */ function PMA_DBI_get_tables_full($database, $table = false, - $tbl_is_group = false, $link = null) + $tbl_is_group = false, $link = null, $limit_offset = 0, $limit_count = false) { + // currently supported for MySQL >= 50002 + if (true === $limit_count) { + $limit_count = $GLOBALS['cfg']['MaxTableList']; + } // prepare and check parameters if (! is_array($database)) { $databases = array($database); @@ -277,6 +281,9 @@ function PMA_DBI_get_tables_full($database, $table = false, WHERE ' . (PMA_IS_WINDOWS ? '' : 'BINARY') . ' `TABLE_SCHEMA` IN (\'' . implode("', '", $this_databases) . '\') ' . $sql_where_table; + if ($limit_count) { + $sql .= ' LIMIT ' . $limit_count . ' OFFSET ' . $limit_offset; + } $tables = PMA_DBI_fetch_result($sql, array('TABLE_SCHEMA', 'TABLE_NAME'), null, $link); unset($sql_where_table, $sql); diff --git a/libraries/db_info.inc.php b/libraries/db_info.inc.php index 4cd8cf6ab..47edbb68b 100644 --- a/libraries/db_info.inc.php +++ b/libraries/db_info.inc.php @@ -40,6 +40,17 @@ */ require_once './libraries/common.inc.php'; +/** + * limits for table list + */ +if (! isset($_SESSION['table_limit_offset'])) { + $_SESSION['table_limit_offset'] = 0; +} +if (isset($_REQUEST['pos'])) { + $_SESSION['table_limit_offset'] = (int) $_REQUEST['pos']; +} +$pos = $_SESSION['table_limit_offset']; + /** * fills given tooltip arrays * @@ -191,7 +202,11 @@ if (! isset($sot_ready)) { $tables = PMA_DBI_get_tables_full($db, $tbl_group, 'comment'); } else { // all tables in db - $tables = PMA_DBI_get_tables_full($db); + // - get the total number of tables + $tables = PMA_DBI_get_tables($db); + $total_num_tables = count($tables); + // - then fetch the details for a possible limited subset + $tables = PMA_DBI_get_tables_full($db, false, false, null, $pos, true); } if ($cfg['ShowTooltip']) { @@ -205,6 +220,9 @@ if (! isset($sot_ready)) { * @global int count of tables in db */ $num_tables = count($tables); +if (! isset($total_num_tables)) { + $total_num_tables = $num_tables; +} /** * cleanup diff --git a/navigation.php b/navigation.php index ccd431344..1d2043546 100644 --- a/navigation.php +++ b/navigation.php @@ -589,6 +589,6 @@ function PMA_displayTableList($tables, $visible = false, echo '' . "\n"; $_url_params = array('pos' => $pos); -PMA_dbPageSelector($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation'); +PMA_listNavigator($GLOBALS['PMA_List_Database']->count(), $pos, $_url_params, 'navigation.php', 'frame_navigation', $GLOBALS['cfg']['MaxDbList']); PMA_exitNavigationFrame(); ?> diff --git a/server_databases.php b/server_databases.php index f18fac8e2..b9b8898b0 100644 --- a/server_databases.php +++ b/server_databases.php @@ -148,7 +148,7 @@ if ($databases_count > 0) { 'sort_order' => $sort_order, ); - PMA_dbPageSelector($databases_count, $pos, $_url_params, 'server_databases.php', 'frame_content'); + PMA_listNavigator($databases_count, $pos, $_url_params, 'server_databases.php', 'frame_content', $GLOBALS['cfg']['MaxDbList']); $_url_params['pos'] = $pos;