You are here

function custom_formatters_ds_render_field in Custom Formatters 7.2

Display Suite render function for Custom Formatters integration.

Parameters

array $field: The Display suite to be rendered.

Return value

mixed The rendered output of the field.

1 string reference to 'custom_formatters_ds_render_field'
custom_formatters_ds_fields_info_alter in includes/ds.inc
Implements hook_ds_fields_info_alter().

File

includes/ds.inc, line 160
Display Suite module integration.

Code

function custom_formatters_ds_render_field($field) {
  if (strpos($field['formatter'], 'custom_formatters_') === 0) {
    $display = array(
      'type' => $field['formatter'],
    );
    foreach (array_keys($field['properties']['formatters']) as $formatter) {
      if (strpos($formatter, 'custom_formatters_') !== 0) {
        $temp_field = $field;
        $temp_field['formatter'] = $formatter;
        $items[$formatter] = $field['#original_field']['function']($temp_field);
      }
    }
    $element = custom_formatters_field_formatter_view($field['entity_type'], $field['entity'], $field, array(), language_default('language'), $items, $display);
    return render($element);
  }

  // Pass field back to it's original function.
  return $field['#original_field']['function']($field);
}