Skip to content

Commit

Permalink
reintroduce missing method for OC block int the courseware plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
tgloeggl committed Sep 28, 2022
1 parent b6e812f commit 4c8168a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions models/OCCourseModel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,26 @@ public static function getCount($course_id, $visitdate)
return $stmt->fetchColumn();
}

public function getEpisodesforREST()
{
$rest_episodes = [];
$is_dozent = $GLOBALS['perm']->have_studip_perm('autor', $this->course_id);
$episodes = $this->getEpisodes();

foreach ($episodes as $episode) {
if ($episode['visibility'] == 'true') {
$rest_episodes[] = $episode;
} else {
if ($is_dozent) {
$rest_episodes[] = $episode;
}
}
}

return $rest_episodes;
}


public function toggleSeriesVisibility()
{
if ($this->getSeriesVisibility() == 'visible') {
Expand Down

0 comments on commit 4c8168a

Please sign in to comment.