function rooms_availability_event in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Displays the necessary json for the date range provided - needs at least start year and month at which point it will return the entire month.
1 string reference to 'rooms_availability_event'
- rooms_availability_menu in modules/
rooms_availability/ rooms_availability.module - Implements hook_menu().
File
- modules/
rooms_availability/ rooms_availability.module, line 507 - Manages availability for Bookable Units and displaying dates on the jquery FullCalendar plugin.
Code
function rooms_availability_event($unit, $start_year = '', $start_month = '', $start_day = '', $end_year = '', $end_month = '', $end_day = '', $event_style = ROOMS_AVAILABILITY_ADMIN_STYLE) {
// If user don't have 'view anonymous availability information' permission.
if (!(user_access('view anonymous availability information') || rooms_unit_access('update availability', $unit))) {
echo drupal_json_encode(array());
return;
}
$json_events = array();
$json_events = rooms_availability_generate_json($unit, $start_year, $start_month, $start_day, $end_year, $end_month, $end_day, $event_style = ROOMS_AVAILABILITY_ADMIN_STYLE);
echo drupal_json_encode($json_events);
}