You are here

function _fullcalendar_legend_get_classes in FullCalendar 8.5

Same name and namespace in other branches
  1. 8 fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  2. 8.2 modules/fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  3. 8.3 fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  4. 8.4 modules/fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  5. 7.2 fullcalendar_legend/theme/theme.inc \_fullcalendar_legend_get_classes()

Spoofs an entity to get its classes.

Parameters

array $type: An array containing the following keys:

  • "entity_type": The entity type; e.g. 'node' or 'user'.
  • "bundle": The bundle name.

Return value

array An array of CSS classes.

1 call to _fullcalendar_legend_get_classes()
template_preprocess_fullcalendar_legend in modules/fullcalendar_legend/fullcalendar_legend.theme.inc
Build the legend as a render array.

File

modules/fullcalendar_legend/fullcalendar_legend.theme.inc, line 65
Theme functions for FullCalendar Legend.

Code

function _fullcalendar_legend_get_classes($type) {
  $values['type'] = $type['bundle'];
  $entity = \Drupal::entityTypeManager()
    ->getStorage($type['entity_type'])
    ->create($values);
  $module_handler = \Drupal::moduleHandler();
  $classes = $module_handler
    ->invokeAll('fullcalendar_classes', [
    $entity,
  ]);
  $module_handler
    ->alter('fullcalendar_classes', $classes, $entity);
  return $classes;
}