From cf14306c2b3f82a81f8d56669a71633b4d4b5fce Mon Sep 17 00:00:00 2001 From: marvin-borner@live.com Date: Mon, 16 Apr 2018 21:09:05 +0200 Subject: Main merge to user management system - files are now at /main/public/ --- .../FormGenerator/src/Element/Checkbox.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 main/app/sprinkles/FormGenerator/src/Element/Checkbox.php (limited to 'main/app/sprinkles/FormGenerator/src/Element/Checkbox.php') diff --git a/main/app/sprinkles/FormGenerator/src/Element/Checkbox.php b/main/app/sprinkles/FormGenerator/src/Element/Checkbox.php new file mode 100755 index 0000000..59e6eaf --- /dev/null +++ b/main/app/sprinkles/FormGenerator/src/Element/Checkbox.php @@ -0,0 +1,38 @@ +element = array_merge([ + "class" => "js-icheck", + "name" => $this->name, + "id" => "field_" . $this->name, + "binary" => true + ], $this->element); + + // We add the check status instead of the value + if ($this->element["binary"] !== false && $this->getValue() == 1) { + $this->element["checked"] = "checked"; + } + } +} -- cgit v1.2.3