function fullcalendar_legend_block_view in FullCalendar 7.2
Implements hook_block_view().
Displays a block with a representative item for each available bundle.
File
- fullcalendar_legend/
fullcalendar_legend.module, line 70 - Adds a legend of event types.
Code
function fullcalendar_legend_block_view($delta = '') {
$block = array();
if ($delta == 'fullcalendar_legend') {
// Ensure that this page is a FullCalendar view with the legend option set.
$view = views_get_page_view();
if (empty($view) || $view->display_handler
->get_option('style_plugin') != 'fullcalendar') {
return;
}
// Build the block structure.
$block['content'] = fullcalendar_legend_build_legend($view, variable_get('fullcalendar_legend_type', 'bundle'));
}
return $block;
}