You are here

bat_fullcalendar.api.php in Booking and Availability Management Tools for Drupal 8

Same filename and directory in other branches
  1. 7 modules/bat_fullcalendar/bat_fullcalendar.api.php

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.

File

modules/bat_fullcalendar/bat_fullcalendar.api.php
View source
<?php

/**
 * @file
 * 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.
 */

/**
 * Allow other modules to alter calendar settings.
 *
 * @param $calendar_settings
 */
function hook_bat_calendar_settings_alter(&$calendar_settings) {

  // No example.
}

/**
 * Allow other modules to change the modal style.
 *
 * @param $modal_style
 */
function hook_bat_fullcalendar_modal_style_alter(&$modal_style) {

  // No example.
}

/**
 * Allow other modules to change the modal content.
 *
 * @param $unit
 * @param $event_type
 * @param $event_id
 * @param $start_date
 * @param $end_date
 */
function hook_bat_fullcalendar_modal_content($unit, $event_type, $event_id, $start_date, $end_date) {

  // No example.
}

/**
 * Allow other modules to change calendar events.
 *
 * @param $formatted_event
 */
function hook_bat_fullcalendar_formatted_event_alter(&$formatted_event) {

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

Functions

Namesort descending Description
hook_bat_calendar_settings_alter Allow other modules to alter calendar settings.
hook_bat_fullcalendar_formatted_event_alter Allow other modules to change calendar events.
hook_bat_fullcalendar_modal_content Allow other modules to change the modal content.
hook_bat_fullcalendar_modal_style_alter Allow other modules to change the modal style.