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
|
// Menu extra
|
||||||
$itemsRight = $this->formatMenu(true);
|
$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
|
// Lien de connexion
|
||||||
if (
|
if (
|
||||||
($this->getData(['theme', 'menu', 'loginLink'])
|
($this->getData(['theme', 'menu', 'loginLink'])
|
||||||
@ -504,24 +524,6 @@ class layout extends common
|
|||||||
]) .
|
]) .
|
||||||
'</li>';
|
'</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
|
* Commandes pour les membres simples
|
||||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||||
|
@ -50,7 +50,7 @@ class common
|
|||||||
const ACCESS_TIMER = 1800;
|
const ACCESS_TIMER = 1800;
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '1.4.09';
|
const ZWII_VERSION = '1.4.10';
|
||||||
|
|
||||||
// URL autoupdate
|
// URL autoupdate
|
||||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
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 = '')
|
public function saveLog($message = '')
|
||||||
{
|
{
|
||||||
// Journalisation
|
// 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 .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
||||||
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
||||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||||
@ -1427,19 +1427,36 @@ class common
|
|||||||
$c = helper::arraycolumn($c, 'title', 'SORT_ASC');
|
$c = helper::arraycolumn($c, 'title', 'SORT_ASC');
|
||||||
switch ($userStatus) {
|
switch ($userStatus) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
|
// Affiche tout
|
||||||
return $c;
|
return $c;
|
||||||
case self::GROUP_EDITOR:
|
case self::GROUP_EDITOR:
|
||||||
foreach ($c as $courseId => $value) {
|
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]);
|
unset($c[$courseId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $c;
|
return $c;
|
||||||
case self::GROUP_MEMBER:
|
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:
|
case self::GROUP_VISITOR:
|
||||||
foreach ($c as $courseId => $value) {
|
foreach ($c as $courseId => $value) {
|
||||||
$students = $this->getData(['enrolment', $courseId]);
|
// Affiche les espaces ouverts
|
||||||
if (isset($students[$userId]) === false) {
|
if ($this->getData(['course', $courseId, 'access']) !== self::COURSE_ENROLMENT_GUEST) {
|
||||||
unset($c[$courseId]);
|
unset($c[$courseId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -607,14 +607,14 @@ nav li ul li {
|
|||||||
nav li ul #barSelectCourse {
|
nav li ul #barSelectCourse {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav #barSelectCourse {
|
nav #barSelectCourse {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
border: 0;
|
border: 0;
|
||||||
color: #111112;
|
color: #111112;
|
||||||
font-size: 1em;
|
font-size: 1em;
|
||||||
background-color: rgba(255, 255, 255, 1);
|
background-color: rgba(255, 255, 255, 1);
|
||||||
padding: 8px;
|
line-height: 45px;
|
||||||
margin-top: 5px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user