You are here

function bat_fullcalendar_modal_style in Booking and Availability Management Tools for Drupal 7

Same name and namespace in other branches
  1. 8 modules/bat_fullcalendar/bat_fullcalendar.module \bat_fullcalendar_modal_style()

Define modal JS style and dependencies.

Parameters

string $style:

1 call to bat_fullcalendar_modal_style()
theme_bat_fullcalendar in modules/bat_fullcalendar/bat_fullcalendar.module
Theme function for FullCalendar.

File

modules/bat_fullcalendar/bat_fullcalendar.module, line 823
Manages the display of FullCalendar and provides ways for other modules to easily modify it.

Code

function bat_fullcalendar_modal_style($style = 'default') {

  // Include libraries.
  ctools_include('modal');
  ctools_include('ajax');
  ctools_modal_add_js();

  // Styles to use for the modal.
  $modal_style = array(
    'bat-modal-style' => array(
      'modalSize' => array(
        'type' => 'fixed',
        'width' => 520,
        'height' => 520,
        'addWidth' => 0,
        'addHeight' => 0,
      ),
      'modalOptions' => array(
        'opacity' => 0.0,
        'background-color' => '#000',
      ),
      'animation' => 'fadeIn',
    ),
  );

  // Allow other modules to change the modal style.
  drupal_alter('bat_fullcalendar_modal_style', $modal_style);

  // Add the ctool modal configuration to settings.
  drupal_add_js($modal_style, 'setting');

  // Add the ctools modal stylesheet.
  drupal_add_css(drupal_get_path('module', 'bat_fullcalendar') . '/css/bat_modal.css');
}