function get_freebusy_activities(&$user_focus, &$start_date_time, &$end_date_time) { $act_list = array(); $vcal_focus = new vCal(); $vcal_str = $vcal_focus->get_vcal_freebusy($user_focus); $lines = explode("\n", $vcal_str); foreach ($lines as $line) { $dates_arr = array(); if (preg_match('/^FREEBUSY.*?:([^\\/]+)\\/([^\\/]+)/i', $line, $matches)) { $dates_arr[] = DateTimeUtil::parse_utc_date_time($matches[1]); $dates_arr[] = DateTimeUtil::parse_utc_date_time($matches[2]); $act_list[] = new CalendarActivity($dates_arr); } } usort($act_list, 'sort_func_by_act_date'); return $act_list; }