function theme_computed_field_formatter_default in Computed Field 6
Same name and namespace in other branches
- 5 computed_field.module \theme_computed_field_formatter_default()
Theme function for 'default' text field formatter.
File
- ./
computed_field.module, line 348
Code
function theme_computed_field_formatter_default($element) {
// Make $node easily available
$node = $element['#node'];
// Grab the field
$field = content_fields($element['#field_name']);
// For "some" backwards compatibility
$node_field_item['value'] = $element['#item']['value'];
// Allow the value to be formated from code not stored in DB
$display_func = 'computed_field_' . $field['field_name'] . '_display';
if (function_exists($display_func)) {
$display = $display_func($field, $element, $node);
}
else {
eval($field['display_format']);
}
return $display;
}