- fixed pre-select for current server (fixed type missmatch)

- do not auto submit on '(Server) ...'
This commit is contained in:
Sebastian Mendel
2006-02-17 09:48:10 +00:00
parent 884834db27
commit c80232dd7d
2 changed files with 19 additions and 16 deletions

View File

@@ -12,6 +12,8 @@ $Source$
- linked all references - linked all references
* libraries/common.lib.php: * libraries/common.lib.php:
- fixed bug #1432626 'bad url error after select "(Databases)..."' - 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 <lem9@users.sourceforge.net> 2006-02-16 Marc Delisle <lem9@users.sourceforge.net>
* lang/italian: update, thanks to Luca Rebellato * lang/italian: update, thanks to Luca Rebellato

View File

@@ -39,7 +39,8 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
} }
echo '<label for="select_server">' . $GLOBALS['strServer'] . ':</label> '; echo '<label for="select_server">' . $GLOBALS['strServer'] . ':</label> ';
echo '<select name="server" id="select_server" onchange="this.form.submit();">'; echo '<select name="server" id="select_server"'
. ' onchange="if (this.value != \'\') this.form.submit();">';
// TODO FIXME replace with $GLOBALS['strServers'] // TODO FIXME replace with $GLOBALS['strServers']
echo '<option value="">(' . $GLOBALS['strServer'] . ') ...</option>' . "\n"; echo '<option value="">(' . $GLOBALS['strServer'] . ') ...</option>' . "\n";
} elseif ($list) { } elseif ($list) {
@@ -53,10 +54,10 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
continue; continue;
} }
if (!empty($GLOBALS['server']) && $GLOBALS['server'] === $key) { if (!empty($GLOBALS['server']) && (int) $GLOBALS['server'] === (int) $key) {
$selected = 1; $selected = 1;
} else { } else {
$selected = 0; $selected = 0;
} }
if (!empty($server['verbose'])) { if (!empty($server['verbose'])) {
@@ -71,7 +72,7 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
// value, displaying such informations may not be a so good // value, displaying such informations may not be a so good
// idea // idea
if (!empty($server['only_db'])) { 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']); $label .= ' - ' . (is_array($server['only_db']) ? implode(', ', $server['only_db']) : $server['only_db']);
} }
if (!empty($server['user']) && $server['auth_type'] == 'config') { if (!empty($server['user']) && $server['auth_type'] == 'config') {
@@ -104,10 +105,10 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" /> <input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
<?php <?php
// Show submit button if we have just one server (this happens with no default) // Show submit button if we have just one server (this happens with no default)
echo '<noscript>'; echo '<noscript>';
echo '<input type="submit" value="' . $GLOBALS['strGo'] . '" />'; echo '<input type="submit" value="' . $GLOBALS['strGo'] . '" />';
echo '</noscript>'; echo '</noscript>';
echo '</form>'; echo '</form>';
} elseif ($list) { } elseif ($list) {
// TODO FIXME display server list as 'list' // TODO FIXME display server list as 'list'
// echo '</ol>'; // echo '</ol>';