Compare commits
297 Commits
Author | SHA1 | Date |
---|---|---|
Fred Tempez | cbe06426bb | |
Fred Tempez | adac7395cc | |
Fred Tempez | 2c459a03d4 | |
Fred Tempez | 751bc450b5 | |
Fred Tempez | 6c8d9097f6 | |
Fred Tempez | b0814d50dc | |
Fred Tempez | a7a2424d93 | |
Fred Tempez | 43b15987d6 | |
Fred Tempez | e100a580ad | |
Fred Tempez | 397bdee655 | |
Fred Tempez | 78b2d87ec1 | |
Fred Tempez | 8dedb39a33 | |
Fred Tempez | 7cee16389f | |
Fred Tempez | 04b2877c48 | |
Fred Tempez | f6c7e5f954 | |
Fred Tempez | b5ea22021b | |
Fred Tempez | 3ee1398e2f | |
Fred Tempez | cfb07b81d5 | |
Fred Tempez | 0da23149db | |
Fred Tempez | 1322cb4eb0 | |
Fred Tempez | 167ad06dde | |
Fred Tempez | 271ee347a8 | |
Fred Tempez | 04a6d86999 | |
Fred Tempez | 05e6ff8f9b | |
Fred Tempez | 6e53ca8766 | |
Fred Tempez | dda93cf3d3 | |
Fred Tempez | 075e4afa1c | |
Fred Tempez | fd144d55f0 | |
Fred Tempez | b595120227 | |
Fred Tempez | b0b3b34bde | |
Fred Tempez | 2f592e2818 | |
Fred Tempez | 8c9bc40a02 | |
Fred Tempez | 37f77b3d50 | |
Fred Tempez | a5130e1d9f | |
Fred Tempez | 256da35d53 | |
Fred Tempez | bb93b1b313 | |
Fred Tempez | 195ed682f6 | |
Fred Tempez | ae71b9649d | |
Fred Tempez | 71418548e7 | |
Fred Tempez | 03c7e0a7fa | |
Fred Tempez | 6bc8636692 | |
Fred Tempez | c0d14596a7 | |
Fred Tempez | 6a72676c7c | |
Fred Tempez | 44c4997436 | |
Fred Tempez | cce73886a2 | |
Fred Tempez | b9733d7391 | |
Fred Tempez | 56ff0580a1 | |
Fred Tempez | 5b9f86fb38 | |
Fred Tempez | d43a78d307 | |
Fred Tempez | deedb002e8 | |
Fred Tempez | 6d7c2f725d | |
Fred Tempez | 5ede9b71c2 | |
Fred Tempez | 04f4c7be6d | |
Fred Tempez | 0c94b2f546 | |
Fred Tempez | 8b72ae01dc | |
Fred Tempez | 1ca77b89ce | |
Fred Tempez | 0934bf847d | |
Fred Tempez | 2a152a9a1d | |
Fred Tempez | bc8fbc17b8 | |
Fred Tempez | a8635f0c8a | |
Fred Tempez | ca875f9f05 | |
Fred Tempez | b4258fe496 | |
Fred Tempez | 509c95a680 | |
Fred Tempez | 2027c5918f | |
Fred Tempez | 3593e853d8 | |
Fred Tempez | cb13d2b0c9 | |
Fred Tempez | 0f55df8d31 | |
Fred Tempez | 939cb8d53f | |
Fred Tempez | 730e4ac9c4 | |
Fred Tempez | d3d96f795a | |
Fred Tempez | e68f58fad1 | |
Fred Tempez | 6c0f34ae71 | |
Fred Tempez | 9373880239 | |
Fred Tempez | a35036e0fa | |
Fred Tempez | 19246a59c9 | |
Fred Tempez | 15c4d1edd3 | |
Fred Tempez | 24f679d531 | |
Fred Tempez | 56f8f03581 | |
Fred Tempez | ae1f15e8b8 | |
Fred Tempez | 7544bb9862 | |
Fred Tempez | ebd078848a | |
Fred Tempez | e8e4f98be0 | |
Fred Tempez | c8c74d9be3 | |
Fred Tempez | 63541cf83a | |
Fred Tempez | 1cb54d46b1 | |
Fred Tempez | cf3936b7c0 | |
Fred Tempez | 84df59c52b | |
Fred Tempez | c75b71f217 | |
Fred Tempez | 269abc5699 | |
Fred Tempez | 638ddadb61 | |
Fred Tempez | 10f8340e76 | |
Fred Tempez | 7c0feae8ee | |
Fred Tempez | 25889b0759 | |
Fred Tempez | 1e0cca8685 | |
Fred Tempez | a02a796f4a | |
Fred Tempez | e640aa327e | |
Fred Tempez | ed34728f5e | |
Fred Tempez | b6e4b39e78 | |
Fred Tempez | 64f19f0f96 | |
Fred Tempez | b6fb2d75b4 | |
Fred Tempez | 7138c07a89 | |
Fred Tempez | 137c151e19 | |
Fred Tempez | 548daad047 | |
Fred Tempez | c8abde012c | |
Fred Tempez | caa348a571 | |
Fred Tempez | 8e1488b86f | |
Fred Tempez | 1d4f8405b1 | |
Fred Tempez | 0fece8c7ca | |
Fred Tempez | 0deec384bc | |
Fred Tempez | 7452faab55 | |
Fred Tempez | e9ed55b065 | |
Fred Tempez | d35010f100 | |
Fred Tempez | 14683133c8 | |
Fred Tempez | 4e174124fe | |
Fred Tempez | 64594e23ff | |
Fred Tempez | 7d5d6edf25 | |
Fred Tempez | 74fabce177 | |
Fred Tempez | e64e819d48 | |
Fred Tempez | 2dd835593a | |
Fred Tempez | 9664ce49b7 | |
Fred Tempez | 3502d78632 | |
Fred Tempez | 65a121cb0a | |
Fred Tempez | e6c52c29ee | |
Fred Tempez | 31994d33e0 | |
Fred Tempez | cfb0d8a0e9 | |
Fred Tempez | 5a8fc68049 | |
Fred Tempez | 8988e2e130 | |
Fred Tempez | 724d391d00 | |
Fred Tempez | 78102b96b4 | |
Fred Tempez | 0535556b68 | |
Fred Tempez | db0637ca1c | |
Fred Tempez | 6d42f792e4 | |
Fred Tempez | dd194e2488 | |
Fred Tempez | fc197b647d | |
Fred Tempez | d2dc4c64c0 | |
Fred Tempez | f65fe62da7 | |
Fred Tempez | 372db6dc3a | |
Fred Tempez | fd5aabd910 | |
Fred Tempez | 36604a1ee4 | |
Fred Tempez | 4dfd73453e | |
Fred Tempez | 2eab0090d1 | |
Fred Tempez | f74c7fd6f7 | |
Fred Tempez | 2bdb09b958 | |
Fred Tempez | 0407bd082d | |
Fred Tempez | d42ce3c733 | |
Fred Tempez | 260098d0a5 | |
Fred Tempez | 52fb225650 | |
Fred Tempez | b5693abbf5 | |
Fred Tempez | a8f1387c96 | |
Fred Tempez | 083d819597 | |
Fred Tempez | d829f57582 | |
Fred Tempez | 31986d138e | |
Fred Tempez | 3b77452bbe | |
Fred Tempez | c6358b4c63 | |
Fred Tempez | 084471aa3b | |
Fred Tempez | 97a782eb4d | |
Fred Tempez | 3884573de9 | |
Fred Tempez | 572f0206a8 | |
Fred Tempez | d3675f62f4 | |
Fred Tempez | 8e9c356188 | |
Fred Tempez | 3b5ddb5a3f | |
Fred Tempez | 91e4a4047c | |
Fred Tempez | caf193611d | |
Fred Tempez | ee4fc93afe | |
Fred Tempez | 3c76bcdf4c | |
Fred Tempez | e9e39f5a03 | |
Fred Tempez | b5382fa5f2 | |
Fred Tempez | cd69635448 | |
Fred Tempez | 0c8569f7cf | |
Fred Tempez | 13227a5cd4 | |
Fred Tempez | c43ce394e4 | |
Fred Tempez | 6c2c6a1acb | |
Fred Tempez | 656d6e557e | |
Fred Tempez | 9bf135337e | |
Fred Tempez | 6d77995439 | |
Fred Tempez | 9a3de92678 | |
Fred Tempez | 7b5f182be4 | |
Fred Tempez | 98f68f284c | |
Fred Tempez | 3ebb305cae | |
Fred Tempez | e80564c106 | |
Fred Tempez | e90929ea3b | |
Fred Tempez | ac8d3016c7 | |
Fred Tempez | ffb872fd03 | |
Fred Tempez | 08fb2d25fd | |
Fred Tempez | 63f7767460 | |
Fred Tempez | 17b76e1a0f | |
Fred Tempez | a4164e4a2d | |
Fred Tempez | 595d068de2 | |
Fred Tempez | cc92c90403 | |
Fred Tempez | 6da8223209 | |
Fred Tempez | 3bedbed4ef | |
Fred Tempez | 023ba99c0b | |
Fred Tempez | b8123b0534 | |
Fred Tempez | 931b56f6a3 | |
Fred Tempez | fcee5a8cde | |
Fred Tempez | 25d1c2400e | |
Fred Tempez | 48725b8703 | |
Fred Tempez | 9bea40ed08 | |
Fred Tempez | 01d6300d90 | |
Fred Tempez | ac28fe496f | |
Fred Tempez | ef371092a0 | |
Fred Tempez | 21afc43656 | |
Fred Tempez | cd03316a9b | |
Fred Tempez | 7ce30078f6 | |
Fred Tempez | ded7bb5c81 | |
Fred Tempez | 87bfe71d9d | |
Fred Tempez | 36537c4b17 | |
Fred Tempez | 13b5adffac | |
Fred Tempez | 28ee5e46a5 | |
Fred Tempez | 0ce3f0d1cb | |
Fred Tempez | f6019714b9 | |
Fred Tempez | e2316dc129 | |
Fred Tempez | fbbf671289 | |
Fred Tempez | 9126d2887b | |
Fred Tempez | 052f4ac035 | |
Fred Tempez | 0f7e271a28 | |
Fred Tempez | 451174cdcf | |
Fred Tempez | 8b8480b444 | |
Fred Tempez | eac4746e8a | |
Fred Tempez | 91a57d30f7 | |
Fred Tempez | 0d94e67ffb | |
Fred Tempez | 09bf4d06f3 | |
Fred Tempez | 1461a35b7a | |
Fred Tempez | e2b0a12824 | |
Fred Tempez | 4fe81830e9 | |
Fred Tempez | c3c5909ea6 | |
Fred Tempez | b297584fbe | |
Fred Tempez | 76721aa91c | |
Fred Tempez | efcfcc6287 | |
Fred Tempez | 3885fbc475 | |
Fred Tempez | 7d23918617 | |
Fred Tempez | 12c12ff9bf | |
Fred Tempez | 511b90e7a8 | |
Fred Tempez | dea8568992 | |
Fred Tempez | 8cfe76bdf6 | |
Fred Tempez | 21c49d8e53 | |
Fred Tempez | a0ffcca22a | |
Fred Tempez | 489f3b0da6 | |
Fred Tempez | 3e8da80e92 | |
Fred Tempez | efab38d4c5 | |
Fred Tempez | 540070af8b | |
Fred Tempez | a67d426a13 | |
Fred Tempez | 3c6d1480ad | |
Fred Tempez | 4387dcda7a | |
Fred Tempez | cf0fb4df53 | |
Fred Tempez | 91c6c0347a | |
Fred Tempez | 4d2bd1c34d | |
Fred Tempez | 280962b852 | |
Fred Tempez | 995a4364f6 | |
Fred Tempez | 9a1ed24295 | |
Fred Tempez | e07ba9963b | |
Fred Tempez | b9669a03e9 | |
Fred Tempez | 2d4e835269 | |
Fred Tempez | 62d1a00a91 | |
Fred Tempez | b948f9baac | |
Fred Tempez | eb581b3fa5 | |
Fred Tempez | 011d435ac5 | |
Fred Tempez | 104e3d408c | |
Fred Tempez | 98ee5d4afe | |
Fred Tempez | 71ecbb1842 | |
Fred Tempez | 5ecae99a87 | |
Fred Tempez | b18820f0b0 | |
Fred Tempez | 0c25151012 | |
Fred Tempez | 9d9db5b8ed | |
Fred Tempez | be7073e63f | |
Fred Tempez | 108947ec3c | |
Fred Tempez | e39c76da33 | |
Fred Tempez | 14def12f2e | |
Fred Tempez | 88ff501195 | |
Fred Tempez | ac133e1547 | |
Fred Tempez | 84b711eac5 | |
Fred Tempez | 127efc3925 | |
Fred Tempez | b3924c73b4 | |
Fred Tempez | f2793d613d | |
Fred Tempez | 47c24d65f7 | |
Fred Tempez | 8320ad6461 | |
Fred Tempez | c2dd9c7f99 | |
Fred Tempez | f57e7fcbdc | |
Fred Tempez | 2819e0d29b | |
Fred Tempez | 283cc7f771 | |
Fred Tempez | 7ac5d9589c | |
Fred Tempez | 2abc9812dc | |
Fred Tempez | 921dff5a82 | |
Fred Tempez | 411565df77 | |
Fred Tempez | 1c1969dc49 | |
Fred Tempez | c6364183af | |
Fred Tempez | a73b65d3fc | |
Fred Tempez | 37d1915007 | |
Fred Tempez | a6a866c01d | |
Fred Tempez | bc9db7f525 | |
Fred Tempez | 2de0594719 | |
Fred Tempez | cd0131e2d4 | |
Fred Tempez | 667417c750 | |
Fred Tempez | f7ea87fb1d | |
Fred Tempez | acd6ddfc56 | |
Fred Tempez | caf00c0d41 | |
Fred Tempez | d64ffa02c7 |
|
@ -9,3 +9,4 @@ site/i18n/*.json
|
|||
core/vendor/tinymce/link_list.json
|
||||
robots.txt
|
||||
sitemap.xml
|
||||
core/module/config/tool/data.key
|
|
@ -32,5 +32,13 @@ Options -Indexes
|
|||
Options -MultiViews
|
||||
</IfModule>
|
||||
|
||||
# Enlever le slash final des URL
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} ^(.+)/$
|
||||
RewriteRule ^ %1 [R=301,L]
|
||||
|
||||
# ne pas supprimer la ligne URL rewriting !
|
||||
|
||||
# URL rewriting
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# ZwiiLMS 1.3.02
|
||||
# ZwiiCampus 1.10.04
|
||||
|
||||
ZwiiLMS (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.
|
||||
ZwiiCampus (Learning Management System) est logiciel auteur destiné à mettre en ligne des tutoriels. Il dispose de plusieurs modalités d'ouverture et d'accès des contenus. Basé sur la version 13 du CMS Zwii, la structure logicielle est solide, le framework de Zwii est éprouvé.
|
||||
|
||||
|
||||
## Configuration recommandée
|
||||
|
@ -68,6 +68,7 @@ A l'occasion de l'installation d'une version majeure, il est recommandé de réa
|
|||
[F] module.json Données des modules de pages
|
||||
[F] theme.css Thème de ce contenu
|
||||
[F] theme.json Thème de ce contenu
|
||||
[F] report.csv Rapport de participation
|
||||
[R] content Dossier des contenus de page
|
||||
[F] accueil.html Exemple contenu de la page d'accueil
|
||||
[R] fonts Dossier contenant les fontes installées
|
||||
|
@ -84,7 +85,7 @@ A l'occasion de l'installation d'une version majeure, il est recommandé de réa
|
|||
[F] core.json Configuration du noyau
|
||||
[F] course.json Données de contenus
|
||||
[F] custom.css Feuille de style de la personnalisation avancée
|
||||
[F] enrolment.json Données des inscriptions et des statistiques par contenu
|
||||
[F] enrolment.json Inscriptions dans les espaces, dernière page vue et timetamp
|
||||
[F] font.json Descripteur des fontes personnalisées
|
||||
[F] journal.log Journalisation des activités
|
||||
[F] language.json Langues de l'interface
|
||||
|
@ -96,7 +97,7 @@ A l'occasion de l'installation d'une version majeure, il est recommandé de réa
|
|||
[R] thumb Miniatures des images
|
||||
[R] tmp Répertoire temporaire
|
||||
|
||||
[F] index.php Fichier d'initialisation de ZwiiLMS
|
||||
[F] index.php Fichier d'initialisation de ZwiiCampus
|
||||
[F] robots.txt Filtrage des répertoires accessibles aux robots des moteurs de recherche
|
||||
[F] sitemap.xml Plan du site
|
||||
[F] sitemap.xml.gz Version compressée
|
||||
|
|
|
@ -193,7 +193,7 @@ class helper
|
|||
{
|
||||
// Creation du ZIP
|
||||
$baseName = str_replace('/', '', helper::baseUrl(false, false));
|
||||
$baseName = empty($baseName) ? 'ZwiiCMS' : $baseName;
|
||||
$baseName = empty($baseName) ? 'Campus' : $baseName;
|
||||
$fileName = $baseName . '-backup-' . date('Y-m-d-H-i-s', time()) . '.zip';
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($folder . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
|
@ -368,7 +368,7 @@ class helper
|
|||
$version = helper::getOnlineVersion($channel);
|
||||
$update = false;
|
||||
if (!empty($version)) {
|
||||
$update = version_compare(common::ZWII_VERSION, $version) === -1;
|
||||
$update = version_compare(common::ZWII_VERSION, $version) == -1;
|
||||
}
|
||||
return $update;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
|||
} elseif (is_array($key)) {
|
||||
// Iterate array of paths
|
||||
foreach ($key as $k) {
|
||||
self::delete($k);
|
||||
self::deleteValue($array, $k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -121,17 +121,17 @@ class JsonDb extends \Prowebcraft\Dot
|
|||
} else {
|
||||
if ($this->config['backup']) {
|
||||
try {
|
||||
//todo make backup of database
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->data = json_decode(file_get_contents($this->db), true);
|
||||
if (!$this->data === null) {
|
||||
throw new \InvalidArgumentException('Database file ' . $this->db
|
||||
. ' contains invalid json object. Please validate or remove file');
|
||||
if (!$this->data === null && json_last_error() !== JSON_ERROR_NONE) {
|
||||
throw new \InvalidArgumentException('Le fichier ' . $this->db
|
||||
. ' contient des données invalides.');
|
||||
}
|
||||
}
|
||||
return $this->data;
|
||||
|
@ -142,20 +142,38 @@ class JsonDb extends \Prowebcraft\Dot
|
|||
*/
|
||||
public function save()
|
||||
{
|
||||
//$v = json_encode($this->data, JSON_UNESCAPED_UNICODE );
|
||||
$v = json_encode($this->data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||
$l = strlen($v);
|
||||
$t = 0;
|
||||
while ($t < 5) {
|
||||
$w = file_put_contents($this->db, $v); // Multi user get a locker
|
||||
if ($w == $l) {
|
||||
// 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);
|
||||
|
||||
// Vérifie la longueur de la chaîne JSON encodée
|
||||
$encoded_length = strlen($encoded_data);
|
||||
|
||||
// Initialise le compteur de tentatives
|
||||
$attempt = 0;
|
||||
|
||||
// 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
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result === $encoded_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
break;
|
||||
}
|
||||
$t++;
|
||||
}
|
||||
if ($w !== $l) {
|
||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées');
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempt++;
|
||||
}
|
||||
|
||||
// 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.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -151,7 +151,7 @@ class layout extends common
|
|||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</main></section>';
|
||||
echo '</section></main>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -291,8 +291,8 @@ class layout extends common
|
|||
$label = empty($this->getData(['config', 'poweredPageLabel'])) ? 'Motorisé par' : $this->getData(['config', 'poweredPageLabel']);
|
||||
$items .= '><wbr> ' . $label . ' </span>';
|
||||
// Toujours afficher le nom du CMS
|
||||
$items .= '<span id="footerZwiiLMS">';
|
||||
$items .= '<a href="https://forge.chapril.org/fredtempez/ZwiiLMS" onclick="window.open(this.href);return false" >ZwiiLMS</a>';
|
||||
$items .= '<span id="footerZwiiCampus">';
|
||||
$items .= '<a href="https://forge.chapril.org/fredtempez/ZwiiCampus" onclick="window.open(this.href);return false" >ZwiiCampus</a>';
|
||||
$items .= '</span>';
|
||||
// Affichage du numéro de version
|
||||
$items .= '<span id="footerDisplayVersion"';
|
||||
|
@ -352,10 +352,11 @@ class layout extends common
|
|||
$items .= $this->getData(['theme', 'footer', 'displaymemberAccount']) === false ? ' class="displayNone">' : '>';
|
||||
$items .= '<wbr> | ';
|
||||
if (
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
) {
|
||||
$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']),
|
||||
'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,
|
||||
'margin' => 'all',
|
||||
'attr' => 'data-lity',
|
||||
'help' => 'Fichiers du site'
|
||||
|
@ -490,6 +491,59 @@ class layout extends common
|
|||
|
||||
// Menu extra
|
||||
$itemsRight = $this->formatMenu(true);
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage du sélecteur d'espaces
|
||||
*/
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||
) {
|
||||
if ($this->getCoursesByProfil()) {
|
||||
$itemsRight .= '<li><select id="menuSelectCourse" >';
|
||||
$itemsRight .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
|
||||
foreach ($this->getCoursesByProfil() as $courseId => $value) {
|
||||
$itemsRight .= '<option name="' . $this->getData(['course', $courseId, 'title']) . '" value="' . helper::baseUrl(true) . 'course/swap/' . $courseId . '" ' . ($courseId === self::$siteContent ? 'selected' : '') . '>' . $this->getData(['course', $courseId, 'title']) . '</option>';
|
||||
}
|
||||
$itemsRight .= '</select></li>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Commandes pour les membres simples
|
||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||
*/
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_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') {
|
||||
$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,
|
||||
'attr' => 'data-lity',
|
||||
'help' => 'Fichiers du site'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Affiche l'icône d'édition du compte
|
||||
if ($this->getUser('permission', 'user', 'edit') === true) {
|
||||
$itemsRight .= '<li>' . template::ico('user', [
|
||||
'help' => 'Mon compte',
|
||||
'margin' => 'right',
|
||||
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
|
||||
]) . '</li>';
|
||||
}
|
||||
$itemsRight .= '<li>' .
|
||||
template::ico('logout', [
|
||||
'help' => 'Déconnecter',
|
||||
'href' => helper::baseUrl() . 'user/logout',
|
||||
'id' => 'barLogout'
|
||||
]) . '</li>';
|
||||
}
|
||||
|
||||
// Lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'menu', 'loginLink'])
|
||||
|
@ -504,37 +558,7 @@ class layout extends common
|
|||
]) .
|
||||
'</li>';
|
||||
}
|
||||
// Commandes pour les membres simples
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN
|
||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||
) {
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_MEMBER &&
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
) {
|
||||
$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']),
|
||||
'attr' => 'data-lity',
|
||||
'help' => 'Fichiers du site'
|
||||
]) . '</li>';
|
||||
}
|
||||
if (
|
||||
$this->getUser('permission', 'user', 'edit') === true
|
||||
) {
|
||||
$itemsRight .= '<li>' . template::ico('user', [
|
||||
'help' => 'Mon compte',
|
||||
'margin' => 'right',
|
||||
'href' => helper::baseUrl() . 'user/edit/' . $this->getUser('id')
|
||||
]) . '</li>';
|
||||
}
|
||||
$itemsRight .= '<li>' .
|
||||
template::ico('logout', [
|
||||
'help' => 'Déconnecter',
|
||||
'href' => helper::baseUrl() . 'user/logout',
|
||||
'id' => 'barLogout'
|
||||
]) . '</li>';
|
||||
}
|
||||
|
||||
// Retourne les items du menu
|
||||
echo '<ul class="navMain" id="menuLeft">' . $itemsLeft . '</ul><ul class="navMain" id="menuRight">' . $itemsRight;
|
||||
echo '</ul>';
|
||||
|
@ -895,21 +919,22 @@ class layout extends common
|
|||
$leftItems = '';
|
||||
// Sélecteur de contenu
|
||||
/**
|
||||
* Les admins voient tousles contenus
|
||||
* Les admins voient tous les contenus
|
||||
* Les enseignants les contenus dont ils sont auteurs
|
||||
*/
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) {
|
||||
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>';
|
||||
foreach ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) as $key => $value) {
|
||||
$leftItems .= '<option name="' . $value['title'] . '" value="' . helper::baseUrl(true) . 'course/swap/' . $key . '" ' . ($key === self::$siteContent ? 'selected' : '') . '>' . $value['title'] . '</option>';
|
||||
foreach ($this->getCoursesByProfil() as $courseId => $value) {
|
||||
$leftItems .= '<option name="' . $this->getData(['course', $courseId, 'title']) . '" value="' . helper::baseUrl(true) . 'course/swap/' . $courseId . '" ' . ($courseId === self::$siteContent ? 'selected' : '') . '>' . $this->getData(['course', $courseId, 'title']) . '</option>';
|
||||
}
|
||||
$leftItems .= '</select></li>';
|
||||
}
|
||||
|
||||
$leftItems .= '<li>' . template::ico('cubes', [
|
||||
'href' => helper::baseUrl() . 'course',
|
||||
'help' => 'Espaces'
|
||||
'help' => 'Gérer les espaces'
|
||||
]) . '</li>';
|
||||
}
|
||||
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
|
@ -918,8 +943,11 @@ class layout extends common
|
|||
'href' => helper::baseUrl() . 'theme'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Liste des pages
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
// 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
|
||||
) {
|
||||
$leftItems .= '<li><select id="barSelectPage">';
|
||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||
$leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">';
|
||||
|
@ -973,7 +1001,7 @@ class layout extends common
|
|||
// Bouton Ajouter une page
|
||||
if ($this->getUser('permission', 'page', 'add')) {
|
||||
$leftItems .= '<li>' . template::ico('plus', [
|
||||
'href' => helper::baseUrl() . 'page/add',
|
||||
'href' => helper::baseUrl() . 'page/add/' . self::$siteContent,
|
||||
'help' => 'Nouvelle page ou barre latérale'
|
||||
]) . '</li>';
|
||||
}
|
||||
|
@ -990,9 +1018,9 @@ class layout extends common
|
|||
or $this->getUrl(0) === ''
|
||||
) {
|
||||
// Bouton Editer une page
|
||||
if ($this->getUser('permission', 'page', 'edit')) {
|
||||
if ($this->getUser('permission', 'page', 'edit') and $this->geturl(1) !== 'edit') {
|
||||
$leftItems .= '<li>' . template::ico('pencil', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Éditer la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
|
@ -1011,7 +1039,7 @@ class layout extends common
|
|||
$this->getUser('permission', 'page', 'duplicate')
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('clone', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0),
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Dupliquer la page'
|
||||
])
|
||||
. '</li>';
|
||||
|
@ -1021,7 +1049,7 @@ class layout extends common
|
|||
$this->getUser('permission', 'page', 'delete')
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('trash', [
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0),
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Supprimer la page',
|
||||
'id' => 'pageDelete'
|
||||
])
|
||||
|
@ -1032,18 +1060,16 @@ class layout extends common
|
|||
// Items de droite
|
||||
$rightItems = '';
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
// ZwiiCampus ------
|
||||
&& self::$siteContent !== 'home'
|
||||
// ZwiiCampus ------
|
||||
&& $this->getUser(
|
||||
'permission',
|
||||
'filemanager'
|
||||
(
|
||||
$this->getUser('group') === self::GROUP_EDITOR
|
||||
&& $this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
)
|
||||
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||
) {
|
||||
$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']),
|
||||
'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,
|
||||
'attr' => 'data-lity'
|
||||
]) . '</li>';
|
||||
}
|
||||
|
|
|
@ -15,12 +15,12 @@ class core extends common
|
|||
}
|
||||
|
||||
// Fuseau horaire
|
||||
self::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
||||
date_default_timezone_set(self::$timezone);
|
||||
common::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
||||
date_default_timezone_set(common::$timezone);
|
||||
// Supprime les fichiers temporaires
|
||||
$lastClearTmp = mktime(0, 0, 0);
|
||||
if ($lastClearTmp > $this->getData(['core', 'lastClearTmp']) + 86400) {
|
||||
$iterator = new DirectoryIterator(self::TEMP_DIR);
|
||||
$iterator = new DirectoryIterator(common::TEMP_DIR);
|
||||
foreach ($iterator as $fileInfos) {
|
||||
if (
|
||||
$fileInfos->isFile() &&
|
||||
|
@ -43,11 +43,11 @@ class core extends common
|
|||
and $this->getData(['user']) // Pas de backup pendant l'installation
|
||||
) {
|
||||
// Copie des fichier de données
|
||||
helper::autoBackup(self::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||
helper::autoBackup(common::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||
// Date du dernier backup
|
||||
$this->setData(['core', 'lastBackup', $lastBackup]);
|
||||
// Supprime les backups de plus de 30 jours
|
||||
$iterator = new DirectoryIterator(self::BACKUP_DIR);
|
||||
$iterator = new DirectoryIterator(common::BACKUP_DIR);
|
||||
foreach ($iterator as $fileInfos) {
|
||||
if (
|
||||
$fileInfos->isFile()
|
||||
|
@ -60,23 +60,23 @@ class core extends common
|
|||
}
|
||||
|
||||
// Crée le fichier de personnalisation avancée
|
||||
if (file_exists(self::DATA_DIR . 'custom.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'custom.css', ('core/module/theme/resource/custom.css'));
|
||||
chmod(self::DATA_DIR . 'custom.css', 0755);
|
||||
if (file_exists(common::DATA_DIR . 'custom.css') === false) {
|
||||
file_put_contents(common::DATA_DIR . 'custom.css', ('core/module/theme/resource/custom.css'));
|
||||
chmod(common::DATA_DIR . 'custom.css', 0755);
|
||||
}
|
||||
// Crée le fichier de personnalisation
|
||||
if (file_exists(self::DATA_DIR . self::$siteContent . '/theme.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . self::$siteContent . '/theme.css', '');
|
||||
chmod(self::DATA_DIR . self::$siteContent . '/theme.css', 0755);
|
||||
if (file_exists(common::DATA_DIR . common::$siteContent . '/theme.css') === false) {
|
||||
file_put_contents(common::DATA_DIR . common::$siteContent . '/theme.css', '');
|
||||
chmod(common::DATA_DIR . common::$siteContent . '/theme.css', 0755);
|
||||
}
|
||||
// Crée le fichier de personnalisation de l'administration
|
||||
if (file_exists(self::DATA_DIR . 'admin.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'admin.css', '');
|
||||
chmod(self::DATA_DIR . 'admin.css', 0755);
|
||||
if (file_exists(common::DATA_DIR . 'admin.css') === false) {
|
||||
file_put_contents(common::DATA_DIR . 'admin.css', '');
|
||||
chmod(common::DATA_DIR . 'admin.css', 0755);
|
||||
}
|
||||
|
||||
// Check la version rafraichissement du theme
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . self::$siteContent . '/theme.css'));
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . common::$siteContent . '/theme.css'));
|
||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) {
|
||||
// Version
|
||||
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
|
||||
|
@ -92,7 +92,7 @@ class core extends common
|
|||
// Fonts disponibles
|
||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||
|
||||
// Fontes installées
|
||||
$fonts = [
|
||||
|
@ -105,53 +105,14 @@ class core extends common
|
|||
// Suppression des polices identiques
|
||||
$fonts = array_unique($fonts);
|
||||
|
||||
/**
|
||||
* Charge les fontes websafe
|
||||
*/
|
||||
$fontFile = '';
|
||||
foreach ($fonts as $fontId) {
|
||||
if (isset($fontsAvailable['websafe'][$fontId])) {
|
||||
$fonts[$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Chargement des polices en ligne dans un fichier font.html inclus dans main.php
|
||||
*/
|
||||
$fontFile = '';
|
||||
$gf = false;
|
||||
foreach ($fonts as $fontId) {
|
||||
if (isset($fontsAvailable['imported'][$fontId])) {
|
||||
$fontFile .= '<link href="' . $fontsAvailable['imported'][$fontId]['resource'] . '" rel="stylesheet">';
|
||||
// Tableau pour la construction de la feuille de style
|
||||
$fonts[$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
||||
$gf = strpos($fontsAvailable['imported'][$fontId]['resource'], 'fonts.googleapis.com') === false ? $gf || false : $gf || true;
|
||||
}
|
||||
}
|
||||
// Ajoute le préconnect des fontes Googles.
|
||||
$fontFile = $gf ? '<link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' . $fontFile
|
||||
: $fontFile;
|
||||
// Enregistre la personnalisation
|
||||
if (!is_dir(self::DATA_DIR . 'font')) {
|
||||
mkdir(self::DATA_DIR . 'font');
|
||||
}
|
||||
file_put_contents(self::DATA_DIR . 'font/font.html', $fontFile);
|
||||
|
||||
/**
|
||||
* Fontes installées localement
|
||||
* Charge les fontes
|
||||
*/
|
||||
foreach ($fonts as $fontId) {
|
||||
// Validité du tableau :
|
||||
if (isset($fontsAvailable['files'][$fontId])) {
|
||||
if (file_exists(self::DATA_DIR . 'font/' . $fontId)) {
|
||||
// Chargement de la police
|
||||
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
||||
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'font/' . $fontsAvailable['files'][$fontId]['resource'] . '");}';
|
||||
// Tableau pour la construction de la feuille de style
|
||||
$fonts[$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
||||
} else {
|
||||
// Le fichier de font n'est pas disponible, fonte par défaut
|
||||
$fonts[$fontId] = 'verdana';
|
||||
foreach (['websafe', 'imported', 'files'] as $typeFont) {
|
||||
if (isset($fontsAvailable[$typeFont][$fontId])) {
|
||||
$fonts[$fontId] = $fontsAvailable[$typeFont][$fontId]['font-family'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -223,7 +184,7 @@ class core extends common
|
|||
|
||||
// Bannière
|
||||
|
||||
// Éléments communs
|
||||
// Eléments communs
|
||||
if ($this->getData(['theme', 'header', 'margin'])) {
|
||||
if ($this->getData(['theme', 'menu', 'position']) === 'site-first') {
|
||||
$css .= 'header{margin:0 20px}';
|
||||
|
@ -311,14 +272,8 @@ class core extends common
|
|||
$css .= '#footerText > p {text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}';
|
||||
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
||||
|
||||
// Enregistre les fontes
|
||||
if (!is_dir(self::DATA_DIR . 'font')) {
|
||||
mkdir(self::DATA_DIR . 'font');
|
||||
}
|
||||
file_put_contents(self::DATA_DIR . 'font/font.html', $fontFile);
|
||||
|
||||
// Enregistre la personnalisation
|
||||
file_put_contents(self::DATA_DIR . self::$siteContent . '/theme.css', $css);
|
||||
file_put_contents(common::DATA_DIR . common::$siteContent . '/theme.css', $css);
|
||||
|
||||
// Effacer le cache pour tenir compte de la couleur de fond TinyMCE
|
||||
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
|
||||
|
@ -329,7 +284,7 @@ class core extends common
|
|||
}
|
||||
|
||||
// Check la version rafraichissement du theme admin
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'admin.css'));
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . 'admin.css'));
|
||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) {
|
||||
|
||||
// Version
|
||||
|
@ -338,7 +293,7 @@ class core extends common
|
|||
// Fonts disponibles
|
||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||
|
||||
/**
|
||||
* Import des polices de caractères
|
||||
|
@ -352,44 +307,12 @@ class core extends common
|
|||
$fonts = array_unique($fonts);
|
||||
|
||||
/**
|
||||
* Charge les fontes websafe
|
||||
*/
|
||||
$fontFile = '';
|
||||
foreach ($fonts as $fontId) {
|
||||
if (isset($fontsAvailable['websafe'][$fontId])) {
|
||||
$fonts[$fontId] = $fontsAvailable['websafe'][$fontId]['font-family'];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Chargement des polices en ligne dans un fichier font.html inclus dans main.php
|
||||
*/
|
||||
$fontFile = '';
|
||||
foreach ($fonts as $fontId) {
|
||||
if (isset($fontsAvailable['imported'][$fontId])) {
|
||||
$fontFile .= '<link href="' . $fontsAvailable['imported'][$fontId]['resource'] . '" rel="stylesheet">';
|
||||
// Tableau pour la construction de la feuille de style
|
||||
$fonts[$fontId] = $fontsAvailable['imported'][$fontId]['font-family'];
|
||||
}
|
||||
}
|
||||
// Enregistre la personnalisation
|
||||
file_put_contents(self::DATA_DIR . 'font/font.html', $fontFile);
|
||||
|
||||
/**
|
||||
* Fontes installées localement
|
||||
* Charge les fontes
|
||||
*/
|
||||
foreach ($fonts as $fontId) {
|
||||
// Validité du tableau :
|
||||
if (isset($fontsAvailable['files'][$fontId])) {
|
||||
if (file_exists(self::DATA_DIR . 'font/' . $fontId)) {
|
||||
// Chargement de la police
|
||||
$css .= '@font-face {font-family:"' . $fontsAvailable['files'][$fontId]['font-family'] . '";';
|
||||
$css .= 'src: url("' . helper::baseUrl(false) . self::DATA_DIR . 'font/' . $fontsAvailable['files'][$fontId]['resource'] . '");}';
|
||||
// Tableau pour la construction de la feuille de style
|
||||
$fonts[$fontId] = $fontsAvailable['files'][$fontId]['font-family'];
|
||||
} else {
|
||||
// Le fichier de font n'est pas disponible, fonte par défaut
|
||||
$fonts[$fontId] = 'verdana';
|
||||
foreach (['websafe', 'imported', 'files'] as $typeFont) {
|
||||
if (isset($fontsAvailable[$typeFont][$fontId])) {
|
||||
$fonts[$fontId] = $fontsAvailable[$typeFont][$fontId]['font-family'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -441,11 +364,11 @@ 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(#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=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']) . ';}';
|
||||
// Bordure du contour TinyMCE
|
||||
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
||||
// Enregistre la personnalisation
|
||||
file_put_contents(self::DATA_DIR . 'admin.css', $css);
|
||||
file_put_contents(common::DATA_DIR . 'admin.css', $css);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -461,8 +384,8 @@ class core extends common
|
|||
require 'core/module/' . $classPath;
|
||||
}
|
||||
// Module
|
||||
elseif (is_readable(self::MODULE_DIR . $classPath)) {
|
||||
require self::MODULE_DIR . $classPath;
|
||||
elseif (is_readable(common::MODULE_DIR . $classPath)) {
|
||||
require common::MODULE_DIR . $classPath;
|
||||
}
|
||||
// Librairie
|
||||
elseif (is_readable('core/vendor/' . $classPath)) {
|
||||
|
@ -491,22 +414,23 @@ class core extends common
|
|||
// Sauvegarde la dernière page visitée par l'utilisateur connecté et enregistre l'historique des consultations
|
||||
if (
|
||||
$this->getUser('id')
|
||||
&& self::$siteContent !== 'home'
|
||||
&& common::$siteContent !== 'home'
|
||||
&& in_array($this->getUrl(0), array_keys($this->getData(['page'])))
|
||||
// Le userId n'est pas celui d'un admis ni le prof du contenu
|
||||
&& (
|
||||
$this->getUser('group') < self::GROUP_ADMIN
|
||||
|| $this->getUser('id') !== $this->getData(['course', self::$siteContent, 'author'])
|
||||
$this->getUser('group') < common::GROUP_ADMIN
|
||||
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author'])
|
||||
)
|
||||
) {
|
||||
// Stocke l'historique des pages vues
|
||||
$data = is_array($this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
|
||||
? array_merge([time()], $this->getData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0)]))
|
||||
: [time()];
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'history', $this->getUrl(0), $data]);
|
||||
// Stocke la dernière page vue et sa date de consultation
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'lastPageView', $this->getUrl(0)]);
|
||||
$this->setData(['enrolment', self::$siteContent, $this->getUser('id'), 'datePageView', time()]);
|
||||
$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);
|
||||
|
||||
}
|
||||
|
||||
// Journalisation
|
||||
|
@ -515,7 +439,7 @@ 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') === self::GROUP_BANNED
|
||||
and ($this->getUser('group') === common::GROUP_BANNED
|
||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
)
|
||||
|
@ -530,7 +454,7 @@ class core extends common
|
|||
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') < self::GROUP_ADMIN
|
||||
and $this->getUser('group') < common::GROUP_ADMIN
|
||||
)
|
||||
)
|
||||
) {
|
||||
|
@ -543,31 +467,11 @@ class core extends common
|
|||
exit();
|
||||
}
|
||||
|
||||
// Pour éviter une 404 sur une langue étrangère, bascule dans la langue correcte.
|
||||
if (is_null($this->getData(['page', $this->getUrl(0)]))) {
|
||||
foreach ($this->getData(['course']) as $key => $value) {;
|
||||
if (
|
||||
is_dir(self::DATA_DIR . $key) &&
|
||||
file_exists(self::DATA_DIR . $key . '/page.json')
|
||||
) {
|
||||
$pagesId = json_decode(file_get_contents(self::DATA_DIR . $key . '/page.json'), true);
|
||||
if (
|
||||
is_array($pagesId['page']) &&
|
||||
array_key_exists($this->getUrl(0), $pagesId['page'])
|
||||
) {
|
||||
//$_SESSION['ZWII_SITE_CONTENT'] = $key;
|
||||
header('Refresh:0; url=' . helper::baseUrl() . 'course/swap/' . $key . '/' . $this->getUrl(0));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check l'accès à la page
|
||||
$access = null;
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
if (
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR
|
||||
$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'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
|
@ -588,7 +492,7 @@ class core extends common
|
|||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$access = false;
|
||||
|
@ -614,9 +518,9 @@ class core extends common
|
|||
$this->getUser('id') &&
|
||||
$userId !== $this->getUser('id') &&
|
||||
$this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() &&
|
||||
array_intersect($t, self::$concurrentAccess) &&
|
||||
//array_intersect($t, self::$accessExclude) !== false &&
|
||||
time() < $this->getData(['user', $userId, 'accessTimer']) + self::ACCESS_TIMER
|
||||
array_intersect($t, common::$concurrentAccess) &&
|
||||
//array_intersect($t, common::$accessExclude) !== false &&
|
||||
time() < $this->getData(['user', $userId, 'accessTimer']) + common::ACCESS_TIMER
|
||||
) {
|
||||
$access = false;
|
||||
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
||||
|
@ -653,10 +557,10 @@ class core extends common
|
|||
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
|
||||
|
||||
// Importe le contenu, le CSS et le script des barres
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$siteContent) : '';
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), common::$siteContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$siteContent) : '';
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), common::$siteContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
|
||||
|
||||
|
@ -674,7 +578,7 @@ class core extends common
|
|||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
'content' => $this->getPage($this->getUrl(0), self::$siteContent),
|
||||
'content' => $this->getPage($this->getUrl(0), common::$siteContent),
|
||||
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
||||
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
||||
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
||||
|
@ -700,7 +604,7 @@ class core extends common
|
|||
: $this->getData(['page', $this->getUrl(0), 'metaDescription']);
|
||||
|
||||
// Importe le CSS de la page principale
|
||||
$pageContent = $this->getPage($this->getUrl(0), self::$siteContent);
|
||||
$pageContent = $this->getPage($this->getUrl(0), common::$siteContent);
|
||||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
|
@ -745,7 +649,7 @@ class core extends common
|
|||
$output = $module->output;
|
||||
// Check le groupe de l'utilisateur
|
||||
if (
|
||||
($module::$actions[$action] === self::GROUP_VISITOR
|
||||
($module::$actions[$action] === common::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') >= $module::$actions[$action]
|
||||
and $this->getUser('permission', $moduleId, $action)
|
||||
|
@ -758,10 +662,10 @@ class core extends common
|
|||
foreach ($_POST as $postId => $postValue) {
|
||||
if (is_array($postValue)) {
|
||||
foreach ($postValue as $subPostId => $subPostValue) {
|
||||
self::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
||||
common::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
||||
}
|
||||
} else {
|
||||
self::$inputBefore[$postId] = $postValue;
|
||||
common::$inputBefore[$postId] = $postValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -801,9 +705,9 @@ class core extends common
|
|||
// Contenu par vue
|
||||
elseif ($output['view']) {
|
||||
// Chemin en fonction d'un module du coeur ou d'un module
|
||||
$modulePath = in_array($moduleId, self::$coreModuleIds) ? 'core/' : '';
|
||||
$modulePath = in_array($moduleId, common::$coreModuleIds) ? 'core/' : '';
|
||||
// CSS
|
||||
$stylePath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
||||
$stylePath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
||||
if (file_exists($stylePath)) {
|
||||
$this->addOutput([
|
||||
'style' => file_get_contents($stylePath)
|
||||
|
@ -816,7 +720,7 @@ class core extends common
|
|||
}
|
||||
|
||||
// JS
|
||||
$scriptPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
||||
$scriptPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
||||
if (file_exists($scriptPath)) {
|
||||
ob_start();
|
||||
include $scriptPath;
|
||||
|
@ -825,7 +729,7 @@ class core extends common
|
|||
]);
|
||||
}
|
||||
// Vue
|
||||
$viewPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
||||
$viewPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
||||
if (file_exists($viewPath)) {
|
||||
ob_start();
|
||||
include $viewPath;
|
||||
|
@ -899,8 +803,9 @@ class core extends common
|
|||
} else {
|
||||
if (
|
||||
$this->getData(['config', 'page403']) !== 'none'
|
||||
and $this->getData(['page', $this->getData(['config', 'page403'])])
|
||||
//and $this->getData(['page', $this->getData(['config', 'page403'])])
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
|
||||
header('Location:' . helper::baseUrl() . $this->getData(['config', 'page403']));
|
||||
} else {
|
||||
$this->addOutput([
|
||||
|
@ -910,13 +815,40 @@ class core extends common
|
|||
}
|
||||
}
|
||||
} elseif ($this->output['content'] === '') {
|
||||
|
||||
// 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) {;
|
||||
if (
|
||||
// l'espace existe
|
||||
is_dir(common::DATA_DIR . $courseId) &&
|
||||
file_exists(common::DATA_DIR . $courseId . '/page.json')
|
||||
) {
|
||||
// Lire les données des pages
|
||||
$pagesId = json_decode(file_get_contents(common::DATA_DIR . $courseId . '/page.json'), true);
|
||||
if (
|
||||
// La page existe
|
||||
is_array($pagesId['page']) &&
|
||||
array_key_exists($this->getUrl(0), $pagesId['page'])
|
||||
) {
|
||||
// Basculer
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
// La page n'existe pas dans les esapces, on génére une erreur 404
|
||||
http_response_code(404);
|
||||
if (
|
||||
// une page est définie dans la configuration mais dans home
|
||||
$this->getData(['config', 'page404']) !== 'none'
|
||||
and $this->getData(['page', $this->getData(['config', 'page404'])])
|
||||
) {
|
||||
// Bascule sur l'acccueil et rediriger
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = 'home';
|
||||
header('Location:' . helper::baseUrl() . $this->getData(['config', 'page404']));
|
||||
} else {
|
||||
// Page par défaut
|
||||
$this->addOutput([
|
||||
'title' => 'Page indisponible',
|
||||
'content' => template::speech('<p>' . helper::translate('La page demandée n\'existe pas ou est introuvable (erreur 404)') . '</p><p><a style="color:inherit" href="javascript:history.back()">'. helper::translate('Retour') . '</a></p>')
|
||||
|
@ -942,25 +874,25 @@ class core extends common
|
|||
}
|
||||
switch ($this->output['display']) {
|
||||
// Layout brut
|
||||
case self::DISPLAY_RAW:
|
||||
case common::DISPLAY_RAW:
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout vide
|
||||
case self::DISPLAY_LAYOUT_BLANK:
|
||||
case common::DISPLAY_LAYOUT_BLANK:
|
||||
require 'core/layout/blank.php';
|
||||
break;
|
||||
// Affichage en JSON
|
||||
case self::DISPLAY_JSON:
|
||||
case common::DISPLAY_JSON:
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($this->output['content']);
|
||||
break;
|
||||
// RSS feed
|
||||
case self::DISPLAY_RSS:
|
||||
case common::DISPLAY_RSS:
|
||||
header('Content-type: application/rss+xml; charset=UTF-8');
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout allégé
|
||||
case self::DISPLAY_LAYOUT_LIGHT:
|
||||
case common::DISPLAY_LAYOUT_LIGHT:
|
||||
ob_start();
|
||||
require 'core/layout/light.php';
|
||||
$content = ob_get_clean();
|
||||
|
@ -971,7 +903,7 @@ class core extends common
|
|||
echo $content;
|
||||
break;
|
||||
// Layout principal
|
||||
case self::DISPLAY_LAYOUT_MAIN:
|
||||
case common::DISPLAY_LAYOUT_MAIN:
|
||||
ob_start();
|
||||
require 'core/layout/main.php';
|
||||
$content = ob_get_clean();
|
||||
|
|
|
@ -358,7 +358,7 @@ class template
|
|||
%s
|
||||
data-lity
|
||||
>
|
||||
' . self::ico('upload', ['margin' => 'right']) . '
|
||||
' . self::ico('upload-cloud', ['margin' => 'right']) . '
|
||||
<span class="inputFileLabel"></span>
|
||||
</a>',
|
||||
$attributes['class'],
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -23,15 +23,15 @@ core.alert = function (text) {
|
|||
.append(
|
||||
$("<span>").text(text),
|
||||
$("<div>")
|
||||
.addClass("lightboxButtons")
|
||||
.append(
|
||||
$("<a>")
|
||||
.addClass("button")
|
||||
.text("Ok")
|
||||
.on("click", function () {
|
||||
lightbox.close();
|
||||
})
|
||||
)
|
||||
.addClass("lightboxButtons")
|
||||
.append(
|
||||
$("<a>")
|
||||
.addClass("button")
|
||||
.text("Ok")
|
||||
.on("click", function () {
|
||||
lightbox.close();
|
||||
})
|
||||
)
|
||||
)
|
||||
}(jQuery));
|
||||
// Validation de la lightbox avec le bouton entrée
|
||||
|
@ -67,29 +67,29 @@ core.confirm = function (text, yesCallback, noCallback) {
|
|||
.append(
|
||||
$("<span>").text(text),
|
||||
$("<div>")
|
||||
.addClass("lightboxButtons")
|
||||
.append(
|
||||
$("<a>")
|
||||
.addClass("button grey")
|
||||
.text("<?php echo helper::translate('Non');?>")
|
||||
.on("click", function () {
|
||||
lightbox.options('button', true);
|
||||
lightbox.close();
|
||||
if (typeof noCallback !== "undefined") {
|
||||
noCallback();
|
||||
}
|
||||
}),
|
||||
$("<a>")
|
||||
.addClass("button")
|
||||
.text("<?php echo helper::translate('Oui');?>")
|
||||
.on("click", function () {
|
||||
lightbox.options('button', true);
|
||||
lightbox.close();
|
||||
if (typeof yesCallback !== "undefined") {
|
||||
yesCallback();
|
||||
}
|
||||
})
|
||||
)
|
||||
.addClass("lightboxButtons")
|
||||
.append(
|
||||
$("<a>")
|
||||
.addClass("button grey")
|
||||
.text("<?php echo helper::translate('Non');?>")
|
||||
.on("click", function () {
|
||||
lightbox.options('button', true);
|
||||
lightbox.close();
|
||||
if (typeof noCallback !== "undefined") {
|
||||
noCallback();
|
||||
}
|
||||
}),
|
||||
$("<a>")
|
||||
.addClass("button")
|
||||
.text("<?php echo helper::translate('Oui');?>")
|
||||
.on("click", function () {
|
||||
lightbox.options('button', true);
|
||||
lightbox.close();
|
||||
if (typeof yesCallback !== "undefined") {
|
||||
yesCallback();
|
||||
}
|
||||
})
|
||||
)
|
||||
)
|
||||
}(jQuery));
|
||||
// Callback lors d'un clic sur le fond et sur la croix de fermeture
|
||||
|
@ -291,14 +291,14 @@ core.start = function () {
|
|||
});
|
||||
// Confirmation de mise à jour
|
||||
$("#barUpdate").on("click", function () {
|
||||
message = "<?php echo helper::translate('Mettre à jour') . ' ?';?>";
|
||||
message = "<?php echo helper::translate('Mise à jour') . ' ?';?>";
|
||||
return core.confirm(message, function () {
|
||||
$(location).attr("href", $("#barUpdate").attr("href"));
|
||||
});
|
||||
});
|
||||
// Confirmation de déconnexion
|
||||
$("#barLogout").on("click", function () {
|
||||
message = "<?php echo helper::translate('Se déconnecter') . '?';?>";
|
||||
message = "<?php echo helper::translate('Se déconnecter') . ' ?';?>";
|
||||
return core.confirm(message, function () {
|
||||
$(location).attr("href", $("#barLogout").attr("href"));
|
||||
});
|
||||
|
@ -525,7 +525,7 @@ $(document).ready(function () {
|
|||
|
||||
|
||||
/**
|
||||
* Sélection d'une langue du site
|
||||
* Sélection d'un espace du site
|
||||
*/
|
||||
$("select#barSelectCourse").on("change", function () {
|
||||
// La langue courante ne déclenche pas de chargement
|
||||
|
@ -538,14 +538,37 @@ $(document).ready(function () {
|
|||
var currentUrl = url.href.split("/");
|
||||
// Change si différent, corrige le problème avec le thème et le rechargement de la langue.
|
||||
if ((currentUrl !== "?theme" ||
|
||||
currentUrl !== "theme") &&
|
||||
currentUrl !== "theme") &&
|
||||
langSelected[6] !== langSession
|
||||
) {
|
||||
//$(location).attr("href", langUrl);
|
||||
var select = document.getElementById("barSelectCourse");
|
||||
var selectedOption = select.options[select.selectedIndex];
|
||||
if (selectedOption.value !== "") {
|
||||
window.location = selectedOption.value; }
|
||||
window.location = selectedOption.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$("select#menuSelectCourse").on("change", function () {
|
||||
// La langue courante ne déclenche pas de chargement
|
||||
var langSelected = $(this).val();
|
||||
var langSelected = langSelected.split("/");
|
||||
// Lit le cookie de langue
|
||||
var langSession = "<?php echo isset($_SESSION['ZWII_SITE_CONTENT']) ? $_SESSION['ZWII_SITE_CONTENT'] : '';?>";
|
||||
// Découpe l'URL pour exclure le changement de page avec le thème
|
||||
var url = window.location;
|
||||
var currentUrl = url.href.split("/");
|
||||
// Change si différent, corrige le problème avec le thème et le rechargement de la langue.
|
||||
if ((currentUrl !== "?theme" ||
|
||||
currentUrl !== "theme") &&
|
||||
langSelected[6] !== langSession
|
||||
) {
|
||||
var select = document.getElementById("menuSelectCourse");
|
||||
var selectedOption = select.options[select.selectedIndex];
|
||||
if (selectedOption.value !== "") {
|
||||
window.location = selectedOption.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
162
core/core.php
162
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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ class common
|
|||
const GROUP_MEMBER = 1;
|
||||
const GROUP_EDITOR = 2;
|
||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
const SIGNATURE_PSEUDO = 2;
|
||||
|
@ -50,7 +51,7 @@ class common
|
|||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '1.4.01';
|
||||
const ZWII_VERSION = '1.10.04';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/campus-update/raw/branch/master/';
|
||||
|
@ -147,24 +148,24 @@ class common
|
|||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Enseignant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupEdits = [
|
||||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Enseignant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupNews = [
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Enseignant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupPublics = [
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Étudiant',
|
||||
self::GROUP_EDITOR => 'Enseignant',
|
||||
self::GROUP_EDITOR => 'Formateur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
|
||||
|
@ -175,6 +176,7 @@ class common
|
|||
public static $i18nUI = 'fr_FR';
|
||||
// Langues de contenu
|
||||
public static $siteContent = 'home';
|
||||
|
||||
public static $languages = [
|
||||
'de' => 'Deutsch',
|
||||
'en_EN' => 'English',
|
||||
|
@ -326,14 +328,12 @@ class common
|
|||
$this->input['_COOKIE'] = $_COOKIE;
|
||||
}
|
||||
|
||||
// Extraction de la sesion
|
||||
// $this->input['_SESSION'] = $_SESSION;
|
||||
|
||||
// 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'];
|
||||
}
|
||||
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
// Les fichiers de configuration
|
||||
foreach ($this->configFiles as $module => $value) {
|
||||
|
@ -344,7 +344,6 @@ class common
|
|||
$this->initDB($module, self::$siteContent);
|
||||
}
|
||||
|
||||
|
||||
// Installation fraîche, initialisation de la configuration inexistante
|
||||
// Nécessaire pour le constructeur
|
||||
if ($this->user === []) {
|
||||
|
@ -449,7 +448,7 @@ class common
|
|||
}
|
||||
|
||||
// Mise à jour des données core
|
||||
include('core/include/update.inc.php');
|
||||
include ('core/include/update.inc.php');
|
||||
|
||||
}
|
||||
|
||||
|
@ -597,7 +596,7 @@ class common
|
|||
public function setPage($page, $value, $path)
|
||||
{
|
||||
|
||||
return file_put_contents(self::DATA_DIR . $path . '/content/' . $page . '.html', $value);
|
||||
return $this->secure_file_put_contents(self::DATA_DIR . $path . '/content/' . $page . '.html', $value);
|
||||
}
|
||||
|
||||
|
||||
|
@ -613,13 +612,54 @@ 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 int $flags Les drapeaux optionnels à passer à la fonction $this->secure_file_put_contents
|
||||
* @return bool True si l'écriture a réussi, sinon false
|
||||
*/
|
||||
function secure_file_put_contents($filename, $data, $flags = 0)
|
||||
{
|
||||
|
||||
// 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);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempts++;
|
||||
}
|
||||
|
||||
// Échec de l'écriture après plusieurs tentatives
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function initDB($module, $path = '')
|
||||
{
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
// Constructeur JsonDB;
|
||||
$this->dataFiles[$module] = new \Prowebcraft\JsonDb([
|
||||
'name' => $module . '.json',
|
||||
'dir' => self::DATA_DIR . $path . '/',
|
||||
'dir' => empty($path) ? self::DATA_DIR : self::DATA_DIR . $path . '/',
|
||||
'backup' => file_exists('site/data/.backup')
|
||||
]);
|
||||
|
||||
|
@ -636,7 +676,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)) {
|
||||
|
@ -671,7 +711,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;
|
||||
|
@ -715,7 +755,7 @@ class common
|
|||
foreach ($pages as $pageId => $pagePosition) {
|
||||
if (
|
||||
// Page parent
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ''
|
||||
$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')
|
||||
|
@ -737,21 +777,21 @@ class common
|
|||
}
|
||||
// Enfants
|
||||
foreach ($pages as $pageId => $pagePosition) {
|
||||
|
||||
if (
|
||||
// Page parent
|
||||
$parentId = $this->getData(['page', $pageId, 'parentPageId'])
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and (
|
||||
($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
and $this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
(
|
||||
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
and
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
)
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $this->$parentId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $this->$parentId, 'profil']))
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $this->$pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
or (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and
|
||||
$this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
|
||||
|
||||
)
|
||||
)
|
||||
|
@ -935,7 +975,7 @@ class common
|
|||
}
|
||||
|
||||
/**
|
||||
* Retourne les permission de l'utilisateur connecté
|
||||
* Retourne les permissions de l'utilisateur connecté
|
||||
* @param int $key Clé de la valeur du groupe
|
||||
* @return string|null
|
||||
*/
|
||||
|
@ -944,7 +984,7 @@ class common
|
|||
// Administrateur, toutes les permissions
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
return true;
|
||||
} elseif ($this->getUser('group') < 1) { // Groupe sans autorisation
|
||||
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
|
||||
return false;
|
||||
} elseif (
|
||||
// Groupe avec profil, consultation des autorisations sur deux clés
|
||||
|
@ -968,11 +1008,8 @@ class common
|
|||
if (class_exists($key1)) {
|
||||
$module = new $key1;
|
||||
if (array_key_exists($key2, $module::$actions)) {
|
||||
// var_dump($this->getUser('group'));
|
||||
// var_dump($module::$actions[$key2]);
|
||||
// var_dump($this->getUser('group') >= $module::$actions[$key2]);
|
||||
return $this->getUser('group') >= $module::$actions[$key2];
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -1068,13 +1105,14 @@ class common
|
|||
}
|
||||
// Articles du blog
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog' &&
|
||||
!empty($this->getData(['module', $parentPageId]))
|
||||
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog'
|
||||
&& !empty($this->getData(['module', $parentPageId]))
|
||||
&& $this->getData(['module', $parentPageId, 'posts'])
|
||||
) {
|
||||
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
|
||||
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {
|
||||
$date = $this->getData(['module', $parentPageId, 'posts', $articleId, 'publishedOn']);
|
||||
$sitemap->addUrl('/' . $parentPageId . '/' . $articleId, new DateTime('@{$date}', new DateTimeZone($timezone)));
|
||||
$sitemap->addUrl('/' . $parentPageId . '/' . $articleId, DateTime::createFromFormat('U', $date));
|
||||
$flag = true;
|
||||
}
|
||||
}
|
||||
|
@ -1097,7 +1135,7 @@ class common
|
|||
foreach ($this->getData(['module', $childKey, 'posts']) as $articleId => $article) {
|
||||
if ($this->getData(['module', $childKey, 'posts', $articleId, 'state']) === true) {
|
||||
$date = $this->getData(['module', $childKey, 'posts', $articleId, 'publishedOn']);
|
||||
$sitemap->addUrl('/' . $childKey . '/' . $articleId, new DateTime('@{$date}', new DateTimeZone($timezone)));
|
||||
$sitemap->addUrl('/' . $childKey . '/' . $articleId, DateTime::createFromFormat('U', $date));
|
||||
$flag = true;
|
||||
}
|
||||
}
|
||||
|
@ -1407,7 +1445,7 @@ class common
|
|||
public function saveLog($message = '')
|
||||
{
|
||||
// Journalisation
|
||||
$dataLog = helper::dateUTF8('%Y%m%d', time(), self::$siteContent) . ';' . helper::dateUTF8('%H:%M', time(), self::$siteContent). ';';
|
||||
$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();
|
||||
|
@ -1423,29 +1461,53 @@ class common
|
|||
* Retourne les contenus d'un utilisateur
|
||||
* @param string $userId identifiant
|
||||
* @param string $serStatus teacher ou student ou admin
|
||||
*
|
||||
* CETTE FONCTION EST UTILISEE PAR LAYOUT
|
||||
*
|
||||
*/
|
||||
public function getCoursesByUser($userId, $userStatus)
|
||||
public function getCoursesByProfil()
|
||||
{
|
||||
$c = $this->getData([('course')]);
|
||||
switch ($userStatus) {
|
||||
$courses = $this->getData([('course')]);
|
||||
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
|
||||
$filter = array();
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_ADMIN:
|
||||
return $c;
|
||||
// Affiche tout
|
||||
return $courses;
|
||||
case self::GROUP_EDITOR:
|
||||
foreach ($c as $courseId => $value) {
|
||||
if ($this->getData(['course', $courseId, 'author']) !== $userId) {
|
||||
unset($c[$courseId]);
|
||||
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
|
||||
($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'])
|
||||
// Le cours est ouvert
|
||||
|| $this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST
|
||||
) {
|
||||
$filter[$courseId] = $courses[$courseId];
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
return $filter;
|
||||
case self::GROUP_MEMBER:
|
||||
case self::GROUP_VISITOR:
|
||||
foreach ($c as $courseId => $value) {
|
||||
$students = $this->getData(['enrolment', $courseId, 'students']);
|
||||
if (in_array($userId, $students) === false) {
|
||||
unset($c[$courseId]);
|
||||
foreach ($courses as $courseId => $value) {
|
||||
// Affiche les espaces du participant et les espaces anonymes
|
||||
if (
|
||||
($this->getData(['enrolment', $courseId]) && array_key_exists($this->getUser('id'), $this->getData(['enrolment', $courseId])))
|
||||
|| $this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST
|
||||
) {
|
||||
$filter[$courseId] = $courses[$courseId];
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
return $filter;
|
||||
case self::GROUP_VISITOR:
|
||||
foreach ($courses as $courseId => $value) {
|
||||
// Affiche les espaces anonymes
|
||||
if ($this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST) {
|
||||
$filter[$courseId] = $courses[$courseId];
|
||||
}
|
||||
}
|
||||
return $filter;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Mises à jour suivant les versions de Zwii
|
||||
* Mises à jour suivant les versions de ZwiiCampus
|
||||
*/
|
||||
|
||||
|
||||
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']);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1700]);
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 1800
|
||||
) {
|
||||
// Parcourir la structure pour écrire dans les fichiers CSV
|
||||
foreach ($this->getData(['enrolment']) as $courseId => $users) {
|
||||
$filename = self::DATA_DIR . $courseId . '/report.csv';
|
||||
$fp = fopen($filename, 'w');
|
||||
foreach ($users as $userId => $userData) {
|
||||
$history = array_key_exists('history', $userData) ? $userData['history'] : null;
|
||||
|
||||
if (is_array($history)) {
|
||||
foreach ($history as $pageId => $timestamps) {
|
||||
foreach ($timestamps as $timestamp) {
|
||||
fputcsv($fp, [$userId, $pageId, $timestamp], ';');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->deleteData(['enrolment', $courseId, $userId, 'history']);
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 1800]);
|
||||
}
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
<?php $layout->showVendor(); ?>
|
||||
<?php $layout->showStyle(); ?>
|
||||
<?php $layout->showFonts(); ?>
|
||||
<?php if (file_exists(self::DATA_DIR . 'font/font.css')): ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>font/font.css?<?php echo md5_file(self::DATA_DIR . 'font/font.css'); ?>">
|
||||
<?php endif; ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/blank.css">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR . self::$siteContent; ?>/theme.css?<?php echo md5_file(self::DATA_DIR. self::$siteContent . '/theme.css'); ?>">
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ h3 {
|
|||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
h4, details {
|
||||
font-size: 1.0em;
|
||||
}
|
||||
|
||||
|
@ -161,7 +161,8 @@ h4,
|
|||
p,
|
||||
hr,
|
||||
ul,
|
||||
ol {
|
||||
ol,
|
||||
details {
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
|
@ -551,6 +552,8 @@ body > nav {
|
|||
|
||||
/* Items du menu */
|
||||
|
||||
|
||||
|
||||
nav a>img {
|
||||
margin: -4px 0;
|
||||
vertical-align: middle;
|
||||
|
@ -587,6 +590,7 @@ nav ul {
|
|||
nav li {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
nav li ul {
|
||||
|
@ -604,6 +608,22 @@ nav li ul li {
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
nav li ul #menuSelectCourse {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
nav #menuSelectCourse {
|
||||
width: 150px;
|
||||
border: 0;
|
||||
color: #111112;
|
||||
font-size: 1em;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
line-height: 45px;
|
||||
padding: 5px 10px;
|
||||
margin: 0px 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
nav .navSub a{
|
||||
|
@ -1108,7 +1128,7 @@ footer #footerSocials .zwiico-twitch:hover {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.block h4 {
|
||||
.block h4, details {
|
||||
margin: -20px -20px 10px -20px;
|
||||
padding: 10px;
|
||||
/* background: #ECEFF1;*/
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
<?php $layout->showVendor(); ?>
|
||||
<?php $layout->showStyle(); ?>
|
||||
<?php $layout->showFonts(); ?>
|
||||
<?php if (file_exists(self::DATA_DIR . 'font/font.css')): ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>font/font.css?<?php echo md5_file(self::DATA_DIR . 'font/font.css'); ?>">
|
||||
<?php endif; ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/light.css">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR . self::$siteContent; ?>/theme.css?<?php echo md5_file(self::DATA_DIR. self::$siteContent . '/theme.css'); ?>">
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
<?php $layout->showFavicon(); ?>
|
||||
<?php $layout->showVendor(); ?>
|
||||
<?php $layout->showFonts(); ?>
|
||||
<?php if (file_exists(self::DATA_DIR . 'font/font.css')): ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>font/font.css?<?php echo md5_file(self::DATA_DIR . 'font/font.css'); ?>">
|
||||
<?php endif; ?>
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css?<?php echo md5_file('core/layout/common.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR . self::$siteContent; ?>/theme.css?<?php echo md5_file(self::DATA_DIR . self::$siteContent . '/theme.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR . 'custom.css'); ?>">
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -429,6 +429,17 @@ class config extends common
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
// Action interdite hors de l'espace accueil
|
||||
if (
|
||||
self::$siteContent !== 'home'
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
]);
|
||||
}
|
||||
|
||||
// Soumission du formulaire
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||
|
@ -479,7 +490,7 @@ class config extends common
|
|||
'cookiesFooterText' => $this->getInput('configLocaleCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN)),
|
||||
'buttonValidLabel' => $this->getInput('configLocaleCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getInput('configCookieConsent', helper::FILTER_BOOLEAN)),
|
||||
],
|
||||
'social' => [
|
||||
'social' => [
|
||||
'facebookId' => $this->getInput('socialFacebookId'),
|
||||
'linkedinId' => $this->getInput('socialLinkedinId'),
|
||||
'instagramId' => $this->getInput('socialInstagramId'),
|
||||
|
@ -545,7 +556,7 @@ class config extends common
|
|||
) {
|
||||
// Ajout des lignes dans le .htaccess
|
||||
$fileContent = file_get_contents('.htaccess');
|
||||
$rewriteData = PHP_EOL .
|
||||
$rewriteData =
|
||||
'# URL rewriting' . PHP_EOL .
|
||||
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
||||
"\tRewriteEngine on" . PHP_EOL .
|
||||
|
@ -554,7 +565,7 @@ class config extends common
|
|||
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
||||
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
||||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
'# URL rewriting';
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
file_put_contents(
|
||||
'.htaccess',
|
||||
|
@ -607,7 +618,7 @@ class config extends common
|
|||
|
||||
// Variable de version
|
||||
if (helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)) {
|
||||
self::$updateButtonText = helper::translate('Mettre à jour');
|
||||
self::$updateButtonText = helper::translate('Mise à jour');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<Files "data.key">
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
</Files>
|
|
@ -0,0 +1,68 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Ce script PHP est conçu pour être appelé via une requête HTTP GET avec une clé spécifique pour déclencher la création d'une archive ZIP de sauvegarde.
|
||||
|
||||
Exemple d'appel dans une URL :
|
||||
http://example.com/chemin/vers/autobackup.php?key=your_secret_key&filter=site
|
||||
|
||||
La clé doit être fournie en tant que paramètre "key" dans l'URL et correspondre à celle stockée dans le fichier "data.key" pour que la création de l'archive soit autorisée. Si la clé est valide, le script parcourt le répertoire spécifié en fonction du paramètre "filter" et ajoute les fichiers à l'archive ZIP. Si la clé est invalide ou absente, le script renvoie une réponse avec le code d'erreur 401 Unauthorized.
|
||||
|
||||
Le paramètre "filter" en GET permet de spécifier le filtre à appliquer lors de la création de l'archive. Sa valeur peut être "file" ou "data". Si le paramètre n'est pas spécifié, le filtre est vide par défaut, ce qui signifie que tous les fichiers seront inclus dans l'archive.
|
||||
|
||||
*/
|
||||
|
||||
// Vérification de la clé
|
||||
if (isset($_GET['key'])) {
|
||||
$key = $_GET['key'];
|
||||
$storedKey = file_get_contents('data.key');
|
||||
if ($key !== $storedKey) {
|
||||
http_response_code(401); // Clé invalide, renvoie une réponse avec le code d'erreur 401 Unauthorized
|
||||
echo 'Clé incorrecte';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Définition du filtre par défaut
|
||||
$filter = ['backup', 'tmp', 'i18n'];
|
||||
|
||||
// Tableau de correspondance entre les valeurs de "filter" et les répertoires à inclure
|
||||
$filterDirectories = [
|
||||
'file' => ['backup', 'tmp', 'file'],
|
||||
'data' => ['backup', 'tmp', 'data'],
|
||||
];
|
||||
|
||||
// Vérification et traitement du paramètre "filter" en GET
|
||||
if (isset($_GET['filter']) && isset($filterDirectories[$_GET['filter']])) {
|
||||
$filter = $filterDirectories[$_GET['filter']];
|
||||
}
|
||||
|
||||
// Création du ZIP
|
||||
$fileName = date('Y-m-d-H-i-s', time()) . '-rolling-backup.zip';
|
||||
$zip = new ZipArchive();
|
||||
$zip->open('../../../../site/backup/' . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
$directory = '../../../../site';
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveCallbackFilterIterator(
|
||||
new RecursiveDirectoryIterator(
|
||||
$directory,
|
||||
RecursiveDirectoryIterator::SKIP_DOTS
|
||||
),
|
||||
function ($fileInfo, $key, $iterator) use ($filter) {
|
||||
return $fileInfo->isFile() || !in_array($fileInfo->getBaseName(), $filter);
|
||||
}
|
||||
)
|
||||
);
|
||||
foreach ($files as $name => $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen(realpath($directory)) + 1);
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
http_response_code(201); // Création de l'archive réussie, renvoie une réponse avec le code 201 Created
|
||||
echo 'Sauvegarde terminée';
|
||||
exit;
|
||||
}
|
||||
?>
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
Ce script PHP est conçu pour supprimer les fichiers ayant l'extension 'tar.gz' dans un répertoire de sauvegarde si leur dernière modification remonte à un certain nombre de jours spécifié via une requête HTTP GET.
|
||||
|
||||
Exemple d'appel dans une URL avec le nombre de jours spécifié :
|
||||
http://example.com/chemin/vers/script.php?days=7&key=your_secret_key
|
||||
|
||||
Le script vérifie également la présence et la validité d'une clé spécifique pour déclencher son exécution. La clé doit être fournie en tant que paramètre "key" dans l'URL et correspondre à celle stockée dans le fichier "data.key" pour que la suppression des fichiers soit autorisée. Si la clé est invalide ou absente, le script affiche un message d'erreur et termine son exécution.
|
||||
|
||||
*/
|
||||
|
||||
// Vérification de la clé
|
||||
if (isset ($_GET['key'])) {
|
||||
// Récupération de la clé fournie en GET
|
||||
$key = $_GET['key'];
|
||||
|
||||
// Récupération de la clé stockée dans le fichier data.key
|
||||
$storedKey = file_get_contents('data.key');
|
||||
|
||||
// Vérification de correspondance entre les clés
|
||||
if ($key !== $storedKey) {
|
||||
http_response_code(401);
|
||||
echo 'Clé incorrecte';
|
||||
exit;
|
||||
}
|
||||
|
||||
// Récupère le nombre de jours à partir de la variable GET 'days'
|
||||
$days = isset ($_GET['days']) ? (int) $_GET['days'] : 1; // Par défaut à 1 si non spécifié
|
||||
|
||||
// Chemin vers le répertoire contenant les fichiers
|
||||
$directory = '../../../../site/backup/'; // Remplacez par le chemin réel
|
||||
|
||||
// Convertit le nombre de jours en secondes
|
||||
$timeLimit = strtotime("-$days days");
|
||||
|
||||
// Crée un nouvel objet DirectoryIterator
|
||||
foreach (new DirectoryIterator($directory) as $file) {
|
||||
// Vérifie si l'élément courant est un fichier et a l'extension 'tar.gz'
|
||||
if ($file->isFile() && $file->getExtension() === 'tar.gz') {
|
||||
// Vérifie si le fichier a été modifié avant la limite de temps
|
||||
if ($file->getMTime() < $timeLimit) {
|
||||
// Supprime le fichier
|
||||
unlink($file->getRealPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Si la clé est manquante, affiche un message d'erreur et arrête l'exécution du script
|
||||
http_response_code(201);
|
||||
echo 'Sauvegarde terminée';
|
||||
exit;
|
||||
}
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
$(document).ready((function(){$("#configBackupForm").submit((function(e){e.preventDefault();var url="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup",message_success="<?php echo helper::translate('Sauvegarde générée avec succès.'); ?>",message_error="<?php echo helper::translate('Erreur : sauvegarde non générée !'); ?>",message_title="<?php echo helper::translate('Sauvegarder'); ?>";$.ajax({type:"POST",url:url,data:$("form").serialize(),success:function(data){$("body, .button").css("cursor","default"),core.alert(message_success)},error:function(data){$("body, .button").css("cursor","default"),core.alert(message_error)},complete:function(){$("#configBackupSubmit").removeClass("disabled").prop("disabled",!1),$("#configBackupSubmit").removeClass("uniqueSubmission").prop("uniqueSubmission",!1),$("#configBackupSubmit span").removeClass("zwiico-spin animate-spin"),$("#configBackupSubmit span").addClass("zwiico-check zwiico-margin-right").text(message_title)}})})),$("#configBackupSubmit").on("click",(function(){if($("input[name=configBackupOption]").is(":checked")){var message_warning="<?php echo helper::translate('La sauvegarde des fichiers peut prendre du temps. Continuer ?'); ?>";return core.confirm(message_warning,(function(){$("body, .button").css("cursor","wait"),$("form#configBackupForm").submit()}))}}))}));
|
||||
$(document).ready((function(){$("#configBackupForm").submit((function(e){e.preventDefault();var url="<?php echo helper::baseUrl() . $this->getUrl(0); ?>/backup",message_success="<?php echo helper::translate('Sauvegarde générée avec succès'); ?>",message_error="<?php echo helper::translate('Erreur : sauvegarde non générée !'); ?>",message_title="<?php echo helper::translate('Sauvegarder'); ?>";$.ajax({type:"POST",url:url,data:$("form").serialize(),success:function(data){$("body, .button").css("cursor","default"),core.alert(message_success)},error:function(data){$("body, .button").css("cursor","default"),core.alert(message_error)},complete:function(){$("#configBackupSubmit").removeClass("disabled").prop("disabled",!1),$("#configBackupSubmit").removeClass("uniqueSubmission").prop("uniqueSubmission",!1),$("#configBackupSubmit span").removeClass("zwiico-spin animate-spin"),$("#configBackupSubmit span").addClass("zwiico-check zwiico-margin-right").text(message_title)}})})),$("#configBackupSubmit").on("click",(function(){if($("input[name=configBackupOption]").is(":checked")){var message_warning="<?php echo helper::translate('La sauvegarde des fichiers peut prendre du temps. Continuer ?'); ?>";return core.confirm(message_warning,(function(){$("body, .button").css("cursor","wait"),$("form#configBackupForm").submit()}))}}))}));
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('configManageSubmit', [
|
||||
'value' => 'Valider',
|
||||
'ico' => 'check'
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<?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"], 'nginx')
|
||||
'disabled' => !in_array('mod_rewrite',apache_get_modules())
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col10 textAlignCenter">
|
||||
<?php if( $module::$imageOpenGraph['type']): ?>
|
||||
<?php if( !empty($module::$imageOpenGraph['type']) ): ?>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('courseEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course',
|
||||
'href' => helper::baseUrl() . 'course/manage/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -27,7 +27,7 @@
|
|||
<div class="col5">
|
||||
<?php echo template::select('courseEditAuthor', $module::$courseTeachers, [
|
||||
'label' => 'Auteur',
|
||||
'value' => $this->getdata(['course', $this->getUrl(2), 'author'])
|
||||
'selected' => $this->getdata(['course', $this->getUrl(2), 'author'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -106,4 +106,5 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -6,28 +6,24 @@
|
|||
* @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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
*/
|
||||
$(".courseDelete").on("click", function () {
|
||||
var _this = $(this);
|
||||
var message = "<?php echo helper::translate('Supprimer cet espace et les documents du gestionnaire de fichier ?'); ?>";
|
||||
return core.confirm(message, function () {
|
||||
$(location).attr("href", _this.attr("href"));
|
||||
});
|
||||
});
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 2,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
target: 3,
|
||||
orderable: false,
|
||||
|
@ -37,16 +33,6 @@ $(document).ready(function () {
|
|||
target: 4,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
target: 5,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
target: 6,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
|
@ -6,26 +6,38 @@
|
|||
'value' => template::ico('home')
|
||||
]); ?>
|
||||
</div>
|
||||
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||
<div class="col1 offset9">
|
||||
<?php echo template::button('courseCategory', [
|
||||
'href' => helper::baseUrl() . 'course/category',
|
||||
'value' => template::ico('table'),
|
||||
'help' => 'Catégories'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 ">
|
||||
<?php echo template::button('courseAdd', [
|
||||
'class' => 'buttonGreen',
|
||||
'href' => helper::baseUrl() . 'course/add',
|
||||
'value' => template::ico('plus'),
|
||||
'help' => 'Ajouter un espace'
|
||||
]); ?>
|
||||
<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',
|
||||
'value' => template::ico('table'),
|
||||
'help' => 'Catégories des espaces'
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php if ($this->getUser('permission', 'course', 'restore') === true): ?>
|
||||
<?php echo template::button('courseUpload', [
|
||||
'href' => helper::baseUrl() . 'course/restore/',
|
||||
'value' => template::ico('upload-cloud'),
|
||||
'help' => 'Restaurer un espace'
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if($module::$courses): ?>
|
||||
<?php echo template::table([2, 2, 2, 3, 1, 1, 1], $module::$courses, ['Titre court', 'Auteur', 'Description', 'Lien direct', '', '', ''], ['id' => 'dataTables']); ?>
|
||||
<?php if ($module::$courses): ?>
|
||||
<?php echo template::table([4, 3, 3, 1, 1], $module::$courses, ['Titre court', 'Description', 'Inscription', '', '',], ['id' => 'dataTables']); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun espace'); ?>
|
||||
<?php endif; ?>
|
||||
<?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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
|
@ -0,0 +1,34 @@
|
|||
/**
|
||||
* 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-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
*/
|
||||
$(".courseDelete").on("click", function () {
|
||||
var _this = $(this);
|
||||
var message = "<?php echo helper::translate('Supprimer cet espace et les documents du gestionnaire de fichier ?'); ?>";
|
||||
return core.confirm(message, function () {
|
||||
$(location).attr("href", _this.attr("href"));
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
*/
|
||||
$(".courseReset").on("click", function () {
|
||||
var _this = $(this);
|
||||
var message = "<?php echo helper::translate('Réinitialiser cet espace ?'); ?>";
|
||||
return core.confirm(message, function () {
|
||||
$(location).attr("href", _this.attr("href"));
|
||||
});
|
||||
});
|
|
@ -0,0 +1,167 @@
|
|||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseManageBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<?php if ($this->getUser('permission', 'course', 'delete') === true): ?>
|
||||
<div class="col2 ">
|
||||
<?php echo template::button('courseManageDelete' . $this->getUrl(2), [
|
||||
'class' => 'courseDelete buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/delete/' . $this->getUrl(2),
|
||||
'value' => 'Supprimer',
|
||||
'ico' => 'trash'
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getUser('permission', 'course', 'reset') === true): ?>
|
||||
<div class="col2 ">
|
||||
<?php echo template::button('courseManageReset' . $this->getUrl(2), [
|
||||
'class' => 'courseReset buttonRed',
|
||||
'href' => helper::baseUrl() . 'course/reset/' . $this->getUrl(2),
|
||||
'value' => 'Réinitaliser',
|
||||
'ico' => 'cancel'
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getUser('permission', 'course', 'backup') === true): ?>
|
||||
<div class="col2">
|
||||
<?php echo template::button('courseManageDownload' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/backup/' . $this->getUrl(2),
|
||||
'value' => 'Sauvegarder',
|
||||
'ico' => 'download-cloud'
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getUser('permission', 'course', 'clone') === true): ?>
|
||||
<div class="col2">
|
||||
<?php echo template::button('courseManageDuplicate' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/clone/' . $this->getUrl(2),
|
||||
'value' => 'Cloner',
|
||||
'ico' => 'clone'
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getUser('permission', 'course', 'edit') === true): ?>
|
||||
<div class="col2">
|
||||
<?php echo template::button('courseManageEdit' . $this->getUrl(2), [
|
||||
'href' => helper::baseUrl() . 'course/edit/' . $this->getUrl(2),
|
||||
'value' => 'Éditer',
|
||||
'ico' => 'pencil'
|
||||
]); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Paramètres'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col7">
|
||||
<?php echo template::text('courseManageShortTitle', [
|
||||
'label' => 'Titre',
|
||||
'value' => $this->getdata(['course', $this->getUrl(2), 'title']),
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::text('courseManageAuthor', [
|
||||
'label' => 'Auteur',
|
||||
'value' => $this->signature($this->getdata(['course', $this->getUrl(2), 'author'])),
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::text('courseManageHomePageId', [
|
||||
'label' => 'Page d\'accueil',
|
||||
'value' => $module::$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'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::textarea('courseManageDescription', [
|
||||
'label' => 'Description',
|
||||
'value' => $this->getdata(['course', $this->getUrl(2), 'description']),
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageAccess', [
|
||||
'label' => 'Disponibilité',
|
||||
'value' => $module::$courseAccess[$this->getdata(['course', $this->getUrl(2), 'access'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::date('courseOpeningDate', [
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Ouverture',
|
||||
'value' => is_null($this->getdata(['course', $this->getUrl(2), 'openingDate'])) ? '' : floor($this->getdata(['course', $this->getUrl(2), 'openingDate']) / 60) * 60,
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::date('courseClosingDate', [
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Fermeture',
|
||||
'value' => is_null($this->getdata(['course', $this->getUrl(2), 'closingDate'])) ? '' : floor($this->getdata(['course', $this->getUrl(2), 'closingDate']) / 60) * 60,
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageEnrolment', [
|
||||
'label' => 'Participation',
|
||||
'value' => $module::$courseEnrolment[$this->getdata(['course', $this->getUrl(2), 'enrolment'])],
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::text('courseManageEnrolmentKey', [
|
||||
'label' => 'Clé',
|
||||
'value' => $this->getdata(['course', $this->getUrl(2), 'enrolmentKey']),
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::checkbox('courseManageEnrolmentLimit', true, 'Date de fin d\'inscription', [
|
||||
'checked' => $this->getdata(['course', $this->getUrl(2), 'limitEnrolment']),
|
||||
'help' => 'Ne s\'applique pas à l\'inscription anonyme',
|
||||
'disabled' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::date('courseManageEnrolmentLimitDate', [
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Fermeture',
|
||||
'value' => is_null($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate'])) ? '' : floor($this->getdata(['course', $this->getUrl(2), 'limitEnrolmentDate']) / 60) * 60,
|
||||
'readonly' => true,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,25 +1,20 @@
|
|||
/**
|
||||
* 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready((function () {
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
},
|
||||
locale: 'fr',
|
||||
searching: false,
|
||||
pageLength: 100,
|
||||
lengthChange: false,
|
||||
paging: false
|
||||
});
|
||||
}));
|
||||
|
||||
/** @import url("site/data/admin.css"); */
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
|
@ -0,0 +1,33 @@
|
|||
<?php echo template::formOpen('courseRestoreForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseRestoreBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('courseRestoreSubmit', [
|
||||
'value' => 'Valider'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo sprintf('%s : %s', helper::translate('Restaurer depuis le dossier de l\'espace id'), self::$siteContent ); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col10 offset1">
|
||||
<?php echo template::file('courseRestoreFile', [
|
||||
'language' => $this->getData(['course', $this->getUser('id'), 'language']),
|
||||
//'label' => 'Fichier de sauvegarde :'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* This file is part of Zwii.
|
||||
*
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
table td {
|
||||
text-align: left;
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* 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-2024, 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 data = [{
|
||||
x: dataX,
|
||||
y: dataY,
|
||||
text: dataText,
|
||||
mode: 'markers', // Mode de tracé des points
|
||||
type: 'scatter' // Type de graphe
|
||||
}];
|
||||
|
||||
// Créer un objet layout et définir les propriétés du titre, des axes, etc.
|
||||
var layout = {
|
||||
title: 'Consultations par jour', // Titre du graphe
|
||||
xaxis: {
|
||||
title: 'Jours', // Titre de l'axe des abscisses
|
||||
type: 'date' // Type de l'axe des abscisses
|
||||
},
|
||||
yaxis: {
|
||||
title: 'Temps (en secondes)', // Titre de l'axe des ordonnées
|
||||
type: 'linear' // Type de l'axe des ordonnées
|
||||
}
|
||||
};
|
||||
|
||||
// Créer et afficher le graphe dans l'élément <div>
|
||||
Plotly.newPlot('graph', data, layout, {locale: 'fr-CH'});
|
||||
|
||||
}));
|
|
@ -14,25 +14,39 @@
|
|||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userHistory): ?>
|
||||
<div class="row">
|
||||
<div class="col10 offset1">
|
||||
<div id="graph">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($module::$userReport): ?>
|
||||
<div class="row">
|
||||
<div class="col4 offset2">
|
||||
<?php if ($this->getData(['course', $this->getUrl(2), 'access']) === self::COURSE_ACCESS_DATE): ?>
|
||||
<p>Espace ouvert le :
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate'])); ?></p
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'openingDate'])); ?>
|
||||
</p>
|
||||
<p>Espace fermé le :
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate'])); ?></p>
|
||||
<?php endif;?>
|
||||
<?php echo helper::dateUTF8('%d %B %Y %H:%M', $this->getData(['course', $this->getUrl(2), 'closingDate'])); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<p>Commencé le : <?php echo $module::$userStat['floor'];?></p>
|
||||
<p>Terminé le : <?php echo $module::$userStat['top'];?></p>
|
||||
<p>Temps passé : <?php echo $module::$userStat['time'];?></p>
|
||||
<p>Commencé le :
|
||||
<?php echo $module::$userStat['floor']; ?>
|
||||
</p>
|
||||
<p>Terminé le :
|
||||
<?php echo $module::$userStat['top']; ?>
|
||||
</p>
|
||||
<p>Temps passé :
|
||||
<?php echo $module::$userStat['time']; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col8">
|
||||
<?php echo template::table([1, 6, 5], $module::$userHistory, ['Ordre', 'Page', 'Consultation'], ['id' => 'dataTables']);?>
|
||||
<?php echo template::table([6, 3, 3], $module::$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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -21,12 +21,14 @@ $(document).ready((function () {
|
|||
$(location).attr("href", _this.attr("href"))
|
||||
}))
|
||||
}));
|
||||
|
||||
$.fn.dataTable.moment( 'DD/MM/YYYY' );
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json"
|
||||
},
|
||||
order: [[3, 'desc']],
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 6,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('courseUserBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'course',
|
||||
'href' => helper::baseUrl() . 'course/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -53,7 +53,7 @@
|
|||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php if ($module::$courseUsers): ?>
|
||||
<?php echo template::table([2, 2, 2, 2, 2, 1, 1], $module::$courseUsers, ['Id', 'Nom Prénom', 'Dernière page vue', 'Date - Heure', 'Étiquettes', 'Progression', ''], ['id' => 'dataTables']); ?>
|
||||
<?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 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -15,4 +15,8 @@
|
|||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
*/
|
||||
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
|
@ -6,13 +6,20 @@
|
|||
* @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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('tr').click(function(){
|
||||
// Cochez ou décochez la case à cocher dans cette ligne
|
||||
$(this).find('input[type="checkbox"]').prop('checked', function(i, val){
|
||||
return !val; // Inverse l'état actuel de la case à cocher
|
||||
});
|
||||
});
|
||||
|
||||
$('#courseUserAddSelectAll').on('click', function() {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
|
@ -32,6 +39,7 @@ $(document).ready((function () {
|
|||
url: "core/vendor/datatables/french.json"
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 0,
|
||||
|
|
|
@ -7,19 +7,22 @@
|
|||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<div class="col1 offset8">
|
||||
<?php echo template::button('courseUserAddSelectAll', [
|
||||
'value' => 'Tout'
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserAddSelectNone', [
|
||||
'value' => 'Aucun'
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<div class="col1">
|
||||
<?php echo template::submit('courseUsersAddSubmit', [
|
||||
'value' => 'Inscrire'
|
||||
'value' => '',
|
||||
'ico' => 'plus',
|
||||
]); ?>
|
||||
</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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -15,4 +15,12 @@
|
|||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
*/
|
||||
|
||||
#courseUsersDeleteSubmit {
|
||||
background-color: rgba(217, 95, 78, 1);
|
||||
}
|
||||
|
||||
tr {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
@ -6,18 +6,25 @@
|
|||
* @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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready((function () {
|
||||
|
||||
$('#courseUserDeleteSelectAll').on('click', function() {
|
||||
$('tr').click(function () {
|
||||
// Cochez ou décochez la case à cocher dans cette ligne
|
||||
$(this).find('input[type="checkbox"]').prop('checked', function (i, val) {
|
||||
return !val; // Inverse l'état actuel de la case à cocher
|
||||
});
|
||||
});
|
||||
|
||||
$('#courseUserDeleteSelectAll').on('click', function () {
|
||||
$('.checkboxSelect').prop('checked', true);
|
||||
saveCheckboxState();
|
||||
});
|
||||
$('#courseUserDeleteSelectNone').on('click', function() {
|
||||
$('#courseUserDeleteSelectNone').on('click', function () {
|
||||
$('.checkboxSelect').prop('checked', false);
|
||||
saveCheckboxState();
|
||||
});
|
||||
|
@ -80,7 +87,7 @@ $(document).ready((function () {
|
|||
// Function to restore checkbox state
|
||||
function restoreCheckboxState() {
|
||||
var checkboxState = JSON.parse(localStorage.getItem('checkboxState')) || {};
|
||||
// console.log(checkboxState);
|
||||
// console.log(checkboxState);
|
||||
for (var checkboxId in checkboxState) {
|
||||
if (checkboxState.hasOwnProperty(checkboxId)) {
|
||||
var checked = checkboxState[checkboxId];
|
||||
|
|
|
@ -7,20 +7,23 @@
|
|||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<div class="col1 offset8">
|
||||
<?php echo template::button('courseUserDeleteSelectAll', [
|
||||
'value' => 'Tout'
|
||||
'value' => template::ico('square-check'),
|
||||
'help' => 'Tout sélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('courseUserDeleteSelectNone', [
|
||||
'value' => 'Aucun'
|
||||
'value' => template::ico('square-check-empty'),
|
||||
'help' => 'Tout désélectionner'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<div class="col1">
|
||||
<?php echo template::submit('courseUsersDeleteSubmit', [
|
||||
'class' => 'buttonRed',
|
||||
'value' => 'Désinscrire'
|
||||
'ico' => '',
|
||||
'value' => template::ico('minus'),
|
||||
]); ?>
|
||||
</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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -194,6 +194,11 @@ class install extends common
|
|||
mkdir(self::I18N_DIR);
|
||||
}
|
||||
|
||||
// Créer le dossier de l'accueil dans les fichiers
|
||||
if (is_dir(self::FILE_DIR . 'source/home') === false) {
|
||||
mkdir(self::FILE_DIR . 'source/home');
|
||||
}
|
||||
|
||||
// Créer la base de données des langues
|
||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||
|
||||
|
@ -248,14 +253,18 @@ class install extends common
|
|||
$message = $success ? '' : 'Erreur de copie du fichier htaccess';
|
||||
}
|
||||
// Nettoyage des fichiers d'installation précédents
|
||||
if (file_exists(self::TEMP_DIR . 'update.tar.gz') && $success) {
|
||||
if ($success && file_exists(self::TEMP_DIR . 'update.tar.gz')) {
|
||||
$success = unlink(self::TEMP_DIR . 'update.tar.gz');
|
||||
$message = $success ? '' : 'Impossible d\'effacer la mise à jour précédente';
|
||||
}
|
||||
if (file_exists(self::TEMP_DIR . 'update.tar') && $success) {
|
||||
if ($success && file_exists(self::TEMP_DIR . 'update.tar')) {
|
||||
$success = unlink(self::TEMP_DIR . 'update.tar');
|
||||
$message = $success ? '' : 'Impossible d\'effacer la mise à jour précédente';
|
||||
}
|
||||
// Sauvegarde le message dans le journal
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
|
@ -267,6 +276,8 @@ class install extends common
|
|||
break;
|
||||
// Téléchargement
|
||||
case 2:
|
||||
$success = true;
|
||||
$message = '';
|
||||
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
||||
$md5origin = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.md5');
|
||||
$md5origin = explode(' ', $md5origin);
|
||||
|
@ -277,27 +288,35 @@ class install extends common
|
|||
$message = "";
|
||||
} else {
|
||||
$success = false;
|
||||
$message = json_encode('Erreur de téléchargement ou de somme de contrôle', JSON_UNESCAPED_UNICODE);
|
||||
$message = 'Erreur de téléchargement ou de somme de contrôle';
|
||||
if (file_exists(self::TEMP_DIR . 'update.tar.gz')) {
|
||||
unlink(self::TEMP_DIR . 'update.tar.gz');
|
||||
http_response_code(500);
|
||||
}
|
||||
}
|
||||
|
||||
// Sauvegarde le message dans le journal
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $message
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
break;
|
||||
// Installation
|
||||
case 3:
|
||||
$success = true;
|
||||
$message = '';
|
||||
|
||||
// Check la réécriture d'URL avant d'écraser les fichiers
|
||||
$rewrite = helper::checkRewrite();
|
||||
if (helper::checkRewrite()) {
|
||||
touch(self::DATA_DIR . '.rewrite');
|
||||
}
|
||||
|
||||
// Décompression et installation
|
||||
try {
|
||||
// Décompression dans le dossier de fichier temporaires
|
||||
|
@ -306,9 +325,11 @@ class install extends common
|
|||
// Installation
|
||||
$pharData->extractTo(__DIR__ . '/../../../', null, true);
|
||||
} catch (Exception $e) {
|
||||
$message = $e->getMessage();
|
||||
$success = false;
|
||||
http_response_code(500);
|
||||
}
|
||||
|
||||
// Nettoyage du dossier
|
||||
if (file_exists(self::TEMP_DIR . 'update.tar.gz')) {
|
||||
unlink(self::TEMP_DIR . 'update.tar.gz');
|
||||
|
@ -316,12 +337,16 @@ class install extends common
|
|||
if (file_exists(self::TEMP_DIR . 'update.tar')) {
|
||||
unlink(self::TEMP_DIR . 'update.tar');
|
||||
}
|
||||
// Sauvegarde le message dans le journal
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $rewrite
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
break;
|
||||
|
@ -329,7 +354,6 @@ class install extends common
|
|||
case 4:
|
||||
$success = true;
|
||||
$message = '';
|
||||
$rewrite = $this->getInput('data');
|
||||
|
||||
/**
|
||||
* Restaure le fichier htaccess
|
||||
|
@ -350,7 +374,7 @@ class install extends common
|
|||
/**
|
||||
* Restaure la réécriture d'URL
|
||||
*/
|
||||
if ($rewrite === 'true') { // Ajout des lignes dans le .htaccess
|
||||
if (file_exists(self::DATA_DIR . '.rewrite')) { // Ajout des lignes dans le .htaccess
|
||||
$fileContent = file_get_contents('.htaccess');
|
||||
$rewriteData = PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL .
|
||||
|
@ -363,10 +387,11 @@ class install extends common
|
|||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
$success = file_put_contents(
|
||||
$success = $this->secure_file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
unlink(self::DATA_DIR . '.rewrite');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -378,7 +403,6 @@ class install extends common
|
|||
$defaultLanguages = init::$defaultData['language'];
|
||||
foreach ($installedLanguages as $key => $value) {
|
||||
|
||||
//var_dump( $defaultLanguages[$key]['date'] > $value['date'] );
|
||||
if (
|
||||
isset($defaultLanguages[$key]['date']) &&
|
||||
$defaultLanguages[$key]['date'] > $value['date'] &&
|
||||
|
@ -390,7 +414,10 @@ class install extends common
|
|||
$this->setData(['language', $key, $defaultLanguages[$key]]);
|
||||
}
|
||||
}
|
||||
|
||||
// Sauvegarde le message dans le journal
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
|
@ -419,10 +446,13 @@ class install extends common
|
|||
} else {
|
||||
// Nouvelle version
|
||||
self::$newVersion = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');
|
||||
|
||||
// Variable de version
|
||||
if (helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)) {
|
||||
self::$updateButtonText = helper::translate('Mettre à jour');
|
||||
self::$updateButtonText = helper::translate('Mise à jour');
|
||||
}
|
||||
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_LAYOUT_LIGHT,
|
||||
|
|
|
@ -64,7 +64,7 @@ class init extends common
|
|||
]
|
||||
],
|
||||
'core' => [
|
||||
'dataVersion' => 1000,
|
||||
'dataVersion' => 1700,
|
||||
'lastBackup' => 0,
|
||||
'lastClearTmp' => 0,
|
||||
'lastAutoUpdate' => 0,
|
||||
|
@ -240,6 +240,21 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false
|
||||
],
|
||||
'course' => [
|
||||
'tutor' => false,
|
||||
'index' => false,
|
||||
'manage' => false,
|
||||
'users' => false,
|
||||
'userHistory' => false,
|
||||
'userHistoryExport' => false,
|
||||
'usersAdd' => false,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
'edit' => false,
|
||||
'backup' => false,
|
||||
'restore' => false,
|
||||
'reset' => false,
|
||||
],
|
||||
'folder' => [
|
||||
'create' => false,
|
||||
'delete' => false,
|
||||
|
@ -247,7 +262,8 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false,
|
||||
'share' => false,
|
||||
'path' => null,
|
||||
'coursePath' => 'none',
|
||||
'homePath' => 'none'
|
||||
],
|
||||
'page' => [
|
||||
'add' => false,
|
||||
|
@ -321,6 +337,21 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false
|
||||
],
|
||||
'course' => [
|
||||
'tutor' => false,
|
||||
'index' => false,
|
||||
'manage' => false,
|
||||
'users' => false,
|
||||
'userHistory' => false,
|
||||
'userHistoryExport' => false,
|
||||
'usersAdd' => false,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
'edit' => false,
|
||||
'backup' => false,
|
||||
'restore' => false,
|
||||
'reset' => false,
|
||||
],
|
||||
'folder' => [
|
||||
'create' => false,
|
||||
'delete' => false,
|
||||
|
@ -328,7 +359,8 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false,
|
||||
'share' => true,
|
||||
'path' => './site/file/source/partage/',
|
||||
'coursePath' => 'none',
|
||||
'homePath' => '/site/file/source/partage/'
|
||||
],
|
||||
'page' => [
|
||||
'add' => false,
|
||||
|
@ -407,6 +439,21 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false
|
||||
],
|
||||
'course' => [
|
||||
'tutor' => true,
|
||||
'index' => true,
|
||||
'manage' => true,
|
||||
'users' => true,
|
||||
'userHistory' => true,
|
||||
'userHistoryExport' => true,
|
||||
'usersAdd' => true,
|
||||
'userDelete' => false,
|
||||
'usersDelete' => false,
|
||||
'edit' => false,
|
||||
'backup' => false,
|
||||
'restore' => false,
|
||||
'reset' => false,
|
||||
],
|
||||
'folder' => [
|
||||
'create' => false,
|
||||
'delete' => false,
|
||||
|
@ -414,7 +461,8 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false,
|
||||
'share' => true,
|
||||
'path' => '',
|
||||
'coursePath' => '',
|
||||
'homePath' => '/site/file/source/partage/'
|
||||
],
|
||||
'page' => [
|
||||
'add' => false,
|
||||
|
@ -489,6 +537,21 @@ class init extends common
|
|||
'copycut' => true,
|
||||
'chmod' => true
|
||||
],
|
||||
'course' => [
|
||||
'tutor' => false,
|
||||
'index' => true,
|
||||
'manage' => true,
|
||||
'users' => true,
|
||||
'userHistory' => true,
|
||||
'userHistoryExport' => true,
|
||||
'usersAdd' => true,
|
||||
'userDelete' => true,
|
||||
'usersDelete' => true,
|
||||
'edit' => true,
|
||||
'backup' => true,
|
||||
'restore' => true,
|
||||
'reset' => true,
|
||||
],
|
||||
'folder' => [
|
||||
'create' => true,
|
||||
'delete' => true,
|
||||
|
@ -496,7 +559,8 @@ class init extends common
|
|||
'copycut' => true,
|
||||
'chmod' => true,
|
||||
'share' => true,
|
||||
'path' => '',
|
||||
'coursePath' => '',
|
||||
'homePath' => '/site/file/source/partage/'
|
||||
],
|
||||
'page' => [
|
||||
'add' => true,
|
||||
|
@ -835,7 +899,8 @@ class init extends common
|
|||
'activeColor' => 'rgba(255, 255, 255, 1)',
|
||||
'activeTextColor' => 'rgba(255, 255, 255, 1)',
|
||||
'radius' => '0px',
|
||||
'memberBar' => false,
|
||||
'memberBar' => true,
|
||||
'selectSpace' => true,
|
||||
'burgerLogo' => '',
|
||||
'burgerContent' => 'title',
|
||||
'width' => 'container'
|
||||
|
|
Binary file not shown.
|
@ -547,7 +547,7 @@
|
|||
"Sauvegarde": "Backup",
|
||||
"Sauvegarde automatique quotidienne du site": "Daily automatic backup of the site",
|
||||
"Sauvegarde du thème dans le": "Backup of the theme in the",
|
||||
"Sauvegarde générée avec succès.": "Successfully generated backup.",
|
||||
"Sauvegarde générée avec succès": "Successfully generated backup.",
|
||||
"Sauvegarder": "Backup",
|
||||
"Sauvegarder et télécharger le module": "Save and download the module",
|
||||
"Sauvegarder le module dans le gestionnaire de fichiers": "Save the module in the file manager",
|
||||
|
|
|
@ -547,7 +547,7 @@
|
|||
"Sauvegarde": "Salvaguardad",
|
||||
"Sauvegarde automatique quotidienne du site": "Copia de seguridad diaria automática del sitio",
|
||||
"Sauvegarde du thème dans le": "Guardando tema en el",
|
||||
"Sauvegarde générée avec succès.": "Copia de seguridad generada con éxito",
|
||||
"Sauvegarde générée avec succès": "Copia de seguridad generada con éxito",
|
||||
"Sauvegarder": "Para salvaguardar",
|
||||
"Sauvegarder et télécharger le module": "Guardar y descargar módulo",
|
||||
"Sauvegarder le module dans le gestionnaire de fichiers": "Guardar módulo en el administrador de archivos",
|
||||
|
|
|
@ -547,7 +547,7 @@
|
|||
"Sauvegarde": "",
|
||||
"Sauvegarde automatique quotidienne du site": "",
|
||||
"Sauvegarde du thème dans le": "",
|
||||
"Sauvegarde générée avec succès.": "",
|
||||
"Sauvegarde générée avec succès": "",
|
||||
"Sauvegarder": "",
|
||||
"Sauvegarder et télécharger le module": "",
|
||||
"Sauvegarder le module dans le gestionnaire de fichiers": "",
|
||||
|
|
|
@ -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-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
function step(i, data) {
|
||||
var errors = ["<?php echo helper::translate('Préparation de la mise à jour'); ?>", "<?php echo helper::translate('Téléchargement et validation de l\'archive'); ?>", "<?php echo helper::translate('Installation'); ?>", "<?php echo helper::translate('Configuration'); ?>"];
|
||||
$(".installUpdateProgressText").hide(), $(".installUpdateProgressText[data-id=" + i + "]").show();
|
||||
|
||||
|
||||
$("body").css("cursor", "wait");
|
||||
|
||||
$.ajax({
|
||||
|
@ -12,11 +12,6 @@ function step(i, data) {
|
|||
data: data
|
||||
},
|
||||
success: function (result) {
|
||||
// if (result.success != "1") { // Vérification de la propriété "success"
|
||||
// Appel de la fonction de gestion d'erreur
|
||||
// showError(i, result, errors);
|
||||
// return;
|
||||
//}
|
||||
setTimeout((function () {
|
||||
if (4 === i) {
|
||||
$("#installUpdateSuccess").show();
|
||||
|
@ -60,10 +55,13 @@ function showError(step, message, errors) {
|
|||
const jsonData = JSON.parse(jsonString);
|
||||
|
||||
// Afficher les résultats
|
||||
$("#installUpdateErrorMessage").html("<strong>Détails de l'erreur :</strong><br> " +
|
||||
jsonData.data.replace(/^"(.*)"$/, '$1') +
|
||||
"<br>" +
|
||||
warningMessage.replace(/<[^p].*?>/g, ""));
|
||||
if (jsonData) {
|
||||
$("#installUpdateErrorMessage").html("<strong>Détails de l'erreur :</strong><br> " +
|
||||
jsonData.data.replace(/^"(.*)"$/, '$1') +
|
||||
"<br>" +
|
||||
warningMessage.replace(/<[^p].*?>/g, ""));
|
||||
}
|
||||
|
||||
} else {
|
||||
// Vous pouvez également faire quelque chose d'autre ici, par exemple, afficher un message à l'utilisateur, etc.
|
||||
$("#installUpdateErrorMessage").html(message);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<?php echo self::ZWII_VERSION; ?>
|
||||
<?php echo helper::translate('vers'); ?>
|
||||
|
||||
<?php echo $module::$newVersion; ?>.
|
||||
<?php echo $module::$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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -99,7 +99,7 @@ class language extends common
|
|||
is_array($descripteur['language'][$lang])
|
||||
) {
|
||||
if ($this->setData(['language', $lang, $descripteur['language'][$lang]])) {
|
||||
$success = file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($languageData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ class language extends common
|
|||
self::$languagesUiInstalled[$file] = [
|
||||
template::flag($file, '20 %') . ' ' . self::$languages[$file],
|
||||
$value['version'],
|
||||
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$siteContent),
|
||||
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nUI),
|
||||
//self::$i18nUI === $file ? helper::translate('Interface') : '',
|
||||
'',
|
||||
/*
|
||||
|
@ -271,7 +271,7 @@ class language extends common
|
|||
'class' => isset($storeUI[$file]['version']) && version_compare($installedUI[$file]['version'], $storeUI[$file]['version']) < 0 ? 'buttonGreen' : '',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/update/' . $file,
|
||||
'value' => template::ico('update'),
|
||||
'help' => 'Mettre à jour',
|
||||
'help' => 'Mise à jour',
|
||||
]),
|
||||
template::button('translateContentLanguageUIDelete' . $file, [
|
||||
'class' => 'translateDelete buttonRed' . (in_array($file, $usersUI) ? ' disabled' : ''),
|
||||
|
@ -291,7 +291,7 @@ class language extends common
|
|||
self::$languagesStore[$file] = [
|
||||
template::flag($file, '20 %') . ' ' . self::$languages[$file],
|
||||
$value['version'],
|
||||
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$siteContent),
|
||||
helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nUI),
|
||||
'',
|
||||
template::button('translateContentLanguageUIDownload' . $file, [
|
||||
'class' => 'buttonGreen',
|
||||
|
@ -435,7 +435,7 @@ class language extends common
|
|||
|
||||
// La locale est-elle celle de la langue de l'UI ?
|
||||
if ($lang === self::$siteContent) {
|
||||
self::$locales[$lang]['locale'] = $this->getData(['locale']);
|
||||
self::$locales[$lang]['locale'] = $this->getData(['config']);
|
||||
} else {
|
||||
// Lire les locales sans passer par les méthodes
|
||||
self::$locales[$lang] = json_decode(file_get_contents(self::DATA_DIR . $lang . '/locale.json'), 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
@ -68,10 +68,10 @@ class page extends common
|
|||
public static $userProfils = [];
|
||||
|
||||
public static $navIconTemplate = [
|
||||
'dir' => 'Petit triangle',
|
||||
'open' => 'Grand triangle',
|
||||
'big' => 'Flèche',
|
||||
];
|
||||
'dir' => 'Petit triangle',
|
||||
'open' => 'Grand triangle',
|
||||
'big' => 'Flèche',
|
||||
];
|
||||
|
||||
public static $navIconPosition = [
|
||||
'none' => 'Masqué',
|
||||
|
@ -85,12 +85,23 @@ class page extends common
|
|||
*/
|
||||
public function duplicate()
|
||||
{
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id d'espace uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
// Adresse sans le token
|
||||
$page = $this->getUrl(2);
|
||||
|
||||
// La page n'existe pas
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
$this->getData(['page', $page]) === null
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||
|| $this->getData(['page', $page]) === null
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -118,7 +129,7 @@ class page extends common
|
|||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId . '/' . self::$siteContent,
|
||||
'notification' => $notification,
|
||||
'state' => true
|
||||
]);
|
||||
|
@ -131,7 +142,19 @@ class page extends common
|
|||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id d'espace uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'access' => false
|
||||
|
@ -198,12 +221,24 @@ class page extends common
|
|||
*/
|
||||
public function delete()
|
||||
{
|
||||
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id d'espace uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
// $url prend l'adresse sans le token
|
||||
$page = $this->getUrl(2);
|
||||
|
||||
// La page n'existe pas
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
$this->getData(['page', $page]) === null
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||
|| $this->getData(['page', $page]) === null
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -214,8 +249,10 @@ class page extends common
|
|||
elseif ($page === $this->homePageId()) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'redirect' => helper::baseUrl() . $this->homePageId(),
|
||||
'notification' => self::$siteContent === 'home'
|
||||
? helper::translate('Suppression interdite, cette page est définie comme page d\'accueil du site')
|
||||
: helper::translate('Suppression interdite, cette page est définie comme page d\'accueil d\'un espace')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer la page affectée
|
||||
|
@ -223,7 +260,7 @@ class page extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration du site')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer la page affectée
|
||||
|
@ -231,7 +268,7 @@ class page extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration du site')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer la page affectée
|
||||
|
@ -239,7 +276,7 @@ class page extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration du site')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer la page affectée
|
||||
|
@ -247,7 +284,7 @@ class page extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration du site')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer la page affectée
|
||||
|
@ -255,14 +292,14 @@ class page extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'config',
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration de la langue du site')
|
||||
'notification' => helper::translate('Suppression interdite, page active dans la configuration du site')
|
||||
]);
|
||||
}
|
||||
// Impossible de supprimer une page contenant des enfants
|
||||
elseif ($this->getHierarchy($page, null)) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $page,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $page . '/' . self::$siteContent,
|
||||
'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants')
|
||||
]);
|
||||
}
|
||||
|
@ -302,10 +339,24 @@ class page extends common
|
|||
*/
|
||||
public function edit()
|
||||
{
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id d'espace uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
// La page n'existe pas
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
$this->getData(['page', $this->getUrl(2)]) === null
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||
|| $this->getData(['page', $this->getUrl(2)]) === null
|
||||
// Contrôle la présence de l'id d'espace uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
|| (
|
||||
$this->getUrl(3)
|
||||
&& $this->getUrl(3) != self::$siteContent
|
||||
)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -357,6 +408,28 @@ class page extends common
|
|||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId]);
|
||||
}
|
||||
}
|
||||
// Met à jour les historiques des utilisateurs
|
||||
foreach ($this->getData(['enrolment', self::$siteContent]) as $userId => $userData) {
|
||||
// Vérifier si l'utilisateur a un historique
|
||||
if (
|
||||
isset($userData["history"])
|
||||
&& isset($userData['history'][$this->getUrl(2)])
|
||||
) {
|
||||
// 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->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]);
|
||||
}
|
||||
}
|
||||
// Met à jour la homePage si nécessaire
|
||||
if ($this->getUrl(2) === $this->getData(['course', self::$siteContent, 'homePageId'])) {
|
||||
$this->setData(['course', self::$siteContent, 'homePageId', $pageId]);
|
||||
}
|
||||
|
||||
// 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]);
|
||||
|
@ -538,7 +611,7 @@ class page extends common
|
|||
}
|
||||
}
|
||||
// Construction du formulaire
|
||||
|
||||
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
|
||||
|
@ -602,14 +675,15 @@ class page extends common
|
|||
$css = $this->getInput('pageCssEditorContent', helper::FILTER_STRING_LONG) === null ? '' : $this->getInput('pageCssEditorContent', helper::FILTER_STRING_LONG);
|
||||
// Enregistre le CSS
|
||||
$this->setData([
|
||||
'page', $this->getUrl(2),
|
||||
'page',
|
||||
$this->getUrl(2),
|
||||
'css',
|
||||
$css
|
||||
]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
|
@ -636,14 +710,15 @@ class page extends common
|
|||
$js = $this->getInput('pageJsEditorContent', helper::FILTER_STRING_LONG) === null ? '' : $this->getInput('pageJsEditorContent', helper::FILTER_STRING_LONG);
|
||||
// Enregistre le JS
|
||||
$this->setData([
|
||||
'page', $this->getUrl(2),
|
||||
'page',
|
||||
$this->getUrl(2),
|
||||
'js',
|
||||
$js
|
||||
]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
|
@ -659,16 +734,16 @@ class page extends common
|
|||
|
||||
/**
|
||||
* Retourne les informations sur les pages en omettant les clés CSS et JS qui occasionnent des bugs d'affichage dans l'éditeur de page
|
||||
* @return array tableau associatif des pages dans le menu
|
||||
* @return string tableau associatif des pages dans le menu
|
||||
*/
|
||||
public function getPageInfo()
|
||||
{
|
||||
$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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('pageCssEditorBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -19,14 +19,14 @@
|
|||
<div class="col1 offset6">
|
||||
<?php echo template::button('pageEditDelete', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2),
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('trash'),
|
||||
'help' => 'Effacer la page'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('pageEditDuplicate', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2),
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('clone'),
|
||||
'help' => 'Dupliquer la page'
|
||||
]); ?>
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('pageJsEditorBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
* @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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*
|
||||
* THIS MODULE MUST ONLY BE USE WITH ZWIILMS, NOT ZWIICMS
|
||||
* THIS MODULE MUST ONLY BE USE WITH ZwiiCampus, NOT ZWIICMS
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -380,7 +380,7 @@ class plugin extends common
|
|||
$store[$key]['category'],
|
||||
'<a href="' . self::BASEURL_STORE . self::MODULE_STORE . $key . '" target="_blank" >' . $store[$key]['title'] . '</a>',
|
||||
$store[$key]['version'],
|
||||
helper::dateUTF8('%d %B %Y', $store[$key]['versionDate'], self::$siteContent),
|
||||
helper::dateUTF8('%d %B %Y', $store[$key]['versionDate'], self::$i18nUI),
|
||||
implode(' - ', $pageInfos),
|
||||
template::button('moduleExport' . $key, [
|
||||
'class' => $class,
|
||||
|
@ -406,7 +406,7 @@ class plugin extends common
|
|||
{
|
||||
$store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true);
|
||||
self::$storeItem = $store[$this->getUrl(2)];
|
||||
self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate'], self::$siteContent);
|
||||
self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate'], self::$i18nUI);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Module ' . self::$storeItem['title']),
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
* @copyright : Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
*/
|
||||
|
||||
class theme extends common
|
||||
|
@ -594,6 +594,7 @@ class theme extends common
|
|||
'radius' => $this->getInput('themeMenuRadius'),
|
||||
'burgerTitle' => $this->getInput('themeMenuBurgerTitle', helper::FILTER_BOOLEAN),
|
||||
'memberBar' => $this->getInput('themeMenuMemberBar', helper::FILTER_BOOLEAN),
|
||||
'selectSpace' => $this->getInput('themeMenuSelectSpace', helper::FILTER_BOOLEAN),
|
||||
'burgerLogo' => $this->getInput('themeMenuBurgerLogo'),
|
||||
'burgerContent' => $this->getInput('themeMenuBurgerContent')
|
||||
]
|
||||
|
@ -628,16 +629,19 @@ class theme extends common
|
|||
// Toutes les fontes installées sont chargées
|
||||
$this->setFonts('all');
|
||||
|
||||
// Polices liées au thème
|
||||
$used = [
|
||||
'Bannière' => $this->getData(['theme', 'header', 'font']),
|
||||
'Menu' => $this->getData(['theme', 'menu', 'font']),
|
||||
'Titre ' => $this->getData(['theme', 'title', 'font']),
|
||||
'Texte' => $this->getData(['theme', 'text', 'font']),
|
||||
'Pied de page' => $this->getData(['theme', 'footer', 'font']),
|
||||
'Titre (admin)' => $this->getData(['admin', 'fontTitle']),
|
||||
'Admin (texte)' => $this->getData(['admin', 'fontText'])
|
||||
];
|
||||
// Polices liées au thème admin
|
||||
$admin = $this->getData(['admin']);
|
||||
$fonts['Titre (admin)'] = $this->getData(['admin', 'fontTitle']);
|
||||
$fonts['Texte (admin)'] = $this->getData(['admin', 'fontText']);
|
||||
// Polices liées aux thèmes des espaces
|
||||
foreach ($this->getData(['course']) as $courseId => $courseValue) {
|
||||
$theme = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
|
||||
$fonts['Bannière ('. $courseId .')'] = $theme['theme']['header']['font'];
|
||||
$fonts['Menu ('. $courseId .')'] = $theme['theme']['menu']['font'];
|
||||
$fonts['Titre ('. $courseId .')'] = $theme['theme']['title']['font'];
|
||||
$fonts['Texte ('. $courseId .')'] = $theme['theme']['text']['font'];
|
||||
$fonts['Pied de page ('. $courseId .')'] = $theme['theme']['footer']['font'];
|
||||
}
|
||||
|
||||
// Récupérer le détail des fontes installées
|
||||
//$f = $this->getFonts();
|
||||
|
@ -645,28 +649,31 @@ class theme extends common
|
|||
$f['imported'] = $this->getData(['font', 'imported']);
|
||||
$f['websafe'] = self::$fontsWebSafe;
|
||||
|
||||
// Listes des espaces à parcourir pour bloquer la suppression d'une fonte utilisée
|
||||
$courses = array_merge(['admin'], array_keys($this->getData(['course'])));
|
||||
|
||||
|
||||
// Parcourir les fontes disponibles et construire le tableau pour le formulaire
|
||||
foreach ($f as $type => $typeValue) {
|
||||
if (is_array($typeValue)) {
|
||||
foreach ($typeValue as $fontId => $fontValue) {
|
||||
// Fontes utilisées par les thèmes
|
||||
$fontUsed[$fontId] = '';
|
||||
foreach ($used as $key => $value) {
|
||||
if ($value === $fontId) {
|
||||
$fontUsed[$fontId] .= $key . '<br/>';
|
||||
}
|
||||
}
|
||||
// Recherche les correspondances
|
||||
$result = array_filter($fonts, function($value) use ($fontId) {
|
||||
return $value == $fontId;
|
||||
});
|
||||
$keyResults = array_keys($result);
|
||||
// Préparation du tableau
|
||||
self::$fontsDetail[] = [
|
||||
$fontId,
|
||||
'<span style="font-family:' . $f[$type][$fontId]['font-family'] . '">' . $f[$type][$fontId]['name'] . '</span>',
|
||||
$f[$type][$fontId]['font-family'],
|
||||
$fontUsed[$fontId],
|
||||
empty($keyResults) ? '' : '<span class="fontsList">' . implode('<br />', $keyResults) . '</span>',
|
||||
$type,
|
||||
$type !== 'websafe' ? template::button('themeFontEdit' . $fontId, [
|
||||
'class' => 'themeFontEdit',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/fontEdit/' . $type . '/' . $fontId,
|
||||
'value' => template::ico('pencil'),
|
||||
'disabled' => !empty($fontUsed[$fontId])
|
||||
//'disabled' => !empty($fontUsed[$fontId])
|
||||
])
|
||||
: '',
|
||||
$type !== 'websafe' ? template::button('themeFontDelete' . $fontId, [
|
||||
|
@ -684,7 +691,10 @@ class theme extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Fontes'),
|
||||
'view' => 'font'
|
||||
'view' => 'font',
|
||||
'vendor' => [
|
||||
'datatables'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -701,8 +711,8 @@ class theme extends common
|
|||
// Type d'import en ligne ou local
|
||||
$type = $this->getInput('fontAddUrl', helper::FILTER_BOOLEAN) ? 'imported' : 'files';
|
||||
$type === 'files' ? 'imported' : 'files';
|
||||
$ressource = $type === 'imported' ? $this->getInput('fontAddUrl', null) : $this->getInput('fontAddFile', null);
|
||||
if (!empty($ressource)) {
|
||||
$resource = $type === 'imported' ? $this->getInput('fontAddUrl', null) : $this->getInput('fontAddFile', null);
|
||||
if (!empty($resource)) {
|
||||
$fontId = $this->getInput('fontAddFontId', null, true);
|
||||
$fontName = $this->getInput('fontAddFontName', null, true);
|
||||
$fontFamilyName = $this->getInput('fontAddFontFamilyName', null, true);
|
||||
|
@ -714,6 +724,22 @@ class theme extends common
|
|||
if (is_array($this->getData(['font', $type, $fontId]))) {
|
||||
$this->deleteData(['font', $type, $fontId]);
|
||||
}
|
||||
|
||||
// Paramètres de la sortie vrai par défaut, c'est une fonte en ligne
|
||||
$success = true;
|
||||
|
||||
// Copier la fonte si le nom du fichier est fourni
|
||||
$success = false;
|
||||
if (!is_dir(self::DATA_DIR . 'font/')) {
|
||||
mkdir(self::DATA_DIR . 'font/');
|
||||
}
|
||||
if (
|
||||
$type === 'files' &&
|
||||
file_exists(self::FILE_DIR . 'source/' . $resource)
|
||||
) {
|
||||
$success = copy(self::FILE_DIR . 'source/' . $resource, self::DATA_DIR . 'font/' . basename($resource));
|
||||
}
|
||||
|
||||
// Stocker la fonte
|
||||
$this->setData([
|
||||
'font',
|
||||
|
@ -722,24 +748,16 @@ class theme extends common
|
|||
[
|
||||
'name' => $fontName,
|
||||
'font-family' => $fontFamilyName,
|
||||
'resource' => $ressource
|
||||
// Stocke l'URL our lien vers la fonte dans data
|
||||
'resource' => $type === 'imported' ? $resource : self::DATA_DIR . 'font/' . basename($resource),
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
// Copier la fonte si le nom du fichier est fourni
|
||||
if (
|
||||
$type === 'files' &&
|
||||
file_exists(self::FILE_DIR . 'source/' . $ressource)
|
||||
) {
|
||||
copy(self::FILE_DIR . 'source/' . $ressource, self::DATA_DIR . 'font/' . $ressource);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Fonte créée'),
|
||||
'redirect' => helper::baseUrl() . 'theme/fonts',
|
||||
'state' => true
|
||||
'notification' => $success ? helper::translate('Fonte actualisée') : helper::translate('Fonte non créée, ressource absente !'),
|
||||
'redirect' => helper::baseUrl() . 'theme/font',
|
||||
'state' => $success
|
||||
]);
|
||||
} else {
|
||||
// Valeurs en sortie
|
||||
|
@ -770,8 +788,8 @@ class theme extends common
|
|||
) {
|
||||
// Type d'import en ligne ou local
|
||||
$type = $this->getInput('fontEditUrl', helper::FILTER_BOOLEAN) ? 'imported' : 'files';
|
||||
$ressource = $type === 'imported' ? $this->getInput('fontEditUrl', null) : $this->getInput('fontEditFile', null);
|
||||
$fontId = $this->getInput('fontEditFontId', null, true);
|
||||
$resource = $this->getData(['font', $type, $fontId, 'resource']);
|
||||
$fontName = $this->getInput('fontEditFontName', null, true);
|
||||
$fontFamilyName = $this->getInput('fontEditFontFamilyName', null, true);
|
||||
|
||||
|
@ -783,6 +801,7 @@ class theme extends common
|
|||
$this->deleteData(['font', $type, $fontId]);
|
||||
}
|
||||
|
||||
|
||||
// Stocker les fontes
|
||||
$this->setData([
|
||||
'font',
|
||||
|
@ -791,21 +810,14 @@ class theme extends common
|
|||
[
|
||||
'name' => $fontName,
|
||||
'font-family' => $fontFamilyName,
|
||||
'resource' => $ressource
|
||||
'resource' => $resource
|
||||
]
|
||||
]);
|
||||
// Copier la fonte si le nom du fichier est fourni
|
||||
if (
|
||||
$type === 'files' &&
|
||||
file_exists(self::FILE_DIR . 'source/' . $ressource)
|
||||
) {
|
||||
copy(self::FILE_DIR . 'source/' . $ressource, self::DATA_DIR . 'font/' . $ressource);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Fonte actualisée'),
|
||||
'redirect' => helper::baseUrl() . 'theme/fonts',
|
||||
'redirect' => helper::baseUrl() . 'theme/font',
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
|
@ -839,22 +851,22 @@ class theme extends common
|
|||
|
||||
// Effacer le fichier existant
|
||||
if (
|
||||
$this->getUrl(2) === 'file' &&
|
||||
file_exists(self::DATA_DIR . $this->getUrl(2))
|
||||
$this->getUrl(2) === 'files' &&
|
||||
file_exists($this->getData(['font', 'files', $this->getUrl(3), 'resource']))
|
||||
) {
|
||||
unlink(self::DATA_DIR . $this->getUrl(2));
|
||||
|
||||
unlink($this->getData(['font', 'files', $this->getUrl(3), 'resource']));
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'theme/fonts',
|
||||
'redirect' => helper::baseUrl() . 'theme/font',
|
||||
'notification' => helper::translate('Fonte supprimée'),
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Réinitialisation de la personnalisation avancée
|
||||
*/
|
||||
|
@ -1045,8 +1057,8 @@ class theme extends common
|
|||
// Archive de thème ?
|
||||
if (
|
||||
file_exists(self::TEMP_DIR . $tempFolder . '/site/data/custom.css')
|
||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data//theme.css')
|
||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data//theme.json')
|
||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.css')
|
||||
and file_exists(self::TEMP_DIR . $tempFolder . '/site/data/theme.json')
|
||||
) {
|
||||
$modele = 'theme';
|
||||
}
|
||||
|
@ -1063,17 +1075,17 @@ class theme extends common
|
|||
// Substitution des fontes Google
|
||||
if ($modele = 'theme') {
|
||||
// Déplacement des deux fichiers de theme dans le siteContent
|
||||
copy (self::DATA_DIR . 'theme.css', self::DATA_DIR . self::$siteContent . '/theme.css');
|
||||
copy (self::DATA_DIR . 'theme.json', self::DATA_DIR . self::$siteContent . '/theme.json');
|
||||
copy(self::DATA_DIR . 'theme.css', self::DATA_DIR . self::$siteContent . '/theme.css');
|
||||
copy(self::DATA_DIR . 'theme.json', self::DATA_DIR . self::$siteContent . '/theme.json');
|
||||
unlink(self::DATA_DIR . 'theme.css');
|
||||
unlink(self::DATA_DIR . 'theme.json');
|
||||
$c = $this->subFont(self::DATA_DIR . self::$siteContent . '/theme.json');
|
||||
$c = $this->subFont(self::DATA_DIR . self::$siteContent . '/theme.json');
|
||||
// Un remplacement nécessite la régénération de la feuille de style
|
||||
if (
|
||||
$c > 0
|
||||
and file_exists(self::DATA_DIR . self::$siteContent . '/theme.css')
|
||||
and file_exists(self::DATA_DIR . self::$siteContent . '/theme.css')
|
||||
) {
|
||||
unlink(self::DATA_DIR . self::$siteContent . '/theme.css');
|
||||
unlink(self::DATA_DIR . self::$siteContent . '/theme.css');
|
||||
}
|
||||
}
|
||||
if ($modele = 'admin') {
|
||||
|
@ -1198,8 +1210,8 @@ class theme extends common
|
|||
}
|
||||
break;
|
||||
case 'theme':
|
||||
$zip->addFile(self::DATA_DIR . self::$siteContent . '/theme.json', self::DATA_DIR . 'theme.json');
|
||||
$zip->addFile(self::DATA_DIR . self::$siteContent . '/theme.css', self::DATA_DIR . 'theme.css');
|
||||
$zip->addFile(self::DATA_DIR . self::$siteContent . '/theme.json', self::DATA_DIR . 'theme.json');
|
||||
$zip->addFile(self::DATA_DIR . self::$siteContent . '/theme.css', self::DATA_DIR . 'theme.css');
|
||||
$zip->addFile(self::DATA_DIR . 'custom.css', self::DATA_DIR . 'custom.css');
|
||||
// Traite l'image dans le body
|
||||
if ($this->getData(['theme', 'body', 'image']) !== '') {
|
||||
|
@ -1227,13 +1239,15 @@ class theme extends common
|
|||
// Ajoute les fontes
|
||||
$zip->addEmptyDir(self::DATA_DIR . 'font');
|
||||
$fonts = $this->getData(['font', 'files']);
|
||||
foreach ($fonts as $fontId => $fontName) {
|
||||
$zip->addFile(self::DATA_DIR . 'font/' . $fontName, self::DATA_DIR . 'font/' . $fontName);
|
||||
foreach ($fonts as $fontId => $fontInfo) {
|
||||
$zip->addFile($fontInfo['resource'], $fontInfo['resource']);
|
||||
}
|
||||
if (file_exists(self::DATA_DIR . 'font/font.html')) {
|
||||
|
||||
$zip->addFile(self::DATA_DIR . 'font/font.html', self::DATA_DIR . 'font/font.html');
|
||||
}
|
||||
if (file_exists(self::DATA_DIR . 'font/font.css')) {
|
||||
$zip->addFile(self::DATA_DIR . 'font/font.css', self::DATA_DIR . 'font/font.css');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1381,13 +1395,13 @@ class theme extends common
|
|||
($scope === 'user' && in_array($fontId, $fontsInstalled))
|
||||
|| $scope === 'all'
|
||||
) {
|
||||
if (file_exists(self::DATA_DIR . 'font/' . $fontValue['resource'])) {
|
||||
if (file_exists($fontValue['resource'])) {
|
||||
// Extension
|
||||
$path_parts = pathinfo(helper::baseUrl(false) . self::DATA_DIR . 'font/' . $fontValue['resource']);
|
||||
// Chargement de la police
|
||||
$fileContentCss .= '@font-face {';
|
||||
$fileContentCss .= 'font-family:"' . $fontValue['name'] . '";';
|
||||
$fileContentCss .= 'src: url("' . $fontValue['resource'] . '") format("' . $path_parts['extension'] . '");';
|
||||
$fileContentCss .= 'src: url("' . helper::baseUrl(false) . $fontValue['resource'] . '") format("' . $path_parts['extension'] . '");';
|
||||
$fileContentCss .= '}';
|
||||
// Préchargement
|
||||
//$fileContent = '<link rel="preload" href="' . self::DATA_DIR . 'font/' . $fontValue['resource'] . '" type="font/woff" crossorigin="anonymous" as="font">' . $fileContent;
|
||||
|
|
|
@ -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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, 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-2023, Frédéric Tempez
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue