You are here

function multifield_field_formatter_settings_form in Multifield 7.2

Same name and namespace in other branches
  1. 7 multifield.field.inc \multifield_field_formatter_settings_form()

Implements hook_field_formatter_settings().

File

./multifield.field.inc, line 758
Field integration for the Multifield module.

Code

function multifield_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $entity_info = entity_get_info('multifield');
  $options = array();
  foreach ($entity_info['view modes'] as $view_mode_name => $view_mode) {
    $options[$view_mode_name] = $view_mode['label'];
  }
  $element['view_mode'] = array(
    '#type' => 'select',
    '#title' => t('View mode'),
    '#options' => array(
      'default' => t('Default'),
    ) + $options,
    '#default_value' => $settings['view_mode'],
    '#required' => TRUE,
  );
  return $element;
}