]> git.joonet.de Git - adminer.git/commitdiff
Clickable labels in IE6
authorjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 26 Sep 2009 16:52:32 +0000 (16:52 +0000)
committerjakubvrana <jakubvrana@7c3ca157-0c34-0410-bff1-cbf682f78f5c>
Sat, 26 Sep 2009 16:52:32 +0000 (16:52 +0000)
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1151 7c3ca157-0c34-0410-bff1-cbf682f78f5c

adminer/dump.inc.php
adminer/include/functions.inc.php
todo.txt

index c36bfdcf44b2f3480cd42578ad07c84be91d3caa..0ae8f52f43880017f88d095fde474e5e7c5c87bd 100644 (file)
@@ -170,7 +170,7 @@ if (strlen(DB)) {
        echo "</thead>\n";
        $views = "";
        foreach (table_status() as $row) {
-               $checked = (strlen($TABLE) && $row["Name"] != $TABLE);
+               $checked = !strlen($TABLE) || $row["Name"] == $TABLE;
                $print = "<tr><td>" . checkbox("tables[]", $row["Name"], $checked, $row["Name"], "form_uncheck('check-tables');");
                if (!$row["Engine"]) {
                        $views .= "$print\n";
index 14eef590479cd9b8b65fa0337ea4f8553ffb4fdb..516b6364ef3c3aed558d5ba306fa96936fc633e7 100644 (file)
@@ -68,8 +68,10 @@ function nbsp($string) {
 * @return string
 */
 function checkbox($name, $value, $checked, $label = "", $onclick = "") {
-       $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . ">";
-       return (strlen($label) ? "<label>$return" . h($label) . "</label>" : $return);
+       static $id = 0;
+       $id++;
+       $return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
+       return (strlen($label) ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
 }
 
 /** Generate list of HTML options
index b5099835ed99670d2af70ea5131c577d16a418f3..8b37111d7e2ec0248e7a4f0c3720eabcd96f9302 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -7,7 +7,6 @@ Create view and routine options
 Function to fix database encoding - http://php.vrana.cz/prevod-kodovani-mysql.php
 Highlight SQL textarea - may use external CodePress
 Mass editation of individual rows
-IE6 - <label for>
 Offer enum and set items in search - whisperer
 Use event $intervals + microseconds in relative date functions
 ? Column and table names auto-completition in SQL textarea