Skip to content

Commit c7c094b

Browse files
committed
fixes #579, fixes #557
1 parent 17e0361 commit c7c094b

File tree

1 file changed

+8
-33
lines changed

1 file changed

+8
-33
lines changed

views/course/_episode.php

+8-33
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@
6161
$now = time();
6262
$startTime = strtotime($item['start']);
6363
$endTime = strtotime($item['start']) + $item['duration'] / 1000;
64-
$live = $now < $endTime;
65-
$isOnAir = $startTime <= $now && $now <= $endTime;
66-
67-
/* today and the next full 7 days */;
68-
$isUpcoming = $startTime <= (strtotime("tomorrow") + 7 * 24 * 60 * 60);
69-
if ($live && !$isUpcoming) {
70-
continue;
71-
}
7264
?>
7365

7466
<? $image = $item['presentation_preview']; ?>
@@ -97,28 +89,20 @@ class="<?= ($item['visibility'] != 'false') ? 'oce_item' : 'hidden_ocvideodiv oc
9789
data-src="<?= $image ?>" height="200"
9890
style="filter: grayscale(100%);">
9991
</span>
100-
<? elseif ($mayWatchEpisodes && (!$live || $isOnAir)) : ?>
92+
<? elseif ($mayWatchEpisodes) : ?>
10193
<a href="<?= $video_url . $item['id'] ?>" target="_blank">
10294
<span class="previewimage">
10395
<img class="previewimage <?= $item['visibility'] == 'false' ? 'ocinvisible' : '' ?>"
10496
data-src="<?= $image ?>" height="200">
10597

106-
<? if ($live) : ?>
107-
<img class="livebutton"
108-
src="<?= $plugin->getPluginURL() . '/images/live.svg' ?>">
109-
<? else: ?>
110-
<img class="playbutton"
111-
src="<?= $plugin->getPluginURL() . '/images/play.svg' ?>">
112-
<? endif ?>
98+
<img class="playbutton"
99+
src="<?= $plugin->getPluginURL() . '/images/play.svg' ?>">
113100
</span>
114101
</a>
115102
<? else : ?>
116103
<span class="previewimage">
117104
<img class="previewimage <?= $item['visibility'] == 'false' ? 'ocinvisible' : '' ?>"
118105
data-src="<?= $image ?>" height="200">
119-
<? if ($live) : ?>
120-
<img class="livebutton disabled" src="<?= $plugin->getPluginURL() . '/images/live.svg' ?>" style="filter: grayscale(100%);">
121-
<? endif ?>
122106
</span>
123107
<? endif ?>
124108
</div>
@@ -138,17 +122,8 @@ class="<?= ($item['visibility'] != 'false') ? 'oce_item' : 'hidden_ocvideodiv oc
138122
</h2>
139123
<ul class="oce_contentlist">
140124
<li class="oce_list_date">
141-
<? if ($live) : ?>
142-
<h3>
143-
<?= sprintf($_('Dies ist ein Livestream! Geplant: %s - %s Uhr'),
144-
date("d.m.Y H:i", strtotime($item['start'])),
145-
date('H:i', strtotime($item['start']) + ($item['duration'] / 1000))
146-
) ?>
147-
</h3>
148-
<? else : ?>
149-
<?= $_('Aufnahmezeitpunkt') ?>:
150-
<?= date("d.m.Y H:i", strtotime($item['start'])) ?> <?= $_("Uhr") ?>
151-
<? endif ?>
125+
<?= $_('Aufnahmezeitpunkt') ?>:
126+
<?= date("d.m.Y H:i", strtotime($item['start'])) ?> <?= $_("Uhr") ?>
152127
</li>
153128
<li>
154129
<?= $_('Vortragende:') ?>
@@ -180,15 +155,15 @@ class="<?= ($item['visibility'] != 'false') ? 'oce_item' : 'hidden_ocvideodiv oc
180155
<? URLHelper::setBaseURL($base); ?>
181156

182157
<? if (OCPerm::editAllowed($course_id)) : ?>
183-
<?= $live ? '' : Studip\LinkButton::create($_($visibility_text[$item['visibility']] ?: $_('Unbekannte Sichtbarkeit')),
158+
<?= Studip\LinkButton::create($_($visibility_text[$item['visibility']] ?: $_('Unbekannte Sichtbarkeit')),
184159
'', [
185160
'class' => 'oc-togglevis ocspecial oc' . ($item['visibility'] ?: 'free'),
186161
'data-episode-id' => $item['id'],
187162
'data-visibility' => $item['visibility'] ?: 'invisible',
188163
'title' => $_('Sichtbarkeit für dieses Video ändern')
189164
]); ?>
190165

191-
<? if (!$live && $item['has_previews']) : ?>
166+
<? if ($item['has_previews']) : ?>
192167

193168
<?= Studip\LinkButton::create(
194169
$_('Schnitteditor öffnen'),
@@ -259,7 +234,7 @@ class="<?= ($item['visibility'] != 'false') ? 'oce_item' : 'hidden_ocvideodiv oc
259234

260235

261236
<? if (OCPerm::editAllowed($course_id)) : ?>
262-
<?= $live ? '' : Studip\LinkButton::create(
237+
<?= Studip\LinkButton::create(
263238
$_('Entfernen'),
264239
$controller->url_for('course/remove_episode/' . get_ticket() . '/' . $item['id']),
265240
[

0 commit comments

Comments
 (0)