You are here

function multifield_field_settings_form in Multifield 7

Same name and namespace in other branches
  1. 7.2 multifield.field.inc \multifield_field_settings_form()

Implements hook_field_settings_form().

File

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

Code

function multifield_field_settings_form($field, $instance) {
  $form['hide_blank_items'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide blank items'),
    '#default_value' => $field['settings']['hide_blank_items'],
    '#description' => t("A blank item is always added to any multivalued field's form. If checked, any additional blank items are hidden except of the first item which is always shown."),
    '#weight' => 10,
    '#states' => array(
      // Show this setting only if the cardinality is unlimited.
      'visible' => array(
        ':input[name="field[cardinality]"]' => array(
          'value' => (string) FIELD_CARDINALITY_UNLIMITED,
        ),
      ),
    ),
  );
  return $form;
}