last half hour trying to resolve this problem...
result:
find this
function change_list_value(...)
add after
case 'enum':
$value = $this->character_limiter($value,30,"...");
break;
this
case 'dropdown':
$value =
( !empty( $value ) && isset($field_info->extras[$value]) )
?
$this->character_limiter($field_info->extras[$value], 30, "...")
:
$this->character_limiter($value,30,"...");
break;
then
add after:
protected function get_enum_input(...){...}
this
protected function get_dropdown_input($field_info,$value)
{
$input = "<select id='field-{$field_info->name}' name='{$field_info->name}'>";
if ( $field_info->extras !== false && is_array($field_info->extras) )
{
$options_array = $field_info->extras;
foreach($options_array as $key => $option)
{
$selected = !empty($value) && $value == $key ? "selected='selected'" : '';
$input .= "<option value='$key' $selected >$option</option>";
}
}
else
{
$options_array = explode("','",substr($field_info->db_max_length,1,-1));
foreach($options_array as $option)
{
$selected = !empty($value) && $value == $option ? "selected='selected'" : '';
$input .= "<option value='$option' $selected >$option</option>";
}
}
$input .= "</select>";
return $input;
}
then
find
protected function get_field_input(...)
add after:
case 'enum':
$field_info->input = $this->get_enum_input($field_info,$value);
break;
this
case 'dropdown':
$field_info->input = $this->get_dropdown_input($field_info,$value);
break;
example:
$crud->change_field_type ( 'visible', 'dropdown', array ('yes' => 'Да', 'no'=> 'Ðет') );