You are here

function template_preprocess_fullcalendar_event in FullCalendar 8

Same name and namespace in other branches
  1. 8.3 fullcalendar.theme.inc \template_preprocess_fullcalendar_event()
  2. 7.2 theme/theme.inc \template_preprocess_fullcalendar_event()

Build the render array for an individual event.

File

./fullcalendar.theme.inc, line 52
Preprocess functions for FullCalendar.

Code

function template_preprocess_fullcalendar_event(&$variables) {
  $variables['element'] = [
    '#type' => 'container',
    '#attributes' => [
      'class' => [
        'fullcalendar-event',
      ],
    ],
    'title' => [
      '#prefix' => '<h3 class="title">',
      '#suffix' => '</h3>',
      '#markup' => $variables['entity']
        ->label(),
    ],
  ];
  foreach ($variables['event'] as $instance) {
    $variables['element'][] = [
      '#type' => 'container',
      '#attributes' => [
        'class' => [
          'fullcalendar-instance',
        ],
      ],
      [
        $instance,
      ],
    ];
  }
}