Default order only by common indexes in Editor
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@932 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
988456b2a6
commit
fd6004fd3f
|
@ -227,29 +227,24 @@ ORDER BY ORDINAL_POSITION"); //! requires MySQL 5
|
|||
if ($_GET["order"]) {
|
||||
return array(idf_escape($_GET["order"][0]) . (isset($_GET["desc"][0]) ? " DESC" : ""));
|
||||
}
|
||||
$index = $indexes[$_GET["index_order"]];
|
||||
if (!strlen($_GET["index_order"])) {
|
||||
foreach ($indexes as $index) {
|
||||
if ($index["type"] == "INDEX") {
|
||||
break;
|
||||
$index_order = $_GET["index_order"];
|
||||
foreach ((strlen($index_order) ? array($indexes[$index_order]) : $indexes) as $index) {
|
||||
if (strlen($index_order) || $index["type"] == "INDEX") {
|
||||
$desc = false;
|
||||
foreach ($index["columns"] as $val) {
|
||||
if (ereg('date|timestamp', $fields[$val]["type"])) {
|
||||
$desc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$return = array();
|
||||
foreach ($index["columns"] as $val) {
|
||||
$return[] = idf_escape($val) . ($desc ? " DESC" : "");
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
if (!$index) {
|
||||
return array();
|
||||
}
|
||||
$desc = false;
|
||||
foreach ($index["columns"] as $val) {
|
||||
if (ereg('date|timestamp', $fields[$val]["type"])) {
|
||||
$desc = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$return = array();
|
||||
foreach ($index["columns"] as $val) {
|
||||
$return[] = idf_escape($val) . ($desc ? " DESC" : "");
|
||||
}
|
||||
return $return;
|
||||
return array();
|
||||
}
|
||||
|
||||
function selectLimitProcess() {
|
||||
|
|
Loading…
Reference in a new issue