You are here

function hook_bat_fullcalendar_formatted_event_alter in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_fullcalendar/bat_fullcalendar.api.php \hook_bat_fullcalendar_formatted_event_alter()

Allow other modules to change calendar events.

Parameters

array $formatted_event:

array $context:

2 invocations of hook_bat_fullcalendar_formatted_event_alter()
FullCalendarFixedStateEventFormatter::format in modules/bat_fullcalendar/src/FullCalendarFixedStateEventFormatter.php
FullCalendarOpenStateEventFormatter::format in modules/bat_fullcalendar/src/FullCalendarOpenStateEventFormatter.php

File

modules/bat_fullcalendar/bat_fullcalendar.api.php, line 65
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_bat_fullcalendar_formatted_event_alter(&$formatted_event, $context) {

  // Hide booking names for non-privileged users.
  if ($formatted_event['type'] == 'availability' && !user_access('create bat_event entities of bundle availability')) {
    if ($formatted_event['blocking']) {
      $formatted_event['title'] = t('Not Available');
      $formatted_event['color'] = '#CC2727';
    }
  }
}