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

Respect defaults and comments checkbox after post (bug #3311791)

This commit is contained in:
Jakub Vrana
2011-06-07 15:00:18 +02:00
parent 05ad2268fa
commit 3a148454c1
3 changed files with 21 additions and 15 deletions

View File

@@ -86,12 +86,13 @@ function nl_br($string) {
* @param bool
* @param string
* @param string
* @param bool
* @return string
*/
function checkbox($name, $value, $checked, $label = "", $onclick = "") {
function checkbox($name, $value, $checked, $label = "", $onclick = "", $jsonly = false) {
static $id = 0;
$id++;
$return = "<input type='checkbox'" . ($name ? " name='$name' value='" . h($value) . "'" : " class='jsonly'") . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . " id='checkbox-$id'>";
$return = "<input type='checkbox' name='$name' value='" . h($value) . "'" . ($checked ? " checked" : "") . ($onclick ? " onclick=\"$onclick\"" : "") . ($jsonly ? " class='jsonly'" : "") . " id='checkbox-$id'>";
return ($label != "" ? "<label for='checkbox-$id'>$return" . h($label) . "</label>" : $return);
}