$slot) { $slotTime = $slot['starts_at']; $slotDate = date('d', $slotTime); if ($slotDate !== $date) { $lines[] = ''; $lines[] = '' . date('d F - l', $slotTime) . ''; $lines[] = ' '; $lines[] = ''; $date = $slotDate; } if ($slotTime !== $time) { if ($time !== 0) { $lines[] = ''; } $lines[] = ''; $lines[] = '' . date('H:i', $slot['starts_at']) . ' - ' . date('H:i', $slot['ends_at']) . ''; $time = $slotTime; } $eid = &$slot['event_id']; $event = &$data['events'][$eid]; if (is_null($eid)) { $lines[] = 'TBA'; } else { $title = mb_substr($event['title'], 0, $cut_len) . (mb_strlen($event['title']) > $cut_len ? '...' : ''); $speakers = ''; if (count($event['participant_user_ids']) > 0) { $speakers = json_encode($event['participant_user_ids']) . '
'; $spk = array(); $speaker_name = array(); foreach ($event['participant_user_ids'] as $uid) { /* The check for uid==4 is for us not to show the "Opefest Team" as a presenter for lunches, etc. */ if ($uid == 4 || empty ($data['speakers'][$uid])) { continue; } else { /* TODO: fix the URL */ $name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name']; $spk[$uid] = '' . $name . ''; } } $speakers = implode (', ', $spk); } /* Hack, we don't want language for the misc track. This is the same for all years. */ if ('misc' !== $data['tracks'][$event['track_id']]['name']['en']) { $csslang = "schedule-".$event['language']; } else { $csslang = ""; } $cssclass = &$data['tracks'][$event['track_id']]['css_class']; $style = ' class="' . $cssclass . ' ' . $csslang . '"'; $content = '' . htmlspecialchars($title) . '
' . $speakers; /* these are done by $eid, as otherwise we get some talks more than once (for example the lunch) */ $fulltalks[$eid] = ''; $fulltalks[$eid] .= '
'; /* We don't want '()' when we don't have a speaker name */ $fulltalk_spkr = strlen($speakers)>1 ? ' (' . $speakers . ')' : ''; $fulltalks[$eid] .= '

' . $event['title'] . ' ' . $fulltalk_spkr . ''; $fulltalks[$eid] .= '

' . $event['abstract'] . '

'; $fulltalks[$eid] .= '
'; if ($slot['event_id'] === $prev_event_id) { array_pop($lines); $lines[] = '' . $content . ''; } else { $lines[] = '' . $content . ''; $colspan = 1; } } $prev_event_id = $slot['event_id']; } $lines[] = ''; $gspk = []; $fspk = []; $types = []; $types['twitter']['url']='https://twitter.com/'; $types['twitter']['class']='fa fa-twitter'; $types['github']['url']='https://github.com/'; $types['github']['class']='fa fa-github'; $types['email']['url']='mailto:'; $types['email']['class']='fa fa-envelope'; $gspk[] = '
'; foreach ($data['speakers'] as $speaker) { $name = $speaker['first_name'] . ' ' . $speaker['last_name']; $gspk[] = ''; $fspk[] = '
'; $fspk[] = '' . $name .''; $fspk[] = '

' . $name . '

'; $fspk[] = '
'; foreach ($types as $type => $parm) { if (!empty($speaker[$type])) { $fspk[] = ''; } } $fspk[] = '
'; $fspk[] = '

' . $speaker['biography'] . '

'; $fspk[] = '
'; } $gspk[] = '
'; return array_merge($data, compact('lines', 'fulltalks', 'gspk', 'fspk'));