Commit 0b6a73ad authored by Robert Rollins's avatar Robert Rollins

Applied patch #11 from [#1922658] to get around iCalcreator limitation with...

Applied patch #11 from [#1922658] to get around iCalcreator limitation with stream wrappers. Also made the amount of whitespace on blank lines consistent throughout the project.
parent 3fb327ec
...@@ -148,7 +148,7 @@ function hook_date_ical_icalcreator_component_alter(&$component, &$context) { ...@@ -148,7 +148,7 @@ function hook_date_ical_icalcreator_component_alter(&$component, &$context) {
function hook_date_ical_feeds_object_alter(&$value, &$context) { function hook_date_ical_feeds_object_alter(&$value, &$context) {
// Example of what might be done with this alter hook // Example of what might be done with this alter hook
if ($context['property_key'] == 'dtstart') { if ($context['property_key'] == 'dtstart') {
// Tweak the parsed FeedsDateTime object for the start time. // Tweak the parsed FeedsDateTime object created from the start time.
// ... // ...
} }
} }
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
*/ */
function date_ical_requirements($phase) { function date_ical_requirements($phase) {
$requirements = array(); $requirements = array();
// Ensure translations don't break at install time // Ensure translations don't break at install time
$t = get_t(); $t = get_t();
switch ($phase) { switch ($phase) {
case 'runtime': case 'runtime':
if (($library = libraries_detect('iCalcreator')) && !empty($library['installed'])) { if (($library = libraries_detect('iCalcreator')) && !empty($library['installed'])) {
...@@ -33,7 +33,7 @@ function date_ical_requirements($phase) { ...@@ -33,7 +33,7 @@ function date_ical_requirements($phase) {
} }
break; break;
} }
return $requirements; return $requirements;
} }
......
...@@ -57,10 +57,10 @@ function date_ical_preprocess_node(&$variables) { ...@@ -57,10 +57,10 @@ function date_ical_preprocess_node(&$variables) {
$variables['page'] = TRUE; $variables['page'] = TRUE;
$variables['title_prefix'] = ''; $variables['title_prefix'] = '';
$variables['title_suffix'] = ''; $variables['title_suffix'] = '';
// We don't want to see the author information in our feed. // We don't want to see the author information in our feed.
$variables['display_submitted'] = FALSE; $variables['display_submitted'] = FALSE;
// Comments and links don't belong in an iCal feed. // Comments and links don't belong in an iCal feed.
if (isset($variables['content']['comments'])) { if (isset($variables['content']['comments'])) {
unset($variables['content']['comments']); unset($variables['content']['comments']);
...@@ -107,7 +107,7 @@ function date_ical_libraries_info() { ...@@ -107,7 +107,7 @@ function date_ical_libraries_info() {
'php' => array('iCalcreator.class.php'), 'php' => array('iCalcreator.class.php'),
), ),
); );
return $libraries; return $libraries;
} }
...@@ -209,17 +209,16 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $feed_element) { ...@@ -209,17 +209,16 @@ function date_ical_feeds_set_rrule($source, $entity, $target, $feed_element) {
* giving up completely. * giving up completely.
*/ */
function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $field, $item) { function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $field, $item) {
module_load_include('inc', 'date_api', 'date_api_ical'); module_load_include('inc', 'date_api', 'date_api_ical');
$field_name = $field['field_name']; $field_name = $field['field_name'];
if (empty($rrule)) { if (empty($rrule)) {
$rrule = date_api_ical_build_rrule($rrule_values); $rrule = date_api_ical_build_rrule($rrule_values);
} }
elseif (empty($rrule_values)) { elseif (empty($rrule_values)) {
$rrule_values = date_ical_parse_rrule(NULL, $rrule); $rrule_values = date_ical_parse_rrule(NULL, $rrule);
} }
// By the time we get here, the start and end dates have been // By the time we get here, the start and end dates have been
// adjusted back to UTC, but we want localtime dates to do // adjusted back to UTC, but we want localtime dates to do
// things like '+1 Tuesday', so adjust back to localtime. // things like '+1 Tuesday', so adjust back to localtime.
...@@ -240,7 +239,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f ...@@ -240,7 +239,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f
} }
$duration = $start->difference($end); $duration = $start->difference($end);
$start_datetime = date_format($start, DATE_FORMAT_DATETIME); $start_datetime = date_format($start, DATE_FORMAT_DATETIME);
if (!empty($rrule_values['UNTIL']['datetime'])) { if (!empty($rrule_values['UNTIL']['datetime'])) {
$end = date_ical_date($rrule_values['UNTIL'], $timezone); $end = date_ical_date($rrule_values['UNTIL'], $timezone);
$end_datetime = date_format($end, DATE_FORMAT_DATETIME); $end_datetime = date_format($end, DATE_FORMAT_DATETIME);
...@@ -255,7 +254,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f ...@@ -255,7 +254,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f
$rrule = substr_replace($rrule, 'COUNT=52;', 6, 0); $rrule = substr_replace($rrule, 'COUNT=52;', 6, 0);
$end_datetime = NULL; $end_datetime = NULL;
} }
// Split the RRULE into RRULE, EXDATE, and RDATE parts. // Split the RRULE into RRULE, EXDATE, and RDATE parts.
$parts = date_repeat_split_rrule($rrule); $parts = date_repeat_split_rrule($rrule);
$parsed_exceptions = (array) $parts[1]; $parsed_exceptions = (array) $parts[1];
...@@ -264,14 +263,14 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f ...@@ -264,14 +263,14 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f
$date = date_ical_date($exception, $timezone); $date = date_ical_date($exception, $timezone);
$exceptions[] = date_format($date, 'Y-m-d'); $exceptions[] = date_format($date, 'Y-m-d');
} }
$parsed_rdates = (array) $parts[2]; $parsed_rdates = (array) $parts[2];
$additions = array(); $additions = array();
foreach ($parsed_rdates as $rdate) { foreach ($parsed_rdates as $rdate) {
$date = date_ical_date($rdate, $timezone); $date = date_ical_date($rdate, $timezone);
$additions[] = date_format($date, 'Y-m-d'); $additions[] = date_format($date, 'Y-m-d');
} }
$dates = date_repeat_calc($rrule, $start_datetime, $end_datetime, $exceptions, $timezone, $additions); $dates = date_repeat_calc($rrule, $start_datetime, $end_datetime, $exceptions, $timezone, $additions);
$value = array(); $value = array();
foreach ($dates as $delta => $date) { foreach ($dates as $delta => $date) {
...@@ -301,7 +300,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f ...@@ -301,7 +300,7 @@ function date_ical_build_repeating_dates($rrule = NULL, $rrule_values = NULL, $f
function date_ical_get_location_fields($base = 'node', $reset = FALSE) { function date_ical_get_location_fields($base = 'node', $reset = FALSE) {
static $fields = array(); static $fields = array();
$empty = array('name' => array(), 'alias' => array()); $empty = array('name' => array(), 'alias' => array());
if (empty($fields[$base]) || $reset) { if (empty($fields[$base]) || $reset) {
$cid = 'date_ical_location_fields_' . $base; $cid = 'date_ical_location_fields_' . $base;
if (!$reset && $cached = cache_get($cid, 'cache_views')) { if (!$reset && $cached = cache_get($cid, 'cache_views')) {
......
...@@ -20,7 +20,7 @@ abstract class DateIcalFeedsParser extends FeedsParser { ...@@ -20,7 +20,7 @@ abstract class DateIcalFeedsParser extends FeedsParser {
* ); * );
*/ */
static protected $sources; static protected $sources;
/** /**
* Implementation of FeedsParser::getMappingSources(). * Implementation of FeedsParser::getMappingSources().
*/ */
...@@ -39,7 +39,7 @@ abstract class DateIcalFeedsParser extends FeedsParser { ...@@ -39,7 +39,7 @@ abstract class DateIcalFeedsParser extends FeedsParser {
// Call parent::getMappingSources() to trigger additional target creation. // Call parent::getMappingSources() to trigger additional target creation.
return $sources + parent::getMappingSources(); return $sources + parent::getMappingSources();
} }
/** /**
* Override FeedsParser::getSourceElement(). * Override FeedsParser::getSourceElement().
*/ */
...@@ -48,7 +48,7 @@ abstract class DateIcalFeedsParser extends FeedsParser { ...@@ -48,7 +48,7 @@ abstract class DateIcalFeedsParser extends FeedsParser {
if (substr($property_key, 0, 7) == 'parent:') { if (substr($property_key, 0, 7) == 'parent:') {
return parent::getSourceElement($source, $result, $property_key); return parent::getSourceElement($source, $result, $property_key);
} }
// Otherwise retrieve the current DateIcalComponent from the DateIcalParserResult. // Otherwise retrieve the current DateIcalComponent from the DateIcalParserResult.
if ($item = $result->currentItem()) { if ($item = $result->currentItem()) {
if ($position = strpos($property_key, ':')) { if ($position = strpos($property_key, ':')) {
...@@ -82,7 +82,7 @@ interface DateIcalComponentInterface { ...@@ -82,7 +82,7 @@ interface DateIcalComponentInterface {
class DateIcalParserResult extends FeedsParserResult { class DateIcalParserResult extends FeedsParserResult {
// Feed extension timezone (X-WR-TIMEZONE) // Feed extension timezone (X-WR-TIMEZONE)
public $timezone; public $timezone;
// Feed RFC 5545 timezones; we can't use these at // Feed RFC 5545 timezones; we can't use these at
// present, only PHP timezonedb tz will be actually recognized. // present, only PHP timezonedb tz will be actually recognized.
// So this is more here as reminder/explanation. // So this is more here as reminder/explanation.
......
...@@ -70,7 +70,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -70,7 +70,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
'date_ical_parse_handler' => 'formatCategories', 'date_ical_parse_handler' => 'formatCategories',
), ),
); );
/** /**
* Load and run parser implementation of FeedsParser::parse(). * Load and run parser implementation of FeedsParser::parse().
* *
...@@ -78,19 +78,20 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -78,19 +78,20 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
*/ */
public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) { public function parse(FeedsSource $source, FeedsFetcherResult $fetcher_result) {
self::loadLibrary(); self::loadLibrary();
// Get the path to the temporary file created by the feed download. // Get the path to the temporary file created by the feed download.
$filename = $fetcher_result->getFilePath(); $filename = $fetcher_result->getFilePath();
$config = $source->getConfig();
// //
// Create the calendar object and parse the file. // Create the calendar object and parse the file.
// //
$config = array( $config = array(
'unique_id' => '', // do we need one for incoming parsing? 'unique_id' => '', // do we need one for incoming parsing?
'url' => $filename, // it's a stream wrapper, so url 'filename' => $config['FeedsHTTPFetcher']['source'],
); );
$calendar = new vcalendar($config); $calendar = new vcalendar($config);
if (!$calendar->parse()) { if (!$calendar->parse($fetcher_result->getRaw())) {
throw new DateIcalParseException(t('Error parsing %source iCal file %file', array('%source' => 'todo', '%file' => $filename))); throw new DateIcalParseException(t('Error parsing %source iCal file %file', array('%source' => 'todo', '%file' => $filename)));
} }
...@@ -105,14 +106,14 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -105,14 +106,14 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
// Set a result object. // Set a result object.
// //
$result = new DateIcalParserResult(); $result = new DateIcalParserResult();
// FeedsResult properties // FeedsResult properties
$xcalname = $calendar->getProperty('X-WR-CALNAME'); $xcalname = $calendar->getProperty('X-WR-CALNAME');
$result->title = !empty($xcalname) ? $xcalname[1] : ''; $result->title = !empty($xcalname) ? $xcalname[1] : '';
$xcaldesc = $calendar->getProperty('X-WR-CALDESC'); $xcaldesc = $calendar->getProperty('X-WR-CALDESC');
$result->description = !empty($xcaldesc) ? $xcaldesc[1] : ''; $result->description = !empty($xcaldesc) ? $xcaldesc[1] : '';
$result->link = NULL; $result->link = NULL;
// Additional DateIcalParserResult properties // Additional DateIcalParserResult properties
$xtimezone = $calendar->getProperty('X-WR-TIMEZONE'); $xtimezone = $calendar->getProperty('X-WR-TIMEZONE');
if (!empty($xtimezone)) { if (!empty($xtimezone)) {
...@@ -130,7 +131,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -130,7 +131,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
$components[$component->getProperty('tzid')] = new DateIcalIcalcreatorComponent($component); $components[$component->getProperty('tzid')] = new DateIcalIcalcreatorComponent($component);
} }
$result->timezones = $components; $result->timezones = $components;
// Separate the individual feed items into DateIcalIcalcreatorComponent objects, to be treated as // Separate the individual feed items into DateIcalIcalcreatorComponent objects, to be treated as
// separate parsed elements. // separate parsed elements.
$components = array(); $components = array();
...@@ -152,16 +153,16 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -152,16 +153,16 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
} }
} }
$result->items = $components; $result->items = $components;
return $result; return $result;
} }
/****** /******
* Source output formatters. * Source output formatters.
* *
* Could be in a class of their own? * Could be in a class of their own?
**/ **/
/** /**
* Format text fields. * Format text fields.
* *
...@@ -174,7 +175,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -174,7 +175,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
// Allow modules to alter the text before it's mapped to the target. // Allow modules to alter the text before it's mapped to the target.
drupal_alter('date_ical_feeds_object', $text, $context); drupal_alter('date_ical_feeds_object', $text, $context);
return $text; return $text;
} }
...@@ -192,10 +193,10 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -192,10 +193,10 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
// Allow modules to alter the param text before it's mapped to the target. // Allow modules to alter the param text before it's mapped to the target.
drupal_alter('date_ical_feeds_object', $text, $context); drupal_alter('date_ical_feeds_object', $text, $context);
return $text; return $text;
} }
/** /**
* Format date fields. * Format date fields.
* *
...@@ -209,7 +210,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -209,7 +210,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
if (isset($property['params']['TZID'])) { if (isset($property['params']['TZID'])) {
$date_array['tz'] = $property['params']['TZID']; $date_array['tz'] = $property['params']['TZID'];
} }
if (isset($property['params']['VALUE']) && $property['params']['VALUE'] == 'DATE') { if (isset($property['params']['VALUE']) && $property['params']['VALUE'] == 'DATE') {
/** /**
* DATE values are All Day events, with no time-of-day. * DATE values are All Day events, with no time-of-day.
...@@ -227,12 +228,12 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -227,12 +228,12 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
$start_array['tz'] = $start_prop['params']['TZID']; $start_array['tz'] = $start_prop['params']['TZID'];
} }
// On single-day All Day events (the start date + 1 = the end date), just ignore the DTEND
// if the Date All Day module is installed. Otherwise it'll be displayed strangely.
if ($start_array['year'] == $date_array['year'] if ($start_array['year'] == $date_array['year']
&& $start_array['month'] == $date_array['month'] && $start_array['month'] == $date_array['month']
&& $start_array['day'] + 1 == $date_array['day'] && $start_array['day'] + 1 == $date_array['day']
&& module_exists('date_all_day')) { && module_exists('date_all_day')) {
// On single-day All Day events (the start date + 1 = the end date), just ignore the DTEND
// if the Date All Day module is installed. Otherwise it'll be displayed strangely.
return; return;
} }
} }
...@@ -262,10 +263,14 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -262,10 +263,14 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
else { else {
// Date with time. // Date with time.
$date_string = iCalUtilityFunctions::_format_date_time($date_array); $date_string = iCalUtilityFunctions::_format_date_time($date_array);
$tz = NULL; $tz = NULL;
if (isset($date_array['tz'])) { if (isset($date_array['tz'])) {
$tz = $date_array['tz']; // 'Z' == 'Zulu' == 'UTC'. DateTimeZone won't acept Z, so change it to UTC.
if (strtoupper($date_array['tz']) == 'Z') {
$date_array['tz'] = 'UTC';
}
$tz = new DateTimeZone($date_array['tz']);
} }
else { else {
// If there was no timezone in the date array itself, add one if we have one. // If there was no timezone in the date array itself, add one if we have one.
...@@ -301,7 +306,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -301,7 +306,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
return $parsed_datetime; return $parsed_datetime;
} }
/** /**
* Format Categories * Format Categories
* *
...@@ -351,7 +356,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -351,7 +356,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
$rdate = $item->getRdate(); $rdate = $item->getRdate();
return trim("$rrule\n$exdate\n$rdate"); return trim("$rrule\n$exdate\n$rdate");
} }
/** /**
* Load the iCalcreator library. * Load the iCalcreator library.
*/ */
...@@ -367,7 +372,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser { ...@@ -367,7 +372,7 @@ class DateIcalIcalcreatorParser extends DateIcalFeedsParser {
class DateIcalIcalcreatorComponent implements DateIcalComponentInterface { class DateIcalIcalcreatorComponent implements DateIcalComponentInterface {
protected $component; protected $component;
private $_serialized_component; private $_serialized_component;
/** /**
* Constructor. * Constructor.
* *
...@@ -377,7 +382,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface { ...@@ -377,7 +382,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface {
public function __construct(calendarComponent $component) { public function __construct(calendarComponent $component) {
$this->component = $component; $this->component = $component;
} }
/** /**
* Serialization helper. * Serialization helper.
*/ */
...@@ -385,7 +390,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface { ...@@ -385,7 +390,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface {
$this->_serialized_component = serialize($this->component); $this->_serialized_component = serialize($this->component);
return array('_serialized_component'); return array('_serialized_component');
} }
/** /**
* Unserialization helper. * Unserialization helper.
*/ */
...@@ -393,15 +398,15 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface { ...@@ -393,15 +398,15 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface {
DateIcalIcalcreatorParser::loadLibrary(); DateIcalIcalcreatorParser::loadLibrary();
$this->component = unserialize($this->_serialized_component); $this->component = unserialize($this->_serialized_component);
} }
public function getComponentType() { public function getComponentType() {
return $this->component->objName; return $this->component->objName;
} }
public function getProperty($name) { public function getProperty($name) {
return $this->component->getProperty($name, FALSE, TRUE); return $this->component->getProperty($name, FALSE, TRUE);
} }
// $args should be an array of arguments to be sent to the set$Name() // $args should be an array of arguments to be sent to the set$Name()
// function of calendarComponent. If $args is not an array, it'll be // function of calendarComponent. If $args is not an array, it'll be
// wrapped as one. This is necessary because the iCalcreator API has different // wrapped as one. This is necessary because the iCalcreator API has different
...@@ -424,7 +429,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface { ...@@ -424,7 +429,7 @@ class DateIcalIcalcreatorComponent implements DateIcalComponentInterface {
public function getRrule() { public function getRrule() {
return trim($this->component->createRrule()); return trim($this->component->createRrule());
} }
public function setRdate($rdate) { public function setRdate($rdate) {
return $this->component->rdate[0] = $rdate; return $this->component->rdate[0] = $rdate;
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
*/ */
function date_ical_views_plugins() { function date_ical_views_plugins() {
$includes_path = drupal_get_path('module', 'date_ical') . '/includes'; $includes_path = drupal_get_path('module', 'date_ical') . '/includes';
$data = array( $data = array(
'module' => 'date_ical', // This just tells our themes are elsewhere. 'module' => 'date_ical', // This just tells our themes are elsewhere.
'style' => array( 'style' => array(
......
...@@ -84,7 +84,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -84,7 +84,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$rows[] = $this->row_plugin->render($row); $rows[] = $this->row_plugin->render($row);
} }
unset($this->view->row_index); unset($this->view->row_index);
// Try to load the iCalcreator library, and check if that worked. // Try to load the iCalcreator library, and check if that worked.
$library = libraries_load('iCalcreator'); $library = libraries_load('iCalcreator');
if (!empty($library['loaded'])) { if (!empty($library['loaded'])) {
...@@ -110,7 +110,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -110,7 +110,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
if (!$this->_get_option('no_calname')) { if (!$this->_get_option('no_calname')) {
$vcalendar->setProperty('x-wr-calname', $cal_name, array('VALUE' => 'TEXT')); $vcalendar->setProperty('x-wr-calname', $cal_name, array('VALUE' => 'TEXT'));
} }
// Now add the VEVENTs. // Now add the VEVENTs.
$timezones = array(); $timezones = array();
foreach ($rows as $row) { foreach ($rows as $row) {
...@@ -141,10 +141,10 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -141,10 +141,10 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$start['second'], $start['second'],
$timezone); $timezone);
} }
// Add the Timezone info to the start date, for use later. // Add the Timezone info to the start date, for use later.
$start['tz'] = $row['start']->getTimezone(); $start['tz'] = $row['start']->getTimezone();
// Only add the end date if there is one. // Only add the end date if there is one.
if (!empty($row['end'])) { if (!empty($row['end'])) {
$end = $row['end']->toArray(); $end = $row['end']->toArray();
...@@ -170,7 +170,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -170,7 +170,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
} }
$vevent->setProperty('uid', $row['uid']); $vevent->setProperty('uid', $row['uid']);
$vevent->setProperty('summary', $row['summary']); $vevent->setProperty('summary', $row['summary']);
// Handle repeating dates from the date_repeat module. // Handle repeating dates from the date_repeat module.
if (!empty($row['rrule']) && module_exists('date_repeat')) { if (!empty($row['rrule']) && module_exists('date_repeat')) {
// Split the rrule into the actual rule, exceptions and additions. // Split the rrule into the actual rule, exceptions and additions.
...@@ -207,7 +207,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -207,7 +207,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
$add = date_ical_date($addition, 'UTC'); $add = date_ical_date($addition, 'UTC');
date_timezone_set($add, $start['tz']); date_timezone_set($add, $start['tz']);
$addition_array = $add->toArray(); $addition_array = $add->toArray();
$add_date = array( $add_date = array(
'year' => $addition_array['year'], 'year' => $addition_array['year'],
'month' => $addition_array['month'], 'month' => $addition_array['month'],
...@@ -232,7 +232,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -232,7 +232,7 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
'tz' => $end['tz']->getName(), 'tz' => $end['tz']->getName(),
); );
} }
$add_dates[] = $add_date; $add_dates[] = $add_date;
} }
// Add the additions as 'RDATE's. // Add the additions as 'RDATE's.
...@@ -264,15 +264,15 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -264,15 +264,15 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
// Allow other modules to alter the VEVENT object. // Allow other modules to alter the VEVENT object.
drupal_alter('date_ical_feed_ical_vevent_render', $vevent, $this->view, $row); drupal_alter('date_ical_feed_ical_vevent_render', $vevent, $this->view, $row);
} }
// Now add all the timezones we just used to the calendar. // Now add all the timezones we just used to the calendar.
foreach ($timezones as $timezone) { foreach ($timezones as $timezone) {
iCalUtilityFunctions::createTimezone($vcalendar, $timezone); iCalUtilityFunctions::createTimezone($vcalendar, $timezone);
} }
// Allow other modules to alter the calendar as a whole. // Allow other modules to alter the calendar as a whole.
drupal_alter('date_ical_feed_ical_vcalendar_render', $vcalendar, $this->view); drupal_alter('date_ical_feed_ical_vcalendar_render', $vcalendar, $this->view);
$output = $vcalendar->createCalendar(); $output = $vcalendar->createCalendar();
} }
else { else {
...@@ -327,7 +327,6 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style { ...@@ -327,7 +327,6 @@ class date_ical_plugin_style_ical_feed extends views_plugin_style {
} }
$value = $new_byday; $value = $new_byday;
} }
$new_rrule[$key] = $value; $new_rrule[$key] = $value;
} }
return $new_rrule; return $new_rrule;
......
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