1;
}
$output = [];
if (is_array($dates['regular']['turnus_data'])) {
foreach ($dates['regular']['turnus_data'] as $cycle) {
$first_date = sprintf(
_('ab %s'),
strftime('%x', $cycle['first_date']['date'])
);
$cycle_output = $cycle['tostring'] . ' (' . $first_date . ')';
if ($cycle['desc']) {
$cycle_output .= ', ' . htmlReady($cycle['desc']) . '';
}
if ($show_room) {
$cycle_output .= $this->render_partial('dates/_seminar_rooms', [
'assigned' => $cycle['assigned_rooms'],
'freetext' => $cycle['freetext_rooms'],
'link' => $link
]);
}
$output[] = $cycle_output;
}
}
echo implode('
', $output);
echo $output ? '
' : '';
$freetext_rooms = [];
$irregular_rooms = [];
if (isset($dates['irregular']) && is_array($dates['irregular'])) {
foreach ($dates['irregular'] as $date) {
$irregular[] = $date;
$irregular_strings[] = $date['tostring'];
if ($date['resource_id']) {
if (!isset($irregular_rooms[$date['resource_id']])) {
$irregular_rooms[$date['resource_id']] = 0;
}
$irregular_rooms[$date['resource_id']]++;
} elseif ($date['raum']) {
if (!isset($freetext_rooms[$date['raum']])) {
$freetext_rooms[$date['raum']] = 0;
}
$freetext_rooms[$date['raum']]++;
}
}
// Remove invalid entry if present
unset($irregular_rooms['']);
if (is_array($irregular) && sizeof($irregular)) {
$dates = shrink_dates($irregular);
echo _("Termine am");
if (is_array($dates)) {
if (count($dates) > 10) {
echo implode(', ', array_slice($dates, 0, 10));
echo '';
echo ', ';
echo implode(', ', array_slice($dates, 10));
echo '';
echo ' ...';
echo '(' ._('mehr'). ')';
} else {
$string = implode(', ', $dates);
if (mb_strlen($string) > 222) {
echo mb_substr($string,0, 128);
echo '';
echo mb_substr($string, -1, 1) != ','? ', ' : ' ';
echo mb_substr($string, 128);
echo '';
echo ' ...';
echo '(' ._('mehr'). ')';
} else {
echo $string;
}
}
}
if ($show_room) {
echo $this->render_partial('dates/_seminar_rooms', array(
'assigned' => $irregular_rooms,
'freetext' => $freetext_rooms,
'link' => $link,
'prefix' => count($dates) > 10 ? '
' : ', ',
'hide_empty' => true,
));
}
}
}
if (!empty($link_to_dates)) {
echo '
';
printf(
_('Details zu allen Terminen im %sAblaufplan%s'),
'',
''
);
}
}