renomme les constantes

This commit is contained in:
Fred Tempez 2025-02-07 17:31:43 +01:00
parent d76beebd2d
commit 239fa36b47
81 changed files with 3631 additions and 348 deletions

View File

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

View File

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

View File

@ -24,13 +24,13 @@ class common
const DISPLAY_LAYOUT_BLANK = 3;
const DISPLAY_LAYOUT_MAIN = 4;
const DISPLAY_LAYOUT_LIGHT = 5;
const GROUP_BANNED = -1;
const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1;
const GROUP_EDITOR = 2;
const ROLE_BANNED = -1;
const ROLE_VISITOR = 0;
const ROLE_MEMBER = 1;
const ROLE_EDITOR = 2;
// Groupe MODERATOR, compatibilité avec les anciens modules :
const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3;
const ROLE_MODERATOR = 2;
const ROLE_ADMIN = 3;
const SIGNATURE_ID = 1;
const SIGNATURE_PSEUDO = 2;
const SIGNATURE_FIRSTLASTNAME = 3;
@ -148,28 +148,28 @@ class common
'view' => ''
];
public static $roles = [
self::GROUP_BANNED => 'Banni',
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
self::ROLE_BANNED => 'Banni',
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $roleEdits = [
self::GROUP_BANNED => 'Banni',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
self::ROLE_BANNED => 'Banni',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $roleNews = [
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
public static $rolePublics = [
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Étudiant',
self::GROUP_EDITOR => 'Formateur',
self::GROUP_ADMIN => 'Administrateur'
self::ROLE_VISITOR => 'Visiteur',
self::ROLE_MEMBER => 'Étudiant',
self::ROLE_EDITOR => 'Formateur',
self::ROLE_ADMIN => 'Administrateur'
];
//Langues de l'UI
@ -821,7 +821,7 @@ 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::GROUP_VISITOR
and ($this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
or ($this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
//and $this->getUser('role') >= $this->getData(['page', $pageId, 'role'])
// Modification qui tient compte du profil de la page
@ -848,9 +848,9 @@ class common
// Ignore les pages dont l'utilisateur n'a pas accès
and (
(
$this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
$this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
and
$this->getData(['page', $parentId, 'role']) === self::GROUP_VISITOR
$this->getData(['page', $parentId, 'role']) === self::ROLE_VISITOR
)
or (
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
@ -1048,9 +1048,9 @@ class common
public function getPermission($key1, $key2 = null)
{
// Administrateur, toutes les permissions
if ($this->getUser('role') === self::GROUP_ADMIN) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
return true;
} elseif ($this->getUser('role') <= self::GROUP_VISITOR) { // Groupe sans autorisation
} elseif ($this->getUser('role') <= self::ROLE_VISITOR) { // Groupe sans autorisation
return false;
} elseif (
// Groupe avec profil, consultation des autorisations sur deux clés
@ -1625,10 +1625,10 @@ function makeThumb($src, $dest, $desired_width)
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
$filter = array();
switch ($this->getUser('role')) {
case self::GROUP_ADMIN:
case self::ROLE_ADMIN:
// Affiche tout
return $courses;
case self::GROUP_EDITOR:
case self::ROLE_EDITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces gérés par l'éditeur, les espaces où il participe et les espaces anonymes
if (
@ -1643,7 +1643,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::GROUP_MEMBER:
case self::ROLE_MEMBER:
foreach ($courses as $courseId => $value) {
// Affiche les espaces du participant et les espaces anonymes
if (
@ -1654,7 +1654,7 @@ function makeThumb($src, $dest, $desired_width)
}
}
return $filter;
case self::GROUP_VISITOR:
case self::ROLE_VISITOR:
foreach ($courses as $courseId => $value) {
// Affiche les espaces anonymes
if ($this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST) {

View File

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

View File

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

View File

@ -17,30 +17,30 @@ class course extends common
{
public static $actions = [
'swap' => self::GROUP_VISITOR,
'suscribe' => self::GROUP_VISITOR,
'unsuscribe' => self::GROUP_MEMBER,
'index' => self::GROUP_EDITOR, // Fait
'edit' => self::GROUP_EDITOR, // Fait
'manage' => self::GROUP_EDITOR, // Fait
'users' => self::GROUP_EDITOR, // fait
'usersAdd' => self::GROUP_EDITOR, //Fait
'usersDelete' => self::GROUP_EDITOR, //Fait
'usersReportExport' => self::GROUP_EDITOR, //fait
'userDelete' => self::GROUP_EDITOR, //Fait
'userReport' => self::GROUP_MEMBER, //Fait
'userReportExport' => self::GROUP_EDITOR, //Fait
'backup' => self::GROUP_EDITOR, // Fait
'restore' => self::GROUP_EDITOR, //Fait
'reset' => self::GROUP_EDITOR,
'clone' => self::GROUP_ADMIN,
'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'category' => self::GROUP_ADMIN,
'categoryAdd' => self::GROUP_ADMIN,
'categoryEdit' => self::GROUP_ADMIN,
'categoryDelete' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
'swap' => self::ROLE_VISITOR,
'suscribe' => self::ROLE_VISITOR,
'unsuscribe' => self::ROLE_MEMBER,
'index' => self::ROLE_EDITOR, // Fait
'edit' => self::ROLE_EDITOR, // Fait
'manage' => self::ROLE_EDITOR, // Fait
'users' => self::ROLE_EDITOR, // fait
'usersAdd' => self::ROLE_EDITOR, //Fait
'usersDelete' => self::ROLE_EDITOR, //Fait
'usersReportExport' => self::ROLE_EDITOR, //fait
'userDelete' => self::ROLE_EDITOR, //Fait
'userReport' => self::ROLE_MEMBER, //Fait
'userReportExport' => self::ROLE_EDITOR, //Fait
'backup' => self::ROLE_EDITOR, // Fait
'restore' => self::ROLE_EDITOR, //Fait
'reset' => self::ROLE_EDITOR,
'clone' => self::ROLE_ADMIN,
'add' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'category' => self::ROLE_ADMIN,
'categoryAdd' => self::ROLE_ADMIN,
'categoryEdit' => self::ROLE_ADMIN,
'categoryDelete' => self::ROLE_ADMIN,
'export' => self::ROLE_ADMIN,
];
public static $courseAccess = [
@ -156,7 +156,7 @@ class course extends common
// Accès limité aux admins
if (
$this->getUser('role') !== self::GROUP_ADMIN
$this->getUser('role') !== self::ROLE_ADMIN
) {
// Valeurs en sortie
$this->addOutput([
@ -2004,9 +2004,9 @@ class course extends common
public function permissionControl($function, $courseId)
{
switch ($this->getUser('role')) {
case self::GROUP_ADMIN:
case self::ROLE_ADMIN:
return true;
case self::GROUP_EDITOR:
case self::ROLE_EDITOR:
return (
$this->getUser('permission', __CLASS__, $function)
&& $this->getUser('role') === self::$actions[$function]
@ -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::GROUP_ADMIN ||
($this->getUser('role') === self::ROLE_ADMIN ||
$this->getUser('id') === $this->getData(['course', $courseId, 'author']))
) {
return true;
@ -2152,18 +2152,18 @@ class course extends common
$userId = $this->getUser('id');
$role = $userId ? $this->getData(['user', $userId, 'role']) : null;
switch ($role) {
case self::GROUP_ADMIN:
case self::ROLE_ADMIN:
$r = true;
break;
case self::GROUP_EDITOR:
case self::GROUP_MEMBER:
case self::ROLE_EDITOR:
case self::ROLE_MEMBER:
$r = false;
if (!is_null($this->getData(['enrolment', $courseId]))) {
$r = in_array($userId, array_keys($this->getData(['enrolment', $courseId])));
}
break;
// Visiteur non connecté
case self::GROUP_VISITOR:
case self::ROLE_VISITOR:
case null:
$r = $this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST;
break;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,12 +18,12 @@ class page extends common
{
public static $actions = [
'add' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_EDITOR,
'jsEditor' => self::GROUP_EDITOR,
'cssEditor' => self::GROUP_EDITOR,
'add' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'duplicate' => self::ROLE_EDITOR,
'jsEditor' => self::ROLE_EDITOR,
'cssEditor' => self::ROLE_EDITOR,
];
public static $pagesNoParentId = [
'' => 'Aucune'
@ -180,7 +180,7 @@ class page extends common
'parentPageId' => '',
'modulePosition' => 'bottom',
'position' => 0,
'role' => self::GROUP_VISITOR,
'role' => self::ROLE_VISITOR,
'targetBlank' => false,
'title' => $pageTitle,
'shortTitle' => $pageTitle,
@ -666,11 +666,11 @@ class page extends common
// Profils installés
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) {
if ($profilId < self::ROLE_MEMBER) {
continue;
}
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
continue;
}
foreach ($profilData as $key => $value) {

View File

@ -366,16 +366,16 @@
</div>
<div class="col6">
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, page::$userProfils[self::GROUP_MEMBER], [
id="pageEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_MEMBER, page::$userProfils[self::ROLE_MEMBER], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',
]); ?>
</div>
<div class="pageEditGroupProfil displayNone"
id="pageEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::GROUP_EDITOR, page::$userProfils[self::GROUP_EDITOR], [
id="pageEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('pageEditProfil' . self::ROLE_EDITOR, page::$userProfils[self::ROLE_EDITOR], [
'label' => 'Profil minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
'help' => 'Les profils de niveau supérieur accèdent à la page.',

View File

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

View File

@ -16,7 +16,7 @@
class sitemap extends common
{
public static $actions = [
'index' => self::GROUP_VISITOR
'index' => self::ROLE_VISITOR
];
public static $siteMap = '';

View File

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

View File

@ -17,23 +17,23 @@ class user extends common
{
public static $actions = [
'add' => self::GROUP_ADMIN,
'delete' => self::GROUP_ADMIN,
'usersDelete' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'index' => self::GROUP_ADMIN,
'template' => self::GROUP_ADMIN,
'edit' => self::GROUP_MEMBER,
'logout' => self::GROUP_MEMBER,
'forgot' => self::GROUP_VISITOR,
'login' => self::GROUP_VISITOR,
'auth' => self::GROUP_VISITOR,
'reset' => self::GROUP_VISITOR,
'profil' => self::GROUP_ADMIN,
'profilEdit' => self::GROUP_ADMIN,
'profilAdd' => self::GROUP_ADMIN,
'profilDelete' => self::GROUP_ADMIN,
'tag' => self::GROUP_ADMIN,
'add' => self::ROLE_ADMIN,
'delete' => self::ROLE_ADMIN,
'usersDelete' => self::ROLE_ADMIN,
'import' => self::ROLE_ADMIN,
'index' => self::ROLE_ADMIN,
'template' => self::ROLE_ADMIN,
'edit' => self::ROLE_MEMBER,
'logout' => self::ROLE_MEMBER,
'forgot' => self::ROLE_VISITOR,
'login' => self::ROLE_VISITOR,
'auth' => self::ROLE_VISITOR,
'reset' => self::ROLE_VISITOR,
'profil' => self::ROLE_ADMIN,
'profilEdit' => self::ROLE_ADMIN,
'profilAdd' => self::ROLE_ADMIN,
'profilDelete' => self::ROLE_ADMIN,
'tag' => self::ROLE_ADMIN,
];
public static $users = [];
@ -68,8 +68,8 @@ class user extends common
];
public static $roleProfils = [
self::GROUP_MEMBER => 'Membre',
self::GROUP_EDITOR => 'Éditeur'
self::ROLE_MEMBER => 'Membre',
self::ROLE_EDITOR => 'Éditeur'
];
public static $listModules = [];
@ -176,12 +176,12 @@ class user extends common
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) {
if ($profilId < self::ROLE_MEMBER) {
continue;
}
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment'];
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::ROLE_ADMIN] = $profilData['comment'];
continue;
}
foreach ($profilData as $key => $value) {
@ -209,7 +209,7 @@ class user extends common
// L'utilisateur n'existe pas
$this->getData(['user', $this->getUrl(2)]) === null
// Groupe insuffisant
and ($this->getUrl('role') < self::GROUP_EDITOR)
and ($this->getUrl('role') < self::ROLE_EDITOR)
) {
// Valeurs en sortie
$this->addOutput([
@ -411,10 +411,10 @@ class user extends common
and (
// Impossible de s'auto-éditer
($this->getUser('id') === $this->getUrl(2)
and $this->getUrl('role') <= self::GROUP_VISITOR
and $this->getUrl('role') <= self::ROLE_VISITOR
)
// Impossible d'éditer un autre utilisateur
or ($this->getUrl('role') < self::GROUP_EDITOR)
or ($this->getUrl('role') < self::ROLE_EDITOR)
)
) {
// Valeurs en sortie
@ -430,7 +430,7 @@ class user extends common
) {
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
// Double vérification pour le mot de passe
if ($this->getUser('role') < self::GROUP_ADMIN) {
if ($this->getUser('role') < self::ROLE_ADMIN) {
if ($this->getInput('userEditNewPassword')) {
// L'ancien mot de passe est correct
if (
@ -467,7 +467,7 @@ class user extends common
// Modification du groupe
if (
$this->getUser('role') === self::GROUP_ADMIN
$this->getUser('role') === self::ROLE_ADMIN
and $this->getUrl(2) !== $this->getUser('id')
) {
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
@ -475,7 +475,7 @@ class user extends common
$newGroup = $this->getData(['user', $this->getUrl(2), 'role']);
}
// Modification de nom Prénom
if ($this->getUser('role') === self::GROUP_ADMIN) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
$newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true);
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
} else {
@ -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::GROUP_ADMIN) {
elseif ($this->getUser('role') === self::ROLE_ADMIN) {
$redirect = helper::baseUrl() . 'user';
}
// Redirection normale
@ -542,12 +542,12 @@ class user extends common
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) {
if ($profilId < self::ROLE_MEMBER) {
continue;
}
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment'];
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::ROLE_ADMIN] = $profilData['comment'];
continue;
}
foreach ($profilData as $key => $value) {
@ -749,9 +749,9 @@ class user extends common
foreach ($this->getData(['profil']) as $roleId => $roleData) {
// Membres sans permissions spécifiques
if (
$roleId == self::GROUP_BANNED ||
$roleId == self::GROUP_VISITOR ||
$roleId == self::GROUP_ADMIN
$roleId == self::ROLE_BANNED ||
$roleId == self::ROLE_VISITOR ||
$roleId == self::ROLE_ADMIN
) {
self::$userGroups[$roleId] = [
$roleId,
@ -769,8 +769,8 @@ class user extends common
])
];
} elseif (
$roleId == self::GROUP_MEMBER ||
$roleId == self::GROUP_EDITOR
$roleId == self::ROLE_MEMBER ||
$roleId == self::ROLE_EDITOR
) {
// Enumérer les sous rôles MEMBER et MODERATOR
foreach ($roleData as $profilId => $profilData) {
@ -823,7 +823,7 @@ class user extends common
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
// Sécurité supplémentaire
if (
$role < self::GROUP_MEMBER
$role < self::ROLE_MEMBER
) {
$fileManager = false;
}
@ -1026,7 +1026,7 @@ class user extends common
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
// Sécurité supplémentaire
if (
$role < self::GROUP_MEMBER
$role < self::ROLE_MEMBER
) {
$fileManager = false;
}
@ -1308,7 +1308,7 @@ class user extends common
($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::GROUP_MEMBER
and $this->getData(['user', $userId, 'role']) >= self::ROLE_MEMBER
and $captcha === true
) {
@ -1322,7 +1322,7 @@ class user extends common
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
if (
$this->getData(['config', 'maintenance'])
and $this->getData(['user', $userId, 'role']) < self::GROUP_ADMIN
and $this->getData(['user', $userId, 'role']) < self::ROLE_ADMIN
) {
$this->addOutput([
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
@ -1678,7 +1678,7 @@ class user extends common
// Validation du groupe
$item['groupe'] = (int) $item['groupe'];
$item['profil'] = (int) $item['profil'];
$item['groupe'] = ($item['groupe'] >= self::GROUP_BANNED and $item['groupe'] <= self::GROUP_ADMIN)
$item['groupe'] = ($item['groupe'] >= self::ROLE_BANNED and $item['groupe'] <= self::ROLE_ADMIN)
? $item['groupe'] : 1;
// L'utilisateur existe
$userId = helper::filter($item['id'], helper::FILTER_ID);

View File

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

View File

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

View File

@ -239,7 +239,7 @@
</div>
</div>
</div>
<?php if ($this->getUrl(2) >= self::GROUP_EDITOR): ?>
<?php if ($this->getUrl(2) >= self::ROLE_EDITOR): ?>
<div class="row">
<div class="col12">
<div class="block">

View File

@ -23,21 +23,21 @@ class blog extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
const EDIT_OWNER = 'owner';
const EDIT_GROUP = 'role';
const EDIT_ROLE = 'role';
const EDIT_ALL = 'all';
public static $actions = [
'add' => self::GROUP_EDITOR,
'comment' => self::GROUP_EDITOR,
'commentApprove' => self::GROUP_EDITOR,
'commentDelete' => self::GROUP_EDITOR,
'commentDeleteAll' => self::GROUP_EDITOR,
'config' => self::GROUP_EDITOR,
'option' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR
'add' => self::ROLE_EDITOR,
'comment' => self::ROLE_EDITOR,
'commentApprove' => self::ROLE_EDITOR,
'commentDelete' => self::ROLE_EDITOR,
'commentDeleteAll' => self::ROLE_EDITOR,
'config' => self::ROLE_EDITOR,
'option' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR,
'rss' => self::ROLE_VISITOR
];
public static $articles = [];
@ -112,7 +112,7 @@ class blog extends common
// Permissions d'un article
public static $articleConsent = [
self::EDIT_ALL => 'Tous les rôles',
self::EDIT_GROUP => 'Rôle du propriétaire',
self::EDIT_ROLE => 'Rôle du propriétaire',
self::EDIT_OWNER => 'Propriétaire'
];
@ -259,7 +259,7 @@ class blog extends common
$this->isPost()
) {
// Modification de l'userId
if ($this->getUser('role') === self::GROUP_ADMIN) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
$newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true);
} else {
$newuserid = $this->getUser('id');
@ -284,7 +284,7 @@ class blog extends common
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
'userId' => $newuserid,
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogAddConsent'),
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_ROLE ? $this->getUser('role') : $this->getInput('blogAddConsent'),
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
@ -493,7 +493,7 @@ 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::GROUP_ADMIN)
or $this->getUser('role') === self::ROLE_ADMIN)
)
or (
@ -655,7 +655,7 @@ class blog extends common
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost()
) {
if ($this->getUser('role') === self::GROUP_ADMIN) {
if ($this->getUser('role') === self::ROLE_ADMIN) {
$newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true);
} else {
$newuserid = $this->getUser('id');
@ -683,7 +683,7 @@ class blog extends common
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
'userId' => $newuserid,
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogEditConsent'),
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_ROLE ? $this->getUser('role') : $this->getInput('blogEditConsent'),
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
@ -707,7 +707,7 @@ 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::GROUP_EDITOR) {
if ($this->getData(['user', $userId, 'role']) < self::ROLE_EDITOR) {
unset(self::$users[$userId]);
}
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$roleEdits[$this->getData(['user', $userId, 'role'])] . ')';

View File

@ -82,7 +82,7 @@
<?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
]); ?>
</div>
<div class="col4">

View File

@ -52,12 +52,12 @@
( // 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::GROUP_ADMIN)
or $this->getUser('role') === self::ROLE_ADMIN)
)
or (
// Rôle
($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)
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::ROLE_EDITOR)
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
)
or (

View File

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

View File

@ -77,12 +77,12 @@
( // 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::GROUP_ADMIN)
or $this->getUser('role') === self::ROLE_ADMIN)
)
or (
// Rôle
($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)
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::ROLE_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::ROLE_EDITOR)
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
)
or (

View File

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

1358
module/download/download.php Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,62 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Confirmation de suppression
*/
$(".downloadCommentDelete").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Supprimer le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation d'approbation
*/
$(".downloadCommentApproved").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Approuver le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation de rejet
*/
$(".downloadCommentRejected").on("click", function() {
var _this = $(this);
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
return core.confirm("Rejeter le commentaire de l'item " + nom + " ?", function() {
$(location).attr("href", _this.attr("href"));
});
});
/**
* Confirmation de suppression en masse
*/
$(".downloadCommentDeleteAll").on("click", function() {
var _this = $(this);
var nombre = "<?php echo count($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment' ])); ?>";
var nom = "<?php echo $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>";
if( nombre === "1"){
var message = "Supprimer le commentaire de l'item " + nom + " ?";
} else{
var message = "Supprimer les " + nombre + " commentaires de l'item " + nom + " ?";
}
return core.confirm(message, function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

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

View File

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

View File

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

View File

@ -0,0 +1,40 @@
<div class="row">
<div class="col1">
<?php echo template::button('downloadConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
'value' => template::ico('left')
]); ?>
</div>
<div class="col1 offset8">
<?php echo template::button('downloadConfigSetup', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/option',
'value' => template::ico('sliders'),
'help' => 'Options'
]); ?>
</div>
<div class="col1">
<?php echo template::button('downloadConfigCategories', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/categories',
'value' => template::ico('table'),
'help' => 'Catégories'
]); ?>
</div>
<div class="col1">
<?php echo template::button('downloadConfigAdd', [
'href' => helper::baseUrl() . $this->getUrl(0) . '/add',
'class' => 'buttonGreen',
'value' => template::ico('plus'),
'help' => 'Ajouter une ressource'
]); ?>
</div>
</div>
<?php if ($module::$items): ?>
<?php echo template::table([2, 2, 1, 2, 1, 1, 1, 1, 1], $module::$items, ['Titre', 'Catégorie ' . $module::$allCategories, 'Version', 'Du', 'Stats', 'État', 'Comm', '', '']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucune ressource'); ?>
<?php endif; ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
</div>

View File

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

View File

@ -0,0 +1,77 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
// Lien de connexion
$("#downloadEditMailNotification").on("change", function() {
if($(this).is(":checked")) {
$("#formConfigGroup").show();
}
else {
$("#formConfigGroup").hide();
}
}).trigger("change");
/**
* Soumission du formulaire pour enregistrer en brouillon
*/
$("#downloadEditDraft").on("click", function() {
$("#downloadEditState").val(0);
$("#downloadEditForm").trigger("submit");
});
/**
* Options de commentaires
*/
$("#downloadEditCommentClose").on("change", function() {
if ($(this).is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
});
$("#downloadEditCommentNotification").on("change", function() {
if ($(this).is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown();
} else {
$("#downloadEditCommentGroupNotification").slideUp();
}
});
$( document).ready(function() {
/** Gestion des commentaires */
if ($("#downloadEditCloseComment").is(':checked') ) {
$(".commentOptionsWrapper").slideUp();
} else {
$(".commentOptionsWrapper").slideDown();
}
if ($("#downloadEditCommentNotification").is(':checked') ) {
$("#downloadEditCommentGroupNotification").slideDown();
} else {
$("#downloadEditCommentGroupNotification").slideUp();
}
/**
* Paramétrage du sélecteur de date
* Supprimer les heures
const datepickr = flatpickr("#downloadEditversionDate", {});
datepickr.set (enableTime, false);
*/
});

View File

@ -0,0 +1,210 @@
<?php echo template::formOpen('downloadEditForm'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('downloadEditBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="col3 offset6">
<?php echo template::button('downloadEditDraft', [
'uniqueSubmission' => true,
'value' => 'Enregistrer en brouillon'
]); ?>
<?php echo template::hidden('downloadEditState', [
'value' => true
]); ?>
</div>
<div class="col2">
<?php echo template::submit('downloadEditSubmit', [
'value' => 'Publier'
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Informations sur la ressource</h4>
<div class="row">
<div class="col3">
<?php echo template::text('downloadEditTitle', [
'label' => 'Titre',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title'])
]); ?>
</div>>
<div class="col3">
<?php echo template::text('downloadEditId', [
'label' => 'Id Interne',
'value' => empty($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id']))
? $this->getUrl(2)
: $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id']),
]); ?>
<?php echo template::hidden('downloadEditIdOld', [
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'id'])
]);
?>
</div>>
<div class="col3">
<?php echo template::text('downloadEditVersion', [
'label' => 'Version',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'version'])
]); ?>
</div>
<div class="col3">
<?php echo template::date('downloadEditversionDate', [
'label' => 'Publiée le',
'type' => 'datetime-local',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'versionDate'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::text('downloadEditAuthor', [
'label' => 'Auteur',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'author'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('downloadEditLicense', $module::$licenses, [
'label' => 'Licence',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'license'])
]); ?>
</div>
<div class="col3">
<?php if ($module::$categories) {
echo template::select('downloadEditCategorie', $module::$categories, [
'label' => 'Catégorie',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'category'])
]);
} else {
echo template::select('downloadEditCategorie', ['' => ''], [
'label' => 'Pas de catégorie',
'disabled' => true
]);
}
?>
</div>
<div class="col3">
<?php echo template::file('downloadEditThumb', [
'label' => 'Capture d\'écran',
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'type' => 1,
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'thumb'])) : ''
]); ?>
</div>
</div>
<div class="row">
<div class="col3">
<?php echo template::select('downloadEditRessourceType', $module::$ressourceType, [
'label' => 'Type de ressource',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'ressourceType'])
]); ?>
</div>
<div class="col9">
<div class="row">
<div class="col12">
<?php echo template::file('downloadEditFile', [
'label' => 'Fichier',
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']),
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'file'])) : ''
]); ?>
</div>
<div class="col12">
<?php echo template::text('downloadEditUrl', [
'label' => 'URL',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'url']),
'placeholder' => 'https://'
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('downloadEditContent', [
'class' => 'editorWysiwyg',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Options de publication</h4>
<div class="row">
<div class="col4">
<?php echo template::select('downloadEditUserId', $module::$users, [
'label' => 'Auteur',
'selected' => $this->getUser('id'),
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN ? true : false
]); ?>
</div>
<div class="col4">
<?php echo template::date('downloadEditPublishedOn', [
'help' => 'L\'item n\'est visible qu\'après la date de publication prévue.',
'label' => 'Date de publication',
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']),
'type' => 'datetime-local'
]); ?>
</div>
<div class="col4">
<?php echo template::select('downloadEditConsent', $module::$itemConsent, [
'label' => 'Edition - Suppression',
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_ROLE : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'item sans restriction'
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Commentaires</h4>
<div class="row">
<div class="col4 ">
<?php echo template::checkbox('downloadEditCommentClose', true, 'Fermer les commentaires', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose'])
]); ?>
</div>
<div class="col4 commentOptionsWrapper ">
<?php echo template::checkbox('downloadEditCommentApproved', true, 'Approbation par un modérateur', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']),
''
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadEditCommentMaxlength', $module::$commentLength, [
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'item, mise en forme html comprise.',
'label' => 'Caractères par commentaire',
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
]); ?>
</div>
</div>
<div class="row">
<div class="col3 commentOptionsWrapper offset2">
<?php echo template::checkbox('downloadEditCommentNotification', true, 'Notification par email', [
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
]); ?>
</div>
<div class="col4 commentOptionsWrapper">
<?php echo template::select('downloadEditCommentGroupNotification', $module::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
]); ?>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>

View File

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

View File

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

View File

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

View File

@ -0,0 +1,50 @@
/**
* This file is part of Zwii.
*
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Incrémente les stats
*/
$('#downloadItemFile').click(function() {
$('#downloadStats').html(function(i, val) { return val*1+1 });
});
/**
* Affiche le bloc pour rédiger un commentaire
*/
var commentShowDOM = $("#downloadItemCommentShow");
commentShowDOM.on("click focus", function() {
$("#downloadItemCommentShowWrapper").fadeOut(function() {
$("#downloadItemCommentWrapper").fadeIn();
$("#downloadItemCommentContent").trigger("focus");
});
});
if($("#downloadItemCommentWrapper").find("textarea.notice,input.notice").length) {
commentShowDOM.trigger("click");
}
/**
* Cache le bloc pour rédiger un commentaire
*/
$("#downloadItemCommentHide").on("click focus", function() {
$("#downloadItemCommentWrapper").fadeOut(function() {
$("#downloadItemCommentShowWrapper").fadeIn();
$("#downloadItemCommentContent").val("");
$("#downloadItemCommentAuthor").val("");
});
});
/**
* Force le scroll vers les commentaires en cas d'erreur
*/
$("#downloadItemCommentForm").on("submit", function() {
$(location).attr("href", "#comment");
});

View File

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

View File

@ -0,0 +1 @@
<!-- rien -->

View File

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

View File

@ -0,0 +1,47 @@
<?php echo template::formOpen('downloadConfig'); ?>
<div class="row">
<div class="col1">
<?php echo template::button('downloadConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'value' => template::ico('left')
]); ?>
</div>
<div class="col2 offset9">
<?php echo template::submit('downloadConfigSubmit'); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Paramètres
</h4>
<div class="blockContainer">
<div class="row">
<div class="col4">
<?php echo template::checkbox('downloadConfigShowFeeds', true, 'Lien du flux RSS', [
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
]); ?>
</div>
<div class="col4">
<?php echo template::text('downloadConfigFeedslabel', [
'label' => 'Étiquette du flux',
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('blogConfigItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
</div>

View File

@ -0,0 +1 @@
<!-- rien -->

View File

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

View File

@ -0,0 +1,22 @@
/**
* 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
*/
$(".statsDeleteAll").on("click", function() {
var _this = $(this);
return core.confirm("Êtes-vous sûr de vouloir purger les statistiques ?", function() {
$(location).attr("href", _this.attr("href"));
});
});

View File

@ -0,0 +1,36 @@
<?php echo template::formOpen('statsConfig'); ?>
<div class="row">
<div class="col2">
<?php echo template::button('statsConfigBack', [
'class' => 'buttonGrey',
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
'ico' => 'left',
'value' => 'Retour'
]); ?>
</div>
<div class="col2 offset8">
<?php echo template::button('statsConfigAdd', [
'class' => 'statsDeleteAll buttonRed',
'href' => helper::baseUrl() . $this->getUrl(0) . '/statsDeleteAll' . '/' . $this->getUrl(2) . '/'. $_SESSION['csrf'] ,
'ico' => 'cancel',
'value' => 'Purger'
]); ?>
</div>
</div>
<?php echo template::formClose(); ?>
<div class="row">
<div class="col12">
<h3> Nombre de téléchargements :
<?php echo $module::$statSum; ?>
</h3>
</div>
</div>
<?php if($module::$items): ?>
<?php echo template::table([6, 6], $module::$items, ['Date', 'Adresse IP']); ?>
<?php echo $module::$pages; ?>
<?php else: ?>
<?php echo template::speech('Aucun item.'); ?>
<?php endif; ?>
<div class="moduleVersion">Version
<?php echo $module::VERSION; ?>
</div>

View File

@ -22,13 +22,13 @@ class form extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
'config' => self::GROUP_EDITOR,
'option' => self::GROUP_EDITOR,
'data' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'deleteall' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'export2csv' => self::GROUP_EDITOR,
'config' => self::ROLE_EDITOR,
'option' => self::ROLE_EDITOR,
'data' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'deleteall' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR,
'export2csv' => self::ROLE_EDITOR,
];
public static $data = [];

View File

@ -44,16 +44,16 @@ class gallery extends common
public static $config = [];
public static $actions = [
'config' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'dirs' => self::GROUP_EDITOR,
'sortGalleries' => self::GROUP_EDITOR,
'sortPictures' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'add' => self::GROUP_EDITOR,
'theme' => self::GROUP_EDITOR,
'option' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR
'config' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'dirs' => self::ROLE_EDITOR,
'sortGalleries' => self::ROLE_EDITOR,
'sortPictures' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'add' => self::ROLE_EDITOR,
'theme' => self::ROLE_EDITOR,
'option' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR
];
public static $sort = [

View File

@ -21,15 +21,15 @@ class news extends common
const DATADIRECTORY = self::DATA_DIR . 'news/';
public static $actions = [
'add' => self::GROUP_EDITOR,
'config' => self::GROUP_EDITOR,
'add' => self::ROLE_EDITOR,
'config' => self::ROLE_EDITOR,
// Edition des news
'option' => self::GROUP_EDITOR,
'option' => self::ROLE_EDITOR,
// paramétrage des news
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR,
'rss' => self::ROLE_VISITOR
];
public static $news = [];

View File

@ -42,7 +42,7 @@
$this->isConnected() === true
and
( // Propriétaire
($this->getUser('role') === self::GROUP_ADMIN)
($this->getUser('role') === self::ROLE_ADMIN)
)
): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>">

View File

@ -52,7 +52,7 @@
$this->isConnected() === true
and
( // Propriétaire
($this->getUser('role') === self::GROUP_ADMIN)
($this->getUser('role') === self::ROLE_ADMIN)
)
): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>">

View File

@ -21,8 +21,8 @@ class redirection extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
'config' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR
'config' => self::ROLE_EDITOR,
'index' => self::ROLE_VISITOR
];
@ -59,7 +59,7 @@ class redirection extends common
// Message si l'utilisateur peut éditer la page
if (
$this->isConnected() === true
&& $this->getUser('role') >= self::GROUP_EDITOR
&& $this->getUser('role') >= self::ROLE_EDITOR
&& $this->getUrl(1) !== 'force'
) {
// Valeurs en sortie

View File

@ -25,8 +25,8 @@ class search extends common
const DATADIRECTORY = self::DATA_DIR . 'search/';
public static $actions = [
'index' => self::GROUP_VISITOR,
'config' => self::GROUP_EDITOR
'index' => self::ROLE_VISITOR,
'config' => self::ROLE_EDITOR
];
// Variables pour l'affichage des résultats

View File

@ -19,12 +19,12 @@ class slider extends common
{
public static $actions = [
'config' => self::GROUP_MODERATOR,
'update' => self::GROUP_MODERATOR,
'theme' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'dirs' => self::GROUP_MODERATOR,
'index' => self::GROUP_VISITOR
'config' => self::ROLE_MODERATOR,
'update' => self::ROLE_MODERATOR,
'theme' => self::ROLE_MODERATOR,
'delete' => self::ROLE_MODERATOR,
'dirs' => self::ROLE_MODERATOR,
'index' => self::ROLE_VISITOR
];
const VERSION = '7.3';

View File

@ -33,12 +33,12 @@ class suscribe extends common
];
public static $actions = [
'index' => self::GROUP_VISITOR,
'validate' => self::GROUP_VISITOR,
'config' => self::GROUP_EDITOR,
'users' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR
'index' => self::ROLE_VISITOR,
'validate' => self::ROLE_VISITOR,
'config' => self::ROLE_EDITOR,
'users' => self::ROLE_EDITOR,
'delete' => self::ROLE_EDITOR,
'edit' => self::ROLE_EDITOR
];
public static $layout = [
@ -113,10 +113,10 @@ class suscribe extends common
// Impossible de s'auto-éditer
(
$this->getUser('id') === 'user'
and $this->getUrl('role') <= self::GROUP_VISITOR
and $this->getUrl('role') <= self::ROLE_VISITOR
)
// Impossible d'éditer un autre utilisateur
or ($this->getUrl('role') < self::GROUP_EDITOR)
or ($this->getUrl('role') < self::ROLE_EDITOR)
)
) {
// Valeurs en sortie
@ -140,7 +140,7 @@ class suscribe extends common
'forgot' => 0,
'role' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT),
// Le profil vaut 0 pour les amdins et 1 pour les autres membres, profil par défaut.
'profil' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT) === self::GROUP_ADMIN
'profil' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT) === self::ROLE_ADMIN
? 0 : 1,
'lastname' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'lastname']),
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'mail']),
@ -167,16 +167,16 @@ class suscribe extends common
}
// Changement temporaire de libellé du rôle 0
self::$roles = self::$roleEdits;
self::$roles[self::GROUP_BANNED] = 'En attente d\'approbation';
self::$roles[self::ROLE_BANNED] = 'En attente d\'approbation';
// Profils disponibles
foreach ($this->getData(['profil']) as $profilId => $profilData) {
if ($profilId < self::GROUP_MEMBER) {
if ($profilId < self::ROLE_MEMBER) {
continue;
}
if ($profilId === self::GROUP_ADMIN) {
self::$userProfils[$profilId][self::GROUP_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::GROUP_ADMIN] = $profilData['comment'];
if ($profilId === self::ROLE_ADMIN) {
self::$userProfils[$profilId][self::ROLE_ADMIN] = $profilData['name'];
self::$userProfilsComments[$profilId][self::ROLE_ADMIN] = $profilData['comment'];
continue;
}
foreach ($profilData as $key => $value) {
@ -314,7 +314,7 @@ class suscribe extends common
// Utilisateurs dans le rôle admin
$to = [];
foreach ($this->getData(['user']) as $key => $user) {
if ($user['role'] == self::GROUP_ADMIN) {
if ($user['role'] == self::ROLE_ADMIN) {
$to[] = $user['mail'];
}
}
@ -418,7 +418,7 @@ class suscribe extends common
'lastname' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'lastname']),
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'mail']),
'password' => $this->getInput('registrationValidPassword', helper::FILTER_PASSWORD, true),
'role' => self::GROUP_MEMBER,
'role' => self::ROLE_MEMBER,
'profil' => 1,
'forgot' => 0,
'pseudo' => $userId,

View File

@ -25,7 +25,7 @@
]); ?>
</div>
<div class="col4">
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
<?php if ($this->getUser('role') === self::ROLE_ADMIN): ?>
<?php echo template::select('registrationUserEditGroup', suscribe::$roles, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre role.' : ''),
@ -36,49 +36,49 @@
</div>
<div class="col4">
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, suscribe::$userProfils[self::GROUP_MEMBER], [
id="registrationUserEditGroupProfil<?php echo self::ROLE_MEMBER; ?>">
<?php echo template::select('registrationUserEditProfil' . self::ROLE_MEMBER, suscribe::$userProfils[self::ROLE_MEMBER], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN,
]); ?>
</div>
<div class="registrationUserEditGroupProfil"
id="registrationUserEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, suscribe::$userProfils[self::GROUP_EDITOR], [
id="registrationUserEditGroupProfil<?php echo self::ROLE_EDITOR; ?>">
<?php echo template::select('registrationUserEditProfil' . self::ROLE_EDITOR, suscribe::$userProfils[self::ROLE_EDITOR], [
'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
'disabled' => $this->getUser('role') !== self::ROLE_ADMIN,
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div id="registrationUserCommentProfil<?php echo self::GROUP_MEMBER; ?>"
<div id="registrationUserCommentProfil<?php echo self::ROLE_MEMBER; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_MEMBER, [
<?php echo template::textarea('registrationUserEditProfilComment' . self::ROLE_MEMBER, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_MEMBER]),
'value' => implode("\n", suscribe::$userProfilsComments[self::ROLE_MEMBER]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_EDITOR; ?>"
<div id="registrationUserCommentProfil<?php echo self::ROLE_EDITOR; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_EDITOR, [
<?php echo template::textarea('registrationUserEditProfilComment' . self::ROLE_EDITOR, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_EDITOR]),
'value' => implode("\n", suscribe::$userProfilsComments[self::ROLE_EDITOR]),
'readonly' => true,
]);
?>
</div>
<div id="registrationUserCommentProfil<?php echo self::GROUP_ADMIN; ?>"
<div id="registrationUserCommentProfil<?php echo self::ROLE_ADMIN; ?>"
class="col12 registrationUserCommentProfil">
<?php echo template::textarea('registrationUserEditProfilComment' . self::GROUP_ADMIN, [
<?php echo template::textarea('registrationUserEditProfilComment' . self::ROLE_ADMIN, [
'label' => 'Commentaire',
'value' => implode("\n", suscribe::$userProfilsComments[self::GROUP_ADMIN]),
'value' => implode("\n", suscribe::$userProfilsComments[self::ROLE_ADMIN]),
'readonly' => true,
]);
?>

View File

@ -20,8 +20,8 @@ class workshop extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
'config' => self::GROUP_ADMIN,
'index' => self::GROUP_VISITOR
'config' => self::ROLE_ADMIN,
'index' => self::ROLE_VISITOR
];
public static $courseCategories = [