forked from ZwiiCMS-Team/ZwiiCampus
Course sort
This commit is contained in:
parent
98ee5d4afe
commit
104e3d408c
@ -902,8 +902,8 @@ class layout extends common
|
|||||||
if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) {
|
if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) {
|
||||||
$leftItems .= '<li><select id="barSelectCourse" >';
|
$leftItems .= '<li><select id="barSelectCourse" >';
|
||||||
$leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
|
$leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
|
||||||
foreach ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) as $key => $value) {
|
foreach ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) as $courseId => $value) {
|
||||||
$leftItems .= '<option name="' . $value['title'] . '" value="' . helper::baseUrl(true) . 'course/swap/' . $key . '" ' . ($key === self::$siteContent ? 'selected' : '') . '>' . $value['title'] . '</option>';
|
$leftItems .= '<option name="' . $this->getData(['course', $courseId, 'title']) . '" value="' . helper::baseUrl(true) . 'course/swap/' . $courseId . '" ' . ($courseId === self::$siteContent ? 'selected' : '') . '>' . $this->getData(['course', $courseId, 'title']) . '</option>';
|
||||||
}
|
}
|
||||||
$leftItems .= '</select></li>';
|
$leftItems .= '</select></li>';
|
||||||
}
|
}
|
||||||
@ -1033,7 +1033,7 @@ class layout extends common
|
|||||||
$rightItems = '';
|
$rightItems = '';
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
// ZwiiCampus ------
|
// ZwiiCampus ------
|
||||||
self::$siteContent !== 'home'
|
self::$siteContent !== 'home'
|
||||||
// ZwiiCampus ------
|
// ZwiiCampus ------
|
||||||
&& $this->getUser('group') >= self::GROUP_MEMBER
|
&& $this->getUser('group') >= self::GROUP_MEMBER
|
||||||
|
@ -1424,6 +1424,7 @@ class common
|
|||||||
public function getCoursesByUser($userId, $userStatus)
|
public function getCoursesByUser($userId, $userStatus)
|
||||||
{
|
{
|
||||||
$c = $this->getData([('course')]);
|
$c = $this->getData([('course')]);
|
||||||
|
$c = helper::arraycolumn($c, 'title', 'SORT_ASC');
|
||||||
switch ($userStatus) {
|
switch ($userStatus) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
return $c;
|
return $c;
|
||||||
|
@ -89,11 +89,11 @@ class course extends common
|
|||||||
$author = isset($authorId)
|
$author = isset($authorId)
|
||||||
? sprintf('%s %s', $this->getData(['user', $authorId, 'firstname']), $this->getData(['user', $authorId, 'lastname']))
|
? sprintf('%s %s', $this->getData(['user', $authorId, 'firstname']), $this->getData(['user', $authorId, 'lastname']))
|
||||||
: '';
|
: '';
|
||||||
$info = sprintf('<strong>%s<br /></strong>Auteur : %s<br />Id : <a href="%s" target="_blank">%s<br />', $courseValue['title'], $author, $categorieUrl, $courseId);
|
|
||||||
$categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId;
|
$categorieUrl = helper::baseUrl() . 'course/swap/' . $courseId;
|
||||||
$access = self::$courseAccess[$courseValue['access']];
|
$info = sprintf('<strong>%s<br /></strong>Auteur : %s<br />Id : <a href="%s" target="_blank">%s<br />', $this->getData(['course', $courseId, 'title']), $author, $categorieUrl, $courseId);
|
||||||
$enrolment = self::$courseEnrolment[$courseValue['enrolment']];
|
$access = self::$courseAccess[$this->getData(['course', $courseId, 'access'])];
|
||||||
$description = sprintf('<strong>%s</strong><br />Accès : %s<br />Inscription : %s<br />', $courseValue['description'], $access, $enrolment);
|
$enrolment = self::$courseEnrolment[$this->getData(['course', $courseId, 'enrolment'])];
|
||||||
|
$description = sprintf('<strong>%s</strong><br />Accès : %s<br />Inscription : %s<br />', $this->getData(['course', $courseId, 'description']), $access, $enrolment);
|
||||||
self::$courses[] = [
|
self::$courses[] = [
|
||||||
$info,
|
$info,
|
||||||
//$author,
|
//$author,
|
||||||
|
Loading…
Reference in New Issue
Block a user