You are here

function sharerich_field_formatter_settings_form in Sharerich 7.2

Same name and namespace in other branches
  1. 7.3 sharerich.module \sharerich_field_formatter_settings_form()

Pseudo hook_field_formatter_settings_form().

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

File

./sharerich.module, line 723

Code

function sharerich_field_formatter_settings_form($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];
  }
  $form['sharerich_sets'] = array(
    '#type' => 'select',
    '#title' => t('Sharerich set'),
    '#default_value' => !empty($display['settings']['sharerich_sets']) ? $display['settings']['sharerich_sets'] : '',
    '#options' => _sharerich_get_sets(),
    '#description' => t('Note: Disabled sets are not listed.'),
  );
  return $form;
}