class = 'Combobox'; $this->name = $name; } function setMultiple($value) { $this->mMultiple = $value; } function isMultiple() { return $this->mMultiple; } function setData($value) { $this->mOptions = $value; } function getData() { return $this->mOptions; } function setDataDefault($value) { $this->mOptionsEmpty = $value; } function getDataDefault() { return $this->mOptionsEmpty; } function setDataKeys($keys) { $this->mDataKeys = $keys; $this->mDataDeep = 2; } function getDataKeys() { return $this->mDataKeys; } function getHtml() { if ($this->id=="") $this->id = $this->name; $html = "\n\tname\" id=\"$this->id\""; if ($this->size!="") $html .= " size=\"$this->size\""; if ($this->mMultiple) $html .= " multiple"; if ($this->on_change!="") $html .= " onchange=\"$this->on_change\""; 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)) foreach ($this->mOptions as $key=>$value) { if ($this->mDataDeep>1) { $key = $value[$this->mDataKeys[0]]; $value = $value[$this->mDataKeys[1]]; } $html .= "\n"; } $html .= ""; return $html; } }