Compare commits
152 Commits
Author | SHA1 | Date |
---|---|---|
Fred Tempez | 9bfa8280fd | |
Fred Tempez | 55b4e7335d | |
Fred Tempez | f7c2aab390 | |
Fred Tempez | cdab4659a6 | |
Fred Tempez | fc69015448 | |
Fred Tempez | 9e656294a6 | |
Fred Tempez | 8e91faf2d2 | |
Fred Tempez | 36c8619b63 | |
Fred Tempez | d77afce37b | |
Fred Tempez | bca34949a9 | |
Fred Tempez | 07baed8713 | |
Fred Tempez | 6687c324e5 | |
Fred Tempez | 03d1dacb88 | |
Fred Tempez | 77d8296642 | |
Fred Tempez | 999370646b | |
Fred Tempez | d8f4af660f | |
Fred Tempez | 5f146bfbdc | |
Fred Tempez | 950ba8cc9d | |
Fred Tempez | 2448e50793 | |
Fred Tempez | 5e29699563 | |
Fred Tempez | b78fc84a89 | |
Fred Tempez | 665c8dea6d | |
Fred Tempez | 159297e421 | |
Fred Tempez | fc502a1c64 | |
Fred Tempez | 457c8e0f66 | |
Fred Tempez | 660398bad7 | |
Fred Tempez | fad19249db | |
Fred Tempez | 060aa9e4d5 | |
Fred Tempez | 9052247e53 | |
Fred Tempez | df06b1f7ba | |
Fred Tempez | 8d324f9c79 | |
Fred Tempez | f18d4eee1d | |
Fred Tempez | fd51122918 | |
Fred Tempez | 15bd0400ea | |
Fred Tempez | 1147b5c5e1 | |
Fred Tempez | 2cbd3d5923 | |
Fred Tempez | 11753b4476 | |
Fred Tempez | f2a6d35351 | |
Fred Tempez | c4a23de744 | |
Fred Tempez | a47cbe49fe | |
Fred Tempez | 5f5815cbd9 | |
Fred Tempez | e811660d7c | |
Fred Tempez | 10083e7ee8 | |
Fred Tempez | d89455d86a | |
Fred Tempez | 5e7c9597cd | |
Fred Tempez | 49180ab4ed | |
Fred Tempez | c4fc466876 | |
Fred Tempez | 75203d6e8e | |
Fred Tempez | f61c2a977a | |
Fred Tempez | a02ce894c8 | |
Fred Tempez | 2d92bd3963 | |
Fred Tempez | b8c0b47faf | |
Fred Tempez | 2a8563ce9a | |
Fred Tempez | f924a2b2b3 | |
Fred Tempez | 5846c111fe | |
Fred Tempez | f86f38d8b0 | |
Fred Tempez | 68d0aaff84 | |
Fred Tempez | f5f04c90d9 | |
Fred Tempez | d8525bf123 | |
Fred Tempez | 25d6192e0e | |
Fred Tempez | 90a5a8a96a | |
Fred Tempez | 69852c82bc | |
Fred Tempez | f3ae03a133 | |
Fred Tempez | 9b5cc38c94 | |
Fred Tempez | 890cf97127 | |
Fred Tempez | 87a1f2cd18 | |
Fred Tempez | 50fc319afd | |
Fred Tempez | a2f53e1e58 | |
Fred Tempez | e6b9cb16b5 | |
Fred Tempez | 6f2447533c | |
Fred Tempez | 6f946b32ac | |
Fred Tempez | 33e2dca864 | |
Fred Tempez | a890a70beb | |
Fred Tempez | e92c709796 | |
Fred Tempez | bcf75ebfbd | |
Fred Tempez | c8a6a21f9c | |
Fred Tempez | a176556081 | |
Fred Tempez | 949373b39e | |
Fred Tempez | e26beac06c | |
Fred Tempez | 4bfc75288f | |
Fred Tempez | d1e4c9761f | |
Fred Tempez | dbafb6f4bb | |
Fred Tempez | 7ad8e3ea05 | |
Fred Tempez | e142f961d9 | |
Fred Tempez | 5c97b5cea6 | |
Fred Tempez | d21cfcba78 | |
Fred Tempez | c9300e5979 | |
Fred Tempez | 8cefdd027d | |
Fred Tempez | c3ade0fe0f | |
Fred Tempez | d3284c67d8 | |
Fred Tempez | 6b3085ef27 | |
Fred Tempez | 748e6d0873 | |
Fred Tempez | a9abe8aaa1 | |
Fred Tempez | 1fbf91a9cb | |
Fred Tempez | 9485ebe4cb | |
Fred Tempez | 88e7cb8761 | |
Fred Tempez | 857a6ff808 | |
Fred Tempez | 2d6bbcec9e | |
Fred Tempez | 748bb3befb | |
Fred Tempez | 29d6b1c758 | |
Fred Tempez | 696ca111b7 | |
Fred Tempez | a8381b4c18 | |
Fred Tempez | 0895abc30b | |
Fred Tempez | 3539c3b04e | |
Fred Tempez | 77aa46f753 | |
Fred Tempez | 42ef876963 | |
Fred Tempez | 3bfcaa4187 | |
Fred Tempez | 5a5e9dc72c | |
Fred Tempez | 4606d987b2 | |
Fred Tempez | b403816c88 | |
Fred Tempez | 470c017184 | |
Fred Tempez | 0720db7b17 | |
Fred Tempez | 1a61f34c19 | |
Fred Tempez | 94eda284ed | |
Fred Tempez | 9ae67cd2f3 | |
Fred Tempez | b6b5461241 | |
Fred Tempez | 9fac118004 | |
Fred Tempez | 92c7384816 | |
Fred Tempez | 9be5dab828 | |
Fred Tempez | c6ae372429 | |
Fred Tempez | 22e0b71012 | |
Fred Tempez | f0bec949bb | |
Fred Tempez | 0d42ca0740 | |
Fred Tempez | 18228b1b8e | |
Fred Tempez | 824ab8401a | |
Fred Tempez | 7249abc649 | |
Fred Tempez | 5336720809 | |
Fred Tempez | 3a7e4e8db6 | |
Fred Tempez | 51cc6b41a7 | |
Fred Tempez | 38b3a72c92 | |
Fred Tempez | fb79bce39c | |
Fred Tempez | 2c6b29747a | |
Fred Tempez | fd28afdd80 | |
Fred Tempez | 032a150b11 | |
Fred Tempez | c34e249cd0 | |
Fred Tempez | 953ba662e8 | |
Fred Tempez | e79ef549d6 | |
Fred Tempez | 5459aae163 | |
Fred Tempez | a3145fbd00 | |
Fred Tempez | bd04f94c76 | |
Fred Tempez | 74da56e58d | |
Fred Tempez | b26e7dcb7d | |
Fred Tempez | 3cee46072b | |
Fred Tempez | b590f91534 | |
Fred Tempez | 10e6822ad5 | |
Fred Tempez | 9944a192e2 | |
Fred Tempez | 8ad50b10dd | |
Fred Tempez | ee90649833 | |
Fred Tempez | a4601da9e0 | |
Fred Tempez | b1fcd4ecc8 | |
Fred Tempez | e110eba5d8 | |
Fred Tempez | 30e602adc2 |
|
@ -9,3 +9,5 @@ site/i18n/*.json
|
|||
core/vendor/tinymce/link_list.json
|
||||
robots.txt
|
||||
sitemap.xml
|
||||
.gitignore
|
||||
core/module/config/tool/data.key
|
106
CHANGES.md
106
CHANGES.md
|
@ -1,9 +1,109 @@
|
|||
# Changelog
|
||||
|
||||
## Version 13.2.02
|
||||
|
||||
Corrige un warning quand un module blog ou news ne contient pas d'article.
|
||||
|
||||
|
||||
## Version 13.2.01
|
||||
|
||||
### Correction
|
||||
|
||||
Modification de la fonction d'écriture des données de la classe jsonDB dans le but de s'assurer de l'intégrité des données écrites. Un trafic intense en pointe sur des fichiers volumineux et sur un serveur peu puissant pouvait occasionner des erreurs d'écriture ou un mauvais formatage des données json.
|
||||
|
||||
## Version 13.1.08
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige des erreurs quand une page parente ou des pages enfants ont des permissions limitées.
|
||||
- Module Search 3.1 : initialisation du module après installation dans une page sans configration par l'utilisateur.
|
||||
|
||||
### Améliorations
|
||||
|
||||
- Sauvegarde de l'état des sélecteurs dans les tables des fontes et des utilisateurs.
|
||||
- Ajoute des contrôles d'intégrité des bases de données Json lors des opérations de chargement et de sauvegarde.
|
||||
- Fournit une interface pour le contrôle des sauvegardes automatisées et de leur nettoyage par script CRON.
|
||||
|
||||
## Version 13.1.07
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige une dépréciation de la sortie de la fonction Usort dans RFM.
|
||||
- Module slider 6.4 : corrige plusieurs bugs dans les fonctions de tri
|
||||
|
||||
## Version 13.1.06
|
||||
|
||||
### Corrections
|
||||
|
||||
- Ajout d'utilisateur, étiquette non sauvegardée.
|
||||
- Slider, corrige un tri non pris en compte.
|
||||
|
||||
## Version 13.1.05
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige définitivement la fonction delete de la classe dot.
|
||||
- Branche de mise à jour de la version 13.1.04 incorrecte.
|
||||
|
||||
## Version 13.1.04
|
||||
|
||||
### Corrections
|
||||
|
||||
- Evite une notice dans l'onglet social de la configuration lorsque l'image opengraph n'est pas spécifiée.
|
||||
- Corrige une erreur dans la classe dot (fonction delete appelée statiquement)
|
||||
- Ne redirige pas vers une page d'erreur (403 ou 404) après un login.
|
||||
|
||||
### Améliorations
|
||||
|
||||
- Mise à jour en ligne :restauration de la réécriture dans le fichier .htaccess de la racine, utilisation d'un fichier drapeau *.rewrite* pour conserver l'état de la réécriture afin de dédier la variable ```data``` (XHR) aux messages d'erreur.
|
||||
- Journalise les erreurs de mise à jour automatique.
|
||||
|
||||
|
||||
## Version 13.1.03
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige un format de date dans la génération du sitemap.
|
||||
- Limite l'affichage de l'icône du gestionnaire de fichiers dans le menu aux membres simples.
|
||||
- Module blog ; format d'une variable de temps.
|
||||
- Modules Blog et news, corrige un bug de paramètre de localisation erroné.
|
||||
- Mot de passe oublié, une variable non définie affichant un warning.
|
||||
|
||||
### Améliorations
|
||||
|
||||
- Thèmes ; fontes : les fontes attribuées sont dans le thème administrateur sont prises en compte dans le blocage de l'effacement.
|
||||
- Optimisation du code de discrimination.
|
||||
|
||||
## Version 13.1.02
|
||||
|
||||
### Corrections
|
||||
|
||||
- Thème ; fontes : corrige un problème lors de l'installation et de la désinstallation d'une fonte sous forme de fichier woff.
|
||||
- Thème ; fontes : corrige un bug de redirection vers la liste des fontes après édition ou ajout.
|
||||
- Utilisateur ; ajout : corrige la non prise en compte de la langue.
|
||||
- Supprime le script imagemap non tenu à jour et bogué.
|
||||
|
||||
### Amélioration
|
||||
|
||||
- Thèmes ; fontes : filtrage et tri des fontes installées.
|
||||
|
||||
## Version 13.1.01
|
||||
|
||||
### Améliorations
|
||||
|
||||
- Cette version supprime le sélecteur de thème lors de l'installation.
|
||||
- Modules news et blog :
|
||||
- Nouvelle option ajoutant un bouton de retour dans la page de l'article.
|
||||
- La mise en forme du bloc signature est homogénéisée.
|
||||
- Profil des membres, corrige une impossibilité d'autoriser l'accès au gestionnaire de fichiers pour les membres non administrateurs.
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige une mauvaise mise en forme du journal des évènements.
|
||||
- Autres petites corrections.
|
||||
|
||||
## Version 13.1.00
|
||||
|
||||
|
||||
|
||||
### Améliorations
|
||||
|
||||
- La gestion des utilisateurs bénéficie de nouvelles fonctionnalités :
|
||||
|
@ -31,7 +131,7 @@
|
|||
|
||||
## Version 13.0.07
|
||||
|
||||
### Corrections
|
||||
### Corrections
|
||||
|
||||
- Module Slider (version 6.1), conformité de la largeur de l'image en pleine largeur lorsque le site est en largeur 100%.
|
||||
- Gestion des extensions, création du dossier "Modules" absent lors de la copie de l'archive d'un module dans le gestionnaire de fichiers.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# ZwiiCMS 13.1.00
|
||||
# ZwiiCMS 13.2.02
|
||||
|
||||
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# ZwiiCMS 13.1.00
|
||||
# ZwiiCMS 13.2.02
|
||||
|
||||
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class helper
|
|||
// Créer la variable
|
||||
$data = array_merge($data, [$text => '']);
|
||||
}
|
||||
file_put_contents('site/i18n/' . $to . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
file_put_contents('site/i18n/' . $to . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,12 @@ class JsonDb extends \Prowebcraft\Dot
|
|||
protected $db = '';
|
||||
protected $data = null;
|
||||
protected $config = [];
|
||||
// Tentative d'encodage après échec
|
||||
const MAX_JSON_ENCODE_ATTEMPTS = 5;
|
||||
// Tentative d'écriture après échec
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
// Délais entre deux tentaives
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
|
@ -121,10 +127,10 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -142,20 +148,40 @@ 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++;
|
||||
|
||||
// Attente
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
// 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>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -506,7 +506,7 @@ class layout extends common
|
|||
}
|
||||
// Commandes pour les membres simples
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||
) {
|
||||
if (
|
||||
|
|
|
@ -61,17 +61,17 @@ 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', file_get_contents('core/module/theme/resource/custom.css'));
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'custom.css', file_get_contents('core/module/theme/resource/custom.css'));
|
||||
chmod(self::DATA_DIR . 'custom.css', 0755);
|
||||
}
|
||||
// Crée le fichier de personnalisation
|
||||
if (file_exists(self::DATA_DIR . 'theme.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'theme.css', '');
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'theme.css', '');
|
||||
chmod(self::DATA_DIR . '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', '');
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'admin.css', '');
|
||||
chmod(self::DATA_DIR . 'admin.css', 0755);
|
||||
}
|
||||
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 . 'theme.css', $css);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . '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");
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -444,7 +367,7 @@ class core extends common
|
|||
// 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);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'admin.css', $css);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
@ -872,7 +795,7 @@ class core extends common
|
|||
if ($accessInfo['userName']) {
|
||||
$this->addOutput([
|
||||
'title' => 'Accès verrouillé',
|
||||
'content' => template::speech('<p>'. sprintf(helper::translate('La page %s est ouverte par l\'utilisateur %s</p><p><a style="color:inherit" href="javascript:history.back()">%s</a></p>'), $accessInfo['pageId'], $accessInfo['userName'], helper::translate('Retour')))
|
||||
'content' => template::speech('<p>' . sprintf(helper::translate('La page %s est ouverte par l\'utilisateur %s</p><p><a style="color:inherit" href="javascript:history.back()">%s</a></p>'), $accessInfo['pageId'], $accessInfo['userName'], helper::translate('Retour')))
|
||||
|
||||
]);
|
||||
} else {
|
||||
|
@ -884,7 +807,7 @@ class core extends common
|
|||
} else {
|
||||
$this->addOutput([
|
||||
'title' => 'Accès interdit',
|
||||
'content' => template::speech('<p>' . helper::translate('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)') . '</p><p><a style="color:inherit" href="javascript:history.back()">'. helper::translate('Retour') . '</a></p>')
|
||||
'content' => template::speech('<p>' . helper::translate('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)') . '</p><p><a style="color:inherit" href="javascript:history.back()">' . helper::translate('Retour') . '</a></p>')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -898,7 +821,7 @@ class core extends common
|
|||
} else {
|
||||
$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>')
|
||||
'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>')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
@ -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"));
|
||||
});
|
||||
|
|
210
core/core.php
210
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/
|
||||
*/
|
||||
|
@ -51,7 +51,7 @@ class common
|
|||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '13.1.00';
|
||||
const ZWII_VERSION = '13.2.02';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/';
|
||||
|
@ -60,6 +60,18 @@ class common
|
|||
// Valeurs possibles multiple de 10, 10 autorise 9 profils, 100 autorise 99 profils
|
||||
const MAX_PROFILS = 10;
|
||||
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
|
||||
/**
|
||||
* Nombre maximal de tentatives d'encodage JSON
|
||||
*/
|
||||
const MAX_JSON_ENCODE_ATTEMPTS = 3;
|
||||
|
||||
/**
|
||||
* Temps d'attente entre les tentatives en secondes
|
||||
*/
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
|
@ -134,7 +146,7 @@ class common
|
|||
// 'codemirror', // Désactivé par défaut
|
||||
'tippy',
|
||||
'zwiico',
|
||||
'imagemap',
|
||||
//'imagemap',
|
||||
'simplelightbox'
|
||||
],
|
||||
'view' => ''
|
||||
|
@ -328,9 +340,6 @@ class common
|
|||
$this->input['_COOKIE'] = $_COOKIE;
|
||||
}
|
||||
|
||||
// Extraction de la sesion
|
||||
// $this->input['_SESSION'] = $_SESSION;
|
||||
|
||||
// Déterminer la langue du contenu du site
|
||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
||||
// Déterminé par la session présente
|
||||
|
@ -350,6 +359,7 @@ class common
|
|||
// Instanciation de la classe des entrées / sorties
|
||||
$this->jsonDB(self::$siteContent);
|
||||
|
||||
|
||||
// Installation fraîche, initialisation des modules
|
||||
if ($this->user === []) {
|
||||
foreach ($this->dataFiles as $stageId => $item) {
|
||||
|
@ -592,10 +602,48 @@ class common
|
|||
public function setPage($page, $value, $lang)
|
||||
{
|
||||
|
||||
return file_put_contents(self::DATA_DIR . $lang . '/content/' . $page . '.html', $value);
|
||||
return $this->secure_file_put_contents(self::DATA_DIR . $lang . '/content/' . $page . '.html', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Écrit les données dans un fichier avec plusieurs tentatives d'écriture et verrouillage
|
||||
*
|
||||
* @param string $filename Le nom du fichier
|
||||
* @param string $data Les données à écrire dans le fichier
|
||||
* @param int $flags Les drapeaux optionnels à passer à la fonction $this->secure_file_put_contents
|
||||
* @return bool True si l'écriture a réussi, sinon false
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Effacer les données de la page
|
||||
|
@ -709,65 +757,65 @@ class common
|
|||
* Appelée par le core uniquement
|
||||
*/
|
||||
|
||||
private function buildHierarchy()
|
||||
{
|
||||
|
||||
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
||||
// Parents
|
||||
foreach ($pages as $pageId => $pagePosition) {
|
||||
if (
|
||||
// Page parent
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($pagePosition !== 0) {
|
||||
$this->hierarchy['visible'][$pageId] = [];
|
||||
}
|
||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||
$this->hierarchy['bar'][$pageId] = [];
|
||||
}
|
||||
$this->hierarchy['all'][$pageId] = [];
|
||||
}
|
||||
}
|
||||
// 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
|
||||
)
|
||||
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']))
|
||||
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($pagePosition !== 0) {
|
||||
$this->hierarchy['visible'][$parentId][] = $pageId;
|
||||
}
|
||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||
$this->hierarchy['bar'][$pageId] = [];
|
||||
}
|
||||
$this->hierarchy['all'][$parentId][] = $pageId;
|
||||
}
|
||||
}
|
||||
}
|
||||
private function buildHierarchy()
|
||||
{
|
||||
|
||||
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
||||
// Parents
|
||||
foreach ($pages as $pageId => $pagePosition) {
|
||||
if (
|
||||
// Page parent
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($pagePosition !== 0) {
|
||||
$this->hierarchy['visible'][$pageId] = [];
|
||||
}
|
||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||
$this->hierarchy['bar'][$pageId] = [];
|
||||
}
|
||||
$this->hierarchy['all'][$pageId] = [];
|
||||
}
|
||||
}
|
||||
// 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
|
||||
)
|
||||
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'])
|
||||
|
||||
)
|
||||
)
|
||||
) {
|
||||
if ($pagePosition !== 0) {
|
||||
$this->hierarchy['visible'][$parentId][] = $pageId;
|
||||
}
|
||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||
$this->hierarchy['bar'][$pageId] = [];
|
||||
}
|
||||
$this->hierarchy['all'][$parentId][] = $pageId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un fichier json avec la liste des pages
|
||||
|
@ -938,19 +986,17 @@ 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
|
||||
*/
|
||||
public function getPermission($key1, $key2 = null)
|
||||
{
|
||||
// User n'existe pas
|
||||
// if (is_array($this->user) === false) {
|
||||
// return false;
|
||||
|
||||
// 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
|
||||
|
@ -974,11 +1020,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;
|
||||
}
|
||||
|
@ -1076,14 +1119,15 @@ 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sous-pages
|
||||
|
@ -1105,7 +1149,7 @@ class common
|
|||
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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1129,7 +1173,7 @@ class common
|
|||
}
|
||||
$sitemap->updateRobots();
|
||||
} else {
|
||||
file_put_contents('robots.txt', 'User-agent: *' . PHP_EOL . 'Disallow: /');
|
||||
$this->secure_file_put_contents('robots.txt', 'User-agent: *' . PHP_EOL . 'Disallow: /');
|
||||
}
|
||||
|
||||
// Submit your sitemaps to Google, Yahoo, Bing and Ask.com
|
||||
|
@ -1400,13 +1444,13 @@ 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();
|
||||
$dataLog .= PHP_EOL;
|
||||
if ($this->getData(['config', 'connect', 'log'])) {
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ if ($this->getData(['core', 'dataVersion']) < 10200) {
|
|||
}
|
||||
// Créer les en-têtes du journal
|
||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
// Init préservation htaccess
|
||||
$this->setData(['config', 'autoUpdateHtaccess', false]);
|
||||
// Options de barre de membre simple
|
||||
|
@ -459,7 +459,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
|
|||
}
|
||||
foreach ($hierarchy as $parentKey => $parent) {
|
||||
$content = $this->getData(['page', $parent, 'content']);
|
||||
//file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $parent . '.html', $content);
|
||||
//$this->secure_file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $parent . '.html', $content);
|
||||
$this->setPage($parent, $content, 'fr');
|
||||
$this->setData(['page', $parent, 'content', $parent . '.html']);
|
||||
}
|
||||
|
@ -982,7 +982,7 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
|
|||
$d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
|
||||
$d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
|
||||
$t['locale'] = $d;
|
||||
file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t));
|
||||
$this->secure_file_put_contents(self::DATA_DIR . $key . '/locale.json', $t);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1100,6 +1100,19 @@ if ($this->getData(['core', 'dataVersion']) < 13005) {
|
|||
if ($this->getData(['admin', 'backgroundColorButtonHelp']) === null) {
|
||||
$this->setData(['admin', 'backgroundColorButtonHelp', 'rgba(255, 153, 0, 1)']);
|
||||
}
|
||||
|
||||
// Mise à jour
|
||||
$this->setData(['core', 'dataVersion', 13005]);
|
||||
}
|
||||
|
||||
// Version 13.1.01
|
||||
if ($this->getData(['core', 'dataVersion']) < 13101) {
|
||||
|
||||
// Supprime le choix du thème à l'installation
|
||||
if (is_dir('core/module/install/ressource/themes')) {
|
||||
$this->deleteDir('core/module/install/ressource/themes') ;
|
||||
}
|
||||
|
||||
// Mise à jour
|
||||
$this->setData(['core', 'dataVersion', 13101]);
|
||||
}
|
|
@ -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; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'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/
|
||||
*/
|
||||
|
|
|
@ -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; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
|
@ -13,15 +14,23 @@
|
|||
<?php $layout->showFavicon(); ?>
|
||||
<?php $layout->showVendor(); ?>
|
||||
<?php $layout->showFonts(); ?>
|
||||
<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; ?>theme.css?<?php echo md5_file(self::DATA_DIR . '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'); ?>">
|
||||
<?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; ?>theme.css?<?php echo md5_file(self::DATA_DIR . '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'); ?>">
|
||||
<!-- Détection RSS -->
|
||||
<?php if (($this->getData(['page', $this->getUrl(0), 'moduleId']) === 'blog'
|
||||
<?php if (
|
||||
($this->getData(['page', $this->getUrl(0), 'moduleId']) === 'blog'
|
||||
or $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'news')
|
||||
and $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE
|
||||
) : ?>
|
||||
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" title="fLUX rss">
|
||||
): ?>
|
||||
<link rel="alternate" type="application/rss+xml"
|
||||
href="'<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" title="fLUX rss">
|
||||
<?php endif; ?>
|
||||
<?php $layout->showStyle(); ?>
|
||||
<?php $layout->showInlineStyle(); ?>
|
||||
|
@ -30,15 +39,16 @@
|
|||
include(self::DATA_DIR . 'head.inc.html');
|
||||
} ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Barre d'administration -->
|
||||
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
|
||||
<?php if ($this->getUser('group') > self::GROUP_MEMBER): ?>
|
||||
<?php $layout->showBar(); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Notifications -->
|
||||
<?php $layout->showNotification(); ?>
|
||||
<!-- Menu dans le fond du site avant la bannière -->
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top') : ?>
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top'): ?>
|
||||
<!-- Détermine si le menu est fixe en haut de page lorsque l'utilisateur n'est pas connecté -->
|
||||
<?php
|
||||
if (
|
||||
|
@ -54,13 +64,14 @@
|
|||
?>
|
||||
<!-- Menu Burger -->
|
||||
<div id="toggle">
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?></div>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?>
|
||||
</div>
|
||||
<!-- fin du menu burger -->
|
||||
<?php
|
||||
$menuClass = $this->getData(['theme', 'menu', 'position']) === 'top' ? 'class="container-large"' : 'class="container"';
|
||||
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
|
||||
$menuClass = $this->getData(['theme', 'menu', 'position']) === 'top' ? 'class="container-large"' : 'class="container"';
|
||||
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
|
||||
?>
|
||||
<div id="menu" <?php echo $menuClass; ?>>
|
||||
<?php $layout->showMenu(); ?>
|
||||
|
@ -68,58 +79,65 @@
|
|||
</nav>
|
||||
<?php endif; ?>
|
||||
<!-- Bannière dans le fond du site -->
|
||||
<?php if ($this->getData(['theme', 'header', 'position']) === 'body') : ?>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
|
||||
<?php if ($this->getData(['theme', 'header', 'position']) === 'body'): ?>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
|
||||
<?php
|
||||
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
|
||||
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
|
||||
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
|
||||
$headerClass .= $this->getData(['theme', 'header', 'wide']) === 'none' ? '' : 'container';
|
||||
?>
|
||||
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"'; ?>>
|
||||
<?php if ($this->getData(['theme', 'header', 'feature']) === 'wallpaper') : ?>
|
||||
<?php if ($this->getData(['theme', 'header', 'feature']) === 'wallpaper'): ?>
|
||||
<?php if (
|
||||
$this->getData(['theme', 'header', 'textHide']) === false
|
||||
// Affiche toujours le titre de la bannière pour l'édition du thème
|
||||
or ($this->getUrl(0) === 'theme' and $this->getUrl(1) === 'header')
|
||||
) : ?>
|
||||
<span id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
|
||||
<?php else : ?>
|
||||
): ?>
|
||||
<span id="themeHeaderTitle">
|
||||
<?php echo $this->getData(['locale', 'title']); ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<span id="themeHeaderTitle"> </span>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php else: ?>
|
||||
<div id="featureContent">
|
||||
<?php echo $this->getData(['theme', 'header', 'featureContent']); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '</a>' : ''; ?>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '</a>' : ''; ?>
|
||||
<?php endif; ?>
|
||||
<!-- Menu dans le fond du site après la bannière -->
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'body-second') : ?>
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'body-second'): ?>
|
||||
<nav>
|
||||
<!-- Menu burger -->
|
||||
<div id="toggle">
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?></div>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?>
|
||||
</div>
|
||||
<!-- fin du menu burger -->
|
||||
<?php
|
||||
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
|
||||
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
|
||||
?>
|
||||
<div id="menu" <?php echo $menuClass; ?>>
|
||||
<?php $layout->showMenu(); ?></div>
|
||||
<?php $layout->showMenu(); ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<!-- Site -->
|
||||
<div id="site" class="container">
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'site-first') : ?>
|
||||
<?php if ($this->getData(['theme', 'menu', 'position']) === 'site-first'): ?>
|
||||
<!-- Menu dans le site avant la bannière -->
|
||||
<nav>
|
||||
<div id="toggle">
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?></div>
|
||||
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?>
|
||||
</div>
|
||||
<div id="menu" class="container">
|
||||
<?php $layout->showMenu(); ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
|
@ -128,31 +146,33 @@
|
|||
or ($this->getData(['theme', 'header', 'position']) === 'hide'
|
||||
and $this->getUrl(0) === 'theme'
|
||||
)
|
||||
) : ?>
|
||||
): ?>
|
||||
<!-- Bannière dans le site -->
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
|
||||
<?php
|
||||
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
|
||||
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
|
||||
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
|
||||
?>
|
||||
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"'; ?>>
|
||||
<?php if ($this->getData(['theme', 'header', 'feature']) === 'wallpaper') : ?>
|
||||
<?php if ($this->getData(['theme', 'header', 'feature']) === 'wallpaper'): ?>
|
||||
<?php if (
|
||||
$this->getData(['theme', 'header', 'textHide']) === false
|
||||
// Affiche toujours le titre de la bannière pour l'édition du thème
|
||||
or ($this->getUrl(0) === 'theme' and $this->getUrl(1) === 'header')
|
||||
) : ?>
|
||||
<span id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
|
||||
<?php else : ?>
|
||||
): ?>
|
||||
<span id="themeHeaderTitle">
|
||||
<?php echo $this->getData(['locale', 'title']); ?>
|
||||
</span>
|
||||
<?php else: ?>
|
||||
<span id="themeHeaderTitle"> </span>
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<?php else: ?>
|
||||
<div id="featureContent">
|
||||
<?php echo $this->getData(['theme', 'header', 'featureContent']); ?>
|
||||
</diV>
|
||||
<?php endif; ?>
|
||||
</header>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '</a>' : ''; ?>
|
||||
<?php echo ($this->getData(['theme', 'header', 'linkHomePage']) && $this->getData(['theme', 'header', 'feature']) === 'wallpaper') ? '</a>' : ''; ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['theme', 'menu', 'position']) === 'site-second' ||
|
||||
|
@ -161,14 +181,17 @@
|
|||
or ($this->getData(['theme', 'menu', 'position']) === 'hide'
|
||||
and $this->getUrl(0) === 'theme'
|
||||
)
|
||||
) : ?>
|
||||
): ?>
|
||||
<!-- Menu dans le site après la bannière -->
|
||||
<nav <?php if ($this->getData(['theme', 'menu', 'position']) === 'hide') : ?>class="displayNone" <?php endif; ?>>
|
||||
<nav <?php if ($this->getData(['theme', 'menu', 'position']) === 'hide'): ?>class="displayNone" <?php endif; ?>>
|
||||
<div id="toggle">
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?></div>
|
||||
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'title' ? '<div id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?>
|
||||
<?php echo $this->getData(['theme', 'menu', 'burgerContent']) === 'logo' ? '<div id="burgerLogo"><img src="' . helper::baseUrl(false) . self::FILE_DIR . 'source/' . $this->getData(['theme', 'menu', 'burgerLogo']) . '"></div>' : ''; ?>
|
||||
<?php echo template::ico('menu', ['fontSize' => '2em']); ?>
|
||||
</div>
|
||||
<div id="menu" class="container">
|
||||
<?php $layout->showMenu(); ?>
|
||||
</div>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
<!-- Corps de page -->
|
||||
|
@ -178,7 +201,9 @@
|
|||
<!-- Fin du site -->
|
||||
<?php echo $this->getData(['theme', 'footer', 'position']) === 'site' ? '</div>' : ''; ?>
|
||||
<!-- Lien remonter en haut -->
|
||||
<div id="backToTop"><?php echo template::ico('up'); ?></div>
|
||||
<div id="backToTop">
|
||||
<?php echo template::ico('up'); ?>
|
||||
</div>
|
||||
<!-- Affichage du consentement aux cookies-->
|
||||
<?php $layout->showCookies(); ?>
|
||||
<!-- Les scripts -->
|
||||
|
@ -186,7 +211,7 @@
|
|||
<!-- Script perso dans body -->
|
||||
<?php if (file_exists(self::DATA_DIR . 'body.inc.html')) {
|
||||
include(self::DATA_DIR . 'body.inc.html');
|
||||
}?>
|
||||
} ?>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -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/
|
||||
*/
|
||||
|
@ -534,7 +534,7 @@ class config extends common
|
|||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
file_put_contents(
|
||||
$this->secure_file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
|
@ -550,7 +550,7 @@ class config extends common
|
|||
$fileContent = file_get_contents('.htaccess');
|
||||
$fileContent = explode('# URL rewriting', $fileContent);
|
||||
$fileContent = $fileContent[0] . '# URL rewriting' . $fileContent[2];
|
||||
file_put_contents(
|
||||
$this->secure_file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
|
@ -585,7 +585,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');
|
||||
}
|
||||
|
||||
|
||||
|
@ -654,10 +654,10 @@ class config extends common
|
|||
) {
|
||||
// Ecrire les fichiers de script
|
||||
if ($this->geturl(2) === 'head') {
|
||||
file_put_contents(self::DATA_DIR . 'head.inc.html', $this->getInput('configScriptHead', null));
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'head.inc.html', $this->getInput('configScriptHead', null));
|
||||
}
|
||||
if ($this->geturl(2) === 'body') {
|
||||
file_put_contents(self::DATA_DIR . 'body.inc.html', $this->getInput('configScriptBody', null));
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'body.inc.html', $this->getInput('configScriptBody', null));
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -699,7 +699,7 @@ class config extends common
|
|||
unlink(self::DATA_DIR . 'journal.log');
|
||||
// Créer les en-têtes des journaux
|
||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Configuration'),
|
||||
|
@ -775,15 +775,15 @@ class config extends common
|
|||
ob_start();
|
||||
$fileName = self::TEMP_DIR . 'blacklist.log';
|
||||
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
|
||||
file_put_contents($fileName, $d);
|
||||
$this->secure_file_put_contents($fileName, $d);
|
||||
if (file_exists($fileName)) {
|
||||
$d = $this->getData(['blacklist']);
|
||||
$data = '';
|
||||
foreach ($d as $key => $item) {
|
||||
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$siteContent) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$siteContent);
|
||||
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$i18nUI) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nUI);
|
||||
$data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL;
|
||||
}
|
||||
file_put_contents($fileName, $data, FILE_APPEND);
|
||||
$this->secure_file_put_contents($fileName, $data, FILE_APPEND);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
<Files "data.key">
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
</Files>
|
|
@ -0,0 +1,47 @@
|
|||
<?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
|
||||
|
||||
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é et ajoute les fichiers à l'archive ZIP. 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'])) {
|
||||
$key = $_GET['key'];
|
||||
$storedKey = file_get_contents('data.key');
|
||||
if ($key !== $storedKey) {
|
||||
http_response_code(401);
|
||||
exit();
|
||||
}
|
||||
// Création du ZIP
|
||||
$filter = ['backup', 'tmp'];
|
||||
$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);
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?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);
|
||||
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);
|
||||
}
|
|
@ -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/
|
||||
*/
|
||||
|
@ -71,7 +71,7 @@ $(document).ready(function () {
|
|||
configLayout = "setup";
|
||||
setCookie("configLayout", "setup");
|
||||
}
|
||||
$("#localeContainer").hide();
|
||||
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
|
@ -158,39 +158,22 @@ $(document).ready(function () {
|
|||
* Sélection de la page de configuration à afficher
|
||||
*/
|
||||
$("#configSetupButton").on("click", function () {
|
||||
$("#localeContainer").hide();
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#setupContainer").show();
|
||||
$("#configSetupButton").addClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "setup");
|
||||
});
|
||||
$("#configLocaleButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#localeContainer").show();
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").addClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "locale");
|
||||
});
|
||||
$("#configSocialButton").on("click", function () {
|
||||
$("#connectContainer").hide();
|
||||
$("#setupContainer").hide();
|
||||
$("#localeContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#socialContainer").show();
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").addClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
|
@ -198,12 +181,10 @@ $(document).ready(function () {
|
|||
});
|
||||
$("#configConnectButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
$("#localeContainer").hide();
|
||||
$("#socialContainer").hide();
|
||||
$("#networkContainer").hide();
|
||||
$("#connectContainer").show();
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").addClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
|
@ -211,12 +192,10 @@ $(document).ready(function () {
|
|||
});
|
||||
$("#configNetworkButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
$("#localeContainer").hide();
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
$("#networkContainer").show();
|
||||
$("#configSetupButton").removeClass("activeButton");
|
||||
$("#configLocaleButton").removeClass("activeButton");
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").addClass("activeButton");
|
||||
|
@ -233,7 +212,7 @@ $(document).ready(function () {
|
|||
|
||||
|
||||
// Mise en évidence des erreurs de saisie dans les boutons de sélection
|
||||
var containers = ["setup", "locale", "social", "connect", "network"];
|
||||
var containers = ["setup", "social", "connect", "network"];
|
||||
$.each(containers, function (index, value) {
|
||||
var a = $("div#" + value + "Container").find("input.notice").not(".displayNone");
|
||||
if (a.length > 0) {
|
||||
|
|
|
@ -9,14 +9,20 @@
|
|||
</div>
|
||||
<div class="col1">
|
||||
<?php /**echo template::button('configHelp', [
|
||||
'class' => 'buttonHelp',
|
||||
'href' => 'https://doc.zwiicms.fr/configuration-du-site',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */ ?>
|
||||
'class' => 'buttonHelp',
|
||||
'href' => 'https://doc.zwiicms.fr/configuration-du-site',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<div class="col2 offset6">
|
||||
<?php echo template::button('configLocaleButton', [
|
||||
'value' => 'Identité',
|
||||
'href' => helper::baseUrl() . 'language/site'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::submit('Submit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -35,7 +41,6 @@
|
|||
'value' => 'Connexion',
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
|
||||
<?php echo template::button('configNetworkButton', [
|
||||
'value' => 'Réseau',
|
||||
'class' => 'buttonTab'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
@ -32,9 +32,6 @@ class install extends common
|
|||
|
||||
public static $updateButtonText = 'Réinstaller';
|
||||
|
||||
// Thèmes proposés à l'installation
|
||||
public static $themes = [];
|
||||
|
||||
public static $newVersion;
|
||||
|
||||
// Fichiers des Interface
|
||||
|
@ -213,40 +210,17 @@ class install extends common
|
|||
mkdir(self::DATA_DIR . 'font');
|
||||
}
|
||||
|
||||
// Installation du thème sélectionné
|
||||
$dataThemes = json_decode(file_get_contents('core/module/install/ressource/themes/themes.json'), true);
|
||||
$dataThemes = $dataThemes['themes'];
|
||||
$themeFilename = $dataThemes[$this->getInput('installTheme', helper::FILTER_STRING_SHORT)]['filename'];
|
||||
if ($themeFilename !== '') {
|
||||
$theme = new theme;
|
||||
$theme->import('core/module/install/ressource/themes/' . $themeFilename);
|
||||
}
|
||||
|
||||
// Copie des thèmes dans les fichiers
|
||||
if (!is_dir(self::FILE_DIR . 'source/theme')) {
|
||||
mkdir(self::FILE_DIR . 'source/theme');
|
||||
}
|
||||
$this->copyDir('core/module/install/ressource/themes', self::FILE_DIR . 'source/theme');
|
||||
unlink(self::FILE_DIR . 'source/theme/themes.json');
|
||||
|
||||
// Copie des langues de l'UI et génération de la base de données
|
||||
if (is_dir(self::I18N_DIR) === false) {
|
||||
mkdir(self::I18N_DIR);
|
||||
}
|
||||
|
||||
// Créer la base de données des langues
|
||||
// copy('core/module/install/ressource/i18n/language.json', self::DATA_DIR . 'language.json');
|
||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||
// unlink(self::I18N_DIR . 'language.json');
|
||||
|
||||
// Fixe l'adresse from pour les envois d'email
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
||||
|
||||
// Supprimé à cause de l'écrasement des bases
|
||||
//$this->setData(['module', 'blog', 'posts', 'mon-premier-article', 'userId', $userId]);
|
||||
//$this->setData(['module', 'blog', 'posts', 'mon-deuxieme-article', 'userId', $userId]);
|
||||
//$this->setData(['module', 'blog', 'posts', 'mon-troisieme-article', 'userId', $userId]);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl(),
|
||||
|
@ -255,13 +229,6 @@ class install extends common
|
|||
]);
|
||||
}
|
||||
|
||||
// Affichage du formulaire
|
||||
|
||||
// Récupération de la liste des thèmes
|
||||
$dataThemes = json_decode(file_get_contents('core/module/install/ressource/themes/themes.json'), true);
|
||||
$dataThemes = $dataThemes['themes'];
|
||||
self::$themes = helper::arrayColumn($dataThemes, 'name');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_LAYOUT_LIGHT,
|
||||
|
@ -300,14 +267,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,
|
||||
|
@ -319,7 +290,9 @@ class install extends common
|
|||
break;
|
||||
// Téléchargement
|
||||
case 2:
|
||||
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
||||
$success = true;
|
||||
$message = '';
|
||||
$this->secure_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);
|
||||
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
||||
|
@ -329,27 +302,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
|
||||
|
@ -358,9 +339,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');
|
||||
|
@ -368,12 +351,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;
|
||||
|
@ -381,7 +368,6 @@ class install extends common
|
|||
case 4:
|
||||
$success = true;
|
||||
$message = '';
|
||||
$rewrite = $this->getInput('data');
|
||||
|
||||
/**
|
||||
* Restaure le fichier htaccess
|
||||
|
@ -402,7 +388,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 .
|
||||
|
@ -415,10 +401,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');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -430,7 +417,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'] &&
|
||||
|
@ -442,7 +428,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,
|
||||
|
@ -474,7 +463,7 @@ class install extends common
|
|||
|
||||
// Variable de version
|
||||
if (helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)) {
|
||||
self::$updateButtonText = helper::translate('Mettre à jour');
|
||||
self::$updateButtonText = helper::translate('Mise à jour');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -420,7 +420,7 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false,
|
||||
'share' => true,
|
||||
'path' => './site/file/source/partage/',
|
||||
'path' => '/site/file/source/partage/',
|
||||
],
|
||||
'page' => [
|
||||
'add' => false,
|
||||
|
@ -506,7 +506,7 @@ class init extends common
|
|||
'copycut' => false,
|
||||
'chmod' => false,
|
||||
'share' => true,
|
||||
'path' => './site/file/source/partage/',
|
||||
'path' => '/site/file/source/partage/',
|
||||
],
|
||||
'page' => [
|
||||
'add' => false,
|
||||
|
@ -588,7 +588,7 @@ class init extends common
|
|||
'copycut' => true,
|
||||
'chmod' => true,
|
||||
'share' => true,
|
||||
'path' => './site/file/source/partage/',
|
||||
'path' => '/site/file/source/partage/',
|
||||
],
|
||||
'page' => [
|
||||
'add' => true,
|
||||
|
|
|
@ -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": "",
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,24 +0,0 @@
|
|||
{
|
||||
"themes": {
|
||||
"defaut": {
|
||||
"name": "Le thème par défaut, ambiance bleu et montagne",
|
||||
"filename": ""
|
||||
},
|
||||
"moderne": {
|
||||
"name": "Thème avec la nouvelle bannière personnalisable",
|
||||
"filename": "theme_moderne.zip"
|
||||
},
|
||||
"affaire": {
|
||||
"name": "Thème affaire, bannière centre d'appel, ambiance prune",
|
||||
"filename": "theme_affaire.zip"
|
||||
},
|
||||
"black": {
|
||||
"name": "Thème de nuit, ambiance nocturne",
|
||||
"filename": "theme_orange_black.zip"
|
||||
},
|
||||
"facebook": {
|
||||
"name": "Thème Facebook ancienne génération, pas de bannière, menu fixe fond bleu",
|
||||
"filename": "theme_old_facebook.zip"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -94,9 +94,6 @@
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::select('installTheme', $module::$themes, [
|
||||
'label' => 'Thème'
|
||||
]); ?>
|
||||
<?php echo template::hidden('installLanguage', [
|
||||
'value' => $this->getUrl(2)
|
||||
]); ?>
|
||||
|
|
|
@ -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', $languageData);
|
||||
$success = is_int($success) ? true : false;
|
||||
}
|
||||
}
|
||||
|
@ -255,23 +255,23 @@ 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') : '',
|
||||
'',
|
||||
/*
|
||||
template::button('translateContentLanguageUIEdit' . $file, [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $file,
|
||||
'value' => template::ico('pencil'),
|
||||
'help' => 'Éditer',
|
||||
'disabled' => 'fr_FR' === $file
|
||||
]),
|
||||
*/
|
||||
template::button('translateContentLanguageUIEdit' . $file, [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $file,
|
||||
'value' => template::ico('pencil'),
|
||||
'help' => 'Éditer',
|
||||
'disabled' => 'fr_FR' === $file
|
||||
]),
|
||||
*/
|
||||
|
||||
template::button('translateContentLanguageUIDownload' . $file, [
|
||||
'class' => isset($storeUI[$file]['version']) && version_compare($installedUI[$file]['version'], $storeUI[$file]['version']) < 0 ? 'buttonGreen' : '',
|
||||
'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',
|
||||
|
@ -304,6 +304,17 @@ class language extends common
|
|||
}
|
||||
}
|
||||
|
||||
// Pointer vers la fenêtre
|
||||
switch ($this->getUrl(1)) {
|
||||
case 'interface':
|
||||
setcookie('translateLayout', 'ui', time() + 3600, '/', '', false, false);
|
||||
break;
|
||||
case 'site':
|
||||
setcookie('translateLayout', 'content', time() + 3600, '/', '', false, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
|
@ -419,7 +430,7 @@ class language extends common
|
|||
$this->setData(['locale', $data['locale']]);
|
||||
} else {
|
||||
// Sauver sur le disque
|
||||
file_put_contents(self::DATA_DIR . $lang . '/locale.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . $lang . '/locale.json', $data);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
|
@ -501,7 +512,7 @@ class language extends common
|
|||
$data[$key] = $target;
|
||||
}
|
||||
}
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
$this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $data);
|
||||
|
||||
// Mettre à jour le descripteur
|
||||
$this->setData([
|
||||
|
@ -535,7 +546,7 @@ class language extends common
|
|||
$data[$key] = '';
|
||||
}
|
||||
}
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
$this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $data);
|
||||
|
||||
// Tableau des chaines à traduire dans la langue sélectionnée
|
||||
foreach ($data as $key => $value) {
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
@ -177,7 +177,7 @@ class page extends common
|
|||
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
|
||||
}
|
||||
//file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
//$this->secure_file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$siteContent);
|
||||
|
||||
// Met à jour le sitemap
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
@ -314,7 +314,7 @@ class plugin extends common
|
|||
mkdir(self::FILE_DIR . 'source/modules', 0755);
|
||||
}
|
||||
// Sauver les données du fichiers
|
||||
file_put_contents(self::FILE_DIR . 'source/modules/' . $moduleFile, $moduleData);
|
||||
$this->secure_file_put_contents(self::FILE_DIR . 'source/modules/' . $moduleFile, $moduleData);
|
||||
|
||||
// Installation directe
|
||||
if (file_exists(self::FILE_DIR . 'source/modules/' . $moduleFile)) {
|
||||
|
@ -377,7 +377,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,
|
||||
|
@ -403,7 +403,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']),
|
||||
|
@ -592,7 +592,7 @@ class plugin extends common
|
|||
$fileName = $moduleId . str_replace('.', '-', $infoModule[$moduleId]['version']) . '.zip';
|
||||
|
||||
// Régénération du descripteur du module
|
||||
file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE));
|
||||
$this->secure_file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', $infoModule[$moduleId]);
|
||||
|
||||
// Construire l'archive
|
||||
$this->makeZip($tmpFolder . $fileName, self::MODULE_DIR . $moduleId);
|
||||
|
|
|
@ -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
|
||||
|
@ -304,7 +304,7 @@ class theme extends common
|
|||
$this->isPost()
|
||||
) {
|
||||
// Enregistre le CSS
|
||||
file_put_contents(self::DATA_DIR . 'custom.css', $this->getInput('themeAdvancedCss', null));
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'custom.css', $this->getInput('themeAdvancedCss', null));
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
|
@ -628,16 +628,16 @@ class theme extends common
|
|||
// Toutes les fontes installées sont chargées
|
||||
$this->setFonts('all');
|
||||
|
||||
// Polices liées au thème admin
|
||||
$fonts['Titre (admin)'] = $this->getData(['admin', 'fontTitle']);
|
||||
$fonts['Texte (admin)'] = $this->getData(['admin', 'fontText']);
|
||||
|
||||
// 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'])
|
||||
];
|
||||
$fonts['Bannière'] = $this->getData(['theme', 'header', 'font']);
|
||||
$fonts['Menu'] = $this->getData(['theme', 'menu', 'font']);
|
||||
$fonts['Titre'] = $this->getData(['theme', 'title', 'font']);
|
||||
$fonts['Texte'] = $this->getData(['theme', 'text', 'font']);
|
||||
$fonts['Pied de page'] = $this->getData(['theme', 'footer', 'font']);
|
||||
|
||||
// Récupérer le détail des fontes installées
|
||||
//$f = $this->getFonts();
|
||||
|
@ -649,24 +649,23 @@ class theme extends common
|
|||
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 +683,10 @@ class theme extends common
|
|||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Fontes'),
|
||||
'view' => 'font'
|
||||
'view' => 'font',
|
||||
'vendor' => [
|
||||
'datatables'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -701,8 +703,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 +716,21 @@ 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
|
||||
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 +739,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 +779,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 +792,7 @@ class theme extends common
|
|||
$this->deleteData(['font', $type, $fontId]);
|
||||
}
|
||||
|
||||
|
||||
// Stocker les fontes
|
||||
$this->setData([
|
||||
'font',
|
||||
|
@ -791,21 +801,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,15 +842,16 @@ 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
|
||||
]);
|
||||
|
@ -1221,13 +1225,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;
|
||||
}
|
||||
$ret = $zip->close();
|
||||
|
@ -1284,7 +1290,7 @@ class theme extends common
|
|||
}
|
||||
// Sauvegarder la chaîne modifiée
|
||||
if ($count > 0) {
|
||||
file_put_contents($file, $data);
|
||||
$this->secure_file_put_contents($file, $data);
|
||||
}
|
||||
// Retourner le nombre d'occurrences
|
||||
return ($count);
|
||||
|
@ -1374,13 +1380,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;
|
||||
|
@ -1390,8 +1396,8 @@ class theme extends common
|
|||
}
|
||||
|
||||
// Enregistre la personnalisation
|
||||
file_put_contents(self::DATA_DIR . 'font/font.html', $fileContent);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'font/font.html', $fileContent);
|
||||
// Enregistre la personnalisation
|
||||
file_put_contents(self::DATA_DIR . 'font/font.css', $fileContentCss);
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'font/font.css', $fileContentCss);
|
||||
}
|
||||
}
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @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
|
||||
* @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/
|
||||
*/
|
||||
|
|
|
@ -4,8 +4,31 @@
|
|||
* 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/
|
||||
*/
|
||||
$(".themeFontDelete").on("click",(function(){var _this=$(this);return core.confirm("Êtes-vous sûr de vouloir supprimer cette fonte ?",(function(){$(location).attr("href",_this.attr("href"))}))}));
|
||||
$(".themeFontDelete").on("click", (function() {
|
||||
var _this = $(this);
|
||||
return core.confirm("Êtes-vous sûr de vouloir supprimer cette fonte ?", (function() {
|
||||
$(location).attr("href", _this.attr("href"))
|
||||
}))
|
||||
}));
|
||||
$('#dataTables').DataTable({
|
||||
language: {
|
||||
url: "core/vendor/datatables/french.json",
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"columnDefs": [{
|
||||
target: 5,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
},
|
||||
{
|
||||
target: 6,
|
||||
orderable: false,
|
||||
searchable: false
|
||||
}
|
||||
]
|
||||
});
|
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<?php if ($module::$fontsDetail) : ?>
|
||||
<?php echo template::table([2, 2, 3, 2, 1, 1, 1], $module::$fontsDetail, ['FontId', 'Nom', 'Famille', 'Affectation', 'Origine', '', '']); ?>
|
||||
<?php echo template::table([2, 2, 3, 2, 1, 1, 1], $module::$fontsDetail, ['FontId', 'Nom', 'Famille', 'Affectation', 'Origine', '', ''], ['id' => 'dataTables']); ?>
|
||||
<?php else : ?>
|
||||
<?php echo template::speech('Aucune fonte !'); ?>
|
||||
<?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/
|
||||
*/
|
||||
|
|
|
@ -4,8 +4,34 @@
|
|||
* 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/
|
||||
*/
|
||||
$("input[name=fontAddFontImported]").on("click",(function(){$("input[name=fontAddFontImported]").is(":checked")?$("input[name=fontAddFontFile]").prop("checked",!1):$("input[name=fontAddFontFile]").prop("checked",!0),$("#containerFontAddFile").hide(),$("#containerFontAddUrl").show()})),$("input[name=fontAddFontFile]").on("click",(function(){$("input[name=fontAddFontFile]").is(":checked")?$("input[name=fontAddFontImported]").prop("checked",!1):$("input[name=fontAddFontImported]").prop("checked",!0),$("#containerFontAddFile").show(),$("#containerFontAddUrl").hide()}));
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$("input[name=fontAddFontImported]").on("click", (function () {
|
||||
$("input[name=fontAddFontImported]").is(":checked") ? $("input[name=fontAddFontFile]").prop("checked", !1) : $("input[name=fontAddFontFile]").prop("checked", !0), $("#containerFontAddFile").hide(), $("#containerFontAddUrl").show()
|
||||
})), $("input[name=fontAddFontFile]").on("click", (function () {
|
||||
$("input[name=fontAddFontFile]").is(":checked") ? $("input[name=fontAddFontImported]").prop("checked", !1) : $("input[name=fontAddFontImported]").prop("checked", !0), $("#containerFontAddFile").show(), $("#containerFontAddUrl").hide()
|
||||
}));
|
||||
|
||||
|
||||
// Exemple d'utilisation : appel de la fonction à chaque saisie dans le champ texte
|
||||
$('#fontAddFontId').on('input', function () {
|
||||
cleanString();
|
||||
});
|
||||
|
||||
// Fonction pour supprimer les espaces et convertir en minuscules
|
||||
function cleanString() {
|
||||
var champTexte = $('#fontAddFontId');
|
||||
var texte = champTexte.val();
|
||||
texte = texte.replace(/\s/g, ''); // Supprimer les espaces
|
||||
texte = texte.toLowerCase(); // Convertir en minuscules
|
||||
champTexte.val(texte); // Mettre à jour le champ texte avec la nouvelle valeur
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('fontAddBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'theme/fonts',
|
||||
'href' => helper::baseUrl() . 'theme/font',
|
||||
'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/
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,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/
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="col1">
|
||||
<?php echo template::button('fontEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'theme/fonts',
|
||||
'href' => helper::baseUrl() . 'theme/font',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -44,7 +44,8 @@
|
|||
<?php echo template::text('fontEditFontId', [
|
||||
'autocomplete' => 'off',
|
||||
'label' => 'Identifiant (sans espace ni majuscule)',
|
||||
'value' => $this->getUrl(3)
|
||||
'value' => $this->getUrl(3),
|
||||
'readonly' => true
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
|
@ -66,10 +67,10 @@
|
|||
</div>
|
||||
<div class="row" id="containerfontEditFile">
|
||||
<div class="col12">
|
||||
<?php echo template::file('fontEditFile', [
|
||||
<?php echo template::text('fontEditFile', [
|
||||
'label' => 'Fichier de fonte (Format WOFF)',
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'value' => $this->getUrl(2) === 'files' ? $this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'resource']) : ''
|
||||
'value' => $this->getUrl(2) === 'files' ? $this->getData(['font', $this->getUrl(2), $this->getUrl(3), 'resource']) : '',
|
||||
'readonly' => true
|
||||
]); ?>
|
||||
</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/
|
||||
*/
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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 @@
|
|||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @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
|
||||
* @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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
|
|
@ -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/
|
||||
*/
|
||||
|
@ -132,8 +132,8 @@ class user extends common
|
|||
'accessUrl' => null,
|
||||
'accessTimer' => null,
|
||||
'accessCsrf' => null,
|
||||
'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT),
|
||||
'tags' => ''
|
||||
'language' => $this->getInput('userAddLanguage', helper::FILTER_STRING_SHORT),
|
||||
'tags' => $this->getInput('userAddTags', helper::FILTER_STRING_SHORT),
|
||||
]
|
||||
]);
|
||||
|
||||
|
@ -410,6 +410,7 @@ class user extends common
|
|||
$this->isPost()
|
||||
) {
|
||||
$userId = $this->getInput('userForgotId', helper::FILTER_ID, true);
|
||||
$sent = false;
|
||||
if ($this->getData(['user', $userId])) {
|
||||
// Enregistre la date de la demande dans le compte utilisateur
|
||||
$this->setData(['user', $userId, 'forgot', time()]);
|
||||
|
@ -653,7 +654,7 @@ class user extends common
|
|||
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
|
||||
$path = $this->getInput('profilEditPath');
|
||||
if (
|
||||
$group <= self::GROUP_ADMIN
|
||||
$group < self::GROUP_MEMBER
|
||||
&& $fileManager
|
||||
&& empty($path)
|
||||
) {
|
||||
|
@ -692,7 +693,7 @@ class user extends common
|
|||
'rename' => $this->getInput('profilEditFolderRename', helper::FILTER_BOOLEAN),
|
||||
'copycut' => $this->getInput('profilEditFolderCopycut', helper::FILTER_BOOLEAN),
|
||||
'chmod' => $this->getInput('profilEditFolderChmod', helper::FILTER_BOOLEAN),
|
||||
'path' => $path,
|
||||
'path' => preg_replace('/^\\./', '', $path), // Supprime le point pour préserver le chemin
|
||||
],
|
||||
'page' => [
|
||||
'add' => $this->getInput('profilEditPageAdd', helper::FILTER_BOOLEAN),
|
||||
|
@ -738,15 +739,9 @@ class user extends common
|
|||
}
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = $this->getSubdirectories('site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge(['site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Liste des modules installés
|
||||
|
@ -812,7 +807,7 @@ class user extends common
|
|||
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
|
||||
$path = $this->getInput('profilAddPath');
|
||||
if (
|
||||
$group <= self::GROUP_ADMIN
|
||||
$group < self::GROUP_MEMBER
|
||||
&& $fileManager
|
||||
&& empty($path)
|
||||
) {
|
||||
|
@ -847,7 +842,7 @@ class user extends common
|
|||
'rename' => $this->getInput('profilAddFolderRename', helper::FILTER_BOOLEAN),
|
||||
'copycut' => $this->getInput('profilAddFolderCopycut', helper::FILTER_BOOLEAN),
|
||||
'chmod' => $this->getInput('profilAddFolderChmod', helper::FILTER_BOOLEAN),
|
||||
'path' => $path,
|
||||
'path' => preg_replace('/^\\./', '', $path), // Supprime le point pour préserver le chemin
|
||||
],
|
||||
'page' => [
|
||||
'add' => $this->getInput('profilAddPageAdd', helper::FILTER_BOOLEAN),
|
||||
|
@ -901,15 +896,9 @@ class user extends common
|
|||
}
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = $this->getSubdirectories('site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge(['site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Liste des modules installés
|
||||
|
@ -1074,7 +1063,13 @@ class user extends common
|
|||
]);
|
||||
} else {
|
||||
$logStatus = 'Connexion réussie';
|
||||
$redirect = ($this->getUrl(2) && strpos($this->getUrl(2), 'user_reset') !== 0) ? helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $this->getUrl(2))) : helper::baseUrl();
|
||||
$pageId = $this->getUrl(2);
|
||||
if ($this->getData(['config', 'page404']) === $pageId
|
||||
|| $this->getData(['config', 'page403']) === $pageId
|
||||
) {
|
||||
$pageId = '';
|
||||
}
|
||||
$redirect = ($pageId && strpos($pageId, 'user_reset') !== 0) ? helper::baseUrl() . str_replace('_', '/', str_replace('__', '#', $pageId)) : helper::baseUrl();
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => sprintf(helper::translate('Bienvenue %s %s'), $this->getData(['user', $userId, 'firstname']), $this->getData(['user', $userId, 'lastname'])),
|
||||
|
@ -1396,7 +1391,7 @@ class user extends common
|
|||
// Ignorer les entrées de répertoire parent et actuel
|
||||
if ($file == '.' || $file == '..') {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
// Construisez le chemin complet du fichier ou du répertoire
|
||||
$path = $dir . '/' . $file;
|
||||
// Vérifiez si c'est un répertoire
|
||||
|
|
|
@ -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