You are here

function date_repeat_field_date_field_settings_form_alter in Date 7.3

Same name and namespace in other branches
  1. 8 date_repeat_field/date_repeat_field.module \date_repeat_field_date_field_settings_form_alter()
  2. 7.2 date_repeat_field/date_repeat_field.module \date_repeat_field_date_field_settings_form_alter()

Implements hook_date_field_settings_form_alter().

File

date_repeat_field/date_repeat_field.module, line 625
Creates the option of Repeating Date fields and manages Date Repeat fields.

Code

function date_repeat_field_date_field_settings_form_alter(&$form, $context) {

  // This hook lets us alter the field settings form.
  $field = $context['field'];
  $instance = $context['instance'];
  $has_data = $context['has_data'];
  $form['repeat'] = array(
    '#type' => 'select',
    '#title' => t('Repeating date'),
    '#default_value' => $field['settings']['repeat'],
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#attributes' => array(
      'class' => array(
        'container-inline',
      ),
    ),
    '#description' => t("Repeating dates use an 'Unlimited' number of values. Instead of the 'Add more' button, they include a form to select when and how often the date should repeat."),
    '#disabled' => $has_data,
  );
}