Natural order
This commit is contained in:
@@ -509,6 +509,8 @@ $cfg['MaxExactCount'] = 20000; // When approximate count < this, PM
|
||||
$cfg['WYSIWYG-PDF'] = TRUE; // Utilize DHTML/JS capabilities to allow WYSIWYG editing of
|
||||
// the PDF page editor. Requires an IE6/Mozilla based browser.
|
||||
|
||||
$cfg['NaturalOrder'] = TRUE; // Sort table and database in natural order
|
||||
|
||||
/**
|
||||
* Default queries.
|
||||
* %d will be replaced by database name
|
||||
|
33
left.php
33
left.php
@@ -399,6 +399,17 @@ if ($num_dbs > 1) {
|
||||
|
||||
$selected_db = 0;
|
||||
|
||||
// natural order for db list
|
||||
if ($cfg['NaturalOrder'] && $num_dbs > 0) {
|
||||
$dblist_temp = $dblist;
|
||||
natsort($dblist_temp);
|
||||
$i = 0;
|
||||
foreach ($dblist_temp as $each) {
|
||||
$dblist[$i] = $each;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the tables list per database
|
||||
for ($i = 0; $i < $num_dbs; $i++) {
|
||||
$db = $dblist[$i];
|
||||
@@ -539,15 +550,29 @@ if ($num_dbs > 1) {
|
||||
|
||||
$book_sql_query = PMA_queryBookmarks($db, $cfg['Bookmark'], '\'' . PMA_sqlAddslashes($table) . '\'', 'label');
|
||||
|
||||
$table_list .= ' <nobr><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'] . '">' . "\n";
|
||||
$table_list .= ' <img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" title="' . $strBrowse . ': ' . $url_title . '" /></a><bdo dir="' . $text_dir . '"> </bdo>' . "\n";
|
||||
// natural order or not, use an array for the table list
|
||||
|
||||
$table_array[$table] .= ' <nobr><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'] . '">' . "\n";
|
||||
|
||||
$table_array[$table] .= ' <img src="images/button_smallbrowse.png" width="10" height="10" border="0" alt="' . $strBrowse . ': ' . $url_title . '" title="' . $strBrowse . ': ' . $url_title . '" /></a><bdo dir="' . $text_dir . '"> </bdo>' . "\n";
|
||||
|
||||
if (PMA_USR_BROWSER_AGENT == 'IE') {
|
||||
$table_list .= ' <span class="tblItem"><a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></span></nobr><br />' . "\n";
|
||||
$table_array[$table] .= ' <span class="tblItem"><a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></span></nobr><br />' . "\n";
|
||||
} else {
|
||||
$table_list .= ' <a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
|
||||
$table_array[$table] .= ' <a class="tblItem" id="tbl_' . md5($table) . '" title="' . $url_title . '" target="phpmain' . $hash . '" href="' . $cfg['DefaultTabTable'] . '?' . $common_url_query . '&table=' . urlencode($table) . '">' . ($alias != '' && $cfg['ShowTooltipAliasTB'] ? $alias : htmlspecialchars($table)) . '</a></nobr><br />' . "\n";
|
||||
}
|
||||
|
||||
$table_title[$table] = htmlspecialchars($table);
|
||||
|
||||
} // end while (tables list)
|
||||
|
||||
if ($cfg['NaturalOrder'] && $num_tables > 0) {
|
||||
natsort($table_title);
|
||||
}
|
||||
foreach (array_keys($table_title) as $each){
|
||||
$table_list .= " $table_array[$each]";
|
||||
}
|
||||
|
||||
if (!$table_list) {
|
||||
$table_list = ' <br /><br />' . "\n"
|
||||
. ' <div>' . $strNoTablesFound . '</div>' . "\n";
|
||||
|
@@ -136,7 +136,7 @@ if (isset($cfg['FileRevision'])) {
|
||||
} else {
|
||||
$cfg['FileRevision'] = array(1, 1);
|
||||
}
|
||||
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 11)) {
|
||||
if ($cfg['FileRevision'][0] < 2 || ($cfg['FileRevision'][0] == 2 && $cfg['FileRevision'][1] < 12)) {
|
||||
require_once('./libraries/config_import.lib.php');
|
||||
}
|
||||
|
||||
|
@@ -799,6 +799,10 @@ if (!isset($cfg['WYSIWYG-PDF'])) {
|
||||
$cfg['WYSIWYG-PDF'] = TRUE;
|
||||
}
|
||||
|
||||
if (!isset($cfg['NaturalOrder'])) {
|
||||
$cfg['NaturalOrder'] = TRUE;
|
||||
}
|
||||
|
||||
if (!isset($cfg['DefaultQueryTable'])) {
|
||||
$cfg['DefaultQueryTable'] = 'SELECT * FROM %t WHERE 1';
|
||||
}
|
||||
|
Reference in New Issue
Block a user