Show server selection if no server set and we have one server configuration (bug #1399880).
This commit is contained in:
@@ -7,6 +7,9 @@ $Source$
|
||||
|
||||
2006-01-11 Michal Čihař <michal@cihar.com>
|
||||
* main.php: Do not fail if no server is defined.
|
||||
* main.php, libraries/left_header.inc.php,
|
||||
libraries/select_server.lib.php: Show server selection if no server set
|
||||
and we have one server configuration (bug #1399880).
|
||||
|
||||
2006-01-10 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* libraries/sqlparser.lib.php: bug #1394479, problem detecting ending
|
||||
|
@@ -83,7 +83,7 @@ echo '</div>' . "\n";
|
||||
/**
|
||||
* Displays the MySQL servers choice form
|
||||
*/
|
||||
if ( $GLOBALS['cfg']['LeftDisplayServers'] && count($cfg['Servers']) > 1 ) {
|
||||
if ($GLOBALS['cfg']['LeftDisplayServers'] && (count($GLOBALS['cfg']['Servers']) > 1 || $server == 0 && count($GLOBALS['cfg']['Servers']) == 1)) {
|
||||
include('./libraries/select_server.lib.php');
|
||||
PMA_select_server(TRUE, TRUE);
|
||||
} // end if LeftDisplayServers
|
||||
|
@@ -72,9 +72,18 @@ function PMA_select_server($form, $left) {
|
||||
</select>
|
||||
<input type="hidden" name="lang" value="<?php echo $lang; ?>" />
|
||||
<input type="hidden" name="convcharset" value="<?php echo $convcharset; ?>" />
|
||||
<noscript>
|
||||
<?php
|
||||
// Show submit button if we have just one server (this happens with no default)
|
||||
if (count($cfg['Servers']) > 1) {
|
||||
echo '<noscript>';
|
||||
}
|
||||
?>
|
||||
<input type="submit" value="<?php echo $GLOBALS['strGo']; ?>" />
|
||||
</noscript>
|
||||
<?php
|
||||
if (count($cfg['Servers']) > 1) {
|
||||
echo '</noscript>';
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
|
22
main.php
22
main.php
@@ -47,11 +47,12 @@ if ( $server > 0 ) {
|
||||
if ($cfg['Server']['auth_type'] == 'config') {
|
||||
$cfg['ShowChgPassword'] = FALSE;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
<div id="mysqlmaininformation">
|
||||
<?php
|
||||
if ( $server > 0 ) {
|
||||
// robbat2: Use the verbose name of the server instead of the hostname
|
||||
// if a value is set
|
||||
$server_info = '';
|
||||
@@ -73,15 +74,20 @@ if ( $server > 0 ) {
|
||||
|
||||
echo '<h1 xml:lang="en" dir="ltr">MySQL - ' . PMA_MYSQL_STR_VERSION
|
||||
.'</h1>' . "\n";
|
||||
} else {
|
||||
// Case when no server selected
|
||||
echo '<h1 xml:lang="en" dir="ltr">MySQL</h1>' . "\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays the MySQL servers choice form
|
||||
*/
|
||||
if (!$cfg['LeftDisplayServers'] && count($cfg['Servers']) > 1) {
|
||||
include('./libraries/select_server.lib.php');
|
||||
PMA_select_server(TRUE, FALSE);
|
||||
}
|
||||
/**
|
||||
* Displays the MySQL servers choice form
|
||||
*/
|
||||
if (!$cfg['LeftDisplayServers'] && (count($cfg['Servers']) > 1 || $server == 0 && count($cfg['Servers']) == 1)) {
|
||||
include('./libraries/select_server.lib.php');
|
||||
PMA_select_server(TRUE, FALSE);
|
||||
}
|
||||
|
||||
if ( $server > 0 ) {
|
||||
echo '<ul>' . "\n";
|
||||
|
||||
PMA_printListItem( $strProtocolVersion . ': ' . PMA_DBI_get_proto_info()
|
||||
|
Reference in New Issue
Block a user