You are here

function paragraphs_field_formatter_settings_summary in Paragraphs 7

Implements hook_field_formatter_settings_summary().

File

./paragraphs.field_formatter.inc, line 54
Holds relevant functions for paragraph field formatters.

Code

function paragraphs_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $output = array();
  if ($display['type'] == 'paragraphs_view') {
    $entity_type = entity_get_info('paragraphs_item');
    if (!empty($entity_type['view modes'][$settings['view_mode']]['label'])) {
      $output[] = t('View mode: @mode', array(
        '@mode' => $entity_type['view modes'][$settings['view_mode']]['label'],
      ));
    }
    else {
      $output[] = ' ';
    }
  }
  return implode('<br>', $output);
}