You are here

function fullcalendar_colors_page_attachments in FullCalendar 8.3

Same name and namespace in other branches
  1. 8 fullcalendar_colors/fullcalendar_colors.module \fullcalendar_colors_page_attachments()

Implements hook_preprocess_fullcalendar().

Process FullCalendar Colors after the structure is built.

File

fullcalendar_colors/fullcalendar_colors.module, line 13
Provide integration with Colors module for FullCalendar.

Code

function fullcalendar_colors_page_attachments(array &$attachments) {

  // TODO D8: Remove weight once http://drupal.org/node/1388546 is fixed.
  // TODO: This doesn't work because the style tag is position too high in
  // the head to have any effect.
  $css = colors_create_css('fullcalendar_colors');
  $attachments['#attached']['html_head'][] = [
    [
      '#type' => 'html_tag',
      '#tag' => 'style',
      '#value' => $css,
      '#weight' => 1000,
    ],
    'fullcalendar-inline-css',
  ];
}