Compare commits

..

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

148 changed files with 1049 additions and 5816 deletions

View File

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

View File

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

View File

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

View File

@ -4,25 +4,24 @@
* Mises à jour suivant les versions de ZwiiCampus
*/
// Version 1.7.00
if (
$this->getData(['core', 'dataVersion']) < 1700
) {
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
foreach (['1', '2'] as $role) {
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
foreach (['1', '2'] as $group) {
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
}
}
}
$this->setData(['core', 'dataVersion', 1700]);
}
// Version 1.8.00
if (
$this->getData(['core', 'dataVersion']) < 1800
) {
@ -47,7 +46,6 @@ if (
$this->setData(['core', 'dataVersion', 1800]);
}
// Version 1.20.02
if (
$this->getData(['core', 'dataVersion']) < 12002
) {
@ -58,12 +56,9 @@ if (
// Tableau à insérer
$a = [
'theme' =>
[
'menu' => [
'hidePages' => false
]
]
];
['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);
@ -79,57 +74,3 @@ 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('role') > self::ROLE_MEMBER) : ?>
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
<?php $layout->showBar(); ?>
<?php endif; ?>
<!-- Notifications -->
@ -48,7 +48,7 @@
$this->getData(['theme', 'menu', 'position']) === 'top'
and $this->getData(['theme', 'menu', 'fixed']) === true
and $this->isConnected() === true
and $this->getUser('role') > self::ROLE_MEMBER
and $this->getUser('group') > self::GROUP_MEMBER
) {
echo '<nav id="navfixedconnected" >';
} else {

View File

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

View File

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

View File

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

View File

@ -7,6 +7,16 @@
]); ?>
</div>
<div class="col1 offset8">
<?php if ($this->getUser('permission', 'course', 'add') === true): ?>
<?php echo template::button('courseAdd', [
'class' => 'buttonGreen',
'href' => helper::baseUrl() . 'course/add',
'value' => template::ico('plus'),
'help' => 'Ajouter un espace'
]); ?>
<?php endif; ?>
</div>
<div class="col1">
<?php if ($this->getUser('permission', 'course', 'category') === true): ?>
<?php echo template::button('courseCategory', [
'href' => helper::baseUrl() . 'course/category',
@ -23,16 +33,7 @@
'help' => 'Restaurer un espace'
]); ?>
<?php endif; ?>
</div>
<div class="col1">
<?php if ($this->getUser('permission', 'course', 'add') === true): ?>
<?php echo template::button('courseAdd', [
'class' => 'buttonGreen',
'href' => helper::baseUrl() . 'course/add',
'value' => template::ico('plus'),
'help' => 'Ajouter un espace'
]); ?>
<?php endif; ?>
</div>
</div>
<?php if (course::$courses): ?>

View File

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

View File

@ -31,19 +31,10 @@ $(document).ready((function () {
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
"columnDefs": [
{
targets: 2,
type: 'datetime',
searchable: false,
render: function (data, type, row) {
if (type === 'display') {
if (typeof data === 'number' || !isNaN(data)) {
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
} else {
return data;
}
}
// Pour le tri, retournez la valeur au format ISO
return moment(Number(data) * 1000).toISOString();
targets: 3,
type: 'numeric',
render: function (data) {
return moment(data * 1000).format('DD/MM/YYYY HH:mm');
}
},
{

View File

@ -17,7 +17,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'userDeleteAll buttonRed',
'href' => helper::baseUrl() . 'course/usersDelete/' . $this->getUrl(2),
'value' => template::ico('user-times'),
'value' => template::ico('users'),
'help' => 'Désinscrire en masse',
])?>
</div>
@ -25,7 +25,7 @@
<?php echo template::button('userDeleteAll', [
'class' => 'buttonGreen',
'href' => helper::baseUrl() . 'course/usersAdd/' . $this->getUrl(2),
'value' => template::ico('user-plus'),
'value' => template::ico('users'),
'help' => 'Inscription en masse',
]) ?>
</div>
@ -34,7 +34,7 @@
<div class="row" id="Bfrtip">
<div class="col3">
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
]); ?>
</div>
@ -53,7 +53,7 @@
</div>
<?php echo template::formClose(); ?>
<?php if (course::$courseUsers): ?>
<?php echo template::table([3, 3, 2, 2, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière consultation', 'Date' , 'Étiquette', 'Progression', ''], ['id' => 'dataTables']); ?>
<?php echo template::table([3, 3, 2, 2, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
<?php else: ?>
<?php echo template::speech('Aucun participant'); ?>
<?php endif; ?>

View File

@ -17,7 +17,7 @@
<div class="row" id="Bfrtip">
<div class="col3">
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
]); ?>
</div>

View File

@ -18,7 +18,7 @@
<div class="row" id="Bfrtip">
<div class="col3">
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
]); ?>
</div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,12 +18,12 @@ class page extends common
{
public static $actions = [
'add' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'duplicate' => self::ROLE_EDITOR,
'jsEditor' => self::ROLE_EDITOR,
'cssEditor' => self::ROLE_EDITOR,
'add' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_EDITOR,
'jsEditor' => self::GROUP_EDITOR,
'cssEditor' => self::GROUP_EDITOR,
];
public static $pagesNoParentId = [
'' => 'Aucune'
@ -180,7 +180,7 @@ class page extends common
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 0,
'role' => self::ROLE_VISITOR,
'group' => self::GROUP_VISITOR,
'targetBlank' => false,
'title' => $pageTitle,
'shortTitle' => $pageTitle,
@ -542,17 +542,17 @@ class page extends common
}
}
}
// Détermine le rôle selon que la page est une barre ou une page standard
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
// Détermine le groupe selon que la page est une barre ou une page standard
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
//Détermine le profil d'utilisateur en fonction du rôle sinon le rôle vaut 0
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0
$profil = 0;
if (
$this->getinput('pageEditBlock') !== 'bar' ||
$role === 1 ||
$role === 2
$group === 1 ||
$group === 2
) {
$profil = $this->getInput('pageEditProfil' . $role, helper::FILTER_INT);
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT);
}
// Modifie la page ou en crée une nouvelle si l'id a changé
@ -572,7 +572,7 @@ class page extends common
'modulePosition' => $this->getInput('pageModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position,
'role' => $role,
'group' => $group,
'profil' => $profil,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
@ -610,7 +610,7 @@ class page extends common
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
}
$content = empty($this->getInput('pageEditContent', null)) ? '<p></p>' : str_replace('<p></p>', '<p>&nbsp;</p>', $this->getInput('pageEditContent', null));
$content = empty($this->getInput('pageEditWysiwyg', null)) ? '<p></p>' : str_replace('<p></p>', '<p>&nbsp;</p>', $this->getInput('pageEditWysiwyg', null));
$this->setPage($pageId, $content, self::$siteContent);
// Met à jour le sitemap
@ -666,11 +666,11 @@ class page extends common
// Profils installés
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::ROLE_MEMBER) {
if ($profilId < self::GROUP_MEMBER) {
continue;
}
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
continue;
}
foreach ($profilData as $key => $value) {

View File

@ -6,732 +6,306 @@
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @authorFrédéric Tempez <frederic.tempez@outlook.com>
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
/**
* Confirmation de suppression
*/
$("#pageEditDelete").on("click", function() {
var _this = $(this);
var message_delete = "<?php echo helper::translate('Confirmer la suppression de la page'); ?>";
return core.confirm(message_delete, function() {
$(location).attr("href", _this.attr("href"));
});
// Cache jQuery objects for better performance
const $pageEditDelete = $("#pageEditDelete");
const $pageEditModuleId = $("#pageEditModuleId");
const $pageEditModuleIdOld = $("#pageEditModuleIdOld");
const $pageEditModuleIdOldText = $("#pageEditModuleIdOldText");
const $pageEditGroup = $("#pageEditGroup");
const $pageEditGroupProfil = $(".pageEditGroupProfil");
const $pageEditContentContainer = $("#pageEditContentContainer");
const $pageEditExtensionContainer = $("#pageEditExtensionContainer");
const $pageEditPositionContainer = $("#pageEditPositionContainer");
const $pageEditLayoutContainer = $("#pageEditLayoutContainer");
const $pageEditPermissionContainer = $("#pageEditPermissionContainer");
const $pageEditModuleConfig = $("#pageEditModuleConfig");
const $pageModulePositionWrapper = $("#pageModulePositionWrapper");
const $pageEditContentWrapper = $("#pageEditContentWrapper");
const $pageEditHideTitleWrapper = $("#pageEditHideTitleWrapper");
const $pageEditBlockLayout = $("#pageEditBlockLayout");
const $pageEditBlock = $("#pageEditBlock");
const $pageEditBarLeftWrapper = $("#pageEditBarLeftWrapper");
const $pageEditBarRightWrapper = $("#pageEditBarRightWrapper");
const $pageEditMenu = $("#pageEditMenu");
const $pageEditbreadCrumbWrapper = $("#pageEditbreadCrumbWrapper");
const $pageEditModuleIdWrapper = $("#pageEditModuleIdWrapper");
const $pageEditDisplayMenuWrapper = $("#pageEditDisplayMenuWrapper");
const $pageTypeMenuWrapper = $("#pageTypeMenuWrapper");
const $pageEditSeoWrapper = $("#pageEditSeoWrapper");
const $pageEditAdvancedWrapper = $("#pageEditAdvancedWrapper");
const $pageEditHideMenuSideWrapper = $("#pageEditHideMenuSideWrapper");
const $pageEditHideMenuChildrenWrapper = $("#pageEditHideMenuChildrenWrapper");
const $pageEditParentPageId = $("#pageEditParentPageId");
const $pageEditDisable = $("#pageEditDisable");
const $pageEditExtraPosition = $("#pageEditExtraPosition");
const $pageEditPosition = $("#pageEditPosition");
const $pageEditHideTitle = $("#pageEditHideTitle");
const $pageTypeMenu = $("#pageTypeMenu");
const $pageIconUrlWrapper = $("#pageIconUrlWrapper");
const $pageEditTitle = $("#pageEditTitle");
const $pageEditShortTitle = $("#pageEditShortTitle");
// Confirmation de suppression
$pageEditDelete.on("click", function() {
return core.confirm($("#pageEditDataContainer").data("translate-delete"), () => {
$(location).attr("href", $(this).attr("href"));
});
});
$("#pageEditModuleId").on("change", function() {
protectModule();
});
// Gestion du changement de module
$pageEditModuleId.on("change", protectModule);
function protectModule() {
var oldModule = $("#pageEditModuleIdOld").val();
var oldModuleText = $("#pageEditModuleIdOldText").val();
var newModule = $("#pageEditModuleId").val();
if ( oldModule !== "" &&
oldModule !== newModule) {
var _this = $(this);
var message_delete = "<?php echo helper::translate('Confirmer la suppression des données du module'); ?>";
core.confirm(message_delete + " " + oldModuleText,
function() {
$(location).attr("href", _this.attr("href"));
return true;
},
function() {
$("#pageEditModuleId").val(oldModule);
return false;
}
);
}
const oldModule = $pageEditModuleIdOld.val();
const newModule = $pageEditModuleId.val();
if (oldModule && oldModule !== newModule) {
core.confirm($("#pageEditDataContainer").data("translate-module-delete") + " " + $pageEditModuleIdOldText.val(), () => {
$(location).attr("href", $(this).attr("href"));
}, () => {
$pageEditModuleId.val(oldModule);
});
}
}
// Paramètres par défaut au chargement
$(document).ready(function() {
// Changement de profil
$pageEditGroupProfil.hide();
$(`#pageEditGroupProfil${$pageEditGroup.val()}`).show();
$pageEditGroup.on("change", function() {
$pageEditGroupProfil.hide();
$(`#pageEditGroupProfil${$(this).val()}`).show();
});
/**
* Paramètres par défaut au chargement
*/
$( document ).ready(function() {
// Sélection des onglets
const pageLayout = $("#pageEditDataContainer").data("page-layout") || "content";
$pageEditContentContainer.hide();
$pageEditExtensionContainer.hide();
$pageEditPositionContainer.hide();
$pageEditLayoutContainer.hide();
$pageEditPermissionContainer.hide();
$(`#pageEdit${capitalizeFirstLetter(pageLayout)}Container`).show();
$(`#pageEdit${capitalizeFirstLetter(pageLayout)}Button`).addClass("activeButton");
// Changement de profil
$(".pageEditGroupProfil").hide();
$("#pageEditGroupProfil" + $("#pageEditGroup").val()).show();
// Enleve le menu fixe en édition de page
$("nav").removeAttr('id');
$("#pageEditGroup").on("change", function () {
$(".pageEditGroupProfil").hide();
$("#pageEditGroupProfil" + $(this).val()).show();
});
// Gestion des modules
if ($pageEditModuleId.val() === "") {
$pageEditModuleConfig.addClass("disabled");
} else {
$pageEditModuleConfig.removeClass("disabled");
$pageEditBlock.find("option[value='bar']").remove();
}
// Masquer et afficher les éléments en fonction du module sélectionné
toggleModuleElements($pageEditModuleId.val());
/**
* Sélection des onglets
*/
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
// Non défini, valeur par défaut
if (pageLayout == "") {
pageLayout = "content";
}
// Tout cacher
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
// Afficher la bonne tab
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
// Masquer et afficher les éléments en fonction du bloc sélectionné
toggleBlockElements($pageEditBlock.val());
// Masquer ou afficher le chemin de fer
toggleBreadCrumb($pageEditHideTitle.is(':checked'), $pageEditParentPageId.val());
/*
* Enleve le menu fixe en édition de page
*/
$("nav").removeAttr('id');
/**
* Bloque/Débloque le bouton de configuration au changement de module
* Affiche ou masque la position du module selon le call_user_func
*/
if($("#pageEditModuleId").val() === "") {
$("#pageEditModuleConfig").addClass("disabled");
/*$("#pageEditContentContainer").hide();*/
}
else {
$("#pageEditModuleConfig").removeClass("disabled");
/*$("#pageEditContentContainer").hide();*/
$("#pageEditBlock option[value='bar']").remove();
}
/**
* Masquer et affiche la sélection de position du module
*/
if( $("#pageEditModuleId").val() === "redirection" ||
$("#pageEditModuleId").val() === "" ) {
$("#pageModulePositionWrapper").removeClass("disabled");
$("#pageModulePositionWrapper").slideUp();
}
else {
$("#pageModulePositionWrapper").addClass("disabled");
$("#pageModulePositionWrapper").slideDown();
}
/**
* Masquer et démasquer le contenu pour les modules code et redirection
*/
if( $("#pageEditModuleId").val() === "redirection") {
$("#pageEditContentWrapper").removeClass("disabled");
$("#pageEditContentWrapper").slideUp();
} else {
$("#pageEditContentWrapper").addClass("disabled");
$("#pageEditContentWrapper").slideDown();
}
/**
* Masquer et démasquer le masquage du titre pour le module redirection
*/
if( $("#pageEditModuleId").val() === "redirection" ) {
$("#pageEditHideTitleWrapper").removeClass("disabled");
$("#pageEditHideTitleWrapper").hide();
$("#pageEditBlockLayout").removeClass("disabled");
$("#pageEditBlockLayout").hide();
} else {
$("#pageEditHideTitleWrapper").addClass("disabled");
$("#pageEditHideTitleWrapper").show();
$("#pageEditBlockLayout").addClass("disabled");
$("#pageEditBlockLayout").show();
}
/**
* Masquer et démasquer la sélection des barres
*/
switch ($("#pageEditBlock").val()) {
case "bar":
case "12":
$("#pageEditBarLeftWrapper").removeClass("disabled");
$("#pageEditBarLeftWrapper").slideUp();
$("#pageEditBarRightWrapper").removeClass("disabled");
$("#pageEditBarRightWrapper").slideUp();
break;
case "3-9":
case "4-8":
$("#pageEditBarLeftWrapper").addClass("disabled");
$("#pageEditBarLeftWrapper").slideDown();
$("#pageEditBarRightWrapper").removeClass("disabled");
$("#pageEditBarRightWrapper").slideUp();
break;
case "9-3":
case "8-4":
$("#pageEditBarLeftWrapper").removeClass("disabled");
$("#pageEditBarLeftWrapper").slideUp();
$("#pageEditBarRightWrapper").addClass("disabled");
$("#pageEditBarRightWrapper").slideDown();
break;
case "3-6-3":
case "2-7-3":
case "3-7-2":
$("#pageEditBarLeftWrapper").addClass("disabled");
$("#pageEditBarLeftWrapper").slideDown();
$("#pageEditBarRightWrapper").addClass("disabled");
$("#pageEditBarRightWrapper").slideDown();
break;
};
if ($("#pageEditBlock").val() === "bar") {
$("#pageEditMenu").removeClass("disabled");
$("#pageEditMenu").hide();
$("#pageEditHideTitleWrapper").removeClass("disabled");
$("#pageEditHideTitleWrapper").slideUp();
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
$("#pageEditbreadCrumbWrapper").slideUp();
$("#pageEditModuleIdWrapper").removeClass("disabled");
$("#pageEditModuleIdWrapper").slideUp();
$("#pageEditModuleConfig").removeClass("disabled");
$("#pageEditModuleConfig").slideUp();
$("#pageEditDisplayMenuWrapper").addClass("disabled");
$("#pageEditDisplayMenuWrapper").slideDown();
$("#pageTypeMenuWrapper").removeClass("disabled");
$("#pageTypeMenuWrapper").slideUp();
$("#pageEditSeoWrapper").removeClass("disabled");
$("#pageEditSeoWrapper").slideUp();
$("#pageEditAdvancedWrapper").removeClass("disabled");
$("#pageEditAdvancedWrapper").slideUp();
$(".navSelect").slideUp();
/*
$("#pageEditBlockLayout").removeClass("col6");
$("#pageEditBlockLayout").addClass("col12");
*/
} else {
$("#pageEditDisplayMenuWrapper").removeClass("disabled");
$("#pageEditDisplayMenuWrapper").slideUp();
}
/**
* Masquer ou afficher le chemin de fer
* Quand le titre est masqué
*/
if ($("input[name=pageEditHideTitle]").is(':checked') ||
$("#pageEditParentPageId").val() === "" ) {
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
$("#pageEditbreadCrumbWrapper").slideUp();
} else {
if ($("#pageEditParentPageId").val() !== "") {
$("#pageEditbreadCrumbWrapper").addClass("disabled");
$("#pageEditbreadCrumbWrapper").slideDown();
}
}
/**
* Masquer ou afficher la sélection de l'icône
*/
if ($("#pageTypeMenu").val() !== "text") {
$("#pageIconUrlWrapper").addClass("disabled");
$("#pageIconUrlWrapper").slideDown();
} else {
$("#pageIconUrlWrapper").removeClass("disabled");
$("#pageIconUrlWrapper").slideUp();
}
/**
* Cache les options de masquage dans les menus quand la page n'est pas affichée.
*/
if ($("#pageEditPosition").val() === "0" ) {
$("#pageEditHideMenuSideWrapper").removeClass("disabled");
$("#pageEditHideMenuSideWrapper").slideUp();
} else {
$("#pageEditHideMenuSideWrapper").addClass("disabled");
$("#pageEditHideMenuSideWrapper").slideDown();
}
/**
* Cache l'option de masquage des pages enfants
*/
if ($("#pageEditParentPageId").val() !== "") {
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideUp();
} else {
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideDown();
}
/**
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
*/
if ($("#pageEditDisable").is(':checked') ) {
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideUp();
} else {
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideDown();
}
/**
* Liste des pages pour le menu accessoire
*/
if ($("#pageEditExtraPosition").val() == 1 ) {
var positionDOM = $("#pageEditPosition");
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
buildPagesList(true);
$("#pageEditPosition").val(positionInitial);
}
// Masquer ou afficher la sélection de l'icône
toggleIconUrl($pageTypeMenu.val());
// Masquer ou afficher les options de masquage dans les menus
toggleMenuOptions($pageEditPosition.val(), $pageEditParentPageId.val(), $pageEditDisable.is(':checked'));
// Liste des pages pour le menu accessoire
if ($pageEditExtraPosition.val() == 1) {
buildPagesList(true);
$pageEditPosition.val($("#pageEditDataContainer").data("position-initial"));
}
});
// Gestion des évènements
//--------------------------------------------------------------------------------------
/**
* Transmet le bouton de l'onglet sélectionné avant la soumission
*/
$('#pageEditForm').on('submit', function () {
$('#containerSelected').val(pageLayout);
});
/**
* Sélection de la page de configuration à afficher
*/
$("#pageEditContentButton").on("click", function () {
pageLayout = "content";
$("#pageEditContentContainer").show();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").addClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditPositionButton").on("click", function () {
pageLayout = "position";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").show();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").addClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditExtensionButton").on("click", function () {
pageLayout = "extension";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").show();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").addClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditLayoutButton").on("click", function () {
pageLayout = "layout";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").show();
$("#pageEditPermissionContainer").hide();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").addClass("activeButton");
$("#pageEditPermissionButton").removeClass("activeButton");
});
$("#pageEditPermissionButton").on("click", function () {
pageLayout = "permission";
$("#pageEditContentContainer").hide();
$("#pageEditExtensionContainer").hide();
$("#pageEditPositionContainer").hide();
$("#pageEditLayoutContainer").hide();
$("#pageEditPermissionContainer").show();
$("#pageEditContentButton").removeClass("activeButton");
$("#pageEditExtensionButton").removeClass("activeButton");
$("#pageEditPositionButton").removeClass("activeButton");
$("#pageEditLayoutButton").removeClass("activeButton");
$("#pageEditPermissionButton").addClass("activeButton");
});
/**
* Cache le l'option "ne pas afficher les pages enfants dans le menu horizontal" lorsque la page est désactivée
*/
var pageEditDisableDOM = $("#pageEditDisable");
pageEditDisableDOM.on("change", function() {
if ($(this).is(':checked') ) {
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideUp();
$("#pageEditHideMenuChildren").prop("checked", false);
} else {
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideDown();
}
// Gestion des événements
$('#pageEditForm').on('submit', function() {
$('#containerSelected').val(pageLayout);
});
/**
* Cache les options de masquage dans les menus quand la page n'est pas affichée.
*/
var pageEditPositionDOM = $("#pageEditPosition");
pageEditPositionDOM.on("change", function() {
if ($(this).val() === "0" ) {
$("#pageEditHideMenuSideWrapper").removeClass("disabled");
$("#pageEditHideMenuSideWrapper").slideUp();
} else {
$("#pageEditHideMenuSideWrapper").addClass("disabled");
$("#pageEditHideMenuSideWrapper").slideDown();
}
$("#pageEditContentButton, #pageEditPositionButton, #pageEditExtensionButton, #pageEditLayoutButton, #pageEditPermissionButton").on("click", function() {
const tab = $(this).attr("id").replace("pageEdit", "").replace("Button", "").toLowerCase();
$pageEditContentContainer.hide();
$pageEditExtensionContainer.hide();
$pageEditPositionContainer.hide();
$pageEditLayoutContainer.hide();
$pageEditPermissionContainer.hide();
$(`#pageEdit${capitalizeFirstLetter(tab)}Container`).show();
$(this).addClass("activeButton").siblings().removeClass("activeButton");
});
/**
* Bloque/Débloque le bouton de configuration au changement de module
* Affiche ou masque la position du module selon le call_user_func
*/
var pageEditModuleIdDOM = $("#pageEditModuleId");
pageEditModuleIdDOM.on("change", function() {
if($(this).val() === "") {
$("#pageEditModuleConfig").addClass("disabled");
$("#pageEditBlock").append('<option value="bar">Barre latérale</option>');
}
else {
$("#pageEditModuleConfig").removeClass("disabled");
$("#pageEditBlock option[value='bar']").remove();
}
$pageEditDisable.on("change", function() {
toggleMenuOptions($pageEditPosition.val(), $pageEditParentPageId.val(), $(this).is(':checked'));
});
/**
* Masquer et affiche la sélection de position du module
*
* */
var pageEditModuleIdDOM = $("#pageEditModuleId");
pageEditModuleIdDOM.on("change", function() {
if( $(this).val() === "redirection" ||
$(this).val() === "") {
$("#pageModulePositionWrapper").removeClass("disabled");
$("#pageModulePositionWrapper").slideUp();
}
else {
$("#pageModulePositionWrapper").addClass("disabled");
$("#pageModulePositionWrapper").slideDown();
}
$pageEditPosition.on("change", function() {
toggleMenuOptions($(this).val(), $pageEditParentPageId.val(), $pageEditDisable.is(':checked'));
});
/**
* Masquer et démasquer le contenu pour les modules code et redirection
*/
var pageEditModuleIdDOM = $("#pageEditModuleId");
pageEditModuleIdDOM.on("change", function() {
if( $(this).val() === "redirection") {
$("#pageEditContentWrapper").removeClass("disabled");
$("#pageEditContentWrapper").slideUp();
}
else {
$("#pageEditContentWrapper").addClass("disabled");
$("#pageEditContentWrapper").slideDown();
}
$pageEditModuleId.on("change", function() {
toggleModuleElements($(this).val());
});
/**
* Masquer et démasquer le masquage du titre pour le module redirection
*/
var pageEditModuleIdDOM = $("#pageEditModuleId");
pageEditModuleIdDOM.on("change", function() {
if( $(this).val() === "redirection") {
$("#pageEditHideTitleWrapper").removeClass("disabled");
$("#pageEditHideTitleWrapper").slideUp();
$("#pageEditBlockLayout").removeClass("disabled");
$("#pageEditBlockLayout").slideUp();
}
else {
$("#pageEditHideTitleWrapper").addClass("disabled");
$("#pageEditHideTitleWrapper").slideDown();
$("#pageEditBlockLayout").addClass("disabled");
$("#pageEditBlockLayout").slideDown();
}
$pageEditBlock.on("change", function() {
toggleBlockElements($(this).val());
});
/**
* Masquer et démasquer la sélection des barres
*/
var pageEditBlockDOM = $("#pageEditBlock");
pageEditBlockDOM.on("change", function() {
switch ($(this).val()) {
case "bar":
case "12":
$("#pageEditBarLeftWrapper").removeClass("disabled");
$("#pageEditBarLeftWrapper").slideUp();
$("#pageEditBarRightWrapper").removeClass("disabled");
$("#pageEditBarRightWrapper").slideUp();
break;
case "3-9":
case "4-8":
$("#pageEditBarLeftWrapper").addClass("disabled");
$("#pageEditBarLeftWrapper").slideDown();
$("#pageEditBarRightWrapper").removeClass("disabled");
$("#pageEditBarRightWrapper").slideUp();
break;
case "9-3":
case "8-4":
$("#pageEditBarLeftWrapper").removeClass("disabled");
$("#pageEditBarLeftWrapper").slideUp();
$("#pageEditBarRightWrapper").addClass("disabled");
$("#pageEditBarRightWrapper").slideDown();
break;
case "3-6-3":
case "2-7-3":
case "3-7-2":
$("#pageEditBarLeftWrapper").addClass("disabled");
$("#pageEditBarLeftWrapper").slideDown();
$("#pageEditBarRightWrapper").addClass("disabled");
$("#pageEditBarRightWrapper").slideDown();
break;
}
if ($(this).val() === "bar") {
$("#pageEditMenu").removeClass("disabled");
$("#pageEditMenu").hide();
$("#pageEditHideTitleWrapper").removeClass("disabled");
$("#pageEditHideTitleWrapper").slideUp();
$("#pageTypeMenuWrapper").removeClass("disabled");
$("#pageTypeMenuWrapper").slideUp();
$("#pageEditSeoWrapper").removeClass("disabled");
$("#pageEditSeoWrapper").slideUp();
$("#pageEditAdvancedWrapper").removeClass("disabled");
$("#pageEditAdvancedWrapper").slideUp();
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
$("#pageEditbreadCrumbWrapper").slideUp();
$("#pageEditModuleIdWrapper").removeClass("disabled");
$("#pageEditModuleIdWrapper").slideUp();
$("#pageEditModuleConfig").removeClass("disabled");
$("#pageEditModuleConfig").slideUp();
$("#pageEditDisplayMenuWrapper").addClass("disabled");
$("#pageEditDisplayMenuWrapper").slideDown();
$(".navSelect").slideUp();
/*
$("#pageEditBlockLayout").removeClass("col6");
$("#pageEditBlockLayout").addClass("col12");
*/
} else {
$("#pageEditMenu").addClass("disabled");
$("#pageEditMenu").show();
$("#pageEditHideTitleWrapper").addClass("disabled");
$("#pageEditHideTitleWrapper").slideDown();
$("#pageTypeMenuWrapper").addClass("disabled");
$("#pageTypeMenuWrapper").slideDown();
$("#pageEditSeoWrapper").addClass("disabled");
$("#pageEditSeoWrapper").slideDown();
$("#pageEditAdvancedWrapper").addClass("disabled");
$("#pageEditAdvancedWrapper").slideDown();
$("#pageEditModuleIdWrapper").addClass("disabled");
$("#pageEditModuleIdWrapper").slideDown();
$("#pageEditModuleConfig").slideDown();
$("#pageEditDisplayMenuWrapper").removeClass("disabled");
$("#pageEditDisplayMenuWrapper").slideUp();
$(".navSelect").slideDown();
if ($("#pageEditParentPageId").val() !== "") {
$("#pageEditbreadCrumbWrapper").addClass("disabled");
$("#pageEditbreadCrumbWrapper").slideDown();
$("#pageEditExtraPositionWrapper").slideDown();
} else {
}
if ($("#pageEditModuleId").val() === "") {
$("#pageEditModuleConfig").addClass("disabled");
} else {
$("#pageEditModuleConfig").removeClass("disabled");
}
/*
$("#pageEditBlockLayout").removeClass("col12");
$("#pageEditBlockLayout").addClass("col6");
*/
}
$pageEditHideTitle.on("change", function() {
toggleBreadCrumb($(this).is(':checked'), $pageEditParentPageId.val());
});
/**
* Masquer ou afficher le chemin de fer
* Quand le titre est masqué
*/
var pageEditHideTitleDOM = $("#pageEditHideTitle");
pageEditHideTitleDOM.on("change", function() {
if ($("input[name=pageEditHideTitle]").is(':checked')) {
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
$("#pageEditbreadCrumbWrapper").slideUp();
} else {
if ($("#pageEditParentPageId").val() !== "") {
$("#pageEditbreadCrumbWrapper").addClass("disabled");
$("#pageEditbreadCrumbWrapper").slideDown();
}
}
$pageTypeMenu.on("change", function() {
toggleIconUrl($(this).val());
});
/**
* Masquer ou afficher le chemin de fer
* Quand la page n'est pas mère et que le menu n'est pas masqué
*/
var pageEditParentPageIdDOM = $("#pageEditParentPageId");
pageEditParentPageIdDOM.on("change", function() {
if ($(this).val() === "" &&
!$('input[name=pageEditHideTitle]').is(':checked') ) {
$("#pageEditbreadCrumbWrapper").removeClass("disabled");
$("#pageEditbreadCrumbWrapper").slideUp();
$("#pageEditExtraPositionWrapper").slideUp();
} else {
$("#pageEditbreadCrumbWrapper").addClass("disabled");
$("#pageEditbreadCrumbWrapper").slideDown();
$("#pageEditExtraPositionWrapper").slideDown();
}
if ($(this).val() !== "") {
$("#pageEditHideMenuChildrenWrapper").removeClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideUp();
$("#pageEditExtraPositionWrapper").slideUp();
} else {
$("#pageEditHideMenuChildrenWrapper").addClass("disabled");
$("#pageEditHideMenuChildrenWrapper").slideDown();
$("#pageEditExtraPositionWrapper").slideDown();
}
$pageEditTitle.on("input", function() {
$pageEditShortTitle.val($(this).val());
});
/**
* Masquer ou afficher la sélection de l'icône
*/
var pageTypeMenuDOM = $("#pageTypeMenu");
pageTypeMenuDOM.on("change", function() {
if ($(this).val() !== "text") {
$("#pageIconUrlWrapper").addClass("disabled");
$("#pageIconUrlWrapper").slideDown();
} else {
$("#pageIconUrlWrapper").removeClass("disabled");
$("#pageIconUrlWrapper").slideUp();
}
$pageEditExtraPosition.on("change", function() {
buildPagesList($(this).val() == 1);
});
/**
* Duplication du champ Title dans Short title
*/
$("#pageEditTitle").on("input", function() {
$("#pageEditShortTitle").val($(this).val());
$pageEditModuleConfig.on("click", function() {
$("#pageEditModuleRedirect").val(1);
$("#pageEditForm").trigger("submit");
});
/**
* Actualise la liste de pages lorsque le menu accessoire est sélectionné
*/
// Initialise à Début si le menu accessoire est sélectionné
$("#pageEditExtraPosition").on("change", function() {
if ($("#pageEditExtraPosition").val() == 1 ) {
buildPagesList(true);
} else {
buildPagesList(false);
//$("#pageEditParentPageId").trigger("change");
}
});
/**
* Soumission du formulaire pour éditer le module
*/
$("#pageEditModuleConfig").on("click", function() {
$("#pageEditModuleRedirect").val(1);
$("#pageEditForm").trigger("submit");
});
/**
* Affiche les pages en fonction de la page parent dans le choix de la position
*/
$("#pageEditParentPageId").on("change", function() {
buildPagesList(false);
$pageEditParentPageId.on("change", function() {
buildPagesList(false);
}).trigger("change");
/**
* Construit un select contenant la liste des pages du site.
*/
function buildPagesList(extraPosition) {
var hierarchy = <?php echo json_encode($this->getHierarchy()); ?>;
var pages = <?php echo $module->getPageInfo(); ?>;
var positionInitial = <?php echo $this->getData(['page',$this->getUrl(2),"position"]); ?>;
var extraPosition = $("#pageEditExtraPosition").val();
var positionDOM = $("#pageEditPosition");
var message_none = "<?php echo helper::translate('Ne pas afficher'); ?>";
var message_begin = "<?php echo helper::translate('Au début'); ?>";
var message_after = "<?php echo helper::translate('Après'); ?>";
positionDOM.empty().append(
$("<option>").val(0).text(message_none),
$("<option>").val(1).text(message_begin)
);
var parentSelected = $("#pageEditParentPageId").val();
var positionSelected = 0;
var positionPrevious = 1;
// Récupération des données depuis les attributs data-*
const hierarchy = $("#pageEditDataContainer").data("hierarchy");
const pages = $("#pageEditDataContainer").data("pages");
const positionInitial = $("#pageEditDataContainer").data("position-initial");
const currentPage = $("#pageEditDataContainer").data("current-page");
const positionDOM = $pageEditPosition;
const message_none = $("#pageEditDataContainer").data("translate-none");
const message_begin = $("#pageEditDataContainer").data("translate-begin");
const message_after = $("#pageEditDataContainer").data("translate-after");
// Aucune page parent sélectionnée
if(parentSelected === "") {
// Liste des pages sans parents
for(var key in hierarchy) {
if(hierarchy.hasOwnProperty(key) ) {
// Sélectionne la page avant s'il s'agit de la page courante
if(key === "<?php echo $this->getUrl(2); ?>") {
positionSelected = positionPrevious;
}
// Sinon ajoute la page à la liste
else {
// Enregistre la position de cette page afin de la sélectionner si la prochaine page de la liste est la page courante
if (extraPosition == pages[key].extraPosition ) {
positionPrevious++;
// Ajout à la liste
positionDOM.append(
$("<option>").val(positionPrevious).html(message_after + " \"" + (pages[key].title) + "\"")
);
}
positionDOM.empty().append(
$("<option>").val(0).text(message_none),
$("<option>").val(1).text(message_begin)
);
}
}
}
if (positionInitial === 0) {
positionSelected = 0;
}
}
// Une page parent est sélectionnée
else {
// Liste des pages enfants de la page parent
for(var i = 0; i < hierarchy[parentSelected].length; i++) {
// Pour page courante sélectionne la page précédente (pas de - 1 à positionSelected à cause des options par défaut)
if(hierarchy[parentSelected][i] === "<?php echo $this->getUrl(2); ?>") {
positionSelected = positionPrevious;
}
// Sinon ajoute la page à la liste
else {
// Enregistre la position de cette page afin de la sélectionner si la prochaine page de la liste est la page courante
positionPrevious++;
// Ajout à la liste
positionDOM.append(
$("<option>").val(positionPrevious).html(message_after + " \"" + (pages[hierarchy[parentSelected][i]].title) + "\"")
);
}
}
}
// Sélectionne la bonne position
positionDOM.val(positionSelected);
};
const parentSelected = $pageEditParentPageId.val();
let positionSelected = 0;
let positionPrevious = 1;
// --- Début de la logique originale ---
if (parentSelected === "") {
for (const key in hierarchy) {
if (hierarchy.hasOwnProperty(key)) {
if (key === currentPage) {
positionSelected = positionPrevious;
} else {
if (extraPosition == pages[key].extraPosition) {
positionPrevious++;
positionDOM.append(
$("<option>").val(positionPrevious).html(`${message_after} "${pages[key].title}"`)
);
}
}
}
}
if (positionInitial === 0) {
positionSelected = 0;
}
} else {
for (let i = 0; i < hierarchy[parentSelected].length; i++) {
if (hierarchy[parentSelected][i] === currentPage) {
positionSelected = positionPrevious;
} else {
positionPrevious++;
positionDOM.append(
$("<option>").val(positionPrevious).html(`${message_after} "${pages[hierarchy[parentSelected][i]].title}"`)
);
}
}
}
// --- Fin de la logique originale ---
positionDOM.val(positionSelected);
}
// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function toggleModuleElements(moduleId) {
const isRedirection = moduleId === "redirection";
const isEmpty = moduleId === "";
$pageModulePositionWrapper.toggleClass("disabled", !isEmpty && !isRedirection).slideToggle(isEmpty || isRedirection);
$pageEditContentWrapper.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
$pageEditHideTitleWrapper.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
$pageEditBlockLayout.toggleClass("disabled", !isRedirection).slideToggle(isRedirection);
}
function toggleBlockElements(blockValue) {
const isBar = blockValue === "bar";
const isFullWidth = blockValue === "12";
const isLeftBar = blockValue === "3-9" || blockValue === "4-8";
const isRightBar = blockValue === "9-3" || blockValue === "8-4";
const isDoubleBar = blockValue === "3-6-3" || blockValue === "2-7-3" || blockValue === "3-7-2";
$pageEditBarLeftWrapper.toggleClass("disabled", !isBar && !isFullWidth && !isRightBar).slideToggle(isBar || isFullWidth || isRightBar);
$pageEditBarRightWrapper.toggleClass("disabled", !isBar && !isFullWidth && !isLeftBar).slideToggle(isBar || isFullWidth || isLeftBar);
if (isBar) {
$pageEditMenu.removeClass("disabled").hide();
$pageEditHideTitleWrapper.removeClass("disabled").slideUp();
$pageTypeMenuWrapper.removeClass("disabled").slideUp();
$pageEditSeoWrapper.removeClass("disabled").slideUp();
$pageEditAdvancedWrapper.removeClass("disabled").slideUp();
$pageEditbreadCrumbWrapper.removeClass("disabled").slideUp();
$pageEditModuleIdWrapper.removeClass("disabled").slideUp();
$pageEditModuleConfig.removeClass("disabled").slideUp();
$pageEditDisplayMenuWrapper.addClass("disabled").slideDown();
$(".navSelect").slideUp();
} else {
$pageEditMenu.addClass("disabled").show();
$pageEditHideTitleWrapper.addClass("disabled").slideDown();
$pageTypeMenuWrapper.addClass("disabled").slideDown();
$pageEditSeoWrapper.addClass("disabled").slideDown();
$pageEditAdvancedWrapper.addClass("disabled").slideDown();
$pageEditModuleIdWrapper.addClass("disabled").slideDown();
$pageEditModuleConfig.slideDown();
$pageEditDisplayMenuWrapper.removeClass("disabled").slideUp();
$(".navSelect").slideDown();
if ($pageEditParentPageId.val() !== "") {
$pageEditbreadCrumbWrapper.addClass("disabled").slideDown();
$pageEditExtraPositionWrapper.slideDown();
}
if ($pageEditModuleId.val() === "") {
$pageEditModuleConfig.addClass("disabled");
} else {
$pageEditModuleConfig.removeClass("disabled");
}
}
}
function toggleBreadCrumb(isHideTitleChecked, parentPageId) {
$pageEditbreadCrumbWrapper.toggleClass("disabled", !isHideTitleChecked && parentPageId !== "").slideToggle(isHideTitleChecked || parentPageId === "");
}
function toggleIconUrl(menuType) {
$pageIconUrlWrapper.toggleClass("disabled", menuType !== "text").slideToggle(menuType !== "text");
}
function toggleMenuOptions(position, parentPageId, isDisableChecked) {
$pageEditHideMenuSideWrapper.toggleClass("disabled", position !== "0").slideToggle(position === "0");
$pageEditHideMenuChildrenWrapper.toggleClass("disabled", parentPageId === "" && !isDisableChecked).slideToggle(parentPageId !== "" || isDisableChecked);
}

View File

@ -35,30 +35,50 @@
<?php echo template::button('pageEditContentButton', [
'value' => 'Contenu',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditPositionButton', [
'value' => 'Menu',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditExtensionButton', [
'value' => 'Extension',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditLayoutButton', [
'value' => 'Mise en page',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
]); ?>
<?php echo template::button('pageEditPermissionButton', [
'value' => 'Permission',
'class' => 'buttonTab',
//'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
]); ?>
</div>
<?php
// Données dynamiques à insérer dans le JavaScript
$data = [
'translate-delete' => helper::translate('Confirmer la suppression de la page'),
'translate-module-delete' => helper::translate('Confirmer la suppression des données du module'),
'translate-none' => helper::translate('Ne pas afficher'),
'translate-begin' => helper::translate('Au début'),
'translate-after' => helper::translate('Après'),
'hierarchy' => json_encode($this->getHierarchy()),
'pages' => $module->getPageInfo(),
'position-initial' => $this->getData(['page', $this->getUrl(2), 'position']),
'current-page' => $this->getUrl(2),
'page-layout' => $this->getData(['user', $this->getUser('id'), 'view', 'page'])
];
// Génération du contenu JavaScript
echo '<div id="pageEditDataContainer"';
foreach ($data as $key => $value) {
// Convertit explicitement les valeurs null en chaîne vide
$sanitizedValue = $value ?? '';
echo ' data-' . htmlspecialchars($key) . '="' . htmlspecialchars((string)$sanitizedValue) . '"';
}
echo '></div>';
?>
<!-- Champ caché pour transmettre l'onglet-->
<?php echo template::hidden('containerSelected'); ?>
@ -102,7 +122,7 @@
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('pageEditContent', [
<?php echo template::textarea('pageEditWysiwyg', [
'class' => 'editorWysiwyg',
'value' => $this->getPage($this->getUrl(2), self::$siteContent)
]); ?>
@ -358,24 +378,24 @@
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', self::$rolePublics, [
'label' => 'Rôle minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
'help' => 'Les rôles de niveau supérieur accèdent à la page.'
<?php echo template::select('pageEditGroup', self::$groupPublics, [
'label' => 'Groupe minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
]); ?>
</div>
<div class="col6">
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_MEMBER, page::$userProfils[self::ROLE_MEMBER], [
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, page::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',
]); ?>
</div>
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_EDITOR, page::$userProfils[self::ROLE_EDITOR], [
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, page::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,19 +33,17 @@ $(document).ready((function () {
"columnDefs": [
{
target: 4,
type: 'datetime', // Utilisez 'datetime' pour le tri
searchable: false,
render: function (data, type, row) {
if (type === 'display') {
if (typeof data === 'number' || !isNaN(data)) {
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
} else {
return data;
}
type: 'num', // Utilisez 'num' pour le tri
render: function (data) {
// Si data est un nombre, formatez-le en date
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
}
// Pour le tri, retournez la valeur au format ISO
return moment(Number(data) * 1000).toISOString();
}
},
orderable: false,
searchable: false
},
{
target: 5,

View File

@ -6,40 +6,41 @@
'value' => template::ico('home')
]); ?>
</div>
<div class="col1 offset6">
<?php echo template::button('userTag', [
'href' => helper::baseUrl() . 'user/tag',
'value' => template::ico('tags'),
'help' => 'Ajouter des étiquettes'
]); ?>
</div>
<div class="col1">
<?php echo template::button('userGroup', [
'href' => helper::baseUrl() . 'user/profil',
'value' => template::ico('lock'),
'help' => 'Permissions par profils'
]); ?>
</div>
<div class="col1">
<?php echo template::button('userDeleteAll', [
'class' => 'userDeleteAll buttonRed',
'href' => helper::baseUrl() . 'user/usersDelete/' . $this->getUrl(2),
'value' => template::ico('user-times'),
'help' => 'Désinscrire en masse',
]) ?>
</div>
<div class="col1">
<div class="col2 offset2">
<?php echo template::button('userImport', [
'href' => helper::baseUrl() . 'user/import',
'value' => template::ico('download'),
'class' => 'buttonGreen',
'help' => 'Importer en masse'
'ico' => 'users',
'value' => 'Importer en masse'
]); ?>
</div>
<div class="col2">
<?php echo template::button('userDeleteAll', [
'class' => 'userDeleteAll buttonRed',
'href' => helper::baseUrl() . 'user/usersDelete/' . $this->getUrl(2),
'ico' => 'users',
'value' => 'Désinscrire en masse',
]) ?>
</div>
<div class="col2">
<?php echo template::button('userTag', [
'href' => helper::baseUrl() . 'user/tag',
'ico' => 'tags',
'value' => 'Étiquettes',
'help' => 'Filtrer les utilisateurs avec des tags'
]); ?>
</div>
<div class="col2">
<?php echo template::button('userGroup', [
'href' => helper::baseUrl() . 'user/profil',
'ico' => 'lock',
'value' => 'Profils',
'help' => 'Permissions par profils'
]); ?>
</div>
<div class="col1">
<?php echo template::button('userAdd', [
'href' => helper::baseUrl() . 'user/add',
'value' => template::ico('user-plus'),
'value' => template::ico('plus'),
'class' => 'buttonGreen',
'help' => 'Ajouter un utilisateur'
]); ?>
@ -49,7 +50,7 @@
<div class="row">
<div class="col3">
<?php echo template::select('userFilterGroup', user::$usersGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['userFilterGroup']) ? $_POST['userFilterGroup'] : 'all',
]); ?>
</div>
@ -67,4 +68,4 @@
</div>
</div>
<?php echo template::formClose(); ?>
<?php echo template::table([2, 2, 2, 2, 2, 1, 1], user::$users, ['Nom', 'Rôle', 'Profil', 'Étiquette', 'Date connexion', '', ''], ['id' => 'dataTables'], ['name', 'role', 'profile', 'tag', 'data-timestamp', 'edit', 'delete']); ?>
<?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']); ?>

View File

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

View File

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

View File

@ -28,7 +28,7 @@
<div class="row" id="Bfrtip">
<div class="col3">
<?php echo template::select('usersFilterGroup', user::$usersGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['usersFilterGroup']) ? $_POST['usersFilterGroup'] : 'all',
]); ?>
</div>

View File

@ -18,7 +18,7 @@
<div class="row" id="Bfrtip">
<div class="col3">
<?php echo template::select('usersFilterGroup', user::$usersGroups, [
'label' => 'Rôles/ Profils',
'label' => 'Groupes / Profils',
'selected' => isset($_POST['usersFilterGroup']) ? $_POST['usersFilterGroup'] : 'all',
]); ?>
</div>

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

Binary file not shown.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 652 B

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,62 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* 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

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

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

View File

@ -1,21 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* 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

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

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

View File

@ -1,77 +0,0 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
// 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

@ -1,210 +0,0 @@
<?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(); ?>

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