Changeset View
Changeset View
Standalone View
Standalone View
plugins/calendar/drivers/kolab/kolab_driver.php
Show First 20 Lines • Show All 1,778 Lines • ▼ Show 20 Lines | public function get_recurring_events($event, $start, $end = null) | ||||
return $storage->get_recurring_events($event, $start, $end); | return $storage->get_recurring_events($event, $start, $end); | ||||
} | } | ||||
/** | /** | ||||
* | * | ||||
*/ | */ | ||||
private function get_recurrence_count($event, $dtstart) | private function get_recurrence_count($event, $dtstart) | ||||
{ | { | ||||
// load the given event data into a libkolabxml container | |||||
if (!$event['_formatobj']) { | |||||
$event_xml = new kolab_format_event(); | |||||
$event_xml->set($event); | |||||
$event['_formatobj'] = $event_xml; | |||||
} | |||||
// use libkolab to compute recurring events | // use libkolab to compute recurring events | ||||
if (class_exists('kolabcalendaring') && $event['_formatobj']) { | |||||
$recurrence = new kolab_date_recurrence($event['_formatobj']); | $recurrence = new kolab_date_recurrence($event['_formatobj']); | ||||
} | |||||
else { | |||||
// fallback to local recurrence implementation | |||||
require_once($this->cal->home . '/lib/calendar_recurrence.php'); | |||||
$recurrence = new calendar_recurrence($this->cal, $event); | |||||
} | |||||
$count = 0; | $count = 0; | ||||
while (($next_event = $recurrence->next_instance()) && $next_event['start'] <= $dtstart && $count < 1000) { | while (($next_event = $recurrence->next_instance()) && $next_event['start'] <= $dtstart && $count < 1000) { | ||||
$count++; | $count++; | ||||
} | } | ||||
return $count; | return $count; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 735 Lines • Show Last 20 Lines |