Commit bd9f50e1 authored by Robert Rollins's avatar Robert Rollins

Fixed a really bad rrule bug, and 'fixed' Clean URLs.

parent 6ba016bf
......@@ -205,7 +205,6 @@ class date_ical_plugin_row_ical_entity extends views_plugin_row {
}
module_load_include('inc', 'date_api', 'date_api_ical');
$item_text = '';
// If the user specified a LOCATION field, pull that data from the entity.
$location = '';
......@@ -246,7 +245,7 @@ class date_ical_plugin_row_ical_entity extends views_plugin_row {
$uri['options']['absolute'] = TRUE;
$event['url'] = url($uri['path'], $uri['options']);
$event['uid'] = !empty($entity->date_id) ? $entity->date_id[0] : $event['url'];
$event['rrule'] = $is_field && array_key_exists('rrule', $item) ? $item['rrule'] : '';
$event['rrule'] = $is_field && array_key_exists('rrule', $date_field) ? $date_field['rrule'] : '';
if ($location) {
$event['location'] = $location;
}
......
......@@ -250,7 +250,17 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$GLOBALS['devel_shutdown'] = FALSE;
drupal_add_http_header('Content-Type', 'application/calendar; charset=utf-8');
}
header('Content-type: text/calendar');
// For sites with Clean URLs disabled, the "path" value in the view Display
// doesn't actually get applied to the URL of the calendar feed. So, we
// need to manually instruct browsers to download a .ics file.
if (!variable_get('clean_url', FALSE)) {
$path_array = explode('/', $this->display->display_options['path']);
$filename = array_pop($path_array);
header("Content-Disposition: attachment; filename=\"$filename\"");
}
return $output;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment