Development

Changeset 911

You must first sign up to be able to contribute.

Changeset 911

Show
Ignore:
Timestamp:
02/27/06 15:58:56 (7 years ago)
Author:
fabien
Message:

added params to list and filters + changed order of include_* for options_for_select

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/generator/sfPropelAdminGenerator.class.php

    r872 r911  
    455455  public function getColumnListTag($column, $params = array()) 
    456456  { 
     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 
    457461    $type = $column->getCreoleType(); 
    458462 
    459463    if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP) 
    460464    { 
    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\")"; 
    462467    } 
    463468    elseif ($type == CreoleTypes::BOOLEAN) 
     
    473478  public function getColumnFilterTag($column, $params = array()) 
    474479  { 
     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 
    475484    $type = $column->getCreoleType(); 
    476485 
  • trunk/lib/helper/FormHelper.php

    r909 r911  
    5656  $html = ''; 
    5757 
    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'])) 
    5963  { 
    6064    $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"; 
    6565  } 
    6666 
  • trunk/lib/helper/ObjectHelper.php

    r883 r911  
    118118  $select_options = _get_values_for_object_select_tag($object, $related_class); 
    119119 
    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'])) 
    121126  { 
    122127    array_unshift($select_options, '-- '._convert_method_to_name($method, $options).' --'); 
     
    127132    array_unshift($select_options, ''); 
    128133    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']); 
    134134  } 
    135135