From 6b30cfa769bd62c4db85b4df1f17416a81e37af8 Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Fri, 25 Sep 2009 12:03:30 +0000 Subject: [PATCH] Separate checkbox git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1147 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- adminer/db.inc.php | 2 +- adminer/dump.inc.php | 16 +++++++--------- adminer/event.inc.php | 2 +- adminer/include/adminer.inc.php | 6 +++--- adminer/include/editing.inc.php | 4 ++-- adminer/include/functions.inc.php | 13 +++++++++++++ adminer/processlist.inc.php | 2 +- adminer/select.inc.php | 8 ++++---- adminer/sql.inc.php | 2 +- adminer/user.inc.php | 4 +++- 10 files changed, 36 insertions(+), 23 deletions(-) diff --git a/adminer/db.inc.php b/adminer/db.inc.php index 58156cde..7b8fd599 100644 --- a/adminer/db.inc.php +++ b/adminer/db.inc.php @@ -50,7 +50,7 @@ if (!$table_status) { echo '' . lang('Table') . '' . lang('Engine') . '' . lang('Collation') . '' . lang('Data Length') . '' . lang('Index Length') . '' . lang('Data Free') . '' . lang('Auto Increment') . '' . lang('Rows') . '' . lang('Comment') . "\n"; foreach ($table_status as $row) { $name = $row["Name"]; - echo ''; + echo '' . checkbox((isset($row["Rows"]) ? "tables[]" : "views[]"), $name, in_array($name, $tables_views, true), "", "form_uncheck('check-all');"); echo '' . h($name) . ''; if (isset($row["Rows"])) { echo "$row[Engine]$row[Collation]"; diff --git a/adminer/dump.inc.php b/adminer/dump.inc.php index c3c2e80f..c36bfdcf 100644 --- a/adminer/dump.inc.php +++ b/adminer/dump.inc.php @@ -148,12 +148,10 @@ echo "" . lang('Format') . "$dump_format\n"; echo "" . lang('Compression') . "" . ($dump_compress ? $dump_compress : lang('None of the supported PHP extensions (%s) are available.', 'zlib, bz2')) . "\n"; echo "" . lang('Database') . "\n"; if ($connection->server_info >= 5) { - $objects = array('routines' => lang('Routines')); + $checked = strlen($_GET["dump"]); + checkbox("routines", 1, $checked, lang('Routines')); if ($connection->server_info >= 5.1) { - $objects['events'] = lang('Events'); - } - foreach ($objects as $key => $val) { - echo " "; + checkbox("events", 1, $checked, lang('Events')); } } echo "" . lang('Tables') . "\n"; @@ -172,12 +170,12 @@ if (strlen(DB)) { echo "\n"; $views = ""; foreach (table_status() as $row) { - $checked = (strlen($TABLE) && $row["Name"] != $TABLE ? '' : " checked"); - $print = ""; + $checked = (strlen($TABLE) && $row["Name"] != $TABLE); + $print = "" . checkbox("tables[]", $row["Name"], $checked, $row["Name"], "form_uncheck('check-tables');"); if (!$row["Engine"]) { $views .= "$print\n"; } else { - echo "$print\n"; + echo "$print\n"; } } echo $views; @@ -185,7 +183,7 @@ if (strlen(DB)) { echo "\n"; foreach (get_databases() as $db) { if (!information_schema($db)) { - echo '\n"; + echo "" . checkbox("databases[]", $db, 1, $db, "form_uncheck('check-databases');") . "\n"; } } } diff --git a/adminer/event.inc.php b/adminer/event.inc.php index e00cfc50..4a35f804 100644 --- a/adminer/event.inc.php +++ b/adminer/event.inc.php @@ -43,7 +43,7 @@ if ($_POST) { " size="6"> " maxlength="64"> - 

diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 6372dde1..1cc9b962 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -183,7 +183,7 @@ class Adminer { if ($index["type"] == "FULLTEXT") { echo "(" . implode(", ", array_map('h', $index["columns"])) . ") AGAINST"; echo " "; - echo ""; + echo checkbox("boolean[$i]", 1, isset($_GET["boolean"][$i]), "BOOL"); echo "
\n"; } } @@ -214,12 +214,12 @@ class Adminer { foreach ((array) $_GET["order"] as $key => $val) { if (isset($columns[$val])) { echo "

"; - echo "
\n"; + echo checkbox("desc[$i]", 1, isset($_GET["desc"][$key]), lang('descending')) . "\n"; $i++; } } echo "
"; - echo "
\n"; + echo checkbox("desc[$i]", 1, 0, lang('descending')) . "\n"; echo "\n"; } diff --git a/adminer/include/editing.inc.php b/adminer/include/editing.inc.php index 88a8f1ff..6b22e0a6 100644 --- a/adminer/include/editing.inc.php +++ b/adminer/include/editing.inc.php @@ -176,9 +176,9 @@ function edit_fields($fields, $collations, $type = "TABLE", $allowed = 0, $forei " onchange=" 1 ? "" : "editing_add_row(this, $allowed); "); ?>editing_name_change(this);" maxlength="64">"> - checked> + checked> ->" onchange="this.previousSibling.checked = true;"> +" onchange="this.previousSibling.checked = true;">