1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Avoid duplicate values of HTML id attributes (bug #3614245)

Unsupports <label> in IE6.
This commit is contained in:
Jakub Vrana
2013-06-03 08:56:18 -07:00
parent e04be3a996
commit 26ad18bab2
4 changed files with 5 additions and 6 deletions

View File

@@ -99,14 +99,12 @@ function nl_br($string) {
* @return string
*/
function checkbox($name, $value, $checked, $label = "", $onclick = "", $class = "") {
static $id = 0;
$id++;
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'"
. ($checked ? " checked" : "")
. ($onclick ? ' onclick="' . h($onclick) . '"' : '')
. " id='checkbox-$id'>"
. ">"
;
return ($label != "" || $class ? "<label for='checkbox-$id'" . ($class ? " class='$class'" : "") . ">$return" . h($label) . "</label>" : $return);
return ($label != "" || $class ? "<label" . ($class ? " class='$class'" : "") . ">$return" . h($label) . "</label>" : $return);
}
/** Generate list of HTML options