function finder_optionwidgets_finder_admin_element_multiple_bits in Finder 6
Same name and namespace in other branches
- 7 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 - Implementation of hook_form_FORM_ID_alter().
File
- modules/
finder_optionwidgets/ finder_optionwidgets.module, line 108 - 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' => $element->settings['form']['multiple'],
);
$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' => $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' => $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'."),
);
}