X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=WEB-INF%2Flib%2Fform%2FCheckboxGroup.class.php;h=cb7c9f1f4ed4b1d68bae8af4b3df4168bf07139e;hb=e1703495130c8ed88fe210f50a2a6b453b3c566b;hp=f9d850fc2273ddd67452f7e69d308488deb8962a;hpb=a07b6f8bccda226991ced6fe25f1c9c508e423e5;p=timetracker.git
diff --git a/WEB-INF/lib/form/CheckboxGroup.class.php b/WEB-INF/lib/form/CheckboxGroup.class.php
index f9d850fc..cb7c9f1f 100644
--- a/WEB-INF/lib/form/CheckboxGroup.class.php
+++ b/WEB-INF/lib/form/CheckboxGroup.class.php
@@ -33,7 +33,7 @@ class CheckboxGroup extends FormElement {
var $mOptions = array();
var $mLayout = "V";
var $mGroupIn = 1;
- var $cClassName = "CheckboxGroup";
+ var $class = 'CheckboxGroup';
var $mDataKeys = array();
var $mDataDeep = 1;
var $lSelAll = "All";
@@ -41,8 +41,8 @@ class CheckboxGroup extends FormElement {
function __construct($name,$value="")
{
- $this->mName = $name;
- $this->mValue = $value;
+ $this->name = $name;
+ $this->value = $value;
}
function setChecked($value) { $this->mChecked = $value; }
@@ -60,16 +60,14 @@ 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 "";
-
- if ($this->mId=="") $this->mId = $this->mName;
+ function getHtml() {
+
+ if ($this->id=="") $this->id = $this->name;
$renderArray = array();
$renderCols = 0;
@@ -86,14 +84,14 @@ class CheckboxGroup extends FormElement {
$optkey = $optval[$this->mDataKeys[0]];
$optval = $optval[$this->mDataKeys[1]];
}
- $html = "mName[]\" id=\"$this->mId"."_".$i."\"";
- if (is_array($this->mValue)) {
- foreach ($this->mValue as $value) {
- if (($value == $optkey) && ($value != null))
+ $html = "name[]\" id=\"$this->id"."_".$i."\"";
+ if (is_array($this->value)) {
+ foreach ($this->value as $element) {
+ if (($element == $optkey) && ($element != null))
$html .= " checked=\"true\"";
}
}
- $html .= " value=\"".htmlspecialchars($optkey)."\"> ";
+ $html .= " value=\"".htmlspecialchars($optkey)."\"> ";
$renderArray[$col][$row] = $html;
$col++;
@@ -114,14 +112,14 @@ class CheckboxGroup extends FormElement {
$optkey = $optval[$this->mDataKeys[0]];
$optval = $optval[$this->mDataKeys[1]];
}
- $html = "mName[]\" id=\"$this->mId"."_".$i."\"";
- if (is_array($this->mValue)) {
- foreach ($this->mValue as $value) {
- if (($value == $optkey) && ($value != null))
+ $html = "name[]\" id=\"$this->id"."_".$i."\"";
+ if (is_array($this->value)) {
+ foreach ($this->value as $element) {
+ if (($element == $optkey) && ($element != null))
$html .= " checked=\"true\"";
}
}
- $html .= " value=\"".htmlspecialchars($optkey)."\"> ";
+ $html .= " value=\"".htmlspecialchars($optkey)."\"> ";
$renderArray[$col][$row] = $html;
$row++;
@@ -132,8 +130,8 @@ class CheckboxGroup extends FormElement {
}
- $html = "\n\t