From 104e3d408c3011193a389c067406b460fe75ee09 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 13 Jan 2024 22:35:57 +0100 Subject: [PATCH] Course sort --- core/class/layout.class.php | 6 +++--- core/core.php | 1 + core/module/course/course.php | 8 ++++---- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index a7f1612..ea4699f 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -902,8 +902,8 @@ class layout extends common if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) { $leftItems .= '
  • '; } @@ -1033,7 +1033,7 @@ class layout extends common $rightItems = ''; if ( ( - // ZwiiCampus ------ + // ZwiiCampus ------ self::$siteContent !== 'home' // ZwiiCampus ------ && $this->getUser('group') >= self::GROUP_MEMBER diff --git a/core/core.php b/core/core.php index ec57ca4..dfbaacc 100644 --- a/core/core.php +++ b/core/core.php @@ -1424,6 +1424,7 @@ class common public function getCoursesByUser($userId, $userStatus) { $c = $this->getData([('course')]); + $c = helper::arraycolumn($c, 'title', 'SORT_ASC'); switch ($userStatus) { case self::GROUP_ADMIN: return $c; diff --git a/core/module/course/course.php b/core/module/course/course.php index 83c076e..31d493b 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -89,11 +89,11 @@ class course extends common $author = isset($authorId) ? sprintf('%s %s', $this->getData(['user', $authorId, 'firstname']), $this->getData(['user', $authorId, 'lastname'])) : ''; - $info = sprintf('%s
    Auteur : %s
    Id : %s
    ', $courseValue['title'], $author, $categorieUrl, $courseId); $categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId; - $access = self::$courseAccess[$courseValue['access']]; - $enrolment = self::$courseEnrolment[$courseValue['enrolment']]; - $description = sprintf('%s
    Accès : %s
    Inscription : %s
    ', $courseValue['description'], $access, $enrolment); + $info = sprintf('%s
    Auteur : %s
    Id :
    %s
    ', $this->getData(['course', $courseId, 'title']), $author, $categorieUrl, $courseId); + $access = self::$courseAccess[$this->getData(['course', $courseId, 'access'])]; + $enrolment = self::$courseEnrolment[$this->getData(['course', $courseId, 'enrolment'])]; + $description = sprintf('%s
    Accès : %s
    Inscription : %s
    ', $this->getData(['course', $courseId, 'description']), $access, $enrolment); self::$courses[] = [ $info, //$author,