X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/843a300214cc71a3eccd15ef316604bdd0a0d7ff..3cc75c9973fbeb7bc99ddb7befa6f5199d3680d1:/lib/MECON/HTML/QuickForm/caritas.php diff --git a/lib/MECON/HTML/QuickForm/caritas.php b/lib/MECON/HTML/QuickForm/caritas.php index 9979b21..8ae3f41 100644 --- a/lib/MECON/HTML/QuickForm/caritas.php +++ b/lib/MECON/HTML/QuickForm/caritas.php @@ -45,9 +45,9 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element * @var array * @access private */ - var $_selectedCarita = null; + var $_selected = null; - var $_numRows = 5; + var $_cols = 5; /** @@ -118,10 +118,10 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element */ function _setDefaults($options) { - /* if (isset($options['format'])) { - $this->setFormat($options['format']); + if (isset($options['cols'])) { + $this->setCols($options['cols']); } - if (isset($options['language'])) { + /* if (isset($options['language'])) { $this->setLanguage($options['language']); } if (isset($options['minYear'])) { @@ -136,6 +136,17 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element // }}} // {{{ setName() + /** + * Sets the number of cols (columns) + * @param string $name Input field name attribute + * @access public + * @return void + */ + function setCols($cols) + { + $this->_cols = $cols; + } //end func setCols + /** * Sets the input field name * @param string $name Input field name attribute @@ -150,6 +161,46 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element // }}} // {{{ getName() + /** + * Sets the element value + * @access public + * @return string + */ + function setValue($value) + { + $this->_selected = $value; + } //end func getName + + /** + * Sets the element value + * @access public + * @return string + */ + function setSelected($value) + { + $this->_selected = $value; + } //end func getName + + /** + * Returns the element value + * @access public + * @return string + */ + function getValue() + { + return $this->_selected; + } //end func getName + + /** + * Returns the element value + * @access public + * @return string + */ + function getSelected() + { + return $this->_selected; + } //end func getName + /** * Returns the element name * @access public @@ -184,21 +235,6 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element // }}} // {{{ _createNumericOptionList() - // {{{ setSelectedCarita() - - /** - * Sets the selected carita - * @param mixed an associative array corresponding to the format you chose - * for your date or an unix epoch timestamp - * @access public - * @return void - */ - function setSelectedCarita($value) - { - $this->_selectedCarita = $value; - } // end func setSelectedDate - - // }}} // {{{ toHtml() /** @@ -213,7 +249,7 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element $strHtml = ''; $i = 1; foreach ($this->radios as $nombre => $element) { - if (@$this->_selectedCarita == $nombre) { + if (@$this->_selected == $nombre) { $element->setChecked(true); } if ($this->_flagFrozen) { @@ -231,7 +267,7 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element } $imagen =& new HTML_Image(MECON_DIR_IMG."/caritas/$nombre"); $strHtml .= ' ' . $imagen->toHtml() . '     '; - if (!($i++ % $this->_numRows)) + if (!($i++ % $this->_cols)) $strHtml .= '
'; } return $strHtml; @@ -265,11 +301,11 @@ class HTML_QuickForm_caritas extends HTML_QuickForm_element } } if (null !== $value) { - $this->setSelectedCarita($value); + $this->setSelected($value); } break; case 'setGroupValue': - $this->setSelectedCarita($arg); + $this->setSelected($arg); break; default: parent::onQuickFormEvent($event, $arg, $caller);