Updated ticker to support multible events a day

This commit is contained in:
Peder Bergebakken Sundt 2016-08-26 18:39:21 +02:00
parent e0fcf5f265
commit d7885ddfe6
1 changed files with 11 additions and 2 deletions

View File

@ -34,8 +34,17 @@ $agenda = new \pvv\side\Agenda([
<ul id="ticker">
<?php
foreach($agenda->getNextDays() as $period => $events) {
$event = reset($events);
echo '<li>' . strtoupper($translation[$period]) . ': <a href="' . $event->getURL() . '">' . $event->getName() . '</a>';
if (!$events) continue;
$first = true;
foreach($events as $event){
if (!$first){
echo '<i style="opacity:0.7;">&nbsp;og&nbsp;</i>';
} else {
echo '<li style="text-align: center;"><span style="text-transform: uppercase;">' . $translation[$period] . '</span>: ';
}
echo '<a href="' . $event->getURL() . '">' . $event->getName() . '</a>';
$first = false;
}
break;
}
?>