Changeset 911
- Timestamp:
- 02/27/06 15:58:56 (7 years ago)
- Files:
-
- trunk/lib/generator/sfPropelAdminGenerator.class.php (modified) (2 diffs)
- trunk/lib/helper/FormHelper.php (modified) (1 diff)
- trunk/lib/helper/ObjectHelper.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/generator/sfPropelAdminGenerator.class.php
r872 r911 455 455 public function getColumnListTag($column, $params = array()) 456 456 { 457 $user_params = $this->getParameterValue('list.fields.'.$column->getName().'.params'); 458 $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); 459 $params = $user_params ? array_merge($params, $user_params) : $params; 460 457 461 $type = $column->getCreoleType(); 458 462 459 463 if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP) 460 464 { 461 return "format_date(\${$this->getSingularName()}->get{$column->getPhpName()}(), 'f')"; 465 $format = isset($params['date_format']) ? $params['date_format'] : 'f'; 466 return "format_date(\${$this->getSingularName()}->get{$column->getPhpName()}(), \"$format\")"; 462 467 } 463 468 elseif ($type == CreoleTypes::BOOLEAN) … … 473 478 public function getColumnFilterTag($column, $params = array()) 474 479 { 480 $user_params = $this->getParameterValue('list.fields.'.$column->getName().'.params'); 481 $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params); 482 $params = $user_params ? array_merge($params, $user_params) : $params; 483 475 484 $type = $column->getCreoleType(); 476 485 trunk/lib/helper/FormHelper.php
r909 r911 56 56 $html = ''; 57 57 58 if (isset($html_options['include_blank'])) 58 if (isset($html_options['include_custom'])) 59 { 60 $html .= content_tag('option', $html_options['include_custom'], array('value' => ''))."\n"; 61 } 62 else if (isset($html_options['include_blank'])) 59 63 { 60 64 $html .= content_tag('option', '', array('value' => ''))."\n"; 61 }62 else if (isset($html_options['include_custom']))63 {64 $html .= content_tag('option', $html_options['include_custom'], array('value' => ''))."\n";65 65 } 66 66 trunk/lib/helper/ObjectHelper.php
r883 r911 118 118 $select_options = _get_values_for_object_select_tag($object, $related_class); 119 119 120 if (isset($options['include_title'])) 120 if (isset($options['include_custom'])) 121 { 122 array_unshift($select_options, $options['include_custom']); 123 unset($options['include_custom']); 124 } 125 else if (isset($options['include_title'])) 121 126 { 122 127 array_unshift($select_options, '-- '._convert_method_to_name($method, $options).' --'); … … 127 132 array_unshift($select_options, ''); 128 133 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 134 } 135 135