preselect db if only one db

This commit is contained in:
Sebastian Mendel
2005-10-13 06:59:32 +00:00
parent 0be9c380d1
commit bce60be31c
2 changed files with 12 additions and 9 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2005-10-13 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* left.php: preselect db if only one db
2005-10-12 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* css/phpmyadmin.css.php, libraries/common.lib.php,
themes/darkblue_orange/css/theme_right.css.php,

View File

@@ -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,