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 |
} |
} |
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; |
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 |
?> |
?> |