You are here

function hook_date_field_settings_form_alter in Date 8

Same name and namespace in other branches
  1. 7.3 date.api.php \hook_date_field_settings_form_alter()
  2. 7.2 date.api.php \hook_date_field_settings_form_alter()

Alter a date field settings form.

Parameters

array $form: Nested array of form elements that comprise the form.

array $context: An associative array containing the following keys:

  • field: The $field array.
  • instance: The $instance array.
  • has_data: The value of $has_data.

See also

hook_field_settings_form()

1 function implements hook_date_field_settings_form_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

date_repeat_field_date_field_settings_form_alter in date_repeat_field/date_repeat_field.module
Implements hook_date_field_settings_form_alter().
2 invocations of hook_date_field_settings_form_alter()
date_field_field_settings_form in date_field/date_field.module
Helper function for date_field_settings_form().
_date_field_settings_form in ./date_admin.inc
Helper function for date_field_settings_form().

File

./date.api.php, line 366
Hooks provided by the Date module.

Code

function hook_date_field_settings_form_alter(&$form, $context) {
  $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,
  );
}