You are here

function calendar_view_plugin_style::init in Calendar 7.2

Same name and namespace in other branches
  1. 6.2 includes/calendar_view_plugin_style.inc \calendar_view_plugin_style::init()
  2. 7 includes/calendar_view_plugin_style.inc \calendar_view_plugin_style::init()

Init will be called after construct, when the plugin is attached to a view and a display.

Overrides calendar_plugin_style::init

File

includes/calendar_view_plugin_style.inc, line 17
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 init(&$view, &$display, $options = NULL) {
  parent::init($view, $display, $options);
  if (!isset($view->date_info)) {
    $view->date_info = new stdClass();
  }
  $calendar_type = $this->display->handler
    ->get_option('calendar_type');
  $view->date_info->calendar_popup = $this->display->handler
    ->get_option('calendar_popup');
  $view->date_info->style_name_size = $this->options['name_size'];
  $view->date_info->style_with_weekno = $this->options['with_weekno'];
  $view->date_info->style_multiday_theme = $this->options['multiday_theme'];
  $view->date_info->style_theme_style = $this->options['theme_style'];
  $view->date_info->style_max_items = $this->options['max_items'];
  $view->date_info->style_max_items_behavior = $this->options['max_items_behavior'];
  if (!empty($this->options['groupby_times_custom'])) {
    $view->date_info->style_groupby_times = explode(',', $this->options['groupby_times_custom']);
  }
  else {
    $view->date_info->style_groupby_times = calendar_groupby_times($this->options['groupby_times']);
  }
  $view->date_info->style_groupby_field = $this->options['groupby_field'];

  // TODO make this an option setting.
  $view->date_info->style_show_empty_times = !empty($this->options['groupby_times_custom']) ? TRUE : FALSE;

  // Make sure views does't try to limit the number of items in this view.
  $this->view->pager['items_per_page'] = 0;
}