/[cvs]/nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FERadioGroup.inc
ViewVC logotype

Diff of /nfo/php/libs/com.newsblob.phphtmllib/form/form_elements/FERadioGroup.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jonen, Sat Feb 22 21:07:48 2003 UTC revision 1.3 by jonen, Thu May 6 16:27:27 2004 UTC
# Line 64  class FERadioGroup extends FormElement { Line 64  class FERadioGroup extends FormElement {
64       * @param mixed - the value to look up       * @param mixed - the value to look up
65       * @return string - the text associated       * @return string - the text associated
66       */       */
67      function get_value_text($value) {      function get_value_text() {
68            $value = $this->get_value();
69          foreach( $this->_data_list as $arr) {          foreach( $this->_data_list as $arr) {
70              $flip = array_flip($arr);              $flip = array_flip($arr);
71              if ($flip[$value]) {              if (isset($flip[$value])) {
72                  return $flip[$value];                  return $flip[$value];
73              }              }
74          }          }
# Line 125  class FERadioGroup extends FormElement { Line 126  class FERadioGroup extends FormElement {
126    
127          //now build the href so we can click on it.          //now build the href so we can click on it.
128          $attr["class"] ="form_link";          $attr["class"] ="form_link";
129          $attr["href"] = "#";          $attr["href"] = "javascript:void(0)";
130          $js = "javascript: function check(item){item.click();} ".          $js = "javascript: function check(item){item.click();} ".
131                "check(".$this->get_element_name().".item($index));";                "check(".$this->get_element_name().".item($index));";
132          $attr["onclick"] = $js;          $attr["onclick"] = $js;
# Line 162  class FEYesNoRadioGroup extends FERadioG Line 163  class FEYesNoRadioGroup extends FERadioG
163       *       *
164       * @param label string - text label for the element       * @param label string - text label for the element
165       * @param bool required - is this a required element       * @param bool required - is this a required element
166         * @param string - the value to use for the 'yes' radio
167         *                 NOTE: default is 'yes'
168         * @param string - the value to use for the 'no' radio
169         *                 NOTE: default is 'no'
170       */       */
171      function FEYesNoRadioGroup($label, $required = TRUE) {      function FEYesNoRadioGroup($label, $required = TRUE,
172                                   $yes_value="yes", $no_value="no") {
173          $this->FormElement($label, $required);          $this->FormElement($label, $required);
174          $this->_data_list[] = array("Yes" => "yes");          $this->_data_list[] = array("Yes" => $yes_value);
175          $this->_data_list[] = array("No" => "no");          $this->_data_list[] = array("No" => $no_value);
176      }      }
177  }  }
178  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed