fixes to the subtree grouping in databases select menu

This commit is contained in:
Marc Delisle
2005-08-06 13:41:07 +00:00
parent 80176be497
commit 9579ee8223
2 changed files with 24 additions and 12 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2005-08-06 Marc Delisle <lem9@users.sourceforge.net>
* queryframe.php: fixes for tree subgroups in databases selector:
escaping of special characters, display a db name inside its own
group, and proper closing of optgroup, thanks to Ryan Schmidt
2005-08-05 Marc Delisle <lem9@users.sourceforge.net>
* Documentation.html, readme.php, license.php:
bug #965548, displaying README and LICENSE, thanks to Ryan Schmidt

View File

@@ -361,25 +361,25 @@ if ($num_dbs > 1) {
} // end if... else...
if ($cfg['LeftFrameDBTree']) {
$parts = explode($cfg['LeftFrameDBSeparator'],$db,2);
if (count($parts) == 1) {
if (!empty($parent)) {
echo ' '
. '</optgroup>'."\n";
$parent = '';
}
if ($i == 0) {
$parts = explode($cfg['LeftFrameDBSeparator'],$db,2);
} else {
$parts = $next_parts;
}
if ($i == $num_dbs - 1) {
$next_parts = array();
} else {
$next_parts = explode($cfg['LeftFrameDBSeparator'],$dblist[$i+1],2);
}
if (count($parts) > 1 || (count($next_parts) > 1 && $parts[0] == $next_parts[0])) {
if ($parent != $parts[0]) {
if (!empty($parent)) {
echo ' '
. '</optgroup>'."\n";
}
echo ' '
. '<optgroup label="'.$parts[0].'">'."\n";
. '<optgroup label="'.htmlspecialchars($parts[0]).'">'."\n";
$parent = $parts[0];
}
}
}
if (!empty($num_tables)) {
echo ' '
. '<option value="' . htmlspecialchars($db) . '"' . $selected . '>'
@@ -390,6 +390,13 @@ if ($num_dbs > 1) {
. ($db_tooltip != '' && $cfg['ShowTooltipAliasDB'] ? htmlspecialchars($db_tooltip) : htmlspecialchars($db)) . ' (-)</option>' . "\n";
} // end if... else...
if ($cfg['LeftFrameDBTree']) {
if (!empty($parent) && (count($next_parts) == 0 || $parent != $next_parts[0])) {
echo ' '
. '</optgroup>'."\n";
$parent = '';
}
}
} // end for $i (db list)
?>
</select>