You are here

public function availability_calendar_plugin_style_ical::pre_render in Availability Calendars 7.5

Allow the style to do stuff before each row is rendered.

Parameters

array $result: The full array of results from the query.

Overrides views_plugin_style::pre_render

File

views/availability_calendar_plugin_style_ical.inc, line 18
Views style plugin for the iCal feed.

Class

availability_calendar_plugin_style_ical
Default style plugin to render an iCal feed.

Code

public function pre_render($result) {
  $view = $this->view;

  /** @var \views_display $display */
  $display = $view->display[$view->current_display];
  $isFeed = $display->handler instanceof views_plugin_display_feed;
  if ($isFeed && empty($view->live_preview)) {

    // We are in the feed: add content-type header and prevent the Devel
    // module appending queries to the feed.
    drupal_add_http_header('Content-Type', 'text/calendar');

    // Do not let the devel module append queries to the ical feed.
    $GLOBALS['devel_shutdown'] = FALSE;
  }
}