Compare commits

..

No commits in common. "master" and "1.18.00" have entirely different histories.

158 changed files with 952 additions and 5593 deletions

View File

@ -1,4 +1,4 @@
# ZwiiCampus 1.21.01
# ZwiiCampus 1.18.00
ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.

View File

@ -1,5 +1,4 @@
<?php
/**
* Created by PhpStorm.
* User: Andrey Mistulov
@ -113,97 +112,78 @@ class JsonDb extends \Prowebcraft\Dot
/**
* Charge les données depuis un fichier JSON.
*
* @param bool $reload Force le rechargement des données si true
*
* @return array|null Les données chargées ou null si le fichier n'existe pas
*
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
* Local database upload
* @param bool $reload Reboot data?
* @return array|mixed|null
*/
protected function loadData($reload = false): ?array
protected function loadData($reload = false)
{
if ($this->data === null || $reload) {
$this->db = $this->config['dir'] . $this->config['name'];
if (!file_exists($this->db)) {
return null; // Rebuild database managed by CMS
}
return null; // Rebuild database manage by CMS
} else {
if ($this->config['backup']) {
$backup_path = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup';
try {
if (!copy($this->db, $backup_path)) {
throw new \RuntimeException('Échec de la création de la sauvegarde');
}
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
} catch (\Exception $e) {
throw new \RuntimeException('Erreur de sauvegarde : ' . $e->getMessage());
error_log('Erreur de chargement : ' . $e);
exit('Erreur de chargement : ' . $e);
}
}
$file_contents = file_get_contents($this->db);
$this->data = json_decode($file_contents, true);
if ($this->data === null) {
throw new \InvalidArgumentException('Le fichier ' . $this->db . ' contient des données invalides.');
}
$this->data = json_decode(file_get_contents($this->db), true);
if (!$this->data === null) {
throw new \InvalidArgumentException('Le fichier ' . $this->db
. ' contient des données invalides.');
}
}
return $this->data;
}
/**
* Charge les données depuis un fichier JSON.
*
* @param bool $reload Force le rechargement des données si true
*
* @return array|null Les données chargées ou null si le fichier n'existe pas
*
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
* Save database
*/
public function save(): void
public function save()
{
if ($this->data === null) {
throw new \RuntimeException('Tentative de sauvegarde de données nulles');
}
try {
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_THROW_ON_ERROR);
} catch (\JsonException $e) {
throw new \RuntimeException('Erreur d\'encodage JSON : ' . $e->getMessage());
}
// Encode les données au format JSON avec les options spécifiées
//$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
// Vérifie la longueur de la chaîne JSON encodée
$encoded_length = strlen($encoded_data);
$max_attempts = 5;
for ($attempt = 0; $attempt < $max_attempts; $attempt++) {
$temp_file = $this->db . '.tmp' . uniqid();
// Initialise le compteur de tentatives
$attempt = 0;
try {
$write_result = file_put_contents($temp_file, $encoded_data, LOCK_EX);
// Tente d'encoder les données en JSON et de les sauvegarder jusqu'à 5 fois en cas d'échec
while ($attempt < 5) {
// Essaye d'écrire les données encodées dans le fichier de base de données
$write_result = file_put_contents($this->db, $encoded_data, LOCK_EX); // Les utilisateurs multiples obtiennent un verrou
//$now = \DateTime::createFromFormat('U.u', microtime(true));
//file_put_contents("tmplog.txt", '[JsonDb][' . $now->format('H:i:s.u') . ']--' . $this->db . "\r\n", FILE_APPEND);
// Vérifie si l'écriture a réussi
if ($write_result === $encoded_length) {
if (rename($temp_file, $this->db)) {
return;
}
// Sort de la boucle si l'écriture a réussi
break;
}
error_log("Échec sauvegarde : longueur incorrecte ou renommage échoué (tentative " . ($attempt + 1) . ")");
} catch (\Exception $e) {
error_log('Erreur de sauvegarde : ' . $e->getMessage());
// Incrémente le compteur de tentatives
$attempt++;
if (file_exists($temp_file)) {
unlink($temp_file);
}
// Attente 1/4 de seconde
usleep(0.25);
}
usleep(pow(2, $attempt) * 250000);
}
// Vérifie si l'écriture a échoué même après plusieurs tentatives
if ($write_result !== $encoded_length) {
// Enregistre un message d'erreur dans le journal des erreurs
error_log('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
throw new \RuntimeException('Échec de sauvegarde après ' . $max_attempts . ' tentatives');
// Affiche un message d'erreur et termine le script
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
}
}
}

View File

