Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Respect order after search (Editor)

  • Loading branch information...
commit 0bf40f9c708905382960f083c3ef5d6bb68eb3ab 1 parent 5586c51
@vrana authored
Showing with 13 additions and 3 deletions.
  1. +1 −0  changes.txt
  2. +12 −3 editor/include/adminer.inc.php
View
1  changes.txt
@@ -14,6 +14,7 @@ Disable maxlength with functions in edit
Better placement of AJAX icon
Table header in CSV export (Editor)
Time format hint (Editor)
+Respect order after search (Editor)
Polish translation
Adminer 3.2.0 (released 2011-02-24):
View
15 editor/include/adminer.inc.php
@@ -250,9 +250,15 @@ function selectOrderPrint($order, $columns, $indexes) {
}
if ($orders) {
echo '<fieldset><legend>' . lang('Sort') . "</legend><div>";
- echo "<select name='index_order'>" . optionlist(array("" => "") + $orders, $_GET["index_order"], true) . "</select>";
+ echo "<select name='index_order'>" . optionlist(array("" => "") + $orders, ($_GET["order"][0] != "" ? "" : $_GET["index_order"]), true) . "</select>";
echo "</div></fieldset>\n";
}
+ if ($_GET["order"]) {
+ echo "<div style='display: none;'>" . hidden_fields(array(
+ "order" => array(1 => reset($_GET["order"])),
+ "desc" => ($_GET["desc"] ? array(1 => 1) : array()),
+ )) . "</div>\n";
+ }
}
function selectLimitPrint($limit) {
@@ -322,10 +328,13 @@ function selectSearchProcess($fields, $indexes) {
}
function selectOrderProcess($fields, $indexes) {
+ $index_order = $_GET["index_order"];
+ if ($index_order != "") {
+ unset($_GET["order"][1]);
+ }
if ($_GET["order"]) {
- return array(idf_escape($_GET["order"][0]) . (isset($_GET["desc"][0]) ? " DESC" : ""));
+ return array(idf_escape(reset($_GET["order"])) . ($_GET["desc"] ? " DESC" : ""));
}
- $index_order = $_GET["index_order"];
foreach (($index_order != "" ? array($indexes[$index_order]) : $indexes) as $index) {
if ($index_order != "" || $index["type"] == "INDEX") {
$desc = false;
Please sign in to comment.
Something went wrong with that request. Please try again.