From 0e6b47259cac1cd128a889bd9a3792d6f5ffc5e9 Mon Sep 17 00:00:00 2001 From: Vasil Kolev Date: Wed, 7 Nov 2018 17:18:46 +0200 Subject: [PATCH] schedule: more visible (and translated) feedback link, shown after the event --- functions.php | 1 + schedule/parse.php | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/functions.php b/functions.php index 086f5d3..ba34a14 100644 --- a/functions.php +++ b/functions.php @@ -347,4 +347,5 @@ if (function_exists("pll_register_string")) { pll_register_string('high_quality','HIGH_QUALITY'); pll_register_string('all_streams','ALL_STREAMS'); pll_register_string('tba','TBA'); + pll_register_string('feedback','Submit feedback'); } diff --git a/schedule/parse.php b/schedule/parse.php index 7ada9d4..328f076 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -221,7 +221,8 @@ function parseData($config, $data) { $lastTs = 0; $fulltalks = ''; $hall_ids = []; - + $now = time(); + foreach ($events as $slot_index => $events_data) { $columns = []; @@ -250,6 +251,7 @@ function parseData($config, $data) { $eid = &$event_info['event_id']; $event = &$data['events'][$eid]; +# var_dump($microslots[$slot_index]); $title = mb_substr($event['title'], 0, $config['cut_len']) . (mb_strlen($event['title']) > $config['cut_len'] ? '...' : ''); $speakers = ''; @@ -268,6 +270,14 @@ function parseData($config, $data) { $speakers = implode (', ', $spk); } + if ($microslots[$slot_index][0] < $now) { + // talk has already started. Provide feedback links + $fullfb = '

'.pll__('Submit feedback').'

'; + $progfb = '

'.pll__('Submit feedback').'

'; + } else { + $fullfb = ""; + $progfb = ""; + } $content = '' . htmlspecialchars($title) . '
' . $speakers; // these are done by $eid, as otherwise we get some talks more than once (for example the lunch) @@ -280,9 +290,10 @@ function parseData($config, $data) { $fulltalk_spkr = strlen($speakers) > 0 ? (' (' . $speakers . ')') : ''; $fulltalks .= '

' . $event['title'] . ' ' . $fulltalk_spkr . '

'; $fulltalks .= '

' . $event['abstract'] . '

'; - $fulltalks .= '

Submit feedback

'; + $fulltalks .= $fullfb; $fulltalks .= '
'; } + if ($eid === $lastEventId) { array_pop($columns); ++$colspan; @@ -309,7 +320,7 @@ function parseData($config, $data) { $cssClasses = count($cssClasses) > 0 ? (' class="' . implode(' ', $cssClasses) . '"') : ''; // Render cell - $columns[] = ' 1 ? ' colspan="' . $colspan . '"' : $rowspan) . $cssClasses . '>' . $content . ''; + $columns[] = ' 1 ? ' colspan="' . $colspan . '"' : $rowspan) . $cssClasses . '>' . $content . $progfb . ''; $lastEventId = $eid; unset($eid, $event);