public function getFieldType($field)
{
// default form field type
$type = 'Line';
// try to find associated form field type
if (isset($this->type_associations[$field->type()])) {
$type = $this->type_associations[$field->type()];
}
if ($field instanceof Field_Reference) {
$type = 'DropDown';
}
// if form field type explicitly set in model
if ($field->display()) {
$tmp = $field->display();
if (is_array($tmp)) {
$tmp = $tmp['form'];
}
if ($tmp) {
$type = $tmp;
}
}
return $type;
}