Compare commits
275 Commits
Author | SHA1 | Date | |
---|---|---|---|
1f91f501d5 | |||
62d4954572 | |||
b0b5c9292b | |||
b0799c0f7b | |||
05a85c0e4c | |||
9a5d9870c4 | |||
c62f182b16 | |||
1b9027a24a | |||
234bf9d6bc | |||
72c791045d | |||
61e3cb6443 | |||
239fa36b47 | |||
d76beebd2d | |||
0848df4edc | |||
8a09d7c187 | |||
4a91e286dd | |||
c9f1789694 | |||
301ed4cf22 | |||
831d01987d | |||
a2bb3a51a7 | |||
d3e5547461 | |||
bc6cc75202 | |||
71fe3ee650 | |||
ccb7efdd8c | |||
8c5b6169cc | |||
697b94c608 | |||
73e07e92fa | |||
6b7679c997 | |||
e151f66b6e | |||
38b637361b | |||
90a669ac65 | |||
1dcadc41e5 | |||
90fee81365 | |||
eceed6b233 | |||
07e390d818 | |||
cbc7a1ad19 | |||
e7e0fef37e | |||
d0f14f0e60 | |||
cca646b1be | |||
6db9837238 | |||
ca313a2b18 | |||
547dea7350 | |||
9d6e229e0a | |||
22d69ccafb | |||
5e59984211 | |||
0301e1f31d | |||
1f0d490688 | |||
288393778a | |||
7773bc916f | |||
5ebbcfcb9d | |||
f237d0bca1 | |||
70fa6efee7 | |||
30ed4349d9 | |||
ad998c17d1 | |||
4d6b6f8d4f | |||
dd3582b9db | |||
0e26e71a50 | |||
9a56fc9572 | |||
ac8689b40a | |||
0f9a79411d | |||
b944a3bac7 | |||
4bab81c541 | |||
2f3dd5926b | |||
959139b239 | |||
e958287b9e | |||
e110e7b4f9 | |||
61ec8c04be | |||
f0ccf8eb2f | |||
b831275901 | |||
5217763afb | |||
6d19f6ebad | |||
ed2b2c2826 | |||
91e18a9408 | |||
9ae150f3aa | |||
88acbae810 | |||
162bb9a78d | |||
81a996c714 | |||
2e9cfaa991 | |||
f2df3743c6 | |||
83943c6b52 | |||
0c975d8f42 | |||
1b91289320 | |||
d9c57d2090 | |||
ddc590bd69 | |||
883e80cf0d | |||
2fcc01705b | |||
ac45c7e2f2 | |||
2a8d5af713 | |||
012300a061 | |||
c5d26ad9c2 | |||
309de4c823 | |||
cfdd9d11ea | |||
17f6a606c6 | |||
b95d341dfa | |||
9356a75946 | |||
845afe7dbb | |||
8bfcb0163a | |||
057b5f7dd8 | |||
![]() |
549f752aea | ||
![]() |
07d57d83ac | ||
![]() |
85f6c43d79 | ||
![]() |
8a07bf69a7 | ||
![]() |
978bfb2cdc | ||
![]() |
b297e2072d | ||
![]() |
018b3ebc5e | ||
![]() |
b74f0a8949 | ||
![]() |
d12d7b6ddb | ||
![]() |
1a746acfec | ||
![]() |
b147f44776 | ||
![]() |
9b92e29a96 | ||
![]() |
6104123582 | ||
![]() |
3736c2ebc9 | ||
384dc2503b | |||
b5ba4e755b | |||
![]() |
2a44e130f5 | ||
![]() |
65c9aa167d | ||
![]() |
fb06720a00 | ||
![]() |
23187d463f | ||
![]() |
aa9c231327 | ||
![]() |
3b661fa9e2 | ||
1899d2f260 | |||
46fd26c5c8 | |||
58b4ca15c6 | |||
b85a0bfa78 | |||
0e42a15ae1 | |||
d00770967e | |||
ff5edbc47c | |||
b50842b331 | |||
be01fa9414 | |||
73229b4726 | |||
926e8ea45c | |||
91bb26667f | |||
13f7203054 | |||
ed3779b6a0 | |||
c157ae9f41 | |||
27ec459730 | |||
dcb1ee360d | |||
cdc5293580 | |||
dfdda38b1c | |||
9bf614fcc5 | |||
9dba1b8e79 | |||
124aeeeb98 | |||
7d8d0d7a18 | |||
ab89016836 | |||
f172eb4961 | |||
276950b117 | |||
0c8c9f89fd | |||
1debefc9ab | |||
b93e08e9a4 | |||
c13aa495f0 | |||
e6d044d0e1 | |||
e596f5eef6 | |||
db2b6bc518 | |||
130b88ace1 | |||
9df1fe8be2 | |||
0f71d820c5 | |||
a8891b310f | |||
59de6bc32f | |||
3a25c33e3a | |||
eff57bf0ab | |||
20c09d8b0a | |||
a634445dde | |||
4c88d7a71d | |||
bb9b8b086f | |||
61752a9a51 | |||
889e2754fc | |||
77b241c69f | |||
442b84a99d | |||
09f9f6bdd6 | |||
5eace20e26 | |||
18df3848f8 | |||
7b9d145533 | |||
75ad5853cf | |||
7862815f1f | |||
a87d439282 | |||
509c1d6365 | |||
e641ec1c03 | |||
3dec8a8ce5 | |||
54f0b0c6e3 | |||
931e59db2e | |||
cae0e6c8fb | |||
afee77b1e7 | |||
cf8963248e | |||
22af8ac751 | |||
2d4385f038 | |||
c4bb124bea | |||
a474a41402 | |||
e9f65a1e22 | |||
8183b0bb0b | |||
585c888007 | |||
d0997ccbf9 | |||
1a6bfab54b | |||
23f38a606f | |||
f1e1989c97 | |||
9bb5793720 | |||
64443322a0 | |||
76258c835f | |||
dc81614114 | |||
8dc1adc28a | |||
65eac4ac4a | |||
a8f70dc73a | |||
02aeb6ec22 | |||
5bdb38dfec | |||
5700200bc3 | |||
4ffca0e34a | |||
f4553110e1 | |||
bf3b1f9cb0 | |||
05d8ae9e0b | |||
6128d0778d | |||
c38bd7d12f | |||
cd509dfcb1 | |||
5ab8efe72e | |||
6cf6a8d6b2 | |||
daaf309b4d | |||
2d5c395aec | |||
5d5b1e3140 | |||
8aa24e50ab | |||
8574970bb0 | |||
89e6e12748 | |||
9234b76062 | |||
08c1619162 | |||
576f349b4a | |||
be6eaa748e | |||
1dc7b08d2e | |||
35521766cd | |||
c8ee063963 | |||
f0aba44ddb | |||
e6236e5de2 | |||
e5629de660 | |||
92d3da27a3 | |||
1fd0c5492f | |||
bab06033ed | |||
f7cf0f94fc | |||
c244651b62 | |||
beb58da3bd | |||
8756162428 | |||
511a6ff0bb | |||
4175ff828d | |||
087b5d9999 | |||
fea1c40a4b | |||
2dce24f9f2 | |||
0e0fd23913 | |||
0eab6c9049 | |||
ca7ce4e857 | |||
510afbe8f1 | |||
c89a64ca7f | |||
9280d59aac | |||
3accdc135b | |||
3d31ce5e55 | |||
8c60eba918 | |||
b182c2ec90 | |||
523f30027a | |||
f9faaa651e | |||
1aca92b1c7 | |||
4444c58902 | |||
75dbae7cc6 | |||
79e0ac2a38 | |||
1cb4b191bf | |||
485392e772 | |||
9c5f6448b1 | |||
b78e52c5d4 | |||
e687f26d2d | |||
769808ca4e | |||
5ba20aec09 | |||
5c0efda0ca | |||
b6d3eb8ec2 | |||
30df948d81 | |||
15430af1d6 | |||
2aae298d7d | |||
adeaeb624b | |||
d98e235dfc | |||
ef5de018b0 | |||
c024340af7 | |||
6a964938bc | |||
f024a960e4 |
12
README.md
12
README.md
@ -1,7 +1,17 @@
|
||||
# ZwiiCampus 1.10.08
|
||||
# ZwiiCampus 1.21.03
|
||||
|
||||
ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.
|
||||
|
||||
Ce logiciel s'installe en ligne ou localement depuis un serveur Web.
|
||||
|
||||
## Principales fonctionnalités :
|
||||
- Gestion des espaces d'enseignement : Créez des espaces de formation avec accès restreint.
|
||||
- Participation et suivi des apprenants : Inscription libre, imposée ou avec clé, et suivi statistique détaillé des participants.
|
||||
- Gestion des accès : Contrôlez la disponibilité des espaces (ouvert, limité dans le temps, fermé).
|
||||
- Outils statistiques : Visualisation et exportation CSV des progrès des apprenants.
|
||||
- Facilité d'installation : Pas besoin de base de données, tout fonctionne avec des fichiers JSON.
|
||||
- Sauvegarde et restauration : Outils de gestion pour réinitialiser les espaces et les participations.
|
||||
|
||||
|
||||
## Configuration recommandée
|
||||
|
||||
|
@ -35,12 +35,12 @@ class helper
|
||||
|
||||
// La traduction existe déjà dans le core
|
||||
/*
|
||||
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
||||
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
||||
$data = array_merge($dialogues,[$text => '']);
|
||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
}
|
||||
*/
|
||||
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
||||
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
||||
$data = array_merge($dialogues,[$text => '']);
|
||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
}
|
||||
*/
|
||||
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
||||
}
|
||||
|
||||
@ -197,14 +197,20 @@ class helper
|
||||
|
||||
public static function autoBackup($folder, $filter = ['backup', 'tmp'])
|
||||
{
|
||||
// Creation du ZIP
|
||||
// Création du nom de fichier ZIP
|
||||
$baseName = str_replace('/', '', helper::baseUrl(false, false));
|
||||
$baseName = empty($baseName) ? 'ZwiiCMS' : $baseName;
|
||||
$fileName = $baseName . '-backup-' . date('Y-m-d-H-i-s', time()) . '.zip';
|
||||
$fileName = $baseName . '-backup-' . date('Y-m-d-H-i-s') . '.zip';
|
||||
|
||||
// Initialisation de l'archive ZIP
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($folder . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
if ($zip->open($folder . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE) !== true) {
|
||||
return false; // Retourne false si l'ouverture échoue
|
||||
}
|
||||
|
||||
$directory = 'site/';
|
||||
//$filter = array('backup','tmp','file');
|
||||
|
||||
// Récupération des fichiers et des dossiers
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveCallbackFilterIterator(
|
||||
new RecursiveDirectoryIterator(
|
||||
@ -212,21 +218,26 @@ class helper
|
||||
RecursiveDirectoryIterator::SKIP_DOTS
|
||||
),
|
||||
function ($fileInfo, $key, $iterator) use ($filter) {
|
||||
return $fileInfo->isFile() || !in_array($fileInfo->getBaseName(), $filter);
|
||||
// Inclure les fichiers ou les répertoires non filtrés
|
||||
return $fileInfo->isFile() || ($fileInfo->isDir() && !in_array($fileInfo->getBaseName(), $filter));
|
||||
}
|
||||
)
|
||||
);
|
||||
foreach ($files as $name => $file) {
|
||||
|
||||
// Ajout des fichiers à l'archive
|
||||
foreach ($files as $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen(realpath($directory)) + 1);
|
||||
$relativePath = str_replace(DIRECTORY_SEPARATOR, '/', substr($filePath, strlen(realpath($directory)) + 1));
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
return ($fileName);
|
||||
}
|
||||
|
||||
// Fermeture de l'archive ZIP
|
||||
$zip->close();
|
||||
|
||||
return $fileName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -343,7 +354,7 @@ class helper
|
||||
public static function checkRewrite()
|
||||
{
|
||||
// N'interroge que le serveur Apache
|
||||
if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') > 0) {
|
||||
if ((helper::checkServerSoftware() === false)) {
|
||||
self::$rewriteStatus = false;
|
||||
} else {
|
||||
// Ouvre et scinde le fichier .htaccess
|
||||
@ -354,6 +365,14 @@ class helper
|
||||
return self::$rewriteStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne vrai ou faux selon que le serveur est comptatible avec htaccess
|
||||
* @return bool
|
||||
*/
|
||||
public static function checkServerSoftware() {
|
||||
return (stripos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || stripos($_SERVER['SERVER_SOFTWARE'], 'LiteSpeed') !== false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie le numéro de version de Zwii est en ligne
|
||||
* @return string
|
||||
@ -408,8 +427,8 @@ class helper
|
||||
*/
|
||||
public static function deleteCookie($cookieKey)
|
||||
{
|
||||
unset($_COOKIE[$cookieKey]);
|
||||
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
||||
unset($_COOKIE[$cookieKey]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -673,10 +692,30 @@ class helper
|
||||
public static function subword($text, $start, $length)
|
||||
{
|
||||
$text = trim($text);
|
||||
if (strlen($text) > $length) {
|
||||
|
||||
// Vérifier si la longueur du texte sans les balises dépasse la longueur souhaitée
|
||||
if (mb_strlen(strip_tags($text)) > $length) {
|
||||
// Utiliser mb_substr pour couper le texte
|
||||
$text = mb_substr($text, $start, $length);
|
||||
$text = mb_substr($text, 0, min(mb_strlen($text), mb_strrpos($text, ' ')));
|
||||
|
||||
// S'assurer que le texte ne se termine pas au milieu d'un mot
|
||||
$lastSpace = mb_strrpos($text, ' ');
|
||||
if ($lastSpace !== false) {
|
||||
$text = mb_substr($text, 0, $lastSpace);
|
||||
}
|
||||
|
||||
// Fermer les balises HTML ouvertes
|
||||
$dom = new DOMDocument();
|
||||
@$dom->loadHTML('<div>' . $text . '</div>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
$text = $dom->saveHTML();
|
||||
|
||||
// Retirer la balise de conteneur ajoutée
|
||||
$text = preg_replace('~^<div>(.*)</div>$~s', '$1', $text);
|
||||
|
||||
// Ajouter des points de suspension si le texte a été coupé
|
||||
$text .= '...';
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*
|
||||
* @param array|null $data Data
|
||||
*/
|
||||
public function __construct(array $data = null)
|
||||
public function __construct(?array $data = null)
|
||||
{
|
||||
if (is_array($data)) {
|
||||
$this->data = $data;
|
||||
@ -101,7 +101,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
}
|
||||
} else {
|
||||
// Iterate path
|
||||
$keys = explode('.', (string) $key);
|
||||
$keys = explode('.', (string)$key);
|
||||
if ($pop === true) {
|
||||
array_pop($keys);
|
||||
}
|
||||
@ -199,7 +199,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function has($key)
|
||||
{
|
||||
$keys = explode('.', (string) $key);
|
||||
$keys = explode('.', (string)$key);
|
||||
$data = &$this->data;
|
||||
foreach ($keys as $key) {
|
||||
if (!isset($data[$key])) {
|
||||
@ -371,7 +371,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return !(bool) count($this->data);
|
||||
return !(bool)count($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -391,7 +391,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
*/
|
||||
public function toJson()
|
||||
{
|
||||
return json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
|
||||
return json_encode($this->data, JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Andrey Mistulov
|
||||
@ -18,6 +19,10 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
protected $db = '';
|
||||
protected $data = null;
|
||||
protected $config = [];
|
||||
// Tentative d'écriture après échec
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
// Délais entre deux tentaives
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
@ -108,72 +113,97 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
|
||||
|
||||
/**
|
||||
* Local database upload
|
||||
* @param bool $reload Reboot data?
|
||||
* @return array|mixed|null
|
||||
* Charge les données depuis un fichier JSON.
|
||||
*
|
||||
* @param bool $reload Force le rechargement des données si true
|
||||
*
|
||||
* @return array|null Les données chargées ou null si le fichier n'existe pas
|
||||
*
|
||||
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
|
||||
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
|
||||
*/
|
||||
protected function loadData($reload = false)
|
||||
protected function loadData($reload = false): ?array
|
||||
{
|
||||
if ($this->data === null || $reload) {
|
||||
$this->db = $this->config['dir'] . $this->config['name'];
|
||||
|
||||
if (!file_exists($this->db)) {
|
||||
return null; // Rebuild database manage by CMS
|
||||
} else {
|
||||
if ($this->config['backup']) {
|
||||
try {
|
||||
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
|
||||
} catch (\Exception $e) {
|
||||
error_log('Erreur de chargement : ' . $e);
|
||||
exit('Erreur de chargement : ' . $e);
|
||||
return null; // Rebuild database managed by CMS
|
||||
}
|
||||
|
||||
if ($this->config['backup']) {
|
||||
$backup_path = $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup';
|
||||
|
||||
try {
|
||||
if (!copy($this->db, $backup_path)) {
|
||||
throw new \RuntimeException('Échec de la création de la sauvegarde');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw new \RuntimeException('Erreur de sauvegarde : ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
$this->data = json_decode(file_get_contents($this->db), true);
|
||||
if (!$this->data === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw new \InvalidArgumentException('Le fichier ' . $this->db
|
||||
. ' contient des données invalides.');
|
||||
|
||||
$file_contents = file_get_contents($this->db);
|
||||
|
||||
$this->data = json_decode($file_contents, true);
|
||||
|
||||
if ($this->data === null) {
|
||||
throw new \InvalidArgumentException('Le fichier ' . $this->db . ' contient des données invalides.');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save database
|
||||
* Charge les données depuis un fichier JSON.
|
||||
*
|
||||
* @param bool $reload Force le rechargement des données si true
|
||||
*
|
||||
* @return array|null Les données chargées ou null si le fichier n'existe pas
|
||||
*
|
||||
* @throws \RuntimeException En cas d'erreur lors de la création de la sauvegarde
|
||||
* @throws \InvalidArgumentException Si le fichier contient des données JSON invalides
|
||||
*/
|
||||
public function save()
|
||||
public function save(): void
|
||||
{
|
||||
// Encode les données au format JSON avec les options spécifiées
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
|
||||
if ($this->data === null) {
|
||||
throw new \RuntimeException('Tentative de sauvegarde de données nulles');
|
||||
}
|
||||
|
||||
try {
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_THROW_ON_ERROR);
|
||||
} catch (\JsonException $e) {
|
||||
throw new \RuntimeException('Erreur d\'encodage JSON : ' . $e->getMessage());
|
||||
}
|
||||
|
||||
// Vérifie la longueur de la chaîne JSON encodée
|
||||
$encoded_length = strlen($encoded_data);
|
||||
$max_attempts = 5;
|
||||
|
||||
// Initialise le compteur de tentatives
|
||||
$attempt = 0;
|
||||
for ($attempt = 0; $attempt < $max_attempts; $attempt++) {
|
||||
$temp_file = $this->db . '.tmp' . uniqid();
|
||||
|
||||
// Tente d'encoder les données en JSON et de les sauvegarder jusqu'à 5 fois en cas d'échec
|
||||
while ($attempt < 5) {
|
||||
// Essaye d'écrire les données encodées dans le fichier de base de données
|
||||
$write_result = file_put_contents($this->db, $encoded_data, LOCK_EX); // Les utilisateurs multiples obtiennent un verrou
|
||||
try {
|
||||
$write_result = file_put_contents($temp_file, $encoded_data, LOCK_EX);
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result === $encoded_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
break;
|
||||
if ($write_result === $encoded_length) {
|
||||
if (rename($temp_file, $this->db)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
error_log("Échec sauvegarde : longueur incorrecte ou renommage échoué (tentative " . ($attempt + 1) . ")");
|
||||
} catch (\Exception $e) {
|
||||
error_log('Erreur de sauvegarde : ' . $e->getMessage());
|
||||
|
||||
if (file_exists($temp_file)) {
|
||||
unlink($temp_file);
|
||||
}
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempt++;
|
||||
usleep(pow(2, $attempt) * 250000);
|
||||
}
|
||||
|
||||
// Vérifie si l'écriture a échoué même après plusieurs tentatives
|
||||
if ($write_result !== $encoded_length) {
|
||||
// Enregistre un message d'erreur dans le journal des erreurs
|
||||
error_log('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
|
||||
// Affiche un message d'erreur et termine le script
|
||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
}
|
||||
throw new \RuntimeException('Échec de sauvegarde après ' . $max_attempts . ' tentatives');
|
||||
}
|
||||
|
||||
}
|
@ -82,17 +82,25 @@ class layout extends common
|
||||
$content = 'col' . $blocks[1];
|
||||
$blockright = 'col' . $blocks[2];
|
||||
}
|
||||
// Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
||||
$pattern = ['config', 'edit', 'add', 'comment', 'data'];
|
||||
// Toujours en pleine page pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
||||
$pattern = ['config', 'edit', 'add', 'comment', 'data', 'option', 'theme', 'comment', 'article', 'data', 'gallery', 'update', 'users', 'validate'];
|
||||
if (
|
||||
(sizeof($blocks) === 1 ||
|
||||
in_array($this->getUrl(1), $pattern))
|
||||
) { // Pleine page en mode configuration
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') {
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top'
|
||||
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
$this->showNavButtons('top');
|
||||
}
|
||||
$this->showContent();
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') {
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom'
|
||||
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
$this->showNavButtons('bottom');
|
||||
}
|
||||
} else {
|
||||
@ -330,7 +338,7 @@ class layout extends common
|
||||
// Affichage du lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'footer', 'loginLink'])
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -345,7 +353,7 @@ class layout extends common
|
||||
}
|
||||
// Affichage de la barre de membre simple
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN
|
||||
$this->getUser('role') >= self::ROLE_MEMBER && $this->getUser('role') < self::ROLE_ADMIN
|
||||
&& $this->getData(['theme', 'footer', 'memberBar']) === true
|
||||
) {
|
||||
$items .= '<span id="footerDisplayMemberAccount"';
|
||||
@ -353,10 +361,11 @@ class layout extends common
|
||||
$items .= '<wbr> | ';
|
||||
if (
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
) {
|
||||
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
|
||||
$items .= '<wbr>' . template::ico('folder', [
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent,
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . $folder,
|
||||
'margin' => 'all',
|
||||
'attr' => 'data-lity',
|
||||
'help' => 'Fichiers du site'
|
||||
@ -486,9 +495,11 @@ class layout extends common
|
||||
*/
|
||||
public function showMenu()
|
||||
{
|
||||
// Met en forme les items du menu
|
||||
$itemsLeft = $this->formatMenu(false);
|
||||
|
||||
// Met en forme les items du menu si affiché
|
||||
$itemsLeft = '';
|
||||
if ($this->getData(['theme', 'menu', 'hidePages']) === false) {
|
||||
$itemsLeft = $this->formatMenu();
|
||||
}
|
||||
// Menu extra
|
||||
$itemsRight = $this->formatMenu(true);
|
||||
|
||||
@ -497,7 +508,7 @@ class layout extends common
|
||||
* Affichage du sélecteur d'espaces
|
||||
*/
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
$this->getUser('role') === self::ROLE_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||
) {
|
||||
if ($this->getCoursesByProfil()) {
|
||||
@ -510,20 +521,62 @@ class layout extends common
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affiche le bouton d'affichage des rapports individuels de consultation
|
||||
*/
|
||||
|
||||
if (
|
||||
$this->getData(['theme', 'menu', 'userReport']) === true
|
||||
&& self::$siteContent !== 'home'
|
||||
// Pas de statistiques pour les espaces ouverts
|
||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
|
||||
) {
|
||||
$href = '';
|
||||
switch ($this->getUser('role')) {
|
||||
case self::ROLE_MEMBER:
|
||||
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
|
||||
break;
|
||||
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
|
||||
||
|
||||
($this->getData(['enrolment', self::$siteContent])
|
||||
&& $this->getUser('permission', __CLASS__, 'tutor') === true
|
||||
&& array_key_exists($this->getUser('id'), $this->getData(['enrolment', self::$siteContent])))
|
||||
) {
|
||||
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
|
||||
}
|
||||
break;
|
||||
case self::ROLE_ADMIN:
|
||||
$href = helper::baseUrl() . 'course/users/' . self::$siteContent;
|
||||
}
|
||||
if ($href) {
|
||||
$itemsRight .= '<li>' . template::ico('chart-line', [
|
||||
'help' => 'Rapport des consultations',
|
||||
'margin' => 'all',
|
||||
'href' => $href
|
||||
]) . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||
*/
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
$this->getUser('role') === self::ROLE_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||
) {
|
||||
|
||||
// Affiche l'icône RFM
|
||||
if ($this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none') {
|
||||
if (
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
) {
|
||||
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
|
||||
$itemsRight .= '<li>' . template::ico('folder', [
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent,
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . $folder,
|
||||
'attr' => 'data-lity',
|
||||
'help' => 'Fichiers du site'
|
||||
]) . '</li>';
|
||||
@ -547,7 +600,7 @@ class layout extends common
|
||||
// Lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'menu', 'loginLink'])
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -560,8 +613,7 @@ class layout extends common
|
||||
}
|
||||
|
||||
// Retourne les items du menu
|
||||
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight;
|
||||
echo '</ul>';
|
||||
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight . '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -573,6 +625,7 @@ class layout extends common
|
||||
{
|
||||
$items = '';
|
||||
$currentPageId = $this->getData(['page', $this->getUrl(0)]) ? $this->getUrl(0) : $this->getUrl(2);
|
||||
|
||||
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||
// Menu extra ou standard
|
||||
|
||||
@ -592,10 +645,10 @@ class layout extends common
|
||||
|
||||
if (
|
||||
($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') < self::ROLE_EDITOR
|
||||
)
|
||||
) {
|
||||
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||
@ -658,10 +711,10 @@ class layout extends common
|
||||
$items .= '<li id=' . $childKey . '>';
|
||||
if (
|
||||
($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') < self::ROLE_EDITOR
|
||||
)
|
||||
) {
|
||||
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||
@ -754,7 +807,7 @@ class layout extends common
|
||||
$items .= '<li class="menuSideChild">';
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) {
|
||||
$items .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -778,7 +831,7 @@ class layout extends common
|
||||
|
||||
if (
|
||||
$this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) {
|
||||
$itemsChildren .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -914,7 +967,7 @@ class layout extends common
|
||||
*/
|
||||
public function showBar()
|
||||
{
|
||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
if ($this->isConnected() === true) {
|
||||
// Items de gauche
|
||||
$leftItems = '';
|
||||
// Sélecteur de contenu
|
||||
@ -922,7 +975,7 @@ class layout extends common
|
||||
* Les admins voient tous les contenus
|
||||
* Les enseignants les contenus dont ils sont auteurs
|
||||
*/
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if ($this->getUser('role') >= self::ROLE_EDITOR) {
|
||||
if (is_array($this->getCoursesByProfil())) {
|
||||
$leftItems .= '<li><select id="barSelectCourse" >';
|
||||
$leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
|
||||
@ -937,7 +990,7 @@ class layout extends common
|
||||
'help' => 'Gérer les espaces'
|
||||
]) . '</li>';
|
||||
}
|
||||
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
if ($this->getUser('role') >= self::ROLE_ADMIN) {
|
||||
$leftItems .= '<li>' . template::ico('brush', [
|
||||
'help' => 'Thème',
|
||||
'href' => helper::baseUrl() . 'theme'
|
||||
@ -945,8 +998,8 @@ class layout extends common
|
||||
}
|
||||
// Liste des pages et bouton de gestion interdit pour l'accueil sauf admin
|
||||
if (
|
||||
($this->getUser('group') === self::GROUP_EDITOR && self::$siteContent != 'home')
|
||||
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||
($this->getUser('role') === self::ROLE_EDITOR && self::$siteContent != 'home')
|
||||
|| $this->getUser('role') === self::ROLE_ADMIN
|
||||
) {
|
||||
$leftItems .= '<li><select id="barSelectPage">';
|
||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||
@ -1011,95 +1064,93 @@ class layout extends common
|
||||
// Sur une page sans module
|
||||
or $this->getData(['page', $this->getUrl(0), 'moduleId']) === ''
|
||||
// Sur une page avec un module invalide
|
||||
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) &&
|
||||
!class_exists($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
or (empty($this->getData(['page', $this->getUrl(0), 'moduleId'])) === false
|
||||
and class_exists($this->getData(['page', $this->getUrl(0), 'moduleId'])) === false
|
||||
)
|
||||
// Sur une page d'accueil
|
||||
or $this->getUrl(0) === ''
|
||||
) {
|
||||
// Bouton Editer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'edit')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
// Bouton Editer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'edit')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('pencil', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Éditer la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Bouton Editer le module d'une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'module')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
and $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('gear', [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'help' => 'Module de la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Bouton dupliquer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'duplicate')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('clone', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Dupliquer la page'
|
||||
])
|
||||
. '</li>';
|
||||
}
|
||||
// Bouton Effacer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'delete')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('trash', [
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Supprimer la page',
|
||||
'id' => 'pageDelete'
|
||||
])
|
||||
. '</li>';
|
||||
}
|
||||
$leftItems .= '<li>' . template::ico('pencil', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Éditer la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Bouton Editer le module d'une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'module')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
and $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
||||
and class_exists($this->getData(['page', $this->getUrl(0), 'moduleId'])) === true
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('gear', [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'help' => 'Module de la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Bouton dupliquer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'duplicate')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('clone', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Dupliquer la page'
|
||||
])
|
||||
. '</li>';
|
||||
}
|
||||
// Bouton Effacer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'delete')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('trash', [
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Supprimer la page',
|
||||
'id' => 'pageDelete'
|
||||
])
|
||||
. '</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Items de droite
|
||||
$rightItems = '';
|
||||
if (
|
||||
(
|
||||
$this->getUser('group') === self::GROUP_EDITOR
|
||||
$this->getUser('role') === self::ROLE_EDITOR
|
||||
&& $this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
)
|
||||
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||
|| $this->getUser('role') === self::ROLE_ADMIN
|
||||
) {
|
||||
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
|
||||
$rightItems .= '<li>' . template::ico('folder', [
|
||||
'help' => 'Fichiers',
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . '&fldr=/' . self::$siteContent,
|
||||
'href' => helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR . 'core.json') . '&lang=' . $this->getData(['user', $this->getUser('id'), 'language']) . $folder,
|
||||
'attr' => 'data-lity'
|
||||
]) . '</li>';
|
||||
}
|
||||
if (
|
||||
self::$siteContent === 'home'
|
||||
&& $this->getUser('group') >= self::GROUP_ADMIN
|
||||
&& $this->getUser('role') >= self::ROLE_ADMIN
|
||||
) {
|
||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('flag', [
|
||||
'help' => 'Langues',
|
||||
'href' => helper::baseUrl() . 'language'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('address-book', [
|
||||
'help' => 'Utilisateurs',
|
||||
'href' => helper::baseUrl() . 'user'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('cog-alt', [
|
||||
'help' => 'Configuration',
|
||||
'href' => helper::baseUrl() . 'config'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('users', [
|
||||
'help' => 'Utilisateurs',
|
||||
'href' => helper::baseUrl() . 'user'
|
||||
]) . '</li>';
|
||||
// Mise à jour automatique
|
||||
$today = mktime(0, 0, 0);
|
||||
$checkUpdate = $this->getData(['core', 'lastAutoUpdate']);
|
||||
@ -1111,23 +1162,56 @@ class layout extends common
|
||||
$today > $checkUpdate + $this->getData(['config', 'autoUpdateDelay', 86400])
|
||||
) {
|
||||
// Dernier auto controle
|
||||
$this->setData(['core', 'lastAutoUpdate', $today]);
|
||||
$this->setData(['core', 'lastAutoUpdate', $today], false);
|
||||
if (
|
||||
helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)
|
||||
) {
|
||||
$this->setData(['core', 'updateAvailable', true]);
|
||||
$this->setData(['core', 'updateAvailable', true], false);
|
||||
}
|
||||
// Modules installés
|
||||
$infoModules = helper::getModules();
|
||||
// Recherche de mise à jour des modules
|
||||
$store = plugin::getStore();
|
||||
if (is_array($store)) {
|
||||
// Parcourir les données des modules du store
|
||||
foreach ($store as $key => $value) {
|
||||
if (empty($key)) {
|
||||
continue;
|
||||
}
|
||||
// Mise à jour d'un module
|
||||
// Le module est installé et une mise à jour est en ligne
|
||||
if (
|
||||
isset($infoModules[$key])
|
||||
&&
|
||||
version_compare($infoModules[$key]['version'], $value['version'], '<')
|
||||
) {
|
||||
$this->setData(['core', 'updateModuleAvailable', true], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB('core');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Afficher le bouton : Mise à jour détectée + activée
|
||||
if ($this->getData(['core', 'updateAvailable'])) {
|
||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'install/update" data-tippy-content="Mettre à jour Zwii ' . common::ZWII_VERSION . ' vers ' . helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) . '">' . template::ico('update colorRed') . '</a></li>';
|
||||
}
|
||||
}
|
||||
if ($this->getData(['core', 'updateModuleAvailable'])) {
|
||||
$rightItems .= '<li>' . template::ico('puzzle colorRed', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
} else {
|
||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Boutons depuis le rôle éditeur
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
$this->getUser('role') >= self::ROLE_EDITOR
|
||||
&& $this->getUser('permission', 'user', 'edit')
|
||||
|
||||
) {
|
||||
@ -1188,7 +1272,6 @@ class layout extends common
|
||||
if ($style) {
|
||||
echo '<style type="text/css">' . helper::minifyCss(htmlspecialchars_decode($style)) . '</style>';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1213,8 +1296,8 @@ class layout extends common
|
||||
$vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';';
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||
$this->isConnected() === true
|
||||
and $this->getUser('role') >= self::ROLE_EDITOR
|
||||
) {
|
||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ class core extends common
|
||||
parent::__construct();
|
||||
// Token CSRF
|
||||
if (empty($_SESSION['csrf'])) {
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(128));
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(64));
|
||||
}
|
||||
|
||||
// Fuseau horaire
|
||||
@ -32,8 +32,6 @@ class core extends common
|
||||
}
|
||||
// Date de la dernière suppression
|
||||
$this->setData(['core', 'lastClearTmp', $lastClearTmp]);
|
||||
// Enregistre les données
|
||||
//$this->SaveData();
|
||||
}
|
||||
// Backup automatique des données
|
||||
$lastBackup = mktime(0, 0, 0);
|
||||
@ -142,7 +140,7 @@ class core extends common
|
||||
$css .= 'span.mce-text{background-color: unset !important;}';
|
||||
$css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}';
|
||||
$css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}';
|
||||
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
||||
$css .= 'select,input[type=password],input[type=email],input[type=text],input[type=date],input[type=time],input[type=week],input[type=month],input[type=datetime-local],input[type=number],.inputFile,select,textarea{color:' . $this->getData(['theme', 'text', 'textColor']) . ';background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';}';
|
||||
// spécifiques au module de blog
|
||||
$css .= '.blogDate {color:' . $this->getData(['theme', 'text', 'textColor']) . ';}.blogPicture img{border:1px solid ' . $this->getData(['theme', 'text', 'textColor']) . '; box-shadow: 1px 1px 5px ' . $this->getData(['theme', 'text', 'textColor']) . ';}';
|
||||
// Couleur fixée dans admin.css
|
||||
@ -170,7 +168,7 @@ class core extends common
|
||||
$colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor']));
|
||||
$css .= '.speechBubble,.button,.button:hover,button[type=submit],.pagination a,.pagination a:hover,input[type=checkbox]:checked + label:before,input[type=radio]:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}';
|
||||
$css .= '.helpButton span{color:' . $colors['normal'] . '}';
|
||||
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
|
||||
$css .= 'input[type=text]:hover,input[type=date]:hover,input[type=time]:hover,input[type=week]:hover,input[type=month]:hover,input[type=datetime-local]:hover,input[type=number]:hover,input[type=password]:hover,.inputFile:hover,select:hover,textarea:hover{border-color:' . $colors['normal'] . '}';
|
||||
$css .= '.speechBubble:before{border-color:' . $colors['normal'] . ' transparent transparent transparent}';
|
||||
$css .= '.button:hover,button[type=submit]:hover,.pagination a:hover,input[type=checkbox]:not(:active):checked:hover + label:before,input[type=checkbox]:active + label:before,input[type=radio]:checked:hover + label:before,input[type=radio]:not(:checked):active + label:before{background-color:' . $colors['darken'] . '}';
|
||||
$css .= '.helpButton span:hover{color:' . $colors['darken'] . '}';
|
||||
@ -253,6 +251,25 @@ class core extends common
|
||||
}
|
||||
|
||||
$css .= '#toggle span,#menu a{padding:' . $this->getData(['theme', 'menu', 'height']) . ';font-family:' . $fonts[$this->getData(['theme', 'menu', 'font'])] . ';font-weight:' . $this->getData(['theme', 'menu', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'menu', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'menu', 'textTransform']) . '}';
|
||||
|
||||
|
||||
// Déterminer la hauteur max du menu pour éviter les débordements
|
||||
// $padding = $this->getData(['theme', 'menu', 'height']); // Par exemple, "10px 20px"
|
||||
// $fontSize = (float) $this->getData(['theme', 'text', 'fontSize']); // Taille de référence en pixels
|
||||
// $menuFontSize = (float) $this->getData(['theme', 'menu', 'fontSize']); // Taille du menu en em
|
||||
|
||||
// Extraire la première valeur du padding (par exemple "10px 20px" -> "10px")
|
||||
// $firstPadding = (float) explode(" ", $padding)[0]; // Nous prenons la première valeur, supposée être en px
|
||||
|
||||
// Convertir menuFontSize (en em) en pixels
|
||||
// $menuFontSizeInPx = $menuFontSize * $fontSize;
|
||||
|
||||
// Calculer la hauteur totale
|
||||
// $totalHeight = $firstPadding + $fontSize + $menuFontSizeInPx;
|
||||
|
||||
// Fixer la hauteur maximale de la barre de menu
|
||||
// $css .= '#menuLeft, nav, a.active {max-height:' . $totalHeight . 'px}';
|
||||
|
||||
// Pied de page
|
||||
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
|
||||
if ($this->getData(['theme', 'footer', 'margin'])) {
|
||||
@ -364,7 +381,7 @@ class core extends common
|
||||
$css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}';
|
||||
$colors = helper::colorVariants($this->getData(['admin', 'backgroundBlockColor']));
|
||||
$css .= '.buttonTab, .block {border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}.buttonTab, .block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}';
|
||||
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=password],select:not(#barSelectCourse),select:not(#menuSelectCourse),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
|
||||
$css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=number],input[type=password],select:not(#barSelectLanguage),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}';
|
||||
// Bordure du contour TinyMCE
|
||||
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
||||
// Enregistre la personnalisation
|
||||
@ -411,26 +428,43 @@ class core extends common
|
||||
exit();
|
||||
}
|
||||
|
||||
// Sauvegarde la dernière page visitée par l'utilisateur connecté et enregistre l'historique des consultations
|
||||
|
||||
/*
|
||||
* Récupère les statistiques de l'utilisateur non admin
|
||||
* en dehors de home
|
||||
* et si la connextion est nécessaire et que le membre est connecté
|
||||
* stocke la progression dans la base des inscriptions
|
||||
* */
|
||||
if (
|
||||
// L'utilisateur est renseigné
|
||||
$this->getUser('id')
|
||||
// L'accueil ne stocke pas lea progression
|
||||
&& common::$siteContent !== 'home'
|
||||
// La page existe
|
||||
&& in_array($this->getUrl(0), array_keys($this->getData(['page'])))
|
||||
// Le userId n'est pas celui d'un admis ni le prof du contenu
|
||||
// L'espace dispose d'un accès nécessitant un compte
|
||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||
// Le userId n'est pas celui d'un admis ni le compte d'un gestionnaire de cet espace
|
||||
&& (
|
||||
$this->getUser('group') < common::GROUP_ADMIN
|
||||
$this->getUser('role') < common::ROLE_ADMIN
|
||||
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author'])
|
||||
)
|
||||
) {
|
||||
|
||||
$course = new course();
|
||||
|
||||
// Met à jour la progression de l'utisateur et obtient le nombre de pages vues
|
||||
$userProgress = $course->setUserProgress(self::$siteContent, $this->getUser('id'));
|
||||
|
||||
// Stockage dans les données d'inscription du membre
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'progress', $userProgress], false);
|
||||
|
||||
// Les rapports sont activés
|
||||
// Stocke la dernière page vue et sa date de consultation
|
||||
$this->setData(['enrolment', common::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]);
|
||||
$this->setData(['enrolment', common::$siteContent, $this->getUser('id'), 'datePageView', time()]);
|
||||
|
||||
// Stocke le rapport en CSV
|
||||
$file = fopen(common::DATA_DIR . common::$siteContent . '/report.csv', 'a+');
|
||||
fputcsv($file, [$this->getUser('id'), $this->getUrl(0), time()], ';');
|
||||
fclose($file);
|
||||
|
||||
if ($this->getdata(['course', common::$siteContent, 'report']) === true) {
|
||||
$this->setData(['enrolment', common::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)], false);
|
||||
$this->setData(['enrolment', common::$siteContent, $this->getUser('id'), 'datePageView', time()]);
|
||||
}
|
||||
}
|
||||
|
||||
// Journalisation
|
||||
@ -438,8 +472,8 @@ class core extends common
|
||||
|
||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and ($this->getUser('group') === common::GROUP_BANNED
|
||||
$this->isConnected() === true
|
||||
and ($this->getUser('role') === common::ROLE_BANNED
|
||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
)
|
||||
@ -452,9 +486,9 @@ class core extends common
|
||||
$this->getData(['config', 'maintenance'])
|
||||
and in_array($this->getUrl(0), ['maintenance', 'user']) === false
|
||||
and $this->getUrl(1) !== 'login'
|
||||
and ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < common::GROUP_ADMIN
|
||||
and ($this->isConnected() === false
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('role') < common::ROLE_ADMIN
|
||||
)
|
||||
)
|
||||
) {
|
||||
@ -471,11 +505,11 @@ class core extends common
|
||||
$access = null;
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
if (
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||
$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
|
||||
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||
and ($this->getUser('role') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'role']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||
)
|
||||
) {
|
||||
$access = true;
|
||||
@ -489,10 +523,10 @@ class core extends common
|
||||
// Empêcher l'accès aux pages désactivées par URL directe
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') < common::ROLE_EDITOR
|
||||
)
|
||||
) {
|
||||
$access = false;
|
||||
@ -505,6 +539,22 @@ class core extends common
|
||||
) {
|
||||
$access = false;
|
||||
}
|
||||
|
||||
/** Empêche la consultation d'un espace laissé ouvert après la déconnexion et redirige vers home
|
||||
* L'utilisateur n'est pas connecté
|
||||
* ET l'accueil n'est pas affiché
|
||||
* ET l'espace affiché nécessite un compte d'accès, enrolment vaut 1,2 ou 3
|
||||
* */
|
||||
|
||||
if (
|
||||
$this->isConnected() === false
|
||||
and self::$siteContent !== 'home'
|
||||
and $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
|
||||
header('Location:' . helper::baseUrl(true) . 'swap/' . self::$siteContent);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -538,10 +588,11 @@ class core extends common
|
||||
}
|
||||
// Accès concurrent stocke la page visitée
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
&& $this->getUser('id')
|
||||
&& !$this->isPost()
|
||||
) {
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()]);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()], false);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessTimer', time()]);
|
||||
}
|
||||
// Breadcrumb
|
||||
@ -597,7 +648,6 @@ class core extends common
|
||||
'inlineStyle' => $inlineStyle,
|
||||
'inlineScript' => $inlineScript,
|
||||
]);
|
||||
|
||||
}
|
||||
// Importe le module
|
||||
else {
|
||||
@ -655,11 +705,11 @@ class core extends common
|
||||
if (array_key_exists($action, $module::$actions)) {
|
||||
$module->$action();
|
||||
$output = $module->output;
|
||||
// Check le groupe de l'utilisateur
|
||||
// Check le rôle de l'utilisateur
|
||||
if (
|
||||
($module::$actions[$action] === common::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') >= $module::$actions[$action]
|
||||
($module::$actions[$action] === common::ROLE_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('role') >= $module::$actions[$action]
|
||||
and $this->getUser('permission', $moduleId, $action)
|
||||
)
|
||||
)
|
||||
@ -746,7 +796,7 @@ class core extends common
|
||||
$this->addOutput([
|
||||
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')
|
||||
]);
|
||||
} else if ($modpos === 'free') {
|
||||
} elseif ($modpos === 'free' && strstr($pageContent, '[MODULE]')) {
|
||||
if (strstr($pageContent, '[MODULE]', true) === false) {
|
||||
$begin = strstr($pageContent, '[]', true);
|
||||
} else {
|
||||
@ -826,8 +876,7 @@ class core extends common
|
||||
|
||||
// Pour éviter une 404, bascule dans l'espace correct si la page existe dans cet espace.
|
||||
// Parcourir les espaces y compris l'accueil
|
||||
foreach (array_merge(['home' => []], $this->getData(['course'])) as $courseId => $value) {
|
||||
;
|
||||
foreach (array_merge(['home' => []], $this->getData(['course'])) as $courseId => $value) {;
|
||||
if (
|
||||
// l'espace existe
|
||||
is_dir(common::DATA_DIR . $courseId) &&
|
||||
@ -882,25 +931,25 @@ class core extends common
|
||||
]);
|
||||
}
|
||||
switch ($this->output['display']) {
|
||||
// Layout brut
|
||||
// Layout brut
|
||||
case common::DISPLAY_RAW:
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout vide
|
||||
// Layout vide
|
||||
case common::DISPLAY_LAYOUT_BLANK:
|
||||
require 'core/layout/blank.php';
|
||||
break;
|
||||
// Affichage en JSON
|
||||
// Affichage en JSON
|
||||
case common::DISPLAY_JSON:
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($this->output['content']);
|
||||
break;
|
||||
// RSS feed
|
||||
// RSS feed
|
||||
case common::DISPLAY_RSS:
|
||||
header('Content-type: application/rss+xml; charset=UTF-8');
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout allégé
|
||||
// Layout allégé
|
||||
case common::DISPLAY_LAYOUT_LIGHT:
|
||||
ob_start();
|
||||
require 'core/layout/light.php';
|
||||
@ -911,7 +960,7 @@ class core extends common
|
||||
$content = preg_replace('/[\t ]+/u', ' ', $content);
|
||||
echo $content;
|
||||
break;
|
||||
// Layout principal
|
||||
// Layout principal
|
||||
case common::DISPLAY_LAYOUT_MAIN:
|
||||
ob_start();
|
||||
require 'core/layout/main.php';
|
||||
|
@ -128,7 +128,17 @@ class SitemapGenerator
|
||||
*/
|
||||
private $sampleRobotsLines = [
|
||||
"User-agent: *",
|
||||
"Disallow: /",
|
||||
"User-agent: Googlebot",
|
||||
"Allow: /",
|
||||
"User-agent: bingbot",
|
||||
"Allow: /",
|
||||
"User-agent: Slurp",
|
||||
"Allow: /",
|
||||
"User-agent: DuckDuckBot",
|
||||
"Allow: /",
|
||||
"User-agent: Baiduspider",
|
||||
"Allow: /"
|
||||
];
|
||||
/**
|
||||
* @var array list of valid changefreq values according to the spec
|
||||
|
@ -245,6 +245,7 @@ class template
|
||||
'readonly' => false,
|
||||
'value' => '',
|
||||
'type' => 'date',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -271,12 +272,21 @@ class template
|
||||
} else {
|
||||
$attributes['value'] = ($attributes['value'] ? helper::filter($attributes['value'], $filter) : '');
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -325,7 +335,9 @@ class template
|
||||
'name' => $nameId,
|
||||
'type' => 2,
|
||||
'value' => '',
|
||||
'language' => 'fr_FR'
|
||||
'folder' => '',
|
||||
'language' => 'fr_FR',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['value'] = helper::translate($attributes['value']);
|
||||
@ -334,6 +346,13 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Notice
|
||||
@ -346,7 +365,9 @@ class template
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Champ caché contenant l'url de la page
|
||||
@ -361,14 +382,16 @@ class template
|
||||
$html .= sprintf(
|
||||
'<a
|
||||
href="' .
|
||||
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
||||
'?relative_url=1' .
|
||||
'&lang=' . $attributes['language'] .
|
||||
'&field_id=' . $attributes['id'] .
|
||||
'&type=' . $attributes['type'] .
|
||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||
. '"
|
||||
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
||||
'?relative_url=1' .
|
||||
'&lang=' . $attributes['language'] .
|
||||
'&field_id=' . $attributes['id'] .
|
||||
'&type=' . $attributes['type'] .
|
||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||
// Ajoute le nom du dossier si la variable est passée
|
||||
(empty($attributes['folder']) ? '&fldr=/' : '&fldr=' . $attributes['folder']) .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||
. '"
|
||||
class="inputFile %s %s"
|
||||
%s
|
||||
data-lity
|
||||
@ -580,7 +603,8 @@ class template
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -590,12 +614,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -648,18 +681,28 @@ class template
|
||||
//'maxlength' => '500',
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false
|
||||
'readonly' => false,
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
//$attributes['placeholder'] = helper::translate($attributes['placeholder']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -702,7 +745,8 @@ class template
|
||||
'name' => $nameId,
|
||||
'selected' => '',
|
||||
'font' => [],
|
||||
'multiple' => ''
|
||||
'multiple' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -716,12 +760,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['selected'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -831,6 +884,10 @@ class template
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Début tableau
|
||||
$html .= '<table id="' . $attributes['id'] . '" class="table ' . $attributes['class'] . '">';
|
||||
// Pas de tableau d'Id transmis, générer une numérotation
|
||||
if (empty($rowsId)) {
|
||||
$rowsId = range(0, count($cols));
|
||||
}
|
||||
// Entêtes
|
||||
if ($head) {
|
||||
// Début des entêtes
|
||||
@ -838,21 +895,17 @@ class template
|
||||
$html .= '<tr class="nodrag">';
|
||||
$i = 0;
|
||||
foreach ($head as $th) {
|
||||
$html .= '<th class="col' . $cols[$i++] . '">' . $th . '</th>';
|
||||
$html .= '<th id="' . $rowsId[$i] . '" class="col' . $cols[$i++] . '">' . $th . '</th>';
|
||||
}
|
||||
// Fin des entêtes
|
||||
$html .= '</tr>';
|
||||
$html .= '</thead>';
|
||||
}
|
||||
// Pas de tableau d'Id transmis, générer une numérotation
|
||||
if (empty($rowsId)) {
|
||||
$rowsId = range(0, count($body));
|
||||
}
|
||||
// Début contenu
|
||||
$j = 0;
|
||||
foreach ($body as $tr) {
|
||||
// Id de ligne pour les tableaux drag and drop
|
||||
$html .= '<tr id="' . $rowsId[$j++] . '">';
|
||||
$html .= '<tr>';
|
||||
$i = 0;
|
||||
foreach ($tr as $td) {
|
||||
$html .= '<td class="col' . $cols[$i++] . '">' . $td . '</td>';
|
||||
@ -893,7 +946,8 @@ class template
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'value' => '',
|
||||
'type' => 'text'
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -903,12 +957,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
@ -929,6 +992,117 @@ class template
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un champ de saisie de type number (input[type="number"])
|
||||
*
|
||||
* Cette méthode crée un champ numérique HTML complet avec son wrapper,
|
||||
* son label et ses messages d'aide/erreur. Elle gère automatiquement
|
||||
* la conversion des valeurs en nombres et les contraintes de validation.
|
||||
*
|
||||
* @param string $nameId Identifiant unique du champ, utilisé pour name et id
|
||||
* @param array $attributes Tableau des attributs du champ avec les clés suivantes :
|
||||
* @type boolean $before Active la récupération des données précédentes en cas d'erreur (défaut: true)
|
||||
* @type string $class Classes CSS additionnelles pour l'input (défaut: '')
|
||||
* @type string $classWrapper Classes CSS additionnelles pour le wrapper (défaut: '')
|
||||
* @type boolean $noDirty Désactive le marquage dirty du champ (défaut: false)
|
||||
* @type boolean $disabled Désactive le champ (défaut: false)
|
||||
* @type string $help Texte d'aide affiché sous le label (défaut: '')
|
||||
* @type string $label Texte du label (défaut: '')
|
||||
* @type string $placeholder Texte de placeholder (défaut: '')
|
||||
* @type boolean $readonly Rend le champ en lecture seule (défaut: false)
|
||||
* @type mixed $value Valeur initiale du champ (défaut: '')
|
||||
* @type number $min Valeur minimum autorisée (défaut: null)
|
||||
* @type number $max Valeur maximum autorisée (défaut: null)
|
||||
* @type number $step Pas d'incrémentation (ex: 1 pour entiers, 0.01 pour prix) (défaut: null)
|
||||
* @type string $pattern Expression régulière de validation (défaut: null)
|
||||
*
|
||||
* @return string Code HTML du champ number complet
|
||||
*/
|
||||
public static function number($nameId, array $attributes = [])
|
||||
{
|
||||
// Attributs par défaut spécifiques aux champs numériques
|
||||
$attributes = array_merge([
|
||||
'type' => 'number',
|
||||
'before' => true,
|
||||
'class' => '',
|
||||
'classWrapper' => '',
|
||||
'noDirty' => false,
|
||||
'disabled' => false,
|
||||
'help' => '',
|
||||
'id' => $nameId,
|
||||
'label' => '',
|
||||
'name' => $nameId,
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'required' => false,
|
||||
'value' => '',
|
||||
'min' => null,
|
||||
'max' => null,
|
||||
'step' => null,
|
||||
'pattern' => null
|
||||
], $attributes);
|
||||
|
||||
// Conversion de la valeur en nombre si elle n'est pas vide
|
||||
if ($attributes['value'] !== '') {
|
||||
$attributes['value'] = floatval($attributes['value']);
|
||||
}
|
||||
|
||||
// Nettoyage des attributs null pour ne pas les afficher dans le HTML
|
||||
foreach (['min', 'max', 'step', 'pattern'] as $attr) {
|
||||
if ($attributes[$attr] === null) {
|
||||
unset($attributes[$attr]);
|
||||
}
|
||||
}
|
||||
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
|
||||
// Sauvegarde des données en cas d'erreur
|
||||
if ($attributes['before'] && array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
|
||||
// Notice
|
||||
$notice = '';
|
||||
if (array_key_exists($attributes['id'], common::$inputNotices)) {
|
||||
$notice = common::$inputNotices[$attributes['id']];
|
||||
$attributes['class'] .= ' notice';
|
||||
}
|
||||
$html .= self::notice($attributes['id'], $notice);
|
||||
|
||||
// Input number
|
||||
$html .= sprintf(
|
||||
'<input type="number" %s>',
|
||||
helper::sprintAttributes($attributes)
|
||||
);
|
||||
|
||||
// Fin du wrapper
|
||||
$html .= '</div>';
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée un champ texte long
|
||||
* @param string $nameId Nom et id du champ
|
||||
@ -950,7 +1124,8 @@ class template
|
||||
//'maxlength' => '500',
|
||||
'name' => $nameId,
|
||||
'readonly' => false,
|
||||
'value' => ''
|
||||
'value' => '',
|
||||
'required' => false,
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
@ -959,12 +1134,21 @@ class template
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
}
|
||||
// Gestion du champ obligatoire
|
||||
if (isset($attributes['required']) && $attributes['required']) {
|
||||
// Affiche l'astérisque dans le label
|
||||
$required = ' required-field';
|
||||
// Ajoute l'attribut required au champ input
|
||||
$attributes['required'] = 'required';
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
// Label
|
||||
if ($attributes['label']) {
|
||||
$html .= self::label($attributes['id'], $attributes['label'], [
|
||||
'help' => $attributes['help']
|
||||
'help' => $attributes['help'],
|
||||
// Ajoute la classe required-field si le champ est obligatoire
|
||||
'class' => isset($required) ? $required : ''
|
||||
]);
|
||||
}
|
||||
// Notice
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -116,30 +116,14 @@ core.confirm = function (text, yesCallback, noCallback) {
|
||||
|
||||
/**
|
||||
* Scripts à exécuter en dernier
|
||||
*/
|
||||
|
||||
core.end = function () {
|
||||
/**
|
||||
* Modifications non enregistrées du formulaire
|
||||
*/
|
||||
var formDOM = $("form");
|
||||
// Ignore :
|
||||
// - TinyMCE car il gère lui même le message
|
||||
// - Les champs avec data-no-dirty
|
||||
var inputsDOM = formDOM.find("input:not([data-no-dirty]), select:not([data-no-dirty]), textarea:not(.editorWysiwyg):not([data-no-dirty])");
|
||||
var inputSerialize = inputsDOM.serialize();
|
||||
$(window).on("beforeunload", function () {
|
||||
if (inputsDOM.serialize() !== inputSerialize) {
|
||||
message = "<?php echo helper::translate('Les modifications que vous avez apportées ne seront peut-être pas enregistrées.');?>";
|
||||
return message;
|
||||
}
|
||||
});
|
||||
formDOM.submit(function () {
|
||||
$(window).off("beforeunload");
|
||||
});
|
||||
|
||||
};
|
||||
$(function () {
|
||||
core.end();
|
||||
});
|
||||
*/
|
||||
|
||||
/**
|
||||
* Ajoute une notice
|
||||
@ -216,15 +200,15 @@ core.start = function () {
|
||||
// Variables des cookies
|
||||
var getUrl = window.location;
|
||||
var domain = "domain=" + getUrl.hostname + ";";
|
||||
var basePath = getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf('/') + 1);
|
||||
var path = "path=" + basePath + ";";
|
||||
var e = new Date();
|
||||
e.setFullYear(e.getFullYear() + 1);
|
||||
var expires = "expires=" + e.toUTCString();
|
||||
|
||||
var expires = "expires=" + e.toUTCString() + ";";
|
||||
// Stocke le cookie d'acceptation
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires;
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Fermeture de la popup des cookies
|
||||
*/
|
||||
@ -253,8 +237,6 @@ core.start = function () {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Choix de page dans la barre de membre
|
||||
*/
|
||||
@ -372,8 +354,32 @@ core.start = function () {
|
||||
}
|
||||
}).trigger("resize");
|
||||
|
||||
/**
|
||||
* Masque les pages du menu si demandé dans la configuration du thème du menu sauf dans home
|
||||
*/
|
||||
// Option active
|
||||
var hidePages = "<?php echo $this->getData(['theme', 'menu', 'hidePages'])?>";
|
||||
|
||||
if (hidePages == 1) {
|
||||
// Récupérer les valeurs de dimensions
|
||||
var padding = "<?php echo $this->getData(['theme', 'menu', 'height'])?>";
|
||||
var firstPadding = parseFloat(padding.split(" ")[0]); // Convertir la première valeur en nombre
|
||||
var fontSize = parseFloat("<?php echo $this->getData(['theme', 'text', 'fontSize'])?>"); // Taille du texte
|
||||
var menuFontSize = parseFloat("<?php echo $this->getData(['theme', 'menu', 'fontSize'])?>"); // Taille du menu
|
||||
|
||||
// Convertir menuFontSize en pixels
|
||||
var menuFontSizeInPx = menuFontSize * fontSize;
|
||||
|
||||
// Calculer la hauteur totale
|
||||
var totalHeight = firstPadding + fontSize + menuFontSizeInPx;
|
||||
$("#menuLeft").css({
|
||||
"visibility": "hidden",
|
||||
"max-width": "10px"
|
||||
});
|
||||
|
||||
// Par défaut pour tous les thèmes.
|
||||
$("#menuLeft").css("max-height", totalHeight + "px").css("min-height", totalHeight + "px");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
510
core/core.php
510
core/core.php
@ -8,7 +8,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -24,13 +24,13 @@ class common
|
||||
const DISPLAY_LAYOUT_BLANK = 3;
|
||||
const DISPLAY_LAYOUT_MAIN = 4;
|
||||
const DISPLAY_LAYOUT_LIGHT = 5;
|
||||
const GROUP_BANNED = -1;
|
||||
const GROUP_VISITOR = 0;
|
||||
const GROUP_MEMBER = 1;
|
||||
const GROUP_EDITOR = 2;
|
||||
const ROLE_BANNED = -1;
|
||||
const ROLE_VISITOR = 0;
|
||||
const ROLE_MEMBER = 1;
|
||||
const ROLE_EDITOR = 2;
|
||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const ROLE_MODERATOR = 2;
|
||||
const ROLE_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
const SIGNATURE_PSEUDO = 2;
|
||||
const SIGNATURE_FIRSTLASTNAME = 3;
|
||||
@ -51,7 +51,7 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.10.10';
|
||||
const ZWII_VERSION = '1.21.03';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
@ -72,6 +72,9 @@ class common
|
||||
const COURSE_ENROLMENT_SELF_KEY = 2; // Ouvert à tous les membres disposant de la clé
|
||||
const COURSE_ENROLMENT_MANDATORY = 3;
|
||||
|
||||
// Taille et rotation des journaux
|
||||
const LOG_MAXSIZE = 4 * 1024 * 1024;
|
||||
const LOG_MAXARCHIVE = 5;
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
@ -144,29 +147,29 @@ class common
|
||||
],
|
||||
'view' => ''
|
||||
];
|
||||
public static $groups = [
|
||||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
public static $roles = [
|
||||
self::ROLE_BANNED => 'Banni',
|
||||
self::ROLE_VISITOR => 'Visiteur',
|
||||
self::ROLE_MEMBER => 'Étudiant',
|
||||
self::ROLE_EDITOR => 'Formateur',
|
||||
self::ROLE_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupEdits = [
|
||||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
public static $roleEdits = [
|
||||
self::ROLE_BANNED => 'Banni',
|
||||
self::ROLE_MEMBER => 'Étudiant',
|
||||
self::ROLE_EDITOR => 'Formateur',
|
||||
self::ROLE_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupNews = [
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
public static $roleNews = [
|
||||
self::ROLE_MEMBER => 'Étudiant',
|
||||
self::ROLE_EDITOR => 'Formateur',
|
||||
self::ROLE_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupPublics = [
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
public static $rolePublics = [
|
||||
self::ROLE_VISITOR => 'Visiteur',
|
||||
self::ROLE_MEMBER => 'Étudiant',
|
||||
self::ROLE_EDITOR => 'Formateur',
|
||||
self::ROLE_ADMIN => 'Administrateur'
|
||||
];
|
||||
|
||||
//Langues de l'UI
|
||||
@ -174,8 +177,11 @@ class common
|
||||
public static $dialog;
|
||||
// Langue de l'interface sélectionnée
|
||||
public static $i18nUI = 'fr_FR';
|
||||
// Langues de contenu
|
||||
|
||||
// Espace, contenu sélectionné
|
||||
public static $siteContent = 'home';
|
||||
// Progression d'un participant
|
||||
// public static $userProgress = '';
|
||||
|
||||
public static $languages = [
|
||||
'de' => 'Deutsch',
|
||||
@ -199,20 +205,20 @@ class common
|
||||
// Descripteur de données Entrées / Sorties
|
||||
// Liste ici tous les fichiers de données
|
||||
public $dataFiles = [
|
||||
'admin' => '',
|
||||
'blacklist' => '',
|
||||
'config' => '',
|
||||
'core' => '',
|
||||
'course' => '',
|
||||
'font' => '',
|
||||
'module' => '',
|
||||
'page' => '',
|
||||
'theme' => '',
|
||||
'user' => '',
|
||||
'language' => '',
|
||||
'profil' => '',
|
||||
'enrolment' => '',
|
||||
'category' => '',
|
||||
'admin' => null,
|
||||
'blacklist' => null,
|
||||
'config' => null,
|
||||
'core' => null,
|
||||
'course' => null,
|
||||
'font' => null,
|
||||
'module' => null,
|
||||
'page' => null,
|
||||
'theme' => null,
|
||||
'user' => null,
|
||||
'language' => null,
|
||||
'profil' => null,
|
||||
'enrolment' => null,
|
||||
'category' => null,
|
||||
];
|
||||
|
||||
private $configFiles = [
|
||||
@ -320,29 +326,58 @@ class common
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
// Construct cache
|
||||
if (isset($GLOBALS['common_construct'])) {
|
||||
$this->input['_POST'] = $GLOBALS['common_construct']['input']['_POST'];
|
||||
$this->input['_COOKIE'] = $GLOBALS['common_construct']['input']['_COOKIE'];
|
||||
self::$siteContent = $GLOBALS['common_construct']['siteContent'];
|
||||
$this->dataFiles = $GLOBALS['common_construct']['dataFiles'];
|
||||
$this->configFiles = $GLOBALS['common_construct']['configFiles'];
|
||||
$this->user = $GLOBALS['common_construct']['user'];
|
||||
self::$i18nUI = $GLOBALS['common_construct']['i18nUI'];
|
||||
$this->hierarchy = $GLOBALS['common_construct']['hierarchy'];
|
||||
$this->url = $GLOBALS['common_construct']['url'];
|
||||
self::$dialog = $GLOBALS['common_construct']['dialog'];
|
||||
return;
|
||||
}
|
||||
|
||||
// Extraction des données http
|
||||
if (isset($_POST)) {
|
||||
$this->input['_POST'] = $_POST;
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['input']['_POST'] = $this->input['_POST'];
|
||||
}
|
||||
if (isset($_COOKIE)) {
|
||||
$this->input['_COOKIE'] = $_COOKIE;
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['input']['_COOKIE'] = $this->input['_COOKIE'];
|
||||
}
|
||||
|
||||
// Déterminer le contenu du site
|
||||
if (isset($_SESSION['ZWII_SITE_CONTENT'])) {
|
||||
// Déterminé par la session présente
|
||||
self::$siteContent = $_SESSION['ZWII_SITE_CONTENT'];
|
||||
} else {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
|
||||
self::$siteContent = 'home';
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['siteContent'] = self::$siteContent;
|
||||
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
// Les fichiers de configuration
|
||||
foreach ($this->configFiles as $module => $value) {
|
||||
$this->initDB($module);
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['configFiles'] = $this->configFiles;
|
||||
// Les fichiers des contenus
|
||||
foreach ($this->contentFiles as $module => $value) {
|
||||
$this->initDB($module, self::$siteContent);
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['dataFiles'] = $this->dataFiles;
|
||||
|
||||
|
||||
// Installation fraîche, initialisation de la configuration inexistante
|
||||
// Nécessaire pour le constructeur
|
||||
@ -361,13 +396,14 @@ class common
|
||||
$this->initData($stageId, self::$siteContent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Récupère un utilisateur connecté
|
||||
if ($this->user === []) {
|
||||
$this->user = $this->getData(['user', $this->getInput('ZWII_USER_ID')]);
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['user'] = $this->user;
|
||||
|
||||
// Langue de l'administration si le user est connecté
|
||||
if ($this->getData(['user', $this->getUser('id'), 'language'])) {
|
||||
@ -378,25 +414,36 @@ class common
|
||||
? self::$i18nUI
|
||||
: 'fr_FR';
|
||||
} else {
|
||||
if (isset($_SESSION['ZWII_UI'])) {
|
||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||
} elseif (isset($_COOKIE['ZWII_UI'])) {
|
||||
self::$i18nUI = $_COOKIE['ZWII_UI'];
|
||||
// Par défaut la langue définie par défaut à l'installation
|
||||
if ($this->getData(['config', 'defaultLanguageUI'])) {
|
||||
self::$i18nUI = $this->getData(['config', 'defaultLanguageUI']);
|
||||
} else {
|
||||
self::$i18nUI = 'fr_FR';
|
||||
$this->setData(['config', 'defaultLanguageUI', 'fr_FR']);
|
||||
}
|
||||
$_SESSION['ZWII_UI'] = self::$i18nUI;
|
||||
}
|
||||
|
||||
// Stocker le cookie de langue pour l'éditeur de texte ainsi que l'url du contenu pour le theme
|
||||
setcookie('ZWII_UI', self::$i18nUI, time() + 3600, '', '', false, false);
|
||||
setcookie('ZWII_UI', self::$i18nUI, [
|
||||
'expires' => time() + 3600,
|
||||
'path' => helper::baseUrl(false, false),
|
||||
'domain' => '',
|
||||
'secure' => false,
|
||||
'httponly' => false,
|
||||
'samesite' => 'Lax' // Vous pouvez aussi utiliser 'Strict' ou 'None'
|
||||
]);
|
||||
// Stocker l'courseId pour le thème de TinyMCE
|
||||
setcookie('ZWII_SITE_CONTENT', self::$siteContent, time() + 3600, '', '', false, false);
|
||||
//setcookie('ZWII_SITE_CONTENT', self::$siteContent, time() + 3600, '', '', false, false);
|
||||
setlocale(LC_ALL, self::$i18nUI);
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['i18nUI'] = self::$i18nUI;
|
||||
|
||||
// Construit la liste des pages parents/enfants
|
||||
if ($this->hierarchy['all'] === []) {
|
||||
$this->buildHierarchy();
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['hierarchy'] = $this->hierarchy;
|
||||
|
||||
// Construit l'url
|
||||
if ($this->url === '') {
|
||||
@ -406,6 +453,8 @@ class common
|
||||
$this->url = $this->homePageId();
|
||||
}
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['url'] = $this->url;
|
||||
|
||||
// Chargement des dialogues
|
||||
if (!file_exists(self::I18N_DIR . self::$i18nUI . '.json')) {
|
||||
@ -425,6 +474,8 @@ class common
|
||||
self::$dialog = array_merge(self::$dialog, $d);
|
||||
}
|
||||
}
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['dialog'] = self::$dialog;
|
||||
|
||||
// Données de proxy
|
||||
$proxy = $this->getData(['config', 'proxyType']) . $this->getData(['config', 'proxyUrl']) . ':' . $this->getData(['config', 'proxyPort']);
|
||||
@ -448,12 +499,9 @@ class common
|
||||
}
|
||||
|
||||
// Mise à jour des données core
|
||||
include ('core/include/update.inc.php');
|
||||
|
||||
include('core/include/update.inc.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Ajoute les valeurs en sortie
|
||||
* @param array $output Valeurs en sortie
|
||||
@ -498,7 +546,7 @@ class common
|
||||
public function deleteData($keys)
|
||||
{
|
||||
// Descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
// Initialisation de la requête par le nom de la base
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
@ -507,14 +555,16 @@ class common
|
||||
}
|
||||
// Effacer la donnée
|
||||
$success = $db->delete($query, true);
|
||||
return is_object($success);
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sauvegarde des données
|
||||
* @param array $keys Clé(s) des données
|
||||
* @param bool $save Indique si le fichier doit être sauvegardé après modification (par défaut true)
|
||||
* @return bool Succès de l'opération
|
||||
*/
|
||||
public function setData($keys = [])
|
||||
public function setData($keys = [], $save = true)
|
||||
{
|
||||
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
|
||||
if (
|
||||
@ -534,7 +584,7 @@ class common
|
||||
// Construire la requête dans la base inf à 1 retourner toute la base
|
||||
if (count($keys) >= 1) {
|
||||
// Descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
// Ne pas tenir compte du dernier élément qui une une value donc <
|
||||
@ -542,11 +592,12 @@ class common
|
||||
$query .= '.' . $keys[$i];
|
||||
}
|
||||
// Appliquer la modification, le dernier élément étant la donnée à sauvegarder
|
||||
$success = is_object($db->set($query, $keys[count($keys) - 1], true));
|
||||
$success = $db->set($query, $keys[count($keys) - 1], $save);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accède aux données
|
||||
* @param array $keys Clé(s) des données
|
||||
@ -557,7 +608,7 @@ class common
|
||||
// Eviter une requete vide
|
||||
if (count($keys) >= 1) {
|
||||
// descripteur de la base
|
||||
$db = $this->dataFiles[$keys[0]];
|
||||
$db = (object) $this->dataFiles[$keys[0]];
|
||||
$query = $keys[0];
|
||||
// Construire la requête
|
||||
for ($i = 1; $i < count($keys); $i++) {
|
||||
@ -616,7 +667,7 @@ class common
|
||||
* Écrit les données dans un fichier avec plusieurs tentatives d'écriture et verrouillage
|
||||
*
|
||||
* @param string $filename Le nom du fichier
|
||||
* @param array $data Les données à écrire dans le fichier
|
||||
* @param string $data Les données à écrire dans le fichier
|
||||
* @param int $flags Les drapeaux optionnels à passer à la fonction $this->secure_file_put_contents
|
||||
* @return bool True si l'écriture a réussi, sinon false
|
||||
*/
|
||||
@ -626,45 +677,59 @@ class common
|
||||
// Initialise le compteur de tentatives
|
||||
$attempts = 0;
|
||||
|
||||
// Convertit les données en chaîne de caractères
|
||||
$serialized_data = serialize($data);
|
||||
|
||||
// Vérifie la longueur des données
|
||||
$data_length = strlen($serialized_data);
|
||||
$data_length = strlen($data);
|
||||
|
||||
// Effectue jusqu'à 5 tentatives d'écriture
|
||||
while ($attempts < 5) {
|
||||
// Essaye d'écrire les données dans le fichier avec verrouillage exclusif
|
||||
$write_result = file_put_contents($filename, $data, LOCK_EX | $flags);
|
||||
|
||||
// $now = \DateTime::createFromFormat('U.u', microtime(true));
|
||||
// file_put_contents("tmplog.txt", '[SecurePut][' . $now->format('H:i:s.u') . ']' . "\r\n", FILE_APPEND);
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result !== false && $write_result === $data_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempts++;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
// Échec de l'écriture après plusieurs tentatives
|
||||
return false;
|
||||
// Etat de l'écriture
|
||||
return ($attempts < 5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function initDB($module, $path = '')
|
||||
{
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
// Constructeur JsonDB;
|
||||
$this->dataFiles[$module] = new \Prowebcraft\JsonDb([
|
||||
// Chemin complet vers le fichier JSON
|
||||
$dir = empty($path) ? self::DATA_DIR : self::DATA_DIR . $path . '/';
|
||||
$config = [
|
||||
'name' => $module . '.json',
|
||||
'dir' => empty($path) ? self::DATA_DIR : self::DATA_DIR . $path . '/',
|
||||
'backup' => file_exists('site/data/.backup')
|
||||
]);
|
||||
'dir' => $dir,
|
||||
'backup' => file_exists('site/data/.backup'),
|
||||
'update' => false,
|
||||
];
|
||||
|
||||
// Instanciation de l'objet et stockage dans dataFiles
|
||||
$this->dataFiles[$module] = new \Prowebcraft\JsonDb($config);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cette fonction est liée à saveData
|
||||
* @param mixed $module
|
||||
* @return void
|
||||
*/
|
||||
public function saveDB($module): void
|
||||
{
|
||||
$db = (object) $this->dataFiles[$module];
|
||||
$db->save();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialisation des données sur un contenu ou la page d'accueil
|
||||
* @param string $course : id du module à générer
|
||||
@ -676,7 +741,7 @@ class common
|
||||
{
|
||||
|
||||
// Tableau avec les données vierges
|
||||
require_once ('core/module/install/ressource/defaultdata.php');
|
||||
require_once('core/module/install/ressource/defaultdata.php');
|
||||
|
||||
// L'arborescence
|
||||
if (!file_exists(self::DATA_DIR . $path)) {
|
||||
@ -696,12 +761,11 @@ class common
|
||||
if ($module === 'page') {
|
||||
$content = $path === 'home' ? init::$siteContent : init::$courseContent;
|
||||
foreach ($content as $key => $value) {
|
||||
$this->setPage($key, $value, $path);
|
||||
$this->setPage($key, $value['content'], $path);
|
||||
}
|
||||
}
|
||||
|
||||
common::$coreNotices[] = $module;
|
||||
|
||||
}
|
||||
/**
|
||||
* Initialisation des données
|
||||
@ -711,7 +775,7 @@ class common
|
||||
public function saveConfig($module)
|
||||
{
|
||||
// Tableau avec les données vierges
|
||||
require_once ('core/module/install/ressource/defaultdata.php');
|
||||
require_once('core/module/install/ressource/defaultdata.php');
|
||||
// Installation des données des autres modules cad theme profil font config, admin et core
|
||||
$this->setData([$module, init::$defaultData[$module]]);
|
||||
common::$coreNotices[] = $module;
|
||||
@ -747,7 +811,7 @@ class common
|
||||
* Fonction pour construire le tableau des pages
|
||||
*/
|
||||
|
||||
private function buildHierarchy()
|
||||
public function buildHierarchy()
|
||||
{
|
||||
|
||||
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
||||
@ -757,11 +821,11 @@ class common
|
||||
// Page parent
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
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
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
and ($this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
|
||||
)
|
||||
)
|
||||
@ -784,14 +848,14 @@ class common
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and (
|
||||
(
|
||||
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $pageId, 'role']) === self::ROLE_VISITOR
|
||||
and
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $parentId, 'role']) === self::ROLE_VISITOR
|
||||
)
|
||||
or (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
||||
and
|
||||
$this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
|
||||
$this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
|
||||
|
||||
)
|
||||
)
|
||||
@ -956,7 +1020,9 @@ class common
|
||||
|
||||
/**
|
||||
* Accède à l'utilisateur connecté
|
||||
* @param int $key Clé de la valeur
|
||||
* @param string $key Clé de la valeur
|
||||
* @param mixed $perm1
|
||||
* @param mixed $perm2
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUser($key, $perm1 = null, $perm2 = null)
|
||||
@ -976,45 +1042,56 @@ class common
|
||||
|
||||
/**
|
||||
* Retourne les permissions de l'utilisateur connecté
|
||||
* @param int $key Clé de la valeur du groupe
|
||||
* @param int $key Clé de la valeur du rôle
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPermission($key1, $key2 = null)
|
||||
{
|
||||
// Administrateur, toutes les permissions
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('role') === self::ROLE_ADMIN) {
|
||||
return true;
|
||||
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
|
||||
} elseif ($this->getUser('role') <= self::ROLE_VISITOR) { // Groupe sans autorisation
|
||||
return false;
|
||||
} elseif (
|
||||
// Groupe avec profil, consultation des autorisations sur deux clés
|
||||
$key1
|
||||
&& $key2
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
|
||||
&& array_key_exists($key2, $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]))
|
||||
&& $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1])
|
||||
&& array_key_exists($key2, $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]))
|
||||
) {
|
||||
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
|
||||
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1, $key2]);
|
||||
// Groupe avec profil, consultation des autorisations sur une seule clé
|
||||
} elseif (
|
||||
$key1
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil']])
|
||||
&& array_key_exists($key1, $this->getData(['profil', $this->user['group'], $this->user['profil']]))
|
||||
&& $this->getData(['profil', $this->user['role'], $this->user['profil']])
|
||||
&& array_key_exists($key1, $this->getData(['profil', $this->user['role'], $this->user['profil']]))
|
||||
) {
|
||||
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]);
|
||||
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]);
|
||||
} else {
|
||||
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
|
||||
if (class_exists($key1)) {
|
||||
$module = new $key1;
|
||||
if (array_key_exists($key2, $module::$actions)) {
|
||||
return $this->getUser('group') >= $module::$actions[$key2];
|
||||
return $this->getUser('role') >= $module::$actions[$key2];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool l'utilisateur est connecté true sinon false
|
||||
*/
|
||||
public function isConnected()
|
||||
{
|
||||
return (
|
||||
!empty($this->getUser('authKey'))
|
||||
&&
|
||||
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check qu'une valeur est transmise par la méthode _POST
|
||||
* @return bool
|
||||
@ -1054,6 +1131,7 @@ class common
|
||||
* @param string Valeurs possibles
|
||||
*/
|
||||
|
||||
|
||||
public function updateSitemap()
|
||||
{
|
||||
// Le drapeau prend true quand au moins une page est trouvée
|
||||
@ -1091,7 +1169,7 @@ class common
|
||||
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||
// Exclure les barres et les pages non publiques et les pages masquées
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'role']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
|
||||
) {
|
||||
continue;
|
||||
@ -1119,7 +1197,7 @@ class common
|
||||
}
|
||||
// Sous-pages
|
||||
foreach ($childrenPageIds as $childKey) {
|
||||
if ($this->getData(['page', $childKey, 'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
|
||||
if ($this->getData(['page', $childKey, 'role']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
|
||||
continue;
|
||||
}
|
||||
// Cas de la page d'accueil ne pas dupliquer l'URL
|
||||
@ -1170,69 +1248,97 @@ class common
|
||||
}
|
||||
|
||||
return (file_exists('sitemap.xml') && file_exists('robots.txt'));
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Création d'une miniature
|
||||
* Fonction utilisée lors de la mise à jour d'une version 9 à une version 10
|
||||
* @param string $src image source
|
||||
* @param string $dets image destination
|
||||
* @param integer $desired_width largeur demandée
|
||||
*/
|
||||
function makeThumb($src, $dest, $desired_width)
|
||||
{
|
||||
// Vérifier l'existence du dossier de destination.
|
||||
$fileInfo = pathinfo($dest);
|
||||
if (!is_dir($fileInfo['dirname'])) {
|
||||
mkdir($fileInfo['dirname'], 0755, true);
|
||||
}
|
||||
$source_image = '';
|
||||
// Type d'image
|
||||
switch ($fileInfo['extension']) {
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
$source_image = imagecreatefromjpeg($src);
|
||||
break;
|
||||
case 'png':
|
||||
$source_image = imagecreatefrompng($src);
|
||||
break;
|
||||
case 'gif':
|
||||
$source_image = imagecreatefromgif($src);
|
||||
break;
|
||||
case 'webp':
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
$source_image = imagecreatefromavif($src);
|
||||
}
|
||||
// Image valide
|
||||
if ($source_image) {
|
||||
$width = imagesx($source_image);
|
||||
$height = imagesy($source_image);
|
||||
/* find the "desired height" of this thumbnail, relative to the desired width */
|
||||
$desired_height = floor($height * ($desired_width / $width));
|
||||
/* create a new, "virtual" image */
|
||||
$virtual_image = imagecreatetruecolor($desired_width, $desired_height);
|
||||
/* copy source image at a resized size */
|
||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
||||
switch (mime_content_type($src)) {
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
return (imagejpeg($virtual_image, $dest));
|
||||
case 'image/png':
|
||||
return (imagepng($virtual_image, $dest));
|
||||
case 'image/gif':
|
||||
return (imagegif($virtual_image, $dest));
|
||||
case 'image/webp':
|
||||
return (imagewebp($virtual_image, $dest));
|
||||
case 'image/avif':
|
||||
return (imageavif($virtual_image, $dest));
|
||||
}
|
||||
} else {
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée une miniature à partir d'une image source.
|
||||
* Cette fonction prend en charge les formats raster (JPEG, PNG, GIF, WebP, AVIF) et vectoriels (SVG).
|
||||
* Pour les images vectorielles (SVG), aucune redimension n'est effectuée : une copie est réalisée.
|
||||
*
|
||||
* @param string $src Chemin de l'image source.
|
||||
* @param string $dest Chemin de l'image destination (avec le nom du fichier et l'extension).
|
||||
* @param int $desired_width Largeur demandée pour la miniature (ignorée pour les SVG).
|
||||
* @return bool True si l'opération a réussi, false sinon.
|
||||
*/
|
||||
function makeThumb($src, $dest, $desired_width)
|
||||
{
|
||||
// Vérifier l'existence du dossier de destination.
|
||||
$fileInfo = pathinfo($dest);
|
||||
if (!is_dir($fileInfo['dirname'])) {
|
||||
mkdir($fileInfo['dirname'], 0755, true);
|
||||
}
|
||||
|
||||
$extension = strtolower($fileInfo['extension']);
|
||||
$mime_type = mime_content_type($src);
|
||||
|
||||
// Gestion des fichiers SVG (copie simple sans redimensionnement)
|
||||
if ($extension === 'svg' || $mime_type === 'image/svg+xml') {
|
||||
return copy($src, $dest);
|
||||
}
|
||||
|
||||
// Chargement de l'image source selon le type
|
||||
$source_image = '';
|
||||
switch ($extension) {
|
||||
case 'jpeg':
|
||||
case 'jpg':
|
||||
$source_image = imagecreatefromjpeg($src);
|
||||
break;
|
||||
case 'png':
|
||||
$source_image = imagecreatefrompng($src);
|
||||
break;
|
||||
case 'gif':
|
||||
$source_image = imagecreatefromgif($src);
|
||||
break;
|
||||
case 'webp':
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
if (function_exists('imagecreatefromavif')) {
|
||||
$source_image = imagecreatefromavif($src);
|
||||
} else {
|
||||
return false; // AVIF non supporté
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false; // Format non pris en charge
|
||||
}
|
||||
|
||||
// Image valide (formats raster uniquement)
|
||||
if (is_resource($source_image) || (is_object($source_image) && $source_image instanceof GdImage)) {
|
||||
$width = imagesx($source_image);
|
||||
$height = imagesy($source_image);
|
||||
|
||||
// Calcul de la hauteur proportionnelle à la largeur demandée
|
||||
$desired_height = floor($height * ($desired_width / $width));
|
||||
|
||||
// Création d'une nouvelle image virtuelle redimensionnée
|
||||
$virtual_image = imagecreatetruecolor($desired_width, $desired_height);
|
||||
|
||||
// Copie de l'image source dans l'image virtuelle avec redimensionnement
|
||||
imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
|
||||
|
||||
// Enregistrement de l'image redimensionnée au format approprié
|
||||
switch ($mime_type) {
|
||||
case 'image/jpeg':
|
||||
case 'image/jpg':
|
||||
return imagejpeg($virtual_image, $dest);
|
||||
case 'image/png':
|
||||
return imagepng($virtual_image, $dest);
|
||||
case 'image/gif':
|
||||
return imagegif($virtual_image, $dest);
|
||||
case 'image/webp':
|
||||
return imagewebp($virtual_image, $dest);
|
||||
case 'image/avif':
|
||||
if (function_exists('imageavif')) {
|
||||
return imageavif($virtual_image, $dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false; // En cas d'échec
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -1439,18 +1545,67 @@ class common
|
||||
}
|
||||
|
||||
/**
|
||||
* Journalisation
|
||||
* Journalisation avec gestion de la taille maximale et compression
|
||||
*/
|
||||
public function saveLog($message = '')
|
||||
{
|
||||
// Journalisation
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$i18nUI) . ';' . helper::dateUTF8('%H:%M', time(), self::$i18nUI) . ';';
|
||||
// Chemin du fichier journal
|
||||
$logFile = self::DATA_DIR . 'journal.log';
|
||||
|
||||
// Vérifier la taille du fichier
|
||||
if (file_exists($logFile) && filesize($logFile) > self::LOG_MAXSIZE) {
|
||||
$this->rotateLogFile();
|
||||
}
|
||||
|
||||
// Création de l'entrée de journal
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$i18nUI) . ';' .
|
||||
helper::dateUTF8('%H:%M', time(), self::$i18nUI) . ';';
|
||||
$dataLog .= helper::getIp($this->getData(['config', 'connect', 'anonymousIp'])) . ';';
|
||||
$dataLog .= empty($this->getUser('id')) ? 'visitor;' : $this->getUser('id') . ';';
|
||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||
$dataLog .= PHP_EOL;
|
||||
|
||||
// Écriture dans le fichier si la journalisation est activée
|
||||
if ($this->getData(['config', 'connect', 'log'])) {
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
file_put_contents($logFile, $dataLog, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gère la rotation et la compression des fichiers journaux
|
||||
*/
|
||||
private function rotateLogFile()
|
||||
{
|
||||
$logFile = self::DATA_DIR . 'journal.log';
|
||||
|
||||
// Décaler tous les fichiers d'archive existants
|
||||
for ($i = self::LOG_MAXARCHIVE - 1; $i > 0; $i--) {
|
||||
$oldFile = self::DATA_DIR . 'journal-' . $i . '.log.gz';
|
||||
$newFile = self::DATA_DIR . 'journal-' . ($i + 1) . '.log.gz';
|
||||
|
||||
if (file_exists($oldFile)) {
|
||||
if ($i == self::LOG_MAXARCHIVE - 1) {
|
||||
unlink($oldFile); // Supprimer le plus ancien
|
||||
} else {
|
||||
rename($oldFile, $newFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Compresser le fichier journal actuel
|
||||
if (file_exists($logFile)) {
|
||||
$gz = gzopen(self::DATA_DIR . 'journal-1.log.gz', 'w9');
|
||||
$handle = fopen($logFile, 'r');
|
||||
|
||||
while (!feof($handle)) {
|
||||
gzwrite($gz, fread($handle, 8192));
|
||||
}
|
||||
|
||||
fclose($handle);
|
||||
gzclose($gz);
|
||||
|
||||
// Créer un nouveau fichier journal vide
|
||||
file_put_contents($logFile, '');
|
||||
}
|
||||
}
|
||||
|
||||
@ -1460,7 +1615,7 @@ class common
|
||||
* Retourne les contenus d'un utilisateur
|
||||
* @param string $userId identifiant
|
||||
* @param string $serStatus teacher ou student ou admin
|
||||
*
|
||||
* @return array
|
||||
* CETTE FONCTION EST UTILISEE PAR LAYOUT
|
||||
*
|
||||
*/
|
||||
@ -1469,15 +1624,15 @@ class common
|
||||
$courses = $this->getData([('course')]);
|
||||
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
|
||||
$filter = array();
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_ADMIN:
|
||||
switch ($this->getUser('role')) {
|
||||
case self::ROLE_ADMIN:
|
||||
// Affiche tout
|
||||
return $courses;
|
||||
case self::GROUP_EDITOR:
|
||||
case self::ROLE_EDITOR:
|
||||
foreach ($courses as $courseId => $value) {
|
||||
// Affiche les espaces gérés par l'éditeur, les espaces où il participe et les espaces anonymes
|
||||
if (
|
||||
// le membre est inscrit
|
||||
// le membre est inscrit
|
||||
($this->getData(['enrolment', $courseId]) && array_key_exists($this->getUser('id'), $this->getData(['enrolment', $courseId])))
|
||||
// Il est l'auteur
|
||||
|| $this->getUser('id') === $this->getData(['course', $courseId, 'author'])
|
||||
@ -1488,7 +1643,7 @@ class common
|
||||
}
|
||||
}
|
||||
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 (
|
||||
@ -1499,7 +1654,7 @@ class common
|
||||
}
|
||||
}
|
||||
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) {
|
||||
@ -1508,7 +1663,7 @@ class common
|
||||
}
|
||||
return $filter;
|
||||
default:
|
||||
return null;
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1530,5 +1685,4 @@ class common
|
||||
return $this->getData(['user', $userId, 'firstname']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -3,20 +3,17 @@
|
||||
/**
|
||||
* Vérification de la version de PHP
|
||||
*/
|
||||
|
||||
if(version_compare(PHP_VERSION, '7.2.0', '<') ) {
|
||||
exit('PHP 7.2+ mini requis - PHP 7.2+ mini required');
|
||||
|
||||
if (version_compare(PHP_VERSION, '7.2.0', '<')) {
|
||||
displayErrorPage('PHP 7.2+ mini requis - PHP 7.2+ mini required');
|
||||
}
|
||||
|
||||
if ( version_compare(PHP_VERSION, '8.3.999', '>') ) {
|
||||
exit('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
|
||||
if (version_compare(PHP_VERSION, '8.3.999', '>')) {
|
||||
displayErrorPage('PHP 8.3 pas encore supporté, installez PHP 7.n ou PHP 8.1.n - PHP 8.3 not yet supported, install PHP 7.n or PHP 8.1.n');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check les modules installés
|
||||
*/
|
||||
|
||||
$e = [
|
||||
'gd',
|
||||
'json',
|
||||
@ -31,26 +28,57 @@ $e = [
|
||||
];
|
||||
$m = get_loaded_extensions();
|
||||
$b = false;
|
||||
$missingModules = [];
|
||||
foreach ($e as $k => $v) {
|
||||
if (array_search($v,$m) === false) {
|
||||
if (array_search($v, $m) === false) {
|
||||
$b = true;
|
||||
echo '<pre><p>Module PHP : ' . $v . ' manquant - Module PHP ' . $v . ' missing.</p></pre>';
|
||||
$missingModules[] = $v;
|
||||
}
|
||||
}
|
||||
if ($b)
|
||||
exit('<pre><p>ZwiiCMS ne peut pas démarrer ; activez les extensions requises dans PHP.ini- ZwiiCMS cannot start, enabled PHP missing extensions into PHP.ini</p></pre>');
|
||||
/**
|
||||
* Contrôle les htacess
|
||||
*/
|
||||
if ($b) {
|
||||
$errorMessage = 'ZwiiCMS ne peut pas démarrer ; les modules PHP suivants sont manquants : ' . implode(', ', $missingModules) . '<br />';
|
||||
$errorMessage .= 'ZwiiCMS cannot start, the following PHP modules are missing: ' . implode(', ', $missingModules);
|
||||
displayErrorPage($errorMessage);
|
||||
}
|
||||
|
||||
/**
|
||||
* Contrôle les htaccess
|
||||
*/
|
||||
$d = [
|
||||
'',
|
||||
'site/data/',
|
||||
'site/backup/',
|
||||
'site/tmp/',
|
||||
// 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour
|
||||
// 'site/i18n/', pas contrôler pour éviter les pbs de mise à jour
|
||||
];
|
||||
foreach ($d as $key) {
|
||||
if (file_exists($key . '.htaccess') === false)
|
||||
exit('<pre>ZwiiCMS ne peut pas démarrer, le fichier ' .$key . '.htaccess est manquant.<br />ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.</pre>' );
|
||||
if (file_exists($key . '.htaccess') === false) {
|
||||
$errorMessage = 'ZwiiCMS ne peut pas démarrer, le fichier ' . $key . '.htaccess est manquant.<br />';
|
||||
$errorMessage .= 'ZwiiCMS cannot start, file ' . $key . '.htaccess is missing.';
|
||||
displayErrorPage($errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fonction pour afficher une page d'erreur stylisée
|
||||
*/
|
||||
function displayErrorPage($message)
|
||||
{
|
||||
echo '<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Erreur - ZwiiCMS</title>
|
||||
<link rel="stylesheet" href="core\layout\error.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="error-container">
|
||||
<h1>Erreur</h1>
|
||||
<p>' . $message . '</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
exit;
|
||||
}
|
||||
|
@ -4,25 +4,25 @@
|
||||
* Mises à jour suivant les versions de ZwiiCampus
|
||||
*/
|
||||
|
||||
|
||||
// Version 1.7.00
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 1700
|
||||
) {
|
||||
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
|
||||
foreach (['1', '2'] as $group) {
|
||||
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
|
||||
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
|
||||
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
|
||||
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
|
||||
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
|
||||
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
|
||||
foreach (['1', '2'] as $role) {
|
||||
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
|
||||
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
|
||||
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
|
||||
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
|
||||
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
|
||||
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1700]);
|
||||
}
|
||||
|
||||
|
||||
// Version 1.8.00
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 1800
|
||||
) {
|
||||
@ -46,3 +46,90 @@ if (
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1800]);
|
||||
}
|
||||
|
||||
// Version 1.20.02
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 12002
|
||||
) {
|
||||
|
||||
/**
|
||||
* Installe dans le thème du menu la variable hidePages
|
||||
**/
|
||||
// Tableau à insérer
|
||||
$a = [
|
||||
'theme' =>
|
||||
[
|
||||
'menu' => [
|
||||
'hidePages' => false
|
||||
]
|
||||
]
|
||||
];
|
||||
// Parcourir la structure pour écrire dans les fichiers JSON
|
||||
foreach ($this->getData(['course']) as $courseId => $courseValues) {
|
||||
$d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
|
||||
// Insérer la variable hidePages si elle n'existe pas
|
||||
if (isset($d['theme']['menu']['hidePages']) === false) {
|
||||
$result = array_replace_recursive($d, $a);
|
||||
file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
// Forcer la régénération du fichier theme.css
|
||||
if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) {
|
||||
unlink(self::DATA_DIR . $courseId . '/theme.css');
|
||||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 12002]);
|
||||
}
|
||||
|
||||
// Version 1.21.00
|
||||
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 12100
|
||||
) {
|
||||
/**
|
||||
* Renomme la clé dans la base des utilisateurs
|
||||
*/
|
||||
if (
|
||||
is_array($this->getData(['user']))
|
||||
&& empty($this->getData(['user'])) === false
|
||||
) {
|
||||
foreach ($this->getData(['user']) as $userId => $userValue) {
|
||||
$d = $this->getData(['user', $userId]);
|
||||
if (isset($d['group']) && $d['group'] !== '') {
|
||||
$position = array_search('group', array_keys($d)) + 1;
|
||||
$l = array_merge(
|
||||
array_slice($d, 0, $position),
|
||||
['role' => $d['group']],
|
||||
array_slice($d, $position)
|
||||
);
|
||||
unset($l['group']);
|
||||
$this->setData(['user', $userId, $l], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->saveDb('user');
|
||||
|
||||
|
||||
/**
|
||||
* Convertit les pages et les modules
|
||||
*/
|
||||
$courses = array_merge($this->getData(['course']), ['home' => array()]);
|
||||
|
||||
foreach ($courses as $courseId => $courseValue) {
|
||||
// Les pages
|
||||
$filePath = self::DATA_DIR . $courseId . '/page.json';
|
||||
$jsonContent = file_get_contents($filePath);
|
||||
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
|
||||
if ($updatedJsonContent !== $jsonContent) {
|
||||
file_put_contents($filePath, $updatedJsonContent);
|
||||
}
|
||||
|
||||
// Les modules
|
||||
$filePath = self::DATA_DIR . $courseId . '/module.json';
|
||||
$jsonContent = file_get_contents($filePath);
|
||||
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
|
||||
if ($updatedJsonContent !== $jsonContent) {
|
||||
file_put_contents($filePath, $updatedJsonContent);
|
||||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 12100]);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html prefix="og: http://ogp.me/ns#" lang="fr_FR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $layout->showMetaTitle(); ?>
|
||||
<?php $layout->showMetaDescription(); ?>
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -354,6 +354,14 @@ td>.col12 {
|
||||
color: #E74C3C;
|
||||
}
|
||||
|
||||
/* Asterisque des champs obligatoires */
|
||||
.required-field::after {
|
||||
content: '\00204E';
|
||||
color: #E74C3C;
|
||||
margin-left: 4px;
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
|
||||
/* Mauvaise position dans les champs File
|
||||
.inputFile.notice {
|
||||
@ -649,6 +657,7 @@ nav a:hover {
|
||||
|
||||
#menuLeft {
|
||||
display: inline-flex;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#menuRight {
|
||||
@ -1192,6 +1201,7 @@ input[type='datetime-local'],
|
||||
input[type='time'],
|
||||
input[type='month'],
|
||||
input[type='week'],
|
||||
input[type='number'],
|
||||
.inputFile,
|
||||
select,
|
||||
textarea {
|
||||
@ -1217,6 +1227,7 @@ input[type='datetime-local']:hover,
|
||||
input[type='time']:hover,
|
||||
input[type='month']:hover,
|
||||
input[type='week']:hover,
|
||||
input[type='number']:hover,
|
||||
.inputFile:hover,
|
||||
select:hover,
|
||||
textarea:hover {
|
||||
@ -1231,6 +1242,7 @@ input[type='datetime-local'].notice,
|
||||
input[type='time'].notice,
|
||||
input[type='month'].notice,
|
||||
input[type='week'].notice,
|
||||
input[type='number'].notice,
|
||||
.inputFile.notice,
|
||||
select.notice,
|
||||
textarea.notice {
|
||||
@ -1246,6 +1258,7 @@ input[type='datetime-local'].notice:hover,
|
||||
input[type='time'].notice:hover,
|
||||
input[type='month'].notice:hover,
|
||||
input[type='week'].notice:hover,
|
||||
input[type='number'].notice:hover,
|
||||
.inputFile.notice:hover,
|
||||
select.notice:hover,
|
||||
textarea.notice:hover {
|
||||
|
22
core/layout/error.css
Normal file
22
core/layout/error.css
Normal file
@ -0,0 +1,22 @@
|
||||
body {
|
||||
color: #000;
|
||||
font: 75%/1.7em "Helvetica Neue", Helvetica, arial, sans-serif;
|
||||
margin: 0;
|
||||
padding: 80px;
|
||||
background: url('../vendor/zwiico/png/error.png') 30px 30px no-repeat #fff;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
font-size: 300%;
|
||||
margin: 20px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 10px 0;
|
||||
color: #777;
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html prefix="og: http://ogp.me/ns#" lang="fr_FR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $layout->showMetaTitle(); ?>
|
||||
<?php $layout->showMetaDescription(); ?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="fr_FR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html prefix="og: http://ogp.me/ns#" lang="fr_FR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta meta="description=" content="ZwiiCMS le CMS multilingue sans base de données">
|
||||
<meta name="generator" content="ZiiCMS https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@ -35,7 +35,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!-- Barre d'administration -->
|
||||
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
|
||||
<?php if ($this->getUser('role') > self::ROLE_MEMBER) : ?>
|
||||
<?php $layout->showBar(); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Notifications -->
|
||||
@ -47,8 +47,8 @@
|
||||
if (
|
||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') > self::GROUP_MEMBER
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') > self::ROLE_MEMBER
|
||||
) {
|
||||
echo '<nav id="navfixedconnected" >';
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -18,19 +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
|
||||
'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 = [
|
||||
@ -213,7 +214,7 @@ class config extends common
|
||||
* Sitemap compressé et non compressé
|
||||
* Robots.txt
|
||||
*/
|
||||
public function siteMap()
|
||||
public function sitemap()
|
||||
{
|
||||
// La page n'existe pas
|
||||
if (
|
||||
@ -528,11 +529,24 @@ class config extends common
|
||||
'autoDisconnect' => $this->getInput('connectAutoDisconnect', helper::FILTER_BOOLEAN),
|
||||
'captchaType' => $this->getInput('connectCaptchaType'),
|
||||
'showPassword' => $this->getInput('connectShowPassword', helper::FILTER_BOOLEAN),
|
||||
'redirectLogin' => $this->getInput('connectRedirectLogin', helper::FILTER_BOOLEAN)
|
||||
'redirectLogin' => $this->getInput('connectRedirectLogin', helper::FILTER_BOOLEAN),
|
||||
'mailAuth' => $this->getInput('connectAuthMail', helper::FILTER_BOOLEAN),
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
// Sauvegarde la position des onglets de la vue de l'utilisateur courant
|
||||
$this->setData([
|
||||
'user',
|
||||
$this->getUser('id'),
|
||||
'view',
|
||||
[
|
||||
'config' => $this->getInput('containerSelected'),
|
||||
'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']),
|
||||
]
|
||||
]);
|
||||
|
||||
// Efface les fichiers de backup lorsque l'option est désactivée
|
||||
if ($this->getInput('configFileBackup', helper::FILTER_BOOLEAN) === false) {
|
||||
$path = realpath('site/data');
|
||||
@ -592,7 +606,7 @@ class config extends common
|
||||
}
|
||||
}
|
||||
// Générer robots.txt et sitemap
|
||||
$this->siteMap();
|
||||
$this->sitemap();
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Configuration'),
|
||||
@ -972,4 +986,32 @@ class config extends common
|
||||
return getenv('HTTP_MOD_REWRITE') == 'On' || getenv('REDIRECT_STATUS') == '200';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoi un message de test
|
||||
* @return void
|
||||
*/
|
||||
public function testmail()
|
||||
{
|
||||
$sent = $this->sendMail(
|
||||
$this->getUser('mail'),
|
||||
helper::translate('Test de la messagerie du site'),
|
||||
'<strong>' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '</strong>,<br><br>' .
|
||||
'<h4>' . helper::translate('Il semblerait que votre messagerie fonctionne correctement !') . '</h4>',
|
||||
null,
|
||||
'no-reply@localhost'
|
||||
);
|
||||
if ($sent !== true) {
|
||||
// Désactivation de l'authentification par email
|
||||
$this->setData(['config', 'connect', 'mailAuth', 0]);
|
||||
// Journalisation
|
||||
$this->saveLog($sent);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config/' . $this->getUrl(2),
|
||||
'state' => $sent === true ? true : false,
|
||||
'notification' => $sent === true ? helper::translate('Message de test envoyé avec succès') : helper::translate('Message non envoyé')
|
||||
]);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -17,7 +17,8 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres de la sauvegarde'); ?>
|
||||
<h4>
|
||||
<?php echo helper::translate('Paramètres de la sauvegarde'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
@ -27,7 +28,10 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col12">
|
||||
<em>L'archive est générée dans <a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=backup&type=0&akey=<?php echo md5_file(self::DATA_DIR . 'core.json'); ?>&lang=<?php echo $this->getData(['user', $this->getUser('id'), 'language']);?>" data-lity>le dossier Backup</a> du gestionnaire de fichiers.</em>
|
||||
<em>L'archive est générée dans
|
||||
<a href="<?php echo helper::baseUrl(false); ?>core/vendor/filemanager/dialog.php?fldr=backup&type=0&akey=<?php echo md5_file(self::DATA_DIR . 'core.json'); ?>&lang=<?php echo $this->getData(['user', $this->getUser('id'), 'language']); ?>"
|
||||
data-lity>le dossier Backup</a> du gestionnaire de fichiers.
|
||||
</em>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -3,13 +3,7 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Sécurité de la connexion'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/connexion" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php // echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('connectShowPassword', true, 'Dévoiler le mot de passe', [
|
||||
@ -32,43 +26,43 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectAttempt', $module::$connectAttempt, [
|
||||
<?php echo template::select('connectAttempt', config::$connectAttempt, [
|
||||
'label' => 'Limitation des tentatives',
|
||||
'selected' => $this->getData(['config', 'connect', 'attempt'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectTimeout', $module::$connectTimeout, [
|
||||
<?php echo template::select('connectTimeout', config::$connectTimeout, [
|
||||
'label' => 'Blocage après échecs',
|
||||
'selected' => $this->getData(['config', 'connect', 'timeout'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 verticalAlignBottom">
|
||||
<label id="helpBlacklist"><?php echo helper::translate('Liste noire'); ?>
|
||||
<?php echo template::help(
|
||||
'La liste noire énumère les tentatives de connexion à partir de comptes inexistants. Sont stockés : la date, l\'heure, le nom du compte et l\'IP.
|
||||
Après le nombre de tentatives autorisées, l\'IP et le compte sont bloqués.'
|
||||
);
|
||||
?>
|
||||
</label>
|
||||
<?php echo template::button('ConnectBlackListDownload', [
|
||||
'href' => helper::baseUrl() . 'config/blacklistDownload',
|
||||
'value' => 'Télécharger la liste',
|
||||
'ico' => 'download'
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$roleNews), [
|
||||
'label' => 'Validation par clé ⚠️',
|
||||
'selected' => $this->getData(['config', 'connect', 'mailAuth']),
|
||||
'help' => 'La connexion est confirmée à l\'aide d\'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 verticalAlignBottom">
|
||||
<?php echo template::button('CnnectBlackListReset', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'config/blacklistReset',
|
||||
'value' => 'Réinitialiser la liste',
|
||||
'ico' => 'trash'
|
||||
<?php echo template::button('ConfigSendMail', [
|
||||
'href' => helper::baseUrl() . 'config/testmail',
|
||||
'value' => 'Message de test',
|
||||
'ico' => 'mail'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Captcha à la connexion'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('connectCaptcha', true, 'Captcha à la connexion', [
|
||||
<?php echo template::checkbox('connectCaptcha', true, 'Activer', [
|
||||
'checked' => $this->getData(['config', 'connect', 'captcha'])
|
||||
]); ?>
|
||||
</div>
|
||||
@ -79,7 +73,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectCaptchaType', $module::$captchaTypes, [
|
||||
<?php echo template::select('connectCaptchaType', config::$captchaTypes, [
|
||||
'label' => 'Type de captcha',
|
||||
'selected' => $this->getData(['config', 'connect', 'captchaType'])
|
||||
]); ?>
|
||||
@ -92,40 +86,66 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Journalisation'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/journalisation" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php // echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>
|
||||
-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('connectLog', true, 'Activer la journalisation', [
|
||||
'checked' => $this->getData(['config', 'connect', 'log'])
|
||||
]); ?>
|
||||
<div class="col6">
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('connectLog', true, 'Activer la journalisation', [
|
||||
'checked' => $this->getData(['config', 'connect', 'log'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('connectAnonymousIp', config::$anonIP, [
|
||||
'label' => 'Anonymat des adresses IP',
|
||||
'selected' => $this->getData(['config', 'connect', 'anonymousIp']),
|
||||
'help' => 'La règlementation française impose un anonymat de niveau 2'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6 ">
|
||||
<?php echo template::button('ConfigLogDownload', [
|
||||
'href' => helper::baseUrl() . 'config/logDownload',
|
||||
'value' => 'Télécharger le journal',
|
||||
'ico' => 'download'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::button('ConnectLogReset', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'config/logReset',
|
||||
'value' => 'Réinitialiser le journal',
|
||||
'ico' => 'trash'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('connectAnonymousIp', $module::$anonIP, [
|
||||
'label' => 'Anonymat des adresses IP',
|
||||
'selected' => $this->getData(['config', 'connect', 'anonymousIp']),
|
||||
'help' => 'La règlementation française impose un anonymat de niveau 2'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 verticalAlignBottom">
|
||||
<?php echo template::button('ConfigLogDownload', [
|
||||
'href' => helper::baseUrl() . 'config/logDownload',
|
||||
'value' => 'Télécharger le journal',
|
||||
'ico' => 'download'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 verticalAlignBottom">
|
||||
<?php echo template::button('ConnectLogReset', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'config/logReset',
|
||||
'value' => 'Réinitialiser le journal',
|
||||
'ico' => 'trash'
|
||||
]); ?>
|
||||
<div class="col6 verticalAlignBottom">
|
||||
<div class="row">
|
||||
<div class="col6 verticalAlignBottom">
|
||||
<label id="helpBlacklist"><?php echo helper::translate('Liste noire'); ?>
|
||||
<?php echo template::help(
|
||||
'La liste noire énumère les tentatives de connexion à partir de comptes inexistants. Sont stockés : la date, l\'heure, le nom du compte et l\'IP.
|
||||
Après le nombre de tentatives autorisées, l\'IP et le compte sont bloqués.'
|
||||
);
|
||||
?>
|
||||
</label>
|
||||
<?php echo template::button('ConnectBlackListDownload', [
|
||||
'href' => helper::baseUrl() . 'config/blacklistDownload',
|
||||
'value' => 'Télécharger la liste',
|
||||
'ico' => 'download'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6 verticalAlignBottom">
|
||||
<?php echo template::button('CnnectBlackListReset', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'config/blacklistReset',
|
||||
'value' => 'Réinitialiser la liste',
|
||||
'ico' => 'trash'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -66,11 +66,12 @@ $(document).ready(function () {
|
||||
$("#connectCaptchaStrong").prop("checked", false);
|
||||
}
|
||||
|
||||
var configLayout = getCookie("configLayout");
|
||||
if (configLayout == null) {
|
||||
configLayout = "locale";
|
||||
setCookie("configLayout", "locale");
|
||||
let configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (configLayout == "") {
|
||||
configLayout = "setup";
|
||||
}
|
||||
|
||||
$("#localeContainer").hide();
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
@ -83,6 +84,16 @@ $(document).ready(function () {
|
||||
// Gestion des événements
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Transmet le bouton de l'onglet sélectionné avant la soumission
|
||||
*/
|
||||
|
||||
// Mettre à jour le champ caché avant la soumission
|
||||
$('#configForm').on('submit', function () {
|
||||
$('#containerSelected').val(configLayout);
|
||||
});
|
||||
|
||||
/**
|
||||
* Afficher et masquer options smtp
|
||||
*/
|
||||
@ -163,12 +174,12 @@ $(document).ready(function () {
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#localeContainer").show();
|
||||
configLayout = "locale";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").addClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "locale");
|
||||
});
|
||||
$("#configSetupButton").on("click", function () {
|
||||
$("#localeContainer").hide();
|
||||
@ -176,12 +187,12 @@ $(document).ready(function () {
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#setupContainer").show();
|
||||
configLayout = "setup";
|
||||
$("#configSetupButton").addClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "setup");
|
||||
});
|
||||
|
||||
$("#configSocialButton").on("click", function () {
|
||||
@ -190,12 +201,12 @@ $(document).ready(function () {
|
||||
$("#localeContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#socialContainer").show();
|
||||
configLayout = "social";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").addClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "social");
|
||||
});
|
||||
$("#configConnectButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -203,12 +214,12 @@ $(document).ready(function () {
|
||||
$("#socialContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#connectContainer").show();
|
||||
configLayout = "connect";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").addClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "connect");
|
||||
});
|
||||
$("#configNetworkButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -216,12 +227,12 @@ $(document).ready(function () {
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").show();
|
||||
configLayout = "network";
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").addClass("activeButton");
|
||||
setCookie("configLayout", "network");
|
||||
});
|
||||
|
||||
|
||||
@ -246,7 +257,7 @@ $(document).ready(function () {
|
||||
|
||||
// Contrôle l'image Open Screen Graph
|
||||
// Type d'image
|
||||
$("span#screenType").each(function(){
|
||||
$("span#screenType").each(function () {
|
||||
var text = $(this).text();
|
||||
if (text.includes("jpg") || text.includes("jpeg") || text.includes("png")) {
|
||||
$(this).css("color", "green");
|
||||
@ -255,7 +266,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// La largeur
|
||||
$("span#screenWide").each(function(){
|
||||
$("span#screenWide").each(function () {
|
||||
var screenId = parseInt($(this).text());
|
||||
if (screenId >= 1200) {
|
||||
$(this).css("color", "green");
|
||||
@ -264,7 +275,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// La hauteur
|
||||
$("span#screenHeight").each(function(){
|
||||
$("span#screenHeight").each(function () {
|
||||
var screenId = parseInt($(this).text());
|
||||
if (screenId >= 630) {
|
||||
$(this).css("color", "green");
|
||||
@ -273,7 +284,7 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// Le ratio
|
||||
$('span#screenRatio').each(function(){
|
||||
$('span#screenRatio').each(function () {
|
||||
var ratio = parseFloat($(this).text());
|
||||
if (ratio >= 1.90 && ratio <= 1.92) {
|
||||
$(this).css("color", "green");
|
||||
@ -284,17 +295,17 @@ $(document).ready(function () {
|
||||
}
|
||||
});
|
||||
// Le poids
|
||||
$('span#screenWeight').each(function(index){
|
||||
$('span#screenWeight').each(function (index) {
|
||||
var weight = parseFloat($(this).text());
|
||||
var fileType = $('span#screenType').eq(index).text();
|
||||
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
|
||||
$(this).css("color", "green");
|
||||
} else {
|
||||
$(this).css("color", "red");
|
||||
$(this).css("color", "red");
|
||||
}
|
||||
});
|
||||
|
||||
$('span#screenWeight').each(function(index){
|
||||
$('span#screenWeight').each(function (index) {
|
||||
var weight = parseFloat($(this).text());
|
||||
var fileType = $('span#screenType').eq(index).text();
|
||||
|
||||
@ -308,27 +319,6 @@ $(document).ready(function () {
|
||||
});
|
||||
|
||||
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define function to capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
|
@ -7,45 +7,37 @@
|
||||
'value' => template::ico('home')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /**echo template::button('configHelp', [
|
||||
'class' => 'buttonHelp',
|
||||
'href' => 'https://doc.zwiicms.fr/configuration-du-site',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('Submit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab">
|
||||
<?php echo template::button('configLocaleButton', [
|
||||
'value' => 'Identité - Étiquettes',
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('configSetupButton', [
|
||||
'value' => 'Configuration - Outils',
|
||||
'class' => 'buttonTab'
|
||||
'value' => 'Configuration',
|
||||
'class' => 'buttonTab',
|
||||
]); ?>
|
||||
<?php echo template::button('configSocialButton', [
|
||||
'value' => 'Réseaux sociaux',
|
||||
'class' => 'buttonTab'
|
||||
'value' => 'Référencement',
|
||||
'class' => 'buttonTab',
|
||||
]); ?>
|
||||
|
||||
<?php echo template::button('configConnectButton', [
|
||||
'value' => 'Sécurité',
|
||||
'class' => 'buttonTab'
|
||||
'value' => 'Connexion',
|
||||
'class' => 'buttonTab',
|
||||
]); ?>
|
||||
|
||||
<?php echo template::button('configNetworkButton', [
|
||||
'value' => 'Réseau',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
]); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Champ caché pour transmettre l'onglet-->
|
||||
<?php echo template::hidden('containerSelected'); ?>
|
||||
|
||||
<!-- Pages de formulaires -->
|
||||
<?php include('core/module/config/view/locale/locale.php') ?>
|
||||
<?php include('core/module/config/view/setup/setup.php') ?>
|
||||
<?php include('core/module/config/view/social/social.php') ?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -44,21 +44,21 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
|
||||
<?php echo template::select('configLocaleHomePageId', helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC'), [
|
||||
'label' => 'Page d\'accueil de la plate-forme',
|
||||
'selected' => $this->homePageId(),
|
||||
'help' => 'Ce n\'est pas la page d\'accueil d\'un espace.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocalePage403', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocalePage403', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Accès interdit, erreur 403',
|
||||
'selected' => $this->getData(['config', 'page403']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocalePage404', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocalePage404', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Page inexistante, erreur 404',
|
||||
'selected' => $this->getData(['config', 'page404']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
@ -67,14 +67,14 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocaleLegalPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Mentions légales',
|
||||
'selected' => $this->getData(['config', 'legalPageId']),
|
||||
'help' => 'Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configLocaleSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC')), [
|
||||
<?php echo template::select('configLocaleSearchPageId', array_merge(['none' => 'Aucune'], helper::arrayColumn(config::$pagesList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Recherche dans le site',
|
||||
'selected' => $this->getData(['config', 'searchPageId']),
|
||||
'help' => 'Sélectionnez une page contenant le module \'Recherche\'. Une option du pied de page ajoute un lien discret vers cette page.'
|
||||
@ -82,7 +82,7 @@
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php
|
||||
echo template::select('configLocalePage302', array_merge(['none' => 'Page par défaut'], helper::arrayColumn($module::$orphansList, 'title', 'SORT_ASC')), [
|
||||
echo template::select('configLocalePage302', array_merge(['none' => 'Page par défaut'], helper::arrayColumn(config::$orphansList, 'title', 'SORT_ASC')), [
|
||||
'label' => 'Site en maintenance',
|
||||
'selected' => $this->getData(['config', 'page302']),
|
||||
'help' => 'Cette page ne doit pas apparaître dans l\'arborescence du menu. Créez une page orpheline.'
|
||||
|
@ -4,15 +4,10 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Paramètres'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/reseau" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::select('configProxyType', $module::$proxyType, [
|
||||
<?php echo template::select('configProxyType', config::$proxyType, [
|
||||
'label' => 'Type de proxy',
|
||||
'selected' => $this->getData(['config', 'proxyType'])
|
||||
]); ?>
|
||||
@ -25,7 +20,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::text('configProxyPort', [
|
||||
<?php echo template::number('configProxyPort', [
|
||||
'label' => 'Port du proxy',
|
||||
'placeholder' => '6060',
|
||||
'value' => $this->getData(['config', 'proxyPort'])
|
||||
@ -40,11 +35,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('SMTP'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/smtp" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -79,7 +69,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('smtpAuth', $module::$SMTPauth, [
|
||||
<?php echo template::select('smtpAuth', config::$SMTPauth, [
|
||||
'label' => 'Authentification',
|
||||
'selected' => $this->getData(['config', 'smtp', 'auth'])
|
||||
]); ?>
|
||||
@ -97,11 +87,11 @@
|
||||
<?php echo template::password('smtpPassword', [
|
||||
'label' => 'Mot de passe',
|
||||
'autocomplete' => 'off',
|
||||
'value' => $this->getData(['config', 'smtp', 'password'])
|
||||
'value' => $this->getData(['config', 'smtp', 'password'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('smtpSecure', $module::$SMTPEnc, [
|
||||
<?php echo template::select('smtpSecure', config::$SMTPEnc, [
|
||||
'label' => 'Sécurité',
|
||||
'selected' => $this->getData(['config', 'smtp', 'secure'])
|
||||
]); ?>
|
||||
@ -113,3 +103,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -3,12 +3,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres'); ?>
|
||||
<!--<span id="setupHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/parametres" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>-->
|
||||
</span>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
@ -17,7 +11,8 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||
'label' => 'Favicon',
|
||||
'value' => $this->getData(['config', 'favicon'])
|
||||
'value' => $this->getData(['config', 'favicon']),
|
||||
'folder' => $this->getData(['config', 'favicon']) ? dirname($this->getData(['config', 'favicon'])) : ''
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -26,11 +21,12 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||
'label' => 'Favicon thème sombre',
|
||||
'value' => $this->getData(['config', 'faviconDark'])
|
||||
'value' => $this->getData(['config', 'faviconDark']),
|
||||
'folder' => $this->getData(['config', 'faviconDark']) ? dirname($this->getData(['config', 'faviconDark'])) : ''
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('configTimezone', $module::$timezones, [
|
||||
<?php echo template::select('configTimezone', config::$timezones, [
|
||||
'label' => 'Fuseau horaire',
|
||||
'selected' => $this->getData(['config', 'timezone']),
|
||||
'help' => 'Le fuseau horaire est utile au bon référencement'
|
||||
@ -47,8 +43,8 @@
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
||||
'checked' => helper::checkRewrite(),
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'Apache') === false and $module->isModRewriteEnabled()
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => helper::checkServerSoftware() === false and self::isModRewriteEnabled()
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,12 +55,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Mise à jour automatisée'); ?>
|
||||
<!--<span id="updateHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mise-a-jour" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -84,20 +74,20 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('configAutoUpdateDelay', $module::$updateDelay, [
|
||||
<?php echo template::select('configAutoUpdateDelay', config::$updateDelay, [
|
||||
'label' => 'Fréquence de recherche',
|
||||
'selected' => $this->getData(['config', 'autoUpdateDelay']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 offset1 verticalAlignBottom">
|
||||
<pre>Version installée : <strong><?php echo common::ZWII_VERSION ; ?></strong></pre>
|
||||
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) ; ?></strong></pre>
|
||||
<pre>Version installée : <strong><?php echo common::ZWII_VERSION; ?></strong></pre>
|
||||
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL); ?></strong></pre>
|
||||
</div>
|
||||
<div class="col3 offset2 verticalAlignBottom">
|
||||
<?php echo template::button('configUpdateForced', [
|
||||
'ico' => 'download-cloud',
|
||||
'href' => helper::baseUrl() . 'install/update',
|
||||
'value' => $module::$updateButtonText,
|
||||
'value' => config::$updateButtonText,
|
||||
'class' => 'buttonRed',
|
||||
]); ?>
|
||||
</div>
|
||||
@ -109,12 +99,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Maintenance'); ?>
|
||||
<!--<span id="maintenanceHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mode-maintenance" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -169,12 +153,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Scripts externes'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/scripts-externes" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4 offset1 verticalAlignBottom">
|
||||
@ -198,13 +176,21 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
||||
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a
|
||||
href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
||||
</h4>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col12">
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
||||
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0 International.</a></p>
|
||||
<p>Pour voir une copie de cette licence, visitez http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.</p>
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img
|
||||
alt="Licence Creative Commons" style="border-width:0"
|
||||
src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
||||
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license"
|
||||
href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons
|
||||
Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0
|
||||
International.</a></p>
|
||||
<p>Pour voir une copie de cette licence, visitez
|
||||
http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box
|
||||
1866, Mountain View, CA 94042, USA.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Capture d\'écran Open Graph'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -18,29 +13,30 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Image Open Graph',
|
||||
'value' => $this->getData(['config', 'seo', 'openGraphImage']),
|
||||
'folder' => $this->getData(['config', 'seo', 'openGraphImage']) ? dirname($this->getData(['config', 'seo', 'openGraphImage'])) : '',
|
||||
'type' => 1,
|
||||
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
||||
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
||||
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
||||
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
||||
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
||||
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
||||
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
||||
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col10 textAlignCenter">
|
||||
<?php if( !empty($module::$imageOpenGraph['type']) ): ?>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), $module::$imageOpenGraph['wide'], $module::$imageOpenGraph['height'] ); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>' , helper::translate('Ratio'), round($module::$imageOpenGraph['ratio'], 2)); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
||||
</p>
|
||||
<?php if (!empty(config::$imageOpenGraph['type'])): ?>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), config::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), config::$imageOpenGraph['wide'], config::$imageOpenGraph['height']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>', helper::translate('Ratio'), round(config::$imageOpenGraph['ratio'], 2)); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), config::$imageOpenGraph['size']); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -48,10 +44,10 @@
|
||||
<div class="col6">
|
||||
<?php if (
|
||||
$this->getData(['config', 'seo', 'openGraphImage']) &&
|
||||
file_exists(self::FILE_DIR . 'source/' . $this->getData(['config', 'seo', 'openGraphImage']))
|
||||
file_exists(self::FILE_DIR . 'source/' . $this->getData(['config', 'seo', 'openGraphImage']))
|
||||
): ?>
|
||||
<img
|
||||
src="<?php echo self::FILE_DIR . 'source/' . $this->getData(['config', 'seo', 'openGraphImage']); ?>" />
|
||||
src="<?php echo self::FILE_DIR . 'source/' . $this->getData(['config', 'seo', 'openGraphImage']); ?>" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,12 +80,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Réseaux sociaux'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/reseaux-sociaux" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
|
File diff suppressed because it is too large
Load Diff
98
core/module/course/resource/style.css
Normal file
98
core/module/course/resource/style.css
Normal file
@ -0,0 +1,98 @@
|
||||
/* Réinitialisation de base pour supprimer les marges et les espacements par défaut */
|
||||
body, h1, h2, h3, h4, h5, h6, p, ul, ol, li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: Arial, sans-serif;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 20px;
|
||||
padding: 0;
|
||||
background-color: #f5f5f5;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-bottom: 10px;
|
||||
color: #2c3e50;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
ul, ol {
|
||||
margin-bottom: 10px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #3498db;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 0 auto 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.header, .footer {
|
||||
background-color: #34495e;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.header h1, .footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
code {
|
||||
background-color: #f4f4f4;
|
||||
border: 1px solid #e1e1e1;
|
||||
padding: 2px 4px;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
color: #c7254e;
|
||||
display: block;
|
||||
margin-bottom: 10px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #f4f4f4;
|
||||
border: 1px solid #e1e1e1;
|
||||
padding: 10px;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
overflow-x: auto;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* Media Queries pour rendre la page responsive */
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @authorFrédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -31,19 +31,19 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('courseAddAuthor', $module::$courseTeachers, [
|
||||
<?php echo template::select('courseAddAuthor', course::$courseTeachers, [
|
||||
'label' => 'Auteur'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddTheme', $module::$courses, [
|
||||
<?php echo template::select('courseAddTheme', course::$courses, [
|
||||
'label' => 'Copier le thème depuis',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddCategorie', $module::$courseCategories, [
|
||||
<?php echo template::select('courseAddCategorie', course::$courseCategories, [
|
||||
'label' => 'Catégorie',
|
||||
]); ?>
|
||||
</div>
|
||||
@ -57,7 +57,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseAddAccess', $module::$courseAccess, [
|
||||
<?php echo template::select('courseAddAccess', course::$courseAccess, [
|
||||
'label' => 'Accès'
|
||||
]); ?>
|
||||
</div>
|
||||
@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseAddEnrolment', $module::$courseEnrolment, [
|
||||
<?php echo template::select('courseAddEnrolment', course::$courseEnrolment, [
|
||||
'label' => 'Participation'
|
||||
]); ?>
|
||||
</div>
|
||||
@ -87,6 +87,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseAddEnrolmentReport', true, 'Rapport des consultations', [
|
||||
'help' => 'Enregistre une trace des consultations. Ne s\'applique pas à l\'inscription anonyme',
|
||||
'checked' => true
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseAddEnrolmentLimit', true, 'Date de fin d\'inscription', [
|
||||
'help' => 'Ne s\'applique pas à l\'inscription anonyme',
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -15,8 +15,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if($module::$courseCategories): ?>
|
||||
<?php echo template::table([5,5,1,1], $module::$courseCategories, ['Id', 'Titre', '','']); ?>
|
||||
<?php if(course::$courseCategories): ?>
|
||||
<?php echo template::table([5,5,1,1], course::$courseCategories, ['Id', 'Titre', '','']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucune catégorie'); ?>
|
||||
<?php endif; ?>
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @authorFrédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::select('courseEditAuthor', $module::$courseTeachers, [
|
||||
<?php echo template::select('courseEditAuthor', course::$courseTeachers, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'author'])
|
||||
]); ?>
|
||||
@ -33,13 +33,13 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn($module::$pagesList, 'title', 'SORT_ASC'), [
|
||||
<?php echo template::select('courseEditHomePageId', helper::arrayColumn(course::$pagesList, 'title'), [
|
||||
'label' => 'Page d\'accueil',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'homePageId']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('courseEditCategorie', $module::$courseCategories, [
|
||||
<?php echo template::select('courseEditCategorie', course::$courseCategories, [
|
||||
'label' => 'Catégorie',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'category'])
|
||||
]); ?>
|
||||
@ -55,7 +55,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseEditAccess', $module::$courseAccess, [
|
||||
<?php echo template::select('courseEditAccess', course::$courseAccess, [
|
||||
'label' => 'Disponibilité',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'access'])
|
||||
]); ?>
|
||||
@ -77,7 +77,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('courseEditEnrolment', $module::$courseEnrolment, [
|
||||
<?php echo template::select('courseEditEnrolment', course::$courseEnrolment, [
|
||||
'label' => 'Participation',
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'enrolment'])
|
||||
]); ?>
|
||||
@ -90,6 +90,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseEditEnrolmentReport', true, 'Rapport des consultations', [
|
||||
'checked' => $this->getdata(['course', $this->getUrl(2), 'report']),
|
||||
'help' => 'Enregistre une trace des consultations. Ne s\'applique pas à l\'inscription anonyme',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseEditEnrolmentLimit', true, 'Date de fin d\'inscription', [
|
||||
'checked' => $this->getdata(['course', $this->getUrl(2), 'limitEnrolment']),
|
||||
@ -99,7 +105,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::date('courseEditEnrolmentLimitDate', [
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Fermeture',
|
||||
'label' => 'Fin d\'inscription',
|
||||
'value' => is_null($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate'])) ? '' : floor($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate']) / 60) * 60
|
||||
]); ?>
|
||||
</div>
|
||||
|
18
core/module/course/view/export/export.css
Normal file
18
core/module/course/view/export/export.css
Normal 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-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
27
core/module/course/view/export/export.js.php
Normal file
27
core/module/course/view/export/export.js.php
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Quand le bouton "Cocher toutes" est cliqué
|
||||
$('#courseExportSelectAll').on('click', function() {
|
||||
// Cocher toutes les checkboxes avec la classe 'courseManageCheckbox'
|
||||
$('.courseManageCheckbox').prop('checked', true);
|
||||
});
|
||||
|
||||
// Quand le bouton "Décocher toutes" est cliqué
|
||||
$('#courseExportSelectNone').on('click', function() {
|
||||
// Décocher toutes les checkboxes avec la classe 'courseManageCheckbox'
|
||||
$('.courseManageCheckbox').prop('checked', false);
|
||||
});
|
||||
});
|
42
core/module/course/view/export/export.php
Normal file
42
core/module/course/view/export/export.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php echo template::formOpen('courseExportForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseExportBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course/manage/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('courseExportSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseExportSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('courseExportSubmit', [
|
||||
'value' => 'Valider'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Sélection des pages de l\'espace') ?></h4>
|
||||
<div class='row'>
|
||||
<div class='col10 offset2'>
|
||||
<?php foreach (course::$pagesList as $key => $value) {
|
||||
echo $value;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -18,6 +18,7 @@ $(document).ready(function () {
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 2,
|
||||
|
@ -7,16 +7,6 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset8">
|
||||
<?php if ($this->getUser('permission', 'course', 'add') === true): ?>
|
||||
<?php echo template::button('courseAdd', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'course/add',
|
||||
'value' => template::ico('plus'),
|
||||
'help' => 'Ajouter un espace'
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php if ($this->getUser('permission', 'course', 'category') === true): ?>
|
||||
<?php echo template::button('courseCategory', [
|
||||
'href' => helper::baseUrl() . 'course/category',
|
||||
@ -33,11 +23,20 @@
|
||||
'help' => 'Restaurer un espace'
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php if ($this->getUser('permission', 'course', 'add') === true): ?>
|
||||
<?php echo template::button('courseAdd', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'course/add',
|
||||
'value' => template::ico('plus'),
|
||||
'help' => 'Ajouter un espace'
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courses): ?>
|
||||
<?php echo template::table([4, 3, 3, 1, 1], $module::$courses, ['Titre court', 'Description', 'Inscription', '', '',], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courses): ?>
|
||||
<?php echo template::table([4, 3, 3, 1, 1], course::$courses, ['Titre court', 'Description', 'Inscription', '', '',], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun espace'); ?>
|
||||
<?php endif; ?>
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -14,7 +14,8 @@
|
||||
'class' => 'courseDelete buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/delete/' . $this->getUrl(2),
|
||||
'value' => 'Supprimer',
|
||||
'ico' => 'trash'
|
||||
'ico' => 'trash',
|
||||
'help' => 'Supprime l\'espace et les historiques des participants',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -24,7 +25,8 @@
|
||||
'class' => 'courseReset buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/reset/' . $this->getUrl(2),
|
||||
'value' => 'Réinitaliser',
|
||||
'ico' => 'cancel'
|
||||
'ico' => 'cancel',
|
||||
'help' => 'Désinscrit les participants et supprime les historiques',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -33,7 +35,8 @@
|
||||
<?php echo template::button('courseManageDownload' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/backup/' . $this->getUrl(2),
|
||||
'value' => 'Sauvegarder',
|
||||
'ico' => 'download-cloud'
|
||||
'ico' => 'download-cloud',
|
||||
'help' => 'Génère une copie de sauvegarde de l\'espace',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -42,7 +45,8 @@
|
||||
<?php echo template::button('courseManageDuplicate' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/clone/' . $this->getUrl(2),
|
||||
'value' => 'Cloner',
|
||||
'ico' => 'clone'
|
||||
'ico' => 'clone',
|
||||
'help' => 'Copie l\'espace et son contenu sans les participants et leurs historiques',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -51,7 +55,18 @@
|
||||
<?php echo template::button('courseManageEdit' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/edit/' . $this->getUrl(2),
|
||||
'value' => 'Éditer',
|
||||
'ico' => 'pencil'
|
||||
'ico' => 'pencil',
|
||||
'help' => 'Modifie les paramètres de l\'espace',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getUser('permission', 'course', 'export') === true): ?>
|
||||
<div class="col2">
|
||||
<?php echo template::button('courseManageExport' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/export/' . $this->getUrl(2),
|
||||
'value' => 'Exporter HTML',
|
||||
'ico' => 'upload',
|
||||
'help' => 'Le contenu de l\'espace est exporté dans une page web autonome',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@ -83,14 +98,14 @@
|
||||
<div class="col6">
|
||||
<?php echo template::text('courseManageHomePageId', [
|
||||
'label' => 'Page d\'accueil',
|
||||
'value' => $module::$pagesList[$this->getdata(['course', $this->getUrl(2), 'homePageId'])]['shortTitle'],
|
||||
'value' => course::$pagesList[$this->getdata(['course', $this->getUrl(2), 'homePageId'])]['shortTitle'],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('courseManageCategorie', [
|
||||
'label' => 'Catégorie',
|
||||
'value' => $module::$courseCategories[$this->getdata(['course', $this->getUrl(2), 'category'])],
|
||||
'value' => course::$courseCategories[$this->getdata(['course', $this->getUrl(2), 'category'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
@ -108,7 +123,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageAccess', [
|
||||
'label' => 'Disponibilité',
|
||||
'value' => $module::$courseAccess[$this->getdata(['course', $this->getUrl(2), 'access'])],
|
||||
'value' => course::$courseAccess[$this->getdata(['course', $this->getUrl(2), 'access'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
@ -133,7 +148,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageEnrolment', [
|
||||
'label' => 'Participation',
|
||||
'value' => $module::$courseEnrolment[$this->getdata(['course', $this->getUrl(2), 'enrolment'])],
|
||||
'value' => course::$courseEnrolment[$this->getdata(['course', $this->getUrl(2), 'enrolment'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
@ -146,6 +161,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseManageEnrolmentReport', true, 'Rapport des consultations', [
|
||||
'checked' => $this->getdata(['course', $this->getUrl(2), 'report']),
|
||||
'help' => 'Ne s\'applique pas à l\'inscription anonyme',
|
||||
'disabled' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseManageEnrolmentLimit', true, 'Date de fin d\'inscription', [
|
||||
'checked' => $this->getdata(['course', $this->getUrl(2), 'limitEnrolment']),
|
||||
@ -156,7 +178,7 @@
|
||||
<div class="col4">
|
||||
<?php echo template::date('courseManageEnrolmentLimitDate', [
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Fermeture',
|
||||
'label' => 'Fin d\'inscription',
|
||||
'value' => is_null($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate'])) ? '' : floor($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate']) / 60) * 60,
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -3,17 +3,17 @@
|
||||
<div class="col12">
|
||||
<?php echo "<h3>Auteur : " . $this->signature($this->getData(['course', $this->getUrl(2), 'author'])) . "</h3>"; ?>
|
||||
<?php echo "<p>Description : " . $this->getData(['course', $this->getUrl(2), 'description']) . "</p>"; ?>
|
||||
<!--Restriction de date limite d'ouverture-->
|
||||
<?php echo "<p>Disponibilité : " . $module::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === $module::COURSE_ACCESS_DATE): ?>
|
||||
<!--Restriction de date limite d'ouverture-->
|
||||
<?php echo "<p>Disponibilité : " . course::$courseAccess[$this->getData(['course', $this->getUrl(2), 'access'])]; ?>
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === course::COURSE_ACCESS_DATE): ?>
|
||||
<?php $from = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate']), self::$i18nUI); ?>
|
||||
<?php $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate']), self::$i18nUI); ?>
|
||||
<?php echo sprintf(helper::translate(' du %s au %s'), $from, $to); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo '</p>'; ?>
|
||||
<?php echo "<p>Inscription : " . $module::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?>
|
||||
<!--Restriction de date limite d'insription-->
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()):?>
|
||||
<?php echo "<p>Inscription : " . course::$courseEnrolment[$this->getData(['course', $this->getUrl(2), 'enrolment'])] . '.'; ?>
|
||||
<!--Restriction de date limite d'insription-->
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true && $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time()): ?>
|
||||
<?php echo helper::translate(' Les inscriptions sont closes depuis le ') ?>
|
||||
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
@ -22,12 +22,12 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php if ($module::$swapMessage['enrolmentKey']) {
|
||||
echo $module::$swapMessage['enrolmentKey'];
|
||||
<?php if (course::$swapMessage['enrolmentKey']) {
|
||||
echo course::$swapMessage['enrolmentKey'];
|
||||
}
|
||||
?>
|
||||
<?php if ($module::$swapMessage['enrolmentMessage']) {
|
||||
echo $module::$swapMessage['enrolmentMessage'];
|
||||
<?php if (course::$swapMessage['enrolmentMessage']) {
|
||||
echo course::$swapMessage['enrolmentMessage'];
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<?php if ($module::$swapMessage['submitLabel'] === 'Connexion'): ?>
|
||||
<?php if (course::$swapMessage['submitLabel'] === 'Connexion'): ?>
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::button('courseConnect', [
|
||||
'href' => helper::baseUrl(true) . 'user/login',
|
||||
@ -49,13 +49,12 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="col3 offset7">
|
||||
<?php echo template::submit('courseSwapSubmit', [
|
||||
'value' => $module::$swapMessage['submitLabel'],
|
||||
'disabled' => !($module->courseIsAvailable($this->getUrl(2))
|
||||
<div class="col5 offset5">
|
||||
<?php echo template::submit('courseSwapSubmit', [
|
||||
'value' => course::$swapMessage['submitLabel'],
|
||||
'disabled' => course::$courseAvailable === false
|
||||
&& !($this->getData(['course', $this->getUrl(2), 'limitEnrolment']) === true
|
||||
&& $this->getData(['course', $this->getUrl(2), 'limitEnrolmentDate']) <= time())
|
||||
),
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,16 +6,16 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
var dataX = <?php echo json_encode(array_map(function ($item) { return $item[0]; }, $module::$userGraph)); ?>;
|
||||
var dataY = <?php echo json_encode(array_map(function ($item) { return $item[1];}, $module::$userGraph)); ?>;
|
||||
var dataText = <?php echo json_encode(array_map(function ($item) { return $item[2];}, $module::$userGraph)); ?>;
|
||||
var dataX = <?php echo json_encode(array_map(function ($item) { return $item[0]; }, course::$userGraph)); ?>;
|
||||
var dataY = <?php echo json_encode(array_map(function ($item) { return $item[1];}, course::$userGraph)); ?>;
|
||||
var dataText = <?php echo json_encode(array_map(function ($item) { return $item[2];}, course::$userGraph)); ?>;
|
||||
|
||||
var data = [{
|
||||
x: dataX,
|
||||
|
@ -2,15 +2,18 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserHistoryBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
// Le retour est différent selon que c'est un admin ou un tuteur ou l'utilisateur lui-même
|
||||
'href' => $this->getUser('role') === self::ROLE_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset10">
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
'href' => helper::baseUrl() . 'course/userHistoryExport/' . $this->getUrl(2) . '/' . $this->getUrl(3),
|
||||
<?php echo template::button('userReportExportAll', [
|
||||
'href' => helper::baseUrl() . 'course/userReportExport/' . $this->getUrl(2) . '/' . $this->getUrl(3),
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Exporter',
|
||||
'help' => 'Exporter rapport',
|
||||
// Le memebre ne peut pas exporter
|
||||
'disabled' => $this->getUser('role') === self::ROLE_MEMBER
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -20,7 +23,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userReport): ?>
|
||||
<?php if (course::$userReport): ?>
|
||||
<div class="row">
|
||||
<div class="col4 offset2">
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === self::COURSE_ACCESS_DATE): ?>
|
||||
@ -34,19 +37,19 @@
|
||||
</div>
|
||||
<div class="col4">
|
||||
<p>Commencé le :
|
||||
<?php echo $module::$userStat['floor']; ?>
|
||||
<?php echo course::$userStat['floor']; ?>
|
||||
</p>
|
||||
<p>Terminé le :
|
||||
<?php echo $module::$userStat['top']; ?>
|
||||
<?php echo course::$userStat['top']; ?>
|
||||
</p>
|
||||
<p>Temps passé :
|
||||
<?php echo $module::$userStat['time']; ?>
|
||||
<?php echo course::$userStat['time']; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([6, 3, 3], $module::$userReport, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
<?php echo template::table([6, 3, 3], course::$userReport, ['Page', 'Début de Consultation', 'Temps consultation']); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -21,7 +21,6 @@ $(document).ready((function () {
|
||||
$(location).attr("href", _this.attr("href"))
|
||||
}))
|
||||
}));
|
||||
$.fn.dataTable.moment( 'DD/MM/YYYY' );
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
@ -29,13 +28,29 @@ $(document).ready((function () {
|
||||
order: [[3, 'desc']],
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 6,
|
||||
targets: 2,
|
||||
type: 'datetime',
|
||||
searchable: false,
|
||||
render: function (data, type, row) {
|
||||
if (type === 'display') {
|
||||
if (typeof data === 'number' || !isNaN(data)) {
|
||||
return moment(Number(data) * 1000).format('DD/MM/YYYY HH:mm');
|
||||
} else {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
// Pour le tri, retournez la valeur au format ISO
|
||||
return moment(Number(data) * 1000).toISOString();
|
||||
}
|
||||
},
|
||||
{
|
||||
targets: 5,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
|
||||
}));
|
@ -8,16 +8,16 @@
|
||||
</div>
|
||||
<div class="col1 offset8">
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
'href' => helper::baseUrl() . 'course/usersHistoryExport/' . $this->getUrl(2),
|
||||
'href' => helper::baseUrl() . 'course/usersReportExport/' . $this->getUrl(2),
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Exporter',
|
||||
'help' => 'Exporter rapports',
|
||||
]) ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
'class' => 'userDeleteAll buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/usersDelete/' . $this->getUrl(2),
|
||||
'value' => template::ico('users'),
|
||||
'value' => template::ico('user-times'),
|
||||
'help' => 'Désinscrire en masse',
|
||||
])?>
|
||||
</div>
|
||||
@ -25,7 +25,7 @@
|
||||
<?php echo template::button('userDeleteAll', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'course/usersAdd/' . $this->getUrl(2),
|
||||
'value' => template::ico('users'),
|
||||
'value' => template::ico('user-plus'),
|
||||
'help' => 'Inscription en masse',
|
||||
]) ?>
|
||||
</div>
|
||||
@ -33,27 +33,27 @@
|
||||
<?php echo template::formOpen('courseFilterUserForm'); ?>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Rôles/ Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([3, 4, 1, 1, 1, 1, 1], $module::$courseUsers, ['Nom Prénom', 'Dernière page vue', 'Date' , 'Heure', 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([3, 3, 2, 2, 1, 1], course::$courseUsers, ['Nom Prénom', 'Dernière consultation', 'Date' , 'Étiquette', 'Progression', ''], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun participant'); ?>
|
||||
<?php endif; ?>
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -40,6 +40,7 @@ $(document).ready((function () {
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 0,
|
||||
|
@ -7,47 +7,47 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset8">
|
||||
<?php echo template::button('courseUserAddSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserAddSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('courseUsersAddSubmit', [
|
||||
'value' => '',
|
||||
'value' => 'Inscrire',
|
||||
'ico' => 'plus',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Rôles/ Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset1 verticalAlignBottom">
|
||||
<?php echo template::button('courseUserAddSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 verticalAlignBottom">
|
||||
<?php echo template::button('courseUserAddSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], course::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -39,6 +39,7 @@ $(document).ready((function () {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
},
|
||||
locale: 'fr',
|
||||
"lengthMenu": [[10, 25, 50, 100, 299, -1], [10, 25, 50, 100, 200, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 0,
|
||||
|
@ -7,48 +7,48 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset8">
|
||||
<?php echo template::button('courseUserDeleteSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserDeleteSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('courseUsersDeleteSubmit', [
|
||||
'class' => 'buttonRed',
|
||||
'ico' => '',
|
||||
'value' => template::ico('minus'),
|
||||
'ico' => 'minus',
|
||||
'value' => 'Désinscrire',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="Bfrtip">
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterGroup', $module::$courseGroups, [
|
||||
'label' => 'Groupes / Profils',
|
||||
<?php echo template::select('courseFilterGroup', course::$courseGroups, [
|
||||
'label' => 'Rôles/ Profils',
|
||||
'selected' => isset($_POST['courseFilterGroup']) ? $_POST['courseFilterGroup'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterFirstName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterFirstName', course::$alphabet, [
|
||||
'label' => 'Prénom commence par',
|
||||
'selected' => isset($_POST['courseFilterFirstName']) ? $_POST['courseFilterFirstName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('courseFilterLastName', $module::$alphabet, [
|
||||
<?php echo template::select('courseFilterLastName', course::$alphabet, [
|
||||
'label' => 'Nom commence par',
|
||||
'selected' => isset($_POST['courseFilterLastName']) ? $_POST['courseFilterLastName'] : 'all',
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset1 verticalAlignBottom">
|
||||
<?php echo template::button('courseUserDeleteSelectAll', [
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 verticalAlignBottom">
|
||||
<?php echo template::button('courseUserDeleteSelectNone', [
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], $module::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php if (course::$courseUsers): ?>
|
||||
<?php echo template::table([1, 2, 3, 3, 3], course::$courseUsers, ['', 'Id', 'Prénom', 'Nom', 'Étiquettes'], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun inscrit'); ?>
|
||||
<?php endif; ?>
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -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
|
||||
@ -119,6 +119,8 @@ class install extends common
|
||||
// Validation de la langue transmise
|
||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||
self::$i18nUI = array_key_exists(self::$i18nUI, self::$languages) ? self::$i18nUI : 'fr_FR';
|
||||
// Stockage de la langue par défaut afin d'afficher le site dans cette langue lors de l'affichage de la bannière de connexion.
|
||||
$this->setData(['config', 'defaultLanguageUI', self::$i18nUI], false);
|
||||
|
||||
// Création du dossier de contenu avec le marqueur de langue par défaut
|
||||
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT'])) {
|
||||
@ -133,7 +135,7 @@ class install extends common
|
||||
[
|
||||
'firstname' => $userFirstname,
|
||||
'forgot' => 0,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'role' => self::ROLE_ADMIN,
|
||||
'profil' => 0,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => 'Admin',
|
||||
@ -158,9 +160,9 @@ class install extends common
|
||||
);
|
||||
|
||||
// Sauvegarder la configuration du Proxy
|
||||
$this->setData(['config', 'proxyType', $this->getInput('installProxyType')]);
|
||||
$this->setData(['config', 'proxyUrl', $this->getInput('installProxyUrl')]);
|
||||
$this->setData(['config', 'proxyPort', $this->getInput('installProxyPort', helper::FILTER_INT)]);
|
||||
$this->setData(['config', 'proxyType', $this->getInput('installProxyType')], false);
|
||||
$this->setData(['config', 'proxyUrl', $this->getInput('installProxyUrl')], false);
|
||||
$this->setData(['config', 'proxyPort', $this->getInput('installProxyPort', helper::FILTER_INT)], false);
|
||||
|
||||
// Images exemples livrées dans tous les cas
|
||||
try {
|
||||
@ -203,7 +205,7 @@ class install extends common
|
||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||
|
||||
// Fixe l'adresse from pour les envois d'email
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])], false);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -212,9 +214,10 @@ class install extends common
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('config');
|
||||
|
||||
// Affichage du formulaire
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_LAYOUT_LIGHT,
|
||||
|
@ -64,7 +64,7 @@ class init extends common
|
||||
]
|
||||
],
|
||||
'core' => [
|
||||
'dataVersion' => 1700,
|
||||
'dataVersion' => 12002,
|
||||
'lastBackup' => 0,
|
||||
'lastClearTmp' => 0,
|
||||
'lastAutoUpdate' => 0,
|
||||
@ -246,7 +246,7 @@ class init extends common
|
||||
'manage' => false,
|
||||
'users' => false,
|
||||
'userHistory' => false,
|
||||
'userHistoryExport' => false,
|
||||
'userReportExport' => false,
|
||||
'usersAdd' => false,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
@ -343,7 +343,7 @@ class init extends common
|
||||
'manage' => false,
|
||||
'users' => false,
|
||||
'userHistory' => false,
|
||||
'userHistoryExport' => false,
|
||||
'userReportExport' => false,
|
||||
'usersAdd' => false,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
@ -445,7 +445,7 @@ class init extends common
|
||||
'manage' => true,
|
||||
'users' => true,
|
||||
'userHistory' => true,
|
||||
'userHistoryExport' => true,
|
||||
'userReportExport' => true,
|
||||
'usersAdd' => true,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
@ -543,7 +543,7 @@ class init extends common
|
||||
'manage' => true,
|
||||
'users' => true,
|
||||
'userHistory' => true,
|
||||
'userHistoryExport' => true,
|
||||
'userReportExport' => true,
|
||||
'usersAdd' => true,
|
||||
'userDelete' => true,
|
||||
'usersDelete' => true,
|
||||
@ -645,7 +645,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Accueil',
|
||||
@ -676,7 +676,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 6,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Contact',
|
||||
@ -707,7 +707,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Mentions légales',
|
||||
@ -739,7 +739,7 @@ class init extends common
|
||||
'modulePosition' => '',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Maintenance en cours',
|
||||
@ -771,7 +771,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 403',
|
||||
@ -802,7 +802,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 404',
|
||||
@ -903,7 +903,8 @@ class init extends common
|
||||
'selectSpace' => true,
|
||||
'burgerLogo' => '',
|
||||
'burgerContent' => 'title',
|
||||
'width' => 'container'
|
||||
'width' => 'container',
|
||||
'hidePages' => false,
|
||||
],
|
||||
'site' => [
|
||||
'backgroundColor' => 'rgba(255, 255, 255, 1)',
|
||||
@ -937,7 +938,7 @@ class init extends common
|
||||
'config' => [
|
||||
'button' => '',
|
||||
'captcha' => true,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'role' => self::ROLE_ADMIN,
|
||||
'pageId' => '',
|
||||
'subject' => ''
|
||||
],
|
||||
@ -1064,7 +1065,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Sommaire',
|
||||
@ -1095,7 +1096,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Première page',
|
||||
@ -1126,7 +1127,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Seconde page',
|
||||
@ -1157,7 +1158,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Troisième page',
|
||||
@ -1188,7 +1189,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => 0,
|
||||
'role' => 0,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Menu',
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"'Ne pas afficher' crée une page orpheline non accessible par le biais des menus.": "'Do not display' creates an orphan page not accessible through menus.",
|
||||
"'Sauvegarder et télécharger les données du module": "'Save and download module data",
|
||||
"1 jour": "1 jour",
|
||||
"1 jour": "1 day",
|
||||
"1/4 : Préparation...": "1/4: preparation ...",
|
||||
"10 minutes": "10 minutes",
|
||||
"10 tentatives": "10 attempts",
|
||||
@ -31,7 +31,7 @@
|
||||
"Adaptation": "Adaptation",
|
||||
"Administrateur": "Administrator",
|
||||
"Administration": "Administration",
|
||||
"Adresse SMTP": "SMTP Address",
|
||||
"Adresse SMTP": "SMTP address",
|
||||
"Adresse du proxy": "Proxy address",
|
||||
"Adresse électronique": "email address",
|
||||
"Affectation": "Assignment",
|
||||
@ -60,10 +60,10 @@
|
||||
"Archive copiée dans le dossier Modules du gestionnaire de fichier": "Archive copied in the Modules folder",
|
||||
"Archive de thème invalide": "Invalid theme archive",
|
||||
"Archive invalide": "Invalid archive",
|
||||
"Archive invalide, l'écriture dans le dossier core est interdite": "Invalid archive, writing in the core file is prohibited",
|
||||
"Archive invalide, l'écriture dans le dossier core est interdite": "Invalid archive, writing in the core folder is prohibited",
|
||||
"Archive invalide, le descripteur est absent": "Invalid archive, the descriptor is absent",
|
||||
"Archive invalide, le fichier de classe est absent": "Invalide archive, the class file is absent",
|
||||
"Archive invalide, les dossiers ne correspondent pas au descripteur": "Invalid archive, the files do not correspond to the descriptor",
|
||||
"Archive invalide, le fichier de classe est absent": "Invalid archive, the class file is absent",
|
||||
"Archive invalide, les dossiers ne correspondent pas au descripteur": "Invalid archive, the files do not match the descriptor",
|
||||
"Archive non spécifiée ou introuvable": "Archive not specified or not found",
|
||||
"Archive à restaurer": "Archive to restore",
|
||||
"Arrière plan": "Background",
|
||||
@ -86,7 +86,7 @@
|
||||
"Aucune liste noire à télécharger": "No blacklist to download",
|
||||
"Auteur :": "Author:",
|
||||
"Authentification": "Authentication",
|
||||
"Automatique": "Automatique",
|
||||
"Automatique": "Automatic",
|
||||
"Autoriser les robots à référencer le site": "Allow robots to reference the site",
|
||||
"Autorisé": "Allowed",
|
||||
"Avant la bannière": "Before the banner",
|
||||
@ -104,9 +104,9 @@
|
||||
"Barre latérale": "Sidebar",
|
||||
"Barre latérale droite :": "Right sidebar:",
|
||||
"Barre latérale gauche :": "Left sidebar:",
|
||||
"Barres latérales": "Side bars",
|
||||
"Barres latérales": "Sidebars",
|
||||
"Bienvenue %s %s": "Welcome %s %s",
|
||||
"Blocage après échecs": "Blocking after chess",
|
||||
"Blocage après échecs": "Blocking after failure",
|
||||
"Blog": "Blog",
|
||||
"Bords arrondis": "Rounded edges",
|
||||
"Bordure des blocs": "Blocks border",
|
||||
@ -122,16 +122,16 @@
|
||||
"Caché": "Hidden",
|
||||
"Cachée": "Hidden",
|
||||
"Captcha complexe": "Complex captcha",
|
||||
"Captcha à la connexion": "Captcha at connecting",
|
||||
"Captcha à la connexion": "Captcha",
|
||||
"Captcha, identifiant ou mot de passe incorrects": "Incorrect captcha, login or password",
|
||||
"Capture d'écran Open Graph": "Open Graph screenshot",
|
||||
"Capture d'écran générée avec succès": "Successful generated screenshot",
|
||||
"Casse": "Case",
|
||||
"Catalogue": "Store",
|
||||
"Catégorie": "Category",
|
||||
"Ce membre pourra téléverser ou télécharger des fichiers dans le dossier 'partage' et ses sous-dossiers": "This member upload or download files in the 'Sharing' folder and its subfolders",
|
||||
"Ce membre pourra téléverser ou télécharger des fichiers dans le dossier 'partage' et ses sous-dossiers": "This member can upload or download files in the 'Sharing' folder and its subfolders",
|
||||
"Cette page ne doit pas apparaître dans l'arborescence du menu. Créez une page orpheline.": "This page should not appear in the menu tree. Create an orphan page.",
|
||||
"Cette redirection ne concerne que les pages d'administration du site.": "This redirection only concerns the administration pages of the site.",
|
||||
"Cette redirection ne concerne que les pages d'administration du site.": "This redirection only concerns the site administration pages.",
|
||||
"Chaîne Youtube": "Youtube channel",
|
||||
"Chiffres": "Numbers",
|
||||
"Cible": "Target",
|
||||
@ -158,8 +158,8 @@
|
||||
"Consulter l'aide en ligne": "Online help",
|
||||
"Contents": "Contents",
|
||||
"Contenu": "Contents",
|
||||
"Contenu HTML": "HTML contents",
|
||||
"Contenu avancé": "Advanced contents",
|
||||
"Contenu HTML": "HTML content",
|
||||
"Contenu avancé": "Advanced content",
|
||||
"Contenu du menu vertical": "Vertical menu content",
|
||||
"Contrôle total": "Full control",
|
||||
"Cookies": "Cookies",
|
||||
@ -174,7 +174,7 @@
|
||||
"Couleur de fond automatique": "Automatic background color",
|
||||
"Couleur icône haut de page": "Color of top page icon",
|
||||
"Couleur texte page active": "Active page text color",
|
||||
"Couleur unie ou papier-peint": "United color or wallpaper",
|
||||
"Couleur unie ou papier-peint": "Plain color or wallpaper",
|
||||
"Couleur visible en l'absence d'une image.<br />Le curseur horizontal règle le niveau de transparence.": "Visible color in the absence of an image. <br /> The horizontal cursor regulates the level of transparency.",
|
||||
"Couleur visible en l'absence d'une image.<br />Le curseur horizontal règle le niveau de transparence. La couleur du texte est automatique.": "Visible color in the absence of an image. <br /> The horizontal cursor regulates the level of transparency. The color of the text is automatic.",
|
||||
"Couleurs": "Colors",
|
||||
@ -190,8 +190,8 @@
|
||||
"Dossier": "Folder",
|
||||
"Droits sur les dossiers": "Folder authorizations",
|
||||
"Droits sur les fichiers": "File authorizations",
|
||||
"Dupliquer": "Duplicate",
|
||||
"Dupliquer la page": "Duplicate the page",
|
||||
"Dupliquer": "Clone",
|
||||
"Dupliquer la page": "Clone page",
|
||||
"Déconnecte les sessions ouvertes précédemment sur d'autres navigateurs ou terminaux. Activation recommandée.": "Disconnects the previously opened sessions on other browsers or terminals. Recommended activation.",
|
||||
"Déconnecter": "Disconnect",
|
||||
"Déconnexion !": "Logout!",
|
||||
@ -199,7 +199,7 @@
|
||||
"Définir par défaut": "Set as default",
|
||||
"Dévoiler le mot de passe": "Reveal the password",
|
||||
"Effacer": "Delete",
|
||||
"Effacer la page": "Delete the page",
|
||||
"Effacer la page": "Delete page",
|
||||
"Effacer tous les commentaires": "Delete all Comments",
|
||||
"Effacer toutes les statistiques": "Delete all statistics",
|
||||
"Effacer un commentaire": "Delete Comment",
|
||||
@ -212,9 +212,9 @@
|
||||
"En cas de changement de module, les données du module précédent seront supprimées.": "In the event of a module change, data from the previous module will be deleted.",
|
||||
"En dessous du site": "Below the site",
|
||||
"En haut au centre": "Top in the center",
|
||||
"En haut à droite": "Top right",
|
||||
"En haut à gauche": "On the top corner left",
|
||||
"En position libre ajoutez le module en plaçant [MODULE] à l'endroit voulu dans votre page.": "In free position add the module by placing [module] to the desired location in your page.",
|
||||
"En haut à droite": "Top right corner",
|
||||
"En haut à gauche": "Top left corner",
|
||||
"En position libre ajoutez le module en plaçant [MODULE] à l'endroit voulu dans votre page.": "In free position add the module by placing [MODULE] to the desired location in your page.",
|
||||
"En-dehors du site": "Outside the site",
|
||||
"Enregistrer": "Save",
|
||||
"Envoyer un message de confirmation": "Send a confirmation message",
|
||||
@ -226,7 +226,7 @@
|
||||
"Erreur de lecture, vérifiez les permissions": "Reading error, check permissions",
|
||||
"Erreur inconnue": "unknown error",
|
||||
"Erreur inconnue, le module n'est pas installé": "Unknown error, the module is not installed",
|
||||
"Export CSV": "Export CSV",
|
||||
"Export CSV": "CSV Export",
|
||||
"Expéditeur": "From",
|
||||
"Extension": "Extension",
|
||||
"Extraire": "Extract",
|
||||
@ -260,10 +260,10 @@
|
||||
"Grande": "Large",
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Fetter",
|
||||
"Groupe": "Group",
|
||||
"Groupe associé": "Associated Group",
|
||||
"Groupe requis pour accéder à la page :": "Group required to access the page:",
|
||||
"Gras": "Bold",
|
||||
"Rôle": "role",
|
||||
"Rôle associé": "Associated role",
|
||||
"Rôle requis pour accéder à la page :": "role required to access the page:",
|
||||
"Groupes": "Groups",
|
||||
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
|
||||
"Générer une capture Open Graph": "Generate an Open Graph capture",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "Import into",
|
||||
"Importer des utilisateurs en masse": "Import mass users",
|
||||
"Impossible d'ouvrir l'archive": "Impossible to open the archive",
|
||||
"Impossible de modifier votre propre groupe.": "Unable to modify your own group.",
|
||||
"Impossible de modifier votre propre rôle.": "Unable to modify your own group.",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "Unable to submit the form, as it contains errors",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "Unable to delete a page containing children's pages",
|
||||
"Impossible de supprimer votre propre compte": "Unable to delete your own account",
|
||||
@ -318,7 +318,7 @@
|
||||
"Journalisation": "Journalization",
|
||||
"L'archive a été déposée dans le gestionnaire de fichiers. Les archives inférieures à la version 9 ne sont pas acceptées.": "The archive was deposited in the file manager. Archives below version 9 are not accepted.",
|
||||
"L'identifiant est défini lors de la création du compte, il ne peut pas être modifié.": "The identifier is defined when creating the account, it cannot be changed.",
|
||||
"La carte du site a été mise à jour": "The site card has been updated",
|
||||
"La carte du site a été mise à jour": "The sitemap has been updated",
|
||||
"La copie de sauvegarde du fichier htaccess n'a pas été restaurée !": "Backup copy of htaccess file has not been restored!",
|
||||
"La description d'une page participe à son référencement, chaque page doit disposer d'une description différente.": "The description of a page participates in its referencing, each page must have a different description.",
|
||||
"La page %s est ouverte par l'utilisateur %s": "Page %s opened by user %s",
|
||||
@ -340,8 +340,8 @@
|
||||
"Largeur": "Width",
|
||||
"Largeur de l'image": "Image Width",
|
||||
"Largeur du site": "Site Width",
|
||||
"Le curseur horizontal règle le niveau de transparence, le placer tout à la gauche pour un surlignement invisible.": "The horizontal cursor regulates the level of transparency, place it on the left for invisible highlights.",
|
||||
"Le curseur horizontal règle le niveau de transparence.": "The horizontal cursor regulates the level of transparency.",
|
||||
"Le curseur horizontal règle le niveau de transparence, le placer tout à la gauche pour un surlignement invisible.": "The horizontal cursor sets the level of transparency, place it on the left for invisible highlights.",
|
||||
"Le curseur horizontal règle le niveau de transparence.": "The horizontal cursor sets the level of transparency.",
|
||||
"Le fuseau horaire est utile au bon référencement": "The time zone is useful for the right SEO",
|
||||
"Le menu accessoire est aligné à droite de la barre de menu, c'est un emplacement réservé aux drapeaux et au bouton de connexion.": "The accessory menu is aligned to the right of the menu bar, it is a place reserved for flags and the login button.",
|
||||
"Le menu horizontal intégral": "The full horizontal menu",
|
||||
@ -349,7 +349,7 @@
|
||||
"Le module %s de la page %s a été supprimé": "The %s module of the %s has been deleted",
|
||||
"Le module %s est désinstallé, il reste peut-être des données dans %s": "The module %s is uninstalled, there may be data in %s",
|
||||
"Le sous-menu de la page parente": "The parent page submenu",
|
||||
"Le survol d'une icône de l'écran de connexion affiche temporairement le mot de passe.": "Flyover of an icon on the connection screen temporarily displays the password.",
|
||||
"Le survol d'une icône de l'écran de connexion affiche temporairement le mot de passe.": "Hovering over a login screen icon temporarily displays the password",
|
||||
"Le titre court est affiché dans les menus. Il peut être identique au titre de la page.": "The short title is displayed in the menus. It can be identical to the page title.",
|
||||
"Les langues sélectionnées sont identiques": "The selected languages are identical",
|
||||
"Les mentions légales sont obligatoires en France. Une option du pied de page ajoute un lien discret vers cette page.": "Legal notices are compulsory in France. An option of the footer adds a discrete link to this page.",
|
||||
@ -359,7 +359,7 @@
|
||||
"Libre": "Libre",
|
||||
"Licence :": "Licence:",
|
||||
"Lien de connexion": "Login link",
|
||||
"Lien page des mentions légales.": "Link of legal notices.",
|
||||
"Lien page des mentions légales.": "Link to legal notices.",
|
||||
"Liens": "Links",
|
||||
"Limitation des tentatives": "Limitation of attempts",
|
||||
"Limitée au site": "Limited to the site",
|
||||
@ -371,7 +371,7 @@
|
||||
"Légère": "Light",
|
||||
"Maigre": "Lean",
|
||||
"Maintenance": "Maintenance",
|
||||
"Majuscule à chaque mot": "Capper with each word",
|
||||
"Majuscule à chaque mot": "Capitalize each word",
|
||||
"Majuscules": "Capital letters",
|
||||
"Marges verticales": "Vertical margins",
|
||||
"Masquer la bannière en écran réduit": "Hide the banner in reduced screen",
|
||||
@ -405,20 +405,20 @@
|
||||
"Modules installés": "Installed modules",
|
||||
"Modules orphelins": "Orphaned modules",
|
||||
"Mot de passe": "Password",
|
||||
"Mot de passe oublié": "Forgot your password",
|
||||
"Mot de passe oublié": "Forgot password",
|
||||
"Mot de passe perdu": "Lost password",
|
||||
"Motorisé par": "Powered by",
|
||||
"Moyen": "Medium",
|
||||
"Moyenne": "Medium",
|
||||
"Moyenne (200%)": "Average (200%)",
|
||||
"Moyenne (200px)": "Average (200px)",
|
||||
"Moyenne (200%)": "Medium (200%)",
|
||||
"Moyenne (200px)": "Medium (200px)",
|
||||
"Méta-description": "Meta-description",
|
||||
"Méta-titre": "Meta title",
|
||||
"Ne pas afficher": "Do not display",
|
||||
"Ne pas charger l'exemple de site (utilisateurs avancés)": "Do not load the example of a site (advanced users)",
|
||||
"Ne pas répéter": "Do not repeat",
|
||||
"Ne pas saisir les balises": "Don't type tags",
|
||||
"News": "",
|
||||
"News": "News",
|
||||
"Niveau 1 (192.168.12.x)": "Level 1 (192.168.12.x)",
|
||||
"Niveau 2 (192.168.x.x)": "Level 2 (192.168.x.x)",
|
||||
"Niveau 3 (192.x.x.x)": "Level 3 (192.x.x.x)",
|
||||
@ -427,18 +427,18 @@
|
||||
"Nom du profil": "Profile Name",
|
||||
"Nom utilisateur": "Username",
|
||||
"Non": "No",
|
||||
"Non tronquée": "Unmanned",
|
||||
"Notre site est actuellement en maintenance. Nous sommes désolés pour la gêne occasionnée et faisons notre possible pour être rapidement de retour.": "Our site is currently under maintenance. We are sorry for the inconvenience caused and do our best to be quickly back.",
|
||||
"Non tronquée": "Untruncated",
|
||||
"Notre site est actuellement en maintenance. Nous sommes désolés pour la gêne occasionnée et faisons notre possible pour être rapidement de retour.": "Our site is currently under maintenance. Sorry for the inconvenience and we do our best to be back soon.",
|
||||
"Nouveau contenu localisé": "New localized content",
|
||||
"Nouveau mot de passe": "New Password",
|
||||
"Nouveau mot de passe enregistré": "New password recorded",
|
||||
"Nouvel utilisateur": "New user",
|
||||
"Nouvelle page créée": "New page created",
|
||||
"Nouvelle page ou barre latérale": "New page or sidebar",
|
||||
"Obligatoire": "Missing",
|
||||
"Obligatoire": "Required",
|
||||
"Ombre": "Shadow",
|
||||
"Option active en mode déconnecté uniquement, les pages enfants sont visibles et accessibles.": "Active option in disconnected mode only, children's pages are visible and accessible.",
|
||||
"Option recommandée pour sécuriser la connexion. S'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.": "Recommended option to secure the connection. Applies to all the Captchas of the site. Simple Captcha is limited to an addition of numbers from 0 to 10. Complex Captcha uses four numbers of 0 to 20. Recommended activation.",
|
||||
"Option recommandée pour sécuriser la connexion. S'applique à tous les captchas du site. Le captcha simple se limite à une addition de nombres de 0 à 10. Le captcha complexe utilise quatre opérations de nombres de 0 à 20. Activation recommandée.": "Recommended option to secure the connection. Applies to all the Captchas of the site. Simple Captcha is limited to an addition of numbers from 0 to 10. Complex Captcha uses four numbers from 0 to 20. Recommended activation.",
|
||||
"Options": "Options",
|
||||
"Options avancées": "Advanced options",
|
||||
"Origine": "Origin",
|
||||
@ -450,7 +450,7 @@
|
||||
"Page de recherche": "Search page",
|
||||
"Page dupliquée": "Duplicate page",
|
||||
"Page et module dupliqués": "Duplicated page and module",
|
||||
"Page inexistante, erreur 404": "Page non-existent, error 404",
|
||||
"Page inexistante, erreur 404": "Non-existent page, error 404",
|
||||
"Page non cliquable": "Non-clickable page",
|
||||
"Page parent": "Parent page",
|
||||
"Page standard": "Standard page",
|
||||
@ -476,7 +476,7 @@
|
||||
"Permissions sur les pages": "Page Permissions",
|
||||
"Petite": "Small",
|
||||
"Petite (150px)": "Small (150px)",
|
||||
"Petite (180%)": "Petite (180%)",
|
||||
"Petite (180%)": "Small (180%)",
|
||||
"Pied de page": "Footer",
|
||||
"Pinterest": "Pinterest",
|
||||
"Plan du site": "Sitemap",
|
||||
@ -489,10 +489,10 @@
|
||||
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "To define the page as a sidebar, choose the option from the list.",
|
||||
"Presse Papier": "Clipboard",
|
||||
"Presse papier": "Clipboard",
|
||||
"Profils des groupes": "Group Profiles",
|
||||
"Proportionnelle à la taille définie dans le site.": "Proportional to that defined in the site.",
|
||||
"Profils des rôles": "Group Profiles",
|
||||
"Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.",
|
||||
"Prénom": "First name",
|
||||
"Prénom Nom": "Firstname name",
|
||||
"Prénom Nom": "First name Name",
|
||||
"Préparation de la mise à jour": "Preparation of the update",
|
||||
"Préserver le fichier htaccess racine": "Preserve the root htaccess file",
|
||||
"Préserver les comptes des utilisateurs déjà installés": "Preserve user accounts already installed",
|
||||
@ -579,7 +579,7 @@
|
||||
"Sur les deux axes": "On both axes",
|
||||
"Sécurité": "Security",
|
||||
"Sécurité de la connexion": "Connection security",
|
||||
"Sécurité désactivée": "Safety deactivated",
|
||||
"Sécurité désactivée": "Security disabled",
|
||||
"Sélectionner un fichier": "Select a file",
|
||||
"Sélectionnez au moins un contenu à afficher": "Select at least one content to display",
|
||||
"Sélectionnez la langue à copier vers une langue cible": "Select the language to copy to a target language",
|
||||
@ -686,8 +686,21 @@
|
||||
"Modèle": "Template",
|
||||
"Bouton de navigation droit": "Right Navigation Button",
|
||||
"Bouton de navigation gauche": "Left Navigation Button",
|
||||
"Groupes / Profils": "Groups / Profiles",
|
||||
"Rôles/ Profils": "Groups / Profiles",
|
||||
"Prénom commence par": "First Name starts with",
|
||||
"Nom commence par": "Last Name starts with",
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": "Impossible to reset this account password!"
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": "Impossible to reset this account password!",
|
||||
"Test de la messagerie du site": "Site messaging test",
|
||||
"Il semblerait que votre messagerie fonctionne correctement !": "It seems that your messaging is working correctly!",
|
||||
"Message de test envoyé avec succès": "Test message sent successfully",
|
||||
"Message non envoyé": "Message not sent",
|
||||
"Validation par clé ⚠️": "Key-based validation ⚠️",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "The connection is confirmed using a key sent via messaging. From the selected group and the higher groups.",
|
||||
"Envoi du message d'authentification": "Sending authentication message",
|
||||
"Connexion réussie": "Login successful",
|
||||
"Erreur de mot de passe": "Password error",
|
||||
"Erreur de captcha": "Captcha error",
|
||||
"Clé de sécurité": "Security key",
|
||||
"Message de test": "Test message",
|
||||
"Clé d'authentification envoyée à votre adresse mail %s": "Authentication key sent to your email address %s"
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"'Ne pas afficher' crée une page orpheline non accessible par le biais des menus.": "'No mostrar' crea una página huérfana a la que no se puede acceder a través de los menús.",
|
||||
"'Sauvegarder et télécharger les données du module": "Guardar y descargar de los datos del módulo",
|
||||
"1 jour": "1 Jour",
|
||||
"1 jour": "1 diaz",
|
||||
"1/4 : Préparation...": "1/4: Preparando...",
|
||||
"10 minutes": "10 minutos",
|
||||
"10 tentatives": "6 intentos",
|
||||
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Negrita",
|
||||
"Groupe": "Grupo",
|
||||
"Groupe associé": "Grupo asociado",
|
||||
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||
"Rôle": "Grupo",
|
||||
"Rôle associé": "Grupo asociado",
|
||||
"Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||
"Groupes": "Grupos",
|
||||
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
|
||||
"Générer une capture Open Graph": "Generar una captura de Open Graph",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "Importar a",
|
||||
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
|
||||
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
|
||||
"Impossible de modifier votre propre groupe.": "No puede editar su propio grupo.",
|
||||
"Impossible de modifier votre propre rôle.": "No puede editar su propio grupo.",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "No se puede enviar el formulario porque contiene errores",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "No se puede eliminar una página que contiene páginas secundarias",
|
||||
"Impossible de supprimer votre propre compte": "No puede eliminar su propia cuenta",
|
||||
@ -322,7 +322,7 @@
|
||||
"La copie de sauvegarde du fichier htaccess n'a pas été restaurée !": "¡La copia de seguridad del archivo htaccess no ha sido restaurada!",
|
||||
"La description d'une page participe à son référencement, chaque page doit disposer d'une description différente.": "La descripción de una página participa en su referenciación, cada página debe tener una descripción diferente.",
|
||||
"La page %s est ouverte par l'utilisateur %s": "La página %s ha sido abierta por el usuario %s",
|
||||
"La page demandée n'existe pas ou est introuvable (erreur 404)": "La page demandée n'existe pas ou est introuvable (erreur 404)",
|
||||
"La page demandée n'existe pas ou est introuvable (erreur 404)": "La página solicitada no existe o no se encuentra (error 404).",
|
||||
"La page est affichée dans un menu horizontal mais pas dans le menu vertical d'une barre latérale.": "La página se muestra en un menú horizontal pero no en el menú vertical de una barra lateral.",
|
||||
"La première page que vos visiteurs verront.": "La primera página que verán tus visitantes.",
|
||||
"La règlementation française impose un anonymat de niveau 2": "La normativa francesa impone el anonimato de nivel 2",
|
||||
@ -476,7 +476,7 @@
|
||||
"Permissions sur les pages": "Permisos de las páginas",
|
||||
"Petite": "Pequeño",
|
||||
"Petite (150px)": "Pequeño (150px)",
|
||||
"Petite (180%)": "Petite (180%)",
|
||||
"Petite (180%)": "Pequeño (180px)",
|
||||
"Pied de page": "Pie de página",
|
||||
"Pinterest": "Pinterest",
|
||||
"Plan du site": "Mapa del sitio",
|
||||
@ -489,7 +489,7 @@
|
||||
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "Para configurar la página como barra lateral, elija la opción de la lista.",
|
||||
"Presse Papier": "Portapapeles",
|
||||
"Presse papier": "Portapapeles",
|
||||
"Profils des groupes": "Perfiles de grupos",
|
||||
"Profils des rôles": "Perfiles de grupos",
|
||||
"Proportionnelle à la taille définie dans le site.": "Proporcional a la definida en el sitio.",
|
||||
"Prénom": "Nombre de pila",
|
||||
"Prénom Nom": "Nombre Apellido",
|
||||
@ -686,8 +686,21 @@
|
||||
"Modèle": "Plantilla",
|
||||
"Bouton de navigation droit": "Botón de navegación derecha",
|
||||
"Bouton de navigation gauche": "Botón de navegación izquierda",
|
||||
"Groupes / Profils": "Grupos / Perfiles",
|
||||
"Rôles/ Profils": "Grupos / Perfiles",
|
||||
"Prénom commence par": "El nombre comienza con",
|
||||
"Nom commence par": "El apellido comienza con",
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": "No puedo restablecer la contraseña de esta cuenta."
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": "No puedo restablecer la contraseña de esta cuenta.",
|
||||
"Test de la messagerie du site": "Prueba de mensajería del sitio",
|
||||
"Il semblerait que votre messagerie fonctionne correctement !": "¡Parece que su mensajería funciona correctamente!",
|
||||
"Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
|
||||
"Message non envoyé": "Mensaje no enviado",
|
||||
"Validation par clé ⚠️": "Validación por clave ⚠️",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "La conexión se confirma con una clave enviada por mensajería. Desde el grupo seleccionado y los grupos superiores.",
|
||||
"Envoi du message d'authentification": "Envío del mensaje de autenticación",
|
||||
"Connexion réussie": "Conexión exitosa",
|
||||
"Erreur de mot de passe": "Error de contraseña",
|
||||
"Erreur de captcha": "Error de captcha",
|
||||
"Clé de sécurité": "Clave de seguridad",
|
||||
"Message de test": "Mensaje de prueba",
|
||||
"Clé d'authentification envoyée à votre adresse mail %s": "Clave de autenticación enviada a su dirección de correo electrónico %s"
|
||||
}
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "",
|
||||
"Grande (300px)": "",
|
||||
"Gras": "",
|
||||
"Groupe": "",
|
||||
"Groupe associé": "",
|
||||
"Groupe requis pour accéder à la page :": "",
|
||||
"Rôle": "",
|
||||
"Rôle associé": "",
|
||||
"Rôle requis pour accéder à la page :": "",
|
||||
"Groupes": "",
|
||||
"Générer sitemap.xml et robots.txt": "",
|
||||
"Générer une capture Open Graph": "",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "",
|
||||
"Importer des utilisateurs en masse": "",
|
||||
"Impossible d'ouvrir l'archive": "",
|
||||
"Impossible de modifier votre propre groupe.": "",
|
||||
"Impossible de modifier votre propre rôle.": "",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "",
|
||||
"Impossible de supprimer votre propre compte": "",
|
||||
@ -489,7 +489,7 @@
|
||||
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "",
|
||||
"Presse Papier": "",
|
||||
"Presse papier": "",
|
||||
"Profils des groupes": "",
|
||||
"Profils des rôles": "",
|
||||
"Proportionnelle à la taille définie dans le site.": "",
|
||||
"Prénom": "",
|
||||
"Prénom Nom": "",
|
||||
@ -686,8 +686,21 @@
|
||||
"Modèle": "",
|
||||
"Bouton de navigation droit": "",
|
||||
"Bouton de navigation gauche": "",
|
||||
"Groupes / Profils": "",
|
||||
"Rôles/ Profils": "",
|
||||
"Prénom commence par": "",
|
||||
"Nom commence par": "",
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": ""
|
||||
"Impossible de réinitialiser le mot de passe de ce compte !": "",
|
||||
"Test de la messagerie du site": "",
|
||||
"Il semblerait que votre messagerie fonctionne correctement !": "",
|
||||
"Message de test envoyé avec succès": "",
|
||||
"Message non envoyé": "",
|
||||
"Validation par clé ⚠️": "",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le rôle sélectionné et les rôles supérieurs.": "",
|
||||
"Envoi du message d'authentification": "",
|
||||
"Connexion réussie": "",
|
||||
"Erreur de mot de passe": "",
|
||||
"Erreur de captcha": "",
|
||||
"Clé de sécurité": "",
|
||||
"Message de test": "",
|
||||
"Clé d'authentification envoyée à votre adresse mail %s": ""
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -16,3 +16,7 @@
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
.container.light {
|
||||
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
|
||||
}
|
@ -4,9 +4,9 @@
|
||||
</h3>
|
||||
<div class="row">
|
||||
<div class="col6 offset3">
|
||||
<?php echo template::select('installLanguage', $module::$i18nFiles, [
|
||||
<?php echo template::select('installLanguage', install::$i18nFiles, [
|
||||
'label' => 'Langues installées',
|
||||
'selected' => array_key_exists ('fr_FR', $module::$i18nFiles) ? 'fr_FR': reset($module::$i18nFiles),
|
||||
'selected' => isset(self::$i18nUI) ? self::$i18nUI : 'fr_FR',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -20,3 +20,7 @@
|
||||
.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.container.light {
|
||||
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
|
||||
}
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -65,7 +65,7 @@
|
||||
</summary>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('installProxyType', $module::$proxyType, [
|
||||
<?php echo template::select('installProxyType', install::$proxyType, [
|
||||
'label' => 'Type de proxy'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -5,7 +5,7 @@
|
||||
<?php echo self::ZWII_VERSION; ?>
|
||||
<?php echo helper::translate('vers'); ?>
|
||||
|
||||
<?php echo $module::$newVersion; ?>
|
||||
<?php echo install::$newVersion; ?>
|
||||
</strong></p>
|
||||
<p>
|
||||
<?php echo helper::translate('Afin d\'assurer le bon fonctionnement de Zwii, veuillez ne pas fermer cette page avant la fin de l\'opération.'); ?>
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -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';
|
||||
@ -91,16 +91,15 @@ class language extends common
|
||||
}
|
||||
|
||||
// Télécharger le descripteur en ligne
|
||||
$languageData = json_decode(helper::getUrlContents(self::ZWII_UI_URL . $lang . '.json'), true);
|
||||
$languageData = helper::getUrlContents(self::ZWII_UI_URL . $lang . '.json');
|
||||
$descripteur = json_decode(helper::getUrlContents(self::ZWII_UI_URL . 'language.json'), true);
|
||||
$success = false;
|
||||
if (
|
||||
is_array($languageData) &&
|
||||
$languageData &&
|
||||
is_array($descripteur['language'][$lang])
|
||||
) {
|
||||
if ($this->setData(['language', $lang, $descripteur['language'][$lang]])) {
|
||||
$success = $this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($languageData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
$success = is_int($success) ? true : false;
|
||||
$success = $this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $languageData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -501,7 +500,7 @@ class language extends common
|
||||
$data[$key] = $target;
|
||||
}
|
||||
}
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data));
|
||||
|
||||
// Mettre à jour le descripteur
|
||||
$this->setData([
|
||||
@ -529,13 +528,18 @@ class language extends common
|
||||
}
|
||||
|
||||
// Ajout des champs absents selon la langue de référence
|
||||
$dataFr = json_decode(file_get_contents(self::I18N_DIR . 'fr_FR.json'), true);
|
||||
foreach ($dataFr as $key => $value) {
|
||||
if (!array_key_exists($key, $data)) {
|
||||
$data[$key] = '';
|
||||
}
|
||||
}
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
/*
|
||||
$dataFr = json_decode(file_get_contents(self::I18N_DIR . 'fr_FR.json'), true);
|
||||
foreach ($dataFr as $key => $value) {
|
||||
if (!array_key_exists($key, $data)) {
|
||||
$data[$key] = '';
|
||||
}
|
||||
}
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', $data);
|
||||
*/
|
||||
|
||||
// Trier le tableau
|
||||
asort($data);
|
||||
|
||||
// Tableau des chaines à traduire dans la langue sélectionnée
|
||||
foreach ($data as $key => $value) {
|
||||
@ -558,7 +562,7 @@ class language extends common
|
||||
'title' => helper::translate('Éditer les dialogues') . ' ' . template::flag($lang, '20 %'),
|
||||
'view' => 'edit',
|
||||
'vendor' => [
|
||||
'flatpickr',
|
||||
'tablednd'
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4 offset4">
|
||||
<?php echo template::select('translateAddContent', $module::$i18nFiles, [
|
||||
<?php echo template::select('translateAddContent', language::$i18nFiles, [
|
||||
'label' => 'Langues disponibles'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -20,12 +20,12 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('translateFormCopySource', $module::$languagesInstalled, [
|
||||
<?php echo template::select('translateFormCopySource', language::$languagesInstalled, [
|
||||
'label' => 'Source'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::select('translateFormCopyTarget', $module::$languagesTarget, [
|
||||
<?php echo template::select('translateFormCopyTarget', language::$languagesTarget, [
|
||||
'label' => 'Cible'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<div class="row">
|
||||
<?php foreach ($module::$dialogues as $key => $value) : ?>
|
||||
<?php foreach (language::$dialogues as $key => $value) : ?>
|
||||
<div class="col6">
|
||||
<?php echo sprintf('%g -', $key); ?>
|
||||
<?php echo $value['source']; ?>
|
||||
@ -52,7 +52,7 @@
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php echo $module::$pages; ?>
|
||||
<?php echo language::$pages; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -6,7 +6,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -23,8 +23,8 @@
|
||||
<h4>
|
||||
<?php echo helper::translate('Langues installées'); ?>
|
||||
</h4>
|
||||
<?php if ($module::$languagesUiInstalled): ?>
|
||||
<?php echo template::table([2, 1, 1, 5, 1, 1], $module::$languagesUiInstalled, ['Langues', 'Version', 'Date', '', '', '']); ?>
|
||||
<?php if (language::$languagesUiInstalled): ?>
|
||||
<?php echo template::table([2, 1, 1, 4, 1, 1, 1], language::$languagesUiInstalled, ['Langues', 'Version', 'Date', '', '', '', '']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,8 +35,8 @@
|
||||
<h4>
|
||||
<?php echo helper::translate('Catalogue'); ?>
|
||||
</h4>
|
||||
<?php if ($module::$languagesStore): ?>
|
||||
<?php echo template::table([2, 1, 2, 6, 1], $module::$languagesStore, ['Langues', 'Version', 'Date', '', '']); ?>
|
||||
<?php if (language::$languagesStore): ?>
|
||||
<?php echo template::table([2, 1, 2, 6, 1], language::$languagesStore, ['Langues', 'Version', 'Date', '', '']); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -8,7 +8,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -17,7 +17,7 @@ class maintenance extends common
|
||||
{
|
||||
|
||||
public static $actions = [
|
||||
'index' => self::GROUP_VISITOR
|
||||
'index' => self::ROLE_VISITOR
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -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'
|
||||
@ -118,14 +118,16 @@ class page extends common
|
||||
$page
|
||||
]);
|
||||
// Ecriture
|
||||
$this->setData(['page', $pageId, $data]);
|
||||
$this->setData(['page', $pageId, $data], false);
|
||||
$notification = helper::translate('Page dupliquée');
|
||||
// Duplication du module présent
|
||||
if ($this->getData(['page', $page, 'moduleId'])) {
|
||||
$data = $this->getData(['module', $page]);
|
||||
$this->setData(['module', $pageId, $data]);
|
||||
$this->setData(['module', $pageId, $data], false);
|
||||
$notification = helper::translate('Page et module dupliqués');
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('page');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -178,7 +180,7 @@ class page extends common
|
||||
'parentPageId' => '',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::ROLE_VISITOR,
|
||||
'targetBlank' => false,
|
||||
'title' => $pageTitle,
|
||||
'shortTitle' => $pageTitle,
|
||||
@ -203,8 +205,8 @@ class page extends common
|
||||
//file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$siteContent);
|
||||
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
// Ne met à jour le sitemap pour éviter un warning, de toute manière la nouvelle page doit être éditée.
|
||||
// $this->updateSitemap();
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -390,11 +392,11 @@ class page extends common
|
||||
$pageId = helper::increment($pageId, self::$moduleIds);
|
||||
// Met à jour les enfants
|
||||
foreach ($this->getHierarchy($this->getUrl(2), null) as $childrenPageId) {
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId], false);
|
||||
}
|
||||
// Change l'id de page dans les données des modules
|
||||
if ($this->getData(['module', $this->getUrl(2)]) !== null) {
|
||||
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
|
||||
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])], false);
|
||||
$this->deleteData(['module', $this->getUrl(2)]);
|
||||
// Renommer le dossier du module
|
||||
$moduleId = $this->getData(['page', $this->getUrl(2), 'moduleId']);
|
||||
@ -405,10 +407,14 @@ class page extends common
|
||||
copy($modulesData[$moduleId]['dataDirectory'] . $this->getUrl(2), $modulesData[$moduleId]['dataDirectory'] . $pageId);
|
||||
$this->deleteDir($modulesData[$moduleId]['dataDirectory'] . $this->getUrl(2));
|
||||
// Mettre à jour le nom de la feuille de style
|
||||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId]);
|
||||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId], false);
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB('module');
|
||||
}
|
||||
// Met à jour les historiques des utilisateurs
|
||||
/*
|
||||
*
|
||||
* Met à jour les historiques des utilisateurs
|
||||
foreach ($this->getData(['enrolment', self::$siteContent]) as $userId => $userData) {
|
||||
// Vérifier si l'utilisateur a un historique
|
||||
if (
|
||||
@ -417,14 +423,18 @@ class page extends common
|
||||
) {
|
||||
// Remplacer l'ancienne ID par la nouvelle
|
||||
$datas = $this->getData(['enrolment', self::$siteContent, $userId, 'history', $this->getUrl(2)]);
|
||||
$this->setData(['enrolment', self::$siteContent, $userId, 'history', $pageId, $datas]);
|
||||
$this->setData(['enrolment', self::$siteContent, $userId, 'history', $pageId, $datas], false);
|
||||
$this->deleteData(['enrolment', self::$siteContent, $userId, 'history', $this->getUrl(2)]);
|
||||
}
|
||||
// Mettre à jour la dernière page vue si nécessaire
|
||||
if ($this->getData(['enrolment', self::$siteContent, $userId, 'lastPageView']) === $this->getUrl(2)) {
|
||||
$this->setData(['enrolment', self::$siteContent, $userId, 'lastPageView', $pageId]);
|
||||
$this->setData(['enrolment', self::$siteContent, $userId, 'lastPageView', $pageId], false);
|
||||
}
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB('enrolment');
|
||||
**/
|
||||
|
||||
// Met à jour la homePage si nécessaire
|
||||
if ($this->getUrl(2) === $this->getData(['course', self::$siteContent, 'homePageId'])) {
|
||||
$this->setData(['course', self::$siteContent, 'homePageId', $pageId]);
|
||||
@ -432,7 +442,7 @@ class page extends common
|
||||
|
||||
// Si la page correspond à la page d'accueil, change l'id dans la configuration du site
|
||||
if ($this->getData(['config', 'homePageId']) === $this->getUrl(2)) {
|
||||
$this->setData(['config', 'homePageId', $pageId]);
|
||||
$this->setData(['config', 'homePageId', $pageId], false);
|
||||
}
|
||||
}
|
||||
// Supprime les données du module en cas de changement de module
|
||||
@ -448,20 +458,22 @@ class page extends common
|
||||
}
|
||||
// Traitement des pages spéciales affectées dans la config :
|
||||
if ($this->getUrl(2) === $this->getData(['config', 'legalPageId'])) {
|
||||
$this->setData(['config', 'legalPageId', $pageId]);
|
||||
$this->setData(['config', 'legalPageId', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['config', 'searchPageId'])) {
|
||||
$this->setData(['config', 'searchPageId', $pageId]);
|
||||
$this->setData(['config', 'searchPageId', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['config', 'page404'])) {
|
||||
$this->setData(['config', 'page404', $pageId]);
|
||||
$this->setData(['config', 'page404', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['config', 'page403'])) {
|
||||
$this->setData(['config', 'page403', $pageId]);
|
||||
$this->setData(['config', 'page403', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['config', 'page302'])) {
|
||||
$this->setData(['config', 'page302', $pageId]);
|
||||
$this->setData(['config', 'page302', $pageId], false);
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB('config');
|
||||
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
|
||||
$lastPosition = 1;
|
||||
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
|
||||
@ -480,11 +492,12 @@ class page extends common
|
||||
$lastPosition++;
|
||||
}
|
||||
// Change la position
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition]);
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition], false);
|
||||
// Incrémente pour la prochaine position
|
||||
$lastPosition++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->getinput('pageEditBlock') !== 'bar') {
|
||||
$barLeft = $this->getinput('pageEditBarLeft');
|
||||
$barRight = $this->getinput('pageEditBarRight');
|
||||
@ -505,7 +518,7 @@ class page extends common
|
||||
) {
|
||||
foreach ($this->getHierarchy($pageId) as $parentId => $childId) {
|
||||
if ($this->getData(['page', $childId, 'parentPageId']) === $pageId) {
|
||||
$this->setData(['page', $childId, 'position', 0]);
|
||||
$this->setData(['page', $childId, 'position', 0], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -514,32 +527,32 @@ class page extends common
|
||||
if ($this->getinput('pageEditBlock') === 'bar') {
|
||||
foreach ($this->getHierarchy() as $eachPageId => $parentId) {
|
||||
if ($this->getData(['page', $eachPageId, 'barRight']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $eachPageId, 'barRight', $pageId]);
|
||||
$this->setData(['page', $eachPageId, 'barRight', $pageId], false);
|
||||
}
|
||||
if ($this->getData(['page', $eachPageId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId]);
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId], false);
|
||||
}
|
||||
foreach ($parentId as $childId) {
|
||||
if ($this->getData(['page', $childId, 'barRight']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barRight', $pageId]);
|
||||
$this->setData(['page', $childId, 'barRight', $pageId], false);
|
||||
}
|
||||
if ($this->getData(['page', $childId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId]);
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Détermine le groupe selon que la page est une barre ou une page standard
|
||||
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
||||
// Détermine le rôle selon que la page est une barre ou une page standard
|
||||
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
||||
|
||||
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0
|
||||
//Détermine le profil d'utilisateur en fonction du rôle sinon le rôle vaut 0
|
||||
$profil = 0;
|
||||
if (
|
||||
$this->getinput('pageEditBlock') !== 'bar' ||
|
||||
$group === 1 ||
|
||||
$group === 2
|
||||
$role === 1 ||
|
||||
$role === 2
|
||||
) {
|
||||
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT);
|
||||
$profil = $this->getInput('pageEditProfil' . $role, helper::FILTER_INT);
|
||||
}
|
||||
|
||||
// Modifie la page ou en crée une nouvelle si l'id a changé
|
||||
@ -559,7 +572,7 @@ class page extends common
|
||||
'modulePosition' => $this->getInput('pageModulePosition'),
|
||||
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
||||
'position' => $position,
|
||||
'group' => $group,
|
||||
'role' => $role,
|
||||
'profil' => $profil,
|
||||
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
||||
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
||||
@ -580,6 +593,19 @@ class page extends common
|
||||
]
|
||||
]);
|
||||
|
||||
/**
|
||||
* Sauvegarde l'onglet de l'utilisateur
|
||||
*/
|
||||
$this->setData([
|
||||
'user',
|
||||
$this->getUser('id'),
|
||||
'view',
|
||||
[
|
||||
'page' => $this->getInput('containerSelected'),
|
||||
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
|
||||
]
|
||||
]);
|
||||
|
||||
// Creation du contenu de la page
|
||||
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
|
||||
@ -640,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) {
|
||||
@ -740,7 +766,7 @@ class page extends common
|
||||
{
|
||||
$p = $this->getData(['page']);
|
||||
$d = array_map(function ($d) {
|
||||
unset ($d["css"], $d["js"]);
|
||||
unset($d["css"], $d["js"]);
|
||||
return $d;
|
||||
}, $p);
|
||||
return json_encode($d);
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @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-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @authorFrédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2025, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
@ -54,29 +54,31 @@ function protectModule() {
|
||||
*/
|
||||
$( document ).ready(function() {
|
||||
|
||||
// Changement de profil
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $("#pageEditGroup").val()).show();
|
||||
// Changement de profil
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $("#pageEditGroup").val()).show();
|
||||
|
||||
$("#pageEditGroup").on("change", function () {
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $(this).val()).show();
|
||||
});
|
||||
$("#pageEditGroup").on("change", function () {
|
||||
$(".pageEditGroupProfil").hide();
|
||||
$("#pageEditGroupProfil" + $(this).val()).show();
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Sélection des onglets
|
||||
*/
|
||||
var pageLayout = getCookie("pageLayout");
|
||||
if (pageLayout == null) {
|
||||
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (pageLayout == "") {
|
||||
pageLayout = "content";
|
||||
setCookie("pageLayout", "content");
|
||||
}
|
||||
// Tout cacher
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
// Afficher la bonne tab
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
|
||||
|
||||
@ -281,10 +283,18 @@ $( document ).ready(function() {
|
||||
// Gestion des évènements
|
||||
//--------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Transmet le bouton de l'onglet sélectionné avant la soumission
|
||||
*/
|
||||
$('#pageEditForm').on('submit', function () {
|
||||
$('#containerSelected').val(pageLayout);
|
||||
});
|
||||
|
||||
/**
|
||||
* Sélection de la page de configuration à afficher
|
||||
*/
|
||||
$("#pageEditContentButton").on("click", function () {
|
||||
pageLayout = "content";
|
||||
$("#pageEditContentContainer").show();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
@ -292,25 +302,12 @@ $( document ).ready(function() {
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").addClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "content");
|
||||
});
|
||||
$("#pageEditExtensionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").show();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").addClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "extension");
|
||||
});
|
||||
$("#PageEditPositionButton").on("click", function () {
|
||||
$("#pageEditPositionButton").on("click", function () {
|
||||
pageLayout = "position";
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").show();
|
||||
@ -318,12 +315,25 @@ $( document ).ready(function() {
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").addClass("activeButton");
|
||||
$("#pageEditPositionButton").addClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
});
|
||||
$("#pageEditExtensionButton").on("click", function () {
|
||||
pageLayout = "extension";
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").show();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").addClass("activeButton");
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "position");
|
||||
});
|
||||
$("#pageEditLayoutButton").on("click", function () {
|
||||
pageLayout = "layout";
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
@ -331,12 +341,12 @@ $( document ).ready(function() {
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
$("#pageEditContentButton").removeClass("activeButton");
|
||||
$("#pageEditExtensionButton").removeClass("activeButton");
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").addClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "layout");
|
||||
});
|
||||
$("#pageEditPermissionButton").on("click", function () {
|
||||
pageLayout = "permission";
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
@ -347,7 +357,6 @@ $( document ).ready(function() {
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").addClass("activeButton");
|
||||
setCookie("pageLayout", "permission");
|
||||
});
|
||||
|
||||
/**
|
||||
@ -722,30 +731,6 @@ function buildPagesList(extraPosition) {
|
||||
positionDOM.val(positionSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cookies
|
||||
*/
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define function to capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
|
@ -1,4 +1,6 @@
|
||||
<?php echo template::formOpen('pageEditForm'); ?>
|
||||
<!-- Variable transmise à TinyMCE -->
|
||||
<div id="zwii_site_content" data-variable="<?php echo htmlspecialchars(isset($_SESSION['ZWII_SITE_CONTENT']) ? $_SESSION['ZWII_SITE_CONTENT'] : 'home'); ?>"></div>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('configModulesBack', [
|
||||
@ -7,19 +9,10 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /**echo template::button('pageEditHelp', [
|
||||
'href' => 'https://doc.zwiicms.fr/edition-des-pages',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'class' => 'buttonHelp',
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col1 offset6">
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('pageEditDelete', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('trash'),
|
||||
'help' => 'Effacer la page'
|
||||
]); ?>
|
||||
@ -41,37 +34,40 @@
|
||||
<div class="tab">
|
||||
<?php echo template::button('pageEditContentButton', [
|
||||
'value' => 'Contenu',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('PageEditPositionButton', [
|
||||
<?php echo template::button('pageEditPositionButton', [
|
||||
'value' => 'Menu',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditExtensionButton', [
|
||||
'value' => 'Extension',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditLayoutButton', [
|
||||
'value' => 'Mise en page',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPermissionButton', [
|
||||
'value' => 'Permission',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
<!-- Champ caché pour transmettre l'onglet-->
|
||||
<?php echo template::hidden('containerSelected'); ?>
|
||||
|
||||
<div id="pageEditContentContainer" class="tabContent">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Titres'); ?>
|
||||
<!--<span id="infoHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/informations-generales" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col8">
|
||||
@ -120,11 +116,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Emplacement dans le menu'); ?>
|
||||
<!--<span id="positionHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -140,14 +131,14 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
|
||||
<?php echo template::select('pageEditParentPageId', page::$pagesNoParentId, [
|
||||
'label' => 'Page parent',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditExtraPosition', $module::$extraPosition, [
|
||||
<?php echo template::select('pageEditExtraPosition', page::$extraPosition, [
|
||||
'label' => 'Emplacement',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'extraPosition']),
|
||||
'help' => 'Le menu accessoire est aligné à droite de la barre de menu, c\'est un emplacement réservé aux drapeaux et au bouton de connexion.'
|
||||
@ -176,16 +167,11 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Options avancées'); ?>
|
||||
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('pageTypeMenu', $module::$typeMenu, [
|
||||
<?php echo template::select('pageTypeMenu', page::$typeMenu, [
|
||||
'label' => 'Apparence',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
|
||||
]); ?>
|
||||
@ -195,7 +181,8 @@
|
||||
'help' => 'Sélectionnez une image ou une icône de petite dimension',
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Icône',
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl']),
|
||||
'folder' => $this->getData(['page', $this->getUrl(2), 'iconUrl']) ? dirname($this->getData(['page', $this->getUrl(2), 'iconUrl'])) : '',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -228,14 +215,14 @@
|
||||
<div class="row">
|
||||
<div class="col10">
|
||||
<?php echo template::hidden('pageEditModuleRedirect'); ?>
|
||||
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
|
||||
<?php echo template::select('pageEditModuleId', page::$moduleIds, [
|
||||
'help' => 'En cas de changement de module, les données du module précédent seront supprimées.',
|
||||
'label' => 'Module',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
|
||||
]); ?>
|
||||
<?php echo template::hidden('pageEditModuleIdOld', ['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
|
||||
<?php echo template::hidden('pageEditModuleIdOldText', [
|
||||
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']), $module::$moduleIds) ? $module::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']), page::$moduleIds) ? page::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 verticalAlignBottom">
|
||||
@ -248,7 +235,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('pageModulePosition', $module::$modulePosition, [
|
||||
<?php echo template::select('pageModulePosition', page::$modulePosition, [
|
||||
'help' => 'En position libre ajoutez le module en plaçant [MODULE] à l\'endroit voulu dans votre page.',
|
||||
'label' => 'Position du module',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
|
||||
@ -292,18 +279,13 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Mise en page'); ?>
|
||||
<!--<span id="layoutHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mise-en-page-2" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('pageEditBlock', $module::$pageBlocks, [
|
||||
<?php echo template::select('pageEditBlock', page::$pageBlocks, [
|
||||
'label' => 'Gabarits de page - Barre latérale',
|
||||
'help' => 'Pour définir la page comme barre latérale, choisissez l\'option dans la liste.',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'block'])
|
||||
@ -318,7 +300,7 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
|
||||
<?php echo template::select('pageEditBarLeft', page::$pagesBarId, [
|
||||
'label' => 'Barre latérale gauche :',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
|
||||
]); ?>
|
||||
@ -328,12 +310,12 @@
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
|
||||
<?php echo template::select('pageEditBarRight', page::$pagesBarId, [
|
||||
'label' => 'Barre latérale droite :',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo template::select('pageEditDisplayMenu', $module::$displayMenu, [
|
||||
<?php echo template::select('pageEditDisplayMenu', page::$displayMenu, [
|
||||
'label' => 'Contenu du menu vertical',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
|
||||
'help' => 'Par défaut le menu est affiché APRES le contenu de la page. Pour le positionner à un emplacement précis, insérez [MENU] dans le contenu de la page.'
|
||||
@ -342,19 +324,19 @@
|
||||
</div>
|
||||
<div class="row navSelect">
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavLeft', $module::$navIconPosition, [
|
||||
<?php echo template::select('pageEditNavLeft', page::$navIconPosition, [
|
||||
'label' => 'Bouton de navigation gauche',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navLeft']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavTemplate', $module::$navIconTemplate, [
|
||||
<?php echo template::select('pageEditNavTemplate', page::$navIconTemplate, [
|
||||
'label' => 'Modèle',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navTemplate']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('pageEditNavRight', $module::$navIconPosition, [
|
||||
<?php echo template::select('pageEditNavRight', page::$navIconPosition, [
|
||||
'label' => 'Bouton de navigation droit',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'navRight']),
|
||||
]); ?>
|
||||
@ -372,33 +354,28 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Permission et référencement'); ?>
|
||||
<!--<span id="seoHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
<div class='col6'>
|
||||
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
||||
'label' => 'Groupe minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
|
||||
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
|
||||
<?php echo template::select('pageEditGroup', self::$rolePublics, [
|
||||
'label' => 'Rôle minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
|
||||
'help' => 'Les rôles de niveau supérieur accèdent à la page.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<div class="pageEditGroupProfil displayNone"
|
||||
id="pageEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
|
||||
<?php echo template::select('pageEditProfil' . self::GROUP_MEMBER, $module::$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, $module::$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.',
|
||||
@ -424,5 +401,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php echo template::formClose(); ?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user