Development

Changeset 883

You must first sign up to be able to contribute.

Changeset 883

Show
Ignore:
Timestamp:
02/26/06 17:43:42 (7 years ago)
Author:
fabien
Message:

fixed bug in custom titles for object_select_tag + added some more options

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/helper/ObjectHelper.php

    r873 r883  
    116116  unset($options['related_class']); 
    117117 
     118  $select_options = _get_values_for_object_select_tag($object, $related_class); 
     119 
    118120  if (isset($options['include_title'])) 
    119121  { 
    120     $select_options[''] = '-- '._convert_method_to_name($method, $options).' --'
     122    array_unshift($select_options, '-- '._convert_method_to_name($method, $options).' --')
    121123    unset($options['include_title']); 
    122124  } 
    123  
    124   $select_options = _get_values_for_object_select_tag($object, $related_class); 
     125  else if (isset($options['include_blank'])) 
     126  { 
     127    array_unshift($select_options, ''); 
     128    unset($options['include_blank']); 
     129  } 
     130  else if (isset($options['include_custom'])) 
     131  { 
     132    array_unshift($select_options, $options['include_custom']); 
     133    unset($options['include_custom']); 
     134  } 
    125135 
    126136  $value = _get_object_value($object, $method, $default_value);