X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FCombobox.class.php;h=88f0b50a933c3ebff149a0e257921bbf12a04573;hb=f787edd7045299de3885c052d243b446f7324ea0;hp=778379303a86443b3fc49c3d9b0a7755755efece;hpb=33399ff6a8bdfe9b989810dafe9c4dbf3cf3b685;p=timetracker.git diff --git a/WEB-INF/lib/form/Combobox.class.php b/WEB-INF/lib/form/Combobox.class.php index 77837930..88f0b50a 100644 --- a/WEB-INF/lib/form/Combobox.class.php +++ b/WEB-INF/lib/form/Combobox.class.php @@ -44,13 +44,11 @@ class Combobox extends FormElement { var $mCompareOn = "key"; // or "value" var $mDataDeep = 1; var $mDataKeys = array(); - var $cClassName = "Combobox"; - function Combobox($name,$value="") - { - $this->mName = $name; - $this->mValue = $value; - } + function __construct($name) { + $this->class = 'Combobox'; + $this->name = $name; + } function setMultiple($value) { $this->mMultiple = $value; } function isMultiple() { return $this->mMultiple; } @@ -65,34 +63,33 @@ class Combobox extends FormElement { function getDataKeys() { return $this->mDataKeys; } - function toStringControl() { - if (!$this->isRenderable()) return ""; - - if ($this->mId=="") $this->mId = $this->mName; + function getHtml() { + + if ($this->id=="") $this->id = $this->name; $html = "\n\tmName\" id=\"$this->mId\""; + $html .= " name=\"$this->name\" id=\"$this->id\""; - if ($this->mSize!="") - $html .= " size=\"$this->mSize\""; + if ($this->size!="") + $html .= " size=\"$this->size\""; if ($this->mMultiple) $html .= " multiple"; - - if ($this->mTabindex!="") - $html .= " tabindex=\"$this->mTabindex\""; - - if ($this->mOnChange!="") - $html .= " onchange=\"$this->mOnChange\""; + + if ($this->on_change!="") + $html .= " onchange=\"$this->on_change\""; - if ($this->mStyle!="") - $html .= " style=\"$this->mStyle\""; + if ($this->style!="") + $html .= " style=\"$this->style\""; + + if (!$this->isEnabled()) + $html .= " disabled"; $html .= ">\n"; if (is_array($this->mOptionsEmpty) && (count($this->mOptionsEmpty) > 0)) foreach ($this->mOptionsEmpty as $key=>$value) { $html .= "\n"; } if (is_array($this->mOptions) && (count($this->mOptions) > 0)) @@ -103,7 +100,7 @@ class Combobox extends FormElement { $value = $value[$this->mDataKeys[1]]; } $html .= "\n"; }