You are here

function calendar_plugin_style_ical::attach_to in Calendar 7

Same name and namespace in other branches
  1. 6.2 calendar_ical/calendar_plugin_style_ical.inc \calendar_plugin_style_ical::attach_to()
  2. 7.2 calendar_ical/calendar_plugin_style_ical.inc \calendar_plugin_style_ical::attach_to()

Overrides views_plugin_style_rss::attach_to

File

calendar_ical/calendar_plugin_style_ical.inc, line 25
Views style plugin for the Calendar iCal module.

Class

calendar_plugin_style_ical
Default style plugin to render an iCal feed.

Code

function attach_to($display_id, $path, $title) {
  $display = $this->view->display[$display_id]->handler;
  $url_options = array();
  $input = $this->view
    ->get_exposed_input();
  if ($input) {
    $url_options['query'] = $input;
  }

  // TODO adjust this to pick up default values when no arg is set?
  $url = url($this->view
    ->get_url(NULL, $path), $url_options);
  if (empty($this->view->feed_icon)) {
    $this->view->feed_icon = '';
  }
  $this->view->feed_icon .= theme('calendar_ical_icon', array(
    'url' => $url,
  ));
  drupal_add_html_head_link(array(
    'rel' => 'alternate',
    'type' => 'application/calendar',
    'title' => $title,
    'href' => $url,
  ));
}