You are here

function sharerich_field_formatter_settings_summary in Sharerich 7.3

Same name and namespace in other branches
  1. 7.2 sharerich.module \sharerich_field_formatter_settings_summary()

Pseudo hook_field_formatter_settings_summary().

1 call to sharerich_field_formatter_settings_summary()
sharerich_form_field_ui_display_overview_form_alter in ./sharerich.module
Implements hook_form_FORM_ID_alter().

File

./sharerich.module, line 787

Code

function sharerich_field_formatter_settings_summary($build, $sharerich_id, $field_name, $summary = NULL) {
  $display_stored = field_bundle_settings($build['#entity_type'], $build['#bundle']);
  if (!empty($summary)) {
    $display['settings'] = $summary;
  }
  elseif (isset($display_stored['extra_fields']['display'][$field_name][$build['#view_mode']])) {
    $display = $display_stored['extra_fields']['display'][$field_name][$build['#view_mode']];
  }
  else {
    $display_defaults = sharerich_field_extra_fields($sharerich_id);
    $display = $display_defaults['extra_fields']['display'][$field_name];
  }
  $summary = array();
  if (!empty($display['settings']['sharerich_sets'])) {
    $summary[] = t('Sharerich set') . ': ' . $display['settings']['sharerich_sets'];
  }
  else {
    $summary[] = t('No set selected.');
  }
  return implode('<br />', $summary);
}