0) {
PMA_availableDatabases(); // this function is defined in "common.lib.php3"
} else {
$num_dbs = 0;
}
// garvin: For re-usability, moved http-headers
// to a seperate file. It can now be included by header.inc.php3,
// queryframe.php3, querywindow.php3.
include('./libraries/header_http.inc.php3');
/**
* Displays the frame
*/
// Gets the font sizes to use
PMA_setFontSizes();
?>
phpMyAdmin
target="phpmain" />
1 && !$cfg['LeftFrameLight']) {
echo "\n";
?>
1)
else if ($num_dbs == 1) {
echo "\n";
?>
1) {
// Light mode -> beginning of the select combo for databases
if ($cfg['LeftFrameLight']) {
?>
' . "\n";
echo ' ' . "\n";
echo ' (' . $strDatabases . ') ... ' . "\n";
$table_list = '';
$table_list_header = '';
$db_name = '';
}
$selected_db = 0;
// Gets the tables list per database
for ($i = 0; $i < $num_dbs; $i++) {
$db = $dblist[$i];
$j = $i + 2;
if (!empty($db_start) && $db == $db_start) {
$selected_db = $j;
}
$tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0;
$common_url_query = PMA_generate_common_url($db);
if ($num_tables) {
$num_tables_disp = $num_tables;
} else {
$num_tables_disp = '-';
}
// Get additional information about tables for tooltip
if ($cfg['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303
&& $num_tables
&& (!$cfg['LeftFrameLight'] || $selected_db == $j)) {
$tooltip = array();
$tooltip_name = array();
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = PMA_mysql_fetch_array($result)) {
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] ? $tmp['Name'] : $tmp['Comment']);
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
} // end while
} // end if
// garvin: Get comments from PMA comments table
$db_tooltip = '';
if ($cfg['ShowTooltip'] && $cfgRelation['commwork']) {
$tmp_db_tooltip = PMA_getComments($db);
if (is_array($tmp_db_tooltip)) {
$db_tooltip = implode(' ', $tmp_db_tooltip);
}
}
// No light mode -> displays the expandible/collapsible db list
if ($cfg['LeftFrameLight'] == FALSE) {
// Displays the database name
$on_mouse = (($cfg['LeftPointerColor'] == '') ? '' : ' onmouseover="if (isDOM || isIE4) {hilightBase(\'el' . $j . '\', \'' . $cfg['LeftPointerColor'] . '\')}" onmouseout="if (isDOM || isIE4) {hilightBase(\'el' . $j . '\', \'' . $cfg['LeftBgColor'] . '\')}"');
echo "\n";
echo '
>
displays the select combo with databases names and the
// list of tables contained in the current database
else {
echo "\n";
// Builds the databases' names list
if (!empty($db_start) && $db == $db_start) {
// Gets the list of tables from the current database
for ($t = 0; $t < $num_tables; $t++) {
$table = PMA_mysql_tablename($tables, $t);
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
? str_replace('"', '"', $tooltip[$table])
: '';
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
? str_replace('"', '"', $tooltip_name[$table])
: '';
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
$table_list .= ' ' . "\n";
$table_list .= ' ' . "\n";
if (PMA_USR_BROWSER_AGENT == 'IE') {
$table_list .= ' ' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . ' ' . "\n";
} else {
$table_list .= ' ' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . ' ' . "\n";
}
} // end for $t (tables list)
if (!$table_list) {
$table_list = ' ' . "\n"
. ' ' . $strNoTablesFound . '
' . "\n";
}
$selected = ' selected="selected"';
$table_list_header .= ' ' . "\n";
$table_list_header .= ' ' . ($db_tooltip != '' && $cfg['ShowTooltipAliasTB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' ' . "\n\n";
} else {
$selected = '';
} // end if... else...
if (!empty($num_tables)) {
echo ' ' . ($db_tooltip != '' && $cfg['ShowTooltipAliasDB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' (' . $num_tables . ') ' . "\n";
} else {
echo ' ' . ($db_tooltip != '' && $cfg['ShowTooltipAliasDB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' (-) ' . "\n";
} // end if... else...
} // end if (light mode)
} // end for $i (db list)
// Light mode -> end of the select combo for databases and table list for
// the current database
if ($cfg['LeftFrameLight']) {
echo ' ' . "\n";
echo ' ' . "\n";
echo ' ' . "\n";
if (!$table_list) {
$table_list = ' ' . $strSelectADb . '
' . "\n";
}
// Displays the current database name and the list of tables it
// contains
echo "\n" . ' ' . "\n\n";
echo $table_list_header;
echo $table_list;
echo "\n" . ' ' . "\n";
}
// No light mode -> initialize some js variables for the
// expandible/collapsible stuff
else {
?>
1)
// Case where only one database has to be displayed
else if ($num_dbs == 1) {
$db = $dblist[0];
$tables = @PMA_mysql_list_tables($db);
$num_tables = ($tables) ? @mysql_numrows($tables) : 0;
$common_url_query = PMA_generate_common_url($db);
if ($num_tables) {
$num_tables_disp = $num_tables;
} else {
$num_tables_disp = '-';
}
// Get additional infomation about tables for tooltip
if ($cfg['ShowTooltip'] && PMA_MYSQL_INT_VERSION >= 32303
&& $num_tables) {
$tooltip = array();
$tooltip_name = array();
$result = PMA_mysql_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
while ($tmp = PMA_mysql_fetch_array($result)) {
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] ? $tmp['Name'] : $tmp['Comment']);
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
} // end while
} // end if
// garvin: Get comments from PMA comments table
$db_tooltip = '';
if ($cfg['ShowTooltip'] && $cfgRelation['commwork']) {
$tmp_db_tooltip = PMA_getComments($db);
if (is_array($tmp_db_tooltip)) {
$db_tooltip = implode(' ', $tmp_db_tooltip);
}
}
// Displays the database name
echo "\n";
?>
' . $strNoDatabases . '';
} // end if ($num_dbs == 0)
echo "\n";
?>