You are here

function _fullcalendar_legend_get_classes in FullCalendar 7.2

Same name and namespace in other branches
  1. 8.5 modules/fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  2. 8 fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  3. 8.2 modules/fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  4. 8.3 fullcalendar_legend/fullcalendar_legend.theme.inc \_fullcalendar_legend_get_classes()
  5. 8.4 modules/fullcalendar_legend/fullcalendar_legend.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 fullcalendar_legend/theme/theme.inc
Build the legend as a render array.

File

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

Code

function _fullcalendar_legend_get_classes($type) {
  $values['type'] = $type['bundle'];
  if (isset($type['taxonomy_field']) && isset($type['tid'])) {
    $values[$type['taxonomy_field']] = array(
      array(
        array(
          'tid' => $type['tid'],
        ),
      ),
    );
  }
  $entity = module_exists('entity') ? entity_create($type['entity_type'], $values) : new stdClass();
  $entity->bundle = $entity->type = $type['bundle'];
  $entity->entity_type = $type['entity_type'];
  $classes = module_invoke_all('fullcalendar_classes', $entity);
  drupal_alter('fullcalendar_classes', $classes, $entity);
  return $classes;
}