You are here

function office_hours_form_field_ui_field_edit_form_alter in Office Hours 7

Implements hook_form_FORM_ID_alter().

Changes the hook_field_settings_form.

File

includes/office_hours.field.inc, line 81
Implements the office_hours Field.

Code

function office_hours_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
  if ($form['#field']['type'] == 'office_hours') {
    $description = t("This is unlimited by this field's nature. See below for limiting the number of blocks per day.");
    $form['field']['cardinality'] = array(
      '#type' => 'select',
      '#title' => t('Number of values'),
      // '#options' => drupal_map_assoc(array(14)) + array(FIELD_CARDINALITY_UNLIMITED => t('unlimited')) + drupal_map_assoc(range(1, 10)),
      // '#options' => drupal_map_assoc(array(14)),
      // '#default_value' => 14,
      '#options' => array(
        FIELD_CARDINALITY_UNLIMITED => t('unlimited'),
      ),
      '#default_value' => FIELD_CARDINALITY_UNLIMITED,
      '#description' => $description,
    );
  }
}