function bat_calendar_reference_field_settings_form in Booking and Availability Management Tools for Drupal 7
Implements hook_field_settings_form().
File
- modules/
bat_calendar_reference/ bat_calendar_reference.module, line 261 - Defines a field type for referencing event information.
Code
function bat_calendar_reference_field_settings_form($field, $instance, $has_data) {
$settings = $field['settings'];
$form = array();
if ($field['type'] == 'bat_calendar_unit_reference') {
$form['referenceable_unit_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Unit types that can be referenced'),
'#multiple' => TRUE,
'#default_value' => isset($settings['referenceable_unit_types']) ? $settings['referenceable_unit_types'] : array(),
'#options' => array_map('check_plain', bat_unit_types_ids()),
);
}
$form['referenceable_event_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Event types that can be referenced'),
'#multiple' => TRUE,
'#default_value' => isset($settings['referenceable_event_types']) ? $settings['referenceable_event_types'] : array(),
'#options' => array_map('check_plain', bat_event_types_ids()),
);
return $form;
}