function availability_calendar_field_formatter_info in Availability Calendars 7.4
Same name and namespace in other branches
- 7.5 availability_calendar.field.inc \availability_calendar_field_formatter_info()
- 7.3 availability_calendar.field.inc \availability_calendar_field_formatter_info()
Implements hook_field_formatter_info(). @link http://api.drupal.org/api/drupal/modules--field--field.api.php/function/...
This module defines a formatter based on a monthly display, optionally in a viewport. Other formatters may be defined in the future or by other modules.
File
- ./
availability_calendar.field.inc, line 269
Code
function availability_calendar_field_formatter_info() {
$settings = array(
'show_number_of_months' => 12,
// 6 = saturday = default change over day.
'first_day_of_week' => variable_get('date_first_day', 6),
'show_week_number' => 0,
'show_only_first_letter' => 0,
'show_split_day' => 0,
'selectable' => module_exists('availability_calendar_booking_formlet'),
);
$viewport_settings = $settings + array(
'viewport' => array(
'dimensions_calculation' => 'fixed',
'cols' => 3,
'rows' => 1,
'scroll' => 1,
'button_placement' => 'after',
),
);
$result = array(
'availability_calendar' => array(
'label' => t('Show the calendar as a set of months'),
'field types' => array(
'availability_calendar',
),
'settings' => $settings,
),
'availability_calendar_viewport' => array(
'label' => t('Show the calendar in a viewport'),
'description' => t('Allows to define the number of months to show at once, and provides buttons to scroll through the months. Takes up less space.'),
'field types' => array(
'availability_calendar',
),
'settings' => $viewport_settings,
),
);
if (module_exists('colorbox')) {
$colorbox_settings = $settings + array(
'colorbox' => array(
'width' => '720',
'height' => 'auto',
),
);
$result['availability_calendar_colorbox'] = array(
'label' => t('Show the calendar in a Colorbox'),
'description' => t('Show the calendar in a Colorbox, so it takes up almost no space.'),
'field types' => array(
'availability_calendar',
),
'settings' => $colorbox_settings,
);
}
return $result;
}