You are here

function registration_field_formatter_settings_form in Entity Registration 7

Same name and namespace in other branches
  1. 8.2 includes/registration.field.inc \registration_field_formatter_settings_form()
  2. 7.2 includes/registration.field.inc \registration_field_formatter_settings_form()

Implements hook_field_formatter_settings_form().

File

includes/registration.field.inc, line 180
Field hooks.

Code

function registration_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element = array();
  if ($display['type'] == 'registration_link') {
    $element['label'] = array(
      '#title' => t('Label'),
      '#type' => 'textfield',
      '#size' => 20,
      '#default_value' => $settings['label'],
      '#required' => FALSE,
      '#description' => t("Optional label to use when displaying the registration title or link. Leave blank to use the parent event's label."),
    );

    // Store a key so we can store/retrieve translated strings for this field
    // formatter instance.
    $element['i18n_string_key'] = array(
      '#type' => 'value',
      '#value' => implode(':', array(
        $instance['entity_type'],
        $instance['bundle'],
        $view_mode,
        $instance['field_name'],
      )),
    );
  }

  // Since we have translatable strings, we'll need to register them when the
  // form is submitted.
  $element['#process'][] = 'registration_field_formatter_settings_form_process';
  return $element;
}