- Timestamp:
- 07/28/06 05:18:21 (6 years ago)
- Location:
- trunk/trax/vendor/trax/action_view
- Files:
-
- 3 modified
-
helpers.php (modified) (2 diffs)
-
helpers/form_helper.php (modified) (1 diff)
-
helpers/form_options_helper.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/trax/vendor/trax/action_view/helpers.php
r228 r233 292 292 $html = "<$name "; 293 293 $html .= $this->tag_options($options); 294 if($options['strip_slashes']) { 295 $content = stripslashes($content); 296 } 294 297 $html .= ">$content</$name>"; 295 298 return $html."\n"; … … 313 316 */ 314 317 function error_wrapping($html_tag, $has_error) { 315 return ($has_error ? '<span class="fieldWithErrors">' . $html_tag. '</span>' : $html_tag);318 return ($has_error ? '<span class="fieldWithErrors">' . eregi_replace("[\n\r]", '', $html_tag) . '</span>' : $html_tag); 316 319 } 317 320 -
trunk/trax/vendor/trax/action_view/helpers/form_helper.php
r228 r233 269 269 270 270 $options = $this->add_default_name_and_id($options); 271 return $this->error_wrapping($this->tag("input", $options) . $this->tag("input", array("name" => $options["name"], "type" => "hidden", "value" => $unchecked_value)),$this->object()->errors[$this->attribute_name]);271 return $this->error_wrapping($this->tag("input", array("name" => $options["name"], "type" => "hidden", "value" => $unchecked_value)) . $this->tag("input", $options),$this->object()->errors[$this->attribute_name]); 272 272 } 273 273 -
trunk/trax/vendor/trax/action_view/helpers/form_options_helper.php
r228 r233 110 110 if(is_array($choices)) { 111 111 foreach($choices as $choice_value => $choice_text) { 112 if(!empty($choice_value) ) {112 if(!empty($choice_value) || is_numeric($choice_value)) { 113 113 $is_selected = ($choice_value == $selected) 114 114 ? true : false; … … 119 119 if($is_selected) { 120 120 $options[] = "<option value=\"" 121 . htmlspecialchars($choice_value)122 . "\" selected=\"selected\">"123 . htmlspecialchars($choice_text)."</option>";121 . htmlspecialchars($choice_value) 122 . "\" selected=\"selected\">" 123 . htmlspecialchars($choice_text)."</option>"; 124 124 } else { 125 125 $options[] = "<option value=\"" 126 . htmlspecialchars($choice_value)127 . "\">"128 . htmlspecialchars($choice_text)."</option>";126 . htmlspecialchars($choice_value) 127 . "\">" 128 . htmlspecialchars($choice_text)."</option>"; 129 129 } 130 130 } … … 202 202 function to_select_tag($choices, $options, $html_options) { 203 203 $html_options = $this->add_default_name_and_id($html_options); 204 $value = $this->value(); 204 205 return $this->error_wrapping( 205 206 $this->content_tag( 206 207 "select", 207 208 $this->add_options( 208 $this->options_for_select($choices, $ this->value()),209 $this->options_for_select($choices, $value), 209 210 $options, 210 $ this->value()),211 $value), 211 212 $html_options), 212 213 $this->object()->errors[$this->attribute_name]); … … 226 227 $html_options) { 227 228 $html_options = $this->add_default_name_and_id($html_options); 229 $value = $this->value(); 228 230 return $this->error_wrapping( 229 231 $this->content_tag( … … 234 236 $attribute_value, 235 237 $attribute_text, 236 $ this->value()),238 $value), 237 239 $options, 238 $ this->value()),240 $value), 239 241 $html_options), 240 242 $this->object()->errors[$this->attribute_name]); … … 252 254 $options, $html_options) { 253 255 $html_options = $this->add_default_name_and_id($html_options); 256 $value = $this->value(); 254 257 return $this->error_wrapping( 255 258 $this->content_tag( 256 259 "select", 257 260 $this->add_options( 258 $this->country_options_for_select($ this->value(),261 $this->country_options_for_select($value, 259 262 $priority_countries), 260 263 $options, 261 $ this->value),264 $value), 262 265 $html_options), 263 266 $this->object()->errors[$this->attribute_name]); … … 270 273 * @param string[] 271 274 * @param string 272 * @todo <b>FIXME:</b> Why the third argument? It's overwritten!273 275 * @uses value() 274 276 */ … … 278 280 $option_tags = "<option value=\"\"></option>\n" . $option_tags; 279 281 } 280 $value = $this->value();281 282 if(empty($value) && array_key_exists('prompt', $options)) { 282 283 $text = $options['prompt'] ? $options['prompt'] : "Please select";
