Révision 62e0cc08
Ajouté par Assos Assos il y a plus de 3 ans
drupal7/sites/all/modules/date_ical/includes/date_ical_plugin_style_ical_feed.inc | ||
---|---|---|
27 | 27 |
} |
28 | 28 |
$url_options['absolute'] = TRUE; |
29 | 29 |
|
30 |
$url = url($this->view->get_url(NULL, $path), $url_options); |
|
30 |
// Only add arguments to ical path for the contextual filters in the feed display. |
|
31 |
// Clone view to prevent affecting the page view where this is attached. |
|
32 |
$clone = $this->view->clone_view(); |
|
33 |
$clone->set_display($this->display->id); |
|
34 |
$contextual_filters = $clone->get_items('argument'); |
|
35 |
$arg_number = count($contextual_filters); |
|
36 |
|
|
37 |
// Only include as many arguments as the feed display supports. |
|
38 |
foreach($clone->args as $key => $arg) { |
|
39 |
if ($key >= $arg_number) { |
|
40 |
unset($clone->args[$key]); |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
$url = url($clone->get_url(NULL, $path), $url_options); |
|
45 |
|
|
31 | 46 |
// If the user didn't disable the option, change the scheme to webcal:// |
32 | 47 |
// so calendar clients can automatically subscribe via the iCal link. |
33 | 48 |
if (!$this->_get_option('disable_webcal')) { |
34 | 49 |
$url = str_replace(array('http://', 'https://'), 'webcal://', $url); |
35 | 50 |
} |
36 | 51 |
|
37 |
// Render the feed icon and header tag (except during a View Preview). |
|
38 |
if (empty($this->view->live_preview)) { |
|
52 |
// Render the feed icon and header tag (except during a View Preview and |
|
53 |
// if the display is disabled). |
|
54 |
if (empty($this->view->live_preview) && (!isset($this->display->display_options['enabled']) || $this->display->display_options['enabled'])) { |
|
39 | 55 |
$tooltip = t('Add to My Calendar'); |
40 | 56 |
if (!isset($this->view->feed_icon)) { |
41 | 57 |
// In PHP 5.5, you're not allowed to concatinate onto an unset |
... | ... | |
274 | 290 |
// The spec supports putting multiple date values into one EXDATE, |
275 | 291 |
// but several popular calendar clients (*cough* Apple *cough*) |
276 | 292 |
// are bugged, and do not recognize multi-value EXDATEs. |
293 |
$value = $event['all_day'] == 1 ? "DATE" : "DATE-TIME"; |
|
277 | 294 |
foreach ($exdates as $exdate) { |
278 |
$vevent->setExdate(array($exdate)); |
|
295 |
$vevent->setExdate(array($exdate), array( "VALUE" => $value ));
|
|
279 | 296 |
} |
280 | 297 |
} |
281 | 298 |
|
... | ... | |
338 | 355 |
if (!empty($event['description'])) { |
339 | 356 |
$vevent->setDescription($event['description']); |
340 | 357 |
} |
358 |
if (!empty($event['categories'])) { |
|
359 |
$vevent->setCategories($event['categories']); |
|
360 |
} |
|
341 | 361 |
if (!empty($event['last-modified'])) { |
342 | 362 |
$lm = $event['last-modified']->toArray(); |
343 | 363 |
$vevent->setLastModified( |
Formats disponibles : Unified diff
Weekly update of contrib modules