2016-10-16 21:50:09 +03:00
|
|
|
<?php
|
2023-10-16 21:14:47 +03:00
|
|
|
require 'php-8.1-strftime.php';
|
|
|
|
use function PHP81_BC\strftime;
|
|
|
|
|
2016-10-16 21:50:09 +03:00
|
|
|
function parseData($config, $data) {
|
|
|
|
$languages = array(
|
|
|
|
'en' => array(
|
|
|
|
'name' => 'English',
|
|
|
|
'locale' => 'en_US.UTF8'
|
|
|
|
),
|
|
|
|
'bg' => array(
|
|
|
|
'name' => 'Български',
|
|
|
|
'locale' => 'bg_BG.UTF8'
|
|
|
|
)
|
|
|
|
);
|
2023-10-16 21:21:55 +03:00
|
|
|
|
|
|
|
if ($data === false) return false;
|
2018-09-11 17:08:39 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// We need to set these so we actually parse properly the dates. WP fucks up both.
|
|
|
|
date_default_timezone_set('Europe/Sofia');
|
|
|
|
setlocale(LC_TIME, $languages[$config['lang']]['locale']);
|
|
|
|
|
|
|
|
// Filter out invalid slots
|
2016-10-22 03:30:31 +03:00
|
|
|
$data['slots'] = array_filter($data['slots'], function($slot) {
|
|
|
|
return isset($slot['starts_at'], $slot['ends_at'], $slot['hall_id'], $slot['event_id']);
|
|
|
|
});
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
// Collect the slots for each hall, sort them in order of starting
|
|
|
|
$slots = [];
|
|
|
|
$timestamps = [];
|
2017-10-20 01:28:13 +03:00
|
|
|
|
|
|
|
$filtered_type_id =
|
|
|
|
array_key_exists('filterEventType', $config) &&
|
|
|
|
array_key_exists($config['filterEventType'], $config['eventTypes']) ?
|
|
|
|
$config['eventTypes'][$config['filterEventType']] :
|
|
|
|
null;
|
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
foreach ($data['halls'] as $hall_id => $hall) {
|
2016-10-23 23:16:13 +03:00
|
|
|
$slots[$hall_id] = [];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
foreach ($data['slots'] as $slot_id => $slot) {
|
|
|
|
if ($slot['hall_id'] !== $hall_id) {
|
|
|
|
continue;
|
|
|
|
}
|
2017-10-20 01:28:13 +03:00
|
|
|
|
|
|
|
$eid = $slot['event_id'];
|
|
|
|
$etype = $data['events'][$eid]['event_type_id'];
|
2018-10-16 13:07:52 +03:00
|
|
|
if ($etype !== $filtered_type_id && !is_null($filtered_type_id)) {
|
2017-10-20 01:28:13 +03:00
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if (!in_array($slot['starts_at'], $timestamps)) {
|
|
|
|
$timestamps[] = $slot['starts_at'];
|
2016-10-22 03:23:29 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if (!in_array($slot['ends_at'], $timestamps)) {
|
|
|
|
$timestamps[] = $slot['ends_at'];
|
2016-10-22 03:23:29 +03:00
|
|
|
}
|
2016-10-23 23:16:13 +03:00
|
|
|
|
|
|
|
$slots[$hall_id][$slot['starts_at']] = $slot;
|
2016-10-22 03:23:29 +03:00
|
|
|
}
|
2016-10-23 23:16:13 +03:00
|
|
|
ksort($slots[$hall_id]);
|
2017-10-20 01:28:13 +03:00
|
|
|
if (empty($slots[$hall_id])) unset($slots[$hall_id]);
|
2016-10-22 03:23:29 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
sort($timestamps);
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// Find all microslots (the smallest time unit)
|
2016-10-23 23:16:13 +03:00
|
|
|
$microslots = [];
|
2016-10-22 03:23:29 +03:00
|
|
|
$lastTs = 0;
|
|
|
|
$first = true;
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
foreach ($timestamps as $ts) {
|
2016-10-22 03:23:29 +03:00
|
|
|
if ($first) {
|
|
|
|
$lastTs = $ts;
|
|
|
|
$first = false;
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
if (date('d.m', $lastTs) !== date('d.m', $ts)) {
|
2016-10-22 03:23:29 +03:00
|
|
|
$lastTs = $ts;
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$microslots[] = [$lastTs, $ts];
|
2016-10-22 03:23:29 +03:00
|
|
|
$lastTs = $ts;
|
|
|
|
}
|
2016-10-22 19:09:03 +03:00
|
|
|
// Fill in the event ID for each time slot in each hall
|
2016-10-23 23:16:13 +03:00
|
|
|
$events = [];
|
2016-10-24 00:16:00 +03:00
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
foreach ($data['halls'] as $hall_id => $hall) {
|
|
|
|
$hall_data = [];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
foreach ($microslots as $timestamps) {
|
2016-10-22 03:23:29 +03:00
|
|
|
$found = false;
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
foreach ($data['slots'] as $slot_id => $slot) {
|
|
|
|
if (
|
|
|
|
$slot['hall_id'] === $hall_id &&
|
|
|
|
$slot['starts_at'] <= $timestamps[0] &&
|
2016-10-23 23:16:13 +03:00
|
|
|
$slot['ends_at'] >= $timestamps[1] &&
|
|
|
|
array_key_exists($slot['event_id'], $data['events'])
|
2016-10-22 03:23:29 +03:00
|
|
|
) {
|
2016-10-24 00:16:00 +03:00
|
|
|
if (!is_null($filtered_type_id)) {
|
|
|
|
if ($data['events'][$slot['event_id']]['event_type_id'] !== $filtered_type_id) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
$found = true;
|
|
|
|
$hall_data[] = [
|
|
|
|
'event_id' => $slot['event_id'],
|
2016-10-24 00:34:15 +03:00
|
|
|
'hall_id' => $slot['hall_id'],
|
2016-10-22 03:23:29 +03:00
|
|
|
'edge' => $slot['starts_at'] === $timestamps[0] || $slot['ends_at'] === $timestamps[1],
|
|
|
|
];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 03:23:29 +03:00
|
|
|
if (!$found) {
|
|
|
|
$hall_data[] = null;
|
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2021-07-27 22:12:26 +03:00
|
|
|
$events[$hall_id] = $hall_data;
|
2016-10-22 03:23:29 +03:00
|
|
|
}
|
2016-10-24 00:34:15 +03:00
|
|
|
// Remove halls with no events after filtering
|
2022-09-29 15:21:15 +03:00
|
|
|
foreach ($events as $i => $val) {
|
2016-10-24 00:34:15 +03:00
|
|
|
$hasEvents = false;
|
|
|
|
foreach ($events[$i] as $event_info) {
|
|
|
|
if (!is_null($event_info)) {
|
|
|
|
$hasEvents = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!$hasEvents) {
|
|
|
|
unset($events[$i]);
|
|
|
|
}
|
|
|
|
}
|
2016-10-23 23:16:13 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// Transpose the matrix
|
|
|
|
// rows->halls, cols->timeslots ===> rows->timeslots, cols->halls
|
2016-10-23 23:16:13 +03:00
|
|
|
$events = array_map(null, ...$events);
|
|
|
|
|
|
|
|
// Filter empty slots
|
2022-09-29 15:21:15 +03:00
|
|
|
foreach($events as $i => $val) {
|
2016-10-23 23:16:13 +03:00
|
|
|
$hall_count = count($events[$i]);
|
|
|
|
$hasEvents = false;
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
for ($j = 0; $j < $hall_count; ++$j) {
|
|
|
|
if (!is_null($events[$i][$j]) && $events[$i][$j]['edge']) {
|
|
|
|
$hasEvents = true;
|
|
|
|
continue 2;
|
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if (!$hasEvents) {
|
|
|
|
unset($events[$i]);
|
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
// Merge events longer than one slot
|
|
|
|
$prevEventId = [];
|
|
|
|
$prevEventSlot = [];
|
|
|
|
$prevSlotIndex = 0;
|
|
|
|
$first = true;
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
foreach ($events as $slot_index => &$events_data) {
|
|
|
|
if ($first) {
|
|
|
|
$prevEventId = array_map(function($event_info) {
|
|
|
|
return is_null($event_info) ? null : $event_info['event_id'];
|
|
|
|
}, $events_data);
|
|
|
|
$prevEventSlot = array_fill(0, count($events_data), null);
|
|
|
|
$prevSlotIndex = $slot_index;
|
|
|
|
$first = false;
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
foreach ($events_data as $hall_index => &$event_info) {
|
|
|
|
if (is_null($event_info)) {
|
|
|
|
$prevEventId[$hall_index] = null;
|
|
|
|
$prevEventSlot[$hall_index] = null;
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if ($event_info['event_id'] !== $prevEventId[$hall_index]) {
|
|
|
|
$prevEventId[$hall_index] = $event_info['event_id'];
|
|
|
|
$prevEventSlot[$hall_index] = null;
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
// We have a long event
|
|
|
|
if (is_null($prevEventSlot[$hall_index])) {
|
|
|
|
$prevEventSlot[$hall_index] = $prevSlotIndex;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$master_slot = &$events[$prevEventSlot[$hall_index]][$hall_index];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if (!array_key_exists('rowspan', $master_slot)) {
|
|
|
|
$master_slot['rowspan'] = 2;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
++$master_slot['rowspan'];
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
unset($master_slot);
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$event_info = false;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
unset($event_info);
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$prevSlotIndex = $slot_index;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
unset($events_data);
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// Build the HTML
|
2016-10-24 00:34:15 +03:00
|
|
|
$schedule_body = '';
|
2016-10-22 17:22:04 +03:00
|
|
|
$lastTs = 0;
|
2016-10-24 00:16:00 +03:00
|
|
|
$fulltalks = '';
|
2016-10-24 00:34:15 +03:00
|
|
|
$hall_ids = [];
|
2018-11-07 17:18:46 +02:00
|
|
|
$now = time();
|
|
|
|
|
2019-11-01 08:28:12 +02:00
|
|
|
$known_events = array();
|
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
foreach ($events as $slot_index => $events_data) {
|
2016-10-22 03:23:29 +03:00
|
|
|
$columns = [];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
if (date('d.m', $microslots[$slot_index][0]) !== date('d.m', $lastTs)) {
|
2016-10-24 00:34:15 +03:00
|
|
|
$schedule_body .= '<tr><th colspan="' . (count($events_data) + 1) . '">' . strftime('%d %B - %A', $microslots[$slot_index][0]) . '</th></tr>';
|
2016-10-22 17:22:04 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$lastTs = $microslots[$slot_index][0];
|
2016-10-22 17:22:04 +03:00
|
|
|
$lastEventId = 0;
|
2016-10-22 19:09:03 +03:00
|
|
|
$colspan = 1;
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:34:15 +03:00
|
|
|
foreach ($events_data as $event_info) {
|
2016-10-23 23:16:13 +03:00
|
|
|
if ($event_info === false) {
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
|
|
|
if (is_null($event_info) || is_null($event_info['event_id'])) {
|
2016-10-22 03:23:29 +03:00
|
|
|
$columns[] = '<td> </td>';
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:34:15 +03:00
|
|
|
if (!in_array($event_info['hall_id'], $hall_ids)) {
|
|
|
|
$hall_ids[] = $event_info['hall_id'];
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$eid = &$event_info['event_id'];
|
2016-10-22 19:09:03 +03:00
|
|
|
$event = &$data['events'][$eid];
|
2016-10-16 21:50:09 +03:00
|
|
|
|
2018-11-07 17:18:46 +02:00
|
|
|
# var_dump($microslots[$slot_index]);
|
2016-10-16 21:50:09 +03:00
|
|
|
$title = mb_substr($event['title'], 0, $config['cut_len']) . (mb_strlen($event['title']) > $config['cut_len'] ? '...' : '');
|
|
|
|
$speakers = '';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-16 21:50:09 +03:00
|
|
|
if (count($event['participant_user_ids']) > 0) {
|
2016-10-24 00:16:00 +03:00
|
|
|
$spk = [];
|
|
|
|
|
2016-10-16 21:50:09 +03:00
|
|
|
foreach ($event['participant_user_ids'] as $uid) {
|
2016-10-22 19:09:03 +03:00
|
|
|
if (in_array($uid, $config['hidden_speakers']) || empty($data['speakers'][$uid])) {
|
2016-10-16 21:50:09 +03:00
|
|
|
continue;
|
|
|
|
}
|
2016-10-22 19:09:03 +03:00
|
|
|
|
|
|
|
$name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name'];
|
2016-10-24 00:16:00 +03:00
|
|
|
$spk[] = '<a class="vt-p" href="#' . $name . '">' . $name . '</a>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-16 21:50:09 +03:00
|
|
|
$speakers = implode (', ', $spk);
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2018-11-07 17:18:46 +02:00
|
|
|
if ($microslots[$slot_index][0] < $now) {
|
|
|
|
// talk has already started. Provide feedback links
|
|
|
|
$fullfb = '<p align=right><strong><a href="https://cfp.openfest.org/events/' . $eid . '/feedback/new">'.pll__('Submit feedback').'</a></strong></p>';
|
|
|
|
$progfb = '<p><i><a href="https://cfp.openfest.org/events/' . $eid . '/feedback/new">'.pll__('Submit feedback').'</a></i></p>';
|
|
|
|
} else {
|
|
|
|
$fullfb = "";
|
|
|
|
$progfb = "";
|
|
|
|
}
|
2016-10-22 19:09:03 +03:00
|
|
|
$content = '<a href="#lecture-' . $eid . '">' . htmlspecialchars($title) . '</a><br>' . $speakers;
|
2016-10-16 21:50:09 +03:00
|
|
|
|
2022-09-28 13:53:17 +03:00
|
|
|
if (!isset($known_events[$eid])) {
|
|
|
|
//if (!in_array($data['events'][$event_info['event_id']]['track_id'], $config['hidden_language_tracks']) && !isset($known_events[$eid])) {
|
2018-10-16 13:08:18 +03:00
|
|
|
$fulltalks .= '<section id="lecture-' . $eid . '">';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2018-10-16 13:08:18 +03:00
|
|
|
// We don't want '()' when we don't have a speaker name
|
|
|
|
$fulltalk_spkr = strlen($speakers) > 0 ? (' (' . $speakers . ')') : '';
|
2022-10-16 15:23:01 +03:00
|
|
|
$fulltalks .= '<p><strong>' . htmlentities($event['title']) . ' ' . $fulltalk_spkr . '</strong></p>';
|
|
|
|
$fulltalks .= '<p>' . htmlentities($event['abstract']) . '</p>';
|
2018-11-07 17:18:46 +02:00
|
|
|
$fulltalks .= $fullfb;
|
2018-10-16 13:08:18 +03:00
|
|
|
$fulltalks .= '<div class="separator"></div></section>';
|
2019-11-01 08:28:12 +02:00
|
|
|
$known_events[$eid] = $eid;
|
2018-10-16 13:08:18 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
if ($eid === $lastEventId) {
|
|
|
|
array_pop($columns);
|
|
|
|
++$colspan;
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$colspan = 1;
|
|
|
|
}
|
2016-10-23 00:44:27 +03:00
|
|
|
|
2016-10-23 23:16:13 +03:00
|
|
|
$rowspan = array_key_exists('rowspan', $event_info) ? (' rowspan="' . $event_info['rowspan'] . '"') : '';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:16:00 +03:00
|
|
|
// CSS
|
|
|
|
$cssClasses = [];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:16:00 +03:00
|
|
|
if (!in_array($event['track_id'], $config['hidden_language_tracks'])) {
|
|
|
|
$cssClasses[] = 'schedule-' . $event['language'];
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:16:00 +03:00
|
|
|
$cssClass = $data['tracks'][$event['track_id']]['css_class'];
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:16:00 +03:00
|
|
|
if (strlen($cssClass) > 0) {
|
|
|
|
$cssClasses[] = $cssClass;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:16:00 +03:00
|
|
|
$cssClasses = count($cssClasses) > 0 ? (' class="' . implode(' ', $cssClasses) . '"') : '';
|
|
|
|
|
|
|
|
// Render cell
|
2018-11-07 17:18:46 +02:00
|
|
|
$columns[] = '<td' . ($colspan > 1 ? ' colspan="' . $colspan . '"' : $rowspan) . $cssClasses . '>' . $content . $progfb . '</td>';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
$lastEventId = $eid;
|
2016-10-24 00:16:00 +03:00
|
|
|
unset($eid, $event);
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:34:15 +03:00
|
|
|
$schedule_body .= '<tr><td>';
|
2023-10-16 21:13:16 +03:00
|
|
|
$schedule_body .= date('H:i', $microslots[$slot_index][0]) . ' - ' . date('H:i', $microslots[$slot_index][1]);
|
2016-10-24 00:34:15 +03:00
|
|
|
$schedule_body .= '</td>';
|
|
|
|
$schedule_body .= implode('', $columns);
|
|
|
|
$schedule_body .= '</tr>';
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 01:06:43 +03:00
|
|
|
$schedule = '<table cellpadding="0" cellspacing="0" style="text-align: center;" class="schedule"><thead><tr><th></th>';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:34:15 +03:00
|
|
|
foreach ($data['halls'] as $hall_id => $hall) {
|
|
|
|
if (!in_array($hall_id, $hall_ids)) {
|
|
|
|
continue;
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2017-10-20 01:01:37 +03:00
|
|
|
$schedule .= '<th>' . $hall[$config['lang']] . '</th>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-24 00:34:15 +03:00
|
|
|
$schedule .= '</tr></thead><tbody>';
|
|
|
|
$schedule .= $schedule_body;
|
2016-10-22 19:09:03 +03:00
|
|
|
$schedule .= '</tbody></table>';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// Create the legend
|
2016-10-19 21:49:50 +03:00
|
|
|
$legend = '';
|
2016-10-16 21:50:09 +03:00
|
|
|
|
2020-11-05 23:00:18 +02:00
|
|
|
foreach($data['tracks'] as $track_id => $track) {
|
|
|
|
if ( in_array($track_id, $config['hidden_language_tracks'])) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-10-19 21:49:50 +03:00
|
|
|
$legend .= '<tr><td class="' . $track['css_class'] . '">' . $track['name'][$config['lang']] . '</td></tr>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($languages as $code => $lang) {
|
2016-10-19 21:49:50 +03:00
|
|
|
$legend .= '<tr><td class="schedule-' . $code . '">' . $lang['name'] . '</td></tr>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-22 19:09:03 +03:00
|
|
|
// Speaker list
|
2016-10-19 21:49:50 +03:00
|
|
|
$gspk = '<div class="grid members">';
|
|
|
|
$fspk = '';
|
|
|
|
$types = [
|
|
|
|
'twitter' => [
|
|
|
|
'class' => 'twitter',
|
|
|
|
'url' => 'https://twitter.com/',
|
|
|
|
],
|
|
|
|
'github' => [
|
|
|
|
'class' => 'github',
|
|
|
|
'url' => 'https://github.com/',
|
|
|
|
],
|
|
|
|
'email' => [
|
|
|
|
'class' => 'envelope',
|
|
|
|
'url' => 'mailto:',
|
|
|
|
],
|
|
|
|
];
|
2016-10-16 21:50:09 +03:00
|
|
|
|
|
|
|
foreach ($data['speakers'] as $speaker) {
|
|
|
|
$name = $speaker['first_name'] . ' ' . $speaker['last_name'];
|
|
|
|
|
2016-10-19 21:49:50 +03:00
|
|
|
$gspk .= '<div class="member col4">';
|
|
|
|
$gspk .= '<a href="#' . $name . '">';
|
2016-10-22 03:23:29 +03:00
|
|
|
$gspk .= '<img width="100" height="100" src="' . $config['cfp_url'] . $speaker['picture']['schedule']['url'] . '" class="attachment-100x100 wp-post-image" alt="' . $name . '" />';
|
2016-10-19 21:49:50 +03:00
|
|
|
$gspk .= '</a> </div>';
|
2016-10-16 21:50:09 +03:00
|
|
|
|
2016-10-19 21:49:50 +03:00
|
|
|
$fspk .= '<div class="speaker" id="' . $name . '">';
|
2023-10-16 21:21:55 +03:00
|
|
|
$fspk .= '<img width="100" height="100" src="' . $config['cfp_url'] . $speaker['picture']['schedule']['url'] . '" class="attachment-100x100 wp-post-image" alt="' . $name . '" />';
|
2016-10-19 21:49:50 +03:00
|
|
|
$fspk .= '<h3>' . $name . '</h3>';
|
|
|
|
$fspk .= '<div class="icons">';
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-19 21:49:50 +03:00
|
|
|
foreach ($types as $type => $param) {
|
2016-10-16 21:50:09 +03:00
|
|
|
if (!empty($speaker[$type])) {
|
2016-10-19 21:49:50 +03:00
|
|
|
$fspk .= '<a href="' . $param['url'] . $speaker[$type] . '"><i class="fa fa-' . $param['class'] . '"></i></a>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
|
|
|
}
|
2023-10-16 21:21:55 +03:00
|
|
|
|
2016-10-19 21:49:50 +03:00
|
|
|
$fspk .= '</div>';
|
2022-10-16 15:23:01 +03:00
|
|
|
$fspk .= '<p>' . htmlentities($speaker['biography']) . '</p>';
|
2016-10-19 21:49:50 +03:00
|
|
|
$fspk .= '</div><div class="separator"></div>';
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|
|
|
|
|
2016-10-19 21:49:50 +03:00
|
|
|
$gspk .= '</div>';
|
2016-10-16 21:50:09 +03:00
|
|
|
|
2017-08-07 11:10:32 +03:00
|
|
|
return compact('slots', 'schedule', 'fulltalks', 'gspk', 'fspk', 'legend');
|
2016-10-16 21:50:09 +03:00
|
|
|
}
|