@ -353,7 +353,7 @@ class layout extends common
}
// Affichage de la barre de membre simple
if (
$this->getUser('role') >= self::ROLE_MEMBER && $this->getUser('role') < self::ROLE_ADMIN
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN
&& $this->getData(['theme', 'footer', 'memberBar']) === true
) {
$items .= '<span id="footerDisplayMemberAccount"';
@ -508,7 +508,7 @@ class layout extends common
* Affichage du sélecteur d'espaces
*/
if (
$this->getUser('role') === self::ROLE_MEMBER
$this->getUser('group') === self::GROUP_MEMBER
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
) {
if ($this->getCoursesByProfil()) {
@ -532,11 +532,11 @@ class layout extends common
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
) {
$href = '';
switch ($this->getUser('role')) {
case self::ROLE_MEMBER:
switch ($this->getUser('group')) {
case self::GROUP_MEMBER:
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
break;
case self::ROLE_EDITOR:
case self::GROUP_EDITOR:
if (
$this->getData(['enrolment', self::$siteContent]) && ($this->getUser('id') === $this->getData(['course', self::$siteContent, 'author']))
// Permission d'accéder aux espaces dans lesquels le membre est inscrit
@ -548,7 +548,7 @@ class layout extends common
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
}
break;
case self::ROLE_ADMIN:
case self::GROUP_ADMIN:
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
}
if ($href) {
@ -565,7 +565,7 @@ class layout extends common
* Affichage des boutons gestionnaire de fichiers et mon compte
*/
if (
$this->getUser('role') === self::ROLE_MEMBER
$this->getUser('group') === self::GROUP_MEMBER
&& $this->getData(['theme', 'menu', 'memberBar']) === true
) {
@ -613,7 +613,8 @@ class layout extends common
}
// Retourne les items du menu
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight;
echo '</ul>';
}
/**
@ -648,7 +649,7 @@ class layout extends common
and $this->isConnected() === false
) or ($this->getData(['page', $parentPageId, 'disable']) === true
and $this->isConnected() === true
and $this->getUser('role') < self::ROLE_EDITOR
and $this->getUser('group') < self::GROUP_EDITOR
)
) {
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -714,7 +715,7 @@ class layout extends common
and $this->isConnected() === false
) or ($this->getData(['page', $childKey, 'disable']) === true
and $this->isConnected() === true
and $this->getUser('role') < self::ROLE_EDITOR
and $this->getUser('group') < self::GROUP_EDITOR
)
) {
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -975,7 +976,7 @@ class layout extends common
* Les admins voient tous les contenus
* Les enseignants les contenus dont ils sont auteurs
*/
if ($this->getUser('role') >= self::ROLE_EDITOR) {
if ($this->getUser('group') >= self::GROUP_EDITOR) {
if (is_array($this->getCoursesByProfil())) {
$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>';
@ -990,7 +991,7 @@ class layout extends common
'help' => 'Gérer les espaces'
]) . '</li>';
}
if ($this->getUser('role') >= self::ROLE_ADMIN) {
if ($this->getUser('group') >= self::GROUP_ADMIN) {
$leftItems .= '<li>' . template::ico('brush', [
'help' => 'Thème',
'href' => helper::baseUrl() . 'theme'
@ -998,8 +999,8 @@ class layout extends common
}
// Liste des pages et bouton de gestion interdit pour l'accueil sauf admin
if (
($this->getUser('role') === self::ROLE_EDITOR && self::$siteContent != 'home')
|| $this->getUser('role') === self::ROLE_ADMIN
($this->getUser('group') === self::GROUP_EDITOR && self::$siteContent != 'home')
|| $this->getUser('group') === self::GROUP_ADMIN
) {
$leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
@ -1122,11 +1123,11 @@ class layout extends common
$rightItems = '';
if (
(
$this->getUser('role') === self::ROLE_EDITOR
$this->getUser('group') === self::GROUP_EDITOR
&& $this->getUser('permission', 'filemanager') === true
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
)
|| $this->getUser('role') === self::ROLE_ADMIN
|| $this->getUser('group') === self::GROUP_ADMIN
) {
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
$rightItems .= '<li>' . template::ico('folder', [
@ -1137,13 +1138,13 @@ class layout extends common
}
if (
self::$siteContent === 'home'
&& $this->getUser('role') >= self::ROLE_ADMIN
&& $this->getUser('group') >= self::GROUP_ADMIN
) {
$rightItems .= '<li>' . template::ico('flag', [
'help' => 'Langues',
'href' => helper::baseUrl() . 'language'
]) . '</li>';
$rightItems .= '<li>' . template::ico('address-book', [
$rightItems .= '<li>' . template::ico('users', [
'help' => 'Utilisateurs',
'href' => helper::baseUrl() . 'user'
]) . '</li>';
@ -1209,9 +1210,9 @@ class layout extends common
'href' => helper::baseUrl() . 'plugin'
]) . '</li>';
}
// Boutons depuis le rôle éditeur
// Boutons depuis le groupe éditeur
if (
$this->getUser('role') >= self::ROLE_EDITOR
$this->getUser('group') >= self::GROUP_EDITOR
&& $this->getUser('permission', 'user', 'edit')
) {
@ -1297,7 +1298,7 @@ class layout extends common
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
if (
$this->isConnected() === true
and $this->getUser('role') >= self::ROLE_EDITOR
and $this->getUser('group') >= self::GROUP_EDITOR
) {
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
}

View File

@ -140,7 +140,7 @@ class core extends common
$css .= 'span.mce-text{background-color: unset !important;}';
$css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}';
$css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}';
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],input[type=number],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
// spécifiques au module de blog
$css .= '.blogDate {color:' . $this->getData(['theme', 'text', 'textColor']) . ';}.blogPicture img{border:1px solid ' . $this->getData(['theme', 'text', 'textColor']) . '; box-shadow: 1px 1px 5px ' . $this->getData(['theme', 'text', 'textColor']) . ';}';
// Couleur fixée dans admin.css
@ -168,7 +168,7 @@ class core extends common
$colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor']));
$css .= '.speechBubble,.button,.button:hover,button[type=submit],.pagination a,.pagination a:hover,input[type=checkbox]:checked + label:before,input[type=radio]:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}';
$css .= '.helpButton span{color:' . $colors['normal'] . '}';
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=number]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
$css .= '.speechBubble:before{border-color:' . $colors['normal'] . ' transparent transparent transparent}';
$css .= '.button:hover,button[type=submit]:hover,.pagination a:hover,input[type=checkbox]:not(:active):checked:hover + label:before,input[type=checkbox]:active + label:before,input[type=radio]:checked:hover + label:before,input[type=radio]:not(:checked):active + label:before{background-color:' . $colors['darken'] . '}';
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
@ -254,18 +254,18 @@ class core extends common
// Déterminer la hauteur max du menu pour éviter les débordements
// $padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px"
// $fontSize = (float) $this->getData(['theme', 'text', 'fontSize']); // Taille de référence en pixels
// $menuFontSize = (float) $this->getData(['theme', 'menu', 'fontSize']); // Taille du menu en em
$padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px"
$fontSize = (float) $this->getData(['theme', 'text', 'fontSize']); // Taille de référence en pixels
$menuFontSize = (float) $this->getData(['theme', 'menu', 'fontSize']); // Taille du menu en em
// Extraire la première valeur du padding (par exemple "10px 20px" -> "10px")
// $firstPadding = (float) explode(" ", $padding)[0]; // Nous prenons la première valeur, supposée être en px
$firstPadding = (float) explode(" ", $padding)[0]; // Nous prenons la première valeur, supposée être en px
// Convertir menuFontSize (en em) en pixels
// $menuFontSizeInPx = $menuFontSize * $fontSize;
$menuFontSizeInPx = $menuFontSize * $fontSize;
// Calculer la hauteur totale
// $totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx;
$totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx;
// Fixer la hauteur maximale de la barre de menu
// $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}';
@ -381,7 +381,7 @@ class core extends common
$css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}';
$colors = helper::colorVariants($this->getData(['admin', 'backgroundBlockColor']));
$css .= '.buttonTab, .block {border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}.buttonTab, .block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}';
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=number],input[type=password],select:not(#barSelectLanguage),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=password],select:not(#barSelectCourse),select:not(#menuSelectCourse),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
// Bordure du contour TinyMCE
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
// Enregistre la personnalisation
@ -446,7 +446,7 @@ class core extends common
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0
// Le userId n'est pas celui d'un admis ni le compte d'un gestionnaire de cet espace
&& (
$this->getUser('role') < common::ROLE_ADMIN
$this->getUser('group') < common::GROUP_ADMIN
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author'])
)
) {
@ -473,7 +473,7 @@ class core extends common
// Force la déconnexion des membres bannis ou d'une seconde session
if (
$this->isConnected() === true
and ($this->getUser('role') === common::ROLE_BANNED
and ($this->getUser('group') === common::GROUP_BANNED
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
)
@ -488,7 +488,7 @@ class core extends common
and $this->getUrl(1) !== 'login'
and ($this->isConnected() === false
or ($this->isConnected() === true
and $this->getUser('role') < common::ROLE_ADMIN
and $this->getUser('group') < common::GROUP_ADMIN
)
)
) {
@ -505,11 +505,11 @@ class core extends common
$access = null;
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
if (
$this->getData(['page', $this->getUrl(0), 'role']) === common::ROLE_VISITOR
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
or ($this->isConnected() === true
// and $this->getUser('role') >= $this->getData(['page', $this->getUrl(0), 'role'])
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
// Modification qui tient compte du profil de la page
and ($this->getUser('role') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'role']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
)
) {
$access = true;
@ -526,7 +526,7 @@ class core extends common
and $this->isConnected() === false
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
and $this->isConnected() === true
and $this->getUser('role') < common::ROLE_EDITOR
and $this->getUser('group') < common::GROUP_EDITOR
)
) {
$access = false;
@ -705,11 +705,11 @@ class core extends common
if (array_key_exists($action, $module::$actions)) {
$module->$action();
$output = $module->output;
// Check le rôle de l'utilisateur
// Check le groupe de l'utilisateur
if (
($module::$actions[$action] === common::ROLE_VISITOR
($module::$actions[$action] === common::GROUP_VISITOR
or ($this->isConnected() === true
and $this->getUser('role') >= $module::$actions[$action]
and $this->getUser('group') >= $module::$actions[$action]
and $this->getUser('permission', $moduleId, $action)
)
)

View File

@ -884,10 +884,6 @@ class template
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
// Début tableau
$html .= '<table id="' . $attributes['id'] . '" class="table ' . $attributes['class'] . '">';
// Pas de tableau d'Id transmis, générer une numérotation
if (empty($rowsId)) {
$rowsId = range(0, count($cols));
}
// Entêtes
if ($head) {
// Début des entêtes
@ -895,17 +891,21 @@ class template
$html .= '<tr class="nodrag">';
$i = 0;
foreach ($head as $th) {
$html .= '<th id="' . $rowsId[$i] . '" class="col' . $cols[$i++] . '">' . $th . '</th>';
$html .= '<th class="col' . $cols[$i++] . '">' . $th . '</th>';
}
// Fin des entêtes
$html .= '</tr>';
$html .= '</thead>';
}
// Pas de tableau d'Id transmis, générer une numérotation
if (empty($rowsId)) {
$rowsId = range(0, count($body));
}
// Début contenu
$j = 0;
foreach ($body as $tr) {
// Id de ligne pour les tableaux drag and drop
$html .= '<tr>';
$html .= '<tr id="' . $rowsId[$j++] . '">';
$i = 0;
foreach ($tr as $td) {
$html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>';
@ -992,117 +992,6 @@ class template
return $html;
}
/**
* Génère un champ de saisie de type number (input[type="number"])
*
* Cette méthode crée un champ numérique HTML complet avec son wrapper,
* son label et ses messages d'aide/erreur. Elle gère automatiquement
* la conversion des valeurs en nombres et les contraintes de validation.
*
* @param string $nameId Identifiant unique du champ, utilisé pour name et id
* @param array $attributes Tableau des attributs du champ avec les clés suivantes :
* @type boolean $before Active la récupération des données précédentes en cas d'erreur (défaut: true)
* @type string $class Classes CSS additionnelles pour l'input (défaut: '')
* @type string $classWrapper Classes CSS additionnelles pour le wrapper (défaut: '')
* @type boolean $noDirty Désactive le marquage dirty du champ (défaut: false)
* @type boolean $disabled Désactive le champ (défaut: false)
* @type string $help Texte d'aide affiché sous le label (défaut: '')
* @type string $label Texte du label (défaut: '')
* @type string $placeholder Texte de placeholder (défaut: '')
* @type boolean $readonly Rend le champ en lecture seule (défaut: false)
* @type mixed $value Valeur initiale du champ (défaut: '')
* @type number $min Valeur minimum autorisée (défaut: null)
* @type number $max Valeur maximum autorisée (défaut: null)
* @type number $step Pas d'incrémentation (ex: 1 pour entiers, 0.01 pour prix) (défaut: null)
* @type string $pattern Expression régulière de validation (défaut: null)
*
* @return string Code HTML du champ number complet
*/
public static function number($nameId, array $attributes = [])
{
// Attributs par défaut spécifiques aux champs numériques
$attributes = array_merge([
'type' => 'number',
'before' => true,
'class' => '',
'classWrapper' => '',
'noDirty' => false,
'disabled' => false,
'help' => '',
'id' => $nameId,
'label' => '',
'name' => $nameId,
'placeholder' => '',
'readonly' => false,
'required' => false,
'value' => '',
'min' => null,
'max' => null,
'step' => null,
'pattern' => null
], $attributes);
// Conversion de la valeur en nombre si elle n'est pas vide
if ($attributes['value'] !== '') {
$attributes['value'] = floatval($attributes['value']);
}
// Nettoyage des attributs null pour ne pas les afficher dans le HTML
foreach (['min', 'max', 'step', 'pattern'] as $attr) {
if ($attributes[$attr] === null) {
unset($attributes[$attr]);
}
}
// Traduction de l'aide et de l'étiquette
$attributes['label'] = helper::translate($attributes['label']);
$attributes['help'] = helper::translate($attributes['help']);
// Sauvegarde des données en cas d'erreur
if ($attributes['before'] && array_key_exists($attributes['id'], common::$inputBefore)) {
$attributes['value'] = common::$inputBefore[$attributes['id']];
}
// Gestion du champ obligatoire
if (isset($attributes['required']) && $attributes['required']) {
// Affiche l'astérisque dans le label
$required = ' required-field';
// Ajoute l'attribut required au champ input
$attributes['required'] = 'required';
}
// Début du wrapper
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
// Label
if ($attributes['label']) {
$html .= self::label($attributes['id'], $attributes['label'], [
'help' => $attributes['help'],
// Ajoute la classe required-field si le champ est obligatoire
'class' => isset($required) ? $required : ''
]);
}
// Notice
$notice = '';
if (array_key_exists($attributes['id'], common::$inputNotices)) {
$notice = common::$inputNotices[$attributes['id']];
$attributes['class'] .= ' notice';
}
$html .= self::notice($attributes['id'], $notice);
// Input number
$html .= sprintf(
'<input type="number" %s>',
helper::sprintAttributes($attributes)
);
// Fin du wrapper
$html .= '</div>';
return $html;
}
/**
* Crée un champ texte long
* @param string $nameId Nom et id du champ

View File

@ -116,14 +116,30 @@ core.confirm = function (text, yesCallback, noCallback) {
/**
* Scripts à exécuter en dernier
*/
core.end = function () {
/**
* Modifications non enregistrées du formulaire
*/
var formDOM = $("form");
// Ignore :
// - TinyMCE car il gère lui même le message
// - Les champs avec data-no-dirty
var inputsDOM = formDOM.find("input:not([data-no-dirty]), select:not([data-no-dirty]), textarea:not(.editorWysiwyg):not([data-no-dirty])");
var inputSerialize = inputsDOM.serialize();
$(window).on("beforeunload", function () {
if (inputsDOM.serialize() !== inputSerialize) {
message = "<?php echo helper::translate('Les modifications que vous avez apportées ne seront peut-être pas enregistrées.');?>";
return message;
}
});
formDOM.submit(function () {
$(window).off("beforeunload");
});
};
$(function () {
core.end();
});
*/
/**
* Ajoute une notice
@ -374,11 +390,12 @@ core.start = function () {
var totalHeight = firstPadding + fontSize + menuFontSizeInPx;
$("#menuLeft").css({
"visibility": "hidden",
"overflow": "hidden",
"max-width": "10px"
});
// Par défaut pour tous les thèmes.
$("#menuLeft").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px");
$("#menuLeft, nav").css("max-height", totalHeight + "px");
}
};

View File

@ -24,13 +24,13 @@ class common
const DISPLAY_LAYOUT_BLANK = 3;
const DISPLAY_LAYOUT_MAIN = 4;
const DISPLAY_LAYOUT_LIGHT = 5;
const ROLE_BANNED = -1;
const ROLE_VISITOR = 0;
const ROLE_MEMBER = 1;
const ROLE_EDITOR = 2;
const GROUP_BANNED = -1;
const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1;
const GROUP_EDITOR = 2;
// Groupe MODERATOR, compatibilité avec les anciens modules :
const ROLE_MODERATOR = 2;
const ROLE_ADMIN = 3;
const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3;
const SIGNATURE_ID = 1;
const SIGNATURE_PSEUDO = 2;
const SIGNATURE_FIRSTLASTNAME = 3;
@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.21.01';
const ZWII_VERSION = '1.18.00';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
@ -147,29 +147,29 @@ class common
],
'view' => ''
];
public static $roles = [
self::ROLE_BANNED => 'Banni',
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
public static $groups = [
self::GROUP_BANNED => 'Banni',
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $roleEdits = [
self::ROLE_BANNED => 'Banni',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
public static $groupEdits = [
self::GROUP_BANNED => 'Banni',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $roleNews = [
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
public static $groupNews = [
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
];
public static $rolePublics = [
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
public static $groupPublics = [
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
];
//Langues de l'UI
@ -821,11 +821,11 @@ class common
// Page parent
$this->getData(['page', $pageId, 'parentPageId']) === ""
// Ignore les pages dont l'utilisateur n'a pas accès
and ($this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
or ($this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
//and $this->getUser('role') >= $this->getData(['page', $pageId, 'role'])
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
// Modification qui tient compte du profil de la page
and ($this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
)
)
@ -848,14 +848,14 @@ class common
// Ignore les pages dont l'utilisateur n'a pas accès
and (
(
$this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
and
$this->getData(['page', $parentId, 'role']) === self::ROLE_VISITOR
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
)
or (
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
and
$this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
$this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
)
)
@ -1042,39 +1042,39 @@ class common
/**
* Retourne les permissions de l'utilisateur connecté
* @param int $key Clé de la valeur du rôle
* @param int $key Clé de la valeur du groupe
* @return string|null
*/
public function getPermission($key1, $key2 = null)
{
// Administrateur, toutes les permissions
if ($this->getUser('role') === self::ROLE_ADMIN) {
if ($this->getUser('group') === self::GROUP_ADMIN) {
return true;
} elseif ($this->getUser('role') <= self::ROLE_VISITOR) { // Groupe sans autorisation
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
return false;
} elseif (
// Groupe avec profil, consultation des autorisations sur deux clés
$key1
&& $key2
&& $this->user
&& $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1])
&& array_key_exists($key2, $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]))
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
&& array_key_exists($key2, $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]))
) {
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1, $key2]);
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
// Groupe avec profil, consultation des autorisations sur une seule clé
} elseif (
$key1
&& $this->user
&& $this->getData(['profil', $this->user['role'], $this->user['profil']])
&& array_key_exists($key1, $this->getData(['profil', $this->user['role'], $this->user['profil']]))
&& $this->getData(['profil', $this->user['group'], $this->user['profil']])
&& array_key_exists($key1, $this->getData(['profil', $this->user['group'], $this->user['profil']]))
) {
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]);
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]);
} else {
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
if (class_exists($key1)) {
$module = new $key1;
if (array_key_exists($key2, $module::$actions)) {
return $this->getUser('role') >= $module::$actions[$key2];
return $this->getUser('group') >= $module::$actions[$key2];
}
}
return false;
@ -1169,7 +1169,7 @@ class common
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques et les pages masquées
if (
$this->getData(['page', $parentPageId, 'role']) !== 0 ||
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
) {
continue;
@ -1197,7 +1197,7 @@ class common
}
// Sous-pages
foreach ($childrenPageIds as $childKey) {
if ($this->getData(['page', $childKey, 'role']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
if ($this->getData(['page', $childKey, 'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
continue;
}
// Cas de la page d'accueil ne pas dupliquer l'URL
@ -1251,15 +1251,12 @@ class common
}
/**
* Crée une miniature à partir d'une image source.
* Cette fonction prend en charge les formats raster (JPEG, PNG, GIF, WebP, AVIF) et vectoriels (SVG).
* Pour les images vectorielles (SVG), aucune redimension n'est effectuée : une copie est réalisée.
*
* @param string $src Chemin de l'image source.
* @param string $dest Chemin de l'image destination (avec le nom du fichier et l'extension).
* @param int $desired_width Largeur demandée pour la miniature (ignorée pour les SVG).
* @return bool True si l'opération a réussi, false sinon.
/*
* Création d'une miniature
* Fonction utilisée lors de la mise à jour d'une version 9 à une version 10
* @param string $src image source
* @param string $dets image destination
* @param integer $desired_width largeur demandée
*/
function makeThumb($src, $dest, $desired_width)
{
@ -1268,18 +1265,9 @@ function makeThumb($src, $dest, $desired_width)
if (!is_dir($fileInfo['dirname'])) {
mkdir($fileInfo['dirname'], 0755, true);
}
$extension = strtolower($fileInfo['extension']);
$mime_type = mime_content_type($src);
// Gestion des fichiers SVG (copie simple sans redimensionnement)
if ($extension === 'svg' || $mime_type === 'image/svg+xml') {
return copy($src, $dest);
}
// Chargement de l'image source selon le type
$source_image = '';
switch ($extension) {
// Type d'image
switch ($fileInfo['extension']) {
case 'jpeg':
case 'jpg':
$source_image = imagecreatefromjpeg($src);
@ -1294,51 +1282,35 @@ function makeThumb($src, $dest, $desired_width)
$source_image = imagecreatefromwebp($src);
break;
case 'avif':
if (function_exists('imagecreatefromavif')) {
$source_image = imagecreatefromavif($src);
} else {
return false; // AVIF non supporté
}
break;
default:
return false; // Format non pris en charge
}
// Image valide (formats raster uniquement)
if (is_resource($source_image) || (is_object($source_image) && $source_image instanceof GdImage)) {
// Image valide
if ($source_image) {
$width = imagesx($source_image);
$height = imagesy($source_image);
// Calcul de la hauteur proportionnelle à la largeur demandée
/* find the "desired height" of this thumbnail, relative to the desired width */
$desired_height = floor($height * ($desired_width / $width));
// Création d'une nouvelle image virtuelle redimensionnée
/* create a new, "virtual" image */
$virtual_image = imagecreatetruecolor($desired_width, $desired_height);
// Copie de l'image source dans l'image virtuelle avec redimensionnement
/* copy source image at a resized size */
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
// Enregistrement de l'image redimensionnée au format approprié
switch ($mime_type) {
switch (mime_content_type($src)) {
case 'image/jpeg':
case 'image/jpg':
return imagejpeg($virtual_image, $dest);
return (imagejpeg($virtual_image, $dest));
case 'image/png':
return imagepng($virtual_image, $dest);
return (imagepng($virtual_image, $dest));
case 'image/gif':
return imagegif($virtual_image, $dest);
return (imagegif($virtual_image, $dest));
case 'image/webp':
return imagewebp($virtual_image, $dest);
return (imagewebp($virtual_image, $dest));
case 'image/avif':
if (function_exists('imageavif')) {
return imageavif($virtual_image, $dest);
return (imageavif($virtual_image, $dest));
}
} else {
return (false);
}
}
}
return false; // En cas d'échec
}
/**
@ -1624,11 +1596,11 @@ function makeThumb($src, $dest, $desired_width)
$courses = $this->getData([('course')]);
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
$filter = array();
switch ($this->getUser('role')) {
case self::ROLE_ADMIN:
switch ($this->getUser('group')) {
case self::GROUP_ADMIN:
// Affiche tout
return $courses;
case self::ROLE_EDITOR:
case self::GROUP_EDITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces gérés par l'éditeur, les espaces où il participe et les espaces anonymes
if (
@ -1643,7 +1615,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::ROLE_MEMBER:
case self::GROUP_MEMBER:
foreach ($courses as $courseId => $value) {
// Affiche les espaces du participant et les espaces anonymes
if (
@ -1654,7 +1626,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::ROLE_VISITOR:
case self::GROUP_VISITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces anonymes
if ($this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST) {

View File

@ -3,17 +3,20 @@
/**
* Vérification de la version de PHP
*/
if(version_compare(PHP_VERSION, '7.2.0', '<') ) {
displayErrorPage('PHP 7.2+ mini requis - PHP 7.2+ mini required');
exit('PHP 7.2+ mini requis - PHP 7.2+ mini required');
}
if ( version_compare(PHP_VERSION, '8.3.999', '>') ) {
displayErrorPage('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
exit('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
}
/**
* Check les modules installés
*/
$e = [
'gd',
'json',
@ -28,22 +31,18 @@ $e = [
];
$m = get_loaded_extensions();
$b = false;
$missingModules = [];
foreach ($e as $k => $v) {
if (array_search($v,$m) === false) {
$b = true;
$missingModules[] = $v;
echo '<pre><p>Module PHP : ' . $v . ' manquant - Module PHP ' . $v . ' missing.</p></pre>';
}
}
if ($b) {
$errorMessage = 'ZwiiCMS ne peut pas démarrer ; les modules PHP suivants sont manquants : ' . implode(', ', $missingModules) . '<br />';
$errorMessage .= 'ZwiiCMS cannot start, the following PHP modules are missing: ' . implode(', ', $missingModules);
displayErrorPage($errorMessage);
}
if ($b)
exit('<pre><p>ZwiiCMS ne peut pas démarrer ; activez les extensions requises dans PHP.ini- ZwiiCMS cannot start, enabled PHP missing extensions into PHP.ini</p></pre>');
/**
* Contrôle les htaccess
* Contrôle les htacess
*/
$d = [
'',
'site/data/',
@ -52,33 +51,6 @@ $d = [
// 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour
];
foreach ($d as $key) {
if (file_exists($key . '.htaccess') === false) {
$errorMessage = 'ZwiiCMS ne peut pas démarrer, le fichier ' . $key . '.htaccess est manquant.<br />';
$errorMessage .= 'ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.';
displayErrorPage($errorMessage);
}
}
/**
* Fonction pour afficher une page d'erreur stylisée
*/
function displayErrorPage($message)
{
echo '<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Erreur - ZwiiCMS</title>
<link rel="stylesheet" href="core\layout\error.css">
</head>
<body>
<div class="error-container">
<h1>Erreur</h1>
<p>' . $message . '</p>
</div>
</body>
</html>';
exit;
if (file_exists($key . '.htaccess') === false)
exit('<pre>ZwiiCMS ne peut pas démarrer, le fichier ' .$key . '.htaccess est manquant.<br />ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.</pre>' );
}

View File

@ -4,25 +4,25 @@
* Mises à jour suivant les versions de ZwiiCampus
*/
// Version 1.7.00
if (
$this->getData(['core', 'dataVersion']) < 1700
) {
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
foreach (['1', '2'] as $role) {
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
foreach (['1', '2'] as $group) {
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
}
}
}
$this->setData(['core', 'dataVersion', 1700]);
}
// Version 1.8.00
if (
$this->getData(['core', 'dataVersion']) < 1800
) {
@ -46,90 +46,3 @@ if (
}
$this->setData(['core', 'dataVersion', 1800]);
}
// Version 1.20.02
if (
$this->getData(['core', 'dataVersion']) < 12002
) {
/**
* Installe dans le thème du menu la variable hidePages
**/
// Tableau à insérer
$a = [
'theme' =>
[
'menu' => [
'hidePages' => false
]
]
];
// Parcourir la structure pour écrire dans les fichiers JSON
foreach ($this->getData(['course']) as $courseId => $courseValues) {
$d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
// Insérer la variable hidePages si elle n'existe pas
if (isset($d['theme']['menu']['hidePages']) === false) {
$result = array_replace_recursive($d, $a);
file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
}
// Forcer la régénération du fichier theme.css
if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) {
unlink(self::DATA_DIR . $courseId . '/theme.css');
}
}
$this->setData(['core', 'dataVersion', 12002]);
}
// Version 1.21.00
if (
$this->getData(['core', 'dataVersion']) < 12100
) {
/**
* Renomme la clé dans la base des utilisateurs
*/
if (
is_array($this->getData(['user']))
&& empty($this->getData(['user'])) === false
) {
foreach ($this->getData(['user']) as $userId => $userValue) {
$d = $this->getData(['user', $userId]);
if (isset($d['group']) && $d['group'] !== '') {
$position = array_search('group', array_keys($d)) + 1;
$l = array_merge(
array_slice($d, 0, $position),
['role' => $d['group']],
array_slice($d, $position)
);
unset($l['group']);
$this->setData(['user', $userId, $l], false);
}
}
}
$this->saveDb('user');
/**
* Convertit les pages et les modules
*/
$courses = array_merge($this->getData(['course']), ['home' => array()]);
foreach ($courses as $courseId => $courseValue) {
// Les pages
$filePath = self::DATA_DIR . $courseId . '/page.json';
$jsonContent = file_get_contents($filePath);
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
if ($updatedJsonContent !== $jsonContent) {
file_put_contents($filePath, $updatedJsonContent);
}
// Les modules
$filePath = self::DATA_DIR . $courseId . '/module.json';
$jsonContent = file_get_contents($filePath);
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
if ($updatedJsonContent !== $jsonContent) {
file_put_contents($filePath, $updatedJsonContent);
}
}
$this->setData(['core', 'dataVersion', 12100]);
}

View File

@ -657,7 +657,6 @@ nav a:hover {
#menuLeft {
display: inline-flex;
float: left;
}
#menuRight {
@ -1201,7 +1200,6 @@ input[type='datetime-local'],
input[type='time'],
input[type='month'],
input[type='week'],
input[type='number'],
.inputFile,
select,
textarea {
@ -1227,7 +1225,6 @@ input[type='datetime-local']:hover,
input[type='time']:hover,
input[type='month']:hover,
input[type='week']:hover,
input[type='number']:hover,
.inputFile:hover,
select:hover,
textarea:hover {
@ -1242,7 +1239,6 @@ input[type='datetime-local'].notice,
input[type='time'].notice,
input[type='month'].notice,
input[type='week'].notice,
input[type='number'].notice,
.inputFile.notice,
select.notice,
textarea.notice {
@ -1258,7 +1254,6 @@ input[type='datetime-local'].notice:hover,
input[type='time'].notice:hover,
input[type='month'].notice:hover,
input[type='week'].notice:hover,
input[type='number'].notice:hover,
.inputFile.notice:hover,
select.notice:hover,
textarea.notice:hover {

View File

@ -1,22 +0,0 @@
body {
color: #000;
font: 75%/1.7em "Helvetica Neue", Helvetica, arial, sans-serif;
margin: 0;
padding: 80px;
background: url('../vendor/zwiico/png/error.png') 30px 30px no-repeat #fff;
}
h1 {
font-weight: bold;
color: #000;
font-size: 300%;
margin: 20px 0;
padding: 0;
}
p {
margin: 10px 0;
color: #777;
font-size: 16px;
line-height: 1.6;
}

View File

@ -35,7 +35,7 @@
</head>
<body>
<!-- Barre d'administration -->
<?php if ($this->getUser('role') > self::ROLE_MEMBER) : ?>
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
<?php $layout->showBar(); ?>
<?php endif; ?>
<!-- Notifications -->
@ -48,7 +48,7 @@
$this->getData(['theme', 'menu', 'position']) === 'top'
and $this->getData(['theme', 'menu', 'fixed']) === true
and $this->isConnected() === true
and $this->getUser('role') > self::ROLE_MEMBER
and $this->getUser('group') > self::GROUP_MEMBER
) {
echo '<nav id="navfixedconnected" >';
} else {

View File

@ -18,20 +18,20 @@ class config extends common
{
public static $actions = [
'backup' => self::ROLE_ADMIN,
'copyBackups' => self::ROLE_ADMIN,
'delBackups' => self::ROLE_ADMIN,
'configMetaImage' => self::ROLE_ADMIN,
'sitemap' => self::ROLE_ADMIN,
'index' => self::ROLE_ADMIN,
'restore' => self::ROLE_ADMIN,
'updateBaseUrl' => self::ROLE_ADMIN,
'script' => self::ROLE_ADMIN,
'logReset' => self::ROLE_ADMIN,
'logDownload' => self::ROLE_ADMIN,
'blacklistReset' => self::ROLE_ADMIN,
'blacklistDownload' => self::ROLE_ADMIN,
'testmail' => self::ROLE_ADMIN,
'backup' => self::GROUP_ADMIN,
'copyBackups' => self::GROUP_ADMIN,
'delBackups' => self::GROUP_ADMIN,
'configMetaImage' => self::GROUP_ADMIN,
'sitemap' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'restore' => self::GROUP_ADMIN,
'updateBaseUrl' => self::GROUP_ADMIN,
'script' => self::GROUP_ADMIN,
'logReset' => self::GROUP_ADMIN,
'logDownload' => self::GROUP_ADMIN,
'blacklistReset' => self::GROUP_ADMIN,
'blacklistDownload' => self::GROUP_ADMIN,
'testmail' => self::GROUP_ADMIN,
];
public static $timezones = [

View File

@ -38,10 +38,10 @@
]); ?>
</div>
<div class="col3">
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$roleNews), [
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$groupNews), [
'label' => 'Validation par clé ⚠️',
'selected' => $this->getData(['config', 'connect', 'mailAuth']),
'help' => 'La connexion est confirmée à l\'aide d\'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.'
'help' => 'La connexion est confirmée à l\'aide d\'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.'
]); ?>
</div>
<div class="col3 verticalAlignBottom">

View File

@ -20,7 +20,7 @@
]); ?>
</div>
<div class="col2">
<?php echo template::number('configProxyPort', [
<?php echo template::text('configProxyPort', [
'label' => 'Port du proxy',
'placeholder' => '6060',
'value' => $this->getData(['config', 'proxyPort'])

View File

@ -44,7 +44,7 @@
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
'checked' => helper::checkRewrite(),
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
'disabled' => helper::checkServerSoftware() === false and self::isModRewriteEnabled()
'disabled' => helper::checkServerSoftware() === false and config->isModRewriteEnabled()
]); ?>
</div>
</div>

View File

@ -17,30 +17,30 @@ class course extends common
{
public static $actions = [
'swap' => self::ROLE_VISITOR,
'suscribe' => self::ROLE_VISITOR,
'unsuscribe' => self::ROLE_MEMBER,
'index' => self::ROLE_EDITOR, // Fait
'edit' => self::ROLE_EDITOR, // Fait
'manage' => self::ROLE_EDITOR, // Fait
'users' => self::ROLE_EDITOR, // fait
'usersAdd' => self::ROLE_EDITOR, //Fait
'usersDelete' => self::ROLE_EDITOR, //Fait
'usersReportExport' => self::ROLE_EDITOR, //fait
'userDelete' => self::ROLE_EDITOR, //Fait
'userReport' => self::ROLE_MEMBER, //Fait
'userReportExport' => self::ROLE_EDITOR, //Fait
'backup' => self::ROLE_EDITOR, // Fait
'restore' => self::ROLE_EDITOR, //Fait
'reset' => self::ROLE_EDITOR,
'clone' => self::ROLE_ADMIN,
'add' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'category' => self::ROLE_ADMIN,
'categoryAdd' => self::ROLE_ADMIN,
'categoryEdit' => self::ROLE_ADMIN,
'categoryDelete' => self::ROLE_ADMIN,
'export' => self::ROLE_ADMIN,
'swap' => self::GROUP_VISITOR,
'suscribe' => self::GROUP_VISITOR,
'unsuscribe' => self::GROUP_MEMBER,
'index' => self::GROUP_EDITOR, // Fait
'edit' => self::GROUP_EDITOR, // Fait
'manage' => self::GROUP_EDITOR, // Fait
'users' => self::GROUP_EDITOR, // fait
'usersAdd' => self::GROUP_EDITOR, //Fait
'usersDelete' => self::GROUP_EDITOR, //Fait
'usersReportExport' => self::GROUP_EDITOR, //fait
'userDelete' => self::GROUP_EDITOR, //Fait
'userReport' => self::GROUP_MEMBER, //Fait
'userReportExport' => self::GROUP_EDITOR, //Fait
'backup' => self::GROUP_EDITOR, // Fait
'restore' => self::GROUP_EDITOR, //Fait
'reset' => self::GROUP_EDITOR,
'clone' => self::GROUP_ADMIN,
'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'category' => self::GROUP_ADMIN,
'categoryAdd' => self::GROUP_ADMIN,
'categoryEdit' => self::GROUP_ADMIN,
'categoryDelete' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
];
public static $courseAccess = [
@ -94,7 +94,7 @@ class course extends common
if (
$this->getUser('id')
&& $this->getUser('role')
&& $this->getUser('group')
) {
foreach ($this->getData(['course']) as $courseId => $courseValue) {
/**
@ -120,7 +120,7 @@ class course extends common
if ($this->getUser('permission', 'course', 'users') === true) {
$users = template::button('categoryUser' . $this->getUrl(2), [
'href' => helper::baseUrl() . 'course/users/' . $courseId,
'value' => template::ico('address-book'),
'value' => template::ico('users'),
]);
}
self::$courses[] = [
@ -156,7 +156,7 @@ class course extends common
// Accès limité aux admins
if (
$this->getUser('role') !== self::ROLE_ADMIN
$this->getUser('group') !== self::GROUP_ADMIN
) {
// Valeurs en sortie
$this->addOutput([
@ -180,7 +180,7 @@ class course extends common
$this->initData('theme', $courseId);
// Pointer RFM sur le dossier de l'espace
// self::$siteContent = $courseId;
self::$siteContent = $courseId;
// Ordonne les pages par position
$this->buildHierarchy();
@ -319,7 +319,7 @@ class course extends common
$this->initDB('page', $courseId);
// Pointer RFM sur le dossier de l'espace
// self::$siteContent = $courseId;
self::$siteContent = $courseId;
// Ordonne les pages par position
$this->buildHierarchy();
@ -378,7 +378,7 @@ class course extends common
$this->initDB('page', $courseId);
// Pointer RFM sur le dossier de l'espace
// self::$siteContent = $courseId;
self::$siteContent = $courseId;
// Ordonne les pages par position
$this->buildHierarchy();
@ -414,7 +414,7 @@ class course extends common
// Accès limité aux admins, à l'auteur ou éditeurs inscrits
if (
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
) {
// Valeurs en sortie
$this->addOutput([
@ -447,7 +447,7 @@ class course extends common
if (
// Accès limité aux admins
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
// Le contenu n'existe pas
|| $this->getData(['course', $courseId]) === null
) {
@ -487,7 +487,7 @@ class course extends common
if (
// Accès limité aux admins
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
) {
// Valeurs en sortie
$this->addOutput([
@ -526,7 +526,7 @@ class course extends common
if (
// Accès limité aux admins
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
) {
// Valeurs en sortie
$this->addOutput([
@ -557,7 +557,7 @@ class course extends common
{
if (
// Accès limité aux admins
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
) {
// Valeurs en sortie
$this->addOutput([
@ -592,7 +592,7 @@ class course extends common
if (
// Accès limité aux admins
$this->getUser('role') !== self::$actions[__FUNCTION__]
$this->getUser('group') !== self::$actions[__FUNCTION__]
) {
// Valeurs en sortie
$this->addOutput([
@ -637,10 +637,10 @@ class course extends common
// Contenu sélectionné
$courseId = $this->getUrl(2);
// Liste des rôles et des profils
// Liste des groupes et des profils
$courseGroups = $this->getData(['profil']);
foreach ($courseGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($courseGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -650,10 +650,10 @@ class course extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$courseGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -682,20 +682,20 @@ class course extends common
foreach ($users as $userId => $userValue) {
// Compte les rôles valides
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
if ($this->isPost()) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -736,20 +736,22 @@ class course extends common
}
self::$courseUsers[] = [
//$userId,
sprintf('%s %s', $this->getData(['user', $userId, 'lastname']), $this->getData(['user', $userId, 'firstname'])),
array_key_exists('lastPageView', $userValue) && isset($pages['page'][$userValue['lastPageView']]['title'])
? $pages['page'][$userValue['lastPageView']]['title']
$this->getData(['user', $userId, 'firstname']) . ' ' . $this->getData(['user', $userId, 'lastname']),
array_key_exists('lastPageView', $userValue) && isset($pages[$userValue['lastPageView']]['title'])
? $pages[$userValue['lastPageView']]['title']
: '',
array_key_exists('lastPageView', $userValue)
// ? helper::dateUTF8('%d/%m/%Y', $userValue['datePageView'])
? $userValue['datePageView']
? helper::dateUTF8('%d/%m/%Y', $userValue['datePageView'])
: '',
array_key_exists('datePageView', $userValue)
? helper::dateUTF8('%H:%M', $userValue['datePageView'])
: '',
$this->getData(['user', $userId, 'tags']),
$reportButton,
template::button('userDelete' . $userId, [
'class' => 'userDelete buttonRed',
'href' => helper::baseUrl() . 'course/userDelete/' . $courseId . '/' . $userId,
'value' => template::ico('user-times'),
'value' => template::ico('user'),
'help' => 'Désinscrire'
])
];
@ -757,11 +759,11 @@ class course extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$courseGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$courseGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$courseGroups['all'] = self::$courseGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$courseGroups[$roleId] = self::$courseGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$courseGroups[$groupId] = self::$courseGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}
@ -808,10 +810,10 @@ class course extends common
$this->saveDB('enrolment');
}
// Liste des rôles et des profils
// Liste des groupes et des profils
$courseGroups = $this->getData(['profil']);
foreach ($courseGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($courseGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -821,10 +823,10 @@ class course extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$courseGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -850,8 +852,8 @@ class course extends common
foreach ($users as $userId => $userValue) {
// Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
@ -862,13 +864,13 @@ class course extends common
) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -896,11 +898,11 @@ class course extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$courseGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$courseGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$courseGroups['all'] = self::$courseGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$courseGroups[$roleId] = self::$courseGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$courseGroups[$groupId] = self::$courseGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}
@ -976,10 +978,10 @@ class course extends common
}
}
// Liste des rôles et des profils
// Liste des groupes et des profils
$courseGroups = $this->getData(['profil']);
foreach ($courseGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($courseGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -989,10 +991,10 @@ class course extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$courseGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -1013,8 +1015,8 @@ class course extends common
foreach ($users as $userId => $userValue) {
// Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
@ -1025,13 +1027,13 @@ class course extends common
) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -1060,11 +1062,11 @@ class course extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$courseGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$courseGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$courseGroups['all'] = self::$courseGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$courseGroups[$roleId] = self::$courseGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$courseGroups[$groupId] = self::$courseGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}
@ -1738,7 +1740,7 @@ class course extends common
$this->initDB('page', $courseId);
// Pointer RFM sur le dossier de l'espace
// self::$siteContent = $courseId;
self::$siteContent = $courseId;
// Ordonne les pages par position
$this->buildHierarchy();
@ -1892,7 +1894,7 @@ class course extends common
) {
// Récupérer le dossier du profil
$userPath = $this->getData(['profil', $this->getuser('role'), $this->getuser('profil'), 'folder', 'path']);
$userPath = $this->getData(['profil', $this->getuser('group'), $this->getuser('profil'), 'folder', 'path']);
$userPath = $userPath === '' ? self::$siteContent : $userPath;
// Fichier avec le bon chemin selon le profil
$zipName = self::FILE_DIR . 'source/' . $userPath . '/' . $this->getInput('courseRestoreFile', null, true);
@ -2003,13 +2005,13 @@ class course extends common
*/
public function permissionControl($function, $courseId)
{
switch ($this->getUser('role')) {
case self::ROLE_ADMIN:
switch ($this->getUser('group')) {
case self::GROUP_ADMIN:
return true;
case self::ROLE_EDITOR:
case self::GROUP_EDITOR:
return (
$this->getUser('permission', __CLASS__, $function)
&& $this->getUser('role') === self::$actions[$function]
&& $this->getUser('group') === self::$actions[$function]
&&
// Permission d'accéder aux espaces dans lesquels le membre auteur
(
@ -2043,7 +2045,7 @@ class course extends common
// Si un utilisateur connecté est admin ou auteur, c'est autorisé
if (
$this->isConnected() === true &&
($this->getUser('role') === self::ROLE_ADMIN ||
($this->getUser('group') === self::GROUP_ADMIN ||
$this->getUser('id') === $this->getData(['course', $courseId, 'author']))
) {
return true;
@ -2150,20 +2152,20 @@ class course extends common
private function courseIsUserEnroled($courseId)
{
$userId = $this->getUser('id');
$role = $userId ? $this->getData(['user', $userId, 'role']) : null;
switch ($role) {
case self::ROLE_ADMIN:
$group = $userId ? $this->getData(['user', $userId, 'group']) : null;
switch ($group) {
case self::GROUP_ADMIN:
$r = true;
break;
case self::ROLE_EDITOR:
case self::ROLE_MEMBER:
case self::GROUP_EDITOR:
case self::GROUP_MEMBER:
$r = false;
if (!is_null($this->getData(['enrolment', $courseId]))) {
$r = in_array($userId, array_keys($this->getData(['enrolment', $courseId])));
}
break;
// Visiteur non connecté
case self::ROLE_VISITOR:
case self::GROUP_VISITOR:
case null:
$r = $this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST;
break;

View File

@ -3,7 +3,7 @@
<?php echo template::button('courseUserHistoryBack', [
'class' => 'buttonGrey',
// Le retour est différent selon que c'est un admin ou un tuteur ou l'utilisateur lui-même
'href' => $this->getUser('role') === self::ROLE_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
'href' => $this->getUser('group') === self::GROUP_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
'value' => template::ico('left')
]); ?>
</div>
@ -13,7 +13,7 @@
'value' => template::ico('download'),
'help' => 'Exporter rapport',
// Le memebre ne peut pas exporter
'disabled' => $this->getUser('role') === self::ROLE_MEMBER
'disabled' => $this->getUser('group') === self::GROUP_MEMBER
]) ?>
</div>
</div>

View File

@ -21,6 +21,7 @@ $(document).ready((function () {
$(location).attr("href", _this.attr("href"))
}))
}));
$.fn.dataTable.moment( 'DD/MM/YYYY' );
$('#dataTables').DataTable({
language: {
url: "core/vendor/datatables/french.json"
@ -31,26 +32,11 @@ $(document).ready((function () {
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
"columnDefs": [
{
targets: 2,
type: 'datetime',
searchable: false,
render: function (data, type, row) {
if (type === 'display') {
if (typeof data === 'number' || !isNaN(data)) {
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
} else {
return data;
}
}
// Pour le tri, retournez la valeur au format ISO
return moment(Number(data) * 1000).toISOString();
}
},
{
targets: 5,
target: 6,
orderable: false,
searchable: false
}]
}
]
});
}));

View File

@ -17,7 +17,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'userDeleteAll buttonRed',
'href' => helper::baseUrl() . 'course/usersDelete/' . $this->getUrl(2),
'value' => template::ico('user-times'),
'value' => template::ico('users'),
'help' => 'Désinscrire en masse',
])?>
</div>
@ -25,7 +25,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'buttonGreen',
'href' => helper::baseUrl() . 'course/usersAdd/' . $this->getUrl(2),
'value' => template::ico('user-plus'),
'value' => template::ico('users'),
'help' => 'Inscription en masse',
]) ?>
</div>
@ -53,7 +53,7 @@
</div>
<?php echo template::formClose(); ?>
<?php if (course::$courseUsers): ?>
<?php echo template::table([3, 3, 2, 2, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
<?php echo template::table([3, 4, 1, 1, 1, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Heure', 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
<?php else: ?>
<?php echo template::speech('Aucun participant'); ?>
<?php endif; ?>

View File

@ -18,10 +18,10 @@ class install extends common
{
public static $actions = [
'index' => self::ROLE_VISITOR,
"postinstall" => self::ROLE_VISITOR,
'steps' => self::ROLE_ADMIN,
'update' => self::ROLE_ADMIN
'index' => self::GROUP_VISITOR,
"postinstall" => self::GROUP_VISITOR,
'steps' => self::GROUP_ADMIN,
'update' => self::GROUP_ADMIN
];
// Type de proxy
@ -135,7 +135,7 @@ class install extends common
[
'firstname' => $userFirstname,
'forgot' => 0,
'role' => self::ROLE_ADMIN,
'group' => self::GROUP_ADMIN,
'profil' => 0,
'lastname' => $userLastname,
'pseudo' => 'Admin',

View File

@ -64,7 +64,7 @@ class init extends common
]
],
'core' => [
'dataVersion' => 12002,
'dataVersion' => 1700,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
@ -645,7 +645,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Accueil',
@ -676,7 +676,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 6,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Contact',
@ -707,7 +707,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Mentions légales',
@ -739,7 +739,7 @@ class init extends common
'modulePosition' => '',
'parentPageId' => '',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Maintenance en cours',
@ -771,7 +771,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Erreur 403',
@ -802,7 +802,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Erreur 404',
@ -903,8 +903,7 @@ class init extends common
'selectSpace' => true,
'burgerLogo' => '',
'burgerContent' => 'title',
'width' => 'container',
'hidePages' => false,
'width' => 'container'
],
'site' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
@ -938,7 +937,7 @@ class init extends common
'config' => [
'button' => '',
'captcha' => true,
'role' => self::ROLE_ADMIN,
'group' => self::GROUP_ADMIN,
'pageId' => '',
'subject' => ''
],
@ -1065,7 +1064,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Sommaire',
@ -1096,7 +1095,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Première page',
@ -1127,7 +1126,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Seconde page',
@ -1158,7 +1157,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Troisième page',
@ -1189,7 +1188,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'role' => 0,
'group' => 0,
'profil' => 0,
'targetBlank' => false,
'title' => 'Menu',

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)",
"Gras": "Bold",
"Rôle": "role",
"Rôle associé": "Associated role",
"Rôle requis pour accéder à la page :": "role required to access the page:",
"Groupe": "Group",
"Groupe associé": "Associated Group",
"Groupe requis pour accéder à la page :": "Group required to access the page:",
"Groupes": "Groups",
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
"Générer une capture Open Graph": "Generate an Open Graph capture",
@ -295,7 +295,7 @@
"Importer dans": "Import into",
"Importer des utilisateurs en masse": "Import mass users",
"Impossible d'ouvrir l'archive": "Impossible to open the archive",
"Impossible de modifier votre propre rôle.": "Unable to modify your own group.",
"Impossible de modifier votre propre groupe.": "Unable to modify your own group.",
"Impossible de soumettre le formulaire, car il contient des erreurs": "Unable to submit the form, as it contains errors",
"Impossible de supprimer une page contenant des pages enfants": "Unable to delete a page containing children's pages",
"Impossible de supprimer votre propre compte": "Unable to delete your own account",
@ -489,7 +489,7 @@
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "To define the page as a sidebar, choose the option from the list.",
"Presse Papier": "Clipboard",
"Presse papier": "Clipboard",
"Profils des rôles": "Group Profiles",
"Profils des groupes": "Group Profiles",
"Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.",
"Prénom": "First name",
"Prénom Nom": "First name Name",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Test message sent successfully",
"Message non envoyé": "Message not sent",
"Validation par clé ⚠️": "Key-based validation ⚠️",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "The connection is confirmed using a key sent via messaging. From the selected group and the higher groups.",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "The connection is confirmed using a key sent via messaging. From the selected group and the higher groups.",
"Envoi du message d'authentification": "Sending authentication message",
"Connexion réussie": "Login successful",
"Erreur de mot de passe": "Password error",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)",
"Gras": "Negrita",
"Rôle": "Grupo",
"Rôle associé": "Grupo asociado",
"Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Groupe": "Grupo",
"Groupe associé": "Grupo asociado",
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Groupes": "Grupos",
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
"Générer une capture Open Graph": "Generar una captura de Open Graph",
@ -295,7 +295,7 @@
"Importer dans": "Importar a",
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
"Impossible de modifier votre propre rôle.": "No puede editar su propio grupo.",
"Impossible de modifier votre propre groupe.": "No puede editar su propio grupo.",
"Impossible de soumettre le formulaire, car il contient des erreurs": "No se puede enviar el formulario porque contiene errores",
"Impossible de supprimer une page contenant des pages enfants": "No se puede eliminar una página que contiene páginas secundarias",
"Impossible de supprimer votre propre compte": "No puede eliminar su propia cuenta",
@ -489,7 +489,7 @@
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "Para configurar la página como barra lateral, elija la opción de la lista.",
"Presse Papier": "Portapapeles",
"Presse papier": "Portapapeles",
"Profils des rôles": "Perfiles de grupos",
"Profils des groupes": "Perfiles de grupos",
"Proportionnelle à la taille définie dans le site.": "Proporcional a la definida en el sitio.",
"Prénom": "Nombre de pila",
"Prénom Nom": "Nombre Apellido",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
"Message non envoyé": "Mensaje no enviado",
"Validation par clé ⚠️": "Validación por clave ⚠️",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "La conexión se confirma con una clave enviada por mensajería. Desde el grupo seleccionado y los grupos superiores.",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "La conexión se confirma con una clave enviada por mensajería. Desde el grupo seleccionado y los grupos superiores.",
"Envoi du message d'authentification": "Envío del mensaje de autenticación",
"Connexion réussie": "Conexión exitosa",
"Erreur de mot de passe": "Error de contraseña",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "",
"Grande (300px)": "",
"Gras": "",
"Rôle": "",
"Rôle associé": "",
"Rôle requis pour accéder à la page :": "",
"Groupe": "",
"Groupe associé": "",
"Groupe requis pour accéder à la page :": "",
"Groupes": "",
"Générer sitemap.xml et robots.txt": "",
"Générer une capture Open Graph": "",
@ -295,7 +295,7 @@
"Importer dans": "",
"Importer des utilisateurs en masse": "",
"Impossible d'ouvrir l'archive": "",
"Impossible de modifier votre propre rôle.": "",
"Impossible de modifier votre propre groupe.": "",
"Impossible de soumettre le formulaire, car il contient des erreurs": "",
"Impossible de supprimer une page contenant des pages enfants": "",
"Impossible de supprimer votre propre compte": "",
@ -489,7 +489,7 @@
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "",
"Presse Papier": "",
"Presse papier": "",
"Profils des rôles": "",
"Profils des groupes": "",
"Proportionnelle à la taille définie dans le site.": "",
"Prénom": "",
"Prénom Nom": "",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "",
"Message non envoyé": "",
"Validation par clé ⚠️": "",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "",
"Envoi du message d'authentification": "",
"Connexion réussie": "",
"Erreur de mot de passe": "",

View File

@ -16,7 +16,3 @@
/** NE PAS EFFACER
* admin.css
*/
.container.light {
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
}

View File

@ -20,7 +20,3 @@
.title {
font-weight: bold;
}
.container.light {
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
}

View File

@ -20,19 +20,19 @@ class language extends common
const ZWII_UI_URL = 'https://forge.chapril.org/ZwiiCMS-Team/zwiicms-translations/raw/branch/master/v13/';
public static $actions = [
'index' => self::ROLE_ADMIN,
'copy' => self::ROLE_ADMIN,
'add' => self::ROLE_ADMIN,
'index' => self::GROUP_ADMIN,
'copy' => self::GROUP_ADMIN,
'add' => self::GROUP_ADMIN,
// Ajouter une langue de contenu
'edit' => self::ROLE_ADMIN,
'edit' => self::GROUP_ADMIN,
// Éditer une langue de l'UI
'locale' => self::ROLE_ADMIN,
'locale' => self::GROUP_ADMIN,
// Éditer une langue de contenu
'delete' => self::ROLE_ADMIN,
'delete' => self::GROUP_ADMIN,
// Effacer une langue de contenu ou de l'interface
'content' => self::ROLE_VISITOR,
'update' => self::ROLE_ADMIN,
'default' => self::ROLE_ADMIN
'content' => self::GROUP_VISITOR,
'update' => self::GROUP_ADMIN,
'default' => self::GROUP_ADMIN
];
const PAGINATION = '20';

View File

@ -17,7 +17,7 @@ class maintenance extends common
{
public static $actions = [
'index' => self::ROLE_VISITOR
'index' => self::GROUP_VISITOR
];
/**

View File

@ -18,12 +18,13 @@ class page extends common
{
public static $actions = [
'add' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'duplicate' => self::ROLE_EDITOR,
'jsEditor' => self::ROLE_EDITOR,
'cssEditor' => self::ROLE_EDITOR,
'add' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_EDITOR,
'jsEditor' => self::GROUP_EDITOR,
'cssEditor' => self::GROUP_EDITOR,
'register' => self::GROUP_EDITOR,
];
public static $pagesNoParentId = [
'' => 'Aucune'
@ -180,7 +181,7 @@ class page extends common
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => $pageTitle,
'shortTitle' => $pageTitle,
@ -473,7 +474,7 @@ class page extends common
$this->setData(['config', 'page302', $pageId], false);
}
// Sauvegarde la base manuellement
$this->saveDB('config');
$this->saveDB(module: 'config');
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
$lastPosition = 1;
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
@ -542,17 +543,17 @@ class page extends common
}
}
}
// Détermine le rôle selon que la page est une barre ou une page standard
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
// Détermine le groupe selon que la page est une barre ou une page standard
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
//Détermine le profil d'utilisateur en fonction du rôle sinon le rôle vaut 0
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0
$profil = 0;
if (
$this->getinput('pageEditBlock') !== 'bar' ||
$role === 1 ||
$role === 2
$group === 1 ||
$group === 2
) {
$profil = $this->getInput('pageEditProfil' . $role, helper::FILTER_INT);
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT);
}
// Modifie la page ou en crée une nouvelle si l'id a changé
@ -572,7 +573,7 @@ class page extends common
'modulePosition' => $this->getInput('pageModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position,
'role' => $role,
'group' => $group,
'profil' => $profil,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
@ -593,19 +594,6 @@ class page extends common
]
]);
/**
* Sauvegarde l'onglet de l'utilisateur
*/
$this->setData([
'user',
$this->getUser('id'),
'view',
[
'page' => $this->getInput('containerSelected'),
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
]
]);
// Creation du contenu de la page
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
@ -666,11 +654,11 @@ class page extends common
// Profils installés
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::ROLE_MEMBER) {
if ($profilId < self::GROUP_MEMBER) {
continue;
}
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
continue;
}
foreach ($profilData as $key => $value) {
@ -772,4 +760,25 @@ class page extends common
return json_encode($d);
}
/**
* Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite
* @return never
*/
public function register(): void
{
$this->setData([
'user',
$this->getUser('id'),
'view',
[
'page' => $this->getUrl(2),
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
]
]);
// Valeurs en sortie
$this->addOutput([
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(3) . '/' . self::$siteContent,
]);
}
}

View File

@ -283,18 +283,10 @@ $( document ).ready(function() {
// Gestion des évènements
//--------------------------------------------------------------------------------------
/**
* Transmet le bouton de l'onglet sélectionné avant la soumission
*/
$('#pageEditForm').on('submit', function () {
$('#containerSelected').val(pageLayout);
});
/**
* Sélection de la page de configuration à afficher
*/
$("#pageEditContentButton").on("click", function () {
pageLayout = "content";
$("#pageEditContentContainer").show();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
@ -302,25 +294,11 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").addClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditPositionButton").on("click", function () {
pageLayout = "position";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").show();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").addClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditExtensionButton").on("click", function () {
pageLayout = "extension";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").show();
$("#pageEditPositionContainer").hide();
@ -328,12 +306,23 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").addClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#PageEditPositionButton").on("click", function () {
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").show();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#PageEditPositionButton").addClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditLayoutButton").on("click", function () {
pageLayout = "layout";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
@ -341,12 +330,11 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").addClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditPermissionButton").on("click", function () {
pageLayout = "permission";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();

View File

@ -35,33 +35,30 @@
<?php echo template::button('pageEditContentButton', [
'value' => 'Contenu',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditPositionButton', [
'value' => 'Menu',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditExtensionButton', [
'value' => 'Extension',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditLayoutButton', [
'value' => 'Mise en page',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditPermissionButton', [
'value' => 'Permission',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
]); ?>
</div>
<!-- Champ caché pour transmettre l'onglet-->
<?php echo template::hidden('containerSelected'); ?>
<div id="pageEditContentContainer" class="tabContent">
<div class="row">
<div class="col12">
@ -358,24 +355,24 @@
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', self::$rolePublics, [
'label' => 'Rôle minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
'help' => 'Les rôles de niveau supérieur accèdent à la page.'
<?php echo template::select('pageEditGroup', self::$groupPublics, [
'label' => 'Groupe minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
]); ?>
</div>
<div class="col6">
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_MEMBER, page::$userProfils[self::ROLE_MEMBER], [
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, page::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',
]); ?>
</div>
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_EDITOR, page::$userProfils[self::ROLE_EDITOR], [
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, page::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',

View File

@ -21,15 +21,15 @@ class plugin extends common
{
public static $actions = [
'index' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'save' => self::ROLE_ADMIN,
'store' => self::ROLE_ADMIN,
//'item' => self::ROLE_ADMIN,
'index' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN,
'store' => self::GROUP_ADMIN,
//'item' => self::GROUP_ADMIN,
// détail d'un objet
'upload' => self::ROLE_ADMIN,
'upload' => self::GROUP_ADMIN,
// Téléverser catalogue
'uploadItem' => self::ROLE_ADMIN // Téléverser par archive
'uploadItem' => self::GROUP_ADMIN // Téléverser par archive
];
// URL des modules

View File

@ -16,7 +16,7 @@
class sitemap extends common
{
public static $actions = [
'index' => self::ROLE_VISITOR
'index' => self::GROUP_VISITOR
];
public static $siteMap = '';
@ -29,7 +29,7 @@ class sitemap extends common
$items = '<ul>';
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
$items .= ' <li>';
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('role') >= $this->getData(['page', $parentId, 'role'])) {
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
$pageUrl = ($parentId !== $this->homePageId()) ? helper::baseUrl() . $parentId : helper::baseUrl(false);
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>';
} else {
@ -66,7 +66,7 @@ class sitemap extends common
$items .= '<ul>';
// Sous-page
$items .= ' <li>';
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('role') >= $this->getData(['page', $parentId, 'role'])) {
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
$pageUrl = ($childId !== $this->homePageId()) ? helper::baseUrl() . $childId : helper::baseUrl(false);
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
} else {

View File

@ -18,23 +18,23 @@ class theme extends common
{
public static $actions = [
'advanced' => self::ROLE_ADMIN,
'body' => self::ROLE_ADMIN,
'footer' => self::ROLE_ADMIN,
'header' => self::ROLE_ADMIN,
'index' => self::ROLE_ADMIN,
'menu' => self::ROLE_ADMIN,
'reset' => self::ROLE_ADMIN,
'site' => self::ROLE_ADMIN,
'admin' => self::ROLE_ADMIN,
'manage' => self::ROLE_ADMIN,
'export' => self::ROLE_ADMIN,
'import' => self::ROLE_ADMIN,
'save' => self::ROLE_ADMIN,
'font' => self::ROLE_ADMIN,
'fontAdd' => self::ROLE_ADMIN,
'fontEdit' => self::ROLE_ADMIN,
'fontDelete' => self::ROLE_ADMIN
'advanced' => self::GROUP_ADMIN,
'body' => self::GROUP_ADMIN,
'footer' => self::GROUP_ADMIN,
'header' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'menu' => self::GROUP_ADMIN,
'reset' => self::GROUP_ADMIN,
'site' => self::GROUP_ADMIN,
'admin' => self::GROUP_ADMIN,
'manage' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN,
'font' => self::GROUP_ADMIN,
'fontAdd' => self::GROUP_ADMIN,
'fontEdit' => self::GROUP_ADMIN,
'fontDelete' => self::GROUP_ADMIN
];
public static $aligns = [
'left' => 'À gauche',
@ -893,11 +893,11 @@ class theme extends common
$redirect = '';
switch ($this->getUrl(2)) {
case 'admin':
unlink(self::DATA_DIR . 'admin.css');
$this->initData('admin', self::$i18nUI);
$redirect = helper::baseUrl() . 'theme/admin';
break;
case 'manage':
$this->initData('theme', self::$siteContent);
$this->initData('theme', self::$i18nUI);
$redirect = helper::baseUrl() . 'theme/manage';
break;
case 'custom':

View File

@ -1,4 +1,4 @@
id;nom;prenom;email;role;profil;passe;tags
id;nom;prenom;email;groupe;profil;passe;tags
jm1;Membre1;Jean;jean.membre1@email.fr;1;1;jEan05;"adhérent"
am2;Membre2;Albert;albert.membre2@email.fr;1;1;alBertAG;"adhérent"
jrediteur;Editeur;Robert;robert.editeur@email.fr;2;1;roBert54;"trésorier"

1 id nom prenom email role groupe profil passe tags
2 jm1 Membre1 Jean jean.membre1@email.fr 1 1 1 jEan05 adhérent
3 am2 Membre2 Albert albert.membre2@email.fr 1 1 1 alBertAG adhérent
4 jrediteur Editeur Robert robert.editeur@email.fr 2 2 1 roBert54 trésorier

View File

@ -17,23 +17,23 @@ class user extends common
{
public static $actions = [
'add' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'usersDelete' => self::ROLE_ADMIN,
'import' => self::ROLE_ADMIN,
'index' => self::ROLE_ADMIN,
'template' => self::ROLE_ADMIN,
'edit' => self::ROLE_MEMBER,
'logout' => self::ROLE_MEMBER,
'forgot' => self::ROLE_VISITOR,
'login' => self::ROLE_VISITOR,
'auth' => self::ROLE_VISITOR,
'reset' => self::ROLE_VISITOR,
'profil' => self::ROLE_ADMIN,
'profilEdit' => self::ROLE_ADMIN,
'profilAdd' => self::ROLE_ADMIN,
'profilDelete' => self::ROLE_ADMIN,
'tag' => self::ROLE_ADMIN,
'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'usersDelete' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'template' => self::GROUP_ADMIN,
'edit' => self::GROUP_MEMBER,
'logout' => self::GROUP_MEMBER,
'forgot' => self::GROUP_VISITOR,
'login' => self::GROUP_VISITOR,
'auth' => self::GROUP_VISITOR,
'reset' => self::GROUP_VISITOR,
'profil' => self::GROUP_ADMIN,
'profilEdit' => self::GROUP_ADMIN,
'profilAdd' => self::GROUP_ADMIN,
'profilDelete' => self::GROUP_ADMIN,
'tag' => self::GROUP_ADMIN,
];
public static $users = [];
@ -67,9 +67,9 @@ class user extends common
'site/file/source/'
];
public static $roleProfils = [
self::ROLE_MEMBER => 'Membre',
self::ROLE_EDITOR => 'Éditeur'
public static $groupProfils = [
self::GROUP_MEMBER => 'Membre',
self::GROUP_EDITOR => 'Éditeur'
];
public static $listModules = [];
@ -111,10 +111,10 @@ class user extends common
$password = $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true);
// Profil
$role = $this->getInput('userAddGroup', helper::FILTER_INT, true);
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
$profil = 0;
if ($role === 1 || $role === 2) {
$profil = $this->getInput('userAddProfil' . $role, helper::FILTER_INT);
if ($group === 1 || $group === 2) {
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
}
// Stockage des données
@ -124,7 +124,7 @@ class user extends common
[
'firstname' => $userFirstname,
'forgot' => 0,
'role' => $role,
'group' => $group,
'profil' => $profil,
'lastname' => $userLastname,
'pseudo' => $pseudo,
@ -176,12 +176,12 @@ class user extends common
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::ROLE_MEMBER) {
if ($profilId < self::GROUP_MEMBER) {
continue;
}
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::ROLE_ADMIN] = $profilData['comment'];
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment'];
continue;
}
foreach ($profilData as $key => $value) {
@ -209,7 +209,7 @@ class user extends common
// L'utilisateur n'existe pas
$this->getData(['user', $this->getUrl(2)]) === null
// Groupe insuffisant
and ($this->getUrl('role') < self::ROLE_EDITOR)
and ($this->getUrl('group') < self::GROUP_EDITOR)
) {
// Valeurs en sortie
$this->addOutput([
@ -287,11 +287,11 @@ class user extends common
}
// Liste des rôles et des profils
// Liste des groupes et des profils
$usersGroups = $this->getData(['profil']);
foreach ($usersGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($usersGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -301,10 +301,10 @@ class user extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$usersGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -324,8 +324,8 @@ class user extends common
foreach ($users as $userId => $userValue) {
// Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
@ -336,13 +336,13 @@ class user extends common
) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -372,11 +372,11 @@ class user extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$usersGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$usersGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$usersGroups['all'] = self::$usersGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$usersGroups[$roleId] = self::$usersGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$usersGroups[$groupId] = self::$usersGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}
@ -411,10 +411,10 @@ class user extends common
and (
// Impossible de s'auto-éditer
($this->getUser('id') === $this->getUrl(2)
and $this->getUrl('role') <= self::ROLE_VISITOR
and $this->getUrl('group') <= self::GROUP_VISITOR
)
// Impossible d'éditer un autre utilisateur
or ($this->getUrl('role') < self::ROLE_EDITOR)
or ($this->getUrl('group') < self::GROUP_EDITOR)
)
) {
// Valeurs en sortie
@ -430,7 +430,7 @@ class user extends common
) {
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
// Double vérification pour le mot de passe
if ($this->getUser('role') < self::ROLE_ADMIN) {
if ($this->getUser('group') < self::GROUP_ADMIN) {
if ($this->getInput('userEditNewPassword')) {
// L'ancien mot de passe est correct
if (
@ -465,17 +465,17 @@ class user extends common
}
}
// Modification du rôle
// Modification du groupe
if (
$this->getUser('role') === self::ROLE_ADMIN
$this->getUser('group') === self::GROUP_ADMIN
and $this->getUrl(2) !== $this->getUser('id')
) {
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
} else {
$newGroup = $this->getData(['user', $this->getUrl(2), 'role']);
$newGroup = $this->getData(['user', $this->getUrl(2), 'group']);
}
// Modification de nom Prénom
if ($this->getUser('role') === self::ROLE_ADMIN) {
if ($this->getUser('group') === self::GROUP_ADMIN) {
$newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true);
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
} else {
@ -494,7 +494,7 @@ class user extends common
[
'firstname' => $newfirstname,
'forgot' => 0,
'role' => $newGroup,
'group' => $newGroup,
'profil' => $profil,
'lastname' => $newlastname,
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
@ -517,7 +517,7 @@ class user extends common
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
}
// Redirection si retour en arrière possible
elseif ($this->getUser('role') === self::ROLE_ADMIN) {
elseif ($this->getUser('group') === self::GROUP_ADMIN) {
$redirect = helper::baseUrl() . 'user';
}
// Redirection normale
@ -542,12 +542,12 @@ class user extends common
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::ROLE_MEMBER) {
if ($profilId < self::GROUP_MEMBER) {
continue;
}
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::ROLE_ADMIN] = $profilData['comment'];
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment'];
continue;
}
foreach ($profilData as $key => $value) {
@ -594,12 +594,11 @@ class user extends common
);
}
// L'utilisateur n'existe pas, on ne le précise pas
// Valeurs en sortie
$this->addOutput([
'notification' => $sent === true ? helper::translate('Un mail a été envoyé pour confirmer la réinitialisation') : helper::translate('Le mail de réinitialisation ne peut pas être envoyé, contactez l\'administrateur'),
'state' => ($sent === true ? true : false),
'redirect' => helper::baseUrl()
'notification' => helper::translate('Un mail a été envoyé pour confirmer la réinitialisation'),
'state' => ($sent === true ? true : null)
]);
}
// Valeurs en sortie
@ -615,10 +614,10 @@ class user extends common
*/
public function index()
{
// Liste des rôles et des profils
// Liste des groupes et des profils
$usersGroups = $this->getData(['profil']);
foreach ($usersGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($usersGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -628,10 +627,10 @@ class user extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$usersGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -647,23 +646,23 @@ class user extends common
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
ksort($userIdsLastNames);
foreach ($userIdsLastNames as $userId => $userLastNames) {
if ($this->getData(['user', $userId, 'role'])) {
if ($this->getData(['user', $userId, 'group'])) {
// Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
if ($this->isPost()) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('userFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('userFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('userFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -680,19 +679,18 @@ class user extends common
continue;
}
// Formatage de la liste
self::$users[] = [
//$userId,
sprintf('%s %s',$userLastNames, $this->getData(['user', $userId, 'firstname'])),
helper::translate(self::$roles[(int) $this->getData(['user', $userId, 'role'])]),
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$roles[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
$this->getData(['user', $userId, 'firstname']) . ' ' . $userLastNames,
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]),
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
$this->getData(['user', $userId, 'tags']),
is_null($this->getData(['user', $userId, 'accessTimer']))
? 'Jamais'
: $this->getData(['user', $userId, 'accessTimer']),
//helper::dateUTF8('%d/%m/%Y', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
helper::dateUTF8('%d/%m/%Y', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
//helper::dateUTF8('%H:%M', $this->getData(['user', $userId, 'accessTimer']), self::$i18nUI),
template::button('userEdit' . $userId, [
'href' => helper::baseUrl() . 'user/edit/' . $userId,
@ -702,7 +700,7 @@ class user extends common
template::button('userDelete' . $userId, [
'class' => 'userDelete buttonRed',
'href' => helper::baseUrl() . 'user/delete/' . $userId,
'value' => template::ico('user-times'),
'value' => template::ico('trash'),
'help' => 'Supprimer'
])
];
@ -711,11 +709,11 @@ class user extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$usersGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$usersGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$usersGroups['all'] = self::$usersGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$usersGroups[$roleId] = self::$usersGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$usersGroups[$groupId] = self::$usersGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}
@ -730,63 +728,63 @@ class user extends common
}
/**
* Table des rôles
* Table des groupes
*/
public function profil()
{
// Ne pas supprimer un profil utililsé
// recherche les membres du rôle
$roles = helper::arrayColumn($this->getData(['user']), 'role');
$roles = array_keys($roles, $this->getUrl(2));
// recherche les membres du groupe
$groups = helper::arrayColumn($this->getData(['user']), 'group');
$groups = array_keys($groups, $this->getUrl(2));
$profilUsed = true;
// Stoppe si le profil est affecté
foreach ($roles as $userId) {
foreach ($groups as $userId) {
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
$profilUsed = false;
}
}
foreach ($this->getData(['profil']) as $roleId => $roleData) {
foreach ($this->getData(['profil']) as $groupId => $groupData) {
// Membres sans permissions spécifiques
if (
$roleId == self::ROLE_BANNED ||
$roleId == self::ROLE_VISITOR ||
$roleId == self::ROLE_ADMIN
$groupId == self::GROUP_BANNED ||
$groupId == self::GROUP_VISITOR ||
$groupId == self::GROUP_ADMIN
) {
self::$userGroups[$roleId] = [
$roleId,
helper::translate($roleData['name']),
nl2br(helper::translate($roleData['comment'])),
template::button('profilEdit' . $roleId, [
self::$userGroups[$groupId] = [
$groupId,
helper::translate($groupData['name']),
nl2br(helper::translate($groupData['comment'])),
template::button('profilEdit' . $groupId, [
'value' => template::ico('pencil'),
'help' => 'Éditer',
'disabled' => $roleData['readonly'],
'disabled' => $groupData['readonly'],
]),
template::button('profilDelete' . $roleId, [
template::button('profilDelete' . $groupId, [
'value' => template::ico('trash'),
'help' => 'Supprimer',
'disabled' => $roleData['readonly'],
'disabled' => $groupData['readonly'],
])
];
} elseif (
$roleId == self::ROLE_MEMBER ||
$roleId == self::ROLE_EDITOR
$groupId == self::GROUP_MEMBER ||
$groupId == self::GROUP_EDITOR
) {
// Enumérer les sous rôles MEMBER et MODERATOR
foreach ($roleData as $profilId => $profilData) {
self::$userGroups[$roleId . '.' . $profilId] = [
$roleId . '-' . $profilId,
helper::translate(self::$roles[$roleId]) . '<br />Profil : ' . helper::translate($profilData['name']),
// Enumérer les sous groupes MEMBER et MODERATOR
foreach ($groupData as $profilId => $profilData) {
self::$userGroups[$groupId . '.' . $profilId] = [
$groupId . '-' . $profilId,
helper::translate(self::$groups[$groupId]) . '<br />Profil : ' . helper::translate($profilData['name']),
nl2br(helper::translate($profilData['comment'])),
template::button('profilEdit' . $roleId . $profilId, [
'href' => helper::baseUrl() . 'user/profilEdit/' . $roleId . '/' . $profilId,
template::button('profilEdit' . $groupId . $profilId, [
'href' => helper::baseUrl() . 'user/profilEdit/' . $groupId . '/' . $profilId,
'value' => template::ico('pencil'),
'help' => 'Éditer',
'disabled' => $profilData['readonly'],
]),
template::button('profilDelete' . $roleId . $profilId, [
template::button('profilDelete' . $groupId . $profilId, [
'class' => 'profilDelete buttonRed',
'href' => helper::baseUrl() . 'user/profilDelete/' . $roleId . '/' . $profilId,
'href' => helper::baseUrl() . 'user/profilDelete/' . $groupId . '/' . $profilId,
'value' => template::ico('trash'),
'help' => 'Supprimer',
'disabled' => $profilData['permanent'] && $profilUsed,
@ -797,13 +795,13 @@ class user extends common
}
// Valeurs en sortie
$this->addOutput([
'title' => helper::translate('Profils des rôles'),
'title' => helper::translate('Profils des groupes'),
'view' => 'profil'
]);
}
/**
* Edition d'un rôle
* Edition d'un groupe
*/
public function profilEdit()
{
@ -815,7 +813,7 @@ class user extends common
) {
// Effacer les données du numéro de profil ancien
$role = $this->getInput('profilEditGroup', helper::FILTER_STRING_SHORT, true);
$group = $this->getInput('profilEditGroup', helper::FILTER_STRING_SHORT, true);
// Les profils 1 sont désactivés dans le formulaire
$profil = empty($this->getInput('profilEditProfil')) ? '1' : $this->getInput('profilEditProfil');
$oldProfil = $this->getInput('profilEditOldProfil', helper::FILTER_STRING_SHORT);
@ -823,15 +821,15 @@ class user extends common
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
// Sécurité supplémentaire
if (
$role < self::ROLE_MEMBER
$group < self::GROUP_MEMBER
) {
$fileManager = false;
}
if (
$profil !== $oldProfil &&
$this->deleteData(['profil', $role, $oldProfil])
$this->deleteData(['profil', $group, $oldProfil])
) {
$this->deleteData(['profil', $role, $oldProfil]);
$this->deleteData(['profil', $group, $oldProfil]);
}
// Données du formulaire
$data = [
@ -934,7 +932,7 @@ class user extends common
//Sauvegarder le données
$this->setData([
'profil',
$role,
$group,
$profil,
$data
]);
@ -1019,14 +1017,14 @@ class user extends common
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost()
) {
// Nombre de profils de ce rôle
$role = $this->getInput('profilAddGroup');
$profil = count($this->getData(['profil', $role]));
// Nombre de profils de ce groupe
$group = $this->getInput('profilAddGroup');
$profil = count($this->getData(['profil', $group]));
// Gère le chemin
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
// Sécurité supplémentaire
if (
$role < self::ROLE_MEMBER
$group < self::GROUP_MEMBER
) {
$fileManager = false;
}
@ -1131,7 +1129,7 @@ class user extends common
// Sauvegarder les données
$this->setData([
'profil',
$role,
$group,
$profil,
$data
]);
@ -1200,12 +1198,12 @@ class user extends common
public function profilDelete()
{
// Ne pas supprimer un profil utililsé
// recherche les membres du rôle
$roles = helper::arrayColumn($this->getData(['user']), 'role');
$roles = array_keys($roles, $this->getUrl(2));
// recherche les membres du groupe
$groups = helper::arrayColumn($this->getData(['user']), 'group');
$groups = array_keys($groups, $this->getUrl(2));
$flag = true;
// Stoppe si le profil est affecté
foreach ($roles as $userId) {
foreach ($groups as $userId) {
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
$flag = false;
}
@ -1303,12 +1301,12 @@ class user extends common
$this->setData(['user', $userId, 'connectTimeout', 0], false);
}
// Check la présence des variables et contrôle du blocage du compte si valeurs dépassées
// Vérification du mot de passe et du rôle
// Vérification du mot de passe et du groupe
if (
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
and $this->getData(['user', $userId, 'role']) >= self::ROLE_MEMBER
and $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER
and $captcha === true
) {
@ -1322,7 +1320,7 @@ class user extends common
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
if (
$this->getData(['config', 'maintenance'])
and $this->getData(['user', $userId, 'role']) < self::ROLE_ADMIN
and $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN
) {
$this->addOutput([
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
@ -1342,7 +1340,7 @@ class user extends common
$authRedirect = '';
if (
$this->getData(['config', 'connect', 'mailAuth']) > 0
&& $this->getData(['user', $userId, 'role']) >= $this->getData(['config', 'connect', 'mailAuth'])
&& $this->getData(['user', $userId, 'group']) >= $this->getData(['config', 'connect', 'mailAuth'])
) {
/**
* Envoi d'un email contenant une clé
@ -1564,8 +1562,8 @@ class user extends common
$this->saveLog(
' Erreur de réinitialisation de mot de passe ' . $this->getUrl(2) .
' Compte : ' . $this->getData(['user', $this->getUrl(2)]) .
' Temps : ' . ($this->getData(['user', $this->getUrl(2), 'forgot']) + 86400 < time()) .
' Clé : ' . ($this->getUrl(3) !== md5(json_encode($this->getData(['user', $this->getUrl(2), 'forgot']))))
' Temps : ' . $this->getData(['user', $this->getUrl(2), 'forgot']) + 86400 < time() .
' Clé : ' . $this->getUrl(3) !== md5(json_encode($this->getData(['user', $this->getUrl(2), 'forgot'])))
);
// Message d'erreur en cas de problème de réinitialisation de mot de passe
$message = $this->getData(['user', $this->getUrl(2)]) === null
@ -1661,7 +1659,7 @@ class user extends common
array_key_exists('id', $item)
and array_key_exists('prenom', $item)
and array_key_exists('nom', $item)
and array_key_exists('role', $item)
and array_key_exists('groupe', $item)
and array_key_exists('profil', $item)
and array_key_exists('email', $item)
and array_key_exists('passe', $item)
@ -1670,16 +1668,16 @@ class user extends common
and isset($item['nom'])
and isset($item['prenom'])
and isset($item['email'])
and isset($item['role'])
and isset($item['groupe'])
and isset($item['profil'])
and isset($item['passe'])
and isset($item['tags'])
) {
// Validation du rôle
$item['role'] = (int) $item['role'];
// Validation du groupe
$item['groupe'] = (int) $item['groupe'];
$item['profil'] = (int) $item['profil'];
$item['role'] = ($item['role'] >= self::ROLE_BANNED and $item['role'] <= self::ROLE_ADMIN)
? $item['role'] : 1;
$item['groupe'] = ($item['groupe'] >= self::GROUP_BANNED and $item['groupe'] <= self::GROUP_ADMIN)
? $item['groupe'] : 1;
// L'utilisateur existe
$userId = helper::filter($item['id'], helper::FILTER_ID);
if ($this->getData(['user', $userId])) {
@ -1690,10 +1688,10 @@ class user extends common
$userId,
$item['nom'],
$item['prenom'],
self::$roles[$item['role']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$roles[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
self::$groups[$item['groupe']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
$item['prenom'],
helper::filter($item['email'], helper::FILTER_MAIL),
$item['tags'],
@ -1709,7 +1707,7 @@ class user extends common
[
'firstname' => $item['prenom'],
'forgot' => 0,
'role' => $item['role'],
'group' => $item['groupe'],
'profil' => $item['profil'],
'lastname' => $item['nom'],
'mail' => $item['email'],
@ -1753,10 +1751,10 @@ class user extends common
$userId,
$item['nom'],
$item['prenom'],
self::$roles[$item['role']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$roles[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
self::$groups[$item['groupe']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
$item['prenom'],
$item['email'],
$item['tags'],
@ -1853,11 +1851,11 @@ class user extends common
}
// Liste des rôles et des profils
// Liste des groupes et des profils
$usersGroups = $this->getData(['profil']);
foreach ($usersGroups as $roleId => $roleValue) {
switch ($roleId) {
foreach ($usersGroups as $groupId => $groupValue) {
switch ($groupId) {
case "-1":
case "0":
break;
@ -1867,10 +1865,10 @@ class user extends common
break;
case "1":
case "2":
foreach ($roleValue as $profilId => $profilValue) {
foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) {
self::$usersGroups[$roleId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$rolePublics[$roleId], $profilValue['name']);
$profils[$roleId . $profilId] = 0;
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0;
}
}
}
@ -1890,8 +1888,8 @@ class user extends common
foreach ($users as $userId => $userValue) {
// Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
}
// Filtres
@ -1902,13 +1900,13 @@ class user extends common
) {
// Groupe et profils
$role = (string) $this->getData(['user', $userId, 'role']);
$group = (string) $this->getData(['user', $userId, 'group']);
$profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']);
if (
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
)
continue;
// Première lettre du prénom
@ -1938,11 +1936,11 @@ class user extends common
}
// Ajoute les effectifs aux profils du sélecteur
foreach (self::$usersGroups as $roleId => $roleValue) {
if ($roleId === 'all') {
foreach (self::$usersGroups as $groupId => $groupValue) {
if ($groupId === 'all') {
self::$usersGroups['all'] = self::$usersGroups['all'] . ' (' . array_sum($profils) . ')';
} else {
self::$usersGroups[$roleId] = self::$usersGroups[$roleId] . ' (' . $profils[$roleId] . ')';
self::$usersGroups[$groupId] = self::$usersGroups[$groupId] . ' (' . $profils[$groupId] . ')';
}
}

View File

@ -38,7 +38,7 @@ $(document).ready(function () {
});
/**
* Droits des rôles
* Droits des groupes
*/
$("#userAddGroup").on("change", function () {
$(".userAddGroupProfil").hide();

View File

@ -104,44 +104,44 @@
</h4>
<div class="row">
<div class="col6">
<?php echo template::select('userAddGroup', self::$roleNews, [
'label' => 'Rôle',
'selected' => self::ROLE_MEMBER
<?php echo template::select('userAddGroup', self::$groupNews, [
'label' => 'Groupe',
'selected' => self::GROUP_MEMBER
]); ?>
</div>
<div class="col6">
<div class="userAddGroupProfil displayNone"
id="userAddGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('userAddProfil' . self::ROLE_MEMBER, user::$userProfils[self::ROLE_MEMBER], [
id="userAddGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('userAddProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil',
]); ?>
</div>
<div class="userAddGroupProfil displayNone"
id="userAddGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('userAddProfil' . self::ROLE_EDITOR, user::$userProfils[self::ROLE_EDITOR], [
id="userAddGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userAddProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil',
]); ?>
</div>
</div>
</div>
<div class="row">
<div id="userCommentProfil<?php echo self::ROLE_MEMBER; ?>"
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>"
class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::ROLE_MEMBER, [
"value" => implode("\n", user::$userProfilsComments[self::ROLE_MEMBER])
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [
"value" => implode("\n", user::$userProfilsComments[self::GROUP_MEMBER])
]);
?>
</div>
<div id="userCommentProfil<?php echo self::ROLE_EDITOR; ?>"
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>"
class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment2' . self::ROLE_EDITOR, [
"value" => implode("\n", user::$userProfilsComments[self::ROLE_EDITOR])
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
"value" => implode("\n", user::$userProfilsComments[self::GROUP_EDITOR])
]);
?>
</div>
<div id="userCommentProfil<?php echo self::ROLE_ADMIN; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::ROLE_ADMIN, [
"value" => implode("\n", user::$userProfilsComments[self::ROLE_ADMIN])
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_ADMIN, [
"value" => implode("\n", user::$userProfilsComments[self::GROUP_ADMIN])
]);
?>
</div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('userEditForm'); ?>
<div class="row">
<div class="col1">
<?php if ($this->getUser('role') === self::ROLE_ADMIN): ?>
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::button('userEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user',
@ -29,7 +29,7 @@
<div class="col6">
<?php echo template::text('userEditFirstname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('role') > self::ROLE_EDITOR ? false : true,
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
'label' => 'Prénom',
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?>
@ -37,7 +37,7 @@
<div class="col6">
<?php echo template::text('userEditLastname', [
'autocomplete' => 'off',
'disabled' => $this->getUser('role') > self::ROLE_EDITOR ? false : true,
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
'label' => 'Nom',
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
]); ?>
@ -77,7 +77,7 @@
<div class="col12">
<?php echo template::text('userEditTags', [
'label' => 'Étiquettes',
'readonly' => $this->getUser('role') > self::ROLE_EDITOR ? false : true,
'readonly' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
'value' => $this->getData(['user', $this->getUrl(2), 'tags']),
'help' => 'Les étiquettes sont séparées par des espaces'
]); ?>
@ -99,7 +99,7 @@
]); ?>
<?php
// Les admins ont le pouvoir de forcer le changement de mot de passe
if ($this->getUser('role') < self::ROLE_ADMIN): ?>
if ($this->getUser('group') < self::GROUP_ADMIN): ?>
<?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password',
// remplace 'off' pour éviter le pré remplissage auto
@ -125,59 +125,59 @@
</h4>
<div class="row">
<div class="col12">
<?php if ($this->getUser('role') === self::ROLE_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$roleEdits, [
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre rôle.' : ''),
'label' => 'Rôle',
'selected' => $this->getData(['user', $this->getUrl(2), 'role']),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
]); ?>
<?php else: ?>
<?php echo template::hidden('userEditGroup', [
'value' => $this->getData(['user', $this->getUrl(2), 'role'])
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
]); ?>
<?php endif; ?>
</div>
<div class="col12">
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('userEditProfil' . self::ROLE_MEMBER, user::$userProfils[self::ROLE_MEMBER], [
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN,
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::ROLE_EDITOR, user::$userProfils[self::ROLE_EDITOR], [
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN,
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?>
</div>
</div>
</div>
<div class="row">
<div id="userCommentProfil<?php echo self::ROLE_MEMBER; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::ROLE_MEMBER, [
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [
'label' => 'Commentaire',
'value' => implode("\n", user::$userProfilsComments[self::ROLE_MEMBER]),
'value' => implode("\n", user::$userProfilsComments[self::GROUP_MEMBER]),
'disabled' => true,
]);
?>
</div>
<div id="userCommentProfil<?php echo self::ROLE_EDITOR; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::ROLE_EDITOR, [
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [
'label' => 'Commentaire',
'value' => implode("\n", user::$userProfilsComments[self::ROLE_EDITOR]),
'value' => implode("\n", user::$userProfilsComments[self::GROUP_EDITOR]),
'disabled' => true,
]);
?>
</div>
<div id="userCommentProfil<?php echo self::ROLE_ADMIN; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::ROLE_ADMIN, [
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire',
'value' => implode("\n", user::$userProfilsComments[self::ROLE_ADMIN]),
'value' => implode("\n", user::$userProfilsComments[self::GROUP_ADMIN]),
'disabled' => true,
]);
?>

View File

@ -61,7 +61,7 @@
<?php if (user::$users): ?>
<div class="row">
<div class="col12 textAlignCenter">
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Rôle', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Groupe', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
<?php echo template::ico('check'); ?> Compte créé |
<?php echo template::ico('mail'); ?> Compte créé et notifié |
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.

View File

@ -16,13 +16,3 @@
/** NE PAS EFFACER
* admin.css
*/
/** Hide the timestamp column in the user list
*/
tbody td:nth-child(5) {
color: transparent; /* Masquer le texte par défaut */
}
tbody td.visible-text {
color: inherit; /* Rétablir la couleur du texte */
}

View File

@ -31,22 +31,6 @@ $(document).ready((function () {
stateSave: true,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
"columnDefs": [
{
target: 4,
type: 'datetime', // Utilisez 'datetime' pour le tri
searchable: false,
render: function (data, type, row) {
if (type === 'display') {
if (typeof data === 'number' || !isNaN(data)) {
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
} else {
return data;
}
}
// Pour le tri, retournez la valeur au format ISO
return moment(Number(data) * 1000).toISOString();
}
},
{
target: 5,
orderable: false,
@ -59,15 +43,4 @@ $(document).ready((function () {
}
]
});
// Injecter la règle CSS pour la colonne cible
$('<style>')
.prop('type', 'text/css')
.html(`
table.dataTable tbody td:nth-child(5) {
color: inherit !important; /* Rétablir la couleur du texte */
}
`)
.appendTo('head');
}));

View File

@ -40,7 +40,7 @@
<div class="col1">
<?php echo template::button('userAdd', [
'href' => helper::baseUrl() . 'user/add',
'value' => template::ico('user-plus'),
'value' => template::ico('plus'),
'class' => 'buttonGreen',
'help' => 'Ajouter un utilisateur'
]); ?>
@ -68,4 +68,4 @@
</div>
</div>
<?php echo template::formClose(); ?>
<?php echo template::table([3, 2, 2, 2, 2, 1, 1], user::$users, ['Nom', 'Rôle', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','role','profile','tag','data-timestamp','edit','delete']); ?>
<?php echo template::table([3, 2, 2, 2, 2, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Date dernière vue', '', ''], ['id' => 'dataTables']); ?>

View File

@ -27,8 +27,8 @@
]); ?>
</div>
<div class="col12">
<?php echo template::select('profilAddGroup', user::$roleProfils, [
'label' => 'Rôle associé',
<?php echo template::select('profilAddGroup', user::$groupProfils, [
'label' => 'Groupe associé',
'selected' => $this->getUrl(2)
]); ?>
</div>

View File

@ -40,8 +40,8 @@
</div>
<div class="col12">
<?php echo template::text('profilEditDisplayGroup', [
'label' => 'Rôle associé',
'value' => helper::translate(self::$roles[$this->getUrl(2)]),
'label' => 'Groupe associé',
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
'disabled' => true
]); ?>
<?php echo template::hidden('profilEditGroup', [
@ -239,7 +239,7 @@
</div>
</div>
</div>
<?php if ($this->getUrl(2) >= self::ROLE_EDITOR): ?>
<?php if ($this->getUrl(2) >= self::GROUP_EDITOR): ?>
<div class="row">
<div class="col12">
<div class="block">

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ date_default_timezone_set('Europe/Paris');
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'fr_FR';
setlocale(LC_CTYPE, $lang);
/* Lecture du rôle de l'utilisateur connecté pour attribuer les droits et les dossiers */
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
$userId = $_COOKIE['ZWII_USER_ID'];
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
$u = json_decode(file_get_contents('../../../site/data/user.json'), true);
@ -25,8 +25,8 @@ $g = json_decode(file_get_contents('../../../site/data/profil.json'), true);
// Lecture les droits
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
$role = $u['user'][$userId]['role'];
switch ($role) {
$group = $u['user'][$userId]['group'];
switch ($group) {
case 3:
// Accès admin
$file['delete'] = true;
@ -52,12 +52,12 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
case 1:
// Accès contrôlés par le profil
$profil = $u['user'][$userId]['profil'];
$file = $g['profil'][$role][$profil]['file'];
$folder = $g['profil'][$role][$profil]['folder'];
$file = $g['profil'][$group][$profil]['file'];
$folder = $g['profil'][$group][$profil]['folder'];
// membre sans profil déclaré ou accès interdit, pas d'accès
if (
is_null($profil)
|| $g['profil'][$role][$profil]['filemanager'] === false
|| $g['profil'][$group][$profil]['filemanager'] === false
) {
exit("<h1 style='color: red'>Accès interdit au gestionnaire de fichiers !</h1>");
}
@ -88,7 +88,7 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
}
}
/* Fin lecture du rôle de l'utilisateur connecté pour attribuer les droits et les dossiers */
/* Fin lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
/*
|--------------------------------------------------------------------------

View File

@ -1 +1 @@
.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,.9);outline:0!important;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:0!important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:0!important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:-o-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease,-o-transform .3s ease}.lity-closed .lity-content,.lity-loading .lity-content{-webkit-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:0 0;outline:0;-webkit-box-shadow:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:active,.lity-close:focus,.lity-close:hover,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:0 0;outline:0;-webkit-box-shadow:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-facebookvideo .lity-container,.lity-googlemaps .lity-container,.lity-iframe .lity-container,.lity-vimeo .lity-container,.lity-youtube .lity-container{width:100%;max-width:90%}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:3vh;left:0;width:90vw;height:94vh;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}.lity-hide{display:none}
.lity{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;white-space:nowrap;background:#0b0b0b;background:rgba(0,0,0,.9);outline:none!important;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity.lity-opened{opacity:1}.lity.lity-closed{opacity:0}.lity *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity-wrap{z-index:9990;position:fixed;top:0;right:0;bottom:0;left:0;text-align:center;outline:none!important}.lity-wrap:before{content:'';display:inline-block;height:100%;vertical-align:middle;margin-right:-.25em}.lity-loader{z-index:9991;color:#fff;position:absolute;top:50%;margin-top:-.8em;width:100%;text-align:center;font-size:14px;font-family:Arial,Helvetica,sans-serif;opacity:0;-webkit-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}.lity-loading .lity-loader{opacity:1}.lity-container{z-index:9992;position:relative;text-align:left;vertical-align:middle;display:inline-block;white-space:normal;max-width:100%;max-height:100%;outline:none!important}.lity-content{z-index:9993;width:100%;-webkit-transform:scale(1);-ms-transform:scale(1);-o-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform .3s ease;transition:-webkit-transform .3s ease;-o-transition:-o-transform .3s ease;transition:transform .3s ease;transition:transform .3s ease,-webkit-transform .3s ease,-o-transform .3s ease}.lity-loading .lity-content,.lity-closed .lity-content{-webkit-transform:scale(.8);-ms-transform:scale(.8);-o-transform:scale(.8);transform:scale(.8)}.lity-content:after{content:'';position:absolute;left:0;top:0;bottom:0;display:block;right:0;width:auto;height:auto;z-index:-1;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}.lity-close{z-index:9994;width:35px;height:35px;position:fixed;right:0;top:0;-webkit-appearance:none;cursor:pointer;text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close::-moz-focus-inner{border:0;padding:0}.lity-close:hover,.lity-close:focus,.lity-close:active,.lity-close:visited{text-decoration:none;text-align:center;padding:0;color:#fff;font-style:normal;font-size:35px;font-family:Arial,Baskerville,monospace;line-height:35px;text-shadow:0 1px 2px rgba(0,0,0,.6);border:0;background:none;outline:none;-webkit-box-shadow:none;box-shadow:none}.lity-close:active{top:1px}.lity-image img{max-width:100%;display:block;line-height:0;border:0}.lity-iframe .lity-container,.lity-youtube .lity-container,.lity-vimeo .lity-container,.lity-facebookvideo .lity-container,.lity-googlemaps .lity-container{width:100%;max-width:90%}.lity-iframe-container{width:100%;height:0;padding-top:56.25%;overflow:auto;pointer-events:auto;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-overflow-scrolling:touch}.lity-iframe-container iframe{position:absolute;display:block;top:0;left:0;width:100%;height:100%;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6);background:#000}.lity-hide{display:none}

View File

@ -77,9 +77,6 @@
.zwiico-twitch:before { content: '\f1e8'; } /* '' */
.zwiico-brush:before { content: '\f1fc'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */
.zwiico-user-plus:before { content: '\f234'; } /* '' */
.zwiico-user-times:before { content: '\f235'; } /* '' */
.zwiico-reddit:before { content: '\f281'; } /* '' */
.zwiico-shopping-basket:before { content: '\f291'; } /* '' */
.zwiico-address-book:before { content: '\f2b9'; } /* '' */
.zwiico-logout:before { content: '🎓'; } /* '\1f393' */

File diff suppressed because one or more lines are too long

View File

@ -76,9 +76,6 @@
.zwiico-twitch { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1e8;&nbsp;'); }
.zwiico-brush { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1fc;&nbsp;'); }
.zwiico-pinterest { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf231;&nbsp;'); }
.zwiico-user-plus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf234;&nbsp;'); }
.zwiico-user-times { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf235;&nbsp;'); }
.zwiico-reddit { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf281;&nbsp;'); }
.zwiico-shopping-basket { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf291;&nbsp;'); }
.zwiico-address-book { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf2b9;&nbsp;'); }
.zwiico-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x1f393;&nbsp;'); }

View File

@ -87,9 +87,6 @@
.zwiico-twitch { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1e8;&nbsp;'); }
.zwiico-brush { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1fc;&nbsp;'); }
.zwiico-pinterest { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf231;&nbsp;'); }
.zwiico-user-plus { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf234;&nbsp;'); }
.zwiico-user-times { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf235;&nbsp;'); }
.zwiico-reddit { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf281;&nbsp;'); }
.zwiico-shopping-basket { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf291;&nbsp;'); }
.zwiico-address-book { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf2b9;&nbsp;'); }
.zwiico-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x1f393;&nbsp;'); }

View File

@ -1,12 +1,12 @@
@charset "UTF-8";
@font-face {
font-family: 'zwiico';
src: url('../font/zwiico.eot?22250182');
src: url('../font/zwiico.eot?22250182#iefix') format('embedded-opentype'),
url('../font/zwiico.woff2?22250182') format('woff2'),
url('../font/zwiico.woff?22250182') format('woff'),
url('../font/zwiico.ttf?22250182') format('truetype'),
url('../font/zwiico.svg?22250182#zwiico') format('svg');
src: url('../font/zwiico.eot?24931130');
src: url('../font/zwiico.eot?24931130#iefix') format('embedded-opentype'),
url('../font/zwiico.woff2?24931130') format('woff2'),
url('../font/zwiico.woff?24931130') format('woff'),
url('../font/zwiico.ttf?24931130') format('truetype'),
url('../font/zwiico.svg?24931130#zwiico') format('svg');
font-weight: normal;
font-style: normal;
}
@ -16,7 +16,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'zwiico';
src: url('../font/zwiico.svg?22250182#zwiico') format('svg');
src: url('../font/zwiico.svg?24931130#zwiico') format('svg');
}
}
*/
@ -132,9 +132,6 @@
.zwiico-twitch:before { content: '\f1e8'; } /* '' */
.zwiico-brush:before { content: '\f1fc'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */
.zwiico-user-plus:before { content: '\f234'; } /* '' */
.zwiico-user-times:before { content: '\f235'; } /* '' */
.zwiico-reddit:before { content: '\f281'; } /* '' */
.zwiico-shopping-basket:before { content: '\f291'; } /* '' */
.zwiico-address-book:before { content: '\f2b9'; } /* '' */
.zwiico-logout:before { content: '🎓'; } /* '\1f393' */

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2025 by original authors @ fontello.com</metadata>
<metadata>Copyright (C) 2024 by original authors @ fontello.com</metadata>
<defs>
<font id="zwiico" horiz-adv-x="1000" >
<font-face font-family="zwiico" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
@ -160,16 +160,10 @@
<glyph glyph-name="pinterest" unicode="&#xf231;" d="M0 517q0 60 21 113t58 93 85 69 103 44 113 14q88 0 164-37t123-108 47-160q0-54-10-105t-34-99-56-83-80-58-106-21q-38 0-75 18t-54 49q-5-22-15-63t-14-53-11-40-15-39-17-35-26-44-35-48l-7-3-5 6q-9 88-9 105 0 51 12 115t37 161 29 113q-18 36-18 94 0 47 29 87t74 41q34 0 53-23t19-57q0-37-24-106t-25-105q0-35 25-58t61-23q31 0 57 14t44 38 31 53 21 61 11 62 4 56q0 96-61 150t-160 54q-111 0-186-72t-75-183q0-25 7-48t15-36 15-26 7-17q0-15-8-40t-21-25q-1 0-9 1-29 9-51 31t-34 53-18 60-6 60z" horiz-adv-x="714.3" />
<glyph glyph-name="user-plus" unicode="&#xf234;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m536-71h196q7 0 13-6t5-12v-107q0-8-5-13t-13-5h-196v-197q0-7-6-12t-12-6h-107q-8 0-13 6t-5 12v197h-197q-7 0-12 5t-6 13v107q0 7 6 12t12 6h197v196q0 7 5 13t13 5h107q7 0 12-5t6-13v-196z m-411-125q0-29 21-51t50-21h143v-133q-38-28-95-28h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 44-34 86-51t92-17 92 17 86 51q11 10 22 10 73 0 121-54h-125q-29 0-50-21t-21-50v-107z" horiz-adv-x="1142.9" />
<glyph glyph-name="user-times" unicode="&#xf235;" d="M393 350q-89 0-152 63t-62 151 62 152 152 63 151-63 63-152-63-151-151-63z m601-179l139-138q5-5 5-13 0-8-5-13l-76-76q-5-5-12-5-8 0-13 5l-139 139-139-139q-5-5-13-5-7 0-12 5l-76 76q-5 5-5 13 0 8 5 13l139 138-139 139q-5 5-5 13 0 8 5 13l76 75q5 5 12 5 8 0 13-5l139-139 139 139q5 5 13 5 7 0 12-5l76-75q5-5 5-13 0-8-5-13z m-278 0l-101-101q-21-20-21-50 0-30 21-51l46-46q-11-2-24-2h-488q-67 0-108 39t-41 106q0 30 2 58t8 61 15 60 24 55 34 45 48 30 62 11q11 0 22-10 86-68 178-68t178 68q11 10 22 10 15 0 31-4-15-15-22-27t-8-32q0-30 21-51z" horiz-adv-x="1142.9" />
<glyph glyph-name="reddit" unicode="&#xf281;" d="M1000 378q0-32-16-59t-45-40q7-26 7-54 0-86-60-160t-162-117-223-42-223 42-162 117-59 160q0 26 6 53-28 13-46 41t-17 59q0 46 32 78t79 33q48 0 81-35 122 85 287 90l65 291q2 7 9 12t14 2l206-45q10 21 30 33t44 13q35 0 59-24t25-59-25-59-59-25-59 24-24 59l-186 42-58-264q167-5 289-89 33 34 80 34 46 0 79-33t32-78z m-767-111q0-35 25-59t58-25 60 25 24 59-24 59-60 24q-34 0-58-25t-25-58z m452-198q6 6 6 14t-6 15q-5 5-14 5t-14-5q-23-24-68-35t-89-11-89 11-68 35q-6 5-14 5t-14-5q-6-6-6-14t6-15q24-24 66-38t68-17 51-2 51 2 68 17 66 38z m-1 114q34 0 59 25t24 59q0 34-25 58t-58 25q-35 0-60-24t-24-59 24-59 60-25z" horiz-adv-x="1000" />
<glyph glyph-name="shopping-basket" unicode="&#xf291;" d="M1071 421q30 0 51-20t21-51-21-50-51-21h-8l-64-370q-5-26-25-42t-45-17h-715q-25 0-45 17t-25 42l-64 370h-9q-29 0-50 21t-21 50 21 51 50 20h1000z m-800-446q14 1 24 13t9 26l-18 232q-1 14-13 24t-26 9-24-13-9-26l18-232q1-14 12-24t24-9h3z m229 36v232q0 14-11 25t-25 11-25-11-10-25v-232q0-15 10-25t25-11 25 11 11 25z m214 0v232q0 14-10 25t-25 11-25-11-11-25v-232q0-15 11-25t25-11 25 11 10 25z m197-3l18 232q1 15-9 26t-24 13-26-9-13-24l-18-232q-1-15 9-26t24-13h3q14 0 24 9t12 24z m-645 679l-52-230h-74l56 246q11 49 50 80t89 31h94q0 15 10 25t25 11h215q14 0 25-11t10-25h94q50 0 89-31t49-80l57-246h-74l-52 230q-6 25-25 40t-44 16h-94q0-15-10-25t-25-11h-215q-14 0-25 11t-10 25h-94q-25 0-44-16t-25-40z" horiz-adv-x="1142.9" />
<glyph glyph-name="address-book" unicode="&#xf2b9;" d="M670 159q0 32-3 60t-12 56-22 48-35 32-51 13q-3-2-19-12t-23-13-23-11-27-10-26-3-26 3-28 10-22 11-24 13-19 12q-28 0-50-13t-36-32-22-48-12-56-3-60q0-41 23-68t58-27h321q34 0 58 27t23 68z m-96 332q0 60-43 102t-102 43-103-43-42-102q0-60 42-102t103-43 102 43 43 102z m355-302v-107q0-8-5-13t-13-5h-54v-125q0-37-26-63t-63-26h-679q-36 0-63 26t-26 63v822q0 37 26 63t63 26h679q37 0 63-26t26-63v-125h54q8 0 13-5t5-13v-107q0-8-5-13t-13-5h-54v-72h54q8 0 13-5t5-12v-108q0-7-5-12t-13-5h-54v-72h54q8 0 13-5t5-13z" horiz-adv-x="928.6" />
<glyph glyph-name="logout" unicode="&#x1f393;" d="M357 46q0-2 1-11t0-14-2-14-5-11-12-3h-178q-67 0-114 47t-47 114v392q0 67 47 114t114 47h178q8 0 13-5t5-13q0-2 1-11t0-15-2-13-5-11-12-3h-178q-37 0-63-26t-27-64v-392q0-37 27-63t63-27h174t6 0 7-2 4-3 4-5 1-8z m518 304q0-14-11-25l-303-304q-11-10-25-10t-25 10-11 25v161h-250q-14 0-25 11t-11 25v214q0 15 11 25t25 11h250v161q0 14 11 25t25 10 25-10l303-304q11-10 11-25z" horiz-adv-x="928.6" />
</font>
</defs>

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
core/vendor/zwiico/fontello-2efa58ff.zip vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -23,21 +23,21 @@ class blog extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
const EDIT_OWNER = 'owner';
const EDIT_ROLE = 'role';
const EDIT_GROUP = 'group';
const EDIT_ALL = 'all';
public static $actions = [
'add' => self::ROLE_EDITOR,
'comment' => self::ROLE_EDITOR,
'commentApprove' => self::ROLE_EDITOR,
'commentDelete' => self::ROLE_EDITOR,
'commentDeleteAll' => self::ROLE_EDITOR,
'config' => self::ROLE_EDITOR,
'option' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR,
'rss' => self::ROLE_VISITOR
'add' => self::GROUP_EDITOR,
'comment' => self::GROUP_EDITOR,
'commentApprove' => self::GROUP_EDITOR,
'commentDelete' => self::GROUP_EDITOR,
'commentDeleteAll' => self::GROUP_EDITOR,
'config' => self::GROUP_EDITOR,
'option' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR
];
public static $articles = [];
@ -111,8 +111,8 @@ class blog extends common
// Permissions d'un article
public static $articleConsent = [
self::EDIT_ALL => 'Tous les rôles',
self::EDIT_ROLE => 'Rôle du propriétaire',
self::EDIT_ALL => 'Tous les groupes',
self::EDIT_GROUP => 'Groupe du propriétaire',
self::EDIT_OWNER => 'Propriétaire'
];
@ -259,7 +259,7 @@ class blog extends common
$this->isPost()
) {
// Modification de l'userId
if ($this->getUser('role') === self::ROLE_ADMIN) {
if ($this->getUser('group') === self::GROUP_ADMIN) {
$newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true);
} else {
$newuserid = $this->getUser('id');
@ -284,7 +284,7 @@ class blog extends common
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
'userId' => $newuserid,
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_ROLE ? $this->getUser('role') : $this->getInput('blogAddConsent'),
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogAddConsent'),
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
@ -493,13 +493,13 @@ class blog extends common
( // Propriétaire
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) === self::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $value, 'userId']) === $this->getUser('id')
or $this->getUser('role') === self::ROLE_ADMIN)
or $this->getUser('group') === self::GROUP_ADMIN)
)
or (
// Rôle
// Groupe
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
)
or (
// Tout le monde
@ -655,7 +655,7 @@ class blog extends common
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost()
) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
if ($this->getUser('group') === self::GROUP_ADMIN) {
$newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true);
} else {
$newuserid = $this->getUser('id');
@ -683,7 +683,7 @@ class blog extends common
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
'userId' => $newuserid,
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_ROLE ? $this->getUser('role') : $this->getInput('blogEditConsent'),
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogEditConsent'),
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
@ -707,10 +707,10 @@ class blog extends common
ksort(self::$users);
foreach (self::$users as $userId => &$userFirstname) {
// Les membres ne sont pas éditeurs, les exclure de la liste
if ($this->getData(['user', $userId, 'role']) < self::ROLE_EDITOR) {
if ($this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
unset(self::$users[$userId]);
}
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$roleEdits[$this->getData(['user', $userId, 'role'])] . ')';
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
}
unset($userFirstname);
// Valeurs en sortie
@ -783,7 +783,7 @@ class blog extends common
$to = [];
// Liste des destinataires
foreach ($this->getData(['user']) as $userId => $user) {
if ($user['role'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification'])) {
if ($user['group'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification'])) {
$to[] = $user['mail'];
$firstname[] = $user['firstname'];
$lastname[] = $user['lastname'];

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Gelöschte Kommentare",
"Fermer les commentaires": "Schalten Sie die Kommentare aus",
"Gestion des commentaires": "Kommentarmanagement",
"Rôle du propriétaire": "Besitzergruppe",
"Groupe du propriétaire": "Besitzergruppe",
"Image de couverture": "Berichterstattung",
"Informations générales": "Allgemeine Informationen",
"Lien du flux RSS": "Lien du flux RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Artikel",
"Supprimer cet article ?": "Diesen Artikel löschen?",
"Supprimer le commentaire ?": "Den Kommentar löschen?",
"Tous les rôles": "Alle Gruppen",
"Tous les groupes": "Alle Gruppen",
"Tout effacer": "Alles löschen",
"Très Grande": "Sehr groß",
"État": "État",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Deleted comments",
"Fermer les commentaires": "Turn off the comments",
"Gestion des commentaires": "Comment management",
"Rôle du propriétaire": "Owner's group",
"Groupe du propriétaire": "Owner's group",
"Image de couverture": "Coverage",
"Informations générales": "General informations",
"Lien du flux RSS": "Lien du Flux RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Write an article",
"Supprimer cet article ?": "Delete this article?",
"Supprimer le commentaire ?": "Delete the comment?",
"Tous les rôles": "All groups",
"Tous les groupes": "All groups",
"Tout effacer": "Erase everything",
"Très Grande": "Very tall",
"État": "Status",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Comentarios eliminados",
"Fermer les commentaires": "Cerrar los comentarios",
"Gestion des commentaires": "Gestión de comentarios",
"Rôle du propriétaire": "Grupo de propietarios",
"Groupe du propriétaire": "Grupo de propietarios",
"Image de couverture": "Imagen de portada",
"Informations générales": "Información general",
"Lien du flux RSS": "Enlace de fuente RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Escribir un artículo",
"Supprimer cet article ?": "¿Borrar este artículo?",
"Supprimer le commentaire ?": "¿Borrar el comentario?",
"Tous les rôles": "Todos los grupos",
"Tous les groupes": "Todos los grupos",
"Tout effacer": "Borrar todo",
"Très Grande": "Muy grande",
"État": "Estado",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "",
"Fermer les commentaires": "",
"Gestion des commentaires": "",
"Rôle du propriétaire": "",
"Groupe du propriétaire": "",
"Image de couverture": "",
"Informations générales": "",
"Lien du flux RSS": "",
@ -46,7 +46,7 @@
"Rédiger un article": "",
"Supprimer cet article ?": "",
"Supprimer le commentaire ?": "",
"Tous les rôles": "",
"Tous les groupes": "",
"Tout effacer": "",
"Très Grande": "",
"État": "",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Σχόλια διαγράφονται",
"Fermer les commentaires": "Κλείσιμο σχολίων",
"Gestion des commentaires": "Διαχείριση σχολίων",
"Rôle du propriétaire": "Ομάδα ιδιοκτήτη",
"Groupe du propriétaire": "Ομάδα ιδιοκτήτη",
"Image de couverture": "εικόνα εξωφύλλου",
"Informations générales": "Γενικές πληροφορίες",
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Γράψτε ένα άρθρο",
"Supprimer cet article ?": "Να διαγράψετε αυτό το άρθρο;",
"Supprimer le commentaire ?": "Διαγράψτε το σχόλιο;",
"Tous les rôles": "Όλες οι ομάδες",
"Tous les groupes": "Όλες οι ομάδες",
"Tout effacer": "Διαγραφή όλων",
"Très Grande": "Πολύ μεγάλη",
"État": "κατάσταση",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Commenti cancellati",
"Fermer les commentaires": "Disattiva i commenti",
"Gestion des commentaires": "Gestione dei commenti",
"Rôle du propriétaire": "Gruppo del proprietario",
"Groupe du propriétaire": "Gruppo del proprietario",
"Image de couverture": "Copertura",
"Informations générales": "Informazioni generali",
"Lien du flux RSS": "Lien Du Flux RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Scrivi un articolo",
"Supprimer cet article ?": "Elimina questo articolo?",
"Supprimer le commentaire ?": "Elimina il commento?",
"Tous les rôles": "Tutti i gruppi",
"Tous les groupes": "Tutti i gruppi",
"Tout effacer": "Cancellare tutto",
"Très Grande": "Molto alto",
"État": "Stato",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Comentários excluídos",
"Fermer les commentaires": "Desligue os comentários",
"Gestion des commentaires": "Gerenciamento de comentários",
"Rôle du propriétaire": "Grupo do proprietário",
"Groupe du propriétaire": "Grupo do proprietário",
"Image de couverture": "Cobertura",
"Informations générales": "Informações gerais",
"Lien du flux RSS": "Lien du Flux RSS",
@ -46,7 +46,7 @@
"Rédiger un article": "Escrever um artigo",
"Supprimer cet article ?": "Excluir este artigo?",
"Supprimer le commentaire ?": "Excluir o comentário?",
"Tous les rôles": "Todos os grupos",
"Tous les groupes": "Todos os grupos",
"Tout effacer": "Apague tudo",
"Très Grande": "Muito alto",
"État": "Estado",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Silinen yorumlar",
"Fermer les commentaires": "Yorumları kapat",
"Gestion des commentaires": "Yorum yönetimi",
"Rôle du propriétaire": "Sahip grubu",
"Groupe du propriétaire": "Sahip grubu",
"Image de couverture": "Kapak resmi",
"Informations générales": "Genel bilgiler",
"Lien du flux RSS": "RSS dağıtım bağlantısı",
@ -46,7 +46,7 @@
"Rédiger un article": "Bir makale yaz",
"Supprimer cet article ?": "Bu makale silinsin mi?",
"Supprimer le commentaire ?": "Yorum silinsin mi?",
"Tous les rôles": "Tüm gruplar",
"Tous les groupes": "Tüm gruplar",
"Tout effacer": "Her şeyi sil",
"Très Grande": "Çok büyük",
"État": "Durum",

View File

@ -82,7 +82,7 @@
<?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
@ -98,7 +98,7 @@
<?php echo template::select('blogAddConsent', blog::$articleConsent , [
'label' => 'Édition - Suppression',
'selected' => blog::EDIT_ALL,
'help' => 'Les utilisateurs des rôles supérieurs accèdent à l\'article sans restriction'
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
]); ?>
</div>
</div>
@ -128,7 +128,7 @@
<?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email'); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('blogAddCommentGroupNotification', blog::$roleNews); ?>
<?php echo template::select('blogAddCommentGroupNotification', blog::$groupNews); ?>
</div>
</div>
</div>

View File

@ -52,18 +52,18 @@
( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
or $this->getUser('role') === self::ROLE_ADMIN)
or $this->getUser('group') === self::GROUP_ADMIN)
)
or (
// Rôle
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_EDITOR)
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
// Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_EDITOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
)
or (
// Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
and $this->getUser('role') >= blog::$actions['config']
and $this->getUser('group') >= blog::$actions['config']
)
)
): ?>

View File

@ -89,7 +89,7 @@
<?php echo template::select('blogEditUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
@ -103,8 +103,8 @@
<div class="col4">
<?php echo template::select('blogEditConsent', blog::$articleConsent, [
'label' => 'Édition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? blog::EDIT_ROLE : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des rôles supérieurs accèdent à l\'article sans restriction'
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? blog::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
]); ?>
</div>
</div>
@ -143,7 +143,7 @@
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('blogEditCommentGroupNotification', blog::$roleNews, [
<?php echo template::select('blogEditCommentGroupNotification', blog::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
]); ?>
</div>

View File

@ -77,18 +77,18 @@
( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id')
or $this->getUser('role') === self::ROLE_ADMIN)
or $this->getUser('group') === self::GROUP_ADMIN)
)
or (
// Rôle
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::ROLE_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::ROLE_EDITOR)
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
// Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_EDITOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
)
or (
// Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL
and $this->getUser('role') >= blog::$actions['config']
and $this->getUser('group') >= blog::$actions['config']
)
)
): ?>

View File

@ -1,23 +0,0 @@
# Version 4.2
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
# Version 4.1
- Correction fonction signature dans core.php
# Version 4.0
- Gestion des permissions intégrée dans le module
# Version 3.5
- Masque le code de vérification
# Version 3.4
- Bug lors de la création d'un article à partir d'une base vide
- Interprétation des champs date lors de l'édition (version de la ressource et date de l'article )
# Version 3.3
- Compatibilité PHP 8.2
# Version 3.2
Fournit un id pour l'installation depuis le store
# Version 3.1
- Liste export du catalogue non json
# Version 3
- Uniformisation interface graphique
- Corrige un bug de création de catégorie
# Version 2.6
- Saisie obligatoire d'un contenu
- Nouvelle structure 'posts' plutôt que 'items' pour permettre la recherche dans les descriptions avec le module Search

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
{"name":"download","realName":"Téléchargement","version":"4.2","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 Artikel",
"4 articles": "4 Artikel",
"8 articles": "8 Artikel",
"Approbation par un modérateur": "Genehmigung durch einen Moderator",
"Articles par page": "Artikel pro Seite",
"Auteur": "Auteur",
"Brouillon": "Unorganisiert",
"Caractères par commentaire": "Charaktere nach Kommentar",
"Commentaire approuvé": "Genehmigter Kommentar",
"Commentaire rejeté": "Abgelehnter Kommentar",
"Commentaire supprimé": "Kommentar gelöscht",
"Commentaires supprimés": "Gelöschte Kommentare",
"Edition - Suppression": "Ausgabe - Unterdrückung",
"Effacer le commentaire": "Kommentar löschen",
"Fermer les commentaires": "Schalten Sie die Kommentare aus",
"Rôle du propriétaire": "Besitzergruppe",
"Lien du flux RSS": "Lien du flux RSS",
"Notification par email": "Benachrichtigung PAR -E -Mail",
"Pleine largeur": "Gesamtbreite",
"Propriétaire": "Eigentümer",
"Publier": "Veröffentlichen",
"Tous les groupes": "Alle Gruppen",
"Tout effacer": "Alles löschen",
"Très Grande": "Sehr groß",
"État": "État"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 articles",
"4 articles": "4 articles",
"8 articles": "8 articles",
"Approbation par un modérateur": "Approval by a moderator",
"Articles par page": "Articles per page",
"Auteur": "Auteur",
"Brouillon": "Draft copy",
"Caractères par commentaire": "Characters by comment",
"Commentaire approuvé": "Approved comment",
"Commentaire rejeté": "Rejected commentary",
"Commentaire supprimé": "Deleted comment",
"Commentaires supprimés": "Deleted comments",
"Edition - Suppression": "Edition - Suppression",
"Effacer le commentaire": "Delete comment",
"Fermer les commentaires": "Turn off the comments",
"Rôle du propriétaire": "Owner's group",
"Lien du flux RSS": "Lien du Flux RSS",
"Notification par email": "Notification par email",
"Pleine largeur": "Full width",
"Propriétaire": "Owner",
"Publier": "Publish",
"Tous les groupes": "All groups",
"Tout effacer": "Erase everything",
"Très Grande": "Very tall",
"État": "Status"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 Artículos",
"4 articles": "4 Artículos",
"8 articles": "8 Artículos",
"Approbation par un modérateur": "Aprobación del moderador",
"Articles par page": "Artículos por página",
"Auteur": "Autor",
"Brouillon": "Borrador",
"Caractères par commentaire": "Caracteres por comentario",
"Commentaire approuvé": "Comentario aprobado",
"Commentaire rejeté": "Comentario rechazado",
"Commentaire supprimé": "Comentario eliminado",
"Commentaires supprimés": "Comentarios eliminados",
"Edition - Suppression": "Editar Borrar",
"Effacer le commentaire": "Borrar comentario",
"Fermer les commentaires": "Cerrar los comentarios",
"Rôle du propriétaire": "Grupo de propietarios",
"Lien du flux RSS": "Enlace de fuente RSS",
"Notification par email": "Notificación por correo electrónico",
"Pleine largeur": "Anchura completa",
"Propriétaire": "Propietario",
"Publier": "Publicar",
"Tous les groupes": "Todos los grupos",
"Tout effacer": "Borrar todo",
"Très Grande": "Muy grande",
"État": "Estado"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "",
"4 articles": "",
"8 articles": "",
"Approbation par un modérateur": "",
"Articles par page": "",
"Auteur": "",
"Brouillon": "",
"Caractères par commentaire": "",
"Commentaire approuvé": "",
"Commentaire rejeté": "",
"Commentaire supprimé": "",
"Commentaires supprimés": "",
"Edition - Suppression": "",
"Effacer le commentaire": "",
"Fermer les commentaires": "",
"Rôle du propriétaire": "",
"Lien du flux RSS": "",
"Notification par email": "",
"Pleine largeur": "",
"Propriétaire": "",
"Publier": "",
"Tous les groupes": "",
"Tout effacer": "",
"Très Grande": "",
"État": ""
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 Άρθρα",
"4 articles": "4 Άρθρα",
"8 articles": "8 Άρθρα",
"Approbation par un modérateur": "Έγκριση επόπτη",
"Articles par page": "Άρθρα ανά σελίδα",
"Auteur": "Συγγραφέας",
"Brouillon": "Σχέδιο",
"Caractères par commentaire": "Χαρακτήρες ανά σχόλιο",
"Commentaire approuvé": "Σχόλιο εγκεκριμένο",
"Commentaire rejeté": "Σχόλιο απορρίφθηκε",
"Commentaire supprimé": "Σχόλιο διαγράφηκε",
"Commentaires supprimés": "Σχόλια διαγράφονται",
"Edition - Suppression": "Επεξεργασία - Διαγραφή",
"Effacer le commentaire": "Διαγραφή σχολίου",
"Fermer les commentaires": "Κλείσιμο σχολίων",
"Rôle du propriétaire": "Ομάδα ιδιοκτήτη",
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",
"Notification par email": "Ειδοποίηση ηλεκτρονικού ταχυδρομείου",
"Pleine largeur": "Πλήρες πλάτος",
"Propriétaire": "Ιδιοκτήτης",
"Publier": "δημοσιεύστε το άρθρο",
"Tous les groupes": "Όλες οι ομάδες",
"Tout effacer": "Διαγραφή όλων",
"Très Grande": "Πολύ μεγάλη",
"État": "κατάσταση"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 articoli",
"4 articles": "4 articoli",
"8 articles": "8 articoli",
"Approbation par un modérateur": "Approvazione da parte di un moderatore",
"Articles par page": "Articoli per pagina",
"Auteur": "Auteur",
"Brouillon": "Progetto di copia",
"Caractères par commentaire": "Personaggi per commento",
"Commentaire approuvé": "Commento approvato",
"Commentaire rejeté": "Commento respinto",
"Commentaire supprimé": "Commento cancellato",
"Commentaires supprimés": "Commenti cancellati",
"Edition - Suppression": "Edizione - soppressione",
"Effacer le commentaire": "Elimina commento",
"Fermer les commentaires": "Disattiva i commenti",
"Rôle du propriétaire": "Gruppo del proprietario",
"Lien du flux RSS": "Lien Du Flux RSS",
"Notification par email": "Email di notifica par",
"Pleine largeur": "Intera larghezza",
"Propriétaire": "Proprietario",
"Publier": "Pubblicare",
"Tous les groupes": "Tutti i gruppi",
"Tout effacer": "Cancellare tutto",
"Très Grande": "Molto alto",
"État": "Stato"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 artigos",
"4 articles": "4 artigos",
"8 articles": "8 artigos",
"Approbation par un modérateur": "Aprovação por um moderador",
"Articles par page": "Artigos por página",
"Auteur": "Autora",
"Brouillon": "Cópia rascunho",
"Caractères par commentaire": "Personagens por comentários",
"Commentaire approuvé": "Comentário aprovado",
"Commentaire rejeté": "Comentário rejeitado",
"Commentaire supprimé": "Comentário excluído",
"Commentaires supprimés": "Comentários excluídos",
"Edition - Suppression": "Edição - Supressão",
"Effacer le commentaire": "Excluir comentário",
"Fermer les commentaires": "Desligue os comentários",
"Rôle du propriétaire": "Grupo do proprietário",
"Lien du flux RSS": "Lien du Flux RSS",
"Notification par email": "Notificação por e -mail",
"Pleine largeur": "Largura completa",
"Propriétaire": "Proprietário",
"Publier": "Publicar",
"Tous les groupes": "Todos os grupos",
"Tout effacer": "Apague tudo",
"Très Grande": "Muito alto",
"État": "Estado"
}

View File

@ -1,27 +0,0 @@
{
"12 articles": "12 makale",
"4 articles": "4 makale",
"8 articles": "8 makale",
"Approbation par un modérateur": "Moderatör onayı",
"Articles par page": "Sayfa başına makale",
"Auteur": "Yazar",
"Brouillon": "Karalama",
"Caractères par commentaire": "Yorum başına karakter",
"Commentaire approuvé": "Onaylanan yorum",
"Commentaire rejeté": "Reddedilen yorum",
"Commentaire supprimé": "Silinen yorum",
"Commentaires supprimés": "Silinen yorumlar",
"Edition - Suppression": "Düzenle - Sil",
"Effacer le commentaire": "Yorumu sil",
"Fermer les commentaires": "Yorumları kapat",
"Rôle du propriétaire": "Sahip grubu",
"Lien du flux RSS": "RSS dağıtım bağlantısı",
"Notification par email": "Eposta bildirimi",
"Pleine largeur": "Tam genişlik",
"Propriétaire": "Mal sahibi",
"Publier": "Yayınla",
"Tous les groupes": "Tüm gruplar",
"Tout effacer": "Her şeyi sil",
"Très Grande": "Çok büyük",
"État": "Durum"
}

View File

@ -1,22 +0,0 @@
<?php $moduleData['download'] = [
'add' => $this->getInput('profilAddDownloadAdd', helper::FILTER_BOOLEAN),
'edit' => $this->getInput('profilAddDownloadEdit', helper::FILTER_BOOLEAN),
'delete' => $this->getInput('profilAddDownloadDelete', helper::FILTER_BOOLEAN),
'option' => $this->getInput('profilAddDownloadOption', helper::FILTER_BOOLEAN),
'comment' => $this->getInput('profilAddDownloadComment', helper::FILTER_BOOLEAN),
'commentApprove' => $this->getInput('profilAddDownloadCommentApprove', helper::FILTER_BOOLEAN),
'commentDelete' => $this->getInput('profilAddDownloadCommentDelete', helper::FILTER_BOOLEAN),
'commentDeleteAll' => $this->getInput('profilAddDownloadCommentDeleteAll', helper::FILTER_BOOLEAN),
'categoryManage' => $this->getInput('profilAddDownloadCategories', helper::FILTER_BOOLEAN),
'categoryEdit' => $this->getInput('profilAddDownloadCategoryEdit', helper::FILTER_BOOLEAN),
'categoryDelete' => $this->getInput('profilAddDownloadCategoryDelete', helper::FILTER_BOOLEAN),
'deleteAllStats' => $this->getInput('profilAddDownloadCommentDeleteAllStats', helper::FILTER_BOOLEAN),
'config' => $this->getInput('profilAddDownloadAdd', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadEdit', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadOption', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadComment', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadCommentApprove', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadCommentDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilAddDownloadCommentDeleteAll', helper::FILTER_BOOLEAN),
];

View File

@ -1,25 +0,0 @@
<?php $moduleData['download'] = [
'add' => $this->getInput('profilEditDownloadEdit', helper::FILTER_BOOLEAN),
'edit' => $this->getInput('profilEditDownloadEdit', helper::FILTER_BOOLEAN),
'delete' => $this->getInput('profilEditDownloadDelete', helper::FILTER_BOOLEAN),
'option' => $this->getInput('profilEditDownloadOption', helper::FILTER_BOOLEAN),
'comment' => $this->getInput('profilEditDownloadComment', helper::FILTER_BOOLEAN),
'commentApprove' => $this->getInput('profilEditDownloadCommentApprove', helper::FILTER_BOOLEAN),
'commentDelete' => $this->getInput('profilEditDownloadCommentDelete', helper::FILTER_BOOLEAN),
'commentDeleteAll' => $this->getInput('profilEditDownloadCommentDeleteAll', helper::FILTER_BOOLEAN),
'categoryManage' => $this->getInput('profilEditDownloadCategories', helper::FILTER_BOOLEAN),
'categoryEdit' => $this->getInput('profilEditDownloadCategoryEdit', helper::FILTER_BOOLEAN),
'categoryDelete' => $this->getInput('profilEditDownloadCategoryDelete', helper::FILTER_BOOLEAN),
'deleteAllStats' => $this->getInput('profilEditDownloadCommentDeleteAllStats', helper::FILTER_BOOLEAN),
'config' => $this->getInput('profilEditDownloadEdit', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadEdit', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadOption', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadComment', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadCommentApprove', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadCommentDelete', helper::FILTER_BOOLEAN) ||
$this->getInput('profilEditDownloadCommentDeleteAll', helper::FILTER_BOOLEAN),
];

View File

@ -1,52 +0,0 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Téléchargement')); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilAddDownloadAdd', true, 'Ajouter'); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilAddDownloadEdit', true, 'Éditer'); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilAddDownloadDelete', true, 'Effacer'); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilAddDownloadOption', true, 'Options'); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilAddDownloadComment', true, 'Gérer les commentaires'); ?>
</div>
<div class="col3 downloadAddCommentOptions">
<?php echo template::checkbox('profilAddDownloadCommentApprove', true, 'Approuver un commentaire'); ?>
</div>
<div class="col3 downloadAddCommentOptions">
<?php echo template::checkbox('profilAddDownloadCommentDelete', true, 'Effacer un commentaire'); ?>
</div>
<div class="col3 downloadAddCommentOptions">
<?php echo template::checkbox('profilAddDownloadCommentDeleteAll', true, 'Effacer tous les commentaires'); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilAddDownloadCategories', true, 'Gérer les catégories'); ?>
</div>
<div class="col3 downloadAddCategoryOptions">
<?php echo template::checkbox('profilAddDownloadCategoryEdit', true, 'Éditer une catégorie'); ?>
</div>
<div class="col3 downloadAddCategoryOptions">
<?php echo template::checkbox('profilAddDownloadCategoryDelete', true, 'Effacer une catégorie'); ?>
</div>
<div class="col3 downloadAddCategoryOptions">
<?php echo template::checkbox('profilAddDownloadCommentDeleteAllStats', true, 'Effacer toutes les statistiques'); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,76 +0,0 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>
<?php echo sprintf('%s %s', helper::translate('Permissions'), helper::translate('Téléchargement')); ?>
</h4>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditDownloadAdd', true, 'Ajouter', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'add'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditDownloadEdit', true, 'Éditer', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'edit'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditDownloadDelete', true, 'Effacer', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'delete'])
]); ?>
</div>
<div class="col3">
<?php echo template::checkbox('profilEditDownloadOption', true, 'Options', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'option'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditDownloadComment', true, 'Gérer les commentaires', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'comment'])
]); ?>
</div>
<div class="col3 downloadEditCommentOptions">
<?php echo template::checkbox('profilEditDownloadCommentApprove', true, 'Approuver un commentaire', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentApprove'])
]); ?>
</div>
<div class="col3 downloadEditCommentOptions">
<?php echo template::checkbox('profilEditDownloadCommentDelete', true, 'Effacer un commentaire', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentDelete'])
]); ?>
</div>
<div class="col3 downloadEditCommentOptions">
<?php echo template::checkbox('profilEditDownloadCommentDeleteAll', true, 'Effacer tous les commentaires', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'commentDeleteAll'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::checkbox('profilEditDownloadCategories', true, 'Gérer les catégories', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryManage'])
]); ?>
</div>
<div class="col3 downloadEditCategoryOptions">
<?php echo template::checkbox('profilEditDownloadCategoryEdit', true, 'Éditer une catégorie', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryEdit'])
]); ?>
</div>
<div class="col3 downloadEditCategoryOptions">
<?php echo template::checkbox('profilEditDownloadCategoryDelete', true, 'Effacer une catégorie', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'categoryDelete'])
]); ?>
</div>
<div class="col3 downloadEditCategoryOptions">
<?php echo template::checkbox('profilEditDownloadCommentDeleteAllStats', true, 'Effacer toutes les statistiques', [
'checked' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'download', 'deleteAllStats'])
]); ?>
</div>
</div>
</div>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

View File

@ -1,18 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,54 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Soumission du formulaire pour enregistrer en brouillon
*/
$("#downloadAddDraft").on("click", function() {
$("#downloadAddState").val(0);
$("#downloadAddForm").trigger("submit");
});
/**
* Options de commentaires
*/
$("#downloadAddCommentClose").on("change", function() {
if ($(this).is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
});
$("#downloadAddCommentNotification").on("change", function() {
if ($(this).is(':checked') ) {
$("#downloadAddCommentGroupNotification").slideDown();
} else {
$("#downloadAddCommentGroupNotification").slideUp();
}
});
$( document).ready(function() {
if ($("#downloadAddCloseComment").is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
if ($("#downloadAddCommentNotification").is(':checked') ) {
$("#downloadAddCommentGroupNotification").slideDown();
} else {
$("#downloadAddCommentGroupNotification").slideUp();
}
});

View File

@ -1,193 +0,0 @@
<?php echo template::formOpen('downloadAddForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('downloadAddBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset7">
<?php echo template::button('downloadAddDraft', [
'uniqueSubmission' => true,
'value' => 'Brouillon'
]); ?>
<?php echo template::hidden('downloadAddState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('downloadAddPublish', [
'value' => 'Publier'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations sur la ressource</h4>
<div class="row">
<div class="col3">
<?php echo template::text('downloadAddTitle', [
'label' => 'Titre'
]); ?>
</div>
<div class="col3">
<?php echo template::text('downloadAddId', [
'label' => 'Id Interne',
]); ?>
</div>>
<div class="col3">
<?php echo template::text('downloadAddVersion', [
'label' => 'Version'
]); ?>
</div>
<div class="col3">
<?php echo template::date('downloadAddversionDate', [
'label' => 'Publiée le',
'type' => 'datetime-local'
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('downloadAddAuthor', [
'label' => 'Auteur'
]); ?>
</div>
<div class="col3">
<?php echo template::select('downloadAddLicense', $module::$licenses, [
'label' => 'Licence'
]); ?>
</div>
<div class="col3">
<?php if ($module::$categories) {
echo template::select('downloadAddCategorie', $module::$categories, [
'label' => 'Catégorie'
]);
} else {
echo template::select('downloadAddCategorie', ['' => ''], [
'label' => 'Pas de catégorie',
'disabled' => true
]);
}
?>
</div>
<div class="col3">
<?php echo template::file('downloadAddThumb', [
'label' => 'Capture d\'écran',
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'type' => 1,
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::select('downloadAddRessourceType', $module::$ressourceType, [
'label' => 'Type de ressource',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'ressourceType'])
]); ?>
</div>
<div class="col9">
<div class="row">
<div class="col12">
<?php echo template::file('downloadAddFile', [
'label' => 'Fichier',
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file'])) : ''
]); ?>
</div>
<div class="col12">
<?php echo template::text('downloadAddUrl', [
'label' => 'URL',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'url']),
'placeholder' => 'https://'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('downloadAddContent', [
'class' => 'editorWysiwyg'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Options de publication</h4>
<div class="row">
<div class="col4">
<?php echo template::select('downloadAddUserId', $module::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
<?php echo template::date('downloadAddPublishedOn', [
'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.',
'label' => 'Date de publication',
'value' => time(),
'type' => 'datetime-local'
]); ?>
</div>
<div class="col4">
<?php echo template::select('downloadAddConsent', $module::$itemConsent, [
'label' => 'Edition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_ROLE : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Commentaires</h4>
<div class="row">
<div class="col4 ">
<?php echo template::checkbox('downloadAddCommentClose', true, 'Fermer les commentaires', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose'])
]); ?>
</div>
<div class="col4 commentOptionsWrapper ">
<?php echo template::checkbox('downloadAddCommentApproved', true, 'Approbation par un modérateur', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']),
''
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadAddCommentMaxlength', $module::$commentLength, [
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3 commentOptionsWrapper offset2">
<?php echo template::checkbox('downloadAddCommentNotification', true, 'Notification par email', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadAddCommentGroupNotification', $module::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -1,18 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,23 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Confirmation de suppression
*/
$(".categoriesDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cette catégorie ?", function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -1,40 +0,0 @@
<?php echo template::formOpen('categoriesForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('categoriesBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
</div>
<div class="row ">
<div class="col10 offset1">
<div class="block">
<h4>Nouvelle catégorie</h4>
<div class="row ">
<div class="col10">
<?php echo template::text('categoriesTitle', [
'label' => 'Nom',
'value' => $this->getData(['module', $this->getUrl(0), 'categories', $this->getUrl(2), 'title'])
]); ?>
</div>
<div class="col2 verticalAlignBottom">
<?php echo template::submit('categoriesSubmit', [
'ico' => 'plus',
'value' => '',
]); ?>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<?php if ($module::$categories): ?>
<?php echo template::table([2, 6, 1, 1], $module::$categories, ['Nom', 'URL', '', '']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucune catégorie'); ?>
<?php endif; ?>
<div class=" moduleVersion">Version
<?php echo $module::VERSION; ?>
</div>

View File

@ -1,18 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

View File

@ -1,30 +0,0 @@
<?php echo template::formOpen('categoryEditForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('categoryEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/categories',
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('categoryEditSubmit', [
'value' => 'Valider'
]); ?>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Éditer la catégorie</h4>
<div class="row">
<div class="col12">
<?php echo template::text('categoryEditTitle', [
'label' => 'Nom',
'value' => $this->getData(['module', $this->getUrl(0), 'categories', $this->getUrl(2)])
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

@ -1,18 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2020, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/** NE PAS EFFACER
* admin.css
*/

Some files were not shown because too many files have changed in this diff Show More