if (in_array($date['typ'], $presence_types) !== false) : $irregular[] = $date; $irregular_strings[] = $date['tostring']; if ($date['resource_id']) : $irregular_rooms[$date['resource_id']]++; elseif ($date['raum']) : $freetext_rooms['(' . htmlReady($date['raum']) . ')']++; endif; endif; endforeach; unset($irregular_rooms['']); $rooms = array_merge(getFormattedRooms($irregular_rooms, $link), array_keys($freetext_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 '<span class="more-dates-infos" style="display: none">'; echo ', '; echo implode(', ', array_slice($dates, 10)); echo '</span>'; echo '<span class="more-dates-digits"> ...</span>'; echo '<a class="more-dates" style="cursor: pointer; margin-left: 3px" title="' . _('Blenden Sie die restlichen Termine ein') . '">(' ._('mehr'). ')</a>'; else : $string = implode(', ', $dates);
elseif ($date['raum']) : $output_dates[$date['raum']][] = $date; endif; endforeach; // now shrink the dates for each room/freetext and add them to the output if (is_array($output_dates)) foreach ($output_dates as $dates) : if ($dates[0]['resource_id']) : $resObj = ResourceObject::Factory($dates[0]['resource_id']); if ($link) { $output[$resObj->getFormattedLink(TRUE, TRUE, TRUE)][] = implode('<br>', shrink_dates($dates)); } else { $output[htmlReady($resObj->getName())][] = implode('<br>', shrink_dates($dates)); } elseif ($dates[0]['raum']) : $output['('. htmlReady($dates[0]['raum']) .')'][] = implode('<br>', shrink_dates($dates)); endif; endforeach; ?> <? if (sizeof($output) == 0) : ?> <?php echo htmlReady($ort) ?: _("nicht angegeben"); ?> <? elseif (sizeof($output) == 1) : ?> <?php echo array_pop(array_keys($output)); ?> <? else: ?> <table class="default"> <? foreach ($output as $room => $dates) : ?>
if (in_array($date['typ'], $presence_types) !== false) : $irregular[] = $date; $irregular_strings[] = $date['tostring']; if ($date['resource_id']) : $irregular_rooms[$date['resource_id']]++; elseif ($date['raum']) : $freetext_rooms['('. $date['raum'] .')']++; endif; endif; endforeach; unset($irregular_rooms['']); echo sizeof($output) ? ", \n" : ''; $rooms = array_merge(getPlainRooms($irregular_rooms, false), array_keys($freetext_rooms)); if (is_array($irregular) && sizeof($irregular)) : echo _("Termine am") . implode(', ', shrink_dates($irregular)); if (is_array($rooms) && sizeof($rooms) > 0) : if (sizeof($rooms) > 3) : $rooms = array_slice($rooms, sizeof($rooms) - 3, sizeof($rooms)); endif; if ($show_room) : echo ', ' . _("Ort:") . ' '; echo implode(', ', $rooms); endif; endif; endif; endif; endif;
// condense irregular dates by room if (is_array($dates['irregular'])) foreach ($dates['irregular'] as $date) : if ($date['resource_id']) : $output_dates[$date['resource_id']][] = $date; elseif ($date['raum']) : $output_dates[$date['raum']][] = $date; endif; endforeach; // now shrink the dates for each room/freetext and add them to the output if (is_array($output_dates)) foreach ($output_dates as $dates) : if ($dates[0]['resource_id']) : $resObj = ResourceObject::Factory($dates[0]['resource_id']); $output[$resObj->getName()][] = implode(", ", shrink_dates($dates)); elseif ($dates[0]['raum']) : $output['('. $dates[0]['raum'] .')'][] = implode(", ", shrink_dates($dates)); endif; endforeach; if (sizeof($output) == 0) : echo _("nicht angegeben"); elseif (sizeof($output) == 1) : echo array_pop(array_keys($output)); else : $pos = 1; foreach ($output as $room => $dates) : echo $room .': '. implode("\n", $dates) . (sizeof($output) > $pos ? ', ' : '') . "\n"; $pos++; endforeach; endif;