PMA_getTableList(): added second parameter to pass tables (if already fetched from db)

This commit is contained in:
Sebastian Mendel
2006-01-14 18:00:59 +00:00
parent e62ce1a6e2
commit 062b408d0e
2 changed files with 11 additions and 7 deletions

View File

@@ -9,6 +9,8 @@ $Source$
* libraries/sql_query_form.lib.php: undefined js variable * libraries/sql_query_form.lib.php: undefined js variable
* libraries/database_interface.lib.php: PMA_DBI_get_tables_full() first parameter * libraries/database_interface.lib.php: PMA_DBI_get_tables_full() first parameter
now also accepts an array of database names not only a single name now also accepts an array of database names not only a single name
* libraries/common.lib.php: PMA_getTableList():
added second parameter to pass tables (if already fetched from db)
2006-01-12 Marc Delisle <lem9@users.sourceforge.net> 2006-01-12 Marc Delisle <lem9@users.sourceforge.net>
* Documentation.html: typo, thanks to Cédric Corazza * Documentation.html: typo, thanks to Cédric Corazza

View File

@@ -1034,25 +1034,27 @@ if (!defined('PMA_MINIMUM_COMMON')) {
* @param string $db name of db * @param string $db name of db
* return array (rekursive) grouped table list * return array (rekursive) grouped table list
*/ */
function PMA_getTableList($db) function PMA_getTableList($db, $tables = null)
{ {
$sep = $GLOBALS['cfg']['LeftFrameTableSeparator']; $sep = $GLOBALS['cfg']['LeftFrameTableSeparator'];
$tables = PMA_DBI_get_tables_full($db); if ( null === $tables ) {
$tables = PMA_DBI_get_tables_full($db);
if ($GLOBALS['cfg']['NaturalOrder']) {
uksort($tables, 'strnatcasecmp');
}
}
if (count($tables) < 1) { if (count($tables) < 1) {
return $tables; return $tables;
} }
if ($GLOBALS['cfg']['NaturalOrder']) {
uksort($tables, 'strnatcasecmp');
}
$default = array( $default = array(
'Name' => '', 'Name' => '',
'Rows' => 0, 'Rows' => 0,
'Comment' => '', 'Comment' => '',
'disp_name' => '', 'disp_name' => '',
); );
$table_groups = array(); $table_groups = array();