function theme_computed_field_formatter_plain in Computed Field 6
Same name and namespace in other branches
- 5 computed_field.module \theme_computed_field_formatter_plain()
Theme function for 'plain' text field formatter.
File
- ./
computed_field.module, line 370
Code
function theme_computed_field_formatter_plain($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);
}
else {
eval($field['display_format']);
}
return check_plain($display);
}