diff --git a/ChangeLog b/ChangeLog index 8e202c175..736a8685d 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-10-13 Sebastian Mendel + * left.php: preselect db if only one db + 2005-10-12 Sebastian Mendel * css/phpmyadmin.css.php, libraries/common.lib.php, themes/darkblue_orange/css/theme_right.css.php, diff --git a/left.php b/left.php index 143f249af..020871fcf 100644 --- a/left.php +++ b/left.php @@ -14,15 +14,6 @@ require_once('./libraries/grab_globals.lib.php'); // free the session file, for the other frames to be loaded session_write_close(); -if (!empty($db)) { - $db_start = $db; -} else { - $db_start = ''; -} - -$db = isset( $db ) ? $db : ''; -$table = isset( $table ) ? $table : ''; - /** * Gets a core script and starts output buffering work */ @@ -48,10 +39,19 @@ if ($server > 0) { // this function is defined in "common.lib.php" // it defines $num_dbs and $dblist PMA_availableDatabases(); + + if ( empty( $db ) && count( $dblist ) === 1 ) { + reset( $dblist ); + $db = current( $dblist ); + } } else { $num_dbs = 0; } +$db = isset( $db ) ? $db : ''; +$table = isset( $table ) ? $table : ''; +$db_start = $db; + // garvin: For re-usability, moved http-headers // to a seperate file. It can now be included by header.inc.php,