forked from ZwiiCMS-Team/ZwiiCampus
1410 Ajoute l'affichage du sélecteur d'espace aux membres et ouvre les conditions d'accès aux espaces ouverts
This commit is contained in:
parent
489f3b0da6
commit
a0ffcca22a
@ -490,6 +490,26 @@ class layout extends common
|
||||
|
||||
// Menu extra
|
||||
$itemsRight = $this->formatMenu(true);
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage du sélecteur d'espaces
|
||||
*/
|
||||
if (
|
||||
//$this->getUser('group') === self::GROUP_MEMBER
|
||||
// &&
|
||||
$this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||
) {
|
||||
if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) {
|
||||
$itemsRight .= '<li><select id="barSelectCourse" >';
|
||||
$itemsRight .= '<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 $courseId => $value) {
|
||||
$itemsRight .= '<option name="' . $this->getData(['course', $courseId, 'title']) . '" value="' . helper::baseUrl(true) . 'course/swap/' . $courseId . '" ' . ($courseId === self::$siteContent ? 'selected' : '') . '>' . $this->getData(['course', $courseId, 'title']) . '</option>';
|
||||
}
|
||||
$itemsRight .= '</select></li>';
|
||||
}
|
||||
}
|
||||
|
||||
// Lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'menu', 'loginLink'])
|
||||
@ -504,24 +524,6 @@ class layout extends common
|
||||
]) .
|
||||
'</li>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage du sélecteur d'espaces
|
||||
*/
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||
) {
|
||||
if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) {
|
||||
$itemsRight .= '<li><select id="barSelectCourse" >';
|
||||
$itemsRight .= '<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 $courseId => $value) {
|
||||
$itemsRight .= '<option name="' . $this->getData(['course', $courseId, 'title']) . '" value="' . helper::baseUrl(true) . 'course/swap/' . $courseId . '" ' . ($courseId === self::$siteContent ? 'selected' : '') . '>' . $this->getData(['course', $courseId, 'title']) . '</option>';
|
||||
}
|
||||
$itemsRight .= '</select></li>';
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||
|
@ -50,7 +50,7 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.4.09';
|
||||
const ZWII_VERSION = '1.4.10';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
@ -1404,7 +1404,7 @@ class common
|
||||
public function saveLog($message = '')
|
||||
{
|
||||
// Journalisation
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$siteContent) . ';' . helper::dateUTF8('%H:%M', time(), self::$siteContent). ';';
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$siteContent) . ';' . helper::dateUTF8('%H:%M', time(), self::$siteContent) . ';';
|
||||
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
||||
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||
@ -1427,19 +1427,36 @@ class common
|
||||
$c = helper::arraycolumn($c, 'title', 'SORT_ASC');
|
||||
switch ($userStatus) {
|
||||
case self::GROUP_ADMIN:
|
||||
// Affiche tout
|
||||
return $c;
|
||||
case self::GROUP_EDITOR:
|
||||
foreach ($c as $courseId => $value) {
|
||||
if ($this->getData(['course', $courseId, 'author']) !== $userId) {
|
||||
$students = $this->getData(['enrolment', $courseId]);
|
||||
// Affiche les espaces gérés par l'éditeur, les espaces où il participe et les espaces ouverts
|
||||
if (
|
||||
isset($students[$userId]) === false ||
|
||||
$this->getData(['course', $courseId, 'author']) !== $userId ||
|
||||
$this->getData(['course', $courseId, 'access']) !== self::COURSE_ENROLMENT_GUEST
|
||||
) {
|
||||
unset($c[$courseId]);
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
case self::GROUP_MEMBER:
|
||||
foreach ($c as $courseId => $value) {
|
||||
// Affiche les espaces où le membre participe et les espaces ouverts
|
||||
$students = $this->getData(['enrolment', $courseId]);
|
||||
if (
|
||||
isset($students[$userId]) === false ||
|
||||
$this->getData(['course', $courseId, 'access']) !== self::COURSE_ENROLMENT_GUEST
|
||||
) {
|
||||
unset($c[$courseId]);
|
||||
}
|
||||
}
|
||||
case self::GROUP_VISITOR:
|
||||
foreach ($c as $courseId => $value) {
|
||||
$students = $this->getData(['enrolment', $courseId]);
|
||||
if (isset($students[$userId]) === false) {
|
||||
// Affiche les espaces ouverts
|
||||
if ($this->getData(['course', $courseId, 'access']) !== self::COURSE_ENROLMENT_GUEST) {
|
||||
unset($c[$courseId]);
|
||||
}
|
||||
}
|
||||
|
@ -607,14 +607,14 @@ nav li ul li {
|
||||
nav li ul #barSelectCourse {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
nav #barSelectCourse {
|
||||
width: 150px;
|
||||
border: 0;
|
||||
color: #111112;
|
||||
font-size: 1em;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
padding: 8px;
|
||||
margin-top: 5px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
line-height: 45px;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user