diff --git a/core/module/course/course.php b/core/module/course/course.php index 0e25629..eee8579 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -74,16 +74,21 @@ class course extends common public function index() { - if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) { + self::$courses = array(); + if ( + $this->getUser('id') + && $this->getUser('group') + && $this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) + ) { foreach ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) as $courseId => $courseValue) { $categorieUrl = helper::baseUrl() . 'course/suscribe/' . $courseId; $authorId = $this->getData(['course', $courseId, 'author']); $author = isset($authorId) ? sprintf('%s %s', $this->getData(['user', $authorId, 'firstname']), $this->getData(['user', $authorId, 'lastname'])) : ''; - $access = self::$courseAccess[$courseValue ['access']]; - $enrolment = self::$courseEnrolment[$courseValue ['enrolment']]; - $description = sprintf('%s
%s
%s
', $courseValue ['description'], $access, $enrolment); + $access = self::$courseAccess[$courseValue['access']]; + $enrolment = self::$courseEnrolment[$courseValue['enrolment']]; + $description = sprintf('%s
%s
%s
', $courseValue['description'], $access, $enrolment); self::$courses[] = [ $courseValue['title'], $author,