diff --git a/ChangeLog b/ChangeLog index 4ebd99542..b93d87e20 100755 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ $Source$ - linked all references * libraries/common.lib.php: - fixed bug #1432626 'bad url error after select "(Databases)..."' + * libraries/select_server.lib.php: + fixed pre-select for current server (fixed type missmatch) 2006-02-16 Marc Delisle * lang/italian: update, thanks to Luca Rebellato diff --git a/libraries/select_server.lib.php b/libraries/select_server.lib.php index c389ac293..d0a881676 100644 --- a/libraries/select_server.lib.php +++ b/libraries/select_server.lib.php @@ -6,7 +6,7 @@ /** * display server selection in list or selectbox form, or option tags only - * + * * @todo make serverlist a real html-list * @globals $lang * @globals $convcharset @@ -22,7 +22,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset) { global $lang, $convcharset; - + // Show as list? if ($not_only_options) { $list = $GLOBALS['cfg']['DisplayServersList']; @@ -30,7 +30,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset) } else { $list = false; } - + if ($not_only_options) { echo '
'; @@ -38,8 +38,9 @@ function PMA_select_server($not_only_options, $ommit_fieldset) echo '
'; } echo ' '; - - echo ''; // TODO FIXME replace with $GLOBALS['strServers'] echo '' . "\n"; } elseif ($list) { @@ -47,18 +48,18 @@ function PMA_select_server($not_only_options, $ommit_fieldset) // TODO FIXME display server list as 'list' // echo '
    '; } - + foreach ($GLOBALS['cfg']['Servers'] as $key => $server) { if (empty($server['host'])) { continue; } - - if (!empty($GLOBALS['server']) && $GLOBALS['server'] === $key) { + + if (!empty($GLOBALS['server']) && (int) $GLOBALS['server'] === (int) $key) { $selected = 1; } else { - $selected = 0; + $selected = 0; } - + if (!empty($server['verbose'])) { $label = $server['verbose']; } else { @@ -71,7 +72,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset) // value, displaying such informations may not be a so good // idea if (!empty($server['only_db'])) { - // TODO FIXME this can become a really big selectbox ... + // TODO FIXME this can become a really big/long/wide selectbox ... $label .= ' - ' . (is_array($server['only_db']) ? implode(', ', $server['only_db']) : $server['only_db']); } if (!empty($server['user']) && $server['auth_type'] == 'config') { @@ -104,13 +105,13 @@ function PMA_select_server($not_only_options, $ommit_fieldset) '; - echo ''; - echo ''; - echo ''; + echo ''; + echo ''; } elseif ($list) { // TODO FIXME display server list as 'list' // echo '
'; } } -?> +?>