You are here

function finder_optionwidgets_finder_admin_element_multiple_bits in Finder 7

Same name and namespace in other branches
  1. 6 modules/finder_optionwidgets/finder_optionwidgets.module \finder_optionwidgets_finder_admin_element_multiple_bits()

Add settings to the form pertaining to multiple bits.

1 call to finder_optionwidgets_finder_admin_element_multiple_bits()
finder_optionwidgets_form_finder_admin_element_edit_alter in modules/finder_optionwidgets/finder_optionwidgets.module
Implements hook_form_FORM_ID_alter().

File

modules/finder_optionwidgets/finder_optionwidgets.module, line 109
The finder optionwidgets module.

Code

function finder_optionwidgets_finder_admin_element_multiple_bits(&$form, $element) {
  $form['settings']['form']['multiple'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow multiple values.'),
    '#weight' => 180,
    '#default_value' => isset($element->settings['form']['multiple']) ? $element->settings['form']['multiple'] : FALSE,
  );
  $form['settings']['form']['default_value']['#type'] = 'textarea';
  $form['settings']['form']['default_value']['#size'] = 6;
  $form['settings']['form']['default_value']['#description'] .= ' ' . t('One per line for multiple values.');
  $form['settings']['form']['empty'] = array(
    '#type' => 'radios',
    '#title' => t('Add an empty value'),
    '#default_value' => isset($element->settings['form']['empty']) ? $element->settings['form']['empty'] : '',
    '#weight' => 210,
    '#options' => array(
      '' => t('Do not add an empty choice.'),
      'prepend' => t('Prepend an empty choice to the top of the list.'),
      'append' => t('Append an empty choice to the bottom of the list.'),
    ),
  );
  $form['settings']['form']['empty_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Empty choice text'),
    '#default_value' => isset($element->settings['form']['empty_text']) ? $element->settings['form']['empty_text'] : '',
    '#weight' => 212,
    '#description' => t("This can be used to create a choice such as 'please choose' or 'none of the above'."),
  );
}