Compare commits
191 Commits
Author | SHA1 | Date | |
---|---|---|---|
e0748c2eb6 | |||
5811836238 | |||
75b230b2ed | |||
47a5ddb442 | |||
d0f779bb9b | |||
568b79e854 | |||
06bbeb0d2e | |||
75bb94b9a7 | |||
dfd0f1ad2a | |||
7a4b1589af | |||
da9d8d9d62 | |||
e3bc6ce1d3 | |||
ecd0f5827a | |||
c8be7f84a4 | |||
826e6264eb | |||
cc0b6edb34 | |||
0e564a24c9 | |||
7da12be242 | |||
095e317f3b | |||
67eeef26a0 | |||
2273812b2d | |||
4842e3f62b | |||
01c69f0712 | |||
baa5b762e2 | |||
76cd034fd3 | |||
5ea3e12e26 | |||
141a22b6ff | |||
3f1d19f53e | |||
dfceb941db | |||
9db6e5ac13 | |||
12c7682a26 | |||
5d282a4cc4 | |||
a8bf3ec857 | |||
bb9573a82f | |||
15534ba9fa | |||
6aecf5e796 | |||
25f81af87b | |||
6daeb9e474 | |||
14068d24a8 | |||
c78b43f7b0 | |||
5986e8a378 | |||
dd7ee7f2ef | |||
0f1bd2377e | |||
5326b94c04 | |||
17f8fb3b58 | |||
ceca7b10b5 | |||
89c0ae5ead | |||
89be290465 | |||
3c3b122fe4 | |||
61369e7ad1 | |||
2c31e1aefc | |||
eb28a76636 | |||
86afa350fa | |||
6864132afc | |||
49ab83efd3 | |||
27d7b07239 | |||
48ee5c5e1b | |||
be87e4c740 | |||
7f6d010b9c | |||
62437c8fac | |||
2d3b999d27 | |||
72655e6673 | |||
de0749b51b | |||
3598ab2954 | |||
67d94bce61 | |||
fa158effc3 | |||
3e3781bc28 | |||
bc70f39ba5 | |||
998eb3b8a1 | |||
8fd4d2f9bc | |||
f04bc17e28 | |||
ca0561d97c | |||
2251d34122 | |||
eb832f42e5 | |||
83b4103788 | |||
1b9c65189d | |||
c2281b93ef | |||
1b3601ce87 | |||
78905834bd | |||
c270546a9b | |||
ad15e8b827 | |||
f84bcbb878 | |||
62d4d8243a | |||
3e238af50a | |||
54a0add941 | |||
d84f94817b | |||
2939545c8c | |||
c4dc05a4c1 | |||
87b763ddae | |||
c745711a2e | |||
49c8f567e6 | |||
2a1b5e2900 | |||
f2ab357654 | |||
8ad199ee3d | |||
6ddadfd8e5 | |||
cee8b784a4 | |||
f8e2dd5fab | |||
20a4cc45d7 | |||
8db6367cba | |||
090a4318b3 | |||
d17fa93bb7 | |||
f030c2f064 | |||
323cea2e0b | |||
f81fad1c49 | |||
ad3e9aba65 | |||
b035efb710 | |||
ffc373e68f | |||
e42f0bd538 | |||
b86f7fbd4a | |||
96b12bf0d4 | |||
97e50f245c | |||
9d32fa2b86 | |||
5937915d21 | |||
ca15d8f362 | |||
f097111d70 | |||
177541bef3 | |||
3f2a33a7fe | |||
cd9c62b3a3 | |||
4a2d59e4b8 | |||
c702c41fed | |||
b3e3ead5ac | |||
9bfa8280fd | |||
55b4e7335d | |||
f7c2aab390 | |||
cdab4659a6 | |||
fc69015448 | |||
9e656294a6 | |||
8e91faf2d2 | |||
36c8619b63 | |||
d77afce37b | |||
bca34949a9 | |||
07baed8713 | |||
6687c324e5 | |||
03d1dacb88 | |||
77d8296642 | |||
999370646b | |||
d8f4af660f | |||
5f146bfbdc | |||
950ba8cc9d | |||
2448e50793 | |||
5e29699563 | |||
b78fc84a89 | |||
665c8dea6d | |||
159297e421 | |||
fc502a1c64 | |||
457c8e0f66 | |||
660398bad7 | |||
fad19249db | |||
060aa9e4d5 | |||
9052247e53 | |||
df06b1f7ba | |||
8d324f9c79 | |||
f18d4eee1d | |||
fd51122918 | |||
15bd0400ea | |||
1147b5c5e1 | |||
2cbd3d5923 | |||
11753b4476 | |||
f2a6d35351 | |||
c4a23de744 | |||
a47cbe49fe | |||
5f5815cbd9 | |||
e811660d7c | |||
10083e7ee8 | |||
d89455d86a | |||
5e7c9597cd | |||
49180ab4ed | |||
c4fc466876 | |||
75203d6e8e | |||
f61c2a977a | |||
a02ce894c8 | |||
2d92bd3963 | |||
b8c0b47faf | |||
2a8563ce9a | |||
f924a2b2b3 | |||
5846c111fe | |||
f86f38d8b0 | |||
68d0aaff84 | |||
f5f04c90d9 | |||
d8525bf123 | |||
25d6192e0e | |||
90a5a8a96a | |||
69852c82bc | |||
f3ae03a133 | |||
9b5cc38c94 | |||
890cf97127 | |||
87a1f2cd18 | |||
50fc319afd | |||
a2f53e1e58 | |||
e6b9cb16b5 | |||
6f2447533c |
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ core/vendor/tinymce/link_list.json
|
|||||||
robots.txt
|
robots.txt
|
||||||
sitemap.xml
|
sitemap.xml
|
||||||
.gitignore
|
.gitignore
|
||||||
|
core/module/config/tool/data.key
|
11
.htaccess
11
.htaccess
@ -32,5 +32,16 @@ Options -Indexes
|
|||||||
Options -MultiViews
|
Options -MultiViews
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
|
||||||
|
# Enlever le slash final des URL
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteCond %{REQUEST_URI} ^(.+)/$
|
||||||
|
RewriteRule ^ %1 [R=301,L]
|
||||||
|
|
||||||
# ne pas supprimer la ligne URL rewriting !
|
# ne pas supprimer la ligne URL rewriting !
|
||||||
# URL rewriting
|
# URL rewriting
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
108
CHANGES.md
108
CHANGES.md
@ -1,4 +1,108 @@
|
|||||||
# Changelog
|
# Notes de mises à jour
|
||||||
|
|
||||||
|
## Versions 13.4.00
|
||||||
|
** Améliorations :**
|
||||||
|
- Change le mode d'authentification, le hash du mot de passe n'est plus stocké dans un cookie.
|
||||||
|
- Le sélecteur de fichier affiche le chemin d'accès du fichier présent dans le champ dans le gestionnaire de fichier.
|
||||||
|
- Slider en version 7.1, corrections diverses.
|
||||||
|
- Connexion persistante renforcée.
|
||||||
|
- Script Datatables.net filtrage des éléments, nombre d'éléments et position sur l'écran.
|
||||||
|
- Slider 7.2, le dossier sélectionné est affiché par défaut dans la page update.
|
||||||
|
- Augmente la dimension des miniatures après le transfert dans RFM.
|
||||||
|
- Search 3.3 n'effectue qu'une seule lecture du fichier module.json en prévention des bots agressifs.
|
||||||
|
- Modification du contenu de robots.txt afin de n'autoriser que les moteurs de recherche et d'interdire les bots.
|
||||||
|
- Suppression des cookies mémorisant le dernier onglet affiché dans l'édition de la page et dans la configuration du site. Cette information est désormais stockée dans la fiche de l'utilisateur connecté.
|
||||||
|
|
||||||
|
**Corrections : **
|
||||||
|
- Change les paramètres du cookie de consentement.
|
||||||
|
- Isole la session dans l'onglet actif.
|
||||||
|
- Edition de page, delete et duplicate renvoyant vers une mauvaise page.
|
||||||
|
- Supprime un warning à la création d'une page.
|
||||||
|
- Bouton de génération du site inopérant.
|
||||||
|
- Affichage intempestif des boutons de navigation de pages dans les vues des modules.
|
||||||
|
|
||||||
|
## Version 13.3.07
|
||||||
|
- Anticipe la déconnexion de la version 13.4
|
||||||
|
|
||||||
|
## Versions 13.3.06
|
||||||
|
** Corrections : **
|
||||||
|
- Corrige un bug de sécurité dans la gestion des profils.
|
||||||
|
- Répare le bouton d'effacement en mode édition d'une page.
|
||||||
|
- Corrige la feuille de style du slider les balises H1, H3 et A.
|
||||||
|
- Corrige l'absence de contenu de page lorsque le module est en position libre et que le mot clé [MODULE] n'a pas été inséré.
|
||||||
|
- Corrige l'option "Rester connecter sur ce navigateur' dont la connexion est désormais réellement persistante.
|
||||||
|
- Supprime un slash à la fin de l'URL du catalogue.
|
||||||
|
- Eviter un warning lors de la création d'une nouvelle page.
|
||||||
|
|
||||||
|
## Versions 13.3.05
|
||||||
|
** Corrections : **
|
||||||
|
- Corrige la génération des miniatures au format avif et webp.
|
||||||
|
- Corrige le filtre FLOAT du helper qui supprimait la virgule flottante.
|
||||||
|
- Corrige des bugs dans le module Slider qui passe en version 7.0, ajout d'une option d'étiquette sous les images.
|
||||||
|
|
||||||
|
** Modifications : **
|
||||||
|
- Mise à jour du module News 5.9, taille d'un bouton.
|
||||||
|
- Mise à jour du module Blog 7.10, bloque la soumission d'un commentaire vide.
|
||||||
|
- Ajoute les filtres DATE et TIME pour l'affichage correct des champs de formulaire.
|
||||||
|
|
||||||
|
## Versions 13.3.04
|
||||||
|
|
||||||
|
** Correction : **
|
||||||
|
- Mauvaise génération du descripteur d'un module lors de sa sauvegarde.
|
||||||
|
|
||||||
|
## Versions 13.3.03
|
||||||
|
|
||||||
|
** Corrections :**
|
||||||
|
- Le bug d'édition des pages avec Firefox est corrigé grâce à la suppression d'une commande forçant le chargement lassif des images dans core.js.php
|
||||||
|
- Dans la configuration, l'option Apache URL intelligente ne s'active que si le serveur est Apache et que le module Rewriter est actif. Ce qui exclut les autres serveurs non compatibles comme Nginx, Caddy etc.
|
||||||
|
- L'ajout d'un slash en fin d'adresse avec la réécriture active provoquait une mauvaise détermination des adresses des images dans TinyMCE. Résolution : une directive htaccess supprime tous les slashes en fin d'adresse.
|
||||||
|
- Lorsque la page est ouverte en édition, un clic sur le bouton édition dans la barre d'administration affiche une erreur, le lien étant incorrect. Afin d'éviter cette erreur et une redondance, le bouton d'édition est masqué lorsque la page est éditée.
|
||||||
|
- Quand des éléments inutiles sont ajoutés à l'adresse d'une page, une erreur 403 est levée.
|
||||||
|
|
||||||
|
## Versions 13.3.01 - 13.2.02
|
||||||
|
|
||||||
|
Livraison des modules blogs et news corrigeant un problème de flux RSS avec des méta vides.
|
||||||
|
|
||||||
|
## Version 13.3.00
|
||||||
|
|
||||||
|
Cette modification évite les problèmes d'édition de langues différentes dans des onglets différents du même navigateur.
|
||||||
|
|
||||||
|
## 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 configuration 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
|
## Version 13.1.05
|
||||||
|
|
||||||
@ -736,7 +840,7 @@ TinyMCE, URL absolues, transformation autorisée en URL relative si effectuée m
|
|||||||
- Modifications :
|
- Modifications :
|
||||||
- Gestion des cookies :
|
- Gestion des cookies :
|
||||||
- Options de personnalisation du message d'acceptation des cookies, acceptation ou refus du cookie Google Analytics, affichage de la page des mentions légales.
|
- Options de personnalisation du message d'acceptation des cookies, acceptation ou refus du cookie Google Analytics, affichage de la page des mentions légales.
|
||||||
- Etiquette dans le footer permettant d'afficher la popup des cookies.
|
- Étiquette dans le footer permettant d'afficher la popup des cookies.
|
||||||
- Thème :
|
- Thème :
|
||||||
- Disposition des options de configuration du site.
|
- Disposition des options de configuration du site.
|
||||||
- Bannière : le contenu peut être personnalisé à l'aide d'un éditeur. La bannière au-dessus du site peut s'étendre sur la largeur de la page.
|
- Bannière : le contenu peut être personnalisé à l'aide d'un éditeur. La bannière au-dessus du site peut s'étendre sur la largeur de la page.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# ZwiiCMS 13.1.05
|
# ZwiiCMS 13.4.00 version de test
|
||||||
|
|
||||||
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.
|
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.05
|
# ZwiiCMS 13.4.00 test version
|
||||||
|
|
||||||
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.
|
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ class helper
|
|||||||
|
|
||||||
/** Filtres personnalisés */
|
/** Filtres personnalisés */
|
||||||
const FILTER_BOOLEAN = 1;
|
const FILTER_BOOLEAN = 1;
|
||||||
const FILTER_DATETIME = 2;
|
const FILTER_DATETIME = 2; // filtre pour le champ de formulaire A conserver pour la compatibilité
|
||||||
const FILTER_FLOAT = 3;
|
const FILTER_FLOAT = 3;
|
||||||
const FILTER_ID = 4;
|
const FILTER_ID = 4;
|
||||||
const FILTER_INT = 5;
|
const FILTER_INT = 5;
|
||||||
@ -16,8 +16,14 @@ class helper
|
|||||||
const FILTER_PASSWORD = 7;
|
const FILTER_PASSWORD = 7;
|
||||||
const FILTER_STRING_LONG = 8;
|
const FILTER_STRING_LONG = 8;
|
||||||
const FILTER_STRING_SHORT = 9;
|
const FILTER_STRING_SHORT = 9;
|
||||||
const FILTER_TIMESTAMP = 10;
|
const FILTER_TIMESTAMP = 10; // Saisie d'une date en locatime
|
||||||
const FILTER_URL = 11;
|
const FILTER_URL = 11;
|
||||||
|
const FILTER_DATE = 12; // filtre pour le champ de formulaire
|
||||||
|
const FILTER_TIME = 13; // filtre pour le champ de formulair
|
||||||
|
const FILTER_MONTH = 14; // filtre pour le champ de formulair
|
||||||
|
const FILTER_YEAR = 16; // filtre pour le champ de formulair
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,12 +35,12 @@ class helper
|
|||||||
|
|
||||||
// La traduction existe déjà dans le core
|
// La traduction existe déjà dans le core
|
||||||
/*
|
/*
|
||||||
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
||||||
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
||||||
$data = array_merge($dialogues,[$text => '']);
|
$data = array_merge($dialogues,[$text => '']);
|
||||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +83,7 @@ class helper
|
|||||||
// Créer la variable
|
// Créer la variable
|
||||||
$data = array_merge($data, [$text => '']);
|
$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));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -338,13 +344,12 @@ class helper
|
|||||||
{
|
{
|
||||||
// N'interroge que le serveur Apache
|
// N'interroge que le serveur Apache
|
||||||
if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') > 0) {
|
if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') > 0) {
|
||||||
self::$rewriteStatus === false;
|
self::$rewriteStatus = false;
|
||||||
} elseif (self::$rewriteStatus === null) {
|
} else {
|
||||||
// Ouvre et scinde le fichier .htaccess
|
// Ouvre et scinde le fichier .htaccess
|
||||||
$htaccess = explode('# URL rewriting', file_get_contents('.htaccess'));
|
$htaccess = explode('# URL rewriting', file_get_contents('.htaccess'));
|
||||||
// Retourne un boolean en fonction du contenu de la partie réservée à l'URL rewriting
|
// Retourne un boolean en fonction du contenu de la partie réservée à l'URL rewriting
|
||||||
//self::$rewriteStatus = (empty($htaccess[1]) === false);
|
self::$rewriteStatus = (strpos($htaccess[1], 'RewriteEngine on') !== false);
|
||||||
self::$rewriteStatus = (strpos($htaccess[1], 'RewriteEngine on') > 0) ? true : false;
|
|
||||||
}
|
}
|
||||||
return self::$rewriteStatus;
|
return self::$rewriteStatus;
|
||||||
}
|
}
|
||||||
@ -390,10 +395,10 @@ class helper
|
|||||||
'text' => self::relativeLuminanceW3C($rgba) > .22 ? "#222" : "#DDD",
|
'text' => self::relativeLuminanceW3C($rgba) > .22 ? "#222" : "#DDD",
|
||||||
'rgb' => 'rgb(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ')',
|
'rgb' => 'rgb(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ')',
|
||||||
'invert' => 'rgba (' .
|
'invert' => 'rgba (' .
|
||||||
($rgba[0] < 128 ? 255 : 0) . ',' .
|
($rgba[0] < 128 ? 255 : 0) . ',' .
|
||||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||||
($rgba[0] < 128 ? 255 : 0) . ')'
|
($rgba[0] < 128 ? 255 : 0) . ')'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -403,8 +408,8 @@ class helper
|
|||||||
*/
|
*/
|
||||||
public static function deleteCookie($cookieKey)
|
public static function deleteCookie($cookieKey)
|
||||||
{
|
{
|
||||||
unset($_COOKIE[$cookieKey]);
|
|
||||||
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
||||||
|
unset($_COOKIE[$cookieKey]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -427,7 +432,8 @@ class helper
|
|||||||
$text = (int) $date->format('U');
|
$text = (int) $date->format('U');
|
||||||
break;
|
break;
|
||||||
case self::FILTER_FLOAT:
|
case self::FILTER_FLOAT:
|
||||||
$text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT);
|
$text = str_replace(',', '.', $text); // Remplacer les virgules par des points
|
||||||
|
$text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
|
||||||
$text = (float) $text;
|
$text = (float) $text;
|
||||||
break;
|
break;
|
||||||
case self::FILTER_ID:
|
case self::FILTER_ID:
|
||||||
@ -474,6 +480,11 @@ class helper
|
|||||||
case self::FILTER_URL:
|
case self::FILTER_URL:
|
||||||
$text = filter_var($text, FILTER_SANITIZE_URL);
|
$text = filter_var($text, FILTER_SANITIZE_URL);
|
||||||
break;
|
break;
|
||||||
|
case self::FILTER_DATE:
|
||||||
|
$text = date('Y-m-d', $text);
|
||||||
|
break;
|
||||||
|
case self::FILTER_TIME:
|
||||||
|
$text = date('H:i', $text);
|
||||||
}
|
}
|
||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,12 @@ class JsonDb extends \Prowebcraft\Dot
|
|||||||
protected $db = '';
|
protected $db = '';
|
||||||
protected $data = null;
|
protected $data = null;
|
||||||
protected $config = [];
|
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 = [])
|
public function __construct($config = [])
|
||||||
{
|
{
|
||||||
@ -121,10 +127,10 @@ class JsonDb extends \Prowebcraft\Dot
|
|||||||
} else {
|
} else {
|
||||||
if ($this->config['backup']) {
|
if ($this->config['backup']) {
|
||||||
try {
|
try {
|
||||||
//todo make backup of database
|
|
||||||
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
|
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
error_log('Erreur de chargement : ' . $e);
|
||||||
|
exit('Erreur de chargement : ' . $e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,20 +148,41 @@ class JsonDb extends \Prowebcraft\Dot
|
|||||||
*/
|
*/
|
||||||
public function save()
|
public function save()
|
||||||
{
|
{
|
||||||
$v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
// Encode les données au format JSON avec les options spécifiées
|
||||||
$l = strlen($v);
|
//$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
|
||||||
$t = 0;
|
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||||
while ($t < 5) {
|
|
||||||
$w = file_put_contents($this->db, $v); // Multi user get a locker
|
// Vérifie la longueur de la chaîne JSON encodée
|
||||||
if ($w == $l) {
|
$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;
|
break;
|
||||||
}
|
}
|
||||||
$t++;
|
|
||||||
}
|
// Incrémente le compteur de tentatives
|
||||||
if ($w !== $l) {
|
$attempt++;
|
||||||
error_log('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
|
||||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
// 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.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -82,17 +82,25 @@ class layout extends common
|
|||||||
$content = 'col' . $blocks[1];
|
$content = 'col' . $blocks[1];
|
||||||
$blockright = 'col' . $blocks[2];
|
$blockright = 'col' . $blocks[2];
|
||||||
}
|
}
|
||||||
// Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
// Toujours en pleine page pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
||||||
$pattern = ['config', 'edit', 'add', 'comment', 'data'];
|
$pattern = ['config', 'edit', 'add', 'comment', 'data', 'option', 'theme', 'comment', 'article', 'data', 'gallery', 'update', 'users', 'validate'];
|
||||||
if (
|
if (
|
||||||
(sizeof($blocks) === 1 ||
|
(sizeof($blocks) === 1 ||
|
||||||
in_array($this->getUrl(1), $pattern))
|
in_array($this->getUrl(1), $pattern))
|
||||||
) { // Pleine page en mode configuration
|
) { // Pleine page en mode configuration
|
||||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') {
|
if (
|
||||||
|
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top'
|
||||||
|
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top')
|
||||||
|
&& in_array($this->getUrl(1), $pattern) === false
|
||||||
|
) {
|
||||||
$this->showNavButtons('top');
|
$this->showNavButtons('top');
|
||||||
}
|
}
|
||||||
$this->showContent();
|
$this->showContent();
|
||||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') {
|
if (
|
||||||
|
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom'
|
||||||
|
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom')
|
||||||
|
&& in_array($this->getUrl(1), $pattern) === false
|
||||||
|
) {
|
||||||
$this->showNavButtons('bottom');
|
$this->showNavButtons('bottom');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -151,7 +159,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
}
|
}
|
||||||
echo '</main></section>';
|
echo '</section></main>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -330,7 +338,7 @@ class layout extends common
|
|||||||
// Affichage du lien de connexion
|
// Affichage du lien de connexion
|
||||||
if (
|
if (
|
||||||
($this->getData(['theme', 'footer', 'loginLink'])
|
($this->getData(['theme', 'footer', 'loginLink'])
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
)
|
)
|
||||||
or $this->getUrl(0) === 'theme'
|
or $this->getUrl(0) === 'theme'
|
||||||
) {
|
) {
|
||||||
@ -493,7 +501,7 @@ class layout extends common
|
|||||||
// Lien de connexion
|
// Lien de connexion
|
||||||
if (
|
if (
|
||||||
($this->getData(['theme', 'menu', 'loginLink'])
|
($this->getData(['theme', 'menu', 'loginLink'])
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
)
|
)
|
||||||
or $this->getUrl(0) === 'theme'
|
or $this->getUrl(0) === 'theme'
|
||||||
) {
|
) {
|
||||||
@ -580,9 +588,9 @@ class layout extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
($this->getData(['page', $parentPageId, 'disable']) === true
|
($this->getData(['page', $parentPageId, 'disable']) === true
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === true
|
||||||
and $this->getUser('group') < self::GROUP_EDITOR
|
and $this->getUser('group') < self::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -646,9 +654,9 @@ class layout extends common
|
|||||||
$items .= '<li id=' . $childKey . '>';
|
$items .= '<li id=' . $childKey . '>';
|
||||||
if (
|
if (
|
||||||
($this->getData(['page', $childKey, 'disable']) === true
|
($this->getData(['page', $childKey, 'disable']) === true
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === true
|
||||||
and $this->getUser('group') < self::GROUP_EDITOR
|
and $this->getUser('group') < self::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -742,7 +750,7 @@ class layout extends common
|
|||||||
$items .= '<li class="menuSideChild">';
|
$items .= '<li class="menuSideChild">';
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $parentPageId, 'disable']) === true
|
$this->getData(['page', $parentPageId, 'disable']) === true
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
) {
|
) {
|
||||||
$items .= '<a href="' . $this->getUrl(1) . '">';
|
$items .= '<a href="' . $this->getUrl(1) . '">';
|
||||||
} else {
|
} else {
|
||||||
@ -766,7 +774,7 @@ class layout extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $childKey, 'disable']) === true
|
$this->getData(['page', $childKey, 'disable']) === true
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
) {
|
) {
|
||||||
$itemsChildren .= '<a href="' . $this->getUrl(1) . '">';
|
$itemsChildren .= '<a href="' . $this->getUrl(1) . '">';
|
||||||
} else {
|
} else {
|
||||||
@ -902,7 +910,7 @@ class layout extends common
|
|||||||
*/
|
*/
|
||||||
public function showBar()
|
public function showBar()
|
||||||
{
|
{
|
||||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
if ($this->isConnected() === true) {
|
||||||
// Items de gauche
|
// Items de gauche
|
||||||
$leftItems = '';
|
$leftItems = '';
|
||||||
// Sélecteur de langues
|
// Sélecteur de langues
|
||||||
@ -980,7 +988,7 @@ class layout extends common
|
|||||||
// Bouton Ajouter une page
|
// Bouton Ajouter une page
|
||||||
if ($this->getUser('permission', 'page', 'add')) {
|
if ($this->getUser('permission', 'page', 'add')) {
|
||||||
$leftItems .= '<li>' . template::ico('plus', [
|
$leftItems .= '<li>' . template::ico('plus', [
|
||||||
'href' => helper::baseUrl() . 'page/add',
|
'href' => helper::baseUrl() . 'page/add/' . self::$siteContent,
|
||||||
'help' => 'Nouvelle page ou barre latérale'
|
'help' => 'Nouvelle page ou barre latérale'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
}
|
}
|
||||||
@ -990,23 +998,27 @@ class layout extends common
|
|||||||
// Sur une page sans module
|
// Sur une page sans module
|
||||||
or $this->getData(['page', $this->getUrl(0), 'moduleId']) === ''
|
or $this->getData(['page', $this->getUrl(0), 'moduleId']) === ''
|
||||||
// Sur une page avec un module invalide
|
// Sur une page avec un module invalide
|
||||||
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) &&
|
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) and
|
||||||
!class_exists($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
!class_exists($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||||
)
|
)
|
||||||
// Sur une page d'accueil
|
// Sur une page d'accueil
|
||||||
or $this->getUrl(0) === ''
|
or $this->getUrl(0) === ''
|
||||||
) {
|
) {
|
||||||
// Bouton Editer une page
|
// Bouton Editer une page
|
||||||
if ($this->getUser('permission', 'page', 'edit')) {
|
if (
|
||||||
|
$this->getUser('permission', 'page', 'edit')
|
||||||
|
and $this->geturl(1) !== 'edit'
|
||||||
|
) {
|
||||||
$leftItems .= '<li>' . template::ico('pencil', [
|
$leftItems .= '<li>' . template::ico('pencil', [
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'help' => 'Éditer la page'
|
'help' => 'Éditer la page'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
}
|
}
|
||||||
// Bouton Editer le module d'une page
|
// Bouton Editer le module d'une page
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', 'page', 'module')
|
$this->getUser('permission', 'page', 'module')
|
||||||
&& $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
and $this->geturl(1) !== 'edit'
|
||||||
|
and $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
||||||
) {
|
) {
|
||||||
$leftItems .= '<li>' . template::ico('gear', [
|
$leftItems .= '<li>' . template::ico('gear', [
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||||
@ -1016,9 +1028,10 @@ class layout extends common
|
|||||||
// Bouton dupliquer une page
|
// Bouton dupliquer une page
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', 'page', 'duplicate')
|
$this->getUser('permission', 'page', 'duplicate')
|
||||||
|
and $this->geturl(1) !== 'edit'
|
||||||
) {
|
) {
|
||||||
$leftItems .= '<li>' . template::ico('clone', [
|
$leftItems .= '<li>' . template::ico('clone', [
|
||||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'help' => 'Dupliquer la page'
|
'help' => 'Dupliquer la page'
|
||||||
])
|
])
|
||||||
. '</li>';
|
. '</li>';
|
||||||
@ -1026,9 +1039,11 @@ class layout extends common
|
|||||||
// Bouton Effacer une page
|
// Bouton Effacer une page
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', 'page', 'delete')
|
$this->getUser('permission', 'page', 'delete')
|
||||||
|
and $this->geturl(1) !== 'edit'
|
||||||
|
|
||||||
) {
|
) {
|
||||||
$leftItems .= '<li>' . template::ico('trash', [
|
$leftItems .= '<li>' . template::ico('trash', [
|
||||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'help' => 'Supprimer la page',
|
'help' => 'Supprimer la page',
|
||||||
'id' => 'pageDelete'
|
'id' => 'pageDelete'
|
||||||
])
|
])
|
||||||
@ -1056,18 +1071,14 @@ class layout extends common
|
|||||||
'help' => 'Thème',
|
'help' => 'Thème',
|
||||||
'href' => helper::baseUrl() . 'theme'
|
'href' => helper::baseUrl() . 'theme'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
$rightItems .= '<li>' . template::ico('users', [
|
||||||
'help' => 'Modules',
|
'help' => 'Utilisateurs',
|
||||||
'href' => helper::baseUrl() . 'plugin'
|
'href' => helper::baseUrl() . 'user'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
$rightItems .= '<li>' . template::ico('cog-alt', [
|
$rightItems .= '<li>' . template::ico('cog-alt', [
|
||||||
'help' => 'Configuration',
|
'help' => 'Configuration',
|
||||||
'href' => helper::baseUrl() . 'config'
|
'href' => helper::baseUrl() . 'config'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
$rightItems .= '<li>' . template::ico('users', [
|
|
||||||
'help' => 'Utilisateurs',
|
|
||||||
'href' => helper::baseUrl() . 'user'
|
|
||||||
]) . '</li>';
|
|
||||||
// Mise à jour automatique
|
// Mise à jour automatique
|
||||||
$today = mktime(0, 0, 0);
|
$today = mktime(0, 0, 0);
|
||||||
$checkUpdate = $this->getData(['core', 'lastAutoUpdate']);
|
$checkUpdate = $this->getData(['core', 'lastAutoUpdate']);
|
||||||
@ -1085,15 +1096,45 @@ class layout extends common
|
|||||||
) {
|
) {
|
||||||
$this->setData(['core', 'updateAvailable', true]);
|
$this->setData(['core', 'updateAvailable', true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Recherche de mise à jour des modules
|
||||||
|
$store = plugin::getStore();
|
||||||
|
if (is_array($store)) {
|
||||||
|
// Modules installés
|
||||||
|
$infoModules = helper::getModules();
|
||||||
|
// Clés moduleIds dans les pages
|
||||||
|
$inPages = helper::arrayColumn($this->getData(['page']), 'moduleId', 'SORT_DESC');
|
||||||
|
// Parcourir les données des modules
|
||||||
|
foreach ($store as $key => $value) {
|
||||||
|
if (empty($key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// Mise à jour d'un module
|
||||||
|
if (array_key_exists($key, $infoModules) === true) {
|
||||||
|
$this->setData(['core', 'updateModuleAvailable', true]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Afficher le bouton : Mise à jour détectée + activée
|
// Afficher le bouton : Mise à jour détectée + activée
|
||||||
if ($this->getData(['core', 'updateAvailable'])) {
|
if ($this->getData(['core', 'updateAvailable'])) {
|
||||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'install/update" data-tippy-content="Mettre à jour Zwii ' . common::ZWII_VERSION . ' vers ' . helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) . '">' . template::ico('update colorRed') . '</a></li>';
|
$rightItems .= '<li><a href="' . helper::baseUrl() . 'install/update" data-tippy-content="Mettre à jour Zwii ' . common::ZWII_VERSION . ' vers ' . helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) . '">' . template::ico('update colorRed') . '</a></li>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->getData(['core', 'updateModuleAvailable'])) {
|
||||||
|
$rightItems .= '<li>' . template::ico('puzzle colorRed', [
|
||||||
|
'help' => 'Modules',
|
||||||
|
'href' => helper::baseUrl() . 'plugin'
|
||||||
|
]) . '</li>';
|
||||||
|
} else {
|
||||||
|
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||||
|
'help' => 'Modules',
|
||||||
|
'href' => helper::baseUrl() . 'plugin'
|
||||||
|
]) . '</li>';
|
||||||
|
}
|
||||||
|
// Boutons depuis le groupe éditeur
|
||||||
if (
|
if (
|
||||||
$this->getUser('group') >= self::GROUP_EDITOR
|
$this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUser('permission', 'user', 'edit')
|
&& $this->getUser('permission', 'user', 'edit')
|
||||||
@ -1181,7 +1222,7 @@ class layout extends common
|
|||||||
$vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';';
|
$vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';';
|
||||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and $this->getUser('group') >= self::GROUP_EDITOR
|
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
) {
|
) {
|
||||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||||
@ -1230,8 +1271,8 @@ class layout extends common
|
|||||||
public function showi18n($lang)
|
public function showi18n($lang)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
(isset($_SESSION['ZWII_CONTENT'])
|
(isset($_SESSION['ZWII_SITE_CONTENT'])
|
||||||
and $_SESSION['ZWII_CONTENT'] === $lang
|
and $_SESSION['ZWII_SITE_CONTENT'] === $lang
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$select = ' class="i18nFlagSelected" ';
|
$select = ' class="i18nFlagSelected" ';
|
||||||
|
@ -11,16 +11,16 @@ class core extends common
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
// Token CSRF
|
// Token CSRF
|
||||||
if (empty($_SESSION['csrf'])) {
|
if (empty($_SESSION['csrf'])) {
|
||||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(128));
|
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(64));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fuseau horaire
|
// Fuseau horaire
|
||||||
self::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
common::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
||||||
date_default_timezone_set(self::$timezone);
|
date_default_timezone_set(common::$timezone);
|
||||||
// Supprime les fichiers temporaires
|
// Supprime les fichiers temporaires
|
||||||
$lastClearTmp = mktime(0, 0, 0);
|
$lastClearTmp = mktime(0, 0, 0);
|
||||||
if ($lastClearTmp > $this->getData(['core', 'lastClearTmp']) + 86400) {
|
if ($lastClearTmp > $this->getData(['core', 'lastClearTmp']) + 86400) {
|
||||||
$iterator = new DirectoryIterator(self::TEMP_DIR);
|
$iterator = new DirectoryIterator(common::TEMP_DIR);
|
||||||
foreach ($iterator as $fileInfos) {
|
foreach ($iterator as $fileInfos) {
|
||||||
if (
|
if (
|
||||||
$fileInfos->isFile() &&
|
$fileInfos->isFile() &&
|
||||||
@ -43,11 +43,11 @@ class core extends common
|
|||||||
and $this->getData(['user']) // Pas de backup pendant l'installation
|
and $this->getData(['user']) // Pas de backup pendant l'installation
|
||||||
) {
|
) {
|
||||||
// Copie des fichier de données
|
// Copie des fichier de données
|
||||||
helper::autoBackup(self::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
helper::autoBackup(common::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||||
// Date du dernier backup
|
// Date du dernier backup
|
||||||
$this->setData(['core', 'lastBackup', $lastBackup]);
|
$this->setData(['core', 'lastBackup', $lastBackup]);
|
||||||
// Supprime les backups de plus de 30 jours
|
// Supprime les backups de plus de 30 jours
|
||||||
$iterator = new DirectoryIterator(self::BACKUP_DIR);
|
$iterator = new DirectoryIterator(common::BACKUP_DIR);
|
||||||
foreach ($iterator as $fileInfos) {
|
foreach ($iterator as $fileInfos) {
|
||||||
if (
|
if (
|
||||||
$fileInfos->isFile()
|
$fileInfos->isFile()
|
||||||
@ -60,23 +60,23 @@ class core extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Crée le fichier de personnalisation avancée
|
// Crée le fichier de personnalisation avancée
|
||||||
if (file_exists(self::DATA_DIR . 'custom.css') === false) {
|
if (file_exists(common::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(common::DATA_DIR . 'custom.css', file_get_contents('core/module/theme/resource/custom.css'));
|
||||||
chmod(self::DATA_DIR . 'custom.css', 0755);
|
chmod(common::DATA_DIR . 'custom.css', 0755);
|
||||||
}
|
}
|
||||||
// Crée le fichier de personnalisation
|
// Crée le fichier de personnalisation
|
||||||
if (file_exists(self::DATA_DIR . 'theme.css') === false) {
|
if (file_exists(common::DATA_DIR . 'theme.css') === false) {
|
||||||
file_put_contents(self::DATA_DIR . 'theme.css', '');
|
$this->secure_file_put_contents(common::DATA_DIR . 'theme.css', '');
|
||||||
chmod(self::DATA_DIR . 'theme.css', 0755);
|
chmod(common::DATA_DIR . 'theme.css', 0755);
|
||||||
}
|
}
|
||||||
// Crée le fichier de personnalisation de l'administration
|
// Crée le fichier de personnalisation de l'administration
|
||||||
if (file_exists(self::DATA_DIR . 'admin.css') === false) {
|
if (file_exists(common::DATA_DIR . 'admin.css') === false) {
|
||||||
file_put_contents(self::DATA_DIR . 'admin.css', '');
|
$this->secure_file_put_contents(common::DATA_DIR . 'admin.css', '');
|
||||||
chmod(self::DATA_DIR . 'admin.css', 0755);
|
chmod(common::DATA_DIR . 'admin.css', 0755);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check la version rafraichissement du theme
|
// Check la version rafraichissement du theme
|
||||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'theme.css'));
|
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . 'theme.css'));
|
||||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) {
|
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) {
|
||||||
// Version
|
// Version
|
||||||
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
|
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
|
||||||
@ -92,7 +92,7 @@ class core extends common
|
|||||||
// Fonts disponibles
|
// Fonts disponibles
|
||||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||||
|
|
||||||
// Fontes installées
|
// Fontes installées
|
||||||
$fonts = [
|
$fonts = [
|
||||||
@ -273,7 +273,7 @@ class core extends common
|
|||||||
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
||||||
|
|
||||||
// Enregistre la personnalisation
|
// Enregistre la personnalisation
|
||||||
file_put_contents(self::DATA_DIR . 'theme.css', $css);
|
$this->secure_file_put_contents(common::DATA_DIR . 'theme.css', $css);
|
||||||
|
|
||||||
// Effacer le cache pour tenir compte de la couleur de fond TinyMCE
|
// Effacer le cache pour tenir compte de la couleur de fond TinyMCE
|
||||||
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
|
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
|
||||||
@ -284,7 +284,7 @@ class core extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check la version rafraichissement du theme admin
|
// Check la version rafraichissement du theme admin
|
||||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'admin.css'));
|
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . 'admin.css'));
|
||||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) {
|
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) {
|
||||||
|
|
||||||
// Version
|
// Version
|
||||||
@ -293,7 +293,7 @@ class core extends common
|
|||||||
// Fonts disponibles
|
// Fonts disponibles
|
||||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import des polices de caractères
|
* Import des polices de caractères
|
||||||
@ -367,7 +367,7 @@ class core extends common
|
|||||||
// Bordure du contour TinyMCE
|
// Bordure du contour TinyMCE
|
||||||
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
||||||
// Enregistre la personnalisation
|
// Enregistre la personnalisation
|
||||||
file_put_contents(self::DATA_DIR . 'admin.css', $css);
|
$this->secure_file_put_contents(common::DATA_DIR . 'admin.css', $css);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -383,8 +383,8 @@ class core extends common
|
|||||||
require 'core/module/' . $classPath;
|
require 'core/module/' . $classPath;
|
||||||
}
|
}
|
||||||
// Module
|
// Module
|
||||||
elseif (is_readable(self::MODULE_DIR . $classPath)) {
|
elseif (is_readable(common::MODULE_DIR . $classPath)) {
|
||||||
require self::MODULE_DIR . $classPath;
|
require common::MODULE_DIR . $classPath;
|
||||||
}
|
}
|
||||||
// Librairie
|
// Librairie
|
||||||
elseif (is_readable('core/vendor/' . $classPath)) {
|
elseif (is_readable('core/vendor/' . $classPath)) {
|
||||||
@ -415,8 +415,8 @@ class core extends common
|
|||||||
|
|
||||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and ($this->getUser('group') === self::GROUP_BANNED
|
and ($this->getUser('group') === common::GROUP_BANNED
|
||||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||||
)
|
)
|
||||||
@ -429,9 +429,9 @@ class core extends common
|
|||||||
$this->getData(['config', 'maintenance'])
|
$this->getData(['config', 'maintenance'])
|
||||||
and in_array($this->getUrl(0), ['maintenance', 'user']) === false
|
and in_array($this->getUrl(0), ['maintenance', 'user']) === false
|
||||||
and $this->getUrl(1) !== 'login'
|
and $this->getUrl(1) !== 'login'
|
||||||
and ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and ($this->isConnected() === false
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->isConnected() === true
|
||||||
and $this->getUser('group') < self::GROUP_ADMIN
|
and $this->getUser('group') < common::GROUP_ADMIN
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -444,32 +444,12 @@ class core extends common
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pour éviter une 404 sur une langue étrangère, bascule dans la langue correcte.
|
|
||||||
if (is_null($this->getData(['page', $this->getUrl(0)]))) {
|
|
||||||
foreach (self::$languages as $key => $value) {
|
|
||||||
if (
|
|
||||||
is_dir(self::DATA_DIR . $key) &&
|
|
||||||
file_exists(self::DATA_DIR . $key . '/page.json')
|
|
||||||
) {
|
|
||||||
$pagesId = json_decode(file_get_contents(self::DATA_DIR . $key . '/page.json'), true);
|
|
||||||
if (
|
|
||||||
is_array($pagesId['page']) &&
|
|
||||||
array_key_exists($this->getUrl(0), $pagesId['page'])
|
|
||||||
) {
|
|
||||||
$_SESSION['ZWII_CONTENT'] = $key;
|
|
||||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl(0));
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check l'accès à la page
|
// Check l'accès à la page
|
||||||
$access = null;
|
$access = null;
|
||||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR
|
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->isConnected() === true
|
||||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||||
// Modification qui tient compte du profil de la page
|
// Modification qui tient compte du profil de la page
|
||||||
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||||
@ -486,14 +466,22 @@ class core extends common
|
|||||||
// Empêcher l'accès aux pages désactivées par URL directe
|
// Empêcher l'accès aux pages désactivées par URL directe
|
||||||
if (
|
if (
|
||||||
($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === true
|
||||||
and $this->getUser('group') < self::GROUP_EDITOR
|
and $this->getUser('group') < common::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$access = false;
|
$access = false;
|
||||||
}
|
}
|
||||||
|
// Lève une erreur si l'url est celle d'une page avec des éléments surnuméraires https://www.site.fr/page/truc
|
||||||
|
if (
|
||||||
|
array_key_exists($this->getUrl(0), $this->getData(['page']))
|
||||||
|
and $this->getUrl(1)
|
||||||
|
and $this->getData(['page', $this->getUrl(0), 'moduleId']) === ''
|
||||||
|
) {
|
||||||
|
$access = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -515,9 +503,9 @@ class core extends common
|
|||||||
$this->getUser('id') &&
|
$this->getUser('id') &&
|
||||||
$userId !== $this->getUser('id') &&
|
$userId !== $this->getUser('id') &&
|
||||||
$this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() &&
|
$this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() &&
|
||||||
array_intersect($t, self::$concurrentAccess) &&
|
array_intersect($t, common::$concurrentAccess) &&
|
||||||
//array_intersect($t, self::$accessExclude) !== false &&
|
//array_intersect($t, common::$accessExclude) !== false &&
|
||||||
time() < $this->getData(['user', $userId, 'accessTimer']) + self::ACCESS_TIMER
|
time() < $this->getData(['user', $userId, 'accessTimer']) + common::ACCESS_TIMER
|
||||||
) {
|
) {
|
||||||
$access = false;
|
$access = false;
|
||||||
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
||||||
@ -527,7 +515,7 @@ class core extends common
|
|||||||
}
|
}
|
||||||
// Accès concurrent stocke la page visitée
|
// Accès concurrent stocke la page visitée
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
&& $this->getUser('id')
|
&& $this->getUser('id')
|
||||||
) {
|
) {
|
||||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()]);
|
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()]);
|
||||||
@ -554,10 +542,10 @@ class core extends common
|
|||||||
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
|
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
|
||||||
|
|
||||||
// Importe le contenu, le CSS et le script des barres
|
// Importe le contenu, le CSS et le script des barres
|
||||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$siteContent) : '';
|
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), common::$siteContent) : '';
|
||||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
||||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
|
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
|
||||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$siteContent) : '';
|
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), common::$siteContent) : '';
|
||||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
||||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
|
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
|
||||||
|
|
||||||
@ -575,7 +563,7 @@ class core extends common
|
|||||||
|
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'content' => $this->getPage($this->getUrl(0), self::$siteContent),
|
'content' => $this->getPage($this->getUrl(0), common::$siteContent),
|
||||||
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
||||||
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
||||||
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
||||||
@ -601,7 +589,7 @@ class core extends common
|
|||||||
: $this->getData(['page', $this->getUrl(0), 'metaDescription']);
|
: $this->getData(['page', $this->getUrl(0), 'metaDescription']);
|
||||||
|
|
||||||
// Importe le CSS de la page principale
|
// Importe le CSS de la page principale
|
||||||
$pageContent = $this->getPage($this->getUrl(0), self::$siteContent);
|
$pageContent = $this->getPage($this->getUrl(0), common::$siteContent);
|
||||||
|
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
@ -646,8 +634,8 @@ class core extends common
|
|||||||
$output = $module->output;
|
$output = $module->output;
|
||||||
// Check le groupe de l'utilisateur
|
// Check le groupe de l'utilisateur
|
||||||
if (
|
if (
|
||||||
($module::$actions[$action] === self::GROUP_VISITOR
|
($module::$actions[$action] === common::GROUP_VISITOR
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->isConnected() === true
|
||||||
and $this->getUser('group') >= $module::$actions[$action]
|
and $this->getUser('group') >= $module::$actions[$action]
|
||||||
and $this->getUser('permission', $moduleId, $action)
|
and $this->getUser('permission', $moduleId, $action)
|
||||||
)
|
)
|
||||||
@ -659,10 +647,10 @@ class core extends common
|
|||||||
foreach ($_POST as $postId => $postValue) {
|
foreach ($_POST as $postId => $postValue) {
|
||||||
if (is_array($postValue)) {
|
if (is_array($postValue)) {
|
||||||
foreach ($postValue as $subPostId => $subPostValue) {
|
foreach ($postValue as $subPostId => $subPostValue) {
|
||||||
self::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
common::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
self::$inputBefore[$postId] = $postValue;
|
common::$inputBefore[$postId] = $postValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -702,9 +690,9 @@ class core extends common
|
|||||||
// Contenu par vue
|
// Contenu par vue
|
||||||
elseif ($output['view']) {
|
elseif ($output['view']) {
|
||||||
// Chemin en fonction d'un module du coeur ou d'un module
|
// Chemin en fonction d'un module du coeur ou d'un module
|
||||||
$modulePath = in_array($moduleId, self::$coreModuleIds) ? 'core/' : '';
|
$modulePath = in_array($moduleId, common::$coreModuleIds) ? 'core/' : '';
|
||||||
// CSS
|
// CSS
|
||||||
$stylePath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
$stylePath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
||||||
if (file_exists($stylePath)) {
|
if (file_exists($stylePath)) {
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'style' => file_get_contents($stylePath)
|
'style' => file_get_contents($stylePath)
|
||||||
@ -717,7 +705,7 @@ class core extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// JS
|
// JS
|
||||||
$scriptPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
$scriptPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
||||||
if (file_exists($scriptPath)) {
|
if (file_exists($scriptPath)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
include $scriptPath;
|
include $scriptPath;
|
||||||
@ -726,7 +714,7 @@ class core extends common
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Vue
|
// Vue
|
||||||
$viewPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
$viewPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
||||||
if (file_exists($viewPath)) {
|
if (file_exists($viewPath)) {
|
||||||
ob_start();
|
ob_start();
|
||||||
include $viewPath;
|
include $viewPath;
|
||||||
@ -735,7 +723,7 @@ class core extends common
|
|||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')
|
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')
|
||||||
]);
|
]);
|
||||||
} else if ($modpos === 'free') {
|
} elseif ($modpos === 'free' && strstr($pageContent, '[MODULE]')) {
|
||||||
if (strstr($pageContent, '[MODULE]', true) === false) {
|
if (strstr($pageContent, '[MODULE]', true) === false) {
|
||||||
$begin = strstr($pageContent, '[]', true);
|
$begin = strstr($pageContent, '[]', true);
|
||||||
} else {
|
} else {
|
||||||
@ -813,6 +801,29 @@ class core extends common
|
|||||||
}
|
}
|
||||||
} elseif ($this->output['content'] === '') {
|
} elseif ($this->output['content'] === '') {
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
|
// Pour éviter une 404, bascule dans l'espace correct si la page existe dans cette langue.
|
||||||
|
// Parcourir les espaces
|
||||||
|
foreach (common::$languages as $langId => $value) {
|
||||||
|
;
|
||||||
|
if (
|
||||||
|
// l'espace existe
|
||||||
|
is_dir(common::DATA_DIR . $langId) &&
|
||||||
|
file_exists(common::DATA_DIR . $langId . '/page.json')
|
||||||
|
) {
|
||||||
|
// Lire les données des pages
|
||||||
|
$pagesId = json_decode(file_get_contents(common::DATA_DIR . $langId . '/page.json'), true);
|
||||||
|
if (
|
||||||
|
// La page existe
|
||||||
|
is_array($pagesId['page']) &&
|
||||||
|
array_key_exists($this->getUrl(0), $pagesId['page'])
|
||||||
|
) {
|
||||||
|
// Basculer
|
||||||
|
$_SESSION['ZWII_SITE_CONTENT'] = $langId;
|
||||||
|
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
$this->getData(['locale', 'page404']) !== 'none'
|
$this->getData(['locale', 'page404']) !== 'none'
|
||||||
and $this->getData(['page', $this->getData(['locale', 'page404'])])
|
and $this->getData(['page', $this->getData(['locale', 'page404'])])
|
||||||
@ -844,25 +855,25 @@ class core extends common
|
|||||||
}
|
}
|
||||||
switch ($this->output['display']) {
|
switch ($this->output['display']) {
|
||||||
// Layout brut
|
// Layout brut
|
||||||
case self::DISPLAY_RAW:
|
case common::DISPLAY_RAW:
|
||||||
echo $this->output['content'];
|
echo $this->output['content'];
|
||||||
break;
|
break;
|
||||||
// Layout vide
|
// Layout vide
|
||||||
case self::DISPLAY_LAYOUT_BLANK:
|
case common::DISPLAY_LAYOUT_BLANK:
|
||||||
require 'core/layout/blank.php';
|
require 'core/layout/blank.php';
|
||||||
break;
|
break;
|
||||||
// Affichage en JSON
|
// Affichage en JSON
|
||||||
case self::DISPLAY_JSON:
|
case common::DISPLAY_JSON:
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode($this->output['content']);
|
echo json_encode($this->output['content']);
|
||||||
break;
|
break;
|
||||||
// RSS feed
|
// RSS feed
|
||||||
case self::DISPLAY_RSS:
|
case common::DISPLAY_RSS:
|
||||||
header('Content-type: application/rss+xml; charset=UTF-8');
|
header('Content-type: application/rss+xml; charset=UTF-8');
|
||||||
echo $this->output['content'];
|
echo $this->output['content'];
|
||||||
break;
|
break;
|
||||||
// Layout allégé
|
// Layout allégé
|
||||||
case self::DISPLAY_LAYOUT_LIGHT:
|
case common::DISPLAY_LAYOUT_LIGHT:
|
||||||
ob_start();
|
ob_start();
|
||||||
require 'core/layout/light.php';
|
require 'core/layout/light.php';
|
||||||
$content = ob_get_clean();
|
$content = ob_get_clean();
|
||||||
@ -873,7 +884,7 @@ class core extends common
|
|||||||
echo $content;
|
echo $content;
|
||||||
break;
|
break;
|
||||||
// Layout principal
|
// Layout principal
|
||||||
case self::DISPLAY_LAYOUT_MAIN:
|
case common::DISPLAY_LAYOUT_MAIN:
|
||||||
ob_start();
|
ob_start();
|
||||||
require 'core/layout/main.php';
|
require 'core/layout/main.php';
|
||||||
$content = ob_get_clean();
|
$content = ob_get_clean();
|
||||||
|
@ -128,7 +128,17 @@ class SitemapGenerator
|
|||||||
*/
|
*/
|
||||||
private $sampleRobotsLines = [
|
private $sampleRobotsLines = [
|
||||||
"User-agent: *",
|
"User-agent: *",
|
||||||
|
"Disallow: /",
|
||||||
|
"User-agent: Googlebot",
|
||||||
"Allow: /",
|
"Allow: /",
|
||||||
|
"User-agent: bingbot",
|
||||||
|
"Allow: /",
|
||||||
|
"User-agent: Slurp",
|
||||||
|
"Allow: /",
|
||||||
|
"User-agent: DuckDuckBot",
|
||||||
|
"Allow: /",
|
||||||
|
"User-agent: Baiduspider",
|
||||||
|
"Allow: /"
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* @var array list of valid changefreq values according to the spec
|
* @var array list of valid changefreq values according to the spec
|
||||||
|
@ -28,7 +28,7 @@ class template
|
|||||||
$attributes['value'] = helper::translate($attributes['value']);
|
$attributes['value'] = helper::translate($attributes['value']);
|
||||||
$attributes['help'] = helper::translate($attributes['help']);
|
$attributes['help'] = helper::translate($attributes['help']);
|
||||||
// Retourne le html
|
// Retourne le html
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<a %s class="button %s %s %s" %s>%s</a>',
|
'<a %s class="button %s %s %s" %s>%s</a>',
|
||||||
helper::sprintAttributes($attributes, ['class', 'disabled', 'ico', 'value']),
|
helper::sprintAttributes($attributes, ['class', 'disabled', 'ico', 'value']),
|
||||||
$attributes['disabled'] ? 'disabled' : '',
|
$attributes['disabled'] ? 'disabled' : '',
|
||||||
@ -65,12 +65,12 @@ class template
|
|||||||
// Limite addition et soustraction selon le type de captcha
|
// Limite addition et soustraction selon le type de captcha
|
||||||
$numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20];
|
$numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20];
|
||||||
$letters = ['u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a'];
|
$letters = ['u', 't', 's', 'r', 'q', 'p', 'o', 'n', 'm', 'l', 'k', 'j', 'i', 'h', 'g', 'f', 'e', 'd', 'c', 'b', 'a'];
|
||||||
$limit = $attributes['limit'] ? count($letters) - 1 : 10;
|
$limit = $attributes['limit'] ? count($letters) - 1 : 10;
|
||||||
|
|
||||||
// Tirage de l'opération
|
// Tirage de l'opération
|
||||||
mt_srand();
|
mt_srand();
|
||||||
// Captcha simple limité à l'addition
|
// Captcha simple limité à l'addition
|
||||||
$operator = $attributes['limit'] ? mt_rand(1, 4) : 1;
|
$operator = $attributes['limit'] ? mt_rand(1, 4) : 1;
|
||||||
|
|
||||||
// Limite si multiplication ou division
|
// Limite si multiplication ou division
|
||||||
if ($operator > 2) {
|
if ($operator > 2) {
|
||||||
@ -94,15 +94,15 @@ class template
|
|||||||
switch ($operator) {
|
switch ($operator) {
|
||||||
case 1:
|
case 1:
|
||||||
$operator = template::ico('plus', ['fontSize' => '2em;']);
|
$operator = template::ico('plus', ['fontSize' => '2em;']);
|
||||||
$result = $firstNumber + $secondNumber;
|
$result = $firstNumber + $secondNumber;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$operator = template::ico('minus', ['fontSize' => '2em;']);
|
$operator = template::ico('minus', ['fontSize' => '2em;']);
|
||||||
$result = $firstNumber - $secondNumber;
|
$result = $firstNumber - $secondNumber;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$operator = template::ico('cancel', ['fontSize' => '2em;']);
|
$operator = template::ico('cancel', ['fontSize' => '2em;']);
|
||||||
$result = $firstNumber * $secondNumber;
|
$result = $firstNumber * $secondNumber;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$operator = template::ico('divide', ['fontSize' => '2em;']);
|
$operator = template::ico('divide', ['fontSize' => '2em;']);
|
||||||
@ -112,7 +112,7 @@ class template
|
|||||||
}
|
}
|
||||||
mt_srand();
|
mt_srand();
|
||||||
$secondNumber = mt_rand(1, $limit);
|
$secondNumber = mt_rand(1, $limit);
|
||||||
$firstNumber = $firstNumber * $secondNumber;
|
$firstNumber = $firstNumber * $secondNumber;
|
||||||
$result = $firstNumber / $secondNumber;
|
$result = $firstNumber / $secondNumber;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -125,8 +125,8 @@ class template
|
|||||||
$secondLetter = uniqid();
|
$secondLetter = uniqid();
|
||||||
|
|
||||||
// Masquage image source pour éviter un décodage
|
// Masquage image source pour éviter un décodage
|
||||||
copy('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$firstNumber] . '.png', 'site/tmp/' . $firstLetter . '.png');
|
copy('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$firstNumber] . '.png', 'site/tmp/' . $firstLetter . '.png');
|
||||||
copy('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.png');
|
copy('core/vendor/zwiico/png/' . $attributes['type'] . '/' . $letters[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.png');
|
||||||
|
|
||||||
|
|
||||||
// Début du wrapper
|
// Début du wrapper
|
||||||
@ -134,7 +134,7 @@ class template
|
|||||||
// Label
|
// Label
|
||||||
$html .= self::label(
|
$html .= self::label(
|
||||||
$attributes['id'],
|
$attributes['id'],
|
||||||
'<img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $firstLetter . '.png" /> <strong>' . $operator . '</strong> <img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $secondLetter . '.png" />' . template::ico('eq', ['fontSize' => '2em;']),
|
'<img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $firstLetter . '.png" /> <strong>' . $operator . '</strong> <img class="captcha' . ucFirst($attributes['type']) . '" src="' . helper::baseUrl(false) . 'site/tmp/' . $secondLetter . '.png" />' . template::ico('eq', ['fontSize' => '2em;']),
|
||||||
[
|
[
|
||||||
'help' => $attributes['help']
|
'help' => $attributes['help']
|
||||||
]
|
]
|
||||||
@ -224,7 +224,7 @@ class template
|
|||||||
* Crée un champ date
|
* Crée un champ date
|
||||||
* @param string $nameId Nom et id du champ
|
* @param string $nameId Nom et id du champ
|
||||||
* @param array $attributes Attributs ($key => $value)
|
* @param array $attributes Attributs ($key => $value)
|
||||||
* @param string type date time datetime-local month week
|
* @param string type date seule ; time heure seule ; datetime-local (jour et heure)
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function date($nameId, array $attributes = [])
|
public static function date($nameId, array $attributes = [])
|
||||||
@ -244,17 +244,32 @@ class template
|
|||||||
'placeholder' => '',
|
'placeholder' => '',
|
||||||
'readonly' => false,
|
'readonly' => false,
|
||||||
'value' => '',
|
'value' => '',
|
||||||
'type'=> 'date',
|
'type' => 'date',
|
||||||
], $attributes);
|
], $attributes);
|
||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
$attributes['label'] = helper::translate($attributes['label']);
|
$attributes['label'] = helper::translate($attributes['label']);
|
||||||
$attributes['help'] = helper::translate($attributes['help']);
|
$attributes['help'] = helper::translate($attributes['help']);
|
||||||
//$attributes['placeholder'] = helper::translate($attributes['placeholder']);
|
//$attributes['placeholder'] = helper::translate($attributes['placeholder']);
|
||||||
|
// Filtre selon le type
|
||||||
|
switch ($attributes['type']) {
|
||||||
|
case 'datetime-local':
|
||||||
|
$filter = helper::FILTER_TIMESTAMP;
|
||||||
|
break;
|
||||||
|
case 'date':
|
||||||
|
$filter = helper::FILTER_DATE; // Pour générer une valeur uniquement sur la date
|
||||||
|
break;
|
||||||
|
case 'time':
|
||||||
|
$filter = helper::FILTER_TIME; // Pour générer une valeur uniquement sur l'heure
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$filter = null; // pas de filtre pour month and year
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Sauvegarde des données en cas d'erreur
|
// Sauvegarde des données en cas d'erreur
|
||||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||||
} else {
|
} else {
|
||||||
$attributes['value'] = ($attributes['value'] ? helper::filter($attributes['value'], helper::FILTER_TIMESTAMP) : '');
|
$attributes['value'] = ($attributes['value'] ? helper::filter($attributes['value'], $filter) : '');
|
||||||
}
|
}
|
||||||
// Début du wrapper
|
// Début du wrapper
|
||||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||||
@ -310,6 +325,7 @@ class template
|
|||||||
'name' => $nameId,
|
'name' => $nameId,
|
||||||
'type' => 2,
|
'type' => 2,
|
||||||
'value' => '',
|
'value' => '',
|
||||||
|
'folder' => '',
|
||||||
'language' => 'fr_FR'
|
'language' => 'fr_FR'
|
||||||
], $attributes);
|
], $attributes);
|
||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
@ -346,14 +362,16 @@ class template
|
|||||||
$html .= sprintf(
|
$html .= sprintf(
|
||||||
'<a
|
'<a
|
||||||
href="' .
|
href="' .
|
||||||
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
||||||
'?relative_url=1' .
|
'?relative_url=1' .
|
||||||
'&lang=' . $attributes['language'] .
|
'&lang=' . $attributes['language'] .
|
||||||
'&field_id=' . $attributes['id'] .
|
'&field_id=' . $attributes['id'] .
|
||||||
'&type=' . $attributes['type'] .
|
'&type=' . $attributes['type'] .
|
||||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
// Ajoute le nom du dossier si la variable est passée
|
||||||
. '"
|
(!empty($attributes['folder']) ? '&fldr=' . $attributes['folder'] : '') .
|
||||||
|
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||||
|
. '"
|
||||||
class="inputFile %s %s"
|
class="inputFile %s %s"
|
||||||
%s
|
%s
|
||||||
data-lity
|
data-lity
|
||||||
@ -471,7 +489,7 @@ class template
|
|||||||
// Traduction de l'aide
|
// Traduction de l'aide
|
||||||
$attributes['help'] = helper::translate($attributes['help']);
|
$attributes['help'] = helper::translate($attributes['help']);
|
||||||
// Contenu de l'icône
|
// Contenu de l'icône
|
||||||
$alt = $attributes['help'] ? $attributes['help'] : $ico;
|
$alt = $attributes['help'] ? $attributes['help'] : $ico;
|
||||||
$item = $attributes['href'] ? '<a id="' . $attributes['id'] . '" data-tippy-content="' . $attributes['help'] . '" alt="' . $alt . '" href="' . $attributes['href'] . '" ' . $attributes['attr'] . ' >' : '';
|
$item = $attributes['href'] ? '<a id="' . $attributes['id'] . '" data-tippy-content="' . $attributes['help'] . '" alt="' . $alt . '" href="' . $attributes['href'] . '" ' . $attributes['attr'] . ' >' : '';
|
||||||
$item .= '<span class="zwiico-' . $ico . ($attributes['margin'] ? ' zwiico-margin-' . $attributes['margin'] : '') . ($attributes['animate'] ? ' animate-spin' : '') . '" style="font-size:' . $attributes['fontSize'] . '"><!----></span>';
|
$item .= '<span class="zwiico-' . $ico . ($attributes['margin'] ? ' zwiico-margin-' . $attributes['margin'] : '') . ($attributes['animate'] ? ' animate-spin' : '') . '" style="font-size:' . $attributes['fontSize'] . '"><!----></span>';
|
||||||
$item .= ($attributes['href']) ? '</a>' : '';
|
$item .= ($attributes['href']) ? '</a>' : '';
|
||||||
@ -494,8 +512,8 @@ class template
|
|||||||
$lang = $langId;
|
$lang = $langId;
|
||||||
break;
|
break;
|
||||||
case 'selected':
|
case 'selected':
|
||||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
if (isset($_SESSION['ZWII_SITE_CONTENT'])) {
|
||||||
$lang = $_SESSION['ZWII_CONTENT'];
|
$lang = $_SESSION['ZWII_SITE_CONTENT'];
|
||||||
} else {
|
} else {
|
||||||
$lang = 'fr_FR';
|
$lang = 'fr_FR';
|
||||||
}
|
}
|
||||||
@ -686,12 +704,12 @@ class template
|
|||||||
'label' => '',
|
'label' => '',
|
||||||
'name' => $nameId,
|
'name' => $nameId,
|
||||||
'selected' => '',
|
'selected' => '',
|
||||||
'font' => [],
|
'font' => [],
|
||||||
'multiple' => ''
|
'multiple' => ''
|
||||||
], $attributes);
|
], $attributes);
|
||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
$attributes['label'] = helper::translate($attributes['label']);
|
$attributes['label'] = helper::translate($attributes['label']);
|
||||||
$attributes['help'] = helper::translate($attributes['help']);
|
$attributes['help'] = helper::translate($attributes['help']);
|
||||||
// Stocker les fontes et remettre à zéro le tableau des fontes transmis pour éviter une erreur de sprintAttributes
|
// Stocker les fontes et remettre à zéro le tableau des fontes transmis pour éviter une erreur de sprintAttributes
|
||||||
if (empty($attributes['font']) === false) {
|
if (empty($attributes['font']) === false) {
|
||||||
$fonts = $attributes['font'];
|
$fonts = $attributes['font'];
|
||||||
@ -728,7 +746,7 @@ class template
|
|||||||
);
|
);
|
||||||
foreach ($options as $value => $text) {
|
foreach ($options as $value => $text) {
|
||||||
// Select des liste de fontes
|
// Select des liste de fontes
|
||||||
$html .= isset($fonts) ? sprintf(
|
$html .= isset($fonts) ? sprintf(
|
||||||
'<option value="%s"%s style="font-family: %s;">%s</option>',
|
'<option value="%s"%s style="font-family: %s;">%s</option>',
|
||||||
$value,
|
$value,
|
||||||
$attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string
|
$attributes['selected'] == $value ? ' selected' : '', // Double == pour ignorer le type de variable car $_POST change les types en string
|
||||||
@ -782,7 +800,7 @@ class template
|
|||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
$attributes['value'] = helper::translate($attributes['value']);
|
$attributes['value'] = helper::translate($attributes['value']);
|
||||||
// Retourne le html
|
// Retourne le html
|
||||||
return sprintf(
|
return sprintf(
|
||||||
'<button type="submit" class="%s%s" %s>%s</button>',
|
'<button type="submit" class="%s%s" %s>%s</button>',
|
||||||
$attributes['class'],
|
$attributes['class'],
|
||||||
$attributes['uniqueSubmission'] ? 'uniqueSubmission' : '',
|
$attributes['uniqueSubmission'] ? 'uniqueSubmission' : '',
|
||||||
@ -810,7 +828,7 @@ class template
|
|||||||
], $attributes);
|
], $attributes);
|
||||||
// Traduction de l'aide et de l'étiquette
|
// Traduction de l'aide et de l'étiquette
|
||||||
foreach ($head as $value) {
|
foreach ($head as $value) {
|
||||||
$head[array_search($value, $head)] = helper::translate($value);
|
$head[array_search($value, $head)] = helper::translate($value);
|
||||||
}
|
}
|
||||||
// Début du wrapper
|
// Début du wrapper
|
||||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
|
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
|
||||||
@ -905,7 +923,7 @@ class template
|
|||||||
$html .= self::notice($attributes['id'], $notice);
|
$html .= self::notice($attributes['id'], $notice);
|
||||||
// Texte
|
// Texte
|
||||||
$html .= sprintf(
|
$html .= sprintf(
|
||||||
'<input type="' . $attributes['type']. '" %s>',
|
'<input type="' . $attributes['type'] . '" %s>',
|
||||||
helper::sprintAttributes($attributes)
|
helper::sprintAttributes($attributes)
|
||||||
);
|
);
|
||||||
// Fin du wrapper
|
// Fin du wrapper
|
||||||
|
@ -216,12 +216,14 @@ core.start = function () {
|
|||||||
// Variables des cookies
|
// Variables des cookies
|
||||||
var getUrl = window.location;
|
var getUrl = window.location;
|
||||||
var domain = "domain=" + getUrl.hostname + ";";
|
var domain = "domain=" + getUrl.hostname + ";";
|
||||||
|
var basePath = getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf('/') + 1);
|
||||||
|
var path = "path=" + basePath + ";";
|
||||||
var e = new Date();
|
var e = new Date();
|
||||||
e.setFullYear(e.getFullYear() + 1);
|
e.setFullYear(e.getFullYear() + 1);
|
||||||
var expires = "expires=" + e.toUTCString();
|
var expires = "expires=" + e.toUTCString() + ";";
|
||||||
|
|
||||||
// Stocke le cookie d'acceptation
|
// Stocke le cookie d'acceptation
|
||||||
document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires;
|
document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -462,7 +464,7 @@ $(document).ready(function () {
|
|||||||
/**
|
/**
|
||||||
* Chargement paresseux des images et des iframes
|
* Chargement paresseux des images et des iframes
|
||||||
*/
|
*/
|
||||||
$("img,picture,iframe").attr("loading", "lazy");
|
$("img").attr("loading", "lazy");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Effet accordéon
|
* Effet accordéon
|
||||||
@ -532,7 +534,7 @@ $(document).ready(function () {
|
|||||||
var langSelected = $(this).val();
|
var langSelected = $(this).val();
|
||||||
var langSelected = langSelected.split("/");
|
var langSelected = langSelected.split("/");
|
||||||
// Lit le cookie de langue
|
// Lit le cookie de langue
|
||||||
var langSession = "<?php echo isset($_SESSION['ZWII_CONTENT']) ? $_SESSION['ZWII_CONTENT'] : '';?>";
|
var langSession = "<?php echo isset($_SESSION['ZWII_SITE_CONTENT']) ? $_SESSION['ZWII_SITE_CONTENT'] : '';?>";
|
||||||
// Découpe l'URL pour exclure le changement de page avec le thème
|
// Découpe l'URL pour exclure le changement de page avec le thème
|
||||||
var url = window.location;
|
var url = window.location;
|
||||||
var currentUrl = url.href.split("/");
|
var currentUrl = url.href.split("/");
|
||||||
|
199
core/core.php
199
core/core.php
@ -51,7 +51,7 @@ class common
|
|||||||
const ACCESS_TIMER = 1800;
|
const ACCESS_TIMER = 1800;
|
||||||
|
|
||||||
// Numéro de version
|
// Numéro de version
|
||||||
const ZWII_VERSION = '13.1.05';
|
const ZWII_VERSION = '13.4.00.test7';
|
||||||
|
|
||||||
// URL autoupdate
|
// URL autoupdate
|
||||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/';
|
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
|
// Valeurs possibles multiple de 10, 10 autorise 9 profils, 100 autorise 99 profils
|
||||||
const MAX_PROFILS = 10;
|
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 $actions = [];
|
||||||
public static $coreModuleIds = [
|
public static $coreModuleIds = [
|
||||||
@ -329,15 +341,15 @@ class common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Déterminer la langue du contenu du site
|
// Déterminer la langue du contenu du site
|
||||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
if (isset($_SESSION['ZWII_SITE_CONTENT'])) {
|
||||||
// Déterminé par la session présente
|
// Déterminé par la session présente
|
||||||
self::$siteContent = $_SESSION['ZWII_CONTENT'];
|
self::$siteContent = $_SESSION['ZWII_SITE_CONTENT'];
|
||||||
} else {
|
} else {
|
||||||
// Détermine la langue par défaut
|
// Détermine la langue par défaut
|
||||||
foreach (self::$languages as $key => $value) {
|
foreach (self::$languages as $key => $value) {
|
||||||
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
||||||
self::$siteContent = $key;
|
self::$siteContent = $key;
|
||||||
$_SESSION['ZWII_CONTENT'] = $key;
|
$_SESSION['ZWII_SITE_CONTENT'] = $key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -347,6 +359,7 @@ class common
|
|||||||
// Instanciation de la classe des entrées / sorties
|
// Instanciation de la classe des entrées / sorties
|
||||||
$this->jsonDB(self::$siteContent);
|
$this->jsonDB(self::$siteContent);
|
||||||
|
|
||||||
|
|
||||||
// Installation fraîche, initialisation des modules
|
// Installation fraîche, initialisation des modules
|
||||||
if ($this->user === []) {
|
if ($this->user === []) {
|
||||||
foreach ($this->dataFiles as $stageId => $item) {
|
foreach ($this->dataFiles as $stageId => $item) {
|
||||||
@ -589,9 +602,47 @@ class common
|
|||||||
public function setPage($page, $value, $lang)
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -706,65 +757,65 @@ class common
|
|||||||
* Appelée par le core uniquement
|
* Appelée par le core uniquement
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private function buildHierarchy()
|
private function buildHierarchy()
|
||||||
{
|
{
|
||||||
|
|
||||||
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
$pages = helper::arrayColumn($this->getData(['page']), 'position', 'SORT_ASC');
|
||||||
// Parents
|
// Parents
|
||||||
foreach ($pages as $pageId => $pagePosition) {
|
foreach ($pages as $pageId => $pagePosition) {
|
||||||
if (
|
if (
|
||||||
// Page parent
|
// Page parent
|
||||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->isConnected() === true
|
||||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||||
// Modification qui tient compte du profil de la page
|
// Modification qui tient compte du profil de la page
|
||||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||||
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
if ($pagePosition !== 0) {
|
if ($pagePosition !== 0) {
|
||||||
$this->hierarchy['visible'][$pageId] = [];
|
$this->hierarchy['visible'][$pageId] = [];
|
||||||
}
|
}
|
||||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||||
$this->hierarchy['bar'][$pageId] = [];
|
$this->hierarchy['bar'][$pageId] = [];
|
||||||
}
|
}
|
||||||
$this->hierarchy['all'][$pageId] = [];
|
$this->hierarchy['all'][$pageId] = [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Enfants
|
// Enfants
|
||||||
foreach ($pages as $pageId => $pagePosition) {
|
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
|
if (
|
||||||
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']))
|
// Page parent
|
||||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $this->$pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
$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->isConnected() === true
|
||||||
|
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) {
|
if ($pagePosition !== 0) {
|
||||||
$this->hierarchy['visible'][$parentId][] = $pageId;
|
$this->hierarchy['visible'][$parentId][] = $pageId;
|
||||||
}
|
}
|
||||||
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
if ($this->getData(['page', $pageId, 'block']) === 'bar') {
|
||||||
$this->hierarchy['bar'][$pageId] = [];
|
$this->hierarchy['bar'][$pageId] = [];
|
||||||
}
|
}
|
||||||
$this->hierarchy['all'][$parentId][] = $pageId;
|
$this->hierarchy['all'][$parentId][] = $pageId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Génère un fichier json avec la liste des pages
|
* Génère un fichier json avec la liste des pages
|
||||||
@ -977,6 +1028,16 @@ class common
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return bool l'utilisateur est connecté true sinon false
|
||||||
|
*/
|
||||||
|
public function isConnected() {
|
||||||
|
return (
|
||||||
|
!empty($this->getUser('authKey'))
|
||||||
|
&&
|
||||||
|
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY'));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check qu'une valeur est transmise par la méthode _POST
|
* Check qu'une valeur est transmise par la méthode _POST
|
||||||
* @return bool
|
* @return bool
|
||||||
@ -1068,8 +1129,9 @@ class common
|
|||||||
}
|
}
|
||||||
// Articles du blog
|
// Articles du blog
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog' &&
|
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog'
|
||||||
!empty($this->getData(['module', $parentPageId]))
|
&& !empty($this->getData(['module', $parentPageId]))
|
||||||
|
&& $this->getData(['module', $parentPageId, 'posts'])
|
||||||
) {
|
) {
|
||||||
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
|
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
|
||||||
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {
|
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {
|
||||||
@ -1121,7 +1183,7 @@ class common
|
|||||||
}
|
}
|
||||||
$sitemap->updateRobots();
|
$sitemap->updateRobots();
|
||||||
} else {
|
} 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
|
// Submit your sitemaps to Google, Yahoo, Bing and Ask.com
|
||||||
@ -1165,11 +1227,10 @@ class common
|
|||||||
$source_image = imagecreatefromwebp($src);
|
$source_image = imagecreatefromwebp($src);
|
||||||
break;
|
break;
|
||||||
case 'avif':
|
case 'avif':
|
||||||
$source_image = function_exists('imagecreatefromavif') ? imagecreatefromavif($src) : null;
|
$source_image = imagecreatefromavif($src);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
// Image valide
|
// Image valide
|
||||||
if ($source_image) {
|
if (is_object($source_image)) {
|
||||||
$width = imagesx($source_image);
|
$width = imagesx($source_image);
|
||||||
$height = imagesy($source_image);
|
$height = imagesy($source_image);
|
||||||
/* find the "desired height" of this thumbnail, relative to the desired width */
|
/* find the "desired height" of this thumbnail, relative to the desired width */
|
||||||
@ -1186,9 +1247,9 @@ class common
|
|||||||
return (imagepng($virtual_image, $dest));
|
return (imagepng($virtual_image, $dest));
|
||||||
case 'image/gif':
|
case 'image/gif':
|
||||||
return (imagegif($virtual_image, $dest));
|
return (imagegif($virtual_image, $dest));
|
||||||
case 'webp':
|
case 'image/webp':
|
||||||
return (imagewebp($virtual_image, $dest));
|
return (imagewebp($virtual_image, $dest));
|
||||||
case 'avif':
|
case 'image/avif':
|
||||||
return (imageavif($virtual_image, $dest));
|
return (imageavif($virtual_image, $dest));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1398,7 +1459,7 @@ class common
|
|||||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||||
$dataLog .= PHP_EOL;
|
$dataLog .= PHP_EOL;
|
||||||
if ($this->getData(['config', 'connect', 'log'])) {
|
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
|
// Créer les en-têtes du journal
|
||||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
$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
|
// Init préservation htaccess
|
||||||
$this->setData(['config', 'autoUpdateHtaccess', false]);
|
$this->setData(['config', 'autoUpdateHtaccess', false]);
|
||||||
// Options de barre de membre simple
|
// Options de barre de membre simple
|
||||||
@ -459,7 +459,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
|
|||||||
}
|
}
|
||||||
foreach ($hierarchy as $parentKey => $parent) {
|
foreach ($hierarchy as $parentKey => $parent) {
|
||||||
$content = $this->getData(['page', $parent, 'content']);
|
$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->setPage($parent, $content, 'fr');
|
||||||
$this->setData(['page', $parent, 'content', $parent . '.html']);
|
$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 = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
|
||||||
$d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
|
$d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
|
||||||
$t['locale'] = $d;
|
$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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1068,7 +1068,7 @@ if ($this->getData(['core', 'dataVersion']) < 13000) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_SESSION['ZWII_CONTENT'] = $currentlanguage;
|
$_SESSION['ZWII_SITE_CONTENT'] = $currentlanguage;
|
||||||
|
|
||||||
// Supprime la clé OpenOgraph
|
// Supprime la clé OpenOgraph
|
||||||
$this->deleteData(['config', 'seo', 'keyApi']);
|
$this->deleteData(['config', 'seo', 'keyApi']);
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
if (
|
if (
|
||||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->isConnected() === true
|
||||||
and $this->getUser('group') > self::GROUP_MEMBER
|
and $this->getUser('group') > self::GROUP_MEMBER
|
||||||
) {
|
) {
|
||||||
echo '<nav id="navfixedconnected" >';
|
echo '<nav id="navfixedconnected" >';
|
||||||
|
@ -22,7 +22,7 @@ class config extends common
|
|||||||
'copyBackups' => self::GROUP_ADMIN,
|
'copyBackups' => self::GROUP_ADMIN,
|
||||||
'delBackups' => self::GROUP_ADMIN,
|
'delBackups' => self::GROUP_ADMIN,
|
||||||
'configMetaImage' => self::GROUP_ADMIN,
|
'configMetaImage' => self::GROUP_ADMIN,
|
||||||
'siteMap' => self::GROUP_ADMIN,
|
'sitemap' => self::GROUP_ADMIN,
|
||||||
'index' => self::GROUP_ADMIN,
|
'index' => self::GROUP_ADMIN,
|
||||||
'restore' => self::GROUP_ADMIN,
|
'restore' => self::GROUP_ADMIN,
|
||||||
'updateBaseUrl' => self::GROUP_ADMIN,
|
'updateBaseUrl' => self::GROUP_ADMIN,
|
||||||
@ -30,7 +30,8 @@ class config extends common
|
|||||||
'logReset' => self::GROUP_ADMIN,
|
'logReset' => self::GROUP_ADMIN,
|
||||||
'logDownload' => self::GROUP_ADMIN,
|
'logDownload' => self::GROUP_ADMIN,
|
||||||
'blacklistReset' => self::GROUP_ADMIN,
|
'blacklistReset' => self::GROUP_ADMIN,
|
||||||
'blacklistDownload' => self::GROUP_ADMIN
|
'blacklistDownload' => self::GROUP_ADMIN,
|
||||||
|
'register' => self::GROUP_ADMIN,
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $timezones = [
|
public static $timezones = [
|
||||||
@ -211,7 +212,7 @@ class config extends common
|
|||||||
* Sitemap compressé et non compressé
|
* Sitemap compressé et non compressé
|
||||||
* Robots.txt
|
* Robots.txt
|
||||||
*/
|
*/
|
||||||
public function siteMap()
|
public function sitemap()
|
||||||
{
|
{
|
||||||
// La page n'existe pas
|
// La page n'existe pas
|
||||||
if (
|
if (
|
||||||
@ -523,7 +524,7 @@ class config extends common
|
|||||||
) {
|
) {
|
||||||
// Ajout des lignes dans le .htaccess
|
// Ajout des lignes dans le .htaccess
|
||||||
$fileContent = file_get_contents('.htaccess');
|
$fileContent = file_get_contents('.htaccess');
|
||||||
$rewriteData = PHP_EOL .
|
$rewriteData =
|
||||||
'# URL rewriting' . PHP_EOL .
|
'# URL rewriting' . PHP_EOL .
|
||||||
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
||||||
"\tRewriteEngine on" . PHP_EOL .
|
"\tRewriteEngine on" . PHP_EOL .
|
||||||
@ -532,9 +533,9 @@ class config extends common
|
|||||||
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
||||||
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
||||||
'</IfModule>' . PHP_EOL .
|
'</IfModule>' . PHP_EOL .
|
||||||
'# URL rewriting' . PHP_EOL;
|
'# URL rewriting';
|
||||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||||
file_put_contents(
|
$this->secure_file_put_contents(
|
||||||
'.htaccess',
|
'.htaccess',
|
||||||
$fileContent
|
$fileContent
|
||||||
);
|
);
|
||||||
@ -550,7 +551,7 @@ class config extends common
|
|||||||
$fileContent = file_get_contents('.htaccess');
|
$fileContent = file_get_contents('.htaccess');
|
||||||
$fileContent = explode('# URL rewriting', $fileContent);
|
$fileContent = explode('# URL rewriting', $fileContent);
|
||||||
$fileContent = $fileContent[0] . '# URL rewriting' . $fileContent[2];
|
$fileContent = $fileContent[0] . '# URL rewriting' . $fileContent[2];
|
||||||
file_put_contents(
|
$this->secure_file_put_contents(
|
||||||
'.htaccess',
|
'.htaccess',
|
||||||
$fileContent
|
$fileContent
|
||||||
);
|
);
|
||||||
@ -654,10 +655,10 @@ class config extends common
|
|||||||
) {
|
) {
|
||||||
// Ecrire les fichiers de script
|
// Ecrire les fichiers de script
|
||||||
if ($this->geturl(2) === 'head') {
|
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') {
|
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
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -699,7 +700,7 @@ class config extends common
|
|||||||
unlink(self::DATA_DIR . 'journal.log');
|
unlink(self::DATA_DIR . 'journal.log');
|
||||||
// Créer les en-têtes des journaux
|
// Créer les en-têtes des journaux
|
||||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
$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
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Configuration'),
|
'title' => helper::translate('Configuration'),
|
||||||
@ -775,7 +776,7 @@ class config extends common
|
|||||||
ob_start();
|
ob_start();
|
||||||
$fileName = self::TEMP_DIR . 'blacklist.log';
|
$fileName = self::TEMP_DIR . 'blacklist.log';
|
||||||
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
|
$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)) {
|
if (file_exists($fileName)) {
|
||||||
$d = $this->getData(['blacklist']);
|
$d = $this->getData(['blacklist']);
|
||||||
$data = '';
|
$data = '';
|
||||||
@ -783,7 +784,7 @@ class config extends common
|
|||||||
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$i18nUI) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nUI);
|
$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;
|
$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-Description: File Transfer');
|
||||||
header('Content-Type: application/octet-stream');
|
header('Content-Type: application/octet-stream');
|
||||||
header('Content-Transfer-Encoding: binary');
|
header('Content-Transfer-Encoding: binary');
|
||||||
@ -902,4 +903,41 @@ class config extends common
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fonction pour vérifier la présence du module de réécriture
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isModRewriteEnabled()
|
||||||
|
{
|
||||||
|
// Check if Apache and mod_rewrite is loaded
|
||||||
|
if (function_exists('apache_get_modules')) {
|
||||||
|
$modules = apache_get_modules();
|
||||||
|
return in_array('mod_rewrite', $modules);
|
||||||
|
} else {
|
||||||
|
// Fallback if not using Apache or unable to detect modules
|
||||||
|
return getenv('HTTP_MOD_REWRITE') == 'On' || getenv('REDIRECT_STATUS') == '200';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite
|
||||||
|
* @return never
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
$this->setData([
|
||||||
|
'user',
|
||||||
|
$this->getUser('id'),
|
||||||
|
'view',
|
||||||
|
[
|
||||||
|
'config' => $this->getUrl(2),
|
||||||
|
'page' => $this->getData(['user', $this->getUser('id'), 'view', 'page']),
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'redirect' => helper::baseUrl() . 'config/' . $this->getUrl(2),
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
4
core/module/config/tool/.htaccess
Normal file
4
core/module/config/tool/.htaccess
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<Files "data.key">
|
||||||
|
Order Allow,Deny
|
||||||
|
Deny from all
|
||||||
|
</Files>
|
47
core/module/config/tool/autobackup.php
Normal file
47
core/module/config/tool/autobackup.php
Normal file
@ -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);
|
||||||
|
}
|
49
core/module/config/tool/cleanautobackup.php
Normal file
49
core/module/config/tool/cleanautobackup.php
Normal file
@ -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);
|
||||||
|
}
|
@ -66,11 +66,11 @@ $(document).ready(function () {
|
|||||||
$("#connectCaptchaStrong").prop("checked", false);
|
$("#connectCaptchaStrong").prop("checked", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
var configLayout = getCookie("configLayout");
|
var configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||||
if (configLayout == null) {
|
// Non défini, valeur par défaut
|
||||||
|
if (configLayout == "") {
|
||||||
configLayout = "setup";
|
configLayout = "setup";
|
||||||
setCookie("configLayout", "setup");
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$("#socialContainer").hide();
|
$("#socialContainer").hide();
|
||||||
$("#connectContainer").hide();
|
$("#connectContainer").hide();
|
||||||
@ -166,7 +166,6 @@ $(document).ready(function () {
|
|||||||
$("#configSocialButton").removeClass("activeButton");
|
$("#configSocialButton").removeClass("activeButton");
|
||||||
$("#configConnectButton").removeClass("activeButton");
|
$("#configConnectButton").removeClass("activeButton");
|
||||||
$("#configNetworkButton").removeClass("activeButton");
|
$("#configNetworkButton").removeClass("activeButton");
|
||||||
setCookie("configLayout", "setup");
|
|
||||||
});
|
});
|
||||||
$("#configSocialButton").on("click", function () {
|
$("#configSocialButton").on("click", function () {
|
||||||
$("#connectContainer").hide();
|
$("#connectContainer").hide();
|
||||||
@ -177,7 +176,6 @@ $(document).ready(function () {
|
|||||||
$("#configSocialButton").addClass("activeButton");
|
$("#configSocialButton").addClass("activeButton");
|
||||||
$("#configConnectButton").removeClass("activeButton");
|
$("#configConnectButton").removeClass("activeButton");
|
||||||
$("#configNetworkButton").removeClass("activeButton");
|
$("#configNetworkButton").removeClass("activeButton");
|
||||||
setCookie("configLayout", "social");
|
|
||||||
});
|
});
|
||||||
$("#configConnectButton").on("click", function () {
|
$("#configConnectButton").on("click", function () {
|
||||||
$("#setupContainer").hide();
|
$("#setupContainer").hide();
|
||||||
@ -188,7 +186,6 @@ $(document).ready(function () {
|
|||||||
$("#configSocialButton").removeClass("activeButton");
|
$("#configSocialButton").removeClass("activeButton");
|
||||||
$("#configConnectButton").addClass("activeButton");
|
$("#configConnectButton").addClass("activeButton");
|
||||||
$("#configNetworkButton").removeClass("activeButton");
|
$("#configNetworkButton").removeClass("activeButton");
|
||||||
setCookie("configLayout", "connect");
|
|
||||||
});
|
});
|
||||||
$("#configNetworkButton").on("click", function () {
|
$("#configNetworkButton").on("click", function () {
|
||||||
$("#setupContainer").hide();
|
$("#setupContainer").hide();
|
||||||
@ -199,7 +196,6 @@ $(document).ready(function () {
|
|||||||
$("#configSocialButton").removeClass("activeButton");
|
$("#configSocialButton").removeClass("activeButton");
|
||||||
$("#configConnectButton").removeClass("activeButton");
|
$("#configConnectButton").removeClass("activeButton");
|
||||||
$("#configNetworkButton").addClass("activeButton");
|
$("#configNetworkButton").addClass("activeButton");
|
||||||
setCookie("configLayout", "network");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +261,6 @@ $(document).ready(function () {
|
|||||||
$('span#screenWeight').each(function(index){
|
$('span#screenWeight').each(function(index){
|
||||||
var weight = parseFloat($(this).text());
|
var weight = parseFloat($(this).text());
|
||||||
var fileType = $('span#screenType').eq(index).text();
|
var fileType = $('span#screenType').eq(index).text();
|
||||||
console.log(weight);
|
|
||||||
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
|
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
|
||||||
$(this).css("color", "green");
|
$(this).css("color", "green");
|
||||||
} else {
|
} else {
|
||||||
@ -286,28 +281,6 @@ console.log(weight);
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function setCookie(name, value, days) {
|
|
||||||
var expires = "";
|
|
||||||
if (days) {
|
|
||||||
var date = new Date();
|
|
||||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
||||||
expires = "; expires=" + date.toUTCString();
|
|
||||||
}
|
|
||||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCookie(name) {
|
|
||||||
var nameEQ = name + "=";
|
|
||||||
var ca = document.cookie.split(';');
|
|
||||||
for (var i = 0; i < ca.length; i++) {
|
|
||||||
var c = ca[i];
|
|
||||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
||||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define function to capitalize the first letter of a string
|
// Define function to capitalize the first letter of a string
|
||||||
function capitalizeFirstLetter(string) {
|
function capitalizeFirstLetter(string) {
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
|
@ -7,15 +7,6 @@
|
|||||||
'value' => template::ico('home')
|
'value' => template::ico('home')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
|
||||||
<?php /**echo template::button('configHelp', [
|
|
||||||
'class' => 'buttonHelp',
|
|
||||||
'href' => 'https://doc.zwiicms.fr/configuration-du-site',
|
|
||||||
'target' => '_blank',
|
|
||||||
'value' => template::ico('help'),
|
|
||||||
'help' => 'Consulter l\'aide en ligne'
|
|
||||||
]); */?>
|
|
||||||
</div>
|
|
||||||
<div class="col2 offset6">
|
<div class="col2 offset6">
|
||||||
<?php echo template::button('configLocaleButton', [
|
<?php echo template::button('configLocaleButton', [
|
||||||
'value' => 'Identité',
|
'value' => 'Identité',
|
||||||
@ -30,20 +21,24 @@
|
|||||||
<div class="tab">
|
<div class="tab">
|
||||||
<?php echo template::button('configSetupButton', [
|
<?php echo template::button('configSetupButton', [
|
||||||
'value' => 'Configuration',
|
'value' => 'Configuration',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'config/register/setup'
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('configSocialButton', [
|
<?php echo template::button('configSocialButton', [
|
||||||
'value' => 'Référencement',
|
'value' => 'Référencement',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'config/register/social'
|
||||||
]); ?>
|
]); ?>
|
||||||
|
|
||||||
<?php echo template::button('configConnectButton', [
|
<?php echo template::button('configConnectButton', [
|
||||||
'value' => 'Connexion',
|
'value' => 'Connexion',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'config/register/connect'
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('configNetworkButton', [
|
<?php echo template::button('configNetworkButton', [
|
||||||
'value' => 'Réseau',
|
'value' => 'Réseau',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'config/register/network'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2 offset8">
|
<div class="col2 offset9">
|
||||||
<?php echo template::submit('configManageSubmit', [
|
<?php echo template::submit('configManageSubmit', [
|
||||||
'value' => 'Valider',
|
'value' => 'Valider',
|
||||||
'ico' => 'check'
|
'ico' => 'check'
|
||||||
|
@ -3,12 +3,6 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Paramètres'); ?>
|
<h4><?php echo helper::translate('Paramètres'); ?>
|
||||||
<!--<span id="setupHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/parametres" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
|
||||||
?>
|
|
||||||
</a>-->
|
|
||||||
</span>
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -17,7 +11,8 @@
|
|||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||||
'label' => 'Favicon',
|
'label' => 'Favicon',
|
||||||
'value' => $this->getData(['config', 'favicon'])
|
'value' => $this->getData(['config', 'favicon']),
|
||||||
|
'folder' => $this->getData(['config', 'favicon']) ? dirname($this->getData(['config', 'favicon'])) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -26,7 +21,8 @@
|
|||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||||
'label' => 'Favicon thème sombre',
|
'label' => 'Favicon thème sombre',
|
||||||
'value' => $this->getData(['config', 'faviconDark'])
|
'value' => $this->getData(['config', 'faviconDark']),
|
||||||
|
'folder' => $this->getData(['config', 'faviconDark']) ? dirname($this->getData(['config', 'faviconDark'])) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -47,8 +43,8 @@
|
|||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
||||||
'checked' => helper::checkRewrite(),
|
'checked' => helper::checkRewrite(),
|
||||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'nginx')
|
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'Apache') === false and $module->isModRewriteEnabled()
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -59,12 +55,6 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Mise à jour automatisée'); ?>
|
<h4><?php echo helper::translate('Mise à jour automatisée'); ?>
|
||||||
<!--<span id="updateHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/mise-a-jour" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
|
||||||
?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -90,8 +80,8 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3 offset1 verticalAlignBottom">
|
<div class="col3 offset1 verticalAlignBottom">
|
||||||
<pre>Version installée : <strong><?php echo common::ZWII_VERSION ; ?></strong></pre>
|
<pre>Version installée : <strong><?php echo common::ZWII_VERSION; ?></strong></pre>
|
||||||
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) ; ?></strong></pre>
|
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL); ?></strong></pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3 offset2 verticalAlignBottom">
|
<div class="col3 offset2 verticalAlignBottom">
|
||||||
<?php echo template::button('configUpdateForced', [
|
<?php echo template::button('configUpdateForced', [
|
||||||
@ -109,12 +99,6 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Maintenance'); ?>
|
<h4><?php echo helper::translate('Maintenance'); ?>
|
||||||
<!--<span id="maintenanceHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/mode-maintenance" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
|
||||||
?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -169,12 +153,6 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Scripts externes'); ?>
|
<h4><?php echo helper::translate('Scripts externes'); ?>
|
||||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/scripts-externes" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
|
||||||
?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4 offset1 verticalAlignBottom">
|
<div class="col4 offset1 verticalAlignBottom">
|
||||||
@ -198,13 +176,21 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a
|
||||||
|
href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row textAlignCenter">
|
<div class="row textAlignCenter">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img
|
||||||
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0 International.</a></p>
|
alt="Licence Creative Commons" style="border-width:0"
|
||||||
<p>Pour voir une copie de cette licence, visitez http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.</p>
|
src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
||||||
|
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license"
|
||||||
|
href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons
|
||||||
|
Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0
|
||||||
|
International.</a></p>
|
||||||
|
<p>Pour voir une copie de cette licence, visitez
|
||||||
|
http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box
|
||||||
|
1866, Mountain View, CA 94042, USA.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,11 +4,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Capture d\'écran Open Graph'); ?>
|
<?php echo helper::translate('Capture d\'écran Open Graph'); ?>
|
||||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -18,29 +13,30 @@
|
|||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'label' => 'Image Open Graph',
|
'label' => 'Image Open Graph',
|
||||||
'value' => $this->getData(['config', 'seo', 'openGraphImage']),
|
'value' => $this->getData(['config', 'seo', 'openGraphImage']),
|
||||||
|
'folder' => $this->getData(['config', 'seo', 'openGraphImage']) ? dirname($this->getData(['config', 'seo', 'openGraphImage'])) : '',
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
||||||
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
||||||
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
||||||
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col10 textAlignCenter">
|
<div class="col10 textAlignCenter">
|
||||||
<?php if( !empty($module::$imageOpenGraph['type']) ): ?>
|
<?php if( !empty($module::$imageOpenGraph['type']) ): ?>
|
||||||
<p>
|
<p>
|
||||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), $module::$imageOpenGraph['wide'], $module::$imageOpenGraph['height'] ); ?>
|
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), $module::$imageOpenGraph['wide'], $module::$imageOpenGraph['height'] ); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>' , helper::translate('Ratio'), round($module::$imageOpenGraph['ratio'], 2)); ?>
|
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>' , helper::translate('Ratio'), round($module::$imageOpenGraph['ratio'], 2)); ?>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -84,12 +80,6 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Réseaux sociaux'); ?>
|
|
||||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/reseaux-sociaux" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
|
@ -119,24 +119,24 @@ class install extends common
|
|||||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||||
self::$i18nUI = array_key_exists(self::$i18nUI, self::$languages) ? self::$i18nUI : 'fr_FR';
|
self::$i18nUI = array_key_exists(self::$i18nUI, self::$languages) ? self::$i18nUI : 'fr_FR';
|
||||||
// par défaut le contenu est la langue d'installation
|
// par défaut le contenu est la langue d'installation
|
||||||
$_SESSION['ZWII_CONTENT'] = self::$i18nUI;
|
$_SESSION['ZWII_SITE_CONTENT'] = self::$i18nUI;
|
||||||
|
|
||||||
// Création du dossier de langue avec le marqueur de langue par défaut
|
// Création du dossier de langue avec le marqueur de langue par défaut
|
||||||
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_CONTENT'])) {
|
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT'])) {
|
||||||
mkdir(self::DATA_DIR . $_SESSION['ZWII_CONTENT']);
|
mkdir(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT']);
|
||||||
touch(self::DATA_DIR . $_SESSION['ZWII_CONTENT'] . '/.default');
|
touch(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT'] . '/.default');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Installation du site de test
|
// Installation du site de test
|
||||||
if (
|
if (
|
||||||
$this->getInput('installDefaultData', helper::FILTER_BOOLEAN) === false
|
$this->getInput('installDefaultData', helper::FILTER_BOOLEAN) === false
|
||||||
&& $_SESSION['ZWII_CONTENT'] === 'fr_FR'
|
&& $_SESSION['ZWII_SITE_CONTENT'] === 'fr_FR'
|
||||||
) {
|
) {
|
||||||
$sample = true;
|
$sample = true;
|
||||||
}
|
}
|
||||||
$this->initData('page', $_SESSION['ZWII_CONTENT'], $sample);
|
$this->initData('page', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||||
$this->initData('module', $_SESSION['ZWII_CONTENT'], $sample);
|
$this->initData('module', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||||
$this->initData('locale', $_SESSION['ZWII_CONTENT'], $sample);
|
$this->initData('locale', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||||
|
|
||||||
// Création de l'utilisateur si les données sont complétées.
|
// Création de l'utilisateur si les données sont complétées.
|
||||||
// success retour de l'enregistrement des données
|
// success retour de l'enregistrement des données
|
||||||
@ -153,7 +153,7 @@ class install extends common
|
|||||||
'signature' => 1,
|
'signature' => 1,
|
||||||
'mail' => $userMail,
|
'mail' => $userMail,
|
||||||
'password' => $this->getInput('installPassword', helper::FILTER_PASSWORD, true),
|
'password' => $this->getInput('installPassword', helper::FILTER_PASSWORD, true),
|
||||||
'language' => $_SESSION['ZWII_CONTENT']
|
'language' => $_SESSION['ZWII_SITE_CONTENT']
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ class install extends common
|
|||||||
|
|
||||||
// Nettoyage fr par défaut
|
// Nettoyage fr par défaut
|
||||||
if (
|
if (
|
||||||
$_SESSION['ZWII_CONTENT'] !== 'fr_FR'
|
$_SESSION['ZWII_SITE_CONTENT'] !== 'fr_FR'
|
||||||
) {
|
) {
|
||||||
if (is_dir(self::DATA_DIR . 'fr_FR'))
|
if (is_dir(self::DATA_DIR . 'fr_FR'))
|
||||||
$this->deleteDir(self::DATA_DIR . 'fr_FR');
|
$this->deleteDir(self::DATA_DIR . 'fr_FR');
|
||||||
@ -284,7 +284,7 @@ class install extends common
|
|||||||
'display' => self::DISPLAY_JSON,
|
'display' => self::DISPLAY_JSON,
|
||||||
'content' => [
|
'content' => [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'data' => $success ? null : json_encode($message, JSON_UNESCAPED_UNICODE)
|
'data' => $message
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
@ -292,7 +292,7 @@ class install extends common
|
|||||||
case 2:
|
case 2:
|
||||||
$success = true;
|
$success = true;
|
||||||
$message = '';
|
$message = '';
|
||||||
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
$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 = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.md5');
|
||||||
$md5origin = explode(' ', $md5origin);
|
$md5origin = explode(' ', $md5origin);
|
||||||
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
||||||
@ -317,7 +317,7 @@ class install extends common
|
|||||||
'display' => self::DISPLAY_JSON,
|
'display' => self::DISPLAY_JSON,
|
||||||
'content' => [
|
'content' => [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
'data' => $message
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
@ -360,7 +360,7 @@ class install extends common
|
|||||||
'display' => self::DISPLAY_JSON,
|
'display' => self::DISPLAY_JSON,
|
||||||
'content' => [
|
'content' => [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
'data' => $message,
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
@ -401,7 +401,7 @@ class install extends common
|
|||||||
'</IfModule>' . PHP_EOL .
|
'</IfModule>' . PHP_EOL .
|
||||||
'# URL rewriting' . PHP_EOL;
|
'# URL rewriting' . PHP_EOL;
|
||||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||||
$success = file_put_contents(
|
$success = $this->secure_file_put_contents(
|
||||||
'.htaccess',
|
'.htaccess',
|
||||||
$fileContent
|
$fileContent
|
||||||
);
|
);
|
||||||
@ -432,12 +432,13 @@ class install extends common
|
|||||||
if (!empty($message)) {
|
if (!empty($message)) {
|
||||||
$this->saveLog($message);
|
$this->saveLog($message);
|
||||||
}
|
}
|
||||||
|
die($message);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'display' => self::DISPLAY_JSON,
|
'display' => self::DISPLAY_JSON,
|
||||||
'content' => [
|
'content' => [
|
||||||
'success' => $success,
|
'success' => $success,
|
||||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
'data' => $message
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
function step(i, data) {
|
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'); ?>"];
|
var errors = [
|
||||||
$(".installUpdateProgressText").hide(), $(".installUpdateProgressText[data-id=" + i + "]").show();
|
"<?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");
|
$("body").css("cursor", "wait");
|
||||||
|
|
||||||
@ -12,7 +18,7 @@ function step(i, data) {
|
|||||||
data: data
|
data: data
|
||||||
},
|
},
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
setTimeout((function () {
|
setTimeout(function () {
|
||||||
if (4 === i) {
|
if (4 === i) {
|
||||||
$("#installUpdateSuccess").show();
|
$("#installUpdateSuccess").show();
|
||||||
$("body").css("cursor", "default");
|
$("body").css("cursor", "default");
|
||||||
@ -21,15 +27,21 @@ function step(i, data) {
|
|||||||
} else {
|
} else {
|
||||||
step(i + 1, result.data);
|
step(i + 1, result.data);
|
||||||
}
|
}
|
||||||
}), 2e3)
|
}, 2000);
|
||||||
},
|
},
|
||||||
error: function (xhr) {
|
error: function (xhr) {
|
||||||
// Balance tout dans la console
|
|
||||||
console.log(i);
|
console.log(i);
|
||||||
console.log(xhr.responseText);
|
console.log(xhr.responseText);
|
||||||
console.log(errors);
|
console.log(errors);
|
||||||
// Appel de la fonction de gestion d'erreur
|
|
||||||
showError(i, xhr.responseText, errors);
|
// Vérification du code d'erreur HTTP pour gérer la déconnexion
|
||||||
|
if (xhr.status === 401) {
|
||||||
|
alert("Votre session a expiré. Veuillez vous reconnecter.");
|
||||||
|
window.location.href = "/login"; // Redirige vers la page de connexion
|
||||||
|
} else {
|
||||||
|
// Appel de la fonction de gestion d'erreur
|
||||||
|
showError(i, xhr.responseText, errors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -47,23 +59,33 @@ function showError(step, message, errors) {
|
|||||||
// Trouver la position du premier "{" pour repérer le début du tableau
|
// Trouver la position du premier "{" pour repérer le début du tableau
|
||||||
const startOfArray = message.indexOf('{');
|
const startOfArray = message.indexOf('{');
|
||||||
|
|
||||||
// Extraire le message du warning jusqu'au début du tableau
|
if (startOfArray !== -1 && startOfArray > 0) {
|
||||||
const warningMessage = message.substring(0, startOfArray).trim();
|
// Extraire le message du warning jusqu'au début du tableau
|
||||||
|
const warningMessage = message.substring(0, startOfArray).trim();
|
||||||
|
|
||||||
// Extraire le tableau JSON entre les accolades
|
// Extraire le tableau JSON entre les accolades
|
||||||
const jsonString = message.substring(startOfArray);
|
const jsonString = message.substring(startOfArray);
|
||||||
const jsonData = JSON.parse(jsonString);
|
|
||||||
|
|
||||||
// Afficher les résultats
|
try {
|
||||||
if (jsonData) {
|
const jsonData = JSON.parse(jsonString);
|
||||||
$("#installUpdateErrorMessage").html("<strong>Détails de l'erreur :</strong><br> " +
|
|
||||||
jsonData.data.replace(/^"(.*)"$/, '$1') +
|
// Afficher les résultats si le parsing JSON est réussi
|
||||||
"<br>" +
|
if (jsonData) {
|
||||||
warningMessage.replace(/<[^p].*?>/g, ""));
|
$("#installUpdateErrorMessage").html("<strong>Détails de l'erreur :</strong><br> " +
|
||||||
|
jsonData.data.replace(/^"(.*)"$/, '$1') +
|
||||||
|
"<br>" +
|
||||||
|
warningMessage.replace(/<[^p].*?>/g, ""));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Afficher un message générique en cas d'erreur de parsing
|
||||||
|
console.error("Erreur de parsing JSON : ", e);
|
||||||
|
$("#installUpdateErrorMessage").html("Une erreur inattendue est survenue lors du traitement des détails de l'erreur.");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Si pas de JSON détecté, afficher le message brut
|
||||||
|
$("#installUpdateErrorMessage").html("Message d'erreur : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Vous pouvez également faire quelque chose d'autre ici, par exemple, afficher un message à l'utilisateur, etc.
|
|
||||||
$("#installUpdateErrorMessage").html(message);
|
$("#installUpdateErrorMessage").html(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ class language extends common
|
|||||||
is_array($descripteur['language'][$lang])
|
is_array($descripteur['language'][$lang])
|
||||||
) {
|
) {
|
||||||
if ($this->setData(['language', $lang, $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;
|
$success = is_int($success) ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ class language extends common
|
|||||||
) {
|
) {
|
||||||
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
||||||
$messageLocale = helper::translate('Langue par défaut');
|
$messageLocale = helper::translate('Langue par défaut');
|
||||||
} elseif (isset($_SESSION['ZWII_CONTENT']) && $_SESSION['ZWII_CONTENT'] === $key) {
|
} elseif (isset($_SESSION['ZWII_SITE_CONTENT']) && $_SESSION['ZWII_SITE_CONTENT'] === $key) {
|
||||||
$messageLocale = helper::translate('Langue du site sélectionnée');
|
$messageLocale = helper::translate('Langue du site sélectionnée');
|
||||||
} else {
|
} else {
|
||||||
$messageLocale = '';
|
$messageLocale = '';
|
||||||
@ -430,7 +430,7 @@ class language extends common
|
|||||||
$this->setData(['locale', $data['locale']]);
|
$this->setData(['locale', $data['locale']]);
|
||||||
} else {
|
} else {
|
||||||
// Sauver sur le disque
|
// 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
|
// Valeurs en sortie
|
||||||
@ -512,7 +512,7 @@ class language extends common
|
|||||||
$data[$key] = $target;
|
$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
|
// Mettre à jour le descripteur
|
||||||
$this->setData([
|
$this->setData([
|
||||||
@ -546,7 +546,7 @@ class language extends common
|
|||||||
$data[$key] = '';
|
$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
|
// Tableau des chaines à traduire dans la langue sélectionnée
|
||||||
foreach ($data as $key => $value) {
|
foreach ($data as $key => $value) {
|
||||||
@ -700,7 +700,7 @@ class language extends common
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
// Stocker la sélection
|
// Stocker la sélection
|
||||||
$_SESSION['ZWII_CONTENT'] = $lang;
|
$_SESSION['ZWII_SITE_CONTENT'] = $lang;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Étiquettes des pages spéciales'); ?>
|
<h4><?php echo helper::translate('Étiquettes des pages spéciales'); ?>
|
||||||
<!--<span id="labelHelpButton" class="helpDisplayButton" title="Cliquer pour consulter l'aide en ligne">
|
<!--<span id="labelHelpButton" class="helpDisplayButton" title="Cliquer pour consulter l'aide en ligne">
|
||||||
<a href="https://doc.zwiicms.fr/etiquettes-des-pages-speciales" target="_blank">
|
<a href="https://doc.zwiicms.fr/Étiquettes-des-pages-speciales" target="_blank">
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||||
</a>
|
</a>
|
||||||
</span>-->
|
</span>-->
|
||||||
|
@ -23,7 +23,8 @@ class page extends common
|
|||||||
'edit' => self::GROUP_EDITOR,
|
'edit' => self::GROUP_EDITOR,
|
||||||
'duplicate' => self::GROUP_EDITOR,
|
'duplicate' => self::GROUP_EDITOR,
|
||||||
'jsEditor' => self::GROUP_EDITOR,
|
'jsEditor' => self::GROUP_EDITOR,
|
||||||
'cssEditor' => self::GROUP_EDITOR
|
'cssEditor' => self::GROUP_EDITOR,
|
||||||
|
'register' => self::GROUP_EDITOR,
|
||||||
];
|
];
|
||||||
public static $pagesNoParentId = [
|
public static $pagesNoParentId = [
|
||||||
'' => 'Aucune'
|
'' => 'Aucune'
|
||||||
@ -85,8 +86,19 @@ class page extends common
|
|||||||
*/
|
*/
|
||||||
public function duplicate()
|
public function duplicate()
|
||||||
{
|
{
|
||||||
|
// La session ne correspond pas au site ouvert dans cet onglet
|
||||||
|
if (
|
||||||
|
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||||
|
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||||
|
) {
|
||||||
|
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||||
|
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// Adresse sans le token
|
// Adresse sans le token
|
||||||
$page = $this->getUrl(2);
|
$page = $this->getUrl(2);
|
||||||
|
|
||||||
// La page n'existe pas
|
// La page n'existe pas
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||||
@ -118,7 +130,7 @@ class page extends common
|
|||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId,
|
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId . '/' . self::$siteContent,
|
||||||
'notification' => $notification,
|
'notification' => $notification,
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
@ -131,6 +143,16 @@ class page extends common
|
|||||||
*/
|
*/
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
|
// La session ne correspond pas au site ouvert dans cet onglet
|
||||||
|
if (
|
||||||
|
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||||
|
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||||
|
) {
|
||||||
|
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||||
|
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
|
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -177,11 +199,11 @@ class page extends common
|
|||||||
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
||||||
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
|
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);
|
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$siteContent);
|
||||||
|
|
||||||
// Met à jour le sitemap
|
// Ne met à jour le sitemap pour éviter un warning, de toute manière la nouvelle page doit être éditée.
|
||||||
$this->updateSitemap();
|
// $this->updateSitemap();
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -198,6 +220,16 @@ class page extends common
|
|||||||
*/
|
*/
|
||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
|
// La session ne correspond pas au site ouvert dans cet onglet
|
||||||
|
if (
|
||||||
|
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||||
|
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||||
|
) {
|
||||||
|
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||||
|
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// $url prend l'adresse sans le token
|
// $url prend l'adresse sans le token
|
||||||
$page = $this->getUrl(2);
|
$page = $this->getUrl(2);
|
||||||
// La page n'existe pas
|
// La page n'existe pas
|
||||||
@ -262,7 +294,7 @@ class page extends common
|
|||||||
elseif ($this->getHierarchy($page, null)) {
|
elseif ($this->getHierarchy($page, null)) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . 'page/edit/' . $page,
|
'redirect' => helper::baseUrl() . 'page/edit/' . $page . '/' . self::$siteContent,
|
||||||
'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants')
|
'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -302,6 +334,17 @@ class page extends common
|
|||||||
*/
|
*/
|
||||||
public function edit()
|
public function edit()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// La session ne correspond pas au site ouvert dans cet onglet
|
||||||
|
if (
|
||||||
|
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||||
|
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||||
|
) {
|
||||||
|
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||||
|
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
// La page n'existe pas
|
// La page n'existe pas
|
||||||
if (
|
if (
|
||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||||
@ -610,7 +653,7 @@ class page extends common
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => helper::translate('Modifications enregistrées'),
|
'notification' => helper::translate('Modifications enregistrées'),
|
||||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -645,7 +688,7 @@ class page extends common
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => helper::translate('Modifications enregistrées'),
|
'notification' => helper::translate('Modifications enregistrées'),
|
||||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -661,16 +704,36 @@ class page extends common
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne les informations sur les pages en omettant les clés CSS et JS qui occasionnent des bugs d'affichage dans l'éditeur de page
|
* Retourne les informations sur les pages en omettant les clés CSS et JS qui occasionnent des bugs d'affichage dans l'éditeur de page
|
||||||
* @return array tableau associatif des pages dans le menu
|
* @return string tableau associatif des pages dans le menu
|
||||||
*/
|
*/
|
||||||
public function getPageInfo()
|
public function getPageInfo()
|
||||||
{
|
{
|
||||||
$p = $this->getData(['page']);
|
$p = $this->getData(['page']);
|
||||||
$d = array_map(function ($d) {
|
$d = array_map(function ($d) {
|
||||||
unset($d["css"], $d["js"]);
|
unset ($d["css"], $d["js"]);
|
||||||
return $d;
|
return $d;
|
||||||
}, $p);
|
}, $p);
|
||||||
return json_encode($d);
|
return json_encode($d);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stocke la variable dans les paramètres de l'utilisateur pour activer la tab à sa prochaine visite
|
||||||
|
* @return never
|
||||||
|
*/
|
||||||
|
public function register(): void
|
||||||
|
{
|
||||||
|
$this->setData([
|
||||||
|
'user',
|
||||||
|
$this->getUser('id'),
|
||||||
|
'view',
|
||||||
|
[
|
||||||
|
'page' => $this->getUrl(2),
|
||||||
|
'config' => $this->getData(['user', $this->getUser('id'), 'view', 'config']),
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
// Valeurs en sortie
|
||||||
|
$this->addOutput([
|
||||||
|
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(3) . '/' . self::$siteContent,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('pageCssEditorBack', [
|
<?php echo template::button('pageCssEditorBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
/**
|
/**
|
||||||
* Confirmation de suppression
|
* Confirmation de suppression
|
||||||
*/
|
*/
|
||||||
$("#pageEditDelete").on("click", function() {
|
$("#pageEditDelete").on("click", function() {
|
||||||
var _this = $(this);
|
var _this = $(this);
|
||||||
var message_delete = "<?php echo helper::translate('Confirmer la suppression de la page'); ?>";
|
var message_delete = "<?php echo helper::translate('Confirmer la suppression de la page'); ?>";
|
||||||
return core.confirm(message_delete, function() {
|
return core.confirm(message_delete, function() {
|
||||||
@ -67,16 +67,19 @@ $( document ).ready(function() {
|
|||||||
/**
|
/**
|
||||||
* Sélection des onglets
|
* Sélection des onglets
|
||||||
*/
|
*/
|
||||||
var pageLayout = getCookie("pageLayout");
|
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
|
||||||
if (pageLayout == null) {
|
console.log(pageLayout);
|
||||||
|
// Non défini, valeur par défaut
|
||||||
|
if (pageLayout == "") {
|
||||||
pageLayout = "content";
|
pageLayout = "content";
|
||||||
setCookie("pageLayout", "content");
|
|
||||||
}
|
}
|
||||||
|
// Tout cacher
|
||||||
$("#pageEditContentContainer").hide();
|
$("#pageEditContentContainer").hide();
|
||||||
$("#pageEditExtensionContainer").hide();
|
$("#pageEditExtensionContainer").hide();
|
||||||
$("#pageEditPositionContainer").hide();
|
$("#pageEditPositionContainer").hide();
|
||||||
$("#pageEditLayoutContainer").hide();
|
$("#pageEditLayoutContainer").hide();
|
||||||
$("#pageEditPermissionContainer").hide();
|
$("#pageEditPermissionContainer").hide();
|
||||||
|
// Afficher la bonne tab
|
||||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
|
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
|
||||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
|
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
|
||||||
|
|
||||||
@ -295,7 +298,6 @@ $( document ).ready(function() {
|
|||||||
$("#PageEditPositionButton").removeClass("activeButton");
|
$("#PageEditPositionButton").removeClass("activeButton");
|
||||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||||
setCookie("pageLayout", "content");
|
|
||||||
});
|
});
|
||||||
$("#pageEditExtensionButton").on("click", function () {
|
$("#pageEditExtensionButton").on("click", function () {
|
||||||
$("#pageEditContentContainer").hide();
|
$("#pageEditContentContainer").hide();
|
||||||
@ -308,7 +310,6 @@ $( document ).ready(function() {
|
|||||||
$("#PageEditPositionButton").removeClass("activeButton");
|
$("#PageEditPositionButton").removeClass("activeButton");
|
||||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||||
setCookie("pageLayout", "extension");
|
|
||||||
});
|
});
|
||||||
$("#PageEditPositionButton").on("click", function () {
|
$("#PageEditPositionButton").on("click", function () {
|
||||||
$("#pageEditContentContainer").hide();
|
$("#pageEditContentContainer").hide();
|
||||||
@ -321,7 +322,6 @@ $( document ).ready(function() {
|
|||||||
$("#PageEditPositionButton").addClass("activeButton");
|
$("#PageEditPositionButton").addClass("activeButton");
|
||||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||||
setCookie("pageLayout", "position");
|
|
||||||
});
|
});
|
||||||
$("#pageEditLayoutButton").on("click", function () {
|
$("#pageEditLayoutButton").on("click", function () {
|
||||||
$("#pageEditContentContainer").hide();
|
$("#pageEditContentContainer").hide();
|
||||||
@ -334,7 +334,6 @@ $( document ).ready(function() {
|
|||||||
$("#PageEditPositionButton").removeClass("activeButton");
|
$("#PageEditPositionButton").removeClass("activeButton");
|
||||||
$("#pageEditLayoutButton").addClass("activeButton");
|
$("#pageEditLayoutButton").addClass("activeButton");
|
||||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||||
setCookie("pageLayout", "layout");
|
|
||||||
});
|
});
|
||||||
$("#pageEditPermissionButton").on("click", function () {
|
$("#pageEditPermissionButton").on("click", function () {
|
||||||
$("#pageEditContentContainer").hide();
|
$("#pageEditContentContainer").hide();
|
||||||
@ -347,7 +346,6 @@ $( document ).ready(function() {
|
|||||||
$("#pageEditPositionButton").removeClass("activeButton");
|
$("#pageEditPositionButton").removeClass("activeButton");
|
||||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||||
$("#pageEditPermissionButton").addClass("activeButton");
|
$("#pageEditPermissionButton").addClass("activeButton");
|
||||||
setCookie("pageLayout", "permission");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -722,30 +720,6 @@ function buildPagesList(extraPosition) {
|
|||||||
positionDOM.val(positionSelected);
|
positionDOM.val(positionSelected);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Cookies
|
|
||||||
*/
|
|
||||||
function setCookie(name, value, days) {
|
|
||||||
var expires = "";
|
|
||||||
if (days) {
|
|
||||||
var date = new Date();
|
|
||||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
|
||||||
expires = "; expires=" + date.toUTCString();
|
|
||||||
}
|
|
||||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCookie(name) {
|
|
||||||
var nameEQ = name + "=";
|
|
||||||
var ca = document.cookie.split(';');
|
|
||||||
for (var i = 0; i < ca.length; i++) {
|
|
||||||
var c = ca[i];
|
|
||||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
|
||||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define function to capitalize the first letter of a string
|
// Define function to capitalize the first letter of a string
|
||||||
function capitalizeFirstLetter(string) {
|
function capitalizeFirstLetter(string) {
|
||||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||||
|
@ -7,26 +7,17 @@
|
|||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col1 offset7">
|
||||||
<?php /**echo template::button('pageEditHelp', [
|
|
||||||
'href' => 'https://doc.zwiicms.fr/edition-des-pages',
|
|
||||||
'target' => '_blank',
|
|
||||||
'value' => template::ico('help'),
|
|
||||||
'class' => 'buttonHelp',
|
|
||||||
'help' => 'Consulter l\'aide en ligne'
|
|
||||||
]); */?>
|
|
||||||
</div>
|
|
||||||
<div class="col1 offset6">
|
|
||||||
<?php echo template::button('pageEditDelete', [
|
<?php echo template::button('pageEditDelete', [
|
||||||
'class' => 'buttonRed',
|
'class' => 'buttonRed',
|
||||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2),
|
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('trash'),
|
'value' => template::ico('trash'),
|
||||||
'help' => 'Effacer la page'
|
'help' => 'Effacer la page'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('pageEditDuplicate', [
|
<?php echo template::button('pageEditDuplicate', [
|
||||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2),
|
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('clone'),
|
'value' => template::ico('clone'),
|
||||||
'help' => 'Dupliquer la page'
|
'help' => 'Dupliquer la page'
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -37,27 +28,31 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab">
|
<div class="tab">
|
||||||
<?php echo template::button('pageEditContentButton', [
|
<?php echo template::button('pageEditContentButton', [
|
||||||
'value' => 'Contenu',
|
'value' => 'Contenu',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('PageEditPositionButton', [
|
<?php echo template::button('pageEditPositionButton', [
|
||||||
'value' => 'Menu',
|
'value' => 'Menu',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('pageEditExtensionButton', [
|
<?php echo template::button('pageEditExtensionButton', [
|
||||||
'value' => 'Extension',
|
'value' => 'Extension',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('pageEditLayoutButton', [
|
<?php echo template::button('pageEditLayoutButton', [
|
||||||
'value' => 'Mise en page',
|
'value' => 'Mise en page',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php echo template::button('pageEditPermissionButton', [
|
<?php echo template::button('pageEditPermissionButton', [
|
||||||
'value' => 'Permission',
|
'value' => 'Permission',
|
||||||
'class' => 'buttonTab'
|
'class' => 'buttonTab',
|
||||||
|
'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -67,11 +62,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Titres'); ?>
|
<?php echo helper::translate('Titres'); ?>
|
||||||
<!--<span id="infoHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/informations-generales" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col8">
|
<div class="col8">
|
||||||
@ -120,11 +110,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Emplacement dans le menu'); ?>
|
<?php echo helper::translate('Emplacement dans le menu'); ?>
|
||||||
<!--<span id="positionHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="blockContainer">
|
<div class="blockContainer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -176,11 +161,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Options avancées'); ?>
|
<?php echo helper::translate('Options avancées'); ?>
|
||||||
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="blockContainer">
|
<div class="blockContainer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -195,7 +175,8 @@
|
|||||||
'help' => 'Sélectionnez une image ou une icône de petite dimension',
|
'help' => 'Sélectionnez une image ou une icône de petite dimension',
|
||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'label' => 'Icône',
|
'label' => 'Icône',
|
||||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
|
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl']),
|
||||||
|
'folder' => $this->getData(['page', $this->getUrl(2), 'iconUrl']) ? dirname($this->getData(['page', $this->getUrl(2), 'iconUrl'])) : '',
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -292,11 +273,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Mise en page'); ?>
|
<?php echo helper::translate('Mise en page'); ?>
|
||||||
<!--<span id="layoutHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/mise-en-page-2" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="blockContainer">
|
<div class="blockContainer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -372,11 +348,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4>
|
<h4>
|
||||||
<?php echo helper::translate('Permission et référencement'); ?>
|
<?php echo helper::translate('Permission et référencement'); ?>
|
||||||
<!--<span id="seoHelpButton" class="helpDisplayButton">
|
|
||||||
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
|
||||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
|
||||||
</a>
|
|
||||||
</span>-->
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="blockContainer">
|
<div class="blockContainer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -424,5 +395,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('pageJsEditorBack', [
|
<?php echo template::button('pageJsEditorBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +22,7 @@ class plugin extends common
|
|||||||
'delete' => self::GROUP_ADMIN,
|
'delete' => self::GROUP_ADMIN,
|
||||||
'save' => self::GROUP_ADMIN,
|
'save' => self::GROUP_ADMIN,
|
||||||
'store' => self::GROUP_ADMIN,
|
'store' => self::GROUP_ADMIN,
|
||||||
'item' => self::GROUP_ADMIN,
|
//'item' => self::GROUP_ADMIN,
|
||||||
// détail d'un objet
|
// détail d'un objet
|
||||||
'upload' => self::GROUP_ADMIN,
|
'upload' => self::GROUP_ADMIN,
|
||||||
// Téléverser catalogue
|
// Téléverser catalogue
|
||||||
@ -314,7 +314,7 @@ class plugin extends common
|
|||||||
mkdir(self::FILE_DIR . 'source/modules', 0755);
|
mkdir(self::FILE_DIR . 'source/modules', 0755);
|
||||||
}
|
}
|
||||||
// Sauver les données du fichiers
|
// 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
|
// Installation directe
|
||||||
if (file_exists(self::FILE_DIR . 'source/modules/' . $moduleFile)) {
|
if (file_exists(self::FILE_DIR . 'source/modules/' . $moduleFile)) {
|
||||||
@ -330,6 +330,7 @@ class plugin extends common
|
|||||||
'state' => $r['success']
|
'state' => $r['success']
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Catalogue de modules'),
|
'title' => helper::translate('Catalogue de modules'),
|
||||||
@ -411,6 +412,15 @@ class plugin extends common
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retourne le contenu du store en ligne
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function getStore() {
|
||||||
|
$store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true);
|
||||||
|
return $store;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gestion des modules
|
* Gestion des modules
|
||||||
*/
|
*/
|
||||||
@ -556,6 +566,9 @@ class plugin extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Désactive l'icône rouge
|
||||||
|
$this->setData(['core', 'updateModuleAvailable', false]);
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'title' => helper::translate('Gestion des modules'),
|
'title' => helper::translate('Gestion des modules'),
|
||||||
|
@ -304,7 +304,7 @@ class theme extends common
|
|||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
// Enregistre le CSS
|
// 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
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => helper::translate('Modifications enregistrées'),
|
'notification' => helper::translate('Modifications enregistrées'),
|
||||||
@ -1290,7 +1290,7 @@ class theme extends common
|
|||||||
}
|
}
|
||||||
// Sauvegarder la chaîne modifiée
|
// Sauvegarder la chaîne modifiée
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
file_put_contents($file, $data);
|
$this->secure_file_put_contents($file, $data);
|
||||||
}
|
}
|
||||||
// Retourner le nombre d'occurrences
|
// Retourner le nombre d'occurrences
|
||||||
return ($count);
|
return ($count);
|
||||||
@ -1396,8 +1396,8 @@ class theme extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Enregistre la personnalisation
|
// 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
|
// 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,15 +7,7 @@
|
|||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col2 offset9">
|
||||||
<?php /* echo template::button('themeBodyHelp', [
|
|
||||||
'href' => 'https://doc.zwiicms.fr/arriere-plan',
|
|
||||||
'target' => '_blank',
|
|
||||||
'value' => template::ico('help'),
|
|
||||||
'class' => 'buttonHelp'
|
|
||||||
]); */ ?>
|
|
||||||
</div>
|
|
||||||
<div class="col2 offset8">
|
|
||||||
<?php echo template::submit('themeBodySubmit'); ?>
|
<?php echo template::submit('themeBodySubmit'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -35,7 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::text('themeBodyToTopColor', [
|
<?php echo template::text('themeBodyToTopColor', [
|
||||||
'class' => 'colorPicker',
|
'class' => 'colorPicker',
|
||||||
'help' => 'Le curseur horizontal règle le niveau de transparence.',
|
'help' => 'Le curseur horizontal règle le niveau de transparence.',
|
||||||
'label' => 'Couleur icône haut de page',
|
'label' => 'Couleur icône haut de page',
|
||||||
@ -68,7 +60,8 @@
|
|||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'label' => 'Arrière plan',
|
'label' => 'Arrière plan',
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'value' => $imageFile
|
'value' => $imageFile,
|
||||||
|
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -19,6 +19,8 @@ $('#dataTables').DataTable({
|
|||||||
url: "core/vendor/datatables/french.json",
|
url: "core/vendor/datatables/french.json",
|
||||||
},
|
},
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
|
stateSave: true,
|
||||||
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||||
"columnDefs": [{
|
"columnDefs": [{
|
||||||
target: 5,
|
target: 5,
|
||||||
orderable: false,
|
orderable: false,
|
||||||
|
@ -7,15 +7,7 @@
|
|||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col2 offset9">
|
||||||
<?php /* echo template::button('themeHeaderHelp', [
|
|
||||||
'href' => 'https://doc.zwiicms.fr/banniere',
|
|
||||||
'target' => '_blank',
|
|
||||||
'value' => template::ico('help'),
|
|
||||||
'class' => 'buttonHelp'
|
|
||||||
]); */?>
|
|
||||||
</div>
|
|
||||||
<div class="col2 offset8">
|
|
||||||
<?php echo template::submit('themeHeaderSubmit'); ?>
|
<?php echo template::submit('themeHeaderSubmit'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -158,13 +150,17 @@
|
|||||||
'label' => 'Image',
|
'label' => 'Image',
|
||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'value' => $imageFile
|
'value' => $imageFile,
|
||||||
|
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
<span class="themeHeaderImageOptions displayNone" id="themeHeaderImageInfo">
|
<span class="themeHeaderImageOptions displayNone" id="themeHeaderImageInfo">
|
||||||
<?php echo helper::translate('Largeur de l\'image'); ?> <span id="themeHeaderImageWidth"></span> ; <?php echo helper::translate('Largeur du site :'); ?> <?php echo $this->getData(['theme', 'site', 'width']); ?>
|
<?php echo helper::translate('Largeur de l\'image'); ?> <span id="themeHeaderImageWidth"></span>
|
||||||
|
; <?php echo helper::translate('Largeur du site :'); ?>
|
||||||
|
<?php echo $this->getData(['theme', 'site', 'width']); ?>
|
||||||
|
|
|
|
||||||
<?php echo helper::translate('Hauteur de l\'image'); ?> <span id="themeHeaderImageHeight"></span>
|
<?php echo helper::translate('Hauteur de l\'image'); ?> <span
|
||||||
|
id="themeHeaderImageHeight"></span>
|
||||||
|
|
|
|
||||||
<?php echo helper::translate('Ratio'); ?> <span id="themeHeaderImageRatio"></span>
|
<?php echo helper::translate('Ratio'); ?> <span id="themeHeaderImageRatio"></span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -7,22 +7,15 @@
|
|||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col1">
|
<div class="col2 offset9">
|
||||||
<?php /* echo template::button('themeMenuHelp', [
|
|
||||||
'href' => 'https://doc.zwiicms.fr/menu',
|
|
||||||
'target' => '_blank',
|
|
||||||
'value' => template::ico('help'),
|
|
||||||
'class' => 'buttonHelp'
|
|
||||||
]); */?>
|
|
||||||
</div>
|
|
||||||
<div class="col2 offset8">
|
|
||||||
<?php echo template::submit('themeMenuSubmit'); ?>
|
<?php echo template::submit('themeMenuSubmit'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Paramètres'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Paramètres'); ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
@ -84,7 +77,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Contenu'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Contenu'); ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
@ -112,7 +106,8 @@
|
|||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'label' => 'Logo du menu burger',
|
'label' => 'Logo du menu burger',
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'value' => $imageFile
|
'value' => $imageFile,
|
||||||
|
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -123,7 +118,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Couleurs'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Couleurs'); ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -164,7 +160,7 @@
|
|||||||
<?php
|
<?php
|
||||||
echo template::checkbox('themeMenuActiveColorAuto', true, 'Couleur de fond automatique', [
|
echo template::checkbox('themeMenuActiveColorAuto', true, 'Couleur de fond automatique', [
|
||||||
'checked' => $this->getData(['theme', 'menu', 'activeColorAuto']),
|
'checked' => $this->getData(['theme', 'menu', 'activeColorAuto']),
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::text('themeMenuActiveColor', [
|
<?php echo template::text('themeMenuActiveColor', [
|
||||||
@ -181,7 +177,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Mise en forme du texte'); ?>
|
<h4>
|
||||||
|
<?php echo helper::translate('Mise en forme du texte'); ?>
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col3">
|
<div class="col3">
|
||||||
|
@ -133,7 +133,7 @@ class user extends common
|
|||||||
'accessTimer' => null,
|
'accessTimer' => null,
|
||||||
'accessCsrf' => null,
|
'accessCsrf' => null,
|
||||||
'language' => $this->getInput('userAddLanguage', helper::FILTER_STRING_SHORT),
|
'language' => $this->getInput('userAddLanguage', helper::FILTER_STRING_SHORT),
|
||||||
'tags' => ''
|
'tags' => $this->getInput('userAddTags', helper::FILTER_STRING_SHORT),
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -345,6 +345,7 @@ class user extends common
|
|||||||
'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN),
|
'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN),
|
||||||
'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT),
|
'language' => $this->getInput('userEditLanguage', helper::FILTER_STRING_SHORT),
|
||||||
'tags' => $this->getInput('userEditTags', helper::FILTER_STRING_SHORT),
|
'tags' => $this->getInput('userEditTags', helper::FILTER_STRING_SHORT),
|
||||||
|
'authKey' => $this->getData(['user', $this->getUrl(2), 'authKey']),
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Redirection spécifique si l'utilisateur change son mot de passe
|
// Redirection spécifique si l'utilisateur change son mot de passe
|
||||||
@ -574,7 +575,7 @@ class user extends common
|
|||||||
// Stoppe si le profil est affecté
|
// Stoppe si le profil est affecté
|
||||||
foreach ($groups as $userId) {
|
foreach ($groups as $userId) {
|
||||||
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
||||||
$profilUsed= false;
|
$profilUsed = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($this->getData(['profil']) as $groupId => $groupData) {
|
foreach ($this->getData(['profil']) as $groupId => $groupData) {
|
||||||
@ -739,9 +740,9 @@ class user extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Chemin vers les dossiers du gestionnaire de fichier
|
// 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_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);
|
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||||
|
|
||||||
// Liste des modules installés
|
// Liste des modules installés
|
||||||
@ -896,9 +897,9 @@ class user extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Chemin vers les dossiers du gestionnaire de fichier
|
// 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_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);
|
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||||
|
|
||||||
// Liste des modules installés
|
// Liste des modules installés
|
||||||
@ -935,11 +936,11 @@ class user extends common
|
|||||||
// recherche les membres du groupe
|
// recherche les membres du groupe
|
||||||
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||||
$groups = array_keys($groups, $this->getUrl(2));
|
$groups = array_keys($groups, $this->getUrl(2));
|
||||||
$flag= true;
|
$flag = true;
|
||||||
// Stoppe si le profil est affecté
|
// Stoppe si le profil est affecté
|
||||||
foreach ($groups as $userId) {
|
foreach ($groups as $userId) {
|
||||||
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
||||||
$flag= false;
|
$flag = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@ -1045,10 +1046,32 @@ class user extends common
|
|||||||
// RAZ
|
// RAZ
|
||||||
$this->setData(['user', $userId, 'connectFail', 0]);
|
$this->setData(['user', $userId, 'connectFail', 0]);
|
||||||
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
||||||
// Expiration
|
|
||||||
|
// Clé d'authenfication
|
||||||
|
$authKey = uniqid('', true) . bin2hex(random_bytes(8));
|
||||||
|
$this->setData(['user', $userId, 'authKey', $authKey]);
|
||||||
|
|
||||||
|
// Validité du cookie
|
||||||
$expire = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? strtotime("+1 year") : 0;
|
$expire = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? strtotime("+1 year") : 0;
|
||||||
setcookie('ZWII_USER_ID', $userId, $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
switch ($this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN)) {
|
||||||
setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
case false:
|
||||||
|
// Cookie de session
|
||||||
|
setcookie('ZWII_USER_ID', $userId, $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
||||||
|
//setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
||||||
|
|
||||||
|
// Connexion par clé
|
||||||
|
setcookie('ZWII_AUTH_KEY', $authKey, $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Cookie persistant
|
||||||
|
setcookie('ZWII_USER_ID', $userId, $expire, helper::baseUrl(false, false));
|
||||||
|
//setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false));
|
||||||
|
|
||||||
|
// Connexion par clé
|
||||||
|
setcookie('ZWII_AUTH_KEY', $authKey, $expire, helper::baseUrl(false, false));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Accès multiples avec le même compte
|
// Accès multiples avec le même compte
|
||||||
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']]);
|
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']]);
|
||||||
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
|
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
|
||||||
@ -1064,8 +1087,9 @@ class user extends common
|
|||||||
} else {
|
} else {
|
||||||
$logStatus = 'Connexion réussie';
|
$logStatus = 'Connexion réussie';
|
||||||
$pageId = $this->getUrl(2);
|
$pageId = $this->getUrl(2);
|
||||||
if ($this->getData(['config', 'page404']) === $pageId
|
if (
|
||||||
|| $this->getData(['config', 'page403']) === $pageId
|
$this->getData(['config', 'page404']) === $pageId
|
||||||
|
|| $this->getData(['config', 'page403']) === $pageId
|
||||||
) {
|
) {
|
||||||
$pageId = '';
|
$pageId = '';
|
||||||
}
|
}
|
||||||
@ -1123,7 +1147,8 @@ class user extends common
|
|||||||
public function logout()
|
public function logout()
|
||||||
{
|
{
|
||||||
helper::deleteCookie('ZWII_USER_ID');
|
helper::deleteCookie('ZWII_USER_ID');
|
||||||
helper::deleteCookie('ZWII_USER_PASSWORD');
|
//helper::deleteCookie('ZWII_USER_PASSWORD');
|
||||||
|
helper::deleteCookie('ZWII_AUTH_KEY');
|
||||||
|
|
||||||
// Détruit la session
|
// Détruit la session
|
||||||
session_destroy();
|
session_destroy();
|
||||||
|
@ -16,3 +16,4 @@
|
|||||||
/** NE PAS EFFACER
|
/** NE PAS EFFACER
|
||||||
* admin.css
|
* admin.css
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ $(document).ready((function () {
|
|||||||
url: "core/vendor/datatables/french.json",
|
url: "core/vendor/datatables/french.json",
|
||||||
},
|
},
|
||||||
locale: 'fr',
|
locale: 'fr',
|
||||||
|
stateSave: true,
|
||||||
|
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||||
"columnDefs": [
|
"columnDefs": [
|
||||||
{
|
{
|
||||||
target: 5,
|
target: 5,
|
||||||
|
@ -152,7 +152,7 @@
|
|||||||
<?php echo template::select('profilEditPath', $module::$sharePath, [
|
<?php echo template::select('profilEditPath', $module::$sharePath, [
|
||||||
'label' => 'Dossier',
|
'label' => 'Dossier',
|
||||||
'class' => 'filemanager',
|
'class' => 'filemanager',
|
||||||
'selected' => '.' . $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'path'])
|
'selected' => $this->getData(['profil', $this->getUrl(2), $this->getUrl(3), 'folder', 'path'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
13
core/vendor/datatables/datatables.custom.css
vendored
Normal file
13
core/vendor/datatables/datatables.custom.css
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
.dataTables_length {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_length label {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataTables_length select {
|
||||||
|
margin-left: 5px;
|
||||||
|
width: 80px;
|
||||||
|
}
|
2
core/vendor/datatables/french.json
vendored
2
core/vendor/datatables/french.json
vendored
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"processing": "Traitement en cours...",
|
"processing": "Traitement en cours...",
|
||||||
"search": "Rechercher :",
|
"search": "Rechercher :",
|
||||||
"lengthMenu": "Éléments par page _MENU_",
|
"lengthMenu": "Éléments par page : _MENU_",
|
||||||
"info": "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
|
"info": "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
|
||||||
"infoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
|
"infoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
|
||||||
"infoFiltered": "(filtré de _MAX_ éléments au total)",
|
"infoFiltered": "(filtré de _MAX_ éléments au total)",
|
||||||
|
3
core/vendor/datatables/inc.json
vendored
3
core/vendor/datatables/inc.json
vendored
@ -1,4 +1,5 @@
|
|||||||
[
|
[
|
||||||
"datatables.min.js",
|
"datatables.min.js",
|
||||||
"datatables.min.css"
|
"datatables.min.css",
|
||||||
|
"datatables.custom.css"
|
||||||
]
|
]
|
6
core/vendor/filemanager/UploadHandler.php
vendored
6
core/vendor/filemanager/UploadHandler.php
vendored
@ -1505,9 +1505,9 @@ class UploadHandler
|
|||||||
$magicianObj -> saveImage($targetFile);
|
$magicianObj -> saveImage($targetFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$newWidth = 640;
|
||||||
|
$newHeight = 480;
|
||||||
$thumbResult = create_img($targetFile, $targetFileThumb, 122, 91);
|
$thumbResult = create_img($targetFile, $targetFileThumb, $newWidth, $newHeight);
|
||||||
|
|
||||||
if ( $thumbResult!==true)
|
if ( $thumbResult!==true)
|
||||||
{
|
{
|
||||||
|
4
core/vendor/filemanager/config/config.php
vendored
4
core/vendor/filemanager/config/config.php
vendored
@ -54,7 +54,7 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
|||||||
if ($g['profil'][$group][$profil]['filemanager'] === false)
|
if ($g['profil'][$group][$profil]['filemanager'] === false)
|
||||||
exit('Accès interdit');
|
exit('Accès interdit');
|
||||||
// lecture du profil
|
// lecture du profil
|
||||||
if (!is_null($profil)) {
|
if (!is_null($profil) and $g['profil'][$group][$profil]['folder']['path'] !== '') {
|
||||||
$file = $g['profil'][$group][$profil]['file'];
|
$file = $g['profil'][$group][$profil]['file'];
|
||||||
$folder = $g['profil'][$group][$profil]['folder'];
|
$folder = $g['profil'][$group][$profil]['folder'];
|
||||||
$uploadDir = $g['profil'][$group][$profil]['folder']['path'];
|
$uploadDir = $g['profil'][$group][$profil]['folder']['path'];
|
||||||
@ -591,7 +591,7 @@ $config = array(
|
|||||||
// path_from_filemanager/test/test1/
|
// path_from_filemanager/test/test1/
|
||||||
// PS if there isn't write permission in your destination folder you must set it
|
// PS if there isn't write permission in your destination folder you must set it
|
||||||
//
|
//
|
||||||
'fixed_image_creation' => true,
|
'fixed_image_creation' => false,
|
||||||
//activate or not the creation of one or more image resized with fixed path from filemanager folder
|
//activate or not the creation of one or more image resized with fixed path from filemanager folder
|
||||||
'fixed_path_from_filemanager' => array('../../../site/file/thumb/'),
|
'fixed_path_from_filemanager' => array('../../../site/file/thumb/'),
|
||||||
//fixed path of the image folder from the current position on upload folder
|
//fixed path of the image folder from the current position on upload folder
|
||||||
|
44
core/vendor/filemanager/dialog.php
vendored
44
core/vendor/filemanager/dialog.php
vendored
@ -59,12 +59,12 @@ if (checkRelativePath($subdir_path)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($subdir == "") {
|
if ($subdir == "") {
|
||||||
if (!empty($_COOKIE['last_position']) && strpos($_COOKIE['last_position'], '.') === false) {
|
if (!empty($_COOKIE['ZWII_RFM_FOLDER']) && strpos($_COOKIE['ZWII_RFM_FOLDER'], '.') === false) {
|
||||||
$subdir = trim($_COOKIE['last_position']);
|
$subdir = trim($_COOKIE['ZWII_RFM_FOLDER']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//remember last position
|
//remember last position
|
||||||
setcookie('last_position', $subdir, time() + (86400 * 7));
|
setcookie('ZWII_RFM_FOLDER', $subdir, time() + (86400 * 7));
|
||||||
|
|
||||||
if ($subdir == "/") {
|
if ($subdir == "/") {
|
||||||
$subdir = "";
|
$subdir = "";
|
||||||
@ -864,50 +864,54 @@ if ($config['upload_files']) { ?>
|
|||||||
|
|
||||||
switch ($sort_by) {
|
switch ($sort_by) {
|
||||||
case 'date':
|
case 'date':
|
||||||
//usort($sorted, 'dateSort');
|
|
||||||
usort($sorted, function($x, $y) use ($descending) {
|
usort($sorted, function($x, $y) use ($descending) {
|
||||||
if ($x['is_dir'] !== $y['is_dir']) {
|
if ($x['is_dir'] !== $y['is_dir']) {
|
||||||
return $y['is_dir'] ? 1 : -1;
|
return $y['is_dir'] ? 1 : -1;
|
||||||
} else {
|
} else {
|
||||||
return ($descending)
|
if ($descending) {
|
||||||
? $x['size'] < $y['size']
|
return ($x['size'] < $y['size']) ? -1 : ($x['size'] > $y['size'] ? 1 : 0);
|
||||||
: $x['size'] >= $y['size'];
|
} else {
|
||||||
|
return ($x['size'] > $y['size']) ? -1 : ($x['size'] < $y['size'] ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'size':
|
case 'size':
|
||||||
//usort($sorted, 'sizeSort');
|
|
||||||
usort($sorted, function($x, $y) use ($descending) {
|
usort($sorted, function($x, $y) use ($descending) {
|
||||||
if ($x['is_dir'] !== $y['is_dir']) {
|
if ($x['is_dir'] !== $y['is_dir']) {
|
||||||
return $y['is_dir'] ? 1 : -1;
|
return $y['is_dir'] ? 1 : -1;
|
||||||
} else {
|
} else {
|
||||||
return ($descending)
|
if ($descending) {
|
||||||
? $x['date'] < $y['date']
|
return ($x['date'] < $y['date']) ? -1 : ($x['date'] > $y['date'] ? 1 : 0);
|
||||||
: $x['date'] >= $y['date'];
|
} else {
|
||||||
|
return ($x['date'] > $y['date']) ? -1 : ($x['date'] < $y['date'] ? 1 : 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
|
||||||
case 'extension':
|
case 'extension':
|
||||||
//usort($sorted, 'extensionSort');
|
|
||||||
usort($sorted, function($x, $y) use ($descending) {
|
usort($sorted, function($x, $y) use ($descending) {
|
||||||
if ($x['is_dir'] !== $y['is_dir']) {
|
if ($x['is_dir'] !== $y['is_dir']) {
|
||||||
return $y['is_dir'] ? 1 : -1;
|
return $y['is_dir'] ? 1 : -1;
|
||||||
} else {
|
} else {
|
||||||
return ($descending)
|
if ($descending) {
|
||||||
? ($x['extension'] < $y['extension'] ? 1 : 0)
|
return strcasecmp($x['extension'], $y['extension']);
|
||||||
: ($x['extension'] >= $y['extension'] ? 1 : 0);
|
} else {
|
||||||
|
return -strcasecmp($x['extension'], $y['extension']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// usort($sorted, 'filenameSort');
|
|
||||||
usort($sorted, function($x, $y) use ($descending) {
|
usort($sorted, function($x, $y) use ($descending) {
|
||||||
if ($x['is_dir'] !== $y['is_dir']) {
|
if ($x['is_dir'] !== $y['is_dir']) {
|
||||||
return $y['is_dir'] ? 1 : -1;
|
return $y['is_dir'] ? 1 : -1;
|
||||||
} else {
|
} else {
|
||||||
return ($descending)
|
if ($descending) {
|
||||||
? ($x['file_lcase'] < $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1))
|
return strcasecmp($x['file_lcase'], $y['file_lcase']);
|
||||||
: ($x['file_lcase'] >= $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1));
|
} else {
|
||||||
|
return -strcasecmp($x['file_lcase'], $y['file_lcase']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
19
index.php
19
index.php
@ -19,6 +19,25 @@
|
|||||||
*/
|
*/
|
||||||
// Remplace la directive htaccess
|
// Remplace la directive htaccess
|
||||||
ini_set('session.use_trans_sid', FALSE);
|
ini_set('session.use_trans_sid', FALSE);
|
||||||
|
|
||||||
|
// Crée un identifiant unique pour chaque site en fonction du nom de domaine ou autre
|
||||||
|
$siteId = md5($_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_FILENAME']); // Ou utilise un autre identifiant unique pour chaque site
|
||||||
|
// Change le nom de la session en fonction de cet identifiant
|
||||||
|
session_name('zwii_session_' . $siteId);
|
||||||
|
|
||||||
|
// Récupère dynamiquement le chemin du dossier dans lequel le script est exécuté
|
||||||
|
$scriptPath = dirname($_SERVER['SCRIPT_NAME']) . '/';
|
||||||
|
|
||||||
|
// Définissez le chemin du cookie de session dynamiquement
|
||||||
|
session_set_cookie_params([
|
||||||
|
'lifetime' => 0,
|
||||||
|
'path' => $scriptPath, // Utilise le chemin du script pour restreindre la session à ce répertoire
|
||||||
|
'domain' => $_SERVER['SERVER_NAME'], // Domain par défaut
|
||||||
|
'secure' => isset($_SERVER['HTTPS']), // Pour HTTPS, si nécessaire
|
||||||
|
'httponly' => true,
|
||||||
|
'samesite' => 'Lax' // Ou 'Strict' ou 'None' selon tes besoins
|
||||||
|
]);
|
||||||
|
|
||||||
// Démarre la session
|
// Démarre la session
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
class blog extends common
|
class blog extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
const VERSION = '7.5';
|
const VERSION = '7.11';
|
||||||
const REALNAME = 'Blog';
|
const REALNAME = 'Blog';
|
||||||
const DELETE = true;
|
const DELETE = true;
|
||||||
const UPDATE = '0.0';
|
const UPDATE = '0.0';
|
||||||
@ -196,9 +196,11 @@ class blog extends common
|
|||||||
$feeds = new \FeedWriter\RSS2();
|
$feeds = new \FeedWriter\RSS2();
|
||||||
|
|
||||||
// En-tête
|
// En-tête
|
||||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']));
|
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']) ? $this->getData(['page', $this->getUrl(0), 'title']): '');
|
||||||
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
||||||
$feeds->setDescription($this->getData(['page', $this->getUrl(0), 'metaDescription']));
|
if ($this->getData(['page', $this->getUrl(0), 'metaDescription'])) {
|
||||||
|
$feeds->setDescription($this->getData(['page', $this->getUrl(0), 'metaDescription']));
|
||||||
|
}
|
||||||
$feeds->setChannelElement('language', 'fr-FR');
|
$feeds->setChannelElement('language', 'fr-FR');
|
||||||
$feeds->setDate(date('r', time()));
|
$feeds->setDate(date('r', time()));
|
||||||
$feeds->addGenerator();
|
$feeds->addGenerator();
|
||||||
@ -747,7 +749,7 @@ class blog extends common
|
|||||||
) {
|
) {
|
||||||
// Check la captcha
|
// Check la captcha
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === false
|
||||||
//AND $this->getInput('blogArticlecaptcha', helper::FILTER_INT) !== $this->getInput('blogArticlecaptchaFirstNumber', helper::FILTER_INT) + $this->getInput('blogArticlecaptchaSecondNumber', helper::FILTER_INT))
|
//AND $this->getInput('blogArticlecaptcha', helper::FILTER_INT) !== $this->getInput('blogArticlecaptchaFirstNumber', helper::FILTER_INT) + $this->getInput('blogArticlecaptchaSecondNumber', helper::FILTER_INT))
|
||||||
and password_verify($this->getInput('blogArticleCaptcha', helper::FILTER_INT), $this->getInput('blogArticleCaptchaResult')) === false
|
and password_verify($this->getInput('blogArticleCaptcha', helper::FILTER_INT), $this->getInput('blogArticleCaptchaResult')) === false
|
||||||
) {
|
) {
|
||||||
@ -755,7 +757,7 @@ class blog extends common
|
|||||||
}
|
}
|
||||||
// Crée le commentaire
|
// Crée le commentaire
|
||||||
$commentId = helper::increment(uniqid(), $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']));
|
$commentId = helper::increment(uniqid(), $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']));
|
||||||
$content = $this->getInput('blogArticleContent', false);
|
$content = $this->getInput('blogArticleContent', null, true);
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'module', $this->getUrl(0),
|
'module', $this->getUrl(0),
|
||||||
'posts', $this->getUrl(1),
|
'posts', $this->getUrl(1),
|
||||||
@ -829,7 +831,7 @@ class blog extends common
|
|||||||
// Signature de l'article
|
// Signature de l'article
|
||||||
self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
|
self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
|
||||||
// Signature du commentaire édité
|
// Signature du commentaire édité
|
||||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
if ($this->isConnected() === true) {
|
||||||
self::$editCommentSignature = $this->signature($this->getUser('id'));
|
self::$editCommentSignature = $this->signature($this->getUser('id'));
|
||||||
}
|
}
|
||||||
// Commentaires en fonction de la pagination
|
// Commentaires en fonction de la pagination
|
||||||
|
@ -1,3 +1,13 @@
|
|||||||
|
# Versions 7.11
|
||||||
|
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
|
||||||
|
# Versions 7.10
|
||||||
|
- Empêche la validation d'un commentaire lorsque le contenu est vide.
|
||||||
|
# Versions 7.8 - 7.9
|
||||||
|
- Le flux RSS ne fonctionne pas si les méta de la page sont vides.
|
||||||
|
# Version 7.7
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
|
# Version 7.6
|
||||||
|
- Mise à jour RSS Feed
|
||||||
# Version 7.5
|
# Version 7.5
|
||||||
- Bug paramètre de localisation erroné
|
- Bug paramètre de localisation erroné
|
||||||
# Version 7.4
|
# Version 7.4
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"blog","realName":"Blog","version":"7.2","update":"0.0","delete":true,"dataDirectory":""}
|
{"name":"blog","realName":"Blog","version":"7.10","update":"0.0","delete":true,"dataDirectory":""}
|
74
module/blog/vendor/FeedWriter/CHANGELOG.md
vendored
Normal file
74
module/blog/vendor/FeedWriter/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# Change Log
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) .
|
||||||
|
|
||||||
|
## [v1.1.2] - 2023-05-25
|
||||||
|
### Changed
|
||||||
|
- Throw an exception if required feed elements are set with ```NULL``` value. See issue #46.
|
||||||
|
|
||||||
|
## [v1.1.1] - 2016-11-19
|
||||||
|
### Changed
|
||||||
|
- Improved the documentation.
|
||||||
|
- Changed to PSR-4 autoloader in composer.json.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Item::addElement did not method chain in error conditions.
|
||||||
|
|
||||||
|
## [v1.1.0] - 2016-11-08
|
||||||
|
### Added
|
||||||
|
- Support for multiple element values.
|
||||||
|
- Support for a feed description in ATOM feeds.
|
||||||
|
- Support for ATOM feeds without ```link``` elements.
|
||||||
|
- Support for a feed image in RSS 1.0 and ATOM feeds.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- The script does now throw Exceptions instead of stopping the PHP interpreter on error conditions.
|
||||||
|
- The unique identifier for ATOM feeds / entries use the feed / entry title for generating the ID (previously the feed / entry link).
|
||||||
|
- Some URI schemes for ```Item::setId``` were wrongly allowed.
|
||||||
|
- The parameter order of the ```Feed::setImage``` method was changed.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed slow generation of the feed with huge amounts of feed entries (like 40k entries).
|
||||||
|
- Fixed PHP warning when ```Feed::setChannelAbout``` for RSS 1.0 feeds was not called.
|
||||||
|
- A feed element was generated twice if the element content & attribute value was ```NULL```.
|
||||||
|
- The detection of twice the same link with ```rel=alternate```, ```hreflang``` & ```type``` did not work.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- The deprecated method ```Item::setEnclosure``` was removed. Use ```Item::addEnclosure``` instead.
|
||||||
|
|
||||||
|
## [v1.0.4] - 2016-04-17
|
||||||
|
### Changed
|
||||||
|
- The unique identifier for ATOM feed entries is now compliant to the ATOM standard.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Filter more invalid XML chars.
|
||||||
|
- Fixed a PHP warning displayed if ```Feed::setTitle``` or ```Feed::setLink``` was not called.
|
||||||
|
|
||||||
|
## [v1.0.3] - 2015-11-11
|
||||||
|
### Added
|
||||||
|
- Method for removing tags which were CDATA encoded.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed error when the filtering of invalid XML chars failed.
|
||||||
|
- Fixed missing docblock documentation.
|
||||||
|
|
||||||
|
## [v1.0.2] - 2015-01-23
|
||||||
|
### Fixed
|
||||||
|
- Fixed a wrong docblock return data type.
|
||||||
|
|
||||||
|
## [v1.0.1] - 2014-09-21
|
||||||
|
### Fixed
|
||||||
|
- Filter invalid XML chars.
|
||||||
|
|
||||||
|
## v1.0 - 2014-09-14
|
||||||
|
|
||||||
|
|
||||||
|
[Unreleased]: https://github.com/mibe/FeedWriter/compare/v1.1.2...HEAD
|
||||||
|
[v1.1.2]: https://github.com/mibe/FeedWriter/compare/v1.1.1...v1.1.2
|
||||||
|
[v1.1.1]: https://github.com/mibe/FeedWriter/compare/v1.1.0...v1.1.1
|
||||||
|
[v1.1.0]: https://github.com/mibe/FeedWriter/compare/v1.0.4...v1.1.0
|
||||||
|
[v1.0.4]: https://github.com/mibe/FeedWriter/compare/v1.0.3...v1.0.4
|
||||||
|
[v1.0.3]: https://github.com/mibe/FeedWriter/compare/v1.0.2...v1.0.3
|
||||||
|
[v1.0.2]: https://github.com/mibe/FeedWriter/compare/v1.0.1...v1.0.2
|
||||||
|
[v1.0.1]: https://github.com/mibe/FeedWriter/compare/v1.0...v1.0.1
|
39
module/blog/vendor/FeedWriter/Feed.php
vendored
39
module/blog/vendor/FeedWriter/Feed.php
vendored
@ -2,10 +2,11 @@
|
|||||||
namespace FeedWriter;
|
namespace FeedWriter;
|
||||||
|
|
||||||
use \DateTime;
|
use \DateTime;
|
||||||
|
use \DateTimeInterface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||||
* Copyright (C) 2010-2016 Michael Bemmerl <mail@mx-server.de>
|
* Copyright (C) 2010-2016, 2022 Michael Bemmerl <mail@mx-server.de>
|
||||||
*
|
*
|
||||||
* This file is part of the "Universal Feed Writer" project.
|
* This file is part of the "Universal Feed Writer" project.
|
||||||
*
|
*
|
||||||
@ -76,6 +77,13 @@ abstract class Feed
|
|||||||
*/
|
*/
|
||||||
private $version = null;
|
private $version = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the encoding of this feed.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $encoding = 'utf-8';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -87,9 +95,6 @@ abstract class Feed
|
|||||||
{
|
{
|
||||||
$this->version = $version;
|
$this->version = $version;
|
||||||
|
|
||||||
// Setting default encoding
|
|
||||||
$this->encoding = 'utf-8';
|
|
||||||
|
|
||||||
// Setting default value for essential channel element
|
// Setting default value for essential channel element
|
||||||
$this->setTitle($version . ' Feed');
|
$this->setTitle($version . ' Feed');
|
||||||
|
|
||||||
@ -396,9 +401,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $title value of 'title' channel tag
|
* @param string $title value of 'title' channel tag
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the title is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setTitle($title)
|
public function setTitle($title)
|
||||||
{
|
{
|
||||||
|
if (empty($title))
|
||||||
|
throw new \InvalidArgumentException('The title may not be empty or NULL.');
|
||||||
|
|
||||||
return $this->setChannelElement('title', $title);
|
return $this->setChannelElement('title', $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,15 +415,15 @@ abstract class Feed
|
|||||||
* Set the date when the feed was lastly updated.
|
* Set the date when the feed was lastly updated.
|
||||||
*
|
*
|
||||||
* This adds the 'updated' element to the feed. The value of the date parameter
|
* This adds the 'updated' element to the feed. The value of the date parameter
|
||||||
* can be either an instance of the DateTime class, an integer containing a UNIX
|
* can be either a class implementing DateTimeInterface, an integer containing a UNIX
|
||||||
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
||||||
*
|
*
|
||||||
* Not supported in RSS1 feeds.
|
* Not supported in RSS1 feeds.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param DateTime|int|string Date which should be used.
|
* @param DateTimeInterface|int|string Date which should be used.
|
||||||
* @return self
|
* @return self
|
||||||
* @throws \InvalidArgumentException if the given date is not an instance of DateTime, a UNIX timestamp or a date string.
|
* @throws \InvalidArgumentException if the given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.
|
||||||
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
||||||
*/
|
*/
|
||||||
public function setDate($date)
|
public function setDate($date)
|
||||||
@ -425,7 +434,7 @@ abstract class Feed
|
|||||||
// The feeds have different date formats.
|
// The feeds have different date formats.
|
||||||
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
||||||
|
|
||||||
if ($date instanceof DateTime)
|
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||||
$date = $date->format($format);
|
$date = $date->format($format);
|
||||||
else if(is_numeric($date) && $date >= 0)
|
else if(is_numeric($date) && $date >= 0)
|
||||||
$date = date($format, $date);
|
$date = date($format, $date);
|
||||||
@ -438,7 +447,7 @@ abstract class Feed
|
|||||||
$date = date($format, $timestamp);
|
$date = date($format, $timestamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new \InvalidArgumentException('The given date is not an instance of DateTime, a UNIX timestamp or a date string.');
|
throw new \InvalidArgumentException('The given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.');
|
||||||
|
|
||||||
if ($this->version == Feed::ATOM)
|
if ($this->version == Feed::ATOM)
|
||||||
$this->setChannelElement('updated', $date);
|
$this->setChannelElement('updated', $date);
|
||||||
@ -454,9 +463,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $description Description of the feed.
|
* @param string $description Description of the feed.
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the description is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setDescription($description)
|
public function setDescription($description)
|
||||||
{
|
{
|
||||||
|
if (empty($description))
|
||||||
|
throw new \InvalidArgumentException('The description may not be empty or NULL.');
|
||||||
|
|
||||||
if ($this->version != Feed::ATOM)
|
if ($this->version != Feed::ATOM)
|
||||||
$this->setChannelElement('description', $description);
|
$this->setChannelElement('description', $description);
|
||||||
else
|
else
|
||||||
@ -471,9 +484,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $link value of 'link' channel tag
|
* @param string $link value of 'link' channel tag
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the link is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setLink($link)
|
public function setLink($link)
|
||||||
{
|
{
|
||||||
|
if (empty($link))
|
||||||
|
throw new \InvalidArgumentException('The link may not be empty or NULL.');
|
||||||
|
|
||||||
if ($this->version == Feed::ATOM)
|
if ($this->version == Feed::ATOM)
|
||||||
$this->setAtomLink($link);
|
$this->setAtomLink($link);
|
||||||
else
|
else
|
||||||
@ -667,7 +684,7 @@ abstract class Feed
|
|||||||
/**
|
/**
|
||||||
* Replace invalid XML characters.
|
* Replace invalid XML characters.
|
||||||
*
|
*
|
||||||
* @link http://www.phpwact.org/php/i18n/charsets#xml See utf8_for_xml() function
|
* @link https://web.archive.org/web/20160608013721/http://www.phpwact.org:80/php/i18n/charsets#xml See utf8_for_xml() function
|
||||||
* @link http://www.w3.org/TR/REC-xml/#charsets
|
* @link http://www.w3.org/TR/REC-xml/#charsets
|
||||||
* @link https://github.com/mibe/FeedWriter/issues/30
|
* @link https://github.com/mibe/FeedWriter/issues/30
|
||||||
*
|
*
|
||||||
@ -906,7 +923,7 @@ abstract class Feed
|
|||||||
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
||||||
|
|
||||||
// An image has its own element after the channel elements.
|
// An image has its own element after the channel elements.
|
||||||
if (array_key_exists('image', $this->data))
|
if (array_key_exists('Image', $this->data))
|
||||||
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
||||||
} else if ($this->version == Feed::ATOM) {
|
} else if ($this->version == Feed::ATOM) {
|
||||||
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
||||||
|
16
module/blog/vendor/FeedWriter/Item.php
vendored
16
module/blog/vendor/FeedWriter/Item.php
vendored
@ -2,6 +2,7 @@
|
|||||||
namespace FeedWriter;
|
namespace FeedWriter;
|
||||||
|
|
||||||
use \DateTime;
|
use \DateTime;
|
||||||
|
use \DateTimeInterface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||||
@ -217,19 +218,19 @@ class Item
|
|||||||
/**
|
/**
|
||||||
* Set the 'date' element of the feed item.
|
* Set the 'date' element of the feed item.
|
||||||
*
|
*
|
||||||
* The value of the date parameter can be either an instance of the
|
* The value of the date parameter can be either a class implementing
|
||||||
* DateTime class, an integer containing a UNIX timestamp or a string
|
* DateTimeInterface, an integer containing a UNIX timestamp or a string
|
||||||
* which is parseable by PHP's 'strtotime' function.
|
* which is parseable by PHP's 'strtotime' function.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param DateTime|int|string $date Date which should be used.
|
* @param DateTimeInterface|int|string $date Date which should be used.
|
||||||
* @return self
|
* @return self
|
||||||
* @throws \InvalidArgumentException if the given date was not parseable.
|
* @throws \InvalidArgumentException if the given date was not parseable.
|
||||||
*/
|
*/
|
||||||
public function setDate($date)
|
public function setDate($date)
|
||||||
{
|
{
|
||||||
if (!is_numeric($date)) {
|
if (!is_numeric($date)) {
|
||||||
if ($date instanceof DateTime)
|
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||||
$date = $date->getTimestamp();
|
$date = $date->getTimestamp();
|
||||||
else {
|
else {
|
||||||
$date = strtotime($date);
|
$date = strtotime($date);
|
||||||
@ -277,7 +278,7 @@ class Item
|
|||||||
* Attach a external media to the feed item.
|
* Attach a external media to the feed item.
|
||||||
* Not supported in RSS 1.0 feeds.
|
* Not supported in RSS 1.0 feeds.
|
||||||
*
|
*
|
||||||
* See RFC 4288 for syntactical correct MIME types.
|
* See RFC 6838 for syntactical correct MIME types.
|
||||||
*
|
*
|
||||||
* Note that you should avoid the use of more than one enclosure in one item,
|
* Note that you should avoid the use of more than one enclosure in one item,
|
||||||
* since some RSS aggregators don't support it.
|
* since some RSS aggregators don't support it.
|
||||||
@ -288,7 +289,8 @@ class Item
|
|||||||
* @param string $type The MIME type attribute of the media.
|
* @param string $type The MIME type attribute of the media.
|
||||||
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
||||||
* @return self
|
* @return self
|
||||||
* @link https://tools.ietf.org/html/rfc4288
|
* @link https://tools.ietf.org/html/rfc6838
|
||||||
|
* @link http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||||
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
||||||
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
||||||
*/
|
*/
|
||||||
@ -389,7 +391,7 @@ class Item
|
|||||||
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
||||||
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
||||||
// by using only permanent or historical schemes.
|
// by using only permanent or historical schemes.
|
||||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'bb', 'cap', 'cid', 'coap', 'coap+tcp', 'coap+ws', 'coaps', 'coaps+tcp', 'coaps+ws', 'crid', 'data', 'dav', 'dict', 'dns', 'drop', 'dtn', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'grd', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipn', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'leaptofrogans', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mt', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'p1', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp (OBSOLETE)', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'upt', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'wpid', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||||
$found = FALSE;
|
$found = FALSE;
|
||||||
$checkId = strtolower($id);
|
$checkId = strtolower($id);
|
||||||
|
|
||||||
|
8
module/blog/vendor/FeedWriter/README.md
vendored
8
module/blog/vendor/FeedWriter/README.md
vendored
@ -12,6 +12,11 @@ Once a feed is fully composed with its items, the feed class can generate the ne
|
|||||||
|
|
||||||
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
You can install via [Composer](https://getcomposer.org/).
|
||||||
|
|
||||||
|
composer require mibe/feedwriter
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
||||||
@ -40,3 +45,6 @@ In chronological order:
|
|||||||
- Pavel Khakhlou
|
- Pavel Khakhlou
|
||||||
- Daniel
|
- Daniel
|
||||||
- Tino Goratsch
|
- Tino Goratsch
|
||||||
|
- John
|
||||||
|
- Özgür Görgülü
|
||||||
|
- Jan Tojnar
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||||
<!-- Bloc edition -->
|
<!-- Bloc edition -->
|
||||||
<?php if (
|
<?php if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_OWNER
|
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_OWNER
|
||||||
@ -88,7 +88,7 @@
|
|||||||
'readonly' => true
|
'readonly' => true
|
||||||
]); ?>
|
]); ?>
|
||||||
<div id="blogArticleCommentWrapper" class="displayNone">
|
<div id="blogArticleCommentWrapper" class="displayNone">
|
||||||
<?php if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?>
|
<?php if ($this->isConnected() === true): ?>
|
||||||
<?php echo template::text('blogArticleUserName', [
|
<?php echo template::text('blogArticleUserName', [
|
||||||
'label' => 'Nom',
|
'label' => 'Nom',
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
@ -122,7 +122,7 @@
|
|||||||
'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength'])
|
'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<div id="blogArticleContentAlarm"> </div>
|
<div id="blogArticleContentAlarm"> </div>
|
||||||
<?php if ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
|
<?php if ($this->isConnected() === false): ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::captcha('blogArticleCaptcha', [
|
<?php echo template::captcha('blogArticleCaptcha', [
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('blogConfigBack', [
|
<?php echo template::button('blogConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'posts',
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,153 +1,154 @@
|
|||||||
<?php echo template::formOpen('blogEditForm'); ?>
|
<?php echo template::formOpen('blogEditForm'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('blogEditBack', [
|
<?php echo template::button('blogEditBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
|
||||||
<div class="col3 offset6">
|
|
||||||
<?php echo template::button('blogEditDraft', [
|
|
||||||
'uniqueSubmission' => true,
|
|
||||||
'value' => 'Brouillon'
|
|
||||||
]); ?>
|
|
||||||
<?php echo template::hidden('blogEditState', [
|
|
||||||
'value' => true
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col2">
|
|
||||||
<?php echo template::submit('blogEditSubmit', [
|
|
||||||
'value' => 'Publier',
|
|
||||||
'uniqueSubmission' => true
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="col3 offset6">
|
||||||
<div class="col12">
|
<?php echo template::button('blogEditDraft', [
|
||||||
<div class="block">
|
'uniqueSubmission' => true,
|
||||||
<h4><?php echo helper::translate('Paramètres');?></h4>
|
'value' => 'Brouillon'
|
||||||
<div class="row">
|
]); ?>
|
||||||
<div class="col6">
|
<?php echo template::hidden('blogEditState', [
|
||||||
<?php echo template::text('blogEditTitle', [
|
'value' => true
|
||||||
'label' => 'Titre',
|
]); ?>
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title'])
|
</div>
|
||||||
]); ?>
|
<div class="col2">
|
||||||
</div>
|
<?php echo template::submit('blogEditSubmit', [
|
||||||
<div class="col6">
|
'value' => 'Publier',
|
||||||
<?php echo template::text('blogEditPermalink', [
|
'uniqueSubmission' => true
|
||||||
'label' => 'Permalink',
|
]); ?>
|
||||||
'value' => $this->getUrl(2)
|
</div>
|
||||||
]); ?>
|
</div>
|
||||||
</div>
|
<div class="row">
|
||||||
|
<div class="col12">
|
||||||
|
<div class="block">
|
||||||
|
<h4><?php echo helper::translate('Paramètres'); ?></h4>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::text('blogEditTitle', [
|
||||||
|
'label' => 'Titre',
|
||||||
|
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title'])
|
||||||
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="col6">
|
||||||
<div class="col6">
|
<?php echo template::text('blogEditPermalink', [
|
||||||
<?php echo template::file('blogEditPicture', [
|
'label' => 'Permalink',
|
||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'value' => $this->getUrl(2)
|
||||||
'help' => $this->getData(['theme', 'site', 'width']) !== '100%' ? 'Taille optimale de l\'image de couverture : ' . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.' : '',
|
]); ?>
|
||||||
'label' => 'Image de couverture',
|
|
||||||
'type' => 1,
|
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col3">
|
|
||||||
<?php echo template::select('blogEditPictureSize', $module::$pictureSizes, [
|
|
||||||
'label' => 'Largeur de l\'image',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize'])
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col3">
|
|
||||||
<?php echo template::select('blogEditPicturePosition', $module::$picturePositions, [
|
|
||||||
'label' => 'Position',
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']),
|
|
||||||
'help' => 'Le texte de l\'article est adapté autour de l\'image'
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col6">
|
<div class="row">
|
||||||
<?php echo template::checkbox('blogEditHidePicture', true, 'Masquer l\'image de couverture dans l\'article', [
|
<div class="col6">
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture'])
|
<?php echo template::file('blogEditPicture', [
|
||||||
]); ?>
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
</div>
|
'help' => $this->getData(['theme', 'site', 'width']) !== '100%' ? 'Taille optimale de l\'image de couverture : ' . ((int) substr($this->getData(['theme', 'site', 'width']), 0, -2) - (20 * 2)) . ' x 350 pixels.' : '',
|
||||||
|
'label' => 'Image de couverture',
|
||||||
|
'type' => 1,
|
||||||
|
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture']),
|
||||||
|
'folder' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture']) ? dirname($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture'])) : ''
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col3">
|
||||||
|
<?php echo template::select('blogEditPictureSize', $module::$pictureSizes, [
|
||||||
|
'label' => 'Largeur de l\'image',
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize'])
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col3">
|
||||||
|
<?php echo template::select('blogEditPicturePosition', $module::$picturePositions, [
|
||||||
|
'label' => 'Position',
|
||||||
|
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']),
|
||||||
|
'help' => 'Le texte de l\'article est adapté autour de l\'image'
|
||||||
|
]); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col6">
|
||||||
|
<?php echo template::checkbox('blogEditHidePicture', true, 'Masquer l\'image de couverture dans l\'article', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture'])
|
||||||
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo template::textarea('blogEditContent', [
|
</div>
|
||||||
'class' => 'editorWysiwyg',
|
<?php echo template::textarea('blogEditContent', [
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
|
'class' => 'editorWysiwyg',
|
||||||
]); ?>
|
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
|
||||||
<div class="row">
|
]); ?>
|
||||||
<div class="col12">
|
<div class="row">
|
||||||
<div class="block">
|
<div class="col12">
|
||||||
<h4><?php echo helper::translate('Options de publication');?></h4>
|
<div class="block">
|
||||||
<div class="row">
|
<h4><?php echo helper::translate('Options de publication'); ?></h4>
|
||||||
<div class="col4">
|
<div class="row">
|
||||||
<?php echo template::select('blogEditUserId', $module::$users, [
|
<div class="col4">
|
||||||
'label' => 'Auteur',
|
<?php echo template::select('blogEditUserId', $module::$users, [
|
||||||
'selected' => $this->getUser('id'),
|
'label' => 'Auteur',
|
||||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
'selected' => $this->getUser('id'),
|
||||||
]); ?>
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||||
</div>
|
]); ?>
|
||||||
<div class="col4">
|
</div>
|
||||||
<?php echo template::date('blogEditPublishedOn', [
|
<div class="col4">
|
||||||
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
<?php echo template::date('blogEditPublishedOn', [
|
||||||
'type' => 'datetime-local',
|
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
||||||
'label' => 'Publication',
|
'type' => 'datetime-local',
|
||||||
'value' => floor($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) / 60) * 60
|
'label' => 'Publication',
|
||||||
]); ?>
|
'value' => floor($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) / 60) * 60
|
||||||
</div>
|
]); ?>
|
||||||
<div class="col4">
|
</div>
|
||||||
<?php echo template::select('blogEditConsent', $module::$articleConsent , [
|
<div class="col4">
|
||||||
'label' => 'Édition - Suppression',
|
<?php echo template::select('blogEditConsent', $module::$articleConsent, [
|
||||||
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
|
'label' => 'Édition - Suppression',
|
||||||
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
|
'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']),
|
||||||
]); ?>
|
'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'
|
||||||
</div>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col12">
|
<div class="row">
|
||||||
<div class="block">
|
<div class="col12">
|
||||||
<h4><?php echo helper::translate('Commentaires');?></h4>
|
<div class="block">
|
||||||
<div class="row">
|
<h4><?php echo helper::translate('Commentaires'); ?></h4>
|
||||||
<div class="col4 ">
|
<div class="row">
|
||||||
<?php echo template::checkbox('blogEditCommentClose', true, 'Fermer les commentaires', [
|
<div class="col4 ">
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose'])
|
<?php echo template::checkbox('blogEditCommentClose', true, 'Fermer les commentaires', [
|
||||||
]); ?>
|
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose'])
|
||||||
</div>
|
]); ?>
|
||||||
<div class="col4 commentOptionsWrapper ">
|
</div>
|
||||||
<?php echo template::checkbox('blogEditCommentApproved', true, 'Approbation par un modérateur', [
|
<div class="col4 commentOptionsWrapper ">
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']),
|
<?php echo template::checkbox('blogEditCommentApproved', true, 'Approbation par un modérateur', [
|
||||||
''
|
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']),
|
||||||
]); ?>
|
''
|
||||||
</div>
|
]); ?>
|
||||||
<div class="col4 commentOptionsWrapper">
|
</div>
|
||||||
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength,[
|
<div class="col4 commentOptionsWrapper">
|
||||||
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength, [
|
||||||
'label' => 'Caractères par commentaire',
|
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
|
'label' => 'Caractères par commentaire',
|
||||||
]); ?>
|
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
|
||||||
</div>
|
]); ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col3 commentOptionsWrapper offset2">
|
||||||
|
<?php echo template::checkbox('blogEditCommentNotification', true, 'Notification par email', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
|
||||||
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="col4 commentOptionsWrapper">
|
||||||
<div class="col3 commentOptionsWrapper offset2">
|
<?php echo template::select('blogEditCommentGroupNotification', $module::$groupNews, [
|
||||||
<?php echo template::checkbox('blogEditCommentNotification', true, 'Notification par email', [
|
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
|
]); ?>
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
<div class="col4 commentOptionsWrapper">
|
|
||||||
<?php echo template::select('blogEditCommentGroupNotification', $module::$groupNews, [
|
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
|
|
||||||
]); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<?php echo template::formClose(); ?>
|
<?php echo template::formClose(); ?>
|
@ -51,7 +51,7 @@
|
|||||||
<div class="col6 blogEdit">
|
<div class="col6 blogEdit">
|
||||||
<!-- Bloc edition -->
|
<!-- Bloc edition -->
|
||||||
<?php if (
|
<?php if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER
|
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# Versions 4.4
|
||||||
|
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
|
||||||
|
# Version 4.3
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
# Version 4.2
|
# Version 4.2
|
||||||
- Termes des commandes de profils
|
- Termes des commandes de profils
|
||||||
# Version 4.1
|
# Version 4.1
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
class form extends common
|
class form extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
const VERSION = '4.2';
|
const VERSION = '4.4';
|
||||||
const REALNAME = 'Formulaire';
|
const REALNAME = 'Formulaire';
|
||||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('formConfigBack', [
|
<?php echo template::button('formConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Validation du formulaire');?></h4>
|
<h4><?php echo helper::translate('Validation du formulaire'); ?></h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::checkbox('formOptionCaptcha', true, 'Captcha', [
|
<?php echo template::checkbox('formOptionCaptcha', true, 'Captcha', [
|
||||||
@ -49,7 +49,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Gabarit');?></h4>
|
<h4><?php echo helper::translate('Gabarit'); ?></h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('formOptionAlign', $module::$optionAlign, [
|
<?php echo template::select('formOptionAlign', $module::$optionAlign, [
|
||||||
@ -78,7 +78,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Courriel');?></h4>
|
<h4><?php echo helper::translate('Courriel'); ?></h4>
|
||||||
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
||||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
|
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
|
||||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
||||||
@ -128,10 +128,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::file('formOptionLogo', [
|
<?php echo template::file('formOptionLogo', [
|
||||||
|
|
||||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||||
'label' => 'Logo du site',
|
'label' => 'Logo du site',
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])
|
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl']),
|
||||||
|
'folder' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl']) ? dirname($this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])) : ''
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
@ -153,4 +153,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
@ -1,3 +1,5 @@
|
|||||||
|
# Version 4.2
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
# Version 4.1
|
# Version 4.1
|
||||||
- Termes des commandes de profils
|
- Termes des commandes de profils
|
||||||
# Version 4.0
|
# Version 4.0
|
||||||
|
@ -18,7 +18,7 @@ class gallery extends common
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
const VERSION = '4.1';
|
const VERSION = '4.2';
|
||||||
const REALNAME = 'Galerie';
|
const REALNAME = 'Galerie';
|
||||||
const DATADIRECTORY = self::DATA_DIR . 'gallery/';
|
const DATADIRECTORY = self::DATA_DIR . 'gallery/';
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('galleryConfigBack', [
|
<?php echo template::button('galleryConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
# Versions 5.9
|
||||||
|
- Largeur d'un bouton de retour.
|
||||||
|
# Versions 5.7 - 5.8
|
||||||
|
- Le flux RSS ne fonctionne pas si les méta de la page sont vides.
|
||||||
|
# Version 5.6
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
|
# Version 5.5
|
||||||
|
- Mise à jour RSS Feed
|
||||||
# Version 5.4
|
# Version 5.4
|
||||||
- Bug paramètre de localisation erroné
|
- Bug paramètre de localisation erroné
|
||||||
# Version 5.3
|
# Version 5.3
|
||||||
|
@ -1 +1 @@
|
|||||||
{"name":"news","realName":"News","version":"5.0","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
{"name":"news","realName":"News","version":"5.9","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Unorganisiert",
|
"Brouillon": "Unorganisiert",
|
||||||
"Couleur de la bordure": "Randfarbe",
|
"Couleur de la bordure": "Randfarbe",
|
||||||
"Couleur du fond": "Bodenfarbe",
|
"Couleur du fond": "Bodenfarbe",
|
||||||
"Etiquette RSS": "RSS -Label",
|
"Étiquette RSS": "RSS -Label",
|
||||||
"Fine": "Bußgeld",
|
"Fine": "Bußgeld",
|
||||||
"Flux limité aux articles de la première page.": "Flow Limited auf Artikel auf der ersten Seite.",
|
"Flux limité aux articles de la première page.": "Flow Limited auf Artikel auf der ersten Seite.",
|
||||||
"Informations générales": "Allgemeine Informationen",
|
"Informations générales": "Allgemeine Informationen",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Draft copy",
|
"Brouillon": "Draft copy",
|
||||||
"Couleur de la bordure": "Border color",
|
"Couleur de la bordure": "Border color",
|
||||||
"Couleur du fond": "Bottom color",
|
"Couleur du fond": "Bottom color",
|
||||||
"Etiquette RSS": "RSS label",
|
"Étiquette RSS": "RSS label",
|
||||||
"Fine": "Fine",
|
"Fine": "Fine",
|
||||||
"Flux limité aux articles de la première page.": "Flow limited to articles on the first page.",
|
"Flux limité aux articles de la première page.": "Flow limited to articles on the first page.",
|
||||||
"Informations générales": "General informations",
|
"Informations générales": "General informations",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Borrador",
|
"Brouillon": "Borrador",
|
||||||
"Couleur de la bordure": "Color de bordillo",
|
"Couleur de la bordure": "Color de bordillo",
|
||||||
"Couleur du fond": "Color de fondo",
|
"Couleur du fond": "Color de fondo",
|
||||||
"Etiquette RSS": "",
|
"Étiquette RSS": "",
|
||||||
"Fine": "Fino",
|
"Fine": "Fino",
|
||||||
"Flux limité aux articles de la première page.": "Alimento limitado a artículos en la primera página.",
|
"Flux limité aux articles de la première page.": "Alimento limitado a artículos en la primera página.",
|
||||||
"Informations générales": "Información general",
|
"Informations générales": "Información general",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "",
|
"Brouillon": "",
|
||||||
"Couleur de la bordure": "",
|
"Couleur de la bordure": "",
|
||||||
"Couleur du fond": "",
|
"Couleur du fond": "",
|
||||||
"Etiquette RSS": "",
|
"Étiquette RSS": "",
|
||||||
"Fine": "",
|
"Fine": "",
|
||||||
"Flux limité aux articles de la première page.": "",
|
"Flux limité aux articles de la première page.": "",
|
||||||
"Informations générales": "",
|
"Informations générales": "",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Σχέδιο",
|
"Brouillon": "Σχέδιο",
|
||||||
"Couleur de la bordure": "Χρώμα γραμμής",
|
"Couleur de la bordure": "Χρώμα γραμμής",
|
||||||
"Couleur du fond": "Χρώμα του φόντου",
|
"Couleur du fond": "Χρώμα του φόντου",
|
||||||
"Etiquette RSS": "Ετικέτα RSS",
|
"Étiquette RSS": "Ετικέτα RSS",
|
||||||
"Fine": "Πολύ λεπτή γραμμήλεπτή γραμμή",
|
"Fine": "Πολύ λεπτή γραμμήλεπτή γραμμή",
|
||||||
"Flux limité aux articles de la première page.": "Ροή περιορίζεται σε άρθρα στην πρώτη σελίδα.",
|
"Flux limité aux articles de la première page.": "Ροή περιορίζεται σε άρθρα στην πρώτη σελίδα.",
|
||||||
"Informations générales": "Γενικές πληροφορίες",
|
"Informations générales": "Γενικές πληροφορίες",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Progetto di copia",
|
"Brouillon": "Progetto di copia",
|
||||||
"Couleur de la bordure": "Colore del bordo",
|
"Couleur de la bordure": "Colore del bordo",
|
||||||
"Couleur du fond": "Colore inferiore",
|
"Couleur du fond": "Colore inferiore",
|
||||||
"Etiquette RSS": "Etichetta RSS",
|
"Étiquette RSS": "Etichetta RSS",
|
||||||
"Fine": "Bene",
|
"Fine": "Bene",
|
||||||
"Flux limité aux articles de la première page.": "Flusso limitato agli articoli nella prima pagina.",
|
"Flux limité aux articles de la première page.": "Flusso limitato agli articoli nella prima pagina.",
|
||||||
"Informations générales": "Informazioni generali",
|
"Informations générales": "Informazioni generali",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Cópia rascunho",
|
"Brouillon": "Cópia rascunho",
|
||||||
"Couleur de la bordure": "Cor da borda",
|
"Couleur de la bordure": "Cor da borda",
|
||||||
"Couleur du fond": "Cor inferior",
|
"Couleur du fond": "Cor inferior",
|
||||||
"Etiquette RSS": "Rótulo RSS",
|
"Étiquette RSS": "Rótulo RSS",
|
||||||
"Fine": "Multar",
|
"Fine": "Multar",
|
||||||
"Flux limité aux articles de la première page.": "Fluxo limitado a artigos na primeira página.",
|
"Flux limité aux articles de la première page.": "Fluxo limitado a artigos na primeira página.",
|
||||||
"Informations générales": "Informações gerais",
|
"Informations générales": "Informações gerais",
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"Brouillon": "Taslak",
|
"Brouillon": "Taslak",
|
||||||
"Couleur de la bordure": "Çerçeve rengi",
|
"Couleur de la bordure": "Çerçeve rengi",
|
||||||
"Couleur du fond": "Arka plan rengi",
|
"Couleur du fond": "Arka plan rengi",
|
||||||
"Etiquette RSS": "RSS etiketi",
|
"Étiquette RSS": "RSS etiketi",
|
||||||
"Fine": "İnce",
|
"Fine": "İnce",
|
||||||
"Flux limité aux articles de la première page.": "İlk sayfadaki makalelerle sınırlıdır.",
|
"Flux limité aux articles de la première page.": "İlk sayfadaki makalelerle sınırlıdır.",
|
||||||
"Informations générales": "Genel bilgiler",
|
"Informations générales": "Genel bilgiler",
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
class news extends common
|
class news extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
const VERSION = '5.4';
|
const VERSION = '5.9';
|
||||||
const REALNAME = 'News';
|
const REALNAME = 'News';
|
||||||
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
||||||
|
|
||||||
@ -124,9 +124,11 @@ class news extends common
|
|||||||
$feeds = new \FeedWriter\RSS2();
|
$feeds = new \FeedWriter\RSS2();
|
||||||
|
|
||||||
// En-tête
|
// En-tête
|
||||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']));
|
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']) ? $this->getData(['page', $this->getUrl(0), 'title']): '');
|
||||||
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
||||||
$feeds->setDescription($this->getData(['page', $this->getUrl(0), 'metaDescription']));
|
if ($this->getData(['page', $this->getUrl(0), 'metaDescription'])) {
|
||||||
|
$feeds->setDescription($this->getData(['page', $this->getUrl(0), 'metaDescription']));
|
||||||
|
};
|
||||||
$feeds->setChannelElement('language', 'fr-FR');
|
$feeds->setChannelElement('language', 'fr-FR');
|
||||||
$feeds->setDate(date('r', time()));
|
$feeds->setDate(date('r', time()));
|
||||||
$feeds->addGenerator();
|
$feeds->addGenerator();
|
||||||
|
74
module/news/vendor/FeedWriter/CHANGELOG.md
vendored
Normal file
74
module/news/vendor/FeedWriter/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# Change Log
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) .
|
||||||
|
|
||||||
|
## [v1.1.2] - 2023-05-25
|
||||||
|
### Changed
|
||||||
|
- Throw an exception if required feed elements are set with ```NULL``` value. See issue #46.
|
||||||
|
|
||||||
|
## [v1.1.1] - 2016-11-19
|
||||||
|
### Changed
|
||||||
|
- Improved the documentation.
|
||||||
|
- Changed to PSR-4 autoloader in composer.json.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Item::addElement did not method chain in error conditions.
|
||||||
|
|
||||||
|
## [v1.1.0] - 2016-11-08
|
||||||
|
### Added
|
||||||
|
- Support for multiple element values.
|
||||||
|
- Support for a feed description in ATOM feeds.
|
||||||
|
- Support for ATOM feeds without ```link``` elements.
|
||||||
|
- Support for a feed image in RSS 1.0 and ATOM feeds.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- The script does now throw Exceptions instead of stopping the PHP interpreter on error conditions.
|
||||||
|
- The unique identifier for ATOM feeds / entries use the feed / entry title for generating the ID (previously the feed / entry link).
|
||||||
|
- Some URI schemes for ```Item::setId``` were wrongly allowed.
|
||||||
|
- The parameter order of the ```Feed::setImage``` method was changed.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed slow generation of the feed with huge amounts of feed entries (like 40k entries).
|
||||||
|
- Fixed PHP warning when ```Feed::setChannelAbout``` for RSS 1.0 feeds was not called.
|
||||||
|
- A feed element was generated twice if the element content & attribute value was ```NULL```.
|
||||||
|
- The detection of twice the same link with ```rel=alternate```, ```hreflang``` & ```type``` did not work.
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- The deprecated method ```Item::setEnclosure``` was removed. Use ```Item::addEnclosure``` instead.
|
||||||
|
|
||||||
|
## [v1.0.4] - 2016-04-17
|
||||||
|
### Changed
|
||||||
|
- The unique identifier for ATOM feed entries is now compliant to the ATOM standard.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Filter more invalid XML chars.
|
||||||
|
- Fixed a PHP warning displayed if ```Feed::setTitle``` or ```Feed::setLink``` was not called.
|
||||||
|
|
||||||
|
## [v1.0.3] - 2015-11-11
|
||||||
|
### Added
|
||||||
|
- Method for removing tags which were CDATA encoded.
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixed error when the filtering of invalid XML chars failed.
|
||||||
|
- Fixed missing docblock documentation.
|
||||||
|
|
||||||
|
## [v1.0.2] - 2015-01-23
|
||||||
|
### Fixed
|
||||||
|
- Fixed a wrong docblock return data type.
|
||||||
|
|
||||||
|
## [v1.0.1] - 2014-09-21
|
||||||
|
### Fixed
|
||||||
|
- Filter invalid XML chars.
|
||||||
|
|
||||||
|
## v1.0 - 2014-09-14
|
||||||
|
|
||||||
|
|
||||||
|
[Unreleased]: https://github.com/mibe/FeedWriter/compare/v1.1.2...HEAD
|
||||||
|
[v1.1.2]: https://github.com/mibe/FeedWriter/compare/v1.1.1...v1.1.2
|
||||||
|
[v1.1.1]: https://github.com/mibe/FeedWriter/compare/v1.1.0...v1.1.1
|
||||||
|
[v1.1.0]: https://github.com/mibe/FeedWriter/compare/v1.0.4...v1.1.0
|
||||||
|
[v1.0.4]: https://github.com/mibe/FeedWriter/compare/v1.0.3...v1.0.4
|
||||||
|
[v1.0.3]: https://github.com/mibe/FeedWriter/compare/v1.0.2...v1.0.3
|
||||||
|
[v1.0.2]: https://github.com/mibe/FeedWriter/compare/v1.0.1...v1.0.2
|
||||||
|
[v1.0.1]: https://github.com/mibe/FeedWriter/compare/v1.0...v1.0.1
|
39
module/news/vendor/FeedWriter/Feed.php
vendored
39
module/news/vendor/FeedWriter/Feed.php
vendored
@ -2,10 +2,11 @@
|
|||||||
namespace FeedWriter;
|
namespace FeedWriter;
|
||||||
|
|
||||||
use \DateTime;
|
use \DateTime;
|
||||||
|
use \DateTimeInterface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||||
* Copyright (C) 2010-2016 Michael Bemmerl <mail@mx-server.de>
|
* Copyright (C) 2010-2016, 2022 Michael Bemmerl <mail@mx-server.de>
|
||||||
*
|
*
|
||||||
* This file is part of the "Universal Feed Writer" project.
|
* This file is part of the "Universal Feed Writer" project.
|
||||||
*
|
*
|
||||||
@ -76,6 +77,13 @@ abstract class Feed
|
|||||||
*/
|
*/
|
||||||
private $version = null;
|
private $version = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the encoding of this feed.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $encoding = 'utf-8';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -87,9 +95,6 @@ abstract class Feed
|
|||||||
{
|
{
|
||||||
$this->version = $version;
|
$this->version = $version;
|
||||||
|
|
||||||
// Setting default encoding
|
|
||||||
$this->encoding = 'utf-8';
|
|
||||||
|
|
||||||
// Setting default value for essential channel element
|
// Setting default value for essential channel element
|
||||||
$this->setTitle($version . ' Feed');
|
$this->setTitle($version . ' Feed');
|
||||||
|
|
||||||
@ -396,9 +401,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $title value of 'title' channel tag
|
* @param string $title value of 'title' channel tag
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the title is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setTitle($title)
|
public function setTitle($title)
|
||||||
{
|
{
|
||||||
|
if (empty($title))
|
||||||
|
throw new \InvalidArgumentException('The title may not be empty or NULL.');
|
||||||
|
|
||||||
return $this->setChannelElement('title', $title);
|
return $this->setChannelElement('title', $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,15 +415,15 @@ abstract class Feed
|
|||||||
* Set the date when the feed was lastly updated.
|
* Set the date when the feed was lastly updated.
|
||||||
*
|
*
|
||||||
* This adds the 'updated' element to the feed. The value of the date parameter
|
* This adds the 'updated' element to the feed. The value of the date parameter
|
||||||
* can be either an instance of the DateTime class, an integer containing a UNIX
|
* can be either a class implementing DateTimeInterface, an integer containing a UNIX
|
||||||
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
||||||
*
|
*
|
||||||
* Not supported in RSS1 feeds.
|
* Not supported in RSS1 feeds.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param DateTime|int|string Date which should be used.
|
* @param DateTimeInterface|int|string Date which should be used.
|
||||||
* @return self
|
* @return self
|
||||||
* @throws \InvalidArgumentException if the given date is not an instance of DateTime, a UNIX timestamp or a date string.
|
* @throws \InvalidArgumentException if the given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.
|
||||||
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
||||||
*/
|
*/
|
||||||
public function setDate($date)
|
public function setDate($date)
|
||||||
@ -425,7 +434,7 @@ abstract class Feed
|
|||||||
// The feeds have different date formats.
|
// The feeds have different date formats.
|
||||||
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
||||||
|
|
||||||
if ($date instanceof DateTime)
|
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||||
$date = $date->format($format);
|
$date = $date->format($format);
|
||||||
else if(is_numeric($date) && $date >= 0)
|
else if(is_numeric($date) && $date >= 0)
|
||||||
$date = date($format, $date);
|
$date = date($format, $date);
|
||||||
@ -438,7 +447,7 @@ abstract class Feed
|
|||||||
$date = date($format, $timestamp);
|
$date = date($format, $timestamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw new \InvalidArgumentException('The given date is not an instance of DateTime, a UNIX timestamp or a date string.');
|
throw new \InvalidArgumentException('The given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.');
|
||||||
|
|
||||||
if ($this->version == Feed::ATOM)
|
if ($this->version == Feed::ATOM)
|
||||||
$this->setChannelElement('updated', $date);
|
$this->setChannelElement('updated', $date);
|
||||||
@ -454,9 +463,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $description Description of the feed.
|
* @param string $description Description of the feed.
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the description is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setDescription($description)
|
public function setDescription($description)
|
||||||
{
|
{
|
||||||
|
if (empty($description))
|
||||||
|
throw new \InvalidArgumentException('The description may not be empty or NULL.');
|
||||||
|
|
||||||
if ($this->version != Feed::ATOM)
|
if ($this->version != Feed::ATOM)
|
||||||
$this->setChannelElement('description', $description);
|
$this->setChannelElement('description', $description);
|
||||||
else
|
else
|
||||||
@ -471,9 +484,13 @@ abstract class Feed
|
|||||||
* @access public
|
* @access public
|
||||||
* @param string $link value of 'link' channel tag
|
* @param string $link value of 'link' channel tag
|
||||||
* @return self
|
* @return self
|
||||||
|
* @throws \InvalidArgumentException if the link is empty or NULL.
|
||||||
*/
|
*/
|
||||||
public function setLink($link)
|
public function setLink($link)
|
||||||
{
|
{
|
||||||
|
if (empty($link))
|
||||||
|
throw new \InvalidArgumentException('The link may not be empty or NULL.');
|
||||||
|
|
||||||
if ($this->version == Feed::ATOM)
|
if ($this->version == Feed::ATOM)
|
||||||
$this->setAtomLink($link);
|
$this->setAtomLink($link);
|
||||||
else
|
else
|
||||||
@ -667,7 +684,7 @@ abstract class Feed
|
|||||||
/**
|
/**
|
||||||
* Replace invalid XML characters.
|
* Replace invalid XML characters.
|
||||||
*
|
*
|
||||||
* @link http://www.phpwact.org/php/i18n/charsets#xml See utf8_for_xml() function
|
* @link https://web.archive.org/web/20160608013721/http://www.phpwact.org:80/php/i18n/charsets#xml See utf8_for_xml() function
|
||||||
* @link http://www.w3.org/TR/REC-xml/#charsets
|
* @link http://www.w3.org/TR/REC-xml/#charsets
|
||||||
* @link https://github.com/mibe/FeedWriter/issues/30
|
* @link https://github.com/mibe/FeedWriter/issues/30
|
||||||
*
|
*
|
||||||
@ -906,7 +923,7 @@ abstract class Feed
|
|||||||
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
||||||
|
|
||||||
// An image has its own element after the channel elements.
|
// An image has its own element after the channel elements.
|
||||||
if (array_key_exists('image', $this->data))
|
if (array_key_exists('Image', $this->data))
|
||||||
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
||||||
} else if ($this->version == Feed::ATOM) {
|
} else if ($this->version == Feed::ATOM) {
|
||||||
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
||||||
|
16
module/news/vendor/FeedWriter/Item.php
vendored
16
module/news/vendor/FeedWriter/Item.php
vendored
@ -2,6 +2,7 @@
|
|||||||
namespace FeedWriter;
|
namespace FeedWriter;
|
||||||
|
|
||||||
use \DateTime;
|
use \DateTime;
|
||||||
|
use \DateTimeInterface;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||||
@ -217,19 +218,19 @@ class Item
|
|||||||
/**
|
/**
|
||||||
* Set the 'date' element of the feed item.
|
* Set the 'date' element of the feed item.
|
||||||
*
|
*
|
||||||
* The value of the date parameter can be either an instance of the
|
* The value of the date parameter can be either a class implementing
|
||||||
* DateTime class, an integer containing a UNIX timestamp or a string
|
* DateTimeInterface, an integer containing a UNIX timestamp or a string
|
||||||
* which is parseable by PHP's 'strtotime' function.
|
* which is parseable by PHP's 'strtotime' function.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param DateTime|int|string $date Date which should be used.
|
* @param DateTimeInterface|int|string $date Date which should be used.
|
||||||
* @return self
|
* @return self
|
||||||
* @throws \InvalidArgumentException if the given date was not parseable.
|
* @throws \InvalidArgumentException if the given date was not parseable.
|
||||||
*/
|
*/
|
||||||
public function setDate($date)
|
public function setDate($date)
|
||||||
{
|
{
|
||||||
if (!is_numeric($date)) {
|
if (!is_numeric($date)) {
|
||||||
if ($date instanceof DateTime)
|
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||||
$date = $date->getTimestamp();
|
$date = $date->getTimestamp();
|
||||||
else {
|
else {
|
||||||
$date = strtotime($date);
|
$date = strtotime($date);
|
||||||
@ -277,7 +278,7 @@ class Item
|
|||||||
* Attach a external media to the feed item.
|
* Attach a external media to the feed item.
|
||||||
* Not supported in RSS 1.0 feeds.
|
* Not supported in RSS 1.0 feeds.
|
||||||
*
|
*
|
||||||
* See RFC 4288 for syntactical correct MIME types.
|
* See RFC 6838 for syntactical correct MIME types.
|
||||||
*
|
*
|
||||||
* Note that you should avoid the use of more than one enclosure in one item,
|
* Note that you should avoid the use of more than one enclosure in one item,
|
||||||
* since some RSS aggregators don't support it.
|
* since some RSS aggregators don't support it.
|
||||||
@ -288,7 +289,8 @@ class Item
|
|||||||
* @param string $type The MIME type attribute of the media.
|
* @param string $type The MIME type attribute of the media.
|
||||||
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
||||||
* @return self
|
* @return self
|
||||||
* @link https://tools.ietf.org/html/rfc4288
|
* @link https://tools.ietf.org/html/rfc6838
|
||||||
|
* @link http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||||
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
||||||
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
||||||
*/
|
*/
|
||||||
@ -389,7 +391,7 @@ class Item
|
|||||||
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
||||||
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
||||||
// by using only permanent or historical schemes.
|
// by using only permanent or historical schemes.
|
||||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'bb', 'cap', 'cid', 'coap', 'coap+tcp', 'coap+ws', 'coaps', 'coaps+tcp', 'coaps+ws', 'crid', 'data', 'dav', 'dict', 'dns', 'drop', 'dtn', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'grd', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipn', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'leaptofrogans', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mt', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'p1', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp (OBSOLETE)', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'upt', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'wpid', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||||
$found = FALSE;
|
$found = FALSE;
|
||||||
$checkId = strtolower($id);
|
$checkId = strtolower($id);
|
||||||
|
|
||||||
|
8
module/news/vendor/FeedWriter/README.md
vendored
8
module/news/vendor/FeedWriter/README.md
vendored
@ -12,6 +12,11 @@ Once a feed is fully composed with its items, the feed class can generate the ne
|
|||||||
|
|
||||||
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
You can install via [Composer](https://getcomposer.org/).
|
||||||
|
|
||||||
|
composer require mibe/feedwriter
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
||||||
@ -40,3 +45,6 @@ In chronological order:
|
|||||||
- Pavel Khakhlou
|
- Pavel Khakhlou
|
||||||
- Daniel
|
- Daniel
|
||||||
- Tino Goratsch
|
- Tino Goratsch
|
||||||
|
- John
|
||||||
|
- Özgür Görgülü
|
||||||
|
- Jan Tojnar
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
<?php echo helper::dateUTF8('%d %B %Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||||
<!-- Bloc edition -->
|
<!-- Bloc edition -->
|
||||||
<?php if (
|
<?php if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getUser('group') === self::GROUP_ADMIN)
|
($this->getUser('group') === self::GROUP_ADMIN)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('newsConfigBack', [
|
<?php echo template::button('newsConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts',
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<?php echo template::formOpen('newsEditForm'); ?>
|
<?php echo template::formOpen('newsEditForm'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col2">
|
<div class="col1">
|
||||||
<?php echo template::button('newsEditBack', [
|
<?php echo template::button('newsEditBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2 offset6">
|
<div class="col2 offset7">
|
||||||
<?php echo template::button('newsEditDraft', [
|
<?php echo template::button('newsEditDraft', [
|
||||||
'uniqueSubmission' => true,
|
'uniqueSubmission' => true,
|
||||||
'value' => helper::translate('Brouillon')
|
'value' => helper::translate('Brouillon')
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<?php echo helper::dateUTF8($module::$dateFormat, $news['publishedOn'], self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $news['publishedOn'], self::$i18nUI); ?>
|
<?php echo helper::dateUTF8($module::$dateFormat, $news['publishedOn'], self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $news['publishedOn'], self::$i18nUI); ?>
|
||||||
<!-- Bloc edition -->
|
<!-- Bloc edition -->
|
||||||
<?php if (
|
<?php if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getUser('group') === self::GROUP_ADMIN)
|
($this->getUser('group') === self::GROUP_ADMIN)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::text('newsOptionFeedslabel', [
|
<?php echo template::text('newsOptionFeedslabel', [
|
||||||
'label' => 'Etiquette RSS',
|
'label' => 'Étiquette RSS',
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# Version 2.2
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
# Version 2.1
|
# Version 2.1
|
||||||
- Edition du module ou de la page impossible.
|
- Edition du module ou de la page impossible.
|
||||||
# Version 2.0
|
# Version 2.0
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
class redirection extends common
|
class redirection extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
const VERSION = '2.1';
|
const VERSION = '2.2';
|
||||||
const REALNAME = 'Redirection';
|
const REALNAME = 'Redirection';
|
||||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ class redirection extends common
|
|||||||
{
|
{
|
||||||
// Message si l'utilisateur peut éditer la page
|
// Message si l'utilisateur peut éditer la page
|
||||||
if (
|
if (
|
||||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
$this->isConnected() === true
|
||||||
&& $this->getUser('group') >= self::GROUP_EDITOR
|
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUrl(1) !== 'force'
|
&& $this->getUrl(1) !== 'force'
|
||||||
) {
|
) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('redirectionConfigBack', [
|
<?php echo template::button('redirectionConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# Version 3.2
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
|
# Version 3.1
|
||||||
|
- Initialise un module installé dans une page sans avoir ouvert la page de configuration sans lancer de mise à jour.
|
||||||
# Version 3.0
|
# Version 3.0
|
||||||
- Gestion des permissions intégrée dans le module
|
- Gestion des permissions intégrée dans le module
|
||||||
# Version 2.8
|
# Version 2.8
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
class search extends common
|
class search extends common
|
||||||
{
|
{
|
||||||
|
|
||||||
const VERSION = '3.0';
|
const VERSION = '3.2';
|
||||||
const REALNAME = 'Recherche';
|
const REALNAME = 'Recherche';
|
||||||
const DATADIRECTORY = self::DATA_DIR . 'search/';
|
const DATADIRECTORY = self::DATA_DIR . 'search/';
|
||||||
|
|
||||||
@ -173,8 +173,8 @@ class search extends common
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Mise à jour des données de module
|
// Initialise un module non configuré
|
||||||
$this->update();
|
$this->init();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('searchConfigBack', [
|
<?php echo template::button('searchConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,18 @@
|
|||||||
|
# Version 7.2
|
||||||
|
- Le dossier sélectionné est affiché par défaut dans la page update.
|
||||||
|
# Version 7.1
|
||||||
|
- Améliore le desgin du module
|
||||||
|
# Version 7.0
|
||||||
|
- Ajoute un affichage de la légende sous l'image
|
||||||
|
- Corrige un tri inversé
|
||||||
|
- Erreur dans la feuille de style de la vue index
|
||||||
|
- Bug de calcul de la largeur maximale du slide dans la vue index
|
||||||
|
# Version 6.5
|
||||||
|
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||||
|
# Version 6.4
|
||||||
|
- Corrige plusieurs bugs dans les fonctions de tri
|
||||||
|
# Version 6.3
|
||||||
|
- Corrige un tri non fonctionnel.
|
||||||
# Version 6.2
|
# Version 6.2
|
||||||
- Applique les profils
|
- Applique les profils
|
||||||
# Version 6.1
|
# Version 6.1
|
||||||
|
@ -27,7 +27,7 @@ class slider extends common
|
|||||||
'index' => self::GROUP_VISITOR
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
const VERSION = '6.2';
|
const VERSION = '7.2';
|
||||||
const REALNAME = 'Carrousel';
|
const REALNAME = 'Carrousel';
|
||||||
const DELETE = true;
|
const DELETE = true;
|
||||||
const UPDATE = '0.0';
|
const UPDATE = '0.0';
|
||||||
@ -57,6 +57,7 @@ class slider extends common
|
|||||||
false => 'Puces invisibles'
|
false => 'Puces invisibles'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
public static $auto = [
|
public static $auto = [
|
||||||
true => 'Active',
|
true => 'Active',
|
||||||
false => 'Inactive'
|
false => 'Inactive'
|
||||||
@ -76,7 +77,7 @@ class slider extends common
|
|||||||
1920 => '1920 pixels',
|
1920 => '1920 pixels',
|
||||||
0 => 'Largeur de l\'écran'
|
0 => 'Largeur de l\'écran'
|
||||||
];
|
];
|
||||||
public static $selectedMaxwidth = 0;
|
public static $selectedMaxwidth = 640;
|
||||||
|
|
||||||
// Transition
|
// Transition
|
||||||
public static $speed = [
|
public static $speed = [
|
||||||
@ -125,12 +126,17 @@ class slider extends common
|
|||||||
|
|
||||||
//Choix du tri
|
//Choix du tri
|
||||||
public static $sort = [
|
public static $sort = [
|
||||||
'asc' => 'Alphabétique naturel',
|
'dsc' => 'Alphabétique naturel',
|
||||||
'dsc' => 'Alphabétique naturel inverse',
|
'asc' => 'Alphabétique naturel inverse',
|
||||||
'rand' => 'Aléatoire',
|
'rand' => 'Aléatoire',
|
||||||
'none' => 'Par défaut, sans tri',
|
'none' => 'Par défaut, sans tri',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public static $caption = [
|
||||||
|
'bottom' => 'En bas de l\'image',
|
||||||
|
'alt' => 'Uniquement dans le texte alternatif'
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mise à jour du dossier
|
* Mise à jour du dossier
|
||||||
*/
|
*/
|
||||||
@ -236,15 +242,27 @@ class slider extends common
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Tri des images pour affichage de la liste dans la page d'édition
|
// Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
|
||||||
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'tri'])) {
|
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'sort'])) {
|
||||||
case 'dsc':
|
case 'asc':
|
||||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||||
break;
|
break;
|
||||||
case 'asc':
|
case 'dsc':
|
||||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||||
break;
|
break;
|
||||||
case 'rand':
|
case 'rand':
|
||||||
|
// Récupérer les clés du tableau
|
||||||
|
$keys = array_keys(self::$pictures);
|
||||||
|
// Mélanger les clés
|
||||||
|
shuffle($keys);
|
||||||
|
// Créer un nouveau tableau avec les clés mélangées
|
||||||
|
$shuffledPictures = [];
|
||||||
|
foreach ($keys as $key) {
|
||||||
|
$shuffledPictures[$key] = self::$pictures[$key];
|
||||||
|
}
|
||||||
|
// Mettre à jour le tableau initial avec le nouveau tableau mélangé
|
||||||
|
self::$pictures = $shuffledPictures;
|
||||||
|
break;
|
||||||
case 'none':
|
case 'none':
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -331,7 +349,8 @@ class slider extends common
|
|||||||
'speed' => $speed,
|
'speed' => $speed,
|
||||||
'timeout' => $timeout,
|
'timeout' => $timeout,
|
||||||
'namespace' => $this->getInput('sliderThemeNameSpace', helper::FILTER_STRING_SHORT),
|
'namespace' => $this->getInput('sliderThemeNameSpace', helper::FILTER_STRING_SHORT),
|
||||||
'sort' => $this->getInput('sliderThemeTri', helper::FILTER_STRING_SHORT),
|
'sort' => $this->getInput('sliderThemeSort', helper::FILTER_STRING_SHORT),
|
||||||
|
'caption' => $this->getInput('sliderThemeCaption', helper::FILTER_STRING_SHORT),
|
||||||
],
|
],
|
||||||
'directory' => $this->getData(['module', $this->getUrl(0), 'directory']),
|
'directory' => $this->getData(['module', $this->getUrl(0), 'directory']),
|
||||||
'legends' => $this->getData(['module', $this->getUrl(0), 'legends']),
|
'legends' => $this->getData(['module', $this->getUrl(0), 'legends']),
|
||||||
@ -353,7 +372,7 @@ class slider extends common
|
|||||||
// Sélection largeur de l'écran
|
// Sélection largeur de l'écran
|
||||||
self::$selectedMaxwidth = array_key_exists($this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth']), self::$screenWidth)
|
self::$selectedMaxwidth = array_key_exists($this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth']), self::$screenWidth)
|
||||||
? $this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth'])
|
? $this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth'])
|
||||||
: 0;
|
: 640;
|
||||||
|
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -378,24 +397,33 @@ class slider extends common
|
|||||||
if ($fileInfos->isDot() === false and $fileInfos->isFile() and @getimagesize($fileInfos->getPathname())) {
|
if ($fileInfos->isDot() === false and $fileInfos->isFile() and @getimagesize($fileInfos->getPathname())) {
|
||||||
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = [
|
self::$pictures[$directory . '/' . $fileInfos->getFilename()] = [
|
||||||
'legend' => $this->getData(['module', $galleryId, 'legends', str_replace('.', '', $fileInfos->getFilename())]),
|
'legend' => $this->getData(['module', $galleryId, 'legends', str_replace('.', '', $fileInfos->getFilename())]),
|
||||||
'uri' => $this->getData(['module', $galleryId, 'uri', str_replace('.', '', $fileInfos->getFilename())]),
|
'uri' => $this->getData(['module', $galleryId, 'uri', str_replace('.', '', $fileInfos->getFilename())])
|
||||||
];
|
];
|
||||||
//self::$pictures['uri'][$directory . '/' . $fileInfos->getFilename()] = ;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
|
// Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas
|
||||||
switch ($this->getData(['module', $galleryId, 'config', 'tri'])) {
|
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'sort'])) {
|
||||||
case 'SORT_DSC':
|
case 'asc':
|
||||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||||
break;
|
break;
|
||||||
case 'SORT_ASC':
|
case 'dsc':
|
||||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||||
break;
|
break;
|
||||||
case 'RAND':
|
case 'rand':
|
||||||
break;
|
// Récupérer les clés du tableau
|
||||||
case 'NONE':
|
$keys = array_keys(self::$pictures);
|
||||||
|
// Mélanger les clés
|
||||||
|
shuffle($keys);
|
||||||
|
// Créer un nouveau tableau avec les clés mélangées
|
||||||
|
$shuffledPictures = [];
|
||||||
|
foreach ($keys as $key) {
|
||||||
|
$shuffledPictures[$key] = self::$pictures[$key];
|
||||||
|
}
|
||||||
|
// Mettre à jour le tableau initial avec le nouveau tableau mélangé
|
||||||
|
self::$pictures = $shuffledPictures;
|
||||||
break;
|
break;
|
||||||
|
case 'none':
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -433,7 +461,6 @@ class slider extends common
|
|||||||
private function init()
|
private function init()
|
||||||
{
|
{
|
||||||
if (is_null($this->getData(['module', $this->getUrl(0), 'theme']))) {
|
if (is_null($this->getData(['module', $this->getUrl(0), 'theme']))) {
|
||||||
|
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'module',
|
'module',
|
||||||
$this->getUrl(0),
|
$this->getUrl(0),
|
||||||
@ -445,7 +472,7 @@ class slider extends common
|
|||||||
'speed' => 1000,
|
'speed' => 1000,
|
||||||
'timeout' => 3000,
|
'timeout' => 3000,
|
||||||
'namespace' => 'centered-btns',
|
'namespace' => 'centered-btns',
|
||||||
'tri' => 'RAND',
|
'sort' => 'RAND',
|
||||||
],
|
],
|
||||||
'directory' => null,
|
'directory' => null,
|
||||||
'legends' => [],
|
'legends' => [],
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php echo template::button('galleryConfigBack', [
|
<?php echo template::button('galleryConfigBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||||
'value' => template::ico('left')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -15,222 +15,236 @@
|
|||||||
/*! http://responsiveslides.com v1.55 by @arielsalminen */
|
/*! http://responsiveslides.com v1.55 by @arielsalminen */
|
||||||
|
|
||||||
.rslides {
|
.rslides {
|
||||||
position: relative;
|
position: relative;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rslides li {
|
.rslides li {
|
||||||
-webkit-backface-visibility: hidden;
|
-webkit-backface-visibility: hidden;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: none;
|
display: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rslides li:first-child {
|
.rslides li:first-child {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rslides img {
|
.rslides img {
|
||||||
display: block;
|
display: block;
|
||||||
height: auto;
|
height: auto;
|
||||||
float: left;
|
float: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wrapper {
|
#wrapper {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 50px;
|
margin-bottom: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
.rslides h1 {
|
||||||
font: 600 28px/36px sans-serif;
|
font: 600 28px/36px sans-serif;
|
||||||
margin: 50px 0;
|
margin: 50px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 {
|
.rslides h3 {
|
||||||
font: 600 18px/24px sans-serif;
|
font: 600 18px/24px sans-serif;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin: 0 0 20px;
|
margin: 0 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
.rslides a {
|
||||||
color: #222;
|
color: #222;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rslides {
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rslides_container {
|
.rslides {
|
||||||
margin-bottom: 50px;
|
margin: 0 auto;
|
||||||
position: relative;
|
}
|
||||||
float: left;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centered-btns_nav {
|
.rslides_container {
|
||||||
z-index: 3;
|
margin-bottom: 50px;
|
||||||
position: absolute;
|
position: relative;
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
float: left;
|
||||||
top: 50%;
|
width: 100%;
|
||||||
left: 0;
|
}
|
||||||
opacity: 0.7;
|
|
||||||
text-indent: -9999px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-decoration: none;
|
|
||||||
height: 61px;
|
|
||||||
width: 38px;
|
|
||||||
background: transparent url("module/slider/view/index/black.gif") no-repeat left top;
|
|
||||||
margin-top: -45px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centered-btns_nav:active {
|
.centered-btns_nav {
|
||||||
opacity: 1.0;
|
z-index: 3;
|
||||||
}
|
position: absolute;
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
opacity: 0.7;
|
||||||
|
text-indent: -9999px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-decoration: none;
|
||||||
|
height: 61px;
|
||||||
|
width: 38px;
|
||||||
|
background: transparent url("module/slider/view/index/black.gif") no-repeat left top;
|
||||||
|
margin-top: -45px;
|
||||||
|
}
|
||||||
|
|
||||||
.centered-btns_nav.next {
|
.centered-btns_nav:active {
|
||||||
left: auto;
|
opacity: 1.0;
|
||||||
background-position: right top;
|
}
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.transparent-btns_nav {
|
.centered-btns_nav.next {
|
||||||
z-index: 3;
|
left: auto;
|
||||||
position: absolute;
|
background-position: right top;
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
right: 0;
|
||||||
top: 0;
|
}
|
||||||
left: 0;
|
|
||||||
display: block;
|
|
||||||
background: #fff; /* Fix for IE6-9 */
|
|
||||||
opacity: 0;
|
|
||||||
filter: alpha(opacity=1);
|
|
||||||
width: 48%;
|
|
||||||
text-indent: -9999px;
|
|
||||||
overflow: hidden;
|
|
||||||
height: 91%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.transparent-btns_nav.next {
|
.transparent-btns_nav {
|
||||||
left: auto;
|
z-index: 3;
|
||||||
right: 0;
|
position: absolute;
|
||||||
}
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: block;
|
||||||
|
background: #fff;
|
||||||
|
/* Fix for IE6-9 */
|
||||||
|
opacity: 0;
|
||||||
|
filter: alpha(opacity=1);
|
||||||
|
width: 48%;
|
||||||
|
text-indent: -9999px;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 91%;
|
||||||
|
}
|
||||||
|
|
||||||
.large-btns_nav {
|
.transparent-btns_nav.next {
|
||||||
z-index: 3;
|
left: auto;
|
||||||
position: absolute;
|
right: 0;
|
||||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
}
|
||||||
opacity: 0.6;
|
|
||||||
text-indent: -9999px;
|
|
||||||
overflow: hidden;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
background: #000 url("module/slider/view/index/black.gif") no-repeat left 50%;
|
|
||||||
width: 38px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.large-btns_nav:active {
|
.large-btns_nav {
|
||||||
opacity: 1.0;
|
z-index: 3;
|
||||||
}
|
position: absolute;
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
|
opacity: 0.6;
|
||||||
|
text-indent: -9999px;
|
||||||
|
overflow: hidden;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background: #000 url("module/slider/view/index/black.gif") no-repeat left 50%;
|
||||||
|
width: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
.large-btns_nav.next {
|
.large-btns_nav:active {
|
||||||
left: auto;
|
opacity: 1.0;
|
||||||
background-position: right 50%;
|
}
|
||||||
right: 0;
|
|
||||||
}
|
.large-btns_nav.next {
|
||||||
|
left: auto;
|
||||||
|
background-position: right 50%;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Boutons blancs
|
Boutons blancs
|
||||||
*/
|
*/
|
||||||
.white-btns_nav {
|
.white-btns_nav {
|
||||||
z-index: 3;
|
z-index: 3;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
text-indent: -9999px;
|
text-indent: -9999px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
background: transparent url("module/slider/view/index/white.gif") no-repeat left 50%;
|
background: transparent url("module/slider/view/index/white.gif") no-repeat left 50%;
|
||||||
width: 38px;
|
width: 38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-btns_nav:active {
|
.white-btns_nav:active {
|
||||||
opacity: 1.0;
|
opacity: 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.white-btns_nav.next {
|
.white-btns_nav.next {
|
||||||
left: auto;
|
left: auto;
|
||||||
background-position: right 50%;
|
background-position: right 50%;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Boutons blancs
|
Boutons blancs
|
||||||
*/
|
*/
|
||||||
.centered-btns_nav:focus,
|
.centered-btns_nav:focus,
|
||||||
.transparent-btns_nav:focus,
|
.transparent-btns_nav:focus,
|
||||||
.large-btns_nav:focus,
|
.large-btns_nav:focus,
|
||||||
.white-btns_nav:focus {
|
.white-btns_nav:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.centered-btns_tabs,
|
.centered-btns_tabs,
|
||||||
.transparent-btns_tabs,
|
.transparent-btns_tabs,
|
||||||
.large-btns_tabs,
|
.large-btns_tabs,
|
||||||
.white-btns_tabs {
|
.white-btns_tabs {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.centered-btns_tabs li,
|
.centered-btns_tabs li,
|
||||||
.transparent-btns_tabs li,
|
.transparent-btns_tabs li,
|
||||||
.large-btns_tabs li,
|
.large-btns_tabs li,
|
||||||
.white-btns_tabs li {
|
.white-btns_tabs li {
|
||||||
display: inline;
|
display: inline;
|
||||||
float: none;
|
float: none;
|
||||||
_float: left;
|
margin-right: 5px;
|
||||||
*float: left;
|
}
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centered-btns_tabs a,
|
.centered-btns_tabs a,
|
||||||
.transparent-btns_tabs a,
|
.transparent-btns_tabs a,
|
||||||
.large-btns_tabs a,
|
.large-btns_tabs a,
|
||||||
.white-btns_tabs a {
|
.white-btns_tabs a {
|
||||||
text-indent: -9999px;
|
text-indent: -9999px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-webkit-border-radius: 15px;
|
-webkit-border-radius: 15px;
|
||||||
-moz-border-radius: 15px;
|
-moz-border-radius: 15px;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
background: #ccc;
|
background: #ccc;
|
||||||
background: rgba(0, 0, 0, .2);
|
background: rgba(0, 0, 0, .2);
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
_display: block;
|
/*display: block;*/
|
||||||
*display: block;
|
|
||||||
-webkit-box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
-webkit-box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
||||||
-moz-box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
-moz-box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
||||||
box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
||||||
width: 9px;
|
width: 9px;
|
||||||
height: 9px;
|
height: 9px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.centered-btns_here a,
|
.centered-btns_here a,
|
||||||
.transparent-btns_here a,
|
.transparent-btns_here a,
|
||||||
.large-btns_here a,
|
.large-btns_here a,
|
||||||
.white-btns_here a {
|
.white-btns_here a {
|
||||||
background: #222;
|
background: #222;
|
||||||
background: rgba(0,0,0, .8);
|
background: rgba(0, 0, 0, .8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.caption {
|
||||||
|
position: absolute;
|
||||||
|
display: block;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 15px;
|
||||||
|
text-align: center;
|
||||||
|
background: #000;
|
||||||
|
background: rgba(0,0,0, .8);
|
||||||
|
color: #fff;
|
||||||
|
margin: inherit;
|
||||||
|
}
|
||||||
|
|
@ -36,22 +36,7 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
|
||||||
var maxwidth = "<?php echo $this->getData(['module', $this->getUrl(0),'theme', 'maxWidth']); ?>";
|
var maxwidth = "<?php echo $this->getData(['module', $this->getUrl(0),'theme', 'maxWidth']); ?>";
|
||||||
var screenwidth = "<?php echo intval(trim($this->getData(['theme', 'site', 'width']), 'px')); ?>";
|
|
||||||
var sort = "<?php echo $this->getData(['module', $this->getUrl(0),'theme', 'sort']); ?>";
|
var sort = "<?php echo $this->getData(['module', $this->getUrl(0),'theme', 'sort']); ?>";
|
||||||
// Réduction de la taille maximale selon la largeur de la section
|
|
||||||
|
|
||||||
// Limiter à la largeur de l'écran
|
|
||||||
if (
|
|
||||||
screenwidth !== '100%' &&
|
|
||||||
maxwidth > screenwidth
|
|
||||||
) {
|
|
||||||
mawwidth = screenwidth - 40;
|
|
||||||
}
|
|
||||||
// Largeur 100%
|
|
||||||
maxwidth = $("#site").width();
|
|
||||||
|
|
||||||
|
|
||||||
console.log(maxwidth);
|
|
||||||
$("#wrapper").css('width', "100%");
|
$("#wrapper").css('width', "100%");
|
||||||
$(function () {
|
$(function () {
|
||||||
$("#sliders").responsiveSlides({
|
$("#sliders").responsiveSlides({
|
||||||
|
@ -2,15 +2,17 @@
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<div class="rslides_container">
|
<div class="rslides_container">
|
||||||
<ul class="rslides" id="sliders">
|
<ul class="rslides" id="sliders">
|
||||||
<!--id="<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'boutonsVisibles']); ?>"> -->
|
|
||||||
<?php foreach ($module::$pictures as $picture => $options): ?>
|
<?php foreach ($module::$pictures as $picture => $options): ?>
|
||||||
<?php if (!empty($options['uri'])): ?>
|
<?php if (!empty($options['uri'])): ?>
|
||||||
<a href="<?php echo helper::baseUrl() . $options['uri']; ?>">
|
<a href="<?php echo helper::baseUrl() . $options['uri']; ?>">
|
||||||
|
<?php endif; ?>
|
||||||
|
<li>
|
||||||
|
<img src="<?php echo helper::baseUrl(false) . $picture; ?>" alt="<?php echo $options['legend']; ?>">
|
||||||
|
<?php if ($this->getData(['module', $this->getUrl(0), 'theme', 'caption']) === 'bottom'): ?>
|
||||||
|
<p class="caption"><?php echo $options['legend']; ?></p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<li>
|
</li>
|
||||||
<img src="<?php echo helper::baseUrl(false) . $picture; ?>" alt="<?php echo $options['legend']; ?>">
|
<?php if (!empty($options['uri'])): ?>
|
||||||
</li>
|
|
||||||
<?php if (!empty($options['uri'])): ?>
|
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user