From 8a53f1cc55e778f13f5529f7589ed94edc3fcac1 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Mon, 3 May 2004 08:29:32 +0000 Subject: [PATCH] added table nesting for aliased tables --- ChangeLog | 2 ++ left.php | 29 ++++++++++++++++++----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f07e3012..4ab0abdfb 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ $Id$ $Source$ 2004-05-03 Garvin Hicking + * left.php: Bug #946501 - Nested table now also work with aliased + tablenames. * config.inc.php, libraries/config_import.lib.php, querywindow.php, footer.inc.php, Documentation.html: Removed obsolete QueryFrameDebug configuration directive diff --git a/left.php b/left.php index 13385ca08..e4592f247 100644 --- a/left.php +++ b/left.php @@ -538,6 +538,9 @@ if ($num_dbs > 1) { $url_title = (!empty($tooltip) && isset($tooltip[$table])) ? htmlspecialchars($tooltip[$table]) : ''; + $tablename = ($alias != '' && $cfg['ShowTooltipAliasTB'] + ? $alias + : htmlspecialchars($table)); $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label'); @@ -545,11 +548,11 @@ if ($num_dbs > 1) { $list_item .= '' . $strBrowse . ': ' . $url_title . ''; $list_item .= ' ' . "\n"; $list_item .= ''; - $list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '
' . "\n"; + $list_item .= $tablename . '
' . "\n"; // garvin: Check whether to display nested sets if (!empty($cfg['LeftFrameTableSeparator'])) { - $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'',$table)); + $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename)); if (is_array($_table)) { foreach($_table AS $key => $val) { if ($val == '') { @@ -560,15 +563,15 @@ if ($num_dbs > 1) { unset($_table[count($_table)-1]); $_table = PMA_reduceNest($_table); - $eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $table) . '\';'; + $eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $tablename) . '\';'; $eval_string .= '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_list_item\'][] = \'' . str_replace('\'', '\\\'', $list_item) . '\';'; eval($eval_string); } else { - $tablestack['']['pma_name'][] = $table; + $tablestack['']['pma_name'][] = $tablename; $tablestack['']['pma_list_item'][] = $list_item; } } else { - $tablestack['']['pma_name'][] = $table; + $tablestack['']['pma_name'][] = $tablename; $tablestack['']['pma_list_item'][] = $list_item; } } // end while (tables list) @@ -774,6 +777,10 @@ else if ($num_dbs == 1) { $url_title = (!empty($tooltip) && isset($tooltip[$table])) ? htmlentities($tooltip[$table]) : ''; + $tablename = ($alias != '' && $cfg['ShowTooltipAliasTB'] + ? $alias + : htmlspecialchars($table)); + $book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label'); if ($cfg['LeftFrameLight']) { @@ -782,18 +789,18 @@ else if ($num_dbs == 1) { <?php echo $strBrowse . ': ' . $url_title; ?>  -
+
'; $list_item .= '' . $strBrowse . ': ' . $url_title . ''; $list_item .= ' ' . "\n"; $list_item .= ''; - $list_item .= ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '
'; + $list_item .= $tablename . '
'; // garvin: Check whether to display nested sets if (!empty($cfg['LeftFrameTableSeparator'])) { - $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'',$table)); + $_table = explode($cfg['LeftFrameTableSeparator'], str_replace('\'', '\\\'', $tablename)); if (is_array($_table)) { foreach($_table AS $key => $val) { if ($val == '') { @@ -804,15 +811,15 @@ else if ($num_dbs == 1) { unset($_table[count($_table)-1]); $_table = PMA_reduceNest($_table); - $eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $table) . '\';'; + $eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $tablename) . '\';'; $eval_string .= '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_list_item\'][] = \'' . str_replace('\'', '\\\'', $list_item) . '\';'; eval($eval_string); } else { - $tablestack['']['pma_name'][] = $table; + $tablestack['']['pma_name'][] = $tablename; $tablestack['']['pma_list_item'][] = $list_item; } } else { - $tablestack['']['pma_name'][] = $table; + $tablestack['']['pma_name'][] = $tablename; $tablestack['']['pma_list_item'][] = $list_item; } }