Browse files

Display search fields in order

  • Loading branch information...
1 parent 9d944c8 commit 3a333e92fff99c99d72dbb8c2967a97a32d3a462 @vrana committed Aug 24, 2011
Showing with 7 additions and 9 deletions.
  1. +2 −0 adminer/lang/cs.inc.php
  2. +5 −9 editor/include/adminer.inc.php
View
2 adminer/lang/cs.inc.php
@@ -288,6 +288,8 @@
// hint for time format - use language equivalents for hour, minute and second shortcuts
'HH:MM:SS' => 'HH:MM:SS',
'now' => 'teď',
+ 'yes' => 'ano',
+ 'no' => 'ne',
// general SQLite error in create, drop or rename database
'File exists.' => 'Soubor existuje.',
View
14 editor/include/adminer.inc.php
@@ -163,7 +163,7 @@ function selectVal($val, $link, $field) {
}
}
if (like_bool($field) && $return != " ") { // bool
- $return = '<img src="' . ($val ? "../adminer/static/plus.gif" : "../adminer/static/cross.gif") . '" alt="' . h($val) . '">';
+ $return = ($val ? lang('yes') : lang('no'));
}
if ($link) {
$return = "<a href='$link'>$return</a>";
@@ -196,20 +196,16 @@ function selectSearchPrint($where, $columns, $indexes) {
}
$i = 0;
$fields = fields($_GET["select"]);
- foreach ($fields as $name => $field) {
- $desc = $columns[$name];
- if (ereg("enum", $field["type"]) && $desc != "") { //! set - uses 1 << $i and FIND_IN_SET()
+ foreach ($columns as $name => $desc) {
+ $field = $fields[$name];
+ if (ereg("enum", $field["type"])) { //! set - uses 1 << $i and FIND_IN_SET()
$key = $keys[$name];
$i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'>:";
echo enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"], ($field["null"] ? 0 : null));
echo "</div>\n";
unset($columns[$name]);
- }
- }
- foreach ($columns as $name => $desc) {
- $options = $this->_foreignKeyOptions($_GET["select"], $name);
- if (is_array($options)) {
+ } elseif (is_array($options = $this->_foreignKeyOptions($_GET["select"], $name))) {
if ($fields[$name]["null"]) {
$options[0] = '(' . lang('empty') . ')';
}

0 comments on commit 3a333e9

Please sign in to comment.