Skip to content

Commit

Permalink
Display search fields in order
Browse files Browse the repository at this point in the history
  • Loading branch information
vrana committed Aug 24, 2011
1 parent 9d944c8 commit 3a333e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 2 additions & 0 deletions adminer/lang/cs.inc.php
Expand Up @@ -288,6 +288,8 @@
// hint for time format - use language equivalents for hour, minute and second shortcuts // hint for time format - use language equivalents for hour, minute and second shortcuts
'HH:MM:SS' => 'HH:MM:SS', 'HH:MM:SS' => 'HH:MM:SS',
'now' => 'teď', 'now' => 'teď',
'yes' => 'ano',
'no' => 'ne',


// general SQLite error in create, drop or rename database // general SQLite error in create, drop or rename database
'File exists.' => 'Soubor existuje.', 'File exists.' => 'Soubor existuje.',
Expand Down
14 changes: 5 additions & 9 deletions editor/include/adminer.inc.php
Expand Up @@ -163,7 +163,7 @@ function selectVal($val, $link, $field) {
} }
} }
if (like_bool($field) && $return != " ") { // bool 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) { if ($link) {
$return = "<a href='$link'>$return</a>"; $return = "<a href='$link'>$return</a>";
Expand Down Expand Up @@ -196,20 +196,16 @@ function selectSearchPrint($where, $columns, $indexes) {
} }
$i = 0; $i = 0;
$fields = fields($_GET["select"]); $fields = fields($_GET["select"]);
foreach ($fields as $name => $field) { foreach ($columns as $name => $desc) {
$desc = $columns[$name]; $field = $fields[$name];
if (ereg("enum", $field["type"]) && $desc != "") { //! set - uses 1 << $i and FIND_IN_SET() if (ereg("enum", $field["type"])) { //! set - uses 1 << $i and FIND_IN_SET()
$key = $keys[$name]; $key = $keys[$name];
$i--; $i--;
echo "<div>" . h($desc) . "<input type='hidden' name='where[$i][col]' value='" . h($name) . "'>:"; 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 enum_input("checkbox", " name='where[$i][val][]'", $field, (array) $where[$key]["val"], ($field["null"] ? 0 : null));
echo "</div>\n"; echo "</div>\n";
unset($columns[$name]); unset($columns[$name]);
} } elseif (is_array($options = $this->_foreignKeyOptions($_GET["select"], $name))) {
}
foreach ($columns as $name => $desc) {
$options = $this->_foreignKeyOptions($_GET["select"], $name);
if (is_array($options)) {
if ($fields[$name]["null"]) { if ($fields[$name]["null"]) {
$options[0] = '(' . lang('empty') . ')'; $options[0] = '(' . lang('empty') . ')';
} }
Expand Down

0 comments on commit 3a333e9

Please sign in to comment.