diff --git a/schedule/index.php b/schedule/index.php index 06c8171..b6e78da 100644 --- a/schedule/index.php +++ b/schedule/index.php @@ -9,7 +9,7 @@ require $requirePath . 'load.php'; require $requirePath . 'parse.php'; $sched_config = getSchedConfig(date('Y')); $data = loadData($sched_config); -//$sched_config['filterEventType'] = 'workshop'; +$sched_config['filterEventType'] = array_key_exists('event_type', $_GET) ? $_GET['event_type'] : null; $content = parseData($sched_config, $data); ?> diff --git a/schedule/parse.php b/schedule/parse.php index 16b3571..3bca53c 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -1,12 +1,5 @@ array( 'name' => 'English', @@ -78,7 +71,12 @@ function parseData($config, $data) { // Fill in the event ID for each time slot in each hall $events = []; - + $filtered_type_id = + array_key_exists('filterEventType', $config) && + array_key_exists($config['filterEventType'], $config['eventTypes']) ? + $config['eventTypes'][$config['filterEventType']] : + null; + foreach ($data['halls'] as $hall_id => $hall) { $hall_data = []; @@ -92,6 +90,12 @@ function parseData($config, $data) { $slot['ends_at'] >= $timestamps[1] && array_key_exists($slot['event_id'], $data['events']) ) { + if (!is_null($filtered_type_id)) { + if ($data['events'][$slot['event_id']]['event_type_id'] !== $filtered_type_id) { + continue; + } + } + $found = true; $hall_data[] = [ 'event_id' => $slot['event_id'], @@ -196,6 +200,7 @@ function parseData($config, $data) { $schedule .= '
'; $lastTs = 0; + $fulltalks = ''; foreach ($events as $slot_index => $events_data) { $columns = []; @@ -225,32 +230,27 @@ function parseData($config, $data) { $speakers = ''; if (count($event['participant_user_ids']) > 0) { - $spk = array(); - $speaker_name = array(); + $spk = []; + foreach ($event['participant_user_ids'] as $uid) { if (in_array($uid, $config['hidden_speakers']) || empty($data['speakers'][$uid])) { continue; } $name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name']; - $spk[$uid] = '' . $name . ''; + $spk[] = '' . $name . ''; } + $speakers = implode (', ', $spk); } - if (in_array($event['track_id'], $config['hidden_language_tracks'])) { - $csslang = ''; - } else { - $csslang = 'schedule-' . $event['language']; - } - - $cssclass = &$data['tracks'][$event['track_id']]['css_class']; - $style = ' class="' . $cssclass . ' ' . $csslang . '"'; $content = '' . htmlspecialchars($title) . '' . $event['title'] . ' ' . $fulltalk_spkr . '
'; $fulltalks .= '' . $event['abstract'] . '
'; @@ -265,8 +265,27 @@ function parseData($config, $data) { } $rowspan = array_key_exists('rowspan', $event_info) ? (' rowspan="' . $event_info['rowspan'] . '"') : ''; - $columns[] = '