From 489d54e4556f800225cce55a7b9d1c7571b6b7ce Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Tue, 27 Apr 2004 08:34:26 +0000 Subject: [PATCH] bug #942374 - undefined indizes in left frame. Fixed some code issues. --- ChangeLog | 3 +++ left.php | 68 ++++++++++++++++++++++++++----------------------------- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4994066d..278ea7d96 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ $Id$ $Source$ 2004-04-27 Garvin Hicking + * left.php: Fixed bug #942374 - Undefined indizes in left frame + for light mode. Improved performance. Fixed tab-formatted code and + adjusted to coding guidelines. * read_dump.php: Fixed bug #942390 - When entering a "USE database" query together with multiple other queries, the db was reset to the first one. diff --git a/left.php b/left.php index 7cabdc2c3..4b5a420ad 100644 --- a/left.php +++ b/left.php @@ -310,27 +310,27 @@ if ($cfg['LeftDisplayLogo']) { } echo "\n"; if ($cfg['LeftDisplayServers']) { - if ($cfg['LeftDisplayServersList']){ + if ($cfg['LeftDisplayServersList']){ ?> -
+
@@ -385,7 +378,7 @@ if ($cfg['LeftDisplayServers']) {
@@ -393,7 +386,7 @@ echo "\n";
- @@ -439,7 +432,7 @@ if ($num_dbs > 1) { $selected_db = 0; - // natural order for db list + // natural order for db list if ($cfg['NaturalOrder'] && $num_dbs > 0) { $dblist_temp = $dblist; natsort($dblist_temp); @@ -579,8 +572,11 @@ if ($num_dbs > 1) { // Builds the databases' names list if (!empty($db_start) && $db == $db_start) { + $table_title = array(); + $table_array = array(); // Gets the list of tables from the current database while (list($table) = PMA_DBI_fetch_row($tables)) { + $table_array[$table] = ''; $url_title = (!empty($tooltip) && isset($tooltip[$table])) ? htmlentities($tooltip[$table]) : ''; @@ -593,7 +589,6 @@ if ($num_dbs > 1) { // natural order or not, use an array for the table list $table_array[$table] .= ' ' . "\n"; - $table_array[$table] .= ' ' . $strBrowse . ': ' . $url_title . ' ' . "\n"; if (PMA_USR_BROWSER_AGENT == 'IE') { @@ -606,14 +601,15 @@ if ($num_dbs > 1) { } // end while (tables list) - if ($cfg['NaturalOrder'] && $num_tables > 0) { - natsort($table_title); - } - foreach (array_keys($table_title) as $each){ - $table_list .= " $table_array[$each]"; - } + if (count($table_title) > 0) { + if ($cfg['NaturalOrder'] && $num_tables > 0) { + natsort($table_title); + } - if (!$table_list) { + foreach($table_title as $each_key => $each_val) { + $table_list .= ' ' . $table_array[$each_key]; + } + } else { $table_list = '

' . "\n" . '
' . $strNoTablesFound . '
' . "\n"; }