function get($id = "", $label = "", $DefaultValue = false, $tabla = "") { $xL = new cLang(); $label = $xL->getT($label); $this->mLIDs[] = $id; $select = ""; $maxSize = $this->mLabelSize == 0 ? HP_LABEL_SIZE : $this->mLabelSize; //$this->mMaxLineSize - $this->mLineSize; $rll = $maxSize - strlen(html_entity_decode($label)); $id = $id == "" ? $this->mId : $id; $this->mDefault = $DefaultValue !== false ? $DefaultValue : $this->mDefault; $DefaultValue = $this->mDefault; $nEvents = ""; $nProps = ""; $label = $label; //($label == "") ? "" : $label . str_repeat(" ", $rll ); //elimina el Name y le asigna el ID como name //unset($this->mArrProp["name"]); $this->mArrProp["name"] = $id; foreach ($this->mArrEvents as $key => $value) { $nEvents .= " {$key}=\"{$value}\" "; } foreach ($this->mArrProp as $key => $value) { $nProps .= " {$key}=\"{$value}\" "; } if ($this->mSql != "") { $tabla = $this->mSql; } if ($tabla == "") { $txt = ""; $isDef = ""; foreach ($this->mEspOptions as $valor => $tit) { $isDef = $valor == $DefaultValue ? "selected" : ""; $txt .= "<option {$isDef} value='{$valor}'>{$tit}</option>"; } $label = $label == "" ? "" : "<label for='{$id}'>{$label}</label>"; $select = $this->mTags == true ? "<div class='" . $this->mDivClass . "'>{$label}<select id='{$id}' {$nProps} {$nEvents} >{$txt}</select></div> " : "{$label}<select id='{$id}' {$nProps} {$nEvents} >{$txt}</select>"; } else { $xSel = new cSelect($id, $id, $tabla); if ($this->mSql != "") { $xSel->setEsSql(); } foreach ($this->mArrEvents as $key => $value) { $xSel->addEvent($key, $value); } if ($DefaultValue != false) { $xSel->setOptionSelect($DefaultValue); } $xSel->setLabelSize($this->mLabelSize); $select = $xSel->get($label, $this->mTags); } return $select; }