function calendar_view_plugin_style::render in Calendar 7
Same name and namespace in other branches
- 6.2 includes/calendar_view_plugin_style.inc \calendar_view_plugin_style::render()
- 7.2 includes/calendar_view_plugin_style.inc \calendar_view_plugin_style::render()
Render the calendar attachment style.
Overrides calendar_plugin_style::render
File
- includes/
calendar_view_plugin_style.inc, line 180 - Views calendar style plugin for the Calendar module.
Class
- calendar_view_plugin_style
- Style plugin to render the year, month, week, or day calendar view.
Code
function render() {
$calendar_type = $this->display->handler
->get_option('calendar_type');
// Adjust the theme to match the currently selected default.
// Only the month view needs the special 'mini' class,
// which is used to retrieve a different, more compact, theme.
if (!empty($this->view->date_info->mini) && $this->view->date_info->granularity == 'month') {
$this->definition['theme'] = 'calendar_mini';
}
elseif (module_exists('calendar_multiday') && $calendar_type == 'week') {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] = !isset($this->view->style_options['multiday_theme']) || $this->view->style_options['multiday_theme'] == '1' && $this->view->style_options['theme_style'] == '1' ? 'calendar_' . $this->view->date_info->granularity . '_overlap' : 'calendar_' . $this->view->date_info->granularity;
}
elseif (module_exists('calendar_multiday') && $calendar_type == 'day') {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] = !isset($this->view->style_options['multiday_theme']) || $this->view->style_options['theme_style'] == '1' ? 'calendar_' . $this->view->date_info->granularity . '_overlap' : 'calendar_' . $this->view->date_info->granularity;
}
else {
$this->view->date_info->mini = FALSE;
$this->definition['theme'] = 'calendar_' . $this->view->date_info->granularity;
}
$this->view->date_info->hide_admin_links = TRUE;
return theme($this
->theme_functions(), array(
'view' => $this->view,
'options' => $this->options,
'items' => array(),
));
}