NaturalOrder for Non-Light left frame.
New mode 'nested' for Tooltip-Aliases: Groups/folders are created using the Alias name, the tablenames are the non-aliased ones. RFE from the forums.
This commit is contained in:
@@ -5,6 +5,13 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2004-05-04 Garvin Hicking <pma@supergarv.de>
|
||||
* Documentation.html, config.inc.php, left.php: Use NaturalOrder
|
||||
for Non-Light left frame. Introduce new option 'nested' for
|
||||
$cfg['ShowTooltipAliasTB']. With this set Aliases are used for
|
||||
virtual nested grouping, but for the tablename itself the tablename
|
||||
will be show, not the Alias.
|
||||
|
||||
2004-05-03 Alexander M. Turek <me@derrabus.de>
|
||||
* lang/german-*.inc.php: Clarification.
|
||||
|
||||
|
@@ -1170,9 +1170,14 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
|
||||
<br /><br />
|
||||
</dd>
|
||||
|
||||
<dt><b>$cfg['ShowTooltipAliasTB'] </b>boolean</dt>
|
||||
<dt><b>$cfg['ShowTooltipAliasTB'] </b>boolean/string</dt>
|
||||
<dd>
|
||||
Same as $cfg['ShowTooltipAliasDB'], except this works for table names.
|
||||
|
||||
When setting this to 'nested', the Alias of the Tablename is only used
|
||||
to split/nest the tables according to the $cfg['LeftFrameTableSeparator']
|
||||
directive. So only the folder is called like the Alias, the tablename itself
|
||||
stays the real tablename.
|
||||
<br /><br />
|
||||
</dd>
|
||||
<dt><b>$cfg['LeftDisplayLogo'] </b>boolean</dt>
|
||||
|
@@ -212,16 +212,17 @@ $cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the a
|
||||
$cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth
|
||||
|
||||
// Left frame setup
|
||||
$cfg['LeftFrameLight'] = TRUE; // use a select-based menu and display only the
|
||||
// current tables in the left frame.
|
||||
$cfg['LeftFrameTableSeparator']= '__'; // Which string will be used to generate table prefixes
|
||||
// to split tables into multiple categories
|
||||
$cfg['LeftFrameTableLevel'] = '1'; // How many sublevels should be displayed when splitting
|
||||
// up tables by the above Separator
|
||||
$cfg['ShowTooltip'] = TRUE; // display table comment as tooltip in left frame
|
||||
$cfg['ShowTooltipAliasDB'] = FALSE; // if ShowToolTip is enabled, this defines that table/db comments
|
||||
$cfg['ShowTooltipAliasTB'] = FALSE; // are shown (in the left menu and db_details_structure) instead of
|
||||
// table/db names
|
||||
$cfg['LeftFrameLight'] = TRUE; // use a select-based menu and display only the
|
||||
// current tables in the left frame.
|
||||
$cfg['LeftFrameTableSeparator']= '__'; // Which string will be used to generate table prefixes
|
||||
// to split/nest tables into multiple categories
|
||||
$cfg['LeftFrameTableLevel'] = '1'; // How many sublevels should be displayed when splitting
|
||||
// up tables by the above Separator
|
||||
$cfg['ShowTooltip'] = TRUE; // display table comment as tooltip in left frame
|
||||
$cfg['ShowTooltipAliasDB'] = FALSE; // if ShowToolTip is enabled, this defines that table/db comments
|
||||
$cfg['ShowTooltipAliasTB'] = FALSE; // are shown (in the left menu and db_details_structure) instead of
|
||||
// table/db names. Setting ShowTooltipAliasTB to 'nested' will only
|
||||
// use the Aliases for nested descriptors, not the table itself.
|
||||
|
||||
$cfg['LeftDisplayLogo'] = TRUE; // display logo at top of left frame
|
||||
$cfg['LeftDisplayServers'] = FALSE; // display server choice at top of left frame
|
||||
|
61
left.php
61
left.php
@@ -484,7 +484,7 @@ if ($num_dbs > 1) {
|
||||
$result = PMA_DBI_try_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db));
|
||||
while ($tmp = PMA_DBI_fetch_assoc($result)) {
|
||||
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
|
||||
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] ? $tmp['Name'] : $tmp['Comment']);
|
||||
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] && $cfg['ShowTooltipAliasTB'] !== 'nested' ? $tmp['Name'] : $tmp['Comment']);
|
||||
|
||||
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
|
||||
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
|
||||
@@ -530,14 +530,29 @@ if ($num_dbs > 1) {
|
||||
<div id="el<?php echo $j;?>Child" class="child nowrap" style="margin-bottom: 5px"<?php echo $on_mouse; ?>>
|
||||
<?php
|
||||
// Displays the list of tables from the current database
|
||||
$tablestack = array();
|
||||
$tablestack = array();
|
||||
$table_array = array();
|
||||
while (list($table) = PMA_DBI_fetch_row($tables)) {
|
||||
$table_item = (!empty($tooltip_name) && isset($tooltip_name[$table]) && !empty($tooltip_name[$table]) && $cfg['ShowTooltipAliasTB'] && strtolower($cfg['ShowTooltipAliasTB']) !== 'nested'
|
||||
? htmlspecialchars($tooltip_name[$table])
|
||||
: htmlspecialchars($table));
|
||||
$table_array[$table] = $table_item;
|
||||
}
|
||||
|
||||
if ($cfg['NaturalOrder']) {
|
||||
natcasesort($table_array);
|
||||
}
|
||||
|
||||
foreach($table_array as $table => $table_sortkey) {
|
||||
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
|
||||
? htmlspecialchars($tooltip_name[$table])
|
||||
: '';
|
||||
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
|
||||
? htmlspecialchars($tooltip[$table])
|
||||
: '';
|
||||
$table_item = ($alias != '' && $cfg['ShowTooltipAliasTB'] && strtolower($cfg['ShowTooltipAliasTB']) !== 'nested'
|
||||
? $alias
|
||||
: htmlspecialchars($table));
|
||||
$tablename = ($alias != '' && $cfg['ShowTooltipAliasTB']
|
||||
? $alias
|
||||
: htmlspecialchars($table));
|
||||
@@ -548,7 +563,7 @@ if ($num_dbs > 1) {
|
||||
$list_item .= '<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
|
||||
$list_item .= '<bdo dir="' . $text_dir . '"> </bdo>' . "\n";
|
||||
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">';
|
||||
$list_item .= $tablename . '</a><br />' . "\n";
|
||||
$list_item .= $table_item . '</a><br />' . "\n";
|
||||
|
||||
// garvin: Check whether to display nested sets
|
||||
if (!empty($cfg['LeftFrameTableSeparator'])) {
|
||||
@@ -563,19 +578,18 @@ if ($num_dbs > 1) {
|
||||
unset($_table[count($_table)-1]);
|
||||
$_table = PMA_reduceNest($_table);
|
||||
|
||||
$eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $tablename) . '\';';
|
||||
$eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $table_item) . '\';';
|
||||
$eval_string .= '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_list_item\'][] = \'' . str_replace('\'', '\\\'', $list_item) . '\';';
|
||||
eval($eval_string);
|
||||
} else {
|
||||
$tablestack['']['pma_name'][] = $tablename;
|
||||
$tablestack['']['pma_name'][] = $table_item;
|
||||
$tablestack['']['pma_list_item'][] = $list_item;
|
||||
}
|
||||
} else {
|
||||
$tablestack['']['pma_name'][] = $tablename;
|
||||
$tablestack['']['pma_name'][] = $table_item;
|
||||
$tablestack['']['pma_list_item'][] = $list_item;
|
||||
}
|
||||
} // end while (tables list)
|
||||
|
||||
PMA_nestedSet($j, $tablestack);
|
||||
?>
|
||||
</div>
|
||||
@@ -712,8 +726,8 @@ else if ($num_dbs == 1) {
|
||||
$tooltip_name = array();
|
||||
$result = PMA_DBI_try_query('SHOW TABLE STATUS FROM ' . PMA_backquote($db), NULL, PMA_DBI_QUERY_STORE);
|
||||
while ($tmp = PMA_DBI_fetch_assoc($result)) {
|
||||
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
|
||||
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] ? $tmp['Name'] : $tmp['Comment']);
|
||||
$tooltip_name[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '');
|
||||
$tmp['Comment'] = ($cfg['ShowTooltipAliasTB'] && $cfg['ShowTooltipAliasTB'] !== 'nested' ? $tmp['Name'] : $tmp['Comment']);
|
||||
|
||||
$tooltip[$tmp['Name']] = (!empty($tmp['Comment']) ? $tmp['Comment'] . ' ' : '')
|
||||
. '(' . (isset($tmp['Rows']) ? $tmp['Rows'] : '0') . ' ' . $strRows . ')';
|
||||
@@ -770,13 +784,28 @@ else if ($num_dbs == 1) {
|
||||
|
||||
// Displays the list of tables from the current database
|
||||
$tablestack = array();
|
||||
$table_array = array();
|
||||
while (list($table) = PMA_DBI_fetch_row($tables)) {
|
||||
$table_item = (!empty($tooltip_name) && isset($tooltip_name[$table]) && !empty($tooltip_name[$table]) && $cfg['ShowTooltipAliasTB'] && strtolower($cfg['ShowTooltipAliasTB']) !== 'nested'
|
||||
? htmlspecialchars($tooltip_name[$table])
|
||||
: htmlspecialchars($table));
|
||||
$table_array[$table] = $table_item;
|
||||
}
|
||||
|
||||
if ($cfg['NaturalOrder']) {
|
||||
natcasesort($table_array);
|
||||
}
|
||||
|
||||
foreach($table_array as $table => $table_sortkey) {
|
||||
$alias = (!empty($tooltip_name) && isset($tooltip_name[$table]))
|
||||
? htmlentities($tooltip_name[$table])
|
||||
? htmlspecialchars($tooltip_name[$table])
|
||||
: '';
|
||||
$url_title = (!empty($tooltip) && isset($tooltip[$table]))
|
||||
? htmlentities($tooltip[$table])
|
||||
? htmlspecialchars($tooltip[$table])
|
||||
: '';
|
||||
$table_item = ($alias != '' && $cfg['ShowTooltipAliasTB'] && strtolower($cfg['ShowTooltipAliasTB']) !== 'nested'
|
||||
? $alias
|
||||
: htmlspecialchars($table));
|
||||
$tablename = ($alias != '' && $cfg['ShowTooltipAliasTB']
|
||||
? $alias
|
||||
: htmlspecialchars($table));
|
||||
@@ -789,14 +818,14 @@ else if ($num_dbs == 1) {
|
||||
<a target="phpmain<?php echo $hash; ?>" href="sql.php?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>&sql_query=<?php echo (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))); ?>&pos=0&goto=<?php echo $cfg['DefaultTabTable']; ?>" title="<?php echo $strBrowse . ': ' . $url_title; ?>">
|
||||
<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="<?php echo $strBrowse . ': ' . $url_title; ?>" /></a><bdo dir="<?php echo $text_dir; ?>"> </bdo>
|
||||
<a class="tblItem" id="tbl_<?php echo md5($table); ?>" title="<?php echo $url_title; ?>" target="phpmain<?php echo $hash; ?>" href="<?php echo $cfg['DefaultTabTable']; ?>?<?php echo $common_url_query; ?>&table=<?php echo urlencode($table); ?>">
|
||||
<?php echo $tablename; ?></a><br />
|
||||
<?php echo $table_item; ?></a><br />
|
||||
<?php
|
||||
} else {
|
||||
$list_item = '<a target="phpmain' . $hash . '" href="sql.php?' . $common_url_query . '&table=' . urlencode($table) . '&sql_query=' . (isset($book_sql_query) && $book_sql_query != FALSE ? urlencode($book_sql_query) : urlencode('SELECT * FROM ' . PMA_backquote($table))) . '&pos=0&goto=' . $cfg['DefaultTabTable'] . '" title="' . $strBrowse . ': ' . $url_title . '">';
|
||||
$list_item .= '<img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" /></a>';
|
||||
$list_item .= '<bdo dir="' . $text_dir . '"> </bdo>' . "\n";
|
||||
$list_item .= '<a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">';
|
||||
$list_item .= $tablename . '</a><br />';
|
||||
$list_item .= $table_item . '</a><br />';
|
||||
|
||||
// garvin: Check whether to display nested sets
|
||||
if (!empty($cfg['LeftFrameTableSeparator'])) {
|
||||
@@ -811,15 +840,15 @@ else if ($num_dbs == 1) {
|
||||
unset($_table[count($_table)-1]);
|
||||
$_table = PMA_reduceNest($_table);
|
||||
|
||||
$eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $tablename) . '\';';
|
||||
$eval_string = '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_name\'][] = \'' . str_replace('\'', '\\\'', $table_item) . '\';';
|
||||
$eval_string .= '$tablestack[\'' . implode('\'][\'', $_table) . '\'][\'pma_list_item\'][] = \'' . str_replace('\'', '\\\'', $list_item) . '\';';
|
||||
eval($eval_string);
|
||||
} else {
|
||||
$tablestack['']['pma_name'][] = $tablename;
|
||||
$tablestack['']['pma_name'][] = $table_item;
|
||||
$tablestack['']['pma_list_item'][] = $list_item;
|
||||
}
|
||||
} else {
|
||||
$tablestack['']['pma_name'][] = $tablename;
|
||||
$tablestack['']['pma_name'][] = $table_item;
|
||||
$tablestack['']['pma_list_item'][] = $list_item;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user