Development

Changeset 9966

You must first sign up to be able to contribute.

Changeset 9966

Show
Ignore:
Timestamp:
06/29/08 09:55:16 (5 years ago)
Author:
fabien
Message:

moved _convert_options() function to TagHelper? as FormHelper? is not always loaded (when sf_compat is off for example)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/helper/FormHelper.php

    r9487 r9966  
    992992} 
    993993 
    994  
    995 /** 
    996  * Converts specific <i>$options</i> to their correct HTML format 
    997  * 
    998  * @param  array $options 
    999  * @return array returns properly formatted options  
    1000  */ 
    1001 function _convert_options($options) 
    1002 { 
    1003   $options = _parse_attributes($options); 
    1004  
    1005   foreach (array('disabled', 'readonly', 'multiple') as $attribute) 
    1006   { 
    1007     if (array_key_exists($attribute, $options)) 
    1008     { 
    1009       if ($options[$attribute]) 
    1010       { 
    1011         $options[$attribute] = $attribute; 
    1012       } 
    1013       else 
    1014       { 
    1015         unset($options[$attribute]); 
    1016       } 
    1017     } 
    1018   } 
    1019  
    1020   return $options; 
    1021 } 
    1022  
    1023994function _convert_include_custom_for_select($options, &$select_options) 
    1024995{ 
  • branches/1.1/lib/helper/TagHelper.php

    r9101 r9966  
    118118  return $value; 
    119119} 
     120 
     121/** 
     122 * Converts specific <i>$options</i> to their correct HTML format 
     123 * 
     124 * @param  array $options 
     125 * @return array returns properly formatted options  
     126 */ 
     127function _convert_options($options) 
     128{ 
     129  $options = _parse_attributes($options); 
     130 
     131  foreach (array('disabled', 'readonly', 'multiple') as $attribute) 
     132  { 
     133    if (array_key_exists($attribute, $options)) 
     134    { 
     135      if ($options[$attribute]) 
     136      { 
     137        $options[$attribute] = $attribute; 
     138      } 
     139      else 
     140      { 
     141        unset($options[$attribute]); 
     142      } 
     143    } 
     144  } 
     145 
     146  return $options; 
     147}