blob: 283dda7041b31ed0eb6a636a9fb0c1aa79707db2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
<?php
/**
* @var CourseDate|CourseExDate|CalendarDateAssignment $termin
* @var bool $admin
* @var bool $isProfile
* @var bool $course_range
*/
?>
<article class="studip toggle <?= ContentBoxHelper::classes($termin->getObjectId()) ?>"
id="<?= htmlReady($termin->getObjectId()) ?>">
<header>
<h1>
<a href="<?= ContentBoxHelper::href($termin->getObjectId()) ?>">
<?= Icon::create('date', Icon::ROLE_INACTIVE)->asImg(['class' => 'text-bottom']) ?>
<?= htmlReady($titles[$termin->getObjectId()] ?? $termin->getTitle()) ?>
</a>
</h1>
<nav>
<span>
<? if ($termin instanceof CalendarDateAssignment): ?>
<?= $termin->getLocation() ? _('Raum') . ': ' . formatLinks($termin->getLocation()) : '' ?>
<? else: ?>
<?= $termin->getRoomNames() ? _('Raum') . ': ' . formatLinks($termin->getRoomNames()) : '' ?>
<? endif; ?>
</span>
<? if ($admin && $isProfile && $termin->getObjectClass() === 'CalendarDateAssignment') : ?>
<a href="<?= URLHelper::getLink('dispatch.php/calendar/calendar') ?>"
title="<?= _('Zum Kalender') ?>" aria-label="<?= _('Zum Kalender') ?>">
<?= Icon::create('schedule')->asImg(['class' => 'text-bottom']) ?>
</a>
<? if ($termin->calendar_date->isWritable($GLOBALS['user']->id)) : ?>
<a href="<?= URLHelper::getLink('dispatch.php/calendar/date/edit/' . $termin->getPrimaryObjectId()) ?>"
title="<?= _('Termin bearbeiten') ?>" aria-label="<?= _('Termin bearbeiten') ?>"
data-dialog>
<?= Icon::create('edit')->asImg(['class' => 'text-bottom']) ?>
</a>
<? endif ?>
<? elseif (!$course_range && in_array($termin->getObjectClass(), [CalendarCourseDate::class, CalendarCourseExDate::class])) : ?>
<a href="<?= URLHelper::getLink('dispatch.php/course/dates', ['cid' => $termin->getPrimaryObjectId()]) ?>"
title="<?= _('Zur Veranstaltung') ?>" aria-label="<?= _('Zur Veranstaltung') ?>">
<?= Icon::create('seminar')->asImg(['class' => 'text-bottom']) ?>
</a>
<? endif ?>
</nav>
</header>
<div>
<?
$themen = [];
if ($termin instanceof CourseDate) {
$themen = $termin->topics->toArray('title description');
}
$description = '';
if ($termin instanceof CourseExDate) {
$description = $termin->content;
} elseif ($termin instanceof CourseDate && isset($termin->cycle)) {
$description = $termin->cycle->description;
} elseif (empty($themen)) {
$description = $termin->getDescription();
}
?>
<? if ($description || count($themen) > 0) : ?>
<p><?= formatReady($description) ?></p>
<? if (count($themen)) : ?>
<? foreach ($themen as $thema) : ?>
<h3>
<?= Icon::create('topic', Icon::ROLE_INFO)->asImg(['class' => 'text-bottom']) ?>
<?= htmlReady($thema['title']) ?>
</h3>
<div>
<?= formatReady($thema['description']) ?>
</div>
<? endforeach ?>
<? endif ?>
<? else : ?>
<?= _('Keine Beschreibung vorhanden') ?>
<? endif ?>
<ul class="list-csv" style="text-align: center;">
<? foreach ($termin->getAdditionalDescriptions() as $type => $info) : ?>
<? if (trim($info)) : ?>
<li>
<small>
<? if (!is_numeric($type)): ?>
<em><?= htmlReady($type) ?>:</em>
<? endif; ?>
<?= htmlReady(trim($info)) ?>
</small>
</li>
<? endif ?>
<? endforeach ?>
</ul>
<? if (!$course_range && in_array($termin->getObjectClass(), [CalendarCourseDate::class, CalendarCourseExDate::class])) : ?>
<div>
<a href="<?= URLHelper::getLink('dispatch.php/course/dates', ['cid' => $termin->getPrimaryObjectId()]) ?>">
<?= Icon::create('link-intern')->asImg(['class' => 'text-bottom']) ?>
<?= _('Zur Veranstaltung') ?>
</a>
</div>
<? endif ?>
</div>
</article>
|