Commit 4ee80ea0 authored by Robert Rollins's avatar Robert Rollins

Got rid of all the pointless whitespace.

I used to like keeping whitespace on blank lines that lined up with the
indentiation level of the code. I don't like doing that any more, so out it goes.
parent 943ac4f8
......@@ -67,7 +67,7 @@ HOW TO EXPORT AN ICAL FEED USING THE iCal Entities PLUGIN
as the event date for the iCal feed. Make sure that you choose a field that
is a part of every entity that your View displays. Otherwise, the entities
which don't have that field will be left out of the iCal feed.
9. You may optionally choose a field that will be used to populate the
9. You may optionally choose a field that will be used to populate the
Location property of events in your iCal feed. This field can be a text
field, a Node Reference field, an Addressfield, or a Location field.
10. Give the Feed a path like 'calendar/%/export.ics', including a '/%/' for
......
......@@ -80,7 +80,7 @@ function hook_date_ical_export_raw_event_alter(&$event, $view, $context) {
$event['comment'] = check_plain($comment['value']);
}
}
// Example: Retrieving information from additional fields in the View (using
// the Fields plugin).
$event['comment'] = $view->style_plugin->get_field($context['row_index'], 'field_comment');
......
......@@ -9,10 +9,10 @@
*/
function date_ical_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time.
$t = get_t();
if ($phase == 'runtime') {
if (!function_exists('libraries_detect')) {
$requirements['date_ical'] = array(
......@@ -26,7 +26,7 @@ function date_ical_requirements($phase) {
// Return immediately, since we can't even attempt to determine if iCalcreator is installed.
return $requirements;
}
$library = libraries_detect('iCalcreator');
if ($library && !empty($library['installed'])) {
$requirements['date_ical'] = array(
......@@ -46,7 +46,7 @@ function date_ical_requirements($phase) {
);
}
}
return $requirements;
}
......@@ -73,7 +73,7 @@ function date_ical_update_7300() {
// Drupal attempts to instantiate the old feeds plugin classes.
registry_rebuild();
cache_clear_all('plugins:feeds:plugins', 'cache');
// Update all the importers which used DateIcalIcalcreatorParser to use
// DateiCalFeedsParser instead.
$importer_data = ctools_export_load_object('feeds_importer', 'all');
......@@ -81,7 +81,7 @@ function date_ical_update_7300() {
$importer = feeds_importer($key);
$importer_config = $importer->getConfig();
$needs_update = ($importer_config['parser']['plugin_key'] == 'DateIcalIcalcreatorParser');
$processor = $importer->processor;
$processor_config = $processor->getconfig();
// Also update importers which use the new parser, but have un-capitalized
......@@ -91,18 +91,18 @@ function date_ical_update_7300() {
&& !empty($processor_config['mappings'][0]['source'])) {
$needs_update = (strtoupper($processor_config['mappings'][0]['source']) != $processor_config['mappings'][0]['source']);
}
if ($needs_update) {
$importer->setPlugin('DateiCalFeedsParser');
// Source keys are now capitalized, so we need to update the mappings.
foreach ($processor_config['mappings'] as &$mapping) {
$mapping['source'] = strtoupper($mapping['source']);
}
$processor->setConfig($processor_config);
$importer->save();
// When this importer object got created, a warning was issued about its
// parser plugin being missing. We corrected that warning above, so we
// should clear it out to avoid potential confusion.
......
......@@ -121,10 +121,10 @@ function date_ical_preprocess_node(&$variables) {
$variables['page'] = TRUE;
$variables['title_prefix'] = '';
$variables['title_suffix'] = '';
// We don't want to see the author information in our feed.
$variables['display_submitted'] = FALSE;
// Comments and links don't belong in an iCal feed.
if (isset($variables['content']['comments'])) {
unset($variables['content']['comments']);
......@@ -174,7 +174,7 @@ function date_ical_libraries_info() {
'php' => array('iCalcreator.class.php'),
),
);
return $libraries;
}
......@@ -231,14 +231,14 @@ function date_ical_sanitize_text($text = '') {
// HTML tags may get converted to < and such by the View code, so we need
// to convert them back to HTML so we can remove them with strip_tags().
$text = decode_entities($text);
// Convert <p> tags to double newlines.
$text = trim(preg_replace("/<p.*?>/i", "\n\n", $text));
// Separate heading tags from the text around them in both directions.
$text = trim(preg_replace("/<\\?h\d.*?>/i", "\n\n", $text));
// Add a newline for each <div>.
$text = trim(preg_replace("/<div.*?>/i", "\n", $text));
// Strip the remaining HTML.
$text = strip_tags($text);
// Remove newlines added at the beginning.
......@@ -278,7 +278,7 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $repeat_rule) {
array('RRULE', 'RDATE', 'EXRULE', 'EXDATE'),
explode('|', $repeat_rule)
);
module_load_include('inc', 'date_ical', 'date_ical.utils');
// This "loop" is really just to make sure we get the right array keys. It
// souldn't ever execute more than once.
......@@ -296,7 +296,7 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $repeat_rule) {
function date_ical_get_location_fields($base = 'node', $reset = FALSE) {
static $fields = array();
$empty = array('name' => array(), 'alias' => array());
if (empty($fields[$base]) || $reset) {
$cid = 'date_ical_location_fields_' . $base;
if (!$reset && $cached = cache_get($cid, 'cache_views')) {
......@@ -326,10 +326,10 @@ function _date_ical_get_location_fields($base = 'node') {
if (empty($base)) {
$base = 'node';
}
$cid = 'date_ical_location_fields_' . $base;
cache_clear_all($cid, 'cache_views');
// Iterate over all the fields that Views knows about.
$all_fields = date_views_views_fetch_fields($base, 'field');
$fields = array();
......@@ -338,7 +338,7 @@ function _date_ical_get_location_fields($base = 'node') {
$tmp = explode('.', $name);
$field_name = $tmp[1];
$table_name = $tmp[0];
// Skip unsupported field types and fields that weren't defined through
// the Field module.
$info = field_info_field($field_name);
......@@ -353,7 +353,7 @@ function _date_ical_get_location_fields($base = 'node') {
if (!$info || !in_array($info['type'], $supported_location_fields)) {
continue;
}
// Build an array of the field info that we'll need.
$alias = str_replace('.', '_', $alias);
$fields['name'][$name] = array(
......@@ -362,14 +362,14 @@ function _date_ical_get_location_fields($base = 'node') {
'field_name' => $field_name,
'type' => $info['type'],
);
// These are here only to make this $field array conform to the same format
// as the one returned by _date_views_fields(). They're probably not needed,
// but I thought that consistency would be a good idea.
$fields['name'][$name]['real_field_name'] = $field_name;
$fields['alias'][$alias] = $fields['name'][$name];
}
cache_set($cid, $fields, 'cache_views');
return $fields;
}
......
......@@ -14,12 +14,12 @@
function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source) {
module_load_include('inc', 'date_api', 'date_api_ical');
$field_info = field_info_field($field_name);
$rrule_values = _date_ical_parse_repeat_rule($repeat_data['RRULE']);
//$exrule_values = _date_ical_parse_repeat_rule($repeat_data['EXRULE']);
$rdates = _date_ical_parse_repeat_dates($repeat_data['RDATE']);
$exdates = _date_ical_parse_repeat_dates($repeat_data['EXDATE']);
// By the time we get here, the start and end dates have been
// adjusted back to UTC, but we want localtime dates to do
// things like '+1 Tuesday', so adjust back to localtime.
......@@ -40,7 +40,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
}
$duration = $start->difference($end);
$start_datetime = date_format($start, DATE_FORMAT_DATETIME);
if (!empty($rrule_values['UNTIL']['datetime'])) {
// The spec says that UNTIL must be in UTC, but not all feed creators
// follow that rule. If the user specified that he wanted to overcome this
......@@ -50,7 +50,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
// Change the parsed UNTIL from UTC to $timezone, so that the
// date_ical_date() won't convert it.
$rrule_values['UNTIL']['tz'] = $timezone;
// Convert the unparsed UNTIL to UTC, since the Date code will use it.
// It may currently have a Z on it, but only because iCalcreator blindly
// adds one to DATETIME-type UNTILs if it's not there.
......@@ -81,7 +81,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
// No UNTIL and no COUNT? This is an illegal RRULE.
return array();
}
// Convert the EXDATE and RDATE values to datetime strings.
// Even though exdates and rdates can be specified to the second, Date
// Repeat's code checks them by comparing them to the date value only.
......@@ -95,9 +95,9 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
$date = date_ical_date($rdate, $timezone);
$additions[] = date_format($date, 'Y-m-d');
}
// TODO: EXRULEs.
$date_repeat_compatible_rrule = "{$repeat_data['RRULE']}\n{$repeat_data['RDATE']}\n{$repeat_data['EXDATE']}";
$calculated_dates = date_repeat_calc($date_repeat_compatible_rrule, $start_datetime, $final_repeat_datetime, $exceptions, $timezone, $additions);
$repeat_dates = array();
......@@ -131,7 +131,7 @@ function _date_ical_get_repeat_dates($field_name, $repeat_data, $item, $source)
*/
function _date_ical_parse_repeat_rule($repeat_rule_string) {
module_load_include('inc', 'date_api', 'date_api_ical');
$repeat_rule_string = preg_replace('/(R|EX)RULE.*:/', '', $repeat_rule_string);
$items = array('DATA' => $repeat_rule_string);
foreach (explode(';', $repeat_rule_string) as $recur_val) {
......@@ -140,7 +140,7 @@ function _date_ical_parse_repeat_rule($repeat_rule_string) {
if (empty($key) || empty($value)) {
continue;
}
// The following keys never have multiple values.
if (in_array($key, array('UNTIL', 'FREQ', 'INTERVAL', 'COUNT', 'WKST'))) {
if ($key == 'UNTIL') {
......@@ -152,7 +152,7 @@ function _date_ical_parse_repeat_rule($repeat_rule_string) {
// The rest can be multi-value csv strings.
$value = explode(',', $value);
}
$items[$key] = $value;
}
return $items;
......@@ -171,10 +171,10 @@ function _date_ical_parse_repeat_rule($repeat_rule_string) {
*/
function _date_ical_parse_repeat_dates($repeat_date_string) {
module_load_include('inc', 'date_api', 'date_api_ical');
$properties = explode("\n", str_replace("\r\n", "\n", $repeat_date_string));
$parsed_dates = array();
foreach ($properties as $property) {
$matches = array();
if (preg_match('/(R|EX)DATE([^:]*):(.*)/', $property, $matches)) {
......
......@@ -5,14 +5,14 @@
*/
class DateiCalFeedsParser extends FeedsParser {
/**
* Implements FeedsParser::getMappingSources().
*/
public function getMappingSources() {
return parent::getMappingSources() + self::getiCalMappingSources();
}
/**
* Implements FeedsParser::parse().
*/
......@@ -22,10 +22,10 @@ class DateiCalFeedsParser extends FeedsParser {
throw new DateIcalException(t('Unable to load the iCalcreator library. Please ensure that it is properly installed.'));
}
$state = $source->state(FEEDS_PARSE);
// Read the iCal feed into memory.
$ical_feed_contents = $fetcher_result->getRaw();
// Parse the feed into an iCalcreator vcalendar object.
$calendar = new vcalendar();
if ($calendar->parse($ical_feed_contents) === FALSE) {
......@@ -33,41 +33,41 @@ class DateiCalFeedsParser extends FeedsParser {
$url = $source->config[$plugin]['source'];
throw new DateIcalException(t('Parsing the data from %url failed. Please ensure that this URL leads to a valid iCal feed.', array('%url' => $url)));
}
// Total hack to get around iCalcreator's mistreatment of UID "0".
if (empty($calendar->components[0]->uid) || empty($calendar->components[0]->uid['value'])) {
$calendar->components[0]->uid = array('value' => 'zero', 'params' => NULL);
}
// Allow modules to alter the vcalendar object before we interpret it.
$context = array(
'source' => $source,
'fetcher_result' => $fetcher_result,
);
drupal_alter('date_ical_import_vcalendar', $calendar, $context);
// We've got a vcalendar object created from the feed data. Now we need to
// convert that vcalendar into an array of Feeds-compatible data arrays.
// ParserVcalendar->parse() does that.
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'date_ical') . '/libraries/ParserVcalendar.inc';
$parser = new ParserVcalendar($calendar, $source, $fetcher_result, $source->getConfigFor($this));
// Using the stored progress pointer (or 0 if it's not set),
// determine which section of the feed to parse, then parse it.
$offset = isset($state->pointer) ? $state->pointer : 0;
$limit = $source->importer->getLimit();
$rows = $parser->parse($offset, $limit);
// Report progress.
$state->total = $parser->getTotalComponents();
// We need to add 1 to the index of the last parsed componenent so that
// the subsequent batch starts on the first unparsed component.
$state->pointer = $parser->getLastComponentParsed() + 1;
$state->progress($state->total, $state->pointer);
return new FeedsParserResult($rows);
}
/**
* Defines the default configuration settings for an actual import.
*/
......@@ -78,7 +78,7 @@ class DateiCalFeedsParser extends FeedsParser {
'skip_days' => $this->config['skip_days'],
);
}
/**
* Defines the default settings shown on the configuration form.
*/
......@@ -90,7 +90,7 @@ class DateiCalFeedsParser extends FeedsParser {
'skip_days' => NULL,
);
}
/**
* Builds the configuration form.
*/
......@@ -133,7 +133,7 @@ class DateiCalFeedsParser extends FeedsParser {
);
return $form;
}
/**
* Validation handler for configForm.
*/
......@@ -145,7 +145,7 @@ class DateiCalFeedsParser extends FeedsParser {
$source_config['skip_days'] = NULL;
}
}
/**
* Creates the list of mapping sources offered by DateiCalFeedsParser.
*/
......@@ -210,10 +210,10 @@ class DateiCalFeedsParser extends FeedsParser {
'description' => t('The CATEGORIES property. Catagories that describe the event, which can be imported into taxonomy terms.'),
'date_ical_parse_handler' => 'parseMultivalueProperty',
);
// Allow other modules to add custom source fields.
drupal_alter('date_ical_mapping_sources', $sources);
return $sources;
}
}
......@@ -10,7 +10,7 @@
*/
function date_ical_views_plugins() {
$includes_path = drupal_get_path('module', 'date_ical') . '/includes';
$data = array(
'module' => 'date_ical',
'style' => array(
......@@ -48,6 +48,6 @@ function date_ical_views_plugins() {
),
),
);
return $data;
}
......@@ -9,7 +9,7 @@
* A Views plugin which builds an iCal VEVENT from a views row with Fields.
*/
class date_ical_plugin_row_ical_fields extends views_plugin_row {
/**
* Set up the options for the row plugin.
*/
......@@ -22,7 +22,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$options['additional_settings']['skip_blank_dates'] = array('default' => FALSE);
return $options;
}
/**
* Build the form for setting the row plugin's options.
*/
......@@ -32,7 +32,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$date_field_labels = $this->get_date_field_candidates($all_field_labels);
$date_field_label_options = array_merge(array('first_available' => t('First populated Date field')), $date_field_labels);
$text_field_label_options = array_merge(array('' => t('- None -')), $all_field_labels);
$form['instructions'] = array(
// The surrounding <div> ensures that the settings dialog expands.
'#prefix' => '<div style="font-size: 90%">',
......@@ -88,7 +88,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
'#default_value' => $this->options['additional_settings']['skip_blank_dates'],
);
}
/**
* Set up the environment for the render() function.
*/
......@@ -101,13 +101,13 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
}
$this->repeated_dates = array();
}
/**
* Returns an Event array row in the query with index: $row->index.
*/
public function render($row) {
$date_field_name = $this->options['date_field'];
// If this view is set to use the first populated date field, check each
// field in the row to find the first non-NULL Date field.
if ($date_field_name == 'first_available') {
......@@ -123,7 +123,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
}
}
}
// Fetch the event's date information.
try {
if ($date_field_name == 'first_available') {
......@@ -147,10 +147,10 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
throw $e;
}
}
// Create the event by starting with the date array from this row.
$event = $date;
$entity = $row->_field_data[$this->view->base_field]['entity'];
$entity_type = $row->_field_data[$this->view->base_field]['entity_type'];
// Add the CREATED, LAST-MODIFIED, and URL components based on the entity.
......@@ -170,7 +170,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$uri = entity_uri($entity_type, $entity);
$uri['options']['absolute'] = TRUE;
$event['url'] = url($uri['path'], $uri['options']);
// Generate a unique ID for this event by emulating the way the Date module
// creates a Date ID.
if (isset($row->{"field_data_{$date_field_name}_delta"})) {
......@@ -193,7 +193,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
global $base_url;
$domain = preg_replace('#^https?://#', '', $base_url);
$event['uid'] = "calendar.$entity_id.$date_field_name.$date_field_delta@$domain";
// Because of the way that Date implements repeating dates, we're going to
// be given a separate view result for each repeat. We only want to
// render a VEVENT (with an RRULE) for the first instance of that date, so
......@@ -208,12 +208,12 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
return FALSE;
}
}
// Retrieve the rendered text fields.
$text_fields['summary'] = $this->get_field($row->index, $this->options['title_field']);
$text_fields['description'] = $this->get_field($row->index, $this->options['description_field']);
$text_fields['location'] = $this->get_field($row->index, $this->options['location_field']);
// Allow other modules to alter the rendered text fields before they get
// sanitized for iCal-compliance. This is most useful for fields of type
// "Content: Rendered Node", which are likely to have complex HTML.
......@@ -224,16 +224,16 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
'options' => $this->options,
);
drupal_alter('date_ical_export_html', $text_fields, $this->view, $context);
// Sanitize the text fields for iCal compliance, and add them to the event.
$event['summary'] = date_ical_sanitize_text($text_fields['summary']);
$event['location'] = date_ical_sanitize_text($text_fields['location']);
$event['description'] = date_ical_sanitize_text($text_fields['description']);
// Allow other modules to alter the event object before it gets passed to
// the style plugin to be converted into an iCal VEVENT.
drupal_alter('date_ical_export_raw_event', $event, $this->view, $context);
return $event;
}
......@@ -254,15 +254,15 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$rrule = NULL;
$delta = 0;
$is_date_field = FALSE;
// Fetch the date field value.
$date_field_value = $this->view->style_plugin->get_field_value($row->index, $date_field_name);
// Handle date fields.
if (isset($date_field_value[$delta]) && is_array($date_field_value[$delta])) {
$is_date_field = TRUE;
$date_field = $date_field_value[$delta];
$start = new DateObject($date_field['value'], $date_field['timezone_db']);
if (!empty($date_field['value2'])) {
$end = new DateObject($date_field['value2'], $date_field['timezone_db']);
......@@ -270,7 +270,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
else {
$end = clone $start;
}
if (isset($date_field['rrule'])) {
$rrule = $date_field['rrule'];
}
......@@ -285,41 +285,41 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$title = strip_tags($this->view->style_plugin->get_field($row->index, $this->options['title_field']));
throw new BlankDateFieldException(t("The row %title has a blank date. An iCal entry cannot be created for it.", array('%title' => $title)));
}
// Set the display timezone to whichever tz is stored for this field.
// If there isn't a stored TZ, use the site default.
$timezone = isset($date_field['timezone']) ? $date_field['timezone'] : date_default_timezone(FALSE);
$dtz = new DateTimeZone($timezone);
$start->setTimezone($dtz);
$end->setTimezone($dtz);
$granularity = 'second';
if ($is_date_field) {
$granularity_settings = $this->view->field[$date_field_name]->field_info['settings']['granularity'];
$granularity = date_granularity_precision($granularity_settings);
}
// Check if the start and end dates indicate that this is an All Day event.
$all_day = date_is_all_day(
date_format($start, DATE_FORMAT_DATETIME),
date_format($end, DATE_FORMAT_DATETIME),
$granularity
);
if ($all_day) {
// According to RFC 2445 (clarified in RFC 5545) the DTEND value is
// non-inclusive. When dealing with All Day values, they are DATEs rather
// than DATETIMEs, so we need to add a day to conform to RFC.
$end->modify("+1 day");
}
$date = array(
'start' => $start,
'end' => $end,
'all_day' => $all_day,
'rrule' => $rrule,
);
return $date;
}
......@@ -339,7 +339,7 @@ class date_ical_plugin_row_ical_fields extends views_plugin_row {
$field_candidates = array();
// These are Date, Date (ISO format), and Date (Unix timestamp).
$date_fields = array('datetime', 'date', 'datestamp');
foreach ($view_fields as $alias => $label) {
$handler_class = get_class($handlers[$alias]);
if ($handler_class == 'views_handler_field_date'
......
......@@ -8,14 +8,14 @@
* Defines a Views style plugin that renders iCal feeds.
*/
class date_ical_plugin_style_ical_feed extends views_plugin_style {
/**
* Internal helper function.
*/
protected function _get_option($option_name) {
return isset($this->options[$option_name]) ? $this->options[$option_name] : '';
}
/**
* Sets up the iCal feed icon on calendar pages.
*/
......@@ -26,14 +26,14 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$url_options['query'] = $input;
}
$url_options['absolute'] = TRUE;
$url = url($this->view->get_url(NULL, $path), $url_options);
// If the user didn't disable the option, change the scheme to webcal://
// so calendar clients can automatically subscribe via the iCal link.
if (!$this->_get_option('disable_webcal')) {
$url = str_replace(array('http://', 'https://'), 'webcal://', $url);
}
// Render the feed icon and header tag (except during a View Preview).
if (empty($this->view->live_preview)) {
$tooltip = t('Add to My Calendar');
......@@ -57,13 +57,13 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
));
}
}
/**
* Set up the options for the style plugin.
*/
public function option_definition() {
$false_bool = array('default' => FALSE, 'bool' => TRUE);
$options = parent::option_definition();
$options['cal_name'] = array('default' => array());
$options['no_calname'] = $false_bool;
......@@ -72,7 +72,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$options['unescape_punctuation'] = $false_bool;
return $options;
}
/**
* Build the form for setting the style plugin's options.
*/
......@@ -120,7 +120,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
Enable this option to have Date iCal unescape these characters before it exports the iCal feed.'),
);
}
/**
* Render the event arrays returned by the row plugin into a VCALENDAR.
*/
......@@ -148,7 +148,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
}
}
unset($this->view->row_index);
// Try to load the iCalcreator library.
$library = libraries_load('iCalcreator');
if (!$library['loaded']) {
......@@ -160,7 +160,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$config = array('unique_id' => 'Date iCal v' . DATE_ICAL_VERSION);
$vcalendar = new vcalendar($config);
$vcalendar->setMethod('PUBLISH');
// Only include the X-WR-CALNAME property if the user didn't enable
// the "Exclude Calendar Name" option.
if (!$this->_get_option('no_calname')) {
......@@ -175,7 +175,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$vcalendar->setProperty('X-WR-CALNAME', $cal_name, array('VALUE' => 'TEXT'));
}
}
// Now add the VEVENTs.
$timezones = array();
foreach ($events as $event) {
......@@ -185,16 +185,16 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
// When this happens, just skip it.
continue;
}
$vevent = $vcalendar->newComponent('vevent');
$vevent->setUid($event['uid']);
$vevent->setSummary($event['summary']);
// Get the start date as an array.
$start = $event['start']->toArray();
$start_timezone = $event['start']->getTimezone()->getName();
$timezones[$start_timezone] = $start_timezone;
if ($event['all_day']) {
// All Day events need to be DATEs, rather than DATE-TIMEs.
$vevent->setDtstart($start['year'], $start['month'], $start['day'],
......@@ -211,16 +211,16 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$start_timezone
);