Skip to content

Commit 4c8168a

Browse files
committed
reintroduce missing method for OC block int the courseware plugin
1 parent b6e812f commit 4c8168a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

models/OCCourseModel.class.php

+20
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ public static function getCount($course_id, $visitdate)
173173
return $stmt->fetchColumn();
174174
}
175175

176+
public function getEpisodesforREST()
177+
{
178+
$rest_episodes = [];
179+
$is_dozent = $GLOBALS['perm']->have_studip_perm('autor', $this->course_id);
180+
$episodes = $this->getEpisodes();
181+
182+
foreach ($episodes as $episode) {
183+
if ($episode['visibility'] == 'true') {
184+
$rest_episodes[] = $episode;
185+
} else {
186+
if ($is_dozent) {
187+
$rest_episodes[] = $episode;
188+
}
189+
}
190+
}
191+
192+
return $rest_episodes;
193+
}
194+
195+
176196
public function toggleSeriesVisibility()
177197
{
178198
if ($this->getSeriesVisibility() == 'visible') {

0 commit comments

Comments
 (0)