Compare commits

..

73 Commits

Author SHA1 Message Date
1b9027a24a 1.21 correctifs de commentaire + nouvelles icônes 2025-02-07 21:06:32 +01:00
234bf9d6bc Commentaires 2025-02-07 21:03:25 +01:00
72c791045d Nouvelles icônes 2025-02-07 20:42:22 +01:00
61e3cb6443 ajoute sondage 2025-02-07 17:34:00 +01:00
239fa36b47 renomme les constantes 2025-02-07 17:31:43 +01:00
d76beebd2d Traductions 2025-02-07 17:25:16 +01:00
0848df4edc RFM window size 2025-02-07 17:10:44 +01:00
8a09d7c187 Nom de variable $role 2025-02-07 16:52:16 +01:00
4a91e286dd Table users 2025-02-07 12:55:05 +01:00
c9f1789694 Verison et largeur de table 2025-02-07 12:44:29 +01:00
301ed4cf22 Bug page edit content 2025-02-07 12:33:39 +01:00
831d01987d "role" pour "group" 2025-02-07 12:28:20 +01:00
a2bb3a51a7 Rôles pour groupes 2025-02-07 11:47:49 +01:00
d3e5547461 Merge branch 'role' 2025-02-07 11:34:35 +01:00
bc6cc75202 1.20.04 2025-02-07 10:53:29 +01:00
71fe3ee650 1.20.05 Tri et largeur de champs table des utilisateur colonne dernière connection 2025-02-07 10:50:25 +01:00
ccb7efdd8c Commentaires 2025-02-06 16:47:37 +01:00
8c5b6169cc Commentaires 2025-02-06 16:41:30 +01:00
697b94c608 Etiquettes Rôle avec accent circonflexe 2025-02-06 16:29:36 +01:00
73e07e92fa Commente update.inc.php 2025-02-06 14:31:47 +01:00
6b7679c997 update page and module 2025-02-06 13:42:38 +01:00
e151f66b6e rename role update page et module 2025-02-06 11:12:38 +01:00
38b637361b 1.20.04 Corrige l'ordre dans le tableau des participants d'un espace 2025-02-05 12:29:23 +01:00
90a669ac65 fix users table 2025-02-05 07:51:47 +01:00
1dcadc41e5 1.21.01 fix ordre tableau users d'un espace date et étiquette 2025-02-05 07:48:49 +01:00
90fee81365 Revert "1.21 renomme group en role"
This reverts commit 07e390d818e63f873af1d5b154dd316609c8a269.
2025-02-05 07:36:37 +01:00
eceed6b233 1.21 branche beta 2025-02-05 07:36:13 +01:00
07e390d818 1.21 renomme group en role 2025-02-03 14:44:22 +01:00
cbc7a1ad19 1.21.04 sécurisation de la méthode de changement de mot de passe. 2025-01-31 18:13:00 +01:00
e7e0fef37e 1.20.03 version 2025-01-31 10:45:45 +01:00
d0f14f0e60 1.20.03 Dépréciation concaténation 2025-01-31 09:52:52 +01:00
cca646b1be revert page edit script 2025-01-31 09:31:49 +01:00
6db9837238 revert page edit script 2025-01-30 16:39:13 +01:00
ca313a2b18 1.20.03 revert page edit 2025-01-30 16:36:36 +01:00
547dea7350 1.20.02 save dataversion 2025-01-30 13:07:37 +01:00
9d6e229e0a 1.20.02
Installe la variable de masquage des pages dans les thèmes où elle n'a pas été définie.
Corrige le décalage du contenu de la page lorsque les pages sont masquées du menu.
Mise à jour du jeu de données 1.20.02
2025-01-30 13:03:40 +01:00
22d69ccafb 1.20.01 bug template table 2025-01-29 20:39:49 +01:00
5e59984211 1.20.01 bug de theme à installation 2025-01-29 20:17:31 +01:00
0301e1f31d 1.20.00 commente 2025-01-29 16:51:02 +01:00
1f0d490688 Bug page Editor 2025-01-28 18:44:40 +01:00
288393778a Bug édition de page 2025-01-28 18:22:28 +01:00
7773bc916f Revert "Revert Optimisation Page Edit"
This reverts commit 5ebbcfcb9d025e53029ed9f252ac5bac686506c4.
2025-01-28 18:10:29 +01:00
5ebbcfcb9d Revert Optimisation Page Edit 2025-01-28 17:29:43 +01:00
f237d0bca1 1.20.00 2025-01-28 12:33:02 +01:00
70fa6efee7 Message d'erreur d'envoi de l'email de réinitialisaiton 2025-01-27 18:52:41 +01:00
30ed4349d9 Formatage du message d'erreur d'erreur de démarrage 2025-01-27 18:43:55 +01:00
ad998c17d1 Liste des users, corrige la colonne date de dernière connexion. 2025-01-26 20:50:19 +01:00
4d6b6f8d4f Bug template table, id des colonnes mal placés 2025-01-26 20:49:37 +01:00
dd3582b9db Supprime des commentaires 2025-01-25 22:25:12 +01:00
0e26e71a50 1.19.05 Script page edit optimisé 2025-01-25 22:22:45 +01:00
9a56fc9572 Revert "1.19.05 Page edit script optimisé"
This reverts commit ac8689b40aeadb0b43a5c90824cd74fc05f2ad75.
2025-01-25 21:58:16 +01:00
ac8689b40a 1.19.05 Page edit script optimisé 2025-01-25 21:50:29 +01:00
0f9a79411d 1.9.05 Tri par date et bug dernière page vue 2025-01-25 19:03:49 +01:00
b944a3bac7 Renforce jsonDB 2025-01-25 14:21:31 +01:00
4bab81c541 1.19.04 Fix bug du formulaire édition de page 2025-01-24 19:40:41 +01:00
2f3dd5926b 1.19..04 Supprime jquery de datatable 2025-01-24 18:47:07 +01:00
959139b239 Miniature des images vectorielles 2025-01-24 18:01:36 +01:00
e958287b9e 1.19.04 largeur de page de l'espace lorsque les pages sont désactivées dans le menu 2025-01-24 17:40:31 +01:00
e110e7b4f9 Bug setup 2025-01-24 17:28:55 +01:00
61ec8c04be Bug descripteur php 8 2025-01-24 17:17:50 +01:00
f0ccf8eb2f 1.19.04 bordure autour du form update et install 2025-01-23 21:22:43 +01:00
b831275901 1.19.04 cadre autour du form update 2025-01-23 21:17:11 +01:00
5217763afb Supprime l'événement beforeunload 2025-01-23 21:06:51 +01:00
6d19f6ebad 1.19.03
- jsonDB upgrade
- Supprime le change de $siteContent dans la gestion d'un espace
2025-01-23 20:39:22 +01:00
ed2b2c2826 jsondb WIP 2025-01-23 16:57:27 +01:00
91e18a9408 1.19.02 hauteur minimale de la barre de menu vide 2025-01-23 13:22:04 +01:00
9ae150f3aa Users par Nom puis Prénom 2025-01-22 15:35:26 +01:00
88acbae810 Message d'erreur d'envoi du mail de réinitialisation du mot de passe 2025-01-22 14:56:10 +01:00
162bb9a78d Message erreur d'envoi du mail de réinitialisation 2025-01-22 14:52:48 +01:00
81a996c714 Form 4.6 2025-01-22 12:42:37 +01:00
2e9cfaa991 Form 4.6 2025-01-22 12:39:18 +01:00
f2df3743c6 Fix bug reset admin theme 2025-01-22 11:36:43 +01:00
83943c6b52 Méthode number 2025-01-21 19:45:31 +01:00
158 changed files with 5595 additions and 954 deletions

View File

@ -1,4 +1,4 @@
# ZwiiCampus 1.18.00 # ZwiiCampus 1.21.01
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é. 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,4 +1,5 @@
<?php <?php
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: Andrey Mistulov * User: Andrey Mistulov
@ -112,78 +113,97 @@ class JsonDb extends \Prowebcraft\Dot
/** /**
* Local database upload * Charge les données depuis un fichier JSON.
* @param bool $reload Reboot data? *
* @return array|mixed|null * @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
*/ */
protected function loadData($reload = false) protected function loadData($reload = false): ?array
{ {
if ($this->data === null || $reload) { if ($this->data === null || $reload) {
$this->db = $this->config['dir'] . $this->config['name']; $this->db = $this->config['dir'] . $this->config['name'];
if (!file_exists($this->db)) { if (!file_exists($this->db)) {
return null; // Rebuild database manage by CMS return null; // Rebuild database managed by CMS
} else { }
if ($this->config['backup']) { if ($this->config['backup']) {
$backup_path = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup';
try { try {
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup'); if (!copy($this->db, $backup_path)) {
throw new \RuntimeException('Échec de la création de la sauvegarde');
}
} catch (\Exception $e) { } catch (\Exception $e) {
error_log('Erreur de chargement : ' . $e); throw new \RuntimeException('Erreur de sauvegarde : ' . $e->getMessage());
exit('Erreur de chargement : ' . $e);
} }
} }
}
$this->data = json_decode(file_get_contents($this->db), true); $file_contents = file_get_contents($this->db);
if (!$this->data === null) {
throw new \InvalidArgumentException('Le fichier ' . $this->db $this->data = json_decode($file_contents, true);
. ' contient des données invalides.');
if ($this->data === null) {
throw new \InvalidArgumentException('Le fichier ' . $this->db . ' contient des données invalides.');
} }
} }
return $this->data; return $this->data;
} }
/** /**
* Save database * 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
*/ */
public function save() public function save(): void
{ {
// Encode les données au format JSON avec les options spécifiées if ($this->data === null) {
//$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT); throw new \RuntimeException('Tentative de sauvegarde de données nulles');
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); }
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());
}
// Vérifie la longueur de la chaîne JSON encodée
$encoded_length = strlen($encoded_data); $encoded_length = strlen($encoded_data);
$max_attempts = 5;
// Initialise le compteur de tentatives for ($attempt = 0; $attempt < $max_attempts; $attempt++) {
$attempt = 0; $temp_file = $this->db . '.tmp' . uniqid();
// Tente d'encoder les données en JSON et de les sauvegarder jusqu'à 5 fois en cas d'échec try {
while ($attempt < 5) { $write_result = file_put_contents($temp_file, $encoded_data, LOCK_EX);
// 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 ($write_result === $encoded_length) {
// Sort de la boucle si l'écriture a réussi if (rename($temp_file, $this->db)) {
break; return;
}
} }
// Incrémente le compteur de tentatives error_log("Échec sauvegarde : longueur incorrecte ou renommage échoué (tentative " . ($attempt + 1) . ")");
$attempt++; } catch (\Exception $e) {
error_log('Erreur de sauvegarde : ' . $e->getMessage());
// Attente 1/4 de seconde if (file_exists($temp_file)) {
usleep(0.25); unlink($temp_file);
}
} }
// Vérifie si l'écriture a échoué même après plusieurs tentatives usleep(pow(2, $attempt) * 250000);
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.');
// Affiche un message d'erreur et termine le script throw new \RuntimeException('Échec de sauvegarde après ' . $max_attempts . ' tentatives');
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 // Affichage de la barre de membre simple
if ( if (
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN $this->getUser('role') >= self::ROLE_MEMBER && $this->getUser('role') < self::ROLE_ADMIN
&& $this->getData(['theme', 'footer', 'memberBar']) === true && $this->getData(['theme', 'footer', 'memberBar']) === true
) { ) {
$items .= '<span id="footerDisplayMemberAccount"'; $items .= '<span id="footerDisplayMemberAccount"';
@ -508,7 +508,7 @@ class layout extends common
* Affichage du sélecteur d'espaces * Affichage du sélecteur d'espaces
*/ */
if ( if (
$this->getUser('group') === self::GROUP_MEMBER $this->getUser('role') === self::ROLE_MEMBER
&& $this->getData(['theme', 'menu', 'selectSpace']) === true && $this->getData(['theme', 'menu', 'selectSpace']) === true
) { ) {
if ($this->getCoursesByProfil()) { if ($this->getCoursesByProfil()) {
@ -532,11 +532,11 @@ class layout extends common
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1 && $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
) { ) {
$href = ''; $href = '';
switch ($this->getUser('group')) { switch ($this->getUser('role')) {
case self::GROUP_MEMBER: case self::ROLE_MEMBER:
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id'); $href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
break; break;
case self::GROUP_EDITOR: case self::ROLE_EDITOR:
if ( if (
$this->getData(['enrolment', self::$siteContent]) && ($this->getUser('id') === $this->getData(['course', self::$siteContent, 'author'])) $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 // 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; $href = helper::baseUrl() . 'course/users/' . self::$siteContent;
} }
break; break;
case self::GROUP_ADMIN: case self::ROLE_ADMIN:
$href = helper::baseUrl() . 'course/users/' . self::$siteContent; $href = helper::baseUrl() . 'course/users/' . self::$siteContent;
} }
if ($href) { if ($href) {
@ -565,7 +565,7 @@ class layout extends common
* Affichage des boutons gestionnaire de fichiers et mon compte * Affichage des boutons gestionnaire de fichiers et mon compte
*/ */
if ( if (
$this->getUser('group') === self::GROUP_MEMBER $this->getUser('role') === self::ROLE_MEMBER
&& $this->getData(['theme', 'menu', 'memberBar']) === true && $this->getData(['theme', 'menu', 'memberBar']) === true
) { ) {
@ -613,8 +613,7 @@ class layout extends common
} }
// Retourne les items du menu // Retourne les items du menu
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight; echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
echo '</ul>';
} }
/** /**
@ -649,7 +648,7 @@ class layout extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $parentPageId, 'disable']) === true ) or ($this->getData(['page', $parentPageId, 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < self::GROUP_EDITOR and $this->getUser('role') < self::ROLE_EDITOR
) )
) { ) {
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); $pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -715,7 +714,7 @@ class layout extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $childKey, 'disable']) === true ) or ($this->getData(['page', $childKey, 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < self::GROUP_EDITOR and $this->getUser('role') < self::ROLE_EDITOR
) )
) { ) {
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); $pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -976,7 +975,7 @@ class layout extends common
* Les admins voient tous les contenus * Les admins voient tous les contenus
* Les enseignants les contenus dont ils sont auteurs * Les enseignants les contenus dont ils sont auteurs
*/ */
if ($this->getUser('group') >= self::GROUP_EDITOR) { if ($this->getUser('role') >= self::ROLE_EDITOR) {
if (is_array($this->getCoursesByProfil())) { if (is_array($this->getCoursesByProfil())) {
$leftItems .= '<li><select id="barSelectCourse" >'; $leftItems .= '<li><select id="barSelectCourse" >';
$leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>'; $leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
@ -991,7 +990,7 @@ class layout extends common
'help' => 'Gérer les espaces' 'help' => 'Gérer les espaces'
]) . '</li>'; ]) . '</li>';
} }
if ($this->getUser('group') >= self::GROUP_ADMIN) { if ($this->getUser('role') >= self::ROLE_ADMIN) {
$leftItems .= '<li>' . template::ico('brush', [ $leftItems .= '<li>' . template::ico('brush', [
'help' => 'Thème', 'help' => 'Thème',
'href' => helper::baseUrl() . 'theme' 'href' => helper::baseUrl() . 'theme'
@ -999,8 +998,8 @@ class layout extends common
} }
// Liste des pages et bouton de gestion interdit pour l'accueil sauf admin // Liste des pages et bouton de gestion interdit pour l'accueil sauf admin
if ( if (
($this->getUser('group') === self::GROUP_EDITOR && self::$siteContent != 'home') ($this->getUser('role') === self::ROLE_EDITOR && self::$siteContent != 'home')
|| $this->getUser('group') === self::GROUP_ADMIN || $this->getUser('role') === self::ROLE_ADMIN
) { ) {
$leftItems .= '<li><select id="barSelectPage">'; $leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>'; $leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
@ -1123,11 +1122,11 @@ class layout extends common
$rightItems = ''; $rightItems = '';
if ( if (
( (
$this->getUser('group') === self::GROUP_EDITOR $this->getUser('role') === self::ROLE_EDITOR
&& $this->getUser('permission', 'filemanager') === true && $this->getUser('permission', 'filemanager') === true
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none' && $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
) )
|| $this->getUser('group') === self::GROUP_ADMIN || $this->getUser('role') === self::ROLE_ADMIN
) { ) {
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent); $folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
$rightItems .= '<li>' . template::ico('folder', [ $rightItems .= '<li>' . template::ico('folder', [
@ -1138,13 +1137,13 @@ class layout extends common
} }
if ( if (
self::$siteContent === 'home' self::$siteContent === 'home'
&& $this->getUser('group') >= self::GROUP_ADMIN && $this->getUser('role') >= self::ROLE_ADMIN
) { ) {
$rightItems .= '<li>' . template::ico('flag', [ $rightItems .= '<li>' . template::ico('flag', [
'help' => 'Langues', 'help' => 'Langues',
'href' => helper::baseUrl() . 'language' 'href' => helper::baseUrl() . 'language'
]) . '</li>'; ]) . '</li>';
$rightItems .= '<li>' . template::ico('users', [ $rightItems .= '<li>' . template::ico('address-book', [
'help' => 'Utilisateurs', 'help' => 'Utilisateurs',
'href' => helper::baseUrl() . 'user' 'href' => helper::baseUrl() . 'user'
]) . '</li>'; ]) . '</li>';
@ -1210,9 +1209,9 @@ class layout extends common
'href' => helper::baseUrl() . 'plugin' 'href' => helper::baseUrl() . 'plugin'
]) . '</li>'; ]) . '</li>';
} }
// Boutons depuis le groupe éditeur // Boutons depuis le rôle éditeur
if ( if (
$this->getUser('group') >= self::GROUP_EDITOR $this->getUser('role') >= self::ROLE_EDITOR
&& $this->getUser('permission', 'user', 'edit') && $this->getUser('permission', 'user', 'edit')
) { ) {
@ -1298,7 +1297,7 @@ class layout extends common
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
if ( if (
$this->isConnected() === true $this->isConnected() === true
and $this->getUser('group') >= self::GROUP_EDITOR and $this->getUser('role') >= self::ROLE_EDITOR
) { ) {
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';'; $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 .= 'span.mce-text{background-color: unset !important;}';
$css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}';
$css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; $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],.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],input[type=number],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
// spécifiques au module de blog // 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']) . ';}'; $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 // Couleur fixée dans admin.css
@ -168,7 +168,7 @@ class core extends common
$colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor'])); $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 .= '.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 .= '.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=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=number]: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 .= '.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 .= '.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'] . '}'; $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 // Déterminer la hauteur max du menu pour éviter les débordements
$padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px" // $padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px"
$fontSize = (float) $this->getData(['theme', 'text', 'fontSize']); // Taille de référence en pixels // $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 // $menuFontSize = (float) $this->getData(['theme', 'menu', 'fontSize']); // Taille du menu en em
// Extraire la première valeur du padding (par exemple "10px 20px" -> "10px") // 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 // Convertir menuFontSize (en em) en pixels
$menuFontSizeInPx = $menuFontSize * $fontSize; // $menuFontSizeInPx = $menuFontSize * $fontSize;
// Calculer la hauteur totale // Calculer la hauteur totale
$totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx; // $totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx;
// Fixer la hauteur maximale de la barre de menu // Fixer la hauteur maximale de la barre de menu
// $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}'; // $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'] . ';}'; $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'])); $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 .= '.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=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']) . ';}'; $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']) . ';}';
// Bordure du contour TinyMCE // Bordure du contour TinyMCE
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}'; $css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
// Enregistre la personnalisation // Enregistre la personnalisation
@ -446,7 +446,7 @@ class core extends common
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0 && $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 // Le userId n'est pas celui d'un admis ni le compte d'un gestionnaire de cet espace
&& ( && (
$this->getUser('group') < common::GROUP_ADMIN $this->getUser('role') < common::ROLE_ADMIN
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author']) || $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 // Force la déconnexion des membres bannis ou d'une seconde session
if ( if (
$this->isConnected() === true $this->isConnected() === true
and ($this->getUser('group') === common::GROUP_BANNED and ($this->getUser('role') === common::ROLE_BANNED
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf']) or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
and $this->getData(['config', 'connect', 'autoDisconnect']) === true) and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
) )
@ -488,7 +488,7 @@ class core extends common
and $this->getUrl(1) !== 'login' and $this->getUrl(1) !== 'login'
and ($this->isConnected() === false and ($this->isConnected() === false
or ($this->isConnected() === true or ($this->isConnected() === true
and $this->getUser('group') < common::GROUP_ADMIN and $this->getUser('role') < common::ROLE_ADMIN
) )
) )
) { ) {
@ -505,11 +505,11 @@ class core extends common
$access = null; $access = null;
if ($this->getData(['page', $this->getUrl(0)]) !== null) { if ($this->getData(['page', $this->getUrl(0)]) !== null) {
if ( if (
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR $this->getData(['page', $this->getUrl(0), 'role']) === common::ROLE_VISITOR
or ($this->isConnected() === true or ($this->isConnected() === true
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group']) // and $this->getUser('role') >= $this->getData(['page', $this->getUrl(0), 'role'])
// Modification qui tient compte du profil de la page // Modification qui tient compte du profil de la page
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil'])) and ($this->getUser('role') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'role']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
) )
) { ) {
$access = true; $access = true;
@ -526,7 +526,7 @@ class core extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true ) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < common::GROUP_EDITOR and $this->getUser('role') < common::ROLE_EDITOR
) )
) { ) {
$access = false; $access = false;
@ -705,11 +705,11 @@ class core extends common
if (array_key_exists($action, $module::$actions)) { if (array_key_exists($action, $module::$actions)) {
$module->$action(); $module->$action();
$output = $module->output; $output = $module->output;
// Check le groupe de l'utilisateur // Check le rôle de l'utilisateur
if ( if (
($module::$actions[$action] === common::GROUP_VISITOR ($module::$actions[$action] === common::ROLE_VISITOR
or ($this->isConnected() === true or ($this->isConnected() === true
and $this->getUser('group') >= $module::$actions[$action] and $this->getUser('role') >= $module::$actions[$action]
and $this->getUser('permission', $moduleId, $action) and $this->getUser('permission', $moduleId, $action)
) )
) )

View File

@ -884,6 +884,10 @@ class template
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">'; $html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
// Début tableau // Début tableau
$html .= '<table id="' . $attributes['id'] . '" class="table ' . $attributes['class'] . '">'; $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 // Entêtes
if ($head) { if ($head) {
// Début des entêtes // Début des entêtes
@ -891,21 +895,17 @@ class template
$html .= '<tr class="nodrag">'; $html .= '<tr class="nodrag">';
$i = 0; $i = 0;
foreach ($head as $th) { foreach ($head as $th) {
$html .= '<th class="col' . $cols[$i++] . '">' . $th . '</th>'; $html .= '<th id="' . $rowsId[$i] . '" class="col' . $cols[$i++] . '">' . $th . '</th>';
} }
// Fin des entêtes // Fin des entêtes
$html .= '</tr>'; $html .= '</tr>';
$html .= '</thead>'; $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 // Début contenu
$j = 0; $j = 0;
foreach ($body as $tr) { foreach ($body as $tr) {
// Id de ligne pour les tableaux drag and drop // Id de ligne pour les tableaux drag and drop
$html .= '<tr id="' . $rowsId[$j++] . '">'; $html .= '<tr>';
$i = 0; $i = 0;
foreach ($tr as $td) { foreach ($tr as $td) {
$html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>'; $html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>';
@ -992,6 +992,117 @@ class template
return $html; 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 * Crée un champ texte long
* @param string $nameId Nom et id du champ * @param string $nameId Nom et id du champ

View File

@ -116,30 +116,14 @@ core.confirm = function (text, yesCallback, noCallback) {
/** /**
* Scripts à exécuter en dernier * Scripts à exécuter en dernier
*/
core.end = function () { 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 () { $(function () {
core.end(); core.end();
}); });
*/
/** /**
* Ajoute une notice * Ajoute une notice
@ -390,12 +374,11 @@ core.start = function () {
var totalHeight = firstPadding + fontSize + menuFontSizeInPx; var totalHeight = firstPadding + fontSize + menuFontSizeInPx;
$("#menuLeft").css({ $("#menuLeft").css({
"visibility": "hidden", "visibility": "hidden",
"overflow": "hidden",
"max-width": "10px" "max-width": "10px"
}); });
// Par défaut pour tous les thèmes. // Par défaut pour tous les thèmes.
$("#menuLeft, nav").css("max-height", totalHeight + "px"); $("#menuLeft").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px");
} }
}; };

View File

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

View File

@ -3,20 +3,17 @@
/** /**
* Vérification de la version de PHP * Vérification de la version de PHP
*/ */
if (version_compare(PHP_VERSION, '7.2.0', '<')) { if (version_compare(PHP_VERSION, '7.2.0', '<')) {
exit('PHP 7.2+ mini requis - PHP 7.2+ mini required'); displayErrorPage('PHP 7.2+ mini requis - PHP 7.2+ mini required');
} }
if (version_compare(PHP_VERSION, '8.3.999', '>')) { if (version_compare(PHP_VERSION, '8.3.999', '>')) {
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'); 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');
} }
/** /**
* Check les modules installés * Check les modules installés
*/ */
$e = [ $e = [
'gd', 'gd',
'json', 'json',
@ -31,18 +28,22 @@ $e = [
]; ];
$m = get_loaded_extensions(); $m = get_loaded_extensions();
$b = false; $b = false;
$missingModules = [];
foreach ($e as $k => $v) { foreach ($e as $k => $v) {
if (array_search($v, $m) === false) { if (array_search($v, $m) === false) {
$b = true; $b = true;
echo '<pre><p>Module PHP : ' . $v . ' manquant - Module PHP ' . $v . ' missing.</p></pre>'; $missingModules[] = $v;
} }
} }
if ($b) 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>'); $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);
* Contrôle les htacess displayErrorPage($errorMessage);
*/ }
/**
* Contrôle les htaccess
*/
$d = [ $d = [
'', '',
'site/data/', 'site/data/',
@ -51,6 +52,33 @@ $d = [
// 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour // 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour
]; ];
foreach ($d as $key) { foreach ($d as $key) {
if (file_exists($key . '.htaccess') === false) 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>' ); $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;
} }

View File

@ -4,25 +4,25 @@
* Mises à jour suivant les versions de ZwiiCampus * Mises à jour suivant les versions de ZwiiCampus
*/ */
// Version 1.7.00
if ( if (
$this->getData(['core', 'dataVersion']) < 1700 $this->getData(['core', 'dataVersion']) < 1700
) { ) {
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé. // Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
foreach (['1', '2'] as $group) { foreach (['1', '2'] as $role) {
foreach (array_keys($this->getData(['profil', $group])) as $profil) { foreach (array_keys($this->getData(['profil', $role])) as $profil) {
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) { if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']); $path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]); $this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]); $this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $group, $profil, 'folder', 'path']); $this->deleteData(['profil', $role, $profil, 'folder', 'path']);
} }
} }
} }
$this->setData(['core', 'dataVersion', 1700]); $this->setData(['core', 'dataVersion', 1700]);
} }
// Version 1.8.00
if ( if (
$this->getData(['core', 'dataVersion']) < 1800 $this->getData(['core', 'dataVersion']) < 1800
) { ) {
@ -46,3 +46,90 @@ if (
} }
$this->setData(['core', 'dataVersion', 1800]); $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,6 +657,7 @@ nav a:hover {
#menuLeft { #menuLeft {
display: inline-flex; display: inline-flex;
float: left;
} }
#menuRight { #menuRight {
@ -1200,6 +1201,7 @@ input[type='datetime-local'],
input[type='time'], input[type='time'],
input[type='month'], input[type='month'],
input[type='week'], input[type='week'],
input[type='number'],
.inputFile, .inputFile,
select, select,
textarea { textarea {
@ -1225,6 +1227,7 @@ input[type='datetime-local']:hover,
input[type='time']:hover, input[type='time']:hover,
input[type='month']:hover, input[type='month']:hover,
input[type='week']:hover, input[type='week']:hover,
input[type='number']:hover,
.inputFile:hover, .inputFile:hover,
select:hover, select:hover,
textarea:hover { textarea:hover {
@ -1239,6 +1242,7 @@ input[type='datetime-local'].notice,
input[type='time'].notice, input[type='time'].notice,
input[type='month'].notice, input[type='month'].notice,
input[type='week'].notice, input[type='week'].notice,
input[type='number'].notice,
.inputFile.notice, .inputFile.notice,
select.notice, select.notice,
textarea.notice { textarea.notice {
@ -1254,6 +1258,7 @@ input[type='datetime-local'].notice:hover,
input[type='time'].notice:hover, input[type='time'].notice:hover,
input[type='month'].notice:hover, input[type='month'].notice:hover,
input[type='week'].notice:hover, input[type='week'].notice:hover,
input[type='number'].notice:hover,
.inputFile.notice:hover, .inputFile.notice:hover,
select.notice:hover, select.notice:hover,
textarea.notice:hover { textarea.notice:hover {

22
core/layout/error.css Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,7 +21,6 @@ $(document).ready((function () {
$(location).attr("href", _this.attr("href")) $(location).attr("href", _this.attr("href"))
})) }))
})); }));
$.fn.dataTable.moment( 'DD/MM/YYYY' );
$('#dataTables').DataTable({ $('#dataTables').DataTable({
language: { language: {
url: "core/vendor/datatables/french.json" url: "core/vendor/datatables/french.json"
@ -32,11 +31,26 @@ $(document).ready((function () {
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]], "lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
"columnDefs": [ "columnDefs": [
{ {
target: 6, 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,
orderable: false, orderable: false,
searchable: false searchable: false
} }]
]
}); });
})); }));

View File

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

View File

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

View File

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

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)", "Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)", "Grande (300px)": "Grande (300px)",
"Gras": "Bold", "Gras": "Bold",
"Groupe": "Group", "Rôle": "role",
"Groupe associé": "Associated Group", "Rôle associé": "Associated role",
"Groupe requis pour accéder à la page :": "Group required to access the page:", "Rôle requis pour accéder à la page :": "role required to access the page:",
"Groupes": "Groups", "Groupes": "Groups",
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt", "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", "Générer une capture Open Graph": "Generate an Open Graph capture",
@ -295,7 +295,7 @@
"Importer dans": "Import into", "Importer dans": "Import into",
"Importer des utilisateurs en masse": "Import mass users", "Importer des utilisateurs en masse": "Import mass users",
"Impossible d'ouvrir l'archive": "Impossible to open the archive", "Impossible d'ouvrir l'archive": "Impossible to open the archive",
"Impossible de modifier votre propre groupe.": "Unable to modify your own group.", "Impossible de modifier votre propre rôle.": "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 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 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", "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.", "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",
"Presse papier": "Clipboard", "Presse papier": "Clipboard",
"Profils des groupes": "Group Profiles", "Profils des rôles": "Group Profiles",
"Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.", "Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.",
"Prénom": "First name", "Prénom": "First name",
"Prénom Nom": "First name Name", "Prénom Nom": "First name Name",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Test message sent successfully", "Message de test envoyé avec succès": "Test message sent successfully",
"Message non envoyé": "Message not sent", "Message non envoyé": "Message not sent",
"Validation par clé ⚠️": "Key-based validation ⚠️", "Validation par clé ⚠️": "Key-based validation ⚠️",
"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.", "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.",
"Envoi du message d'authentification": "Sending authentication message", "Envoi du message d'authentification": "Sending authentication message",
"Connexion réussie": "Login successful", "Connexion réussie": "Login successful",
"Erreur de mot de passe": "Password error", "Erreur de mot de passe": "Password error",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)", "Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)", "Grande (300px)": "Grande (300px)",
"Gras": "Negrita", "Gras": "Negrita",
"Groupe": "Grupo", "Rôle": "Grupo",
"Groupe associé": "Grupo asociado", "Rôle associé": "Grupo asociado",
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:", "Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Groupes": "Grupos", "Groupes": "Grupos",
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt", "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", "Générer une capture Open Graph": "Generar una captura de Open Graph",
@ -295,7 +295,7 @@
"Importer dans": "Importar a", "Importer dans": "Importar a",
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva", "Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo", "Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
"Impossible de modifier votre propre groupe.": "No puede editar su propio grupo.", "Impossible de modifier votre propre rôle.": "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 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 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", "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.", "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",
"Presse papier": "Portapapeles", "Presse papier": "Portapapeles",
"Profils des groupes": "Perfiles de grupos", "Profils des rôles": "Perfiles de grupos",
"Proportionnelle à la taille définie dans le site.": "Proporcional a la definida en el sitio.", "Proportionnelle à la taille définie dans le site.": "Proporcional a la definida en el sitio.",
"Prénom": "Nombre de pila", "Prénom": "Nombre de pila",
"Prénom Nom": "Nombre Apellido", "Prénom Nom": "Nombre Apellido",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito", "Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
"Message non envoyé": "Mensaje no enviado", "Message non envoyé": "Mensaje no enviado",
"Validation par clé ⚠️": "Validación por clave ⚠️", "Validation par clé ⚠️": "Validación por clave ⚠️",
"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.", "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.",
"Envoi du message d'authentification": "Envío del mensaje de autenticación", "Envoi du message d'authentification": "Envío del mensaje de autenticación",
"Connexion réussie": "Conexión exitosa", "Connexion réussie": "Conexión exitosa",
"Erreur de mot de passe": "Error de contraseña", "Erreur de mot de passe": "Error de contraseña",

View File

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

View File

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

View File

@ -20,3 +20,7 @@
.title { .title {
font-weight: bold; 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/'; const ZWII_UI_URL = 'https://forge.chapril.org/ZwiiCMS-Team/zwiicms-translations/raw/branch/master/v13/';
public static $actions = [ public static $actions = [
'index' => self::GROUP_ADMIN, 'index' => self::ROLE_ADMIN,
'copy' => self::GROUP_ADMIN, 'copy' => self::ROLE_ADMIN,
'add' => self::GROUP_ADMIN, 'add' => self::ROLE_ADMIN,
// Ajouter une langue de contenu // Ajouter une langue de contenu
'edit' => self::GROUP_ADMIN, 'edit' => self::ROLE_ADMIN,
// Éditer une langue de l'UI // Éditer une langue de l'UI
'locale' => self::GROUP_ADMIN, 'locale' => self::ROLE_ADMIN,
// Éditer une langue de contenu // Éditer une langue de contenu
'delete' => self::GROUP_ADMIN, 'delete' => self::ROLE_ADMIN,
// Effacer une langue de contenu ou de l'interface // Effacer une langue de contenu ou de l'interface
'content' => self::GROUP_VISITOR, 'content' => self::ROLE_VISITOR,
'update' => self::GROUP_ADMIN, 'update' => self::ROLE_ADMIN,
'default' => self::GROUP_ADMIN 'default' => self::ROLE_ADMIN
]; ];
const PAGINATION = '20'; const PAGINATION = '20';

View File

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

View File

@ -18,13 +18,12 @@ class page extends common
{ {
public static $actions = [ public static $actions = [
'add' => self::GROUP_EDITOR, 'add' => self::ROLE_EDITOR,
'delete' => self::GROUP_EDITOR, 'delete' => self::ROLE_EDITOR,
'edit' => self::GROUP_EDITOR, 'edit' => self::ROLE_EDITOR,
'duplicate' => self::GROUP_EDITOR, 'duplicate' => self::ROLE_EDITOR,
'jsEditor' => self::GROUP_EDITOR, 'jsEditor' => self::ROLE_EDITOR,
'cssEditor' => self::GROUP_EDITOR, 'cssEditor' => self::ROLE_EDITOR,
'register' => self::GROUP_EDITOR,
]; ];
public static $pagesNoParentId = [ public static $pagesNoParentId = [
'' => 'Aucune' '' => 'Aucune'
@ -181,7 +180,7 @@ class page extends common
'parentPageId' => '', 'parentPageId' => '',
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::ROLE_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => $pageTitle, 'title' => $pageTitle,
'shortTitle' => $pageTitle, 'shortTitle' => $pageTitle,
@ -474,7 +473,7 @@ class page extends common
$this->setData(['config', 'page302', $pageId], false); $this->setData(['config', 'page302', $pageId], false);
} }
// Sauvegarde la base manuellement // Sauvegarde la base manuellement
$this->saveDB(module: 'config'); $this->saveDB('config');
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents // Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
$lastPosition = 1; $lastPosition = 1;
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy()); $hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
@ -543,17 +542,17 @@ class page extends common
} }
} }
} }
// Détermine le groupe selon que la page est une barre ou une page standard // Détermine le rôle selon que la page est une barre ou une page standard
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0; $role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0 //Détermine le profil d'utilisateur en fonction du rôle sinon le rôle vaut 0
$profil = 0; $profil = 0;
if ( if (
$this->getinput('pageEditBlock') !== 'bar' || $this->getinput('pageEditBlock') !== 'bar' ||
$group === 1 || $role === 1 ||
$group === 2 $role === 2
) { ) {
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT); $profil = $this->getInput('pageEditProfil' . $role, helper::FILTER_INT);
} }
// Modifie la page ou en crée une nouvelle si l'id a changé // Modifie la page ou en crée une nouvelle si l'id a changé
@ -573,7 +572,7 @@ class page extends common
'modulePosition' => $this->getInput('pageModulePosition'), 'modulePosition' => $this->getInput('pageModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'), 'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position, 'position' => $position,
'group' => $group, 'role' => $role,
'profil' => $profil, 'profil' => $profil,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN), 'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT), 'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
@ -594,6 +593,19 @@ 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 // Creation du contenu de la page
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) { if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755); mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
@ -654,11 +666,11 @@ class page extends common
// Profils installés // Profils installés
// Profils disponibles // Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) { foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) { if ($profilId < self::ROLE_MEMBER) {
continue; continue;
} }
if ($profilId === self::GROUP_ADMIN) { if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name']; self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
continue; continue;
} }
foreach ($profilData as $key => $value) { foreach ($profilData as $key => $value) {
@ -760,25 +772,4 @@ class page extends common
return json_encode($d); 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,10 +283,18 @@ $( document ).ready(function() {
// Gestion des évènements // 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 * Sélection de la page de configuration à afficher
*/ */
$("#pageEditContentButton").on("click", function () { $("#pageEditContentButton").on("click", function () {
pageLayout = "content";
$("#pageEditContentContainer").show(); $("#pageEditContentContainer").show();
$("#pageEditExtensionContainer").hide(); $("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide(); $("#pageEditPositionContainer").hide();
@ -294,23 +302,12 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide(); $("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").addClass("activeButton"); $("#pageEditContentButton").addClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton"); $("#pageEditExtensionButton").removeClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton"); $("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton"); $("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton"); $("#pageEditPermissionButton").removeClass("activeButton");
}); });
$("#pageEditExtensionButton").on("click", function () { $("#pageEditPositionButton").on("click", function () {
$("#pageEditContentContainer").hide(); pageLayout = "position";
$("#pageEditExtensionContainer").show();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").addClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#PageEditPositionButton").on("click", function () {
$("#pageEditContentContainer").hide(); $("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide(); $("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").show(); $("#pageEditPositionContainer").show();
@ -318,11 +315,25 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide(); $("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton"); $("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton"); $("#pageEditExtensionButton").removeClass("activeButton");
$("#PageEditPositionButton").addClass("activeButton"); $("#pageEditPositionButton").addClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditExtensionButton").on("click", function () {
pageLayout = "extension";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").show();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").addClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton"); $("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton"); $("#pageEditPermissionButton").removeClass("activeButton");
}); });
$("#pageEditLayoutButton").on("click", function () { $("#pageEditLayoutButton").on("click", function () {
pageLayout = "layout";
$("#pageEditContentContainer").hide(); $("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide(); $("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide(); $("#pageEditPositionContainer").hide();
@ -330,11 +341,12 @@ $( document ).ready(function() {
$("#pageEditPermissionContainer").hide(); $("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton"); $("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton"); $("#pageEditExtensionButton").removeClass("activeButton");
$("#PageEditPositionButton").removeClass("activeButton"); $("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").addClass("activeButton"); $("#pageEditLayoutButton").addClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton"); $("#pageEditPermissionButton").removeClass("activeButton");
}); });
$("#pageEditPermissionButton").on("click", function () { $("#pageEditPermissionButton").on("click", function () {
pageLayout = "permission";
$("#pageEditContentContainer").hide(); $("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide(); $("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide(); $("#pageEditPositionContainer").hide();

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@
<?php if (user::$users): ?> <?php if (user::$users): ?>
<div class="row"> <div class="row">
<div class="col12 textAlignCenter"> <div class="col12 textAlignCenter">
<?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::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::ico('check'); ?> Compte créé | <?php echo template::ico('check'); ?> Compte créé |
<?php echo template::ico('mail'); ?> Compte créé et notifié | <?php echo template::ico('mail'); ?> Compte créé et notifié |
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe. <?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.

View File

@ -16,3 +16,13 @@
/** NE PAS EFFACER /** NE PAS EFFACER
* admin.css * 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,6 +31,22 @@ $(document).ready((function () {
stateSave: true, stateSave: true,
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]], "lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
"columnDefs": [ "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, target: 5,
orderable: false, orderable: false,
@ -43,4 +59,15 @@ $(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"> <div class="col1">
<?php echo template::button('userAdd', [ <?php echo template::button('userAdd', [
'href' => helper::baseUrl() . 'user/add', 'href' => helper::baseUrl() . 'user/add',
'value' => template::ico('plus'), 'value' => template::ico('user-plus'),
'class' => 'buttonGreen', 'class' => 'buttonGreen',
'help' => 'Ajouter un utilisateur' 'help' => 'Ajouter un utilisateur'
]); ?> ]); ?>
@ -68,4 +68,4 @@
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<?php echo template::table([3, 2, 2, 2, 2, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Date dernière vue', '', ''], ['id' => 'dataTables']); ?> <?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']); ?>

View File

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

View File

@ -40,8 +40,8 @@
</div> </div>
<div class="col12"> <div class="col12">
<?php echo template::text('profilEditDisplayGroup', [ <?php echo template::text('profilEditDisplayGroup', [
'label' => 'Groupe associé', 'label' => 'Rôle associé',
'value' => helper::translate(self::$groups[$this->getUrl(2)]), 'value' => helper::translate(self::$roles[$this->getUrl(2)]),
'disabled' => true 'disabled' => true
]); ?> ]); ?>
<?php echo template::hidden('profilEditGroup', [ <?php echo template::hidden('profilEditGroup', [
@ -239,7 +239,7 @@
</div> </div>
</div> </div>
</div> </div>
<?php if ($this->getUrl(2) >= self::GROUP_EDITOR): ?> <?php if ($this->getUrl(2) >= self::ROLE_EDITOR): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <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'; $lang = isset($_GET['lang']) ? $_GET['lang'] : 'fr_FR';
setlocale(LC_CTYPE, $lang); setlocale(LC_CTYPE, $lang);
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */ /* Lecture du rôle de l'utilisateur connecté pour attribuer les droits et les dossiers */
$userId = $_COOKIE['ZWII_USER_ID']; $userId = $_COOKIE['ZWII_USER_ID'];
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : ''; $courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
$u = json_decode(file_get_contents('../../../site/data/user.json'), true); $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 // Lecture les droits
if (!is_null($u) && !is_null($g) && !is_null($userId)) { if (!is_null($u) && !is_null($g) && !is_null($userId)) {
$group = $u['user'][$userId]['group']; $role = $u['user'][$userId]['role'];
switch ($group) { switch ($role) {
case 3: case 3:
// Accès admin // Accès admin
$file['delete'] = true; $file['delete'] = true;
@ -52,12 +52,12 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
case 1: case 1:
// Accès contrôlés par le profil // Accès contrôlés par le profil
$profil = $u['user'][$userId]['profil']; $profil = $u['user'][$userId]['profil'];
$file = $g['profil'][$group][$profil]['file']; $file = $g['profil'][$role][$profil]['file'];
$folder = $g['profil'][$group][$profil]['folder']; $folder = $g['profil'][$role][$profil]['folder'];
// membre sans profil déclaré ou accès interdit, pas d'accès // membre sans profil déclaré ou accès interdit, pas d'accès
if ( if (
is_null($profil) is_null($profil)
|| $g['profil'][$group][$profil]['filemanager'] === false || $g['profil'][$role][$profil]['filemanager'] === false
) { ) {
exit("<h1 style='color: red'>Accès interdit au gestionnaire de fichiers !</h1>"); 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 groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */ /* Fin lecture du rôle 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: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} .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}

View File

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

File diff suppressed because one or more lines are too long

View File

@ -76,6 +76,9 @@
.zwiico-twitch { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1e8;&nbsp;'); } .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-brush { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1fc;&nbsp;'); }
.zwiico-pinterest { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf231;&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-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-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;'); } .zwiico-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x1f393;&nbsp;'); }

View File

@ -87,6 +87,9 @@
.zwiico-twitch { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1e8;&nbsp;'); } .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-brush { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf1fc;&nbsp;'); }
.zwiico-pinterest { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf231;&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-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-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;'); } .zwiico-logout { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#x1f393;&nbsp;'); }

View File

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

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?> <?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"> <!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"> <svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2024 by original authors @ fontello.com</metadata> <metadata>Copyright (C) 2025 by original authors @ fontello.com</metadata>
<defs> <defs>
<font id="zwiico" horiz-adv-x="1000" > <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" /> <font-face font-family="zwiico" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
@ -160,10 +160,16 @@
<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="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="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="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" /> <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> </font>
</defs> </defs>

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

BIN
core/vendor/zwiico/png/error.png vendored Normal file

Binary file not shown.

After

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,23 @@
# 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

1358
module/download/download.php Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,27 @@
{
"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

@ -0,0 +1,22 @@
<?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

@ -0,0 +1,25 @@
<?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

@ -0,0 +1,52 @@
<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

@ -0,0 +1,76 @@
<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.

After

Width:  |  Height:  |  Size: 652 B

View File

@ -0,0 +1,18 @@
/**
* 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

@ -0,0 +1,54 @@
/**
* 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

@ -0,0 +1,193 @@
<?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

@ -0,0 +1,18 @@
/**
* 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

@ -0,0 +1,23 @@
/**
* 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

@ -0,0 +1,40 @@
<?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

@ -0,0 +1,18 @@
/**
* 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

@ -0,0 +1,30 @@
<?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

@ -0,0 +1,18 @@
/**
* 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