X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FCheckboxGroup.class.php;h=0bb3ac42df39da71afc3a0af9abc2b718cb88d61;hb=e2b992aea6edc4a734ddb751103101e2450f3b20;hp=759a0767acb2ab3dee6ad90b7c4061f1c9b63e78;hpb=6e59f47d1baf9e3d420b4a368dcc005d54b6e599;p=timetracker.git
diff --git a/WEB-INF/lib/form/CheckboxGroup.class.php b/WEB-INF/lib/form/CheckboxGroup.class.php
index 759a0767..0bb3ac42 100644
--- a/WEB-INF/lib/form/CheckboxGroup.class.php
+++ b/WEB-INF/lib/form/CheckboxGroup.class.php
@@ -33,17 +33,15 @@ class CheckboxGroup extends FormElement {
var $mOptions = array();
var $mLayout = "V";
var $mGroupIn = 1;
- var $cClassName = "CheckboxGroup";
var $mDataKeys = array();
var $mDataDeep = 1;
var $lSelAll = "All";
var $lSelNone = "None";
- function __construct($name,$value="")
- {
- $this->name = $name;
- $this->mValue = $value;
- }
+ function __construct($name) {
+ $this->class = 'CheckboxGroup';
+ $this->name = $name;
+ }
function setChecked($value) { $this->mChecked = $value; }
function isChecked() { return $this->mChecked; }
@@ -60,15 +58,13 @@ class CheckboxGroup extends FormElement {
function setGroupIn($value) { $this->mGroupIn = $value; if ($this->mGroupIn<1) $this->mGroupIn = 1;}
function getGroupIn() { return $this->mGroupIn; }
- function setLocalization($i18n) {
- FormElement::setLocalization($i18n);
+ function localize($i18n) {
$this->lSelAll = $i18n->getKey('label.select_all');
$this->lSelNone = $i18n->getKey('label.select_none');
}
- function toStringControl() {
- if (!$this->isRenderable()) return "";
-
+ function getHtml() {
+
if ($this->id=="") $this->id = $this->name;
$renderArray = array();
@@ -87,9 +83,9 @@ class CheckboxGroup extends FormElement {
$optval = $optval[$this->mDataKeys[1]];
}
$html = "name[]\" id=\"$this->id"."_".$i."\"";
- if (is_array($this->mValue)) {
- foreach ($this->mValue as $value) {
- if (($value == $optkey) && ($value != null))
+ if (is_array($this->value)) {
+ foreach ($this->value as $element) {
+ if (($element == $optkey) && ($element != null))
$html .= " checked=\"true\"";
}
}
@@ -115,9 +111,9 @@ class CheckboxGroup extends FormElement {
$optval = $optval[$this->mDataKeys[1]];
}
$html = "name[]\" id=\"$this->id"."_".$i."\"";
- if (is_array($this->mValue)) {
- foreach ($this->mValue as $value) {
- if (($value == $optkey) && ($value != null))
+ if (is_array($this->value)) {
+ foreach ($this->value as $element) {
+ if (($element == $optkey) && ($element != null))
$html .= " checked=\"true\"";
}
}
@@ -132,8 +128,8 @@ class CheckboxGroup extends FormElement {
}
- $html = "\n\t