Compare commits

...

29 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
143 changed files with 5072 additions and 709 deletions

View File

@ -1,4 +1,4 @@
# ZwiiCampus 1.20.03
# 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é.

View File

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

View File

@ -446,7 +446,7 @@ class core extends common
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0
// Le userId n'est pas celui d'un admis ni le compte d'un gestionnaire de cet espace
&& (
$this->getUser('group') < common::GROUP_ADMIN
$this->getUser('role') < common::ROLE_ADMIN
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author'])
)
) {
@ -473,7 +473,7 @@ class core extends common
// Force la déconnexion des membres bannis ou d'une seconde session
if (
$this->isConnected() === true
and ($this->getUser('group') === common::GROUP_BANNED
and ($this->getUser('role') === common::ROLE_BANNED
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
)
@ -488,7 +488,7 @@ class core extends common
and $this->getUrl(1) !== 'login'
and ($this->isConnected() === false
or ($this->isConnected() === true
and $this->getUser('group') < common::GROUP_ADMIN
and $this->getUser('role') < common::ROLE_ADMIN
)
)
) {
@ -505,11 +505,11 @@ class core extends common
$access = null;
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
if (
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
$this->getData(['page', $this->getUrl(0), 'role']) === common::ROLE_VISITOR
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
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;
@ -526,7 +526,7 @@ class core extends common
and $this->isConnected() === false
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
and $this->isConnected() === true
and $this->getUser('group') < common::GROUP_EDITOR
and $this->getUser('role') < common::ROLE_EDITOR
)
) {
$access = false;
@ -705,11 +705,11 @@ class core extends common
if (array_key_exists($action, $module::$actions)) {
$module->$action();
$output = $module->output;
// Check le groupe de l'utilisateur
// Check le rôle de l'utilisateur
if (
($module::$actions[$action] === common::GROUP_VISITOR
($module::$actions[$action] === common::ROLE_VISITOR
or ($this->isConnected() === true
and $this->getUser('group') >= $module::$actions[$action]
and $this->getUser('role') >= $module::$actions[$action]
and $this->getUser('permission', $moduleId, $action)
)
)

View File

@ -24,13 +24,13 @@ class common
const DISPLAY_LAYOUT_BLANK = 3;
const DISPLAY_LAYOUT_MAIN = 4;
const DISPLAY_LAYOUT_LIGHT = 5;
const GROUP_BANNED = -1;
const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1;
const GROUP_EDITOR = 2;
const ROLE_BANNED = -1;
const ROLE_VISITOR = 0;
const ROLE_MEMBER = 1;
const ROLE_EDITOR = 2;
// Groupe MODERATOR, compatibilité avec les anciens modules :
const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3;
const ROLE_MODERATOR = 2;
const ROLE_ADMIN = 3;
const SIGNATURE_ID = 1;
const SIGNATURE_PSEUDO = 2;
const SIGNATURE_FIRSTLASTNAME = 3;
@ -51,7 +51,7 @@ class common
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_VERSION = '1.20.03';
const ZWII_VERSION = '1.21.01';
// URL autoupdate
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
@ -147,29 +147,29 @@ class common
],
'view' => ''
];
public static $groups = [
self::GROUP_BANNED => 'Banni',
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
public static $roles = [
self::ROLE_BANNED => 'Banni',
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $groupEdits = [
self::GROUP_BANNED => 'Banni',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
public static $roleEdits = [
self::ROLE_BANNED => 'Banni',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $groupNews = [
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
public static $roleNews = [
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $groupPublics = [
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
public static $rolePublics = [
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
//Langues de l'UI
@ -821,11 +821,11 @@ class common
// Page parent
$this->getData(['page', $pageId, 'parentPageId']) === ""
// Ignore les pages dont l'utilisateur n'a pas accès
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
and ($this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
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
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
and (
(
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
$this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
and
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
$this->getData(['page', $parentId, 'role']) === self::ROLE_VISITOR
)
or (
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
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é
* @param int $key Clé de la valeur du groupe
* @param int $key Clé de la valeur du rôle
* @return string|null
*/
public function getPermission($key1, $key2 = null)
{
// Administrateur, toutes les permissions
if ($this->getUser('group') === self::GROUP_ADMIN) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
return true;
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
} elseif ($this->getUser('role') <= self::ROLE_VISITOR) { // Groupe sans autorisation
return false;
} elseif (
// Groupe avec profil, consultation des autorisations sur deux clés
$key1
&& $key2
&& $this->user
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
&& array_key_exists($key2, $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['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é
} elseif (
$key1
&& $this->user
&& $this->getData(['profil', $this->user['group'], $this->user['profil']])
&& array_key_exists($key1, $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['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 {
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
if (class_exists($key1)) {
$module = new $key1;
if (array_key_exists($key2, $module::$actions)) {
return $this->getUser('group') >= $module::$actions[$key2];
return $this->getUser('role') >= $module::$actions[$key2];
}
}
return false;
@ -1169,7 +1169,7 @@ class common
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques et les pages masquées
if (
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
$this->getData(['page', $parentPageId, 'role']) !== 0 ||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
) {
continue;
@ -1197,7 +1197,7 @@ class common
}
// Sous-pages
foreach ($childrenPageIds as $childKey) {
if ($this->getData(['page', $childKey, 'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
if ($this->getData(['page', $childKey, 'role']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
continue;
}
// Cas de la page d'accueil ne pas dupliquer l'URL
@ -1624,11 +1624,11 @@ function makeThumb($src, $dest, $desired_width)
$courses = $this->getData([('course')]);
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
$filter = array();
switch ($this->getUser('group')) {
case self::GROUP_ADMIN:
switch ($this->getUser('role')) {
case self::ROLE_ADMIN:
// Affiche tout
return $courses;
case self::GROUP_EDITOR:
case self::ROLE_EDITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces gérés par l'éditeur, les espaces où il participe et les espaces anonymes
if (
@ -1643,7 +1643,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::GROUP_MEMBER:
case self::ROLE_MEMBER:
foreach ($courses as $courseId => $value) {
// Affiche les espaces du participant et les espaces anonymes
if (
@ -1654,7 +1654,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::GROUP_VISITOR:
case self::ROLE_VISITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces anonymes
if ($this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST) {

View File

@ -4,24 +4,25 @@
* Mises à jour suivant les versions de ZwiiCampus
*/
// Version 1.7.00
if (
$this->getData(['core', 'dataVersion']) < 1700
) {
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
foreach (['1', '2'] as $group) {
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
foreach (['1', '2'] as $role) {
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
}
}
}
$this->setData(['core', 'dataVersion', 1700]);
}
// Version 1.8.00
if (
$this->getData(['core', 'dataVersion']) < 1800
) {
@ -46,6 +47,7 @@ if (
$this->setData(['core', 'dataVersion', 1800]);
}
// Version 1.20.02
if (
$this->getData(['core', 'dataVersion']) < 12002
) {
@ -56,9 +58,12 @@ if (
// Tableau à insérer
$a = [
'theme' =>
['menu' => [
[
'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);
@ -74,3 +79,57 @@ if (
}
$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

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

View File

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

View File

@ -38,10 +38,10 @@
]); ?>
</div>
<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é ⚠️',
'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 class="col3 verticalAlignBottom">

View File

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

View File

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

View File

@ -31,10 +31,19 @@ $(document).ready((function () {
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
"columnDefs": [
{
targets: 3,
type: 'numeric',
render: function (data) {
return moment(data * 1000).format('DD/MM/YYYY HH:mm');
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();
}
},
{

View File

@ -17,7 +17,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'userDeleteAll buttonRed',
'href' => helper::baseUrl() . 'course/usersDelete/' . $this->getUrl(2),
'value' => template::ico('users'),
'value' => template::ico('user-times'),
'help' => 'Désinscrire en masse',
])?>
</div>
@ -25,7 +25,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'buttonGreen',
'href' => helper::baseUrl() . 'course/usersAdd/' . $this->getUrl(2),
'value' => template::ico('users'),
'value' => template::ico('user-plus'),
'help' => 'Inscription en masse',
]) ?>
</div>

View File

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

View File

@ -645,7 +645,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Accueil',
@ -676,7 +676,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 6,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Contact',
@ -707,7 +707,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Mentions légales',
@ -739,7 +739,7 @@ class init extends common
'modulePosition' => '',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Maintenance en cours',
@ -771,7 +771,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Erreur 403',
@ -802,7 +802,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Erreur 404',
@ -938,7 +938,7 @@ class init extends common
'config' => [
'button' => '',
'captcha' => true,
'group' => self::GROUP_ADMIN,
'role' => self::ROLE_ADMIN,
'pageId' => '',
'subject' => ''
],
@ -1065,7 +1065,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Sommaire',
@ -1096,7 +1096,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Première page',
@ -1127,7 +1127,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Seconde page',
@ -1158,7 +1158,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'profil' => 0,
'targetBlank' => false,
'title' => 'Troisième page',
@ -1189,7 +1189,7 @@ class init extends common
'modulePosition' => 'bottom',
'parentPageId' => '',
'position' => 0,
'group' => 0,
'role' => 0,
'profil' => 0,
'targetBlank' => false,
'title' => 'Menu',

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)",
"Gras": "Bold",
"Groupe": "Group",
"Groupe associé": "Associated Group",
"Groupe requis pour accéder à la page :": "Group required to access the page:",
"Rôle": "role",
"Rôle associé": "Associated role",
"Rôle requis pour accéder à la page :": "role required to access the page:",
"Groupes": "Groups",
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
"Générer une capture Open Graph": "Generate an Open Graph capture",
@ -295,7 +295,7 @@
"Importer dans": "Import into",
"Importer des utilisateurs en masse": "Import mass users",
"Impossible d'ouvrir l'archive": "Impossible to open the archive",
"Impossible de modifier votre propre 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 supprimer une page contenant des pages enfants": "Unable to delete a page containing children's pages",
"Impossible de supprimer votre propre compte": "Unable to delete your own account",
@ -489,7 +489,7 @@
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "To define the page as a sidebar, choose the option from the list.",
"Presse Papier": "Clipboard",
"Presse papier": "Clipboard",
"Profils des 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.",
"Prénom": "First name",
"Prénom Nom": "First name Name",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Test message sent successfully",
"Message non envoyé": "Message not sent",
"Validation par clé ⚠️": "Key-based validation ⚠️",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le 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",
"Connexion réussie": "Login successful",
"Erreur de mot de passe": "Password error",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)",
"Gras": "Negrita",
"Groupe": "Grupo",
"Groupe associé": "Grupo asociado",
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Rôle": "Grupo",
"Rôle associé": "Grupo asociado",
"Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Groupes": "Grupos",
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
"Générer une capture Open Graph": "Generar una captura de Open Graph",
@ -295,7 +295,7 @@
"Importer dans": "Importar a",
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
"Impossible de modifier votre propre 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 supprimer une page contenant des pages enfants": "No se puede eliminar una página que contiene páginas secundarias",
"Impossible de supprimer votre propre compte": "No puede eliminar su propia cuenta",
@ -489,7 +489,7 @@
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "Para configurar la página como barra lateral, elija la opción de la lista.",
"Presse Papier": "Portapapeles",
"Presse papier": "Portapapeles",
"Profils des 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.",
"Prénom": "Nombre de pila",
"Prénom Nom": "Nombre Apellido",
@ -695,7 +695,7 @@
"Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
"Message non envoyé": "Mensaje no enviado",
"Validation par clé ⚠️": "Validación por clave ⚠️",
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le 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",
"Connexion réussie": "Conexión exitosa",
"Erreur de mot de passe": "Error de contraseña",

View File

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

View File

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

View File

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

View File

@ -18,12 +18,12 @@ class page extends common
{
public static $actions = [
'add' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_EDITOR,
'jsEditor' => self::GROUP_EDITOR,
'cssEditor' => self::GROUP_EDITOR,
'add' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'duplicate' => self::ROLE_EDITOR,
'jsEditor' => self::ROLE_EDITOR,
'cssEditor' => self::ROLE_EDITOR,
];
public static $pagesNoParentId = [
'' => 'Aucune'
@ -180,7 +180,7 @@ class page extends common
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 0,
'group' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'targetBlank' => false,
'title' => $pageTitle,
'shortTitle' => $pageTitle,
@ -542,17 +542,17 @@ class page extends common
}
}
}
// Détermine le groupe selon que la page est une barre ou une page standard
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
// Détermine le rôle selon que la page est une barre ou une page standard
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
//Détermine le 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;
if (
$this->getinput('pageEditBlock') !== 'bar' ||
$group === 1 ||
$group === 2
$role === 1 ||
$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é
@ -572,7 +572,7 @@ class page extends common
'modulePosition' => $this->getInput('pageModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position,
'group' => $group,
'role' => $role,
'profil' => $profil,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
@ -666,11 +666,11 @@ class page extends common
// Profils installés
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) {
if ($profilId < self::ROLE_MEMBER) {
continue;
}
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
continue;
}
foreach ($profilData as $key => $value) {

View File

@ -294,7 +294,7 @@ $( document ).ready(function() {
* Sélection de la page de configuration à afficher
*/
$("#pageEditContentButton").on("click", function () {
pageLayout = "locale";
pageLayout = "content";
$("#pageEditContentContainer").show();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();

View File

@ -358,24 +358,24 @@
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', self::$groupPublics, [
'label' => 'Groupe minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
<?php echo template::select('pageEditGroup', self::$rolePublics, [
'label' => 'Rôle minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
'help' => 'Les rôles de niveau supérieur accèdent à la page.'
]); ?>
</div>
<div class="col6">
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, page::$userProfils[self::GROUP_MEMBER], [
id="pageEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_MEMBER, page::$userProfils[self::ROLE_MEMBER], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',
]); ?>
</div>
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, page::$userProfils[self::GROUP_EDITOR], [
id="pageEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_EDITOR, page::$userProfils[self::ROLE_EDITOR], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',

View File

@ -21,15 +21,15 @@ class plugin extends common
{
public static $actions = [
'index' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN,
'store' => self::GROUP_ADMIN,
//'item' => self::GROUP_ADMIN,
'index' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'save' => self::ROLE_ADMIN,
'store' => self::ROLE_ADMIN,
//'item' => self::ROLE_ADMIN,
// détail d'un objet
'upload' => self::GROUP_ADMIN,
'upload' => self::ROLE_ADMIN,
// 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

View File

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

View File

@ -18,23 +18,23 @@ class theme extends common
{
public static $actions = [
'advanced' => self::GROUP_ADMIN,
'body' => self::GROUP_ADMIN,
'footer' => self::GROUP_ADMIN,
'header' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'menu' => self::GROUP_ADMIN,
'reset' => self::GROUP_ADMIN,
'site' => self::GROUP_ADMIN,
'admin' => self::GROUP_ADMIN,
'manage' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN,
'font' => self::GROUP_ADMIN,
'fontAdd' => self::GROUP_ADMIN,
'fontEdit' => self::GROUP_ADMIN,
'fontDelete' => self::GROUP_ADMIN
'advanced' => self::ROLE_ADMIN,
'body' => self::ROLE_ADMIN,
'footer' => self::ROLE_ADMIN,
'header' => self::ROLE_ADMIN,
'index' => self::ROLE_ADMIN,
'menu' => self::ROLE_ADMIN,
'reset' => self::ROLE_ADMIN,
'site' => self::ROLE_ADMIN,
'admin' => self::ROLE_ADMIN,
'manage' => self::ROLE_ADMIN,
'export' => self::ROLE_ADMIN,
'import' => self::ROLE_ADMIN,
'save' => self::ROLE_ADMIN,
'font' => self::ROLE_ADMIN,
'fontAdd' => self::ROLE_ADMIN,
'fontEdit' => self::ROLE_ADMIN,
'fontDelete' => self::ROLE_ADMIN
];
public static $aligns = [
'left' => 'À gauche',

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"
am2;Membre2;Albert;albert.membre2@email.fr;1;1;alBertAG;"adhérent"
jrediteur;Editeur;Robert;robert.editeur@email.fr;2;1;roBert54;"trésorier"

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

View File

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

View File

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

View File

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

View File

@ -33,17 +33,19 @@ $(document).ready((function () {
"columnDefs": [
{
target: 4,
type: 'num', // Utilisez 'num' pour le tri
render: function (data) {
// Si data est un nombre, formatez-le en date
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; // Sinon, affichez le texte tel quel
return data;
}
}
// Pour le tri, retournez la valeur au format ISO
return moment(Number(data) * 1000).toISOString();
}
},
orderable: false,
searchable: false
},
{
target: 5,

View File

@ -40,7 +40,7 @@
<div class="col1">
<?php echo template::button('userAdd', [
'href' => helper::baseUrl() . 'user/add',
'value' => template::ico('plus'),
'value' => template::ico('user-plus'),
'class' => 'buttonGreen',
'help' => 'Ajouter un utilisateur'
]); ?>
@ -68,4 +68,4 @@
</div>
</div>
<?php echo template::formClose(); ?>
<?php echo template::table([3, 2, 2, 1, 3, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','group','profile','tag','data-timestamp','edit','delete']); ?>
<?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 class="col12">
<?php echo template::select('profilAddGroup', user::$groupProfils, [
'label' => 'Groupe associé',
<?php echo template::select('profilAddGroup', user::$roleProfils, [
'label' => 'Rôle associé',
'selected' => $this->getUrl(2)
]); ?>
</div>

View File

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

View File

@ -17,7 +17,7 @@ date_default_timezone_set('Europe/Paris');
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'fr_FR';
setlocale(LC_CTYPE, $lang);
/* Lecture du 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'];
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
$u = json_decode(file_get_contents('../../../site/data/user.json'), true);
@ -25,8 +25,8 @@ $g = json_decode(file_get_contents('../../../site/data/profil.json'), true);
// Lecture les droits
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
$group = $u['user'][$userId]['group'];
switch ($group) {
$role = $u['user'][$userId]['role'];
switch ($role) {
case 3:
// Accès admin
$file['delete'] = true;
@ -52,12 +52,12 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
case 1:
// Accès contrôlés par le profil
$profil = $u['user'][$userId]['profil'];
$file = $g['profil'][$group][$profil]['file'];
$folder = $g['profil'][$group][$profil]['folder'];
$file = $g['profil'][$role][$profil]['file'];
$folder = $g['profil'][$role][$profil]['folder'];
// membre sans profil déclaré ou accès interdit, pas d'accès
if (
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>");
}
@ -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-brush:before { content: '\f1fc'; } /* '' */
.zwiico-pinterest:before { content: '\f231'; } /* '' */
.zwiico-user-plus:before { content: '\f234'; } /* '' */
.zwiico-user-times:before { content: '\f235'; } /* '' */
.zwiico-reddit:before { content: '\f281'; } /* '' */
.zwiico-shopping-basket:before { content: '\f291'; } /* '' */
.zwiico-address-book:before { content: '\f2b9'; } /* '' */
.zwiico-logout:before { content: '🎓'; } /* '\1f393' */

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

Before

Width:  |  Height:  |  Size: 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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,7 +82,7 @@
<?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
@ -98,7 +98,7 @@
<?php echo template::select('blogAddConsent', blog::$articleConsent , [
'label' => 'Édition - Suppression',
'selected' => blog::EDIT_ALL,
'help' => 'Les utilisateurs des 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>
@ -128,7 +128,7 @@
<?php echo template::checkbox('blogAddCommentNotification', true, 'Notification par email'); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('blogAddCommentGroupNotification', blog::$groupNews); ?>
<?php echo template::select('blogAddCommentGroupNotification', blog::$roleNews); ?>
</div>
</div>
</div>

View File

@ -52,18 +52,18 @@
( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN)
or $this->getUser('role') === self::ROLE_ADMIN)
)
or (
// Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_EDITOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
// Rôle
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_EDITOR)
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
)
or (
// Tout le monde
$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, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
@ -103,8 +103,8 @@
<div class="col4">
<?php echo template::select('blogEditConsent', blog::$articleConsent, [
'label' => 'Édition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? blog::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? blog::EDIT_ROLE : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des rôles supérieurs accèdent à l\'article sans restriction'
]); ?>
</div>
</div>
@ -143,7 +143,7 @@
]); ?>
</div>
<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']),
]); ?>
</div>

View File

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

View File

@ -0,0 +1,62 @@
/**
* 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/
*/
/**
* Confirmation de suppression
*/
$(".downloadCommentDelete").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Supprimer le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation d'approbation
*/
$(".downloadCommentApproved").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Approuver le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation de rejet
*/
$(".downloadCommentRejected").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Rejeter le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation de suppression en masse
*/
$(".downloadCommentDeleteAll").on("click", function() {
var _this = $(this);
var nombre = "<?php echo count($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment' ])); ?>";
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
if( nombre === "1"){
var message = "Supprimer le commentaire de l'item " + nom + " ?";
} else{
var message = "Supprimer les " + nombre + " commentaires de l'item " + nom + " ?";
}
return core.confirm(message, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -0,0 +1,21 @@
<div class="row">
<div class="col1">
<?php echo template::button('downloadCommentBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left'),
]); ?>
</div>
<?php if($module::$comments): ?>
<div class="col2 offset9">
<?php echo $module::$commentsDelete; ?>
</div>
</div>
<?php echo template::table([3, 5, 2, 1, 1], $module::$comments, ['Date', 'Contenu', 'Auteur', '', '']); ?>
<?php echo $module::$pages.'<br/>'; ?>
<?php else: ?>
</div>
<?php echo template::speech('Aucun commentaire.'); ?>
<?php endif; ?>

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,21 @@
/**
* 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/
*/
/**
* Confirmation de suppression
*/
$(".downloadConfigDelete").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir supprimer cet item ?", function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -0,0 +1,40 @@
<div class="row">
<div class="col1">
<?php echo template::button('downloadConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'value' => template::ico('left')
]); ?>
</div>
<div class="col1 offset8">
<?php echo template::button('downloadConfigSetup', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'value' => template::ico('sliders'),
'help' => 'Options'
]); ?>
</div>
<div class="col1">
<?php echo template::button('downloadConfigCategories', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/categories',
'value' => template::ico('table'),
'help' => 'Catégories'
]); ?>
</div>
<div class="col1">
<?php echo template::button('downloadConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'class' => 'buttonGreen',
'value' => template::ico('plus'),
'help' => 'Ajouter une ressource'
]); ?>
</div>
</div>
<?php if ($module::$items): ?>
<?php echo template::table([2, 2, 1, 2, 1, 1, 1, 1, 1], $module::$items, ['Titre', 'Catégorie ' . $module::$allCategories, 'Version', 'Du', 'Stats', 'État', 'Comm', '', '']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucune ressource'); ?>
<?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,77 @@
/**
* 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/
*/
// Lien de connexion
$("#downloadEditMailNotification").on("change", function() {
if($(this).is(":checked")) {
$("#formConfigGroup").show();
}
else {
$("#formConfigGroup").hide();
}
}).trigger("change");
/**
* Soumission du formulaire pour enregistrer en brouillon
*/
$("#downloadEditDraft").on("click", function() {
$("#downloadEditState").val(0);
$("#downloadEditForm").trigger("submit");
});
/**
* Options de commentaires
*/
$("#downloadEditCommentClose").on("change", function() {
if ($(this).is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
});
$("#downloadEditCommentNotification").on("change", function() {
if ($(this).is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown();
} else {
$("#downloadEditCommentGroupNotification").slideUp();
}
});
$( document).ready(function() {
/** Gestion des commentaires */
if ($("#downloadEditCloseComment").is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
if ($("#downloadEditCommentNotification").is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown();
} else {
$("#downloadEditCommentGroupNotification").slideUp();
}
/**
* Paramétrage du sélecteur de date
* Supprimer les heures
const datepickr = flatpickr("#downloadEditversionDate", {});
datepickr.set (enableTime, false);
*/
});

View File

@ -0,0 +1,210 @@
<?php echo template::formOpen('downloadEditForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('downloadEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="col3 offset6">
<?php echo template::button('downloadEditDraft', [
'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon'
]); ?>
<?php echo template::hidden('downloadEditState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('downloadEditSubmit', [
'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('downloadEditTitle', [
'label' => 'Titre',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title'])
]); ?>
</div>>
<div class="col3">
<?php echo template::text('downloadEditId', [
'label' => 'Id Interne',
'value' => empty($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id']))
? $this->getUrl(2)
: $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id']),
]); ?>
<?php echo template::hidden('downloadEditIdOld', [
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id'])
]);
?>
</div>>
<div class="col3">
<?php echo template::text('downloadEditVersion', [
'label' => 'Version',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'version'])
]); ?>
</div>
<div class="col3">
<?php echo template::date('downloadEditversionDate', [
'label' => 'Publiée le',
'type' => 'datetime-local',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'versionDate'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('downloadEditAuthor', [
'label' => 'Auteur',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'author'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('downloadEditLicense', $module::$licenses, [
'label' => 'Licence',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'license'])
]); ?>
</div>
<div class="col3">
<?php if ($module::$categories) {
echo template::select('downloadEditCategorie', $module::$categories, [
'label' => 'Catégorie',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'category'])
]);
} else {
echo template::select('downloadEditCategorie', ['' => ''], [
'label' => 'Pas de catégorie',
'disabled' => true
]);
}
?>
</div>
<div class="col3">
<?php echo template::file('downloadEditThumb', [
'label' => 'Capture d\'écran',
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'type' => 1,
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb'])) : ''
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::select('downloadEditRessourceType', $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('downloadEditFile', [
'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('downloadEditUrl', [
'label' => 'URL',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'url']),
'placeholder' => 'https://'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('downloadEditContent', [
'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
]); ?>
</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('downloadEditUserId', $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('downloadEditPublishedOn', [
'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.',
'label' => 'Date de publication',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']),
'type' => 'datetime-local'
]); ?>
</div>
<div class="col4">
<?php echo template::select('downloadEditConsent', $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('downloadEditCommentClose', 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('downloadEditCommentApproved', 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('downloadEditCommentMaxlength', $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('downloadEditCommentNotification', 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('downloadEditCommentGroupNotification', $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>
<?php echo template::formClose(); ?>

View File

@ -0,0 +1,69 @@
.rowitem {
margin-bottom: 10px !important;
}
.downloadPicture {
float: none;
border: 1px;
}
.downloadPicture img {
width: 100%;
height: auto;
/*
border:1px solid lightgray;
box-shadow: 1px 1px 5px darkgray;
*/
}
.downloadPicture:hover {
opacity: .7;
}
.row:after {
content: " ";
display: table;
clear: both;
}
.downloadComment {
padding-right: 10px;
float: right;
}
h2{
margin-bottom: 5px;
margin-top: 0px;
padding: 0px;
}
.downloadContent {
float: left;
margin-top: 5px;
}
.downloadDate {
font-size:0.8em;
font-style: italic;
/*
color: grey;
*/
}
@media (max-width: 768px) {
.downloadContent {
display: none;
}
.downloadPicture img {
width: 50% ;
display: block;
margin-left: auto;
margin-right: auto;
}
}
/*
* Flux RSS
*/
#rssFeed {
text-align: right;
float: right;
}
#rssFeed p {
display: inline;
vertical-align: top;
}

View File

@ -0,0 +1,67 @@
<?php if($module::$items): ?>
<div class="row">
<div class="col12">
<?php foreach($module::$items as $itemId => $item): ?>
<div class="row rowitem">
<div class="col3 downloadLeft">
<?php
// Déterminer le nom de la miniature
$parts = explode('/',$item['thumb']);
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $item['thumb']);
// Créer la miniature si manquante
if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) {
$this->makeThumb( self::FILE_DIR . 'source/' . $item['thumb'],
self::FILE_DIR . 'thumb/' . $thumb,
self::THUMBS_WIDTH);
}
?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>" class="downloadPicture">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $item['thumb']; ?>">
</a>
</div>
<div class="col9 downloadRight">
<article>
<h2 class="downloadTitle">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>">
<?php echo $item['title']; ?>
</a>
</h2>
<div class="downloadComment">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>#comment">
<?php if ($item['comment']): ?>
<?php echo count($item['comment']); ?>
<?php endif; ?>
</a>
<?php echo template::ico('comment', ['margin' => 'left']); ?>
</div>
<div class="downloadDate">
<i class="far fa-calendar-alt"></i>
<?php echo mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y - %H:%M', $item['publishedOn']), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y', $item['publishedOn'])
: utf8_encode(\PHP81_BC\strftime('%d %B %Y', $item['publishedOn'])); ?>
</div>
<p class="downloadContent">
<?php echo helper::subword(strip_tags($item['content']), 0, 400); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $itemId; ?>">Lire la suite</a>
</p>
</article>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php echo $module::$pages; ?>
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> ">
<img src='module/download/ressource/feed-icon-16.gif' />
<?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
?>
</a>
</div>
<?php endif; ?>
<?php else: ?>
<?php echo template::speech('Aucun item.'); ?>
<?php endif; ?>

View File

@ -0,0 +1,67 @@
#sectionTitle {
margin-top: 0;
margin-bottom: 5px;
}
.downloadItemPicture {
width: 100%;
border:1px solid lightgray;
box-shadow: 1px 1px 5px;
}
.downloadItemPictureleft {
float: left;
margin: 15px 10px 5px 0 ;
}
.downloadItemPictureright {
float: right;
margin: 15px 0 5px 10px ;
}
.pict20{
width: 20%;
}
.pict30{
width: 30%;
}
.pict40{
width: 40%;
}
.pict50{
width: 50%;
}
.pict100{
width: 100%;
margin: 15px 0 20px 0 ;
}
#downloaditemCommentShow {
cursor: text;
}
#downloaditemOr {
padding: 10px;
}
.downloadDate {
font-size:0.8em;
font-style: italic;
color: grey;
}
@media (max-width: 767px) {
.downloaditemPicture {
height:auto;
max-width: 100%;}
}
#rssFeed {
text-align: right;
float: right;
}
#rssFeed p {
display: inline;
vertical-align: top;
}
.itemInfo, .itemContent {
min-height: 25em;
}

View File

@ -0,0 +1,50 @@
/**
* 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/
*/
/**
* Incrémente les stats
*/
$('#downloadItemFile').click(function() {
$('#downloadStats').html(function(i, val) { return val*1+1 });
});
/**
* Affiche le bloc pour rédiger un commentaire
*/
var commentShowDOM = $("#downloadItemCommentShow");
commentShowDOM.on("click focus", function() {
$("#downloadItemCommentShowWrapper").fadeOut(function() {
$("#downloadItemCommentWrapper").fadeIn();
$("#downloadItemCommentContent").trigger("focus");
});
});
if($("#downloadItemCommentWrapper").find("textarea.notice,input.notice").length) {
commentShowDOM.trigger("click");
}
/**
* Cache le bloc pour rédiger un commentaire
*/
$("#downloadItemCommentHide").on("click focus", function() {
$("#downloadItemCommentWrapper").fadeOut(function() {
$("#downloadItemCommentShowWrapper").fadeIn();
$("#downloadItemCommentContent").val("");
$("#downloadItemCommentAuthor").val("");
});
});
/**
* Force le scroll vers les commentaires en cas d'erreur
*/
$("#downloadItemCommentForm").on("submit", function() {
$(location).attr("href", "#comment");
});

View File

@ -0,0 +1,235 @@
<div class="row">
<div class="col3 itemInfo">
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'thumb'])): ?>
<div class="row">
<div class="col12">
<?php
$pictureSize = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']);
$parts = explode('/',$this->getData(['module', $this->getUrl(0), 'posts',$this->getUrl(1), 'thumb']));
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'thumb']));
echo '<img class="downloadItemPicture" src="' . helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb .
'" alt="' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'thumb']) . '">';
?>
</div>
</div>
<?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'ressourceType']) !== 'content'): ?>
<div class="row">
<div class="col12">
<?php
switch ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'ressourceType'])) {
case 'file':
$href = helper::baseUrl() . $this->getUrl(0) . '/downloadFile/' . $this->getUrl(1);
$target = '_self';
break;
case 'url' :
$href = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'url']);
$target = '_blank';
break;
}
?>
<?php echo template::button('downloadItemFile', [
'href' => $href,
'value' => 'Télécharger',
'target'=> $target
]);
?>
</div>
</div>
<?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'version']) ): ?>
<div class="row">
<div class="col12 textAlignCenter">
<?php echo 'Version n°' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'version']); ?>
</div>
</div>
<?php endif; ?>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'date']) ): ?>
<div class="row">
<div class="col12 textAlignCenter">
<?php $date = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'date'])), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'date']))
: utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'date'])));
echo ' du ' . $date;
?>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col12 textAlignCenter">
<span>Auteur :
<?php echo $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'author']); ?>
</span>
</div>
</div>
<div class="row">
<div class="col12 textAlignCenter">
<span>Licence :
<?php echo $module::$licenses[$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'license'])]; ?>
</span>
</div>
</div>
<?php if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'file'])): ?>
<div class="row">
<div class="col12 textAlignCenter">
<span>Téléchargements : <span id="downloadStats"><?php echo $module::$statSum;'<span>'?></span>
</div>
</div>
<?php endif; ?>
</div>
<div class="col9">
<div class="row">
<div class="col12 itemContent">
<?php echo $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
</div>
</div>
<div class="row verticalAlignMiddle">
<div class="col12 downloadDate">
<?php echo $module::$itemSignature . ' - ';?>
<i class="far fa-calendar-alt"></i>
<?php $date = mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
: utf8_encode(\PHP81_BC\strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
$heure = mb_detect_encoding(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true)
? \PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))
: utf8_encode(\PHP81_BC\strftime('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])));
echo $date . ' à ' . $heure;
?>
<!-- Bouton d'édition -->
<?php if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND
( // Propriétaire
(
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER
AND ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'userId']) === $this->getUser('id')
OR $this->getUser('role') === self::ROLE_ADMIN )
)
OR (
// Rôle
( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::ROLE_ADMIN
OR $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::ROLE_MODERATOR)
AND $this->getUser('role') >= $this->getData(['module',$this->getUrl(0), 'posts', $this->getUrl(1),'editConsent'])
)
OR (
// Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL
AND $this->getUser('role') >= $module::$actions['config']
)
)
): ?>
<a href ="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1);?>">
<?php echo template::ico('pencil');?> Éditer
</a>
<?php endif; ?>
<!-- Bloc RSS-->
<?php if ($this->getData(['module',$this->getUrl(0), 'config', 'feeds'])): ?>
<div id="rssFeed">
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?> ">
<img src='module/download/ressource/feed-icon-16.gif' />
<?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
?>
</a>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!-- Bloc commentaire -->
<div class="row">
<div class="col9">
<?php if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?>
<p>Cet item ne reçoit pas de commentaire.</p>
<?php else: ?>
<h3 id="comment">
<?php //$commentsNb = count($module::$comments); ?>
<?php $commentsNb = $module::$nbCommentsApproved; ?>
<?php $s = $commentsNb === 1 ? '': 's' ?>
<?php echo $commentsNb > 0 ? $commentsNb . ' ' . 'commentaire' . $s : 'Pas encore de commentaire'; ?>
</h3>
<?php echo template::formOpen('downloadItemForm'); ?>
<?php echo template::text('downloadItemCommentShow', [
'placeholder' => 'Rédiger un commentaire...',
'readonly' => true
]); ?>
<div id="downloadItemCommentWrapper" class="displayNone">
<?php if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?>
<?php echo template::text('downloadItemUserName', [
'label' => 'Nom',
'readonly' => true,
'value' => $module::$editCommentSignature
]); ?>
<?php echo template::hidden('downloadItemUserId', [
'value' => $this->getUser('id')
]); ?>
<?php else: ?>
<div class="row">
<div class="col9">
<?php echo template::text('downloadItemAuthor', [
'label' => 'Nom'
]); ?>
</div>
<div class="col1 textAlignCenter verticalAlignBottom">
<div id="downloadItemOr">Ou</div>
</div>
<div class="col2 verticalAlignBottom">
<?php echo template::button('downloadItemLogin', [
'href' => helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()) . '__comment',
'value' => 'Connexion'
]); ?>
</div>
</div>
<?php endif; ?>
<?php echo template::textarea('downloadItemContent', [
'label' => 'Commentaire avec maximum '.$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']).' caractères',
'class' => 'editorWysiwygComment',
'noDirty' => true,
'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength'])
]); ?>
<div id="downloadItemContentAlarm"> </div>
<?php if($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
<div class="row">
<div class="col12">
<?php echo template::captcha('downloadItemCaptcha', [
'limit' => $this->getData(['config','connect', 'captchaStrong']),
'type' => $this->getData(['config','connect', 'captchaType'])
]); ?>
</div>
</div>
<?php endif; ?>
<div class="row">
<div class="col2 offset8">
<?php echo template::button('downloadItemCommentHide', [
'class' => 'buttonGrey',
'value' => 'Annuler'
]); ?>
</div>
<div class="col2">
<?php echo template::submit('downloadItemSubmit', [
'value' => 'Envoyer',
'ico' => ''
]); ?>
</div>
</div>
</div>
<?php endif;?>
<div class="row">
<div class="col12">
<?php foreach($module::$comments as $commentId => $comment): ?>
<div class="block">
<h4><?php echo $module::$commentsSignature[$commentId]; ?>
le <?php echo mb_detect_encoding(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']), 'UTF-8', true)
? \PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn'])
: utf8_encode(\PHP81_BC\strftime('%d %B %Y - %H:%M', $comment['createdOn']));
?>
<?php echo $comment['content']; ?>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<?php echo $module::$pages; ?>

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