From 61fa06641f6c3b06030d0c1e7705b69b46dfacc3 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Wed, 11 Jul 2007 22:25:54 +0000 Subject: [PATCH] not_vals in optionlist() is always true git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@147 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- create.inc.php | 8 ++++---- database.inc.php | 2 +- design.inc.php | 2 +- functions.inc.php | 6 +++--- indexes.inc.php | 8 ++++---- select.inc.php | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/create.inc.php b/create.inc.php index 11d737f0..31ddda7f 100644 --- a/create.inc.php +++ b/create.inc.php @@ -86,8 +86,8 @@ $collations = collations();

: " /> - - + +

@@ -99,9 +99,9 @@ foreach ($row["fields"] as $i => $field) { ?> - + - + diff --git a/database.inc.php b/database.inc.php index 19790b62..ea7530bb 100644 --- a/database.inc.php +++ b/database.inc.php @@ -48,7 +48,7 @@ if ($_POST) {

- + diff --git a/design.inc.php b/design.inc.php index f6018c8a..f03ad8cf 100644 --- a/design.inc.php +++ b/design.inc.php @@ -49,7 +49,7 @@ function page_footer($missing = false) {

diff --git a/functions.inc.php b/functions.inc.php index 9bc80092..ed9e3b88 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -12,15 +12,15 @@ function bracket_escape($idf, $back = false) { return strtr($idf, ($back ? array_flip($trans) : $trans)); } -function optionlist($options, $selected = array(), $not_vals = false) { +function optionlist($options, $selected = array()) { $return = ""; foreach ($options as $k => $v) { if (is_array($v)) { $return .= ''; } foreach ((is_array($v) ? $v : array($k => $v)) as $key => $val) { - $checked = in_array(($not_vals ? $val : $key), (array) $selected, true); - $return .= '' . htmlspecialchars($val) . ''; + $checked = in_array($val, (array) $selected, true); + $return .= '' . htmlspecialchars($val) . ''; } if (is_array($v)) { $return .= ''; diff --git a/indexes.inc.php b/indexes.inc.php index be5591fb..5f604cd6 100644 --- a/indexes.inc.php +++ b/indexes.inc.php @@ -50,14 +50,14 @@ if ($_POST) { $j = 0; foreach ($row["indexes"] as $index) { if ($index["type"] || array_filter($index["columns"], 'strlen')) { - echo "\n"; $j++; @@ -65,7 +65,7 @@ foreach ($row["indexes"] as $index) { } //! JavaScript for adding more indexes and columns ?> - +
" />" maxlength="64" /> " size="3" /> checked="checked" /> checked="checked" /> " maxlength="255" />
"; + echo "
"; ksort($index["columns"]); foreach ($index["columns"] as $i => $column) { if (strlen($column)) { - echo ""; + echo ""; } } - echo ""; + echo ""; //! indexes from substring echo "

diff --git a/select.inc.php b/select.inc.php index 3a43cd26..1a398091 100644 --- a/select.inc.php +++ b/select.inc.php @@ -43,8 +43,8 @@ if (!$columns) { foreach ((array) $_GET["where"] as $val) { if (strlen($val["col"]) && in_array($val["op"], $operators)) { $where[] = idf_escape($val["col"]) . " $val[op]" . ($val["op"] != "IS NULL" ? " '" . $mysql->escape_string($val["val"]) . "'" : ""); - echo "

"; - echo ""; + echo "
"; + echo ""; echo "
\n"; $i++; } @@ -61,8 +61,8 @@ for (var i=0; > i; i++) { "; - echo ""; + echo "
"; + echo ""; echo "
\n"; //! JavaScript for adding next echo "\n"; @@ -72,12 +72,12 @@ for (var i=0; > i; i++) { foreach ((array) $_GET["order"] as $key => $val) { if (in_array($val, $columns, true)) { $order[] = idf_escape($val) . (isset($_GET["desc"][$key]) ? " DESC" : ""); - echo "
"; + echo "
"; echo "
\n"; $i++; } } - echo "
"; + echo "
"; echo "
\n"; echo "\n";