You are here

function template_preprocess_views_ical_vcalendar in Views iCal 7

Preprocess an iCal feed

File

theme/theme.inc, line 11
Theme files for Views iCal.

Code

function template_preprocess_views_ical_vcalendar(&$vars) {
  $view = $vars['view'];
  $view_title = $view
    ->get_title();
  $title = variable_get('site_name', 'Drupal');
  if ($slogan = variable_get('site_slogan', '')) {
    $title .= ' - ' . $slogan;
  }
  $title .= !empty($view_title) ? ': ' . $view_title : '';
  $vars['title'] = check_plain($title);

  // During live preview we don't want to output the header since the contents
  // of the feed are being displayed inside a normal HTML page.
  if (empty($vars['view']->live_preview)) {

    // Keep devel module from appending queries to ical export.
    $GLOBALS['devel_shutdown'] = FALSE;
    drupal_add_http_header('Content-Type', 'application/calendar; charset=utf-8');
  }
}