theme.inc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /**
  3. * @file
  4. * Theme files for Calendar iCal.
  5. */
  6. /**
  7. * Preprocess an iCal feed
  8. */
  9. function template_preprocess_calendar_style_ical(&$vars) {
  10. global $base_url;
  11. global $language;
  12. $view = $vars['view'];
  13. $view_title = $view->get_title();
  14. $title = variable_get('site_name', 'Drupal');
  15. if ($slogan = variable_get('site_slogan', '')) {
  16. $title .= ' - ' . $slogan;
  17. }
  18. $title .= !empty($view_title) ? ': ' . $view_title : '';
  19. $vars['title'] = check_plain($title);
  20. // During live preview we don't want to output the header since the contents
  21. // of the feed are being displayed inside a normal HTML page.
  22. if (empty($vars['view']->live_preview)) {
  23. // Keep devel module from appending queries to ical export.
  24. $GLOBALS['devel_shutdown'] = FALSE;
  25. drupal_add_http_header('Content-Type', 'application/calendar; charset=utf-8');
  26. }
  27. }
  28. /**
  29. * Default theme function for all iCal rows.
  30. */
  31. function template_preprocess_calendar_row_ical_node(&$vars) {
  32. $view = &$vars['view'];
  33. $options = &$vars['options'];
  34. $item = &$vars['row'];
  35. }