Compare commits
215 Commits
Author | SHA1 | Date | |
---|---|---|---|
823e1cfd0e | |||
c0e6781dda | |||
341e002ef2 | |||
a87d04ef5f | |||
11656c72ca | |||
72ee7c9ab6 | |||
483ebd64fe | |||
1a6fadf976 | |||
9b3c7707f0 | |||
261ef2f312 | |||
0abb336850 | |||
82b55210d8 | |||
41f36ef5e6 | |||
71dfbff8d7 | |||
1c57e8dd1d | |||
625308b74b | |||
466e557c1d | |||
121013a48a | |||
1fcc5f92a8 | |||
1c8e2038f6 | |||
29b0a28173 | |||
bd6d5f0128 | |||
6bbd622a98 | |||
d39bf7bc86 | |||
ffd80cde21 | |||
65e2dc8dff | |||
e52c25ad0b | |||
55c7791efa | |||
ec2fc0ab4f | |||
16d4d16950 | |||
b7be76a7e4 | |||
d6072c8591 | |||
23d2631fd7 | |||
06b3690d48 | |||
3c32b3650e | |||
101bae34e8 | |||
f7d53906e2 | |||
bdc9e40627 | |||
d5dfdca9d2 | |||
ce6c4929a0 | |||
c3ac31de69 | |||
24e1238e50 | |||
281e578f4d | |||
1a88ae05e6 | |||
df0c579af0 | |||
a25dbc6bd2 | |||
8e1c8a5ba5 | |||
cce2983347 | |||
6c2bed771c | |||
ae265ba5e7 | |||
909c79559b | |||
97c8573de8 | |||
6274d2c1ff | |||
409b7edb94 | |||
6b82b3af83 | |||
3013f33b35 | |||
77fbb45c71 | |||
2a0849e49a | |||
ac8e713935 | |||
118dfc79b3 | |||
6727752a2d | |||
75a6a093ed | |||
922cba9f5a | |||
35d0b2aa3c | |||
776afaff03 | |||
1c46900156 | |||
08a2264709 | |||
f7db1bf20f | |||
ffd14a8734 | |||
161c1bcb80 | |||
02514ff446 | |||
fdce67d101 | |||
8d1cbc6b88 | |||
b73f8a1c28 | |||
00a0c3d795 | |||
6b8d769e43 | |||
10b79c586b | |||
3c3579a29d | |||
017f02afc4 | |||
df235541d1 | |||
a456047969 | |||
ac48e61264 | |||
604bf2db77 | |||
4055d3e68a | |||
393722038b | |||
54c90bec11 | |||
039ee80db4 | |||
9f30f356cb | |||
fd10883652 | |||
6805111c47 | |||
86ce4a75b4 | |||
03932db20d | |||
d3f247f6fb | |||
c5af0fb37c | |||
9532be0cdc | |||
e0748c2eb6 | |||
5811836238 | |||
92b3854516 | |||
e85801db50 | |||
53dd6a82e6 | |||
75b230b2ed | |||
47a5ddb442 | |||
d0f779bb9b | |||
568b79e854 | |||
06bbeb0d2e | |||
75bb94b9a7 | |||
dfd0f1ad2a | |||
7a4b1589af | |||
da9d8d9d62 | |||
e3bc6ce1d3 | |||
ecd0f5827a | |||
c8be7f84a4 | |||
826e6264eb | |||
cc0b6edb34 | |||
0e564a24c9 | |||
7da12be242 | |||
095e317f3b | |||
67eeef26a0 | |||
2273812b2d | |||
4842e3f62b | |||
01c69f0712 | |||
baa5b762e2 | |||
76cd034fd3 | |||
a929fb3482 | |||
5ea3e12e26 | |||
141a22b6ff | |||
3f1d19f53e | |||
fcfb3ea677 | |||
dfceb941db | |||
9db6e5ac13 | |||
aceb94da3e | |||
12c7682a26 | |||
5d282a4cc4 | |||
a8bf3ec857 | |||
bb9573a82f | |||
15534ba9fa | |||
6aecf5e796 | |||
25f81af87b | |||
c78b43f7b0 | |||
6daeb9e474 | |||
5986e8a378 | |||
14068d24a8 | |||
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 |
11
.htaccess
11
.htaccess
@ -32,5 +32,16 @@ Options -Indexes
|
||||
Options -MultiViews
|
||||
</IfModule>
|
||||
|
||||
# Enlever le slash final des URL
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_URI} ^(.+)/$
|
||||
RewriteRule ^ %1 [R=301,L]
|
||||
|
||||
# ne pas supprimer la ligne URL rewriting !
|
||||
# URL rewriting
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
76
CHANGES.md
76
CHANGES.md
@ -1,5 +1,75 @@
|
||||
# Changelog
|
||||
# Notes de mises à jour
|
||||
|
||||
## Versions 13.5.00
|
||||
**Améliorations :**
|
||||
- Optimisation du chargement des variables de classe.
|
||||
- Suppression de redondance de déclaration des charset.
|
||||
|
||||
**Corrections : **
|
||||
- Corrige un bug de changement de mot de passe pour les comptes non admins.
|
||||
- Blog 7.12, corrige un bug d'affichage des articles lorsque le thème Moderne est sélectionné.
|
||||
- Corrige un dysfonctionnement de la fonction de tronquage subword qui perturbait l'affichage des articles de blog.
|
||||
|
||||
## Versions 13.4.00
|
||||
** Améliorations :**
|
||||
- Change le mode d'authentification, le hash du mot de passe n'est plus stocké dans un cookie.
|
||||
- Améliore les performances des opérations d'écriture.
|
||||
- Le sélecteur de fichier affiche le chemin d'accès du fichier présent dans le champ dans le gestionnaire de fichier.
|
||||
- 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.
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
@ -20,7 +90,7 @@ Modification de la fonction d'écriture des données de la classe jsonDB dans le
|
||||
### Corrections
|
||||
|
||||
- Corrige des erreurs quand une page parente ou des pages enfants ont des permissions limitées.
|
||||
- Module Search 3.1 : initialisation du module après installation dans une page sans configration par l'utilisateur.
|
||||
- Module Search 3.1 : initialisation du module après installation dans une page sans configuration par l'utilisateur.
|
||||
|
||||
### Améliorations
|
||||
|
||||
@ -778,7 +848,7 @@ TinyMCE, URL absolues, transformation autorisée en URL relative si effectuée m
|
||||
- Modifications :
|
||||
- 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.
|
||||
- Etiquette dans le footer permettant d'afficher la popup des cookies.
|
||||
- Étiquette dans le footer permettant d'afficher la popup des cookies.
|
||||
- Thème :
|
||||
- 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.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# ZwiiCMS 13.3.00
|
||||
# ZwiiCMS 13.5.00
|
||||
|
||||
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.3.00
|
||||
# ZwiiCMS 13.5.00
|
||||
|
||||
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 */
|
||||
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_ID = 4;
|
||||
const FILTER_INT = 5;
|
||||
@ -16,8 +16,14 @@ class helper
|
||||
const FILTER_PASSWORD = 7;
|
||||
const FILTER_STRING_LONG = 8;
|
||||
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_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
|
||||
/*
|
||||
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
||||
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
||||
$data = array_merge($dialogues,[$text => '']);
|
||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
}
|
||||
*/
|
||||
if (array_key_exists($text, core::$dialog) === false && !empty($text)) {
|
||||
$dialogues = json_decode(file_get_contents('core/module/install/ressource/i18n/fr_FR.json' ), true);
|
||||
$data = array_merge($dialogues,[$text => '']);
|
||||
file_put_contents ('core/module/install/ressource/i18n/fr_FR.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
}
|
||||
*/
|
||||
return (array_key_exists($text, core::$dialog) && !empty(core::$dialog[$text]) ? core::$dialog[$text] : $text);
|
||||
}
|
||||
|
||||
@ -338,13 +344,12 @@ class helper
|
||||
{
|
||||
// N'interroge que le serveur Apache
|
||||
if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') > 0) {
|
||||
self::$rewriteStatus === false;
|
||||
} elseif (self::$rewriteStatus === null) {
|
||||
self::$rewriteStatus = false;
|
||||
} else {
|
||||
// Ouvre et scinde le fichier .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
|
||||
//self::$rewriteStatus = (empty($htaccess[1]) === false);
|
||||
self::$rewriteStatus = (strpos($htaccess[1], 'RewriteEngine on') > 0) ? true : false;
|
||||
self::$rewriteStatus = (strpos($htaccess[1], 'RewriteEngine on') !== false);
|
||||
}
|
||||
return self::$rewriteStatus;
|
||||
}
|
||||
@ -390,10 +395,10 @@ class helper
|
||||
'text' => self::relativeLuminanceW3C($rgba) > .22 ? "#222" : "#DDD",
|
||||
'rgb' => 'rgb(' . $rgba[0] . ',' . $rgba[1] . ',' . $rgba[2] . ')',
|
||||
'invert' => 'rgba (' .
|
||||
($rgba[0] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[0] < 128 ? 255 : 0) . ')'
|
||||
($rgba[0] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[1] < 128 ? 255 : 0) . ',' .
|
||||
($rgba[0] < 128 ? 255 : 0) . ')'
|
||||
];
|
||||
}
|
||||
|
||||
@ -403,8 +408,8 @@ class helper
|
||||
*/
|
||||
public static function deleteCookie($cookieKey)
|
||||
{
|
||||
unset($_COOKIE[$cookieKey]);
|
||||
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
||||
unset($_COOKIE[$cookieKey]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -427,7 +432,8 @@ class helper
|
||||
$text = (int) $date->format('U');
|
||||
break;
|
||||
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;
|
||||
break;
|
||||
case self::FILTER_ID:
|
||||
@ -474,6 +480,11 @@ class helper
|
||||
case self::FILTER_URL:
|
||||
$text = filter_var($text, FILTER_SANITIZE_URL);
|
||||
break;
|
||||
case self::FILTER_DATE:
|
||||
$text = date('Y-m-d', $text);
|
||||
break;
|
||||
case self::FILTER_TIME:
|
||||
$text = date('H:i', $text);
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
@ -662,13 +673,35 @@ class helper
|
||||
public static function subword($text, $start, $length)
|
||||
{
|
||||
$text = trim($text);
|
||||
if (strlen($text) > $length) {
|
||||
|
||||
// Vérifier si la longueur du texte sans les balises dépasse la longueur souhaitée
|
||||
if (mb_strlen(strip_tags($text)) > $length) {
|
||||
// Utiliser mb_substr pour couper le texte
|
||||
$text = mb_substr($text, $start, $length);
|
||||
$text = mb_substr($text, 0, min(mb_strlen($text), mb_strrpos($text, ' ')));
|
||||
|
||||
// S'assurer que le texte ne se termine pas au milieu d'un mot
|
||||
$lastSpace = mb_strrpos($text, ' ');
|
||||
if ($lastSpace !== false) {
|
||||
$text = mb_substr($text, 0, $lastSpace);
|
||||
}
|
||||
|
||||
// Fermer les balises HTML ouvertes
|
||||
$dom = new DOMDocument();
|
||||
@$dom->loadHTML('<div>' . $text . '</div>', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
$text = $dom->saveHTML();
|
||||
|
||||
// Retirer la balise de conteneur ajoutée
|
||||
$text = preg_replace('~^<div>(.*)</div>$~s', '$1', $text);
|
||||
|
||||
// Ajouter des points de suspension si le texte a été coupé
|
||||
$text .= '...';
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Cryptage
|
||||
* @param string $key la clé d'encryptage
|
||||
|
@ -149,7 +149,8 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
public function save()
|
||||
{
|
||||
// Encode les données au format JSON avec les options spécifiées
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
|
||||
//$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT | JSON_PRETTY_PRINT);
|
||||
$encoded_data = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||
|
||||
// Vérifie la longueur de la chaîne JSON encodée
|
||||
$encoded_length = strlen($encoded_data);
|
||||
@ -162,6 +163,9 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
// 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
|
||||
|
||||
//$now = \DateTime::createFromFormat('U.u', microtime(true));
|
||||
//file_put_contents("tmplog.txt", '[JsonDb][' . $now->format('H:i:s.u') . ']--' . $this->db . "\r\n", FILE_APPEND);
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result === $encoded_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
|
@ -82,17 +82,25 @@ class layout extends common
|
||||
$content = 'col' . $blocks[1];
|
||||
$blockright = 'col' . $blocks[2];
|
||||
}
|
||||
// Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
||||
$pattern = ['config', 'edit', 'add', 'comment', 'data'];
|
||||
// Toujours en pleine page pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
|
||||
$pattern = ['config', 'edit', 'add', 'comment', 'data', 'option', 'theme', 'comment', 'article', 'data', 'gallery', 'update', 'users', 'validate'];
|
||||
if (
|
||||
(sizeof($blocks) === 1 ||
|
||||
in_array($this->getUrl(1), $pattern))
|
||||
) { // Pleine page en mode configuration
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') {
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top'
|
||||
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
$this->showNavButtons('top');
|
||||
}
|
||||
$this->showContent();
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') {
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom'
|
||||
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
$this->showNavButtons('bottom');
|
||||
}
|
||||
} else {
|
||||
@ -330,7 +338,7 @@ class layout extends common
|
||||
// Affichage du lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'footer', 'loginLink'])
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -493,7 +501,7 @@ class layout extends common
|
||||
// Lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'menu', 'loginLink'])
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -580,9 +588,9 @@ class layout extends common
|
||||
|
||||
if (
|
||||
($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
@ -646,9 +654,9 @@ class layout extends common
|
||||
$items .= '<li id=' . $childKey . '>';
|
||||
if (
|
||||
($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
@ -742,7 +750,7 @@ class layout extends common
|
||||
$items .= '<li class="menuSideChild">';
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) {
|
||||
$items .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -766,7 +774,7 @@ class layout extends common
|
||||
|
||||
if (
|
||||
$this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) {
|
||||
$itemsChildren .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -902,7 +910,7 @@ class layout extends common
|
||||
*/
|
||||
public function showBar()
|
||||
{
|
||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
if ($this->isConnected() === true) {
|
||||
// Items de gauche
|
||||
$leftItems = '';
|
||||
// Sélecteur de langues
|
||||
@ -990,14 +998,17 @@ class layout extends common
|
||||
// Sur une page sans module
|
||||
or $this->getData(['page', $this->getUrl(0), 'moduleId']) === ''
|
||||
// Sur une page avec un module invalide
|
||||
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) &&
|
||||
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) and
|
||||
!class_exists($this->getData(['page', $this->getUrl(2), 'moduleId']))
|
||||
)
|
||||
// Sur une page d'accueil
|
||||
or $this->getUrl(0) === ''
|
||||
) {
|
||||
// Bouton Editer une page
|
||||
if ($this->getUser('permission', 'page', 'edit')) {
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'edit')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('pencil', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'help' => 'Éditer la page'
|
||||
@ -1006,7 +1017,8 @@ class layout extends common
|
||||
// Bouton Editer le module d'une page
|
||||
if (
|
||||
$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', [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
@ -1016,6 +1028,7 @@ class layout extends common
|
||||
// Bouton dupliquer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'duplicate')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('clone', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
@ -1026,6 +1039,8 @@ class layout extends common
|
||||
// Bouton Effacer une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'delete')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('trash', [
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
@ -1056,18 +1071,14 @@ class layout extends common
|
||||
'help' => 'Thème',
|
||||
'href' => helper::baseUrl() . 'theme'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
$rightItems .= '<li>' . template::ico('users', [
|
||||
'help' => 'Utilisateurs',
|
||||
'href' => helper::baseUrl() . 'user'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('cog-alt', [
|
||||
'help' => 'Configuration',
|
||||
'href' => helper::baseUrl() . 'config'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('users', [
|
||||
'help' => 'Utilisateurs',
|
||||
'href' => helper::baseUrl() . 'user'
|
||||
]) . '</li>';
|
||||
// Mise à jour automatique
|
||||
$today = mktime(0, 0, 0);
|
||||
$checkUpdate = $this->getData(['core', 'lastAutoUpdate']);
|
||||
@ -1079,21 +1090,55 @@ class layout extends common
|
||||
$today > $checkUpdate + $this->getData(['config', 'autoUpdateDelay', 86400])
|
||||
) {
|
||||
// Dernier auto controle
|
||||
$this->setData(['core', 'lastAutoUpdate', $today]);
|
||||
$this->setData(['core', 'lastAutoUpdate', $today], false);
|
||||
if (
|
||||
helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)
|
||||
) {
|
||||
$this->setData(['core', 'updateAvailable', true]);
|
||||
$this->setData(['core', 'updateAvailable', true], false);
|
||||
}
|
||||
|
||||
// Modules installés
|
||||
$infoModules = helper::getModules();
|
||||
// Recherche de mise à jour des modules
|
||||
$store = plugin::getStore();
|
||||
if (is_array($store)) {
|
||||
// Parcourir les données des modules du store
|
||||
foreach ($store as $key => $value) {
|
||||
if (empty($key)) {
|
||||
continue;
|
||||
}
|
||||
// Mise à jour d'un module
|
||||
// Le module est installé et une mise à jour est en ligne
|
||||
if (
|
||||
isset($infoModules[$key])
|
||||
&&
|
||||
version_compare($infoModules[$key]['version'], $value['version'], '<')
|
||||
) {
|
||||
$this->setData(['core', 'updateModuleAvailable', true], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sauvegarde la base manuellement
|
||||
$this->saveDB('core');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Afficher le bouton : Mise à jour détectée + activée
|
||||
if ($this->getData(['core', 'updateAvailable'])) {
|
||||
$rightItems .= '<li><a href="' . helper::baseUrl() . 'install/update" data-tippy-content="Mettre à jour Zwii ' . common::ZWII_VERSION . ' vers ' . helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) . '">' . template::ico('update colorRed') . '</a></li>';
|
||||
}
|
||||
}
|
||||
if ($this->getData(['core', 'updateModuleAvailable'])) {
|
||||
$rightItems .= '<li>' . template::ico('puzzle colorRed', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
} else {
|
||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Boutons depuis le groupe éditeur
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
&& $this->getUser('permission', 'user', 'edit')
|
||||
@ -1181,7 +1226,7 @@ class layout extends common
|
||||
$vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';';
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||
) {
|
||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||
|
@ -11,7 +11,7 @@ class core extends common
|
||||
parent::__construct();
|
||||
// Token CSRF
|
||||
if (empty($_SESSION['csrf'])) {
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(128));
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(64));
|
||||
}
|
||||
|
||||
// Fuseau horaire
|
||||
@ -32,8 +32,6 @@ class core extends common
|
||||
}
|
||||
// Date de la dernière suppression
|
||||
$this->setData(['core', 'lastClearTmp', $lastClearTmp]);
|
||||
// Enregistre les données
|
||||
//$this->SaveData();
|
||||
}
|
||||
// Backup automatique des données
|
||||
$lastBackup = mktime(0, 0, 0);
|
||||
@ -415,7 +413,7 @@ class core extends common
|
||||
|
||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
and ($this->getUser('group') === common::GROUP_BANNED
|
||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
@ -429,8 +427,8 @@ class core extends common
|
||||
$this->getData(['config', 'maintenance'])
|
||||
and in_array($this->getUrl(0), ['maintenance', 'user']) === false
|
||||
and $this->getUrl(1) !== 'login'
|
||||
and ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and ($this->isConnected() === false
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('group') < common::GROUP_ADMIN
|
||||
)
|
||||
)
|
||||
@ -449,7 +447,7 @@ class core extends common
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
if (
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
or ($this->isConnected() === true
|
||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||
// 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']))
|
||||
@ -466,14 +464,22 @@ class core extends common
|
||||
// Empêcher l'accès aux pages désactivées par URL directe
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -507,10 +513,11 @@ class core extends common
|
||||
}
|
||||
// Accès concurrent stocke la page visitée
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
&& $this->getUser('id')
|
||||
&& !$this->isPost()
|
||||
) {
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()]);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()], false);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessTimer', time()]);
|
||||
}
|
||||
// Breadcrumb
|
||||
@ -627,7 +634,7 @@ class core extends common
|
||||
// Check le groupe de l'utilisateur
|
||||
if (
|
||||
($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('permission', $moduleId, $action)
|
||||
)
|
||||
@ -715,7 +722,7 @@ class core extends common
|
||||
$this->addOutput([
|
||||
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')
|
||||
]);
|
||||
} else if ($modpos === 'free') {
|
||||
} elseif ($modpos === 'free' && strstr($pageContent, '[MODULE]')) {
|
||||
if (strstr($pageContent, '[MODULE]', true) === false) {
|
||||
$begin = strstr($pageContent, '[]', true);
|
||||
} else {
|
||||
@ -795,7 +802,8 @@ class core extends common
|
||||
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) {;
|
||||
foreach (common::$languages as $langId => $value) {
|
||||
;
|
||||
if (
|
||||
// l'espace existe
|
||||
is_dir(common::DATA_DIR . $langId) &&
|
||||
|
@ -128,7 +128,17 @@ class SitemapGenerator
|
||||
*/
|
||||
private $sampleRobotsLines = [
|
||||
"User-agent: *",
|
||||
"Disallow: /",
|
||||
"User-agent: Googlebot",
|
||||
"Allow: /",
|
||||
"User-agent: bingbot",
|
||||
"Allow: /",
|
||||
"User-agent: Slurp",
|
||||
"Allow: /",
|
||||
"User-agent: DuckDuckBot",
|
||||
"Allow: /",
|
||||
"User-agent: Baiduspider",
|
||||
"Allow: /"
|
||||
];
|
||||
/**
|
||||
* @var array list of valid changefreq values according to the spec
|
||||
|
@ -28,7 +28,7 @@ class template
|
||||
$attributes['value'] = helper::translate($attributes['value']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
// Retourne le html
|
||||
return sprintf(
|
||||
return sprintf(
|
||||
'<a %s class="button %s %s %s" %s>%s</a>',
|
||||
helper::sprintAttributes($attributes, ['class', 'disabled', 'ico', 'value']),
|
||||
$attributes['disabled'] ? 'disabled' : '',
|
||||
@ -65,12 +65,12 @@ class template
|
||||
// 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];
|
||||
$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
|
||||
mt_srand();
|
||||
// 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
|
||||
if ($operator > 2) {
|
||||
@ -94,15 +94,15 @@ class template
|
||||
switch ($operator) {
|
||||
case 1:
|
||||
$operator = template::ico('plus', ['fontSize' => '2em;']);
|
||||
$result = $firstNumber + $secondNumber;
|
||||
$result = $firstNumber + $secondNumber;
|
||||
break;
|
||||
case 2:
|
||||
$operator = template::ico('minus', ['fontSize' => '2em;']);
|
||||
$result = $firstNumber - $secondNumber;
|
||||
$result = $firstNumber - $secondNumber;
|
||||
break;
|
||||
case 3:
|
||||
$operator = template::ico('cancel', ['fontSize' => '2em;']);
|
||||
$result = $firstNumber * $secondNumber;
|
||||
$result = $firstNumber * $secondNumber;
|
||||
break;
|
||||
case 4:
|
||||
$operator = template::ico('divide', ['fontSize' => '2em;']);
|
||||
@ -112,7 +112,7 @@ class template
|
||||
}
|
||||
mt_srand();
|
||||
$secondNumber = mt_rand(1, $limit);
|
||||
$firstNumber = $firstNumber * $secondNumber;
|
||||
$firstNumber = $firstNumber * $secondNumber;
|
||||
$result = $firstNumber / $secondNumber;
|
||||
break;
|
||||
}
|
||||
@ -125,8 +125,8 @@ class template
|
||||
$secondLetter = uniqid();
|
||||
|
||||
// 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[$secondNumber] . '.png', 'site/tmp/' . $secondLetter . '.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');
|
||||
|
||||
|
||||
// Début du wrapper
|
||||
@ -134,7 +134,7 @@ class template
|
||||
// Label
|
||||
$html .= self::label(
|
||||
$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']
|
||||
]
|
||||
@ -224,7 +224,7 @@ class template
|
||||
* Crée un champ date
|
||||
* @param string $nameId Nom et id du champ
|
||||
* @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
|
||||
*/
|
||||
public static function date($nameId, array $attributes = [])
|
||||
@ -244,17 +244,32 @@ class template
|
||||
'placeholder' => '',
|
||||
'readonly' => false,
|
||||
'value' => '',
|
||||
'type'=> 'date',
|
||||
'type' => 'date',
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$attributes['label'] = helper::translate($attributes['label']);
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
//$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
|
||||
if ($attributes['before'] and array_key_exists($attributes['id'], common::$inputBefore)) {
|
||||
$attributes['value'] = common::$inputBefore[$attributes['id']];
|
||||
} 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
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
@ -310,6 +325,7 @@ class template
|
||||
'name' => $nameId,
|
||||
'type' => 2,
|
||||
'value' => '',
|
||||
'folder' => '',
|
||||
'language' => 'fr_FR'
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
@ -346,14 +362,16 @@ class template
|
||||
$html .= sprintf(
|
||||
'<a
|
||||
href="' .
|
||||
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
||||
'?relative_url=1' .
|
||||
'&lang=' . $attributes['language'] .
|
||||
'&field_id=' . $attributes['id'] .
|
||||
'&type=' . $attributes['type'] .
|
||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||
. '"
|
||||
helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php' .
|
||||
'?relative_url=1' .
|
||||
'&lang=' . $attributes['language'] .
|
||||
'&field_id=' . $attributes['id'] .
|
||||
'&type=' . $attributes['type'] .
|
||||
'&akey=' . md5_file(core::DATA_DIR . 'core.json') .
|
||||
// Ajoute le nom du dossier si la variable est passée
|
||||
(!empty($attributes['folder']) ? '&fldr=' . $attributes['folder'] : '') .
|
||||
($attributes['extensions'] ? '&extensions=' . $attributes['extensions'] : '')
|
||||
. '"
|
||||
class="inputFile %s %s"
|
||||
%s
|
||||
data-lity
|
||||
@ -471,7 +489,7 @@ class template
|
||||
// Traduction de l'aide
|
||||
$attributes['help'] = helper::translate($attributes['help']);
|
||||
// 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 .= '<span class="zwiico-' . $ico . ($attributes['margin'] ? ' zwiico-margin-' . $attributes['margin'] : '') . ($attributes['animate'] ? ' animate-spin' : '') . '" style="font-size:' . $attributes['fontSize'] . '"><!----></span>';
|
||||
$item .= ($attributes['href']) ? '</a>' : '';
|
||||
@ -686,12 +704,12 @@ class template
|
||||
'label' => '',
|
||||
'name' => $nameId,
|
||||
'selected' => '',
|
||||
'font' => [],
|
||||
'font' => [],
|
||||
'multiple' => ''
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
$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
|
||||
if (empty($attributes['font']) === false) {
|
||||
$fonts = $attributes['font'];
|
||||
@ -728,7 +746,7 @@ class template
|
||||
);
|
||||
foreach ($options as $value => $text) {
|
||||
// Select des liste de fontes
|
||||
$html .= isset($fonts) ? sprintf(
|
||||
$html .= isset($fonts) ? sprintf(
|
||||
'<option value="%s"%s style="font-family: %s;">%s</option>',
|
||||
$value,
|
||||
$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
|
||||
$attributes['value'] = helper::translate($attributes['value']);
|
||||
// Retourne le html
|
||||
return sprintf(
|
||||
return sprintf(
|
||||
'<button type="submit" class="%s%s" %s>%s</button>',
|
||||
$attributes['class'],
|
||||
$attributes['uniqueSubmission'] ? 'uniqueSubmission' : '',
|
||||
@ -810,7 +828,7 @@ class template
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
foreach ($head as $value) {
|
||||
$head[array_search($value, $head)] = helper::translate($value);
|
||||
$head[array_search($value, $head)] = helper::translate($value);
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="tableWrapper ' . $attributes['classWrapper'] . '">';
|
||||
@ -905,7 +923,7 @@ class template
|
||||
$html .= self::notice($attributes['id'], $notice);
|
||||
// Texte
|
||||
$html .= sprintf(
|
||||
'<input type="' . $attributes['type']. '" %s>',
|
||||
'<input type="' . $attributes['type'] . '" %s>',
|
||||
helper::sprintAttributes($attributes)
|
||||
);
|
||||
// Fin du wrapper
|
||||
|
@ -216,12 +216,14 @@ core.start = function () {
|
||||
// Variables des cookies
|
||||
var getUrl = window.location;
|
||||
var domain = "domain=" + getUrl.hostname + ";";
|
||||
var basePath = getUrl.pathname.substring(0, getUrl.pathname.lastIndexOf('/') + 1);
|
||||
var path = "path=" + basePath + ";";
|
||||
var e = new Date();
|
||||
e.setFullYear(e.getFullYear() + 1);
|
||||
var expires = "expires=" + e.toUTCString();
|
||||
var expires = "expires=" + e.toUTCString() + ";";
|
||||
|
||||
// Stocke le cookie d'acceptation
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires;
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true; samesite=lax; " + domain + path + expires;
|
||||
});
|
||||
|
||||
|
||||
@ -462,7 +464,7 @@ $(document).ready(function () {
|
||||
/**
|
||||
* Chargement paresseux des images et des iframes
|
||||
*/
|
||||
$("img,picture,iframe").attr("loading", "lazy");
|
||||
$("img").attr("loading", "lazy");
|
||||
|
||||
/**
|
||||
* Effet accordéon
|
||||
|
102
core/core.php
102
core/core.php
@ -51,11 +51,18 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '13.3.00';
|
||||
const ZWII_VERSION = '13.5.00';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/';
|
||||
const ZWII_UPDATE_CHANNEL = 'v13';
|
||||
|
||||
/**
|
||||
* Branche de base pour la mise à jour
|
||||
* Pour les versions supérieures à 13.4 et inférieure à 14, la branche reste sur v134
|
||||
* La branche v13 est maintenue afin de télécharger un correctif permettant d'installer
|
||||
* les version supérieures.
|
||||
*/
|
||||
const ZWII_UPDATE_CHANNEL = 'v134';
|
||||
|
||||
// Valeurs possibles multiple de 10, 10 autorise 9 profils, 100 autorise 99 profils
|
||||
const MAX_PROFILS = 10;
|
||||
@ -331,6 +338,19 @@ class common
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Récupération du cache des propriétés
|
||||
if(isset($GLOBALS['common_cache'])) {
|
||||
$this->input['_POST'] = $GLOBALS['common_cache']['input']['_POST'];
|
||||
$this->input['_COOKIE'] = $GLOBALS['common_cache']['input']['_COOKIE'];
|
||||
self::$siteContent = $GLOBALS['common_cache']['siteContent'];
|
||||
$this->dataFiles = $GLOBALS['common_cache']['dataFiles'];
|
||||
$this->user = $GLOBALS['common_cache']['user'];
|
||||
self::$i18nUI = $GLOBALS['common_cache']['i18nUI'];
|
||||
$this->hierarchy = $GLOBALS['common_cache']['hierarchy'];
|
||||
$this->url = $GLOBALS['common_cache']['url'];
|
||||
self::$dialog = $GLOBALS['common_cache']['dialog'];
|
||||
return;
|
||||
}
|
||||
|
||||
// Extraction des données http
|
||||
if (isset($_POST)) {
|
||||
@ -354,12 +374,13 @@ class common
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Localisation
|
||||
\setlocale(LC_ALL, self::$siteContent . '.UTF8');
|
||||
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
$this->jsonDB(self::$siteContent);
|
||||
|
||||
|
||||
// Installation fraîche, initialisation des modules
|
||||
if ($this->user === []) {
|
||||
foreach ($this->dataFiles as $stageId => $item) {
|
||||
@ -432,6 +453,9 @@ class common
|
||||
}
|
||||
}
|
||||
|
||||
// Cache
|
||||
$GLOBALS['common_construct']['dialog'] = self::$dialog;
|
||||
|
||||
// Données de proxy
|
||||
$proxy = $this->getData(['config', 'proxyType']) . $this->getData(['config', 'proxyUrl']) . ':' . $this->getData(['config', 'proxyPort']);
|
||||
if (
|
||||
@ -453,6 +477,21 @@ class common
|
||||
stream_context_set_default($context);
|
||||
}
|
||||
|
||||
// Mise en cache des propriétés
|
||||
$GLOBALS['common_cache'] = [
|
||||
'input' => [
|
||||
'_POST' => $this->input['_POST'],
|
||||
'_COOKIE' => $this->input['_COOKIE'],
|
||||
],
|
||||
'siteContent' => self::$siteContent,
|
||||
'dataFiles' => $this->dataFiles,
|
||||
'user' => $this->user,
|
||||
'i18nUI' => self::$i18nUI,
|
||||
'hierarchy' => $this->hierarchy,
|
||||
'url' => $this->url,
|
||||
'dialog' => self::$dialog,
|
||||
];
|
||||
|
||||
// Mise à jour des données core
|
||||
include('core/include/update.inc.php');
|
||||
|
||||
@ -520,7 +559,7 @@ class common
|
||||
* Sauvegarde des données
|
||||
* @param array $keys Clé(s) des données
|
||||
*/
|
||||
public function setData($keys = [])
|
||||
public function setData($keys = [], $save = true)
|
||||
{
|
||||
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
|
||||
if (
|
||||
@ -548,7 +587,7 @@ class common
|
||||
$query .= '.' . $keys[$i];
|
||||
}
|
||||
// Appliquer la modification, le dernier élément étant la donnée à sauvegarder
|
||||
$success = is_object($db->set($query, $keys[count($keys) - 1], true));
|
||||
$success = is_object($db->set($query, $keys[count($keys) - 1], $save));
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
@ -619,32 +658,35 @@ class common
|
||||
// Initialise le compteur de tentatives
|
||||
$attempts = 0;
|
||||
|
||||
// Convertit les données en chaîne de caractères
|
||||
$serialized_data = serialize($data);
|
||||
|
||||
// Vérifie la longueur des données
|
||||
$data_length = strlen($serialized_data);
|
||||
$data_length = strlen($data);
|
||||
|
||||
// Effectue jusqu'à 5 tentatives d'écriture
|
||||
while ($attempts < 5) {
|
||||
// Essaye d'écrire les données dans le fichier avec verrouillage exclusif
|
||||
$write_result = file_put_contents($filename, $data, LOCK_EX | $flags);
|
||||
|
||||
//$now = \DateTime::createFromFormat('U.u', microtime(true));
|
||||
//file_put_contents("tmplog.txt", '[SecurePut][' . $now->format('H:i:s.u') . ']--' . $filename . "\r\n", FILE_APPEND);
|
||||
|
||||
// Vérifie si l'écriture a réussi
|
||||
if ($write_result !== false && $write_result === $data_length) {
|
||||
// Sort de la boucle si l'écriture a réussi
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempts++;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
// Échec de l'écriture après plusieurs tentatives
|
||||
return false;
|
||||
// Etat de l'écriture
|
||||
return ($attempts < 5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Effacer les données de la page
|
||||
* @param string pageId
|
||||
@ -701,11 +743,11 @@ class common
|
||||
mkdir(self::DATA_DIR . $lang . '/content', 0755);
|
||||
}
|
||||
// Site en français avec site exemple
|
||||
if ($lang == 'fr_FR' && $sampleSite === true) {
|
||||
if ($lang == 'fr_FR' && $sampleSite === true && $module === 'page') {
|
||||
$this->setData([$module, init::$siteTemplate[$module]]);
|
||||
// Création des pages
|
||||
foreach (init::$siteContent as $key => $value) {
|
||||
$this->setPage($key, $value, 'fr_FR');
|
||||
$this->setPage($key, $value['content'], 'fr_FR');
|
||||
}
|
||||
// Version en langue étrangère ou fr_FR sans site de test
|
||||
} else {
|
||||
@ -726,6 +768,17 @@ class common
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Forçage de l'enregistrement
|
||||
* @param mixed $module
|
||||
* @return void
|
||||
*/
|
||||
public function saveDB($module): void
|
||||
{
|
||||
$db = $this->dataFiles[$module];
|
||||
$db->save();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Accède à la liste des pages parents et de leurs enfants
|
||||
@ -768,7 +821,7 @@ class common
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
or ($this->isConnected() === true
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
@ -799,7 +852,7 @@ class common
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
)
|
||||
or (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$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'])
|
||||
|
||||
@ -1028,6 +1081,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
|
||||
* @return bool
|
||||
@ -1217,11 +1280,10 @@ class common
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
$source_image = function_exists('imagecreatefromavif') ? imagecreatefromavif($src) : null;
|
||||
break;
|
||||
$source_image = imagecreatefromavif($src);
|
||||
}
|
||||
// Image valide
|
||||
if ($source_image) {
|
||||
if (is_object($source_image)) {
|
||||
$width = imagesx($source_image);
|
||||
$height = imagesy($source_image);
|
||||
/* find the "desired height" of this thumbnail, relative to the desired width */
|
||||
@ -1238,9 +1300,9 @@ class common
|
||||
return (imagepng($virtual_image, $dest));
|
||||
case 'image/gif':
|
||||
return (imagegif($virtual_image, $dest));
|
||||
case 'webp':
|
||||
case 'image/webp':
|
||||
return (imagewebp($virtual_image, $dest));
|
||||
case 'avif':
|
||||
case 'image/avif':
|
||||
return (imageavif($virtual_image, $dest));
|
||||
}
|
||||
} else {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $layout->showMetaTitle(); ?>
|
||||
<?php $layout->showMetaDescription(); ?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html prefix="og: http://ogp.me/ns#" lang="<?php echo substr(self::$siteContent, 0, 2); ?>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<?php $layout->showMetaTitle(); ?>
|
||||
<?php $layout->showMetaDescription(); ?>
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php echo substr(self::$siteContent, 0, 2);?>">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="x-apple-disable-message-reformatting">
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="content-type" content="text/html;">
|
||||
<meta meta="description=" content="ZwiiCMS le CMS multilingue sans base de données">
|
||||
<meta name="generator" content="ZiiCMS https://forge.chapril.org/ZwiiCMS-Team/ZwiiCMS">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@ -54,7 +54,7 @@
|
||||
if (
|
||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') > self::GROUP_MEMBER
|
||||
) {
|
||||
echo '<nav id="navfixedconnected" >';
|
||||
|
@ -22,7 +22,7 @@ class config extends common
|
||||
'copyBackups' => self::GROUP_ADMIN,
|
||||
'delBackups' => self::GROUP_ADMIN,
|
||||
'configMetaImage' => self::GROUP_ADMIN,
|
||||
'siteMap' => self::GROUP_ADMIN,
|
||||
'sitemap' => self::GROUP_ADMIN,
|
||||
'index' => self::GROUP_ADMIN,
|
||||
'restore' => self::GROUP_ADMIN,
|
||||
'updateBaseUrl' => self::GROUP_ADMIN,
|
||||
@ -30,7 +30,8 @@ class config extends common
|
||||
'logReset' => self::GROUP_ADMIN,
|
||||
'logDownload' => self::GROUP_ADMIN,
|
||||
'blacklistReset' => self::GROUP_ADMIN,
|
||||
'blacklistDownload' => self::GROUP_ADMIN
|
||||
'blacklistDownload' => self::GROUP_ADMIN,
|
||||
'register' => self::GROUP_ADMIN,
|
||||
];
|
||||
|
||||
public static $timezones = [
|
||||
@ -211,7 +212,7 @@ class config extends common
|
||||
* Sitemap compressé et non compressé
|
||||
* Robots.txt
|
||||
*/
|
||||
public function siteMap()
|
||||
public function sitemap()
|
||||
{
|
||||
// La page n'existe pas
|
||||
if (
|
||||
@ -523,7 +524,7 @@ class config extends common
|
||||
) {
|
||||
// Ajout des lignes dans le .htaccess
|
||||
$fileContent = file_get_contents('.htaccess');
|
||||
$rewriteData = PHP_EOL .
|
||||
$rewriteData =
|
||||
'# URL rewriting' . PHP_EOL .
|
||||
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
||||
"\tRewriteEngine on" . PHP_EOL .
|
||||
@ -532,7 +533,7 @@ class config extends common
|
||||
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
||||
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
||||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
'# URL rewriting';
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
$this->secure_file_put_contents(
|
||||
'.htaccess',
|
||||
@ -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),
|
||||
]);
|
||||
}
|
||||
}
|
@ -66,11 +66,11 @@ $(document).ready(function () {
|
||||
$("#connectCaptchaStrong").prop("checked", false);
|
||||
}
|
||||
|
||||
var configLayout = getCookie("configLayout");
|
||||
if (configLayout == null) {
|
||||
var configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (configLayout == "") {
|
||||
configLayout = "setup";
|
||||
setCookie("configLayout", "setup");
|
||||
}
|
||||
}
|
||||
|
||||
$("#socialContainer").hide();
|
||||
$("#connectContainer").hide();
|
||||
@ -166,7 +166,6 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "setup");
|
||||
});
|
||||
$("#configSocialButton").on("click", function () {
|
||||
$("#connectContainer").hide();
|
||||
@ -177,7 +176,6 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").addClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "social");
|
||||
});
|
||||
$("#configConnectButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -188,7 +186,6 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").addClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "connect");
|
||||
});
|
||||
$("#configNetworkButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -199,7 +196,6 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").addClass("activeButton");
|
||||
setCookie("configLayout", "network");
|
||||
});
|
||||
|
||||
|
||||
@ -265,7 +261,6 @@ $(document).ready(function () {
|
||||
$('span#screenWeight').each(function(index){
|
||||
var weight = parseFloat($(this).text());
|
||||
var fileType = $('span#screenType').eq(index).text();
|
||||
console.log(weight);
|
||||
if ((fileType === "jpg" || fileType === "jpeg") && weight < 5000000) {
|
||||
$(this).css("color", "green");
|
||||
} 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
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
|
@ -7,16 +7,7 @@
|
||||
'value' => template::ico('home')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /**echo template::button('configHelp', [
|
||||
'class' => 'buttonHelp',
|
||||
'href' => 'https://doc.zwiicms.fr/configuration-du-site',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col2 offset6">
|
||||
<div class="col2 offset7">
|
||||
<?php echo template::button('configLocaleButton', [
|
||||
'value' => 'Identité',
|
||||
'href' => helper::baseUrl() . 'language/site'
|
||||
@ -30,20 +21,24 @@
|
||||
<div class="tab">
|
||||
<?php echo template::button('configSetupButton', [
|
||||
'value' => 'Configuration',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/setup'
|
||||
]); ?>
|
||||
<?php echo template::button('configSocialButton', [
|
||||
'value' => 'Référencement',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/social'
|
||||
]); ?>
|
||||
|
||||
<?php echo template::button('configConnectButton', [
|
||||
'value' => 'Connexion',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/connect'
|
||||
]); ?>
|
||||
<?php echo template::button('configNetworkButton', [
|
||||
'value' => 'Réseau',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/network'
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
|
@ -3,12 +3,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres'); ?>
|
||||
<!--<span id="setupHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/parametres" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>-->
|
||||
</span>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
@ -17,7 +11,8 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'help' => 'Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||
'label' => 'Favicon',
|
||||
'value' => $this->getData(['config', 'favicon'])
|
||||
'value' => $this->getData(['config', 'favicon']),
|
||||
'folder' => $this->getData(['config', 'favicon']) ? dirname($this->getData(['config', 'favicon'])) : ''
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -26,7 +21,8 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'help' => 'Sélectionnez une icône adaptée à un thème sombre.<br>Pensez à supprimer le cache de votre navigateur si la favicon ne change pas.',
|
||||
'label' => 'Favicon thème sombre',
|
||||
'value' => $this->getData(['config', 'faviconDark'])
|
||||
'value' => $this->getData(['config', 'faviconDark']),
|
||||
'folder' => $this->getData(['config', 'faviconDark']) ? dirname($this->getData(['config', 'faviconDark'])) : ''
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -47,8 +43,8 @@
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
||||
'checked' => helper::checkRewrite(),
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'nginx')
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'Apache') === false and $module->isModRewriteEnabled()
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,12 +55,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Mise à jour automatisée'); ?>
|
||||
<!--<span id="updateHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mise-a-jour" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -90,8 +80,8 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 offset1 verticalAlignBottom">
|
||||
<pre>Version installée : <strong><?php echo common::ZWII_VERSION ; ?></strong></pre>
|
||||
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL) ; ?></strong></pre>
|
||||
<pre>Version installée : <strong><?php echo common::ZWII_VERSION; ?></strong></pre>
|
||||
<pre>Version en ligne : <strong><?php echo helper::getOnlineVersion(common::ZWII_UPDATE_CHANNEL); ?></strong></pre>
|
||||
</div>
|
||||
<div class="col3 offset2 verticalAlignBottom">
|
||||
<?php echo template::button('configUpdateForced', [
|
||||
@ -109,12 +99,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Maintenance'); ?>
|
||||
<!--<span id="maintenanceHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mode-maintenance" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -169,12 +153,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Scripts externes'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/scripts-externes" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']);
|
||||
?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4 offset1 verticalAlignBottom">
|
||||
@ -198,13 +176,21 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
||||
<h4>ZwiiCMS <a href="https://zwiicms.fr" target="_blank">Site Web</a> - <a
|
||||
href="https://forum.zwiicms.fr" target="_blank">Forum</a>
|
||||
</h4>
|
||||
<div class="row textAlignCenter">
|
||||
<div class="col12">
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Licence Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
||||
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0 International.</a></p>
|
||||
<p>Pour voir une copie de cette licence, visitez http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.</p>
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img
|
||||
alt="Licence Creative Commons" style="border-width:0"
|
||||
src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a>
|
||||
<p>Cette œuvre est mise à disposition selon les termes de la <a rel="license"
|
||||
href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Licence Creative Commons
|
||||
Attribution - Pas d'Utilisation Commerciale - Pas de Modification 4.0
|
||||
International.</a></p>
|
||||
<p>Pour voir une copie de cette licence, visitez
|
||||
http://creativecommons.org/licenses/by-nc-nd/4.0/ ou écrivez à Creative Commons, PO Box
|
||||
1866, Mountain View, CA 94042, USA.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,11 +4,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Capture d\'écran Open Graph'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -18,29 +13,30 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Image Open Graph',
|
||||
'value' => $this->getData(['config', 'seo', 'openGraphImage']),
|
||||
'folder' => $this->getData(['config', 'seo', 'openGraphImage']) ? dirname($this->getData(['config', 'seo', 'openGraphImage'])) : '',
|
||||
'type' => 1,
|
||||
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
||||
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
||||
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
||||
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
||||
'help' => sprintf('%s : JPG - PNG<br />', helper::translate('Format')) .
|
||||
sprintf('%s : 1200 x 630 pixels<br />', helper::translate('Dimensions minimales')) .
|
||||
sprintf('%s : 1.91:1<br />', helper::translate('Ratio')) .
|
||||
sprintf('%s : %s, %s<br />', helper::translate('Taille maximale du fichier'), helper::translate('5 Mo pour les images JPEG'), helper::translate('1 Mo pour les images PNG'))
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col10 textAlignCenter">
|
||||
<?php if( !empty($module::$imageOpenGraph['type']) ): ?>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenType">%s</span>', helper::translate('Format'), $module::$imageOpenGraph['type']); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWide">%s</span> x <span id="screenHeight">%s</span> pixels', helper::translate('Dimensions minimales'), $module::$imageOpenGraph['wide'], $module::$imageOpenGraph['height'] ); ?>
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenRatio">%s</span><span id="screenFract">:1</span>' , helper::translate('Ratio'), round($module::$imageOpenGraph['ratio'], 2)); ?>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
||||
</p>
|
||||
</p>
|
||||
<p>
|
||||
<?php echo sprintf('%s : <span id="screenWeight">%s</span>', helper::translate('Poids'), $module::$imageOpenGraph['size']); ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,12 +80,6 @@
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Réseaux sociaux'); ?>
|
||||
<!--<span id="specialeHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/reseaux-sociaux" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
|
@ -179,9 +179,9 @@ class install extends common
|
||||
}
|
||||
|
||||
// Sauvegarder la configuration du Proxy
|
||||
$this->setData(['config', 'proxyType', $this->getInput('installProxyType')]);
|
||||
$this->setData(['config', 'proxyUrl', $this->getInput('installProxyUrl')]);
|
||||
$this->setData(['config', 'proxyPort', $this->getInput('installProxyPort', helper::FILTER_INT)]);
|
||||
$this->setData(['config', 'proxyType', $this->getInput('installProxyType')], false);
|
||||
$this->setData(['config', 'proxyUrl', $this->getInput('installProxyUrl')], false);
|
||||
$this->setData(['config', 'proxyPort', $this->getInput('installProxyPort', helper::FILTER_INT)], false);
|
||||
|
||||
// Images exemples livrées dans tous les cas
|
||||
try {
|
||||
@ -219,7 +219,7 @@ class install extends common
|
||||
$this->copyDir('core/module/install/ressource/i18n', self::I18N_DIR);
|
||||
|
||||
// Fixe l'adresse from pour les envois d'email
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])], false);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -228,6 +228,8 @@ class install extends common
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('config');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -284,7 +286,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $success ? null : json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
'data' => $message
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -317,7 +319,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
'data' => $message
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -360,7 +362,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
'data' => $message,
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -432,12 +434,13 @@ class install extends common
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
'data' => $message
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
@ -1,6 +1,12 @@
|
||||
function step(i, data) {
|
||||
var errors = ["<?php echo helper::translate('Préparation de la mise à jour'); ?>", "<?php echo helper::translate('Téléchargement et validation de l\'archive'); ?>", "<?php echo helper::translate('Installation'); ?>", "<?php echo helper::translate('Configuration'); ?>"];
|
||||
$(".installUpdateProgressText").hide(), $(".installUpdateProgressText[data-id=" + i + "]").show();
|
||||
var errors = [
|
||||
"<?php echo helper::translate('Préparation de la mise à jour'); ?>",
|
||||
"<?php echo helper::translate('Téléchargement et validation de l\'archive'); ?>",
|
||||
"<?php echo helper::translate('Installation'); ?>",
|
||||
"<?php echo helper::translate('Configuration'); ?>"
|
||||
];
|
||||
$(".installUpdateProgressText").hide();
|
||||
$(".installUpdateProgressText[data-id=" + i + "]").show();
|
||||
|
||||
$("body").css("cursor", "wait");
|
||||
|
||||
@ -12,7 +18,7 @@ function step(i, data) {
|
||||
data: data
|
||||
},
|
||||
success: function (result) {
|
||||
setTimeout((function () {
|
||||
setTimeout(function () {
|
||||
if (4 === i) {
|
||||
$("#installUpdateSuccess").show();
|
||||
$("body").css("cursor", "default");
|
||||
@ -21,15 +27,21 @@ function step(i, data) {
|
||||
} else {
|
||||
step(i + 1, result.data);
|
||||
}
|
||||
}), 2e3)
|
||||
}, 2000);
|
||||
},
|
||||
error: function (xhr) {
|
||||
// Balance tout dans la console
|
||||
console.log(i);
|
||||
console.log(xhr.responseText);
|
||||
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 || xhr.status === 403) {
|
||||
alert("Votre session a expiré. Veuillez vous reconnecter.");
|
||||
window.location.href = "?user/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
|
||||
const startOfArray = message.indexOf('{');
|
||||
|
||||
// Extraire le message du warning jusqu'au début du tableau
|
||||
const warningMessage = message.substring(0, startOfArray).trim();
|
||||
if (startOfArray !== -1 && startOfArray > 0) {
|
||||
// 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
|
||||
const jsonString = message.substring(startOfArray);
|
||||
const jsonData = JSON.parse(jsonString);
|
||||
// Extraire le tableau JSON entre les accolades
|
||||
const jsonString = message.substring(startOfArray);
|
||||
|
||||
// Afficher les résultats
|
||||
if (jsonData) {
|
||||
$("#installUpdateErrorMessage").html("<strong>Détails de l'erreur :</strong><br> " +
|
||||
jsonData.data.replace(/^"(.*)"$/, '$1') +
|
||||
"<br>" +
|
||||
warningMessage.replace(/<[^p].*?>/g, ""));
|
||||
try {
|
||||
const jsonData = JSON.parse(jsonString);
|
||||
|
||||
// Afficher les résultats si le parsing JSON est réussi
|
||||
if (jsonData) {
|
||||
$("#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 {
|
||||
// Vous pouvez également faire quelque chose d'autre ici, par exemple, afficher un message à l'utilisateur, etc.
|
||||
$("#installUpdateErrorMessage").html(message);
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,7 @@
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Étiquettes des pages spéciales'); ?>
|
||||
<!--<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']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
|
@ -23,7 +23,8 @@ class page extends common
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'duplicate' => self::GROUP_EDITOR,
|
||||
'jsEditor' => self::GROUP_EDITOR,
|
||||
'cssEditor' => self::GROUP_EDITOR
|
||||
'cssEditor' => self::GROUP_EDITOR,
|
||||
'register' => self::GROUP_EDITOR,
|
||||
];
|
||||
public static $pagesNoParentId = [
|
||||
'' => 'Aucune'
|
||||
@ -118,14 +119,16 @@ class page extends common
|
||||
$page
|
||||
]);
|
||||
// Ecriture
|
||||
$this->setData(['page', $pageId, $data]);
|
||||
$this->setData(['page', $pageId, $data], false);
|
||||
$notification = helper::translate('Page dupliquée');
|
||||
// Duplication du module présent
|
||||
if ($this->getData(['page', $page, 'moduleId'])) {
|
||||
$data = $this->getData(['module', $page]);
|
||||
$this->setData(['module', $pageId, $data]);
|
||||
$this->setData(['module', $pageId, $data], false);
|
||||
$notification = helper::translate('Page et module dupliqués');
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('page');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -201,8 +204,8 @@ class page extends common
|
||||
//$this->secure_file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
$this->setPage($pageId, '<p>Contenu de votre nouvelle page.</p>', self::$siteContent);
|
||||
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
// Ne met à jour le sitemap pour éviter un warning, de toute manière la nouvelle page doit être éditée.
|
||||
// $this->updateSitemap();
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -381,11 +384,13 @@ class page extends common
|
||||
$pageId = helper::increment($pageId, self::$moduleIds);
|
||||
// Met à jour les enfants
|
||||
foreach ($this->getHierarchy($this->getUrl(2), null) as $childrenPageId) {
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId], false);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('page');
|
||||
// Change l'id de page dans les données des modules
|
||||
if ($this->getData(['module', $this->getUrl(2)]) !== null) {
|
||||
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
|
||||
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])], false);
|
||||
$this->deleteData(['module', $this->getUrl(2)]);
|
||||
// Renommer le dossier du module
|
||||
$moduleId = $this->getData(['page', $this->getUrl(2), 'moduleId']);
|
||||
@ -396,8 +401,10 @@ class page extends common
|
||||
copy($modulesData[$moduleId]['dataDirectory'] . $this->getUrl(2), $modulesData[$moduleId]['dataDirectory'] . $pageId);
|
||||
$this->deleteDir($modulesData[$moduleId]['dataDirectory'] . $this->getUrl(2));
|
||||
// Mettre à jour le nom de la feuille de style
|
||||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId]);
|
||||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId], false);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('module');
|
||||
}
|
||||
// Si la page correspond à la page d'accueil, change l'id dans la configuration du site
|
||||
if ($this->getData(['locale', 'homePageId']) === $this->getUrl(2)) {
|
||||
@ -417,20 +424,22 @@ class page extends common
|
||||
}
|
||||
// Traitement des pages spéciales affectées dans la config :
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'legalPageId'])) {
|
||||
$this->setData(['locale', 'legalPageId', $pageId]);
|
||||
$this->setData(['locale', 'legalPageId', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'searchPageId'])) {
|
||||
$this->setData(['locale', 'searchPageId', $pageId]);
|
||||
$this->setData(['locale', 'searchPageId', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page404'])) {
|
||||
$this->setData(['locale', 'page404', $pageId]);
|
||||
$this->setData(['locale', 'page404', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page403'])) {
|
||||
$this->setData(['locale', 'page403', $pageId]);
|
||||
$this->setData(['locale', 'page403', $pageId], false);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page302'])) {
|
||||
$this->setData(['locale', 'page302', $pageId]);
|
||||
$this->setData(['locale', 'page302', $pageId], false);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('locale');
|
||||
// Si la page est une page enfant, actualise les positions des autres enfants du parent, sinon actualise les pages sans parents
|
||||
$lastPosition = 1;
|
||||
$hierarchy = $this->getInput('pageEditParentPageId') ? $this->getHierarchy($this->getInput('pageEditParentPageId')) : array_keys($this->getHierarchy());
|
||||
@ -449,7 +458,7 @@ class page extends common
|
||||
$lastPosition++;
|
||||
}
|
||||
// Change la position
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition]);
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition], false);
|
||||
// Incrémente pour la prochaine position
|
||||
$lastPosition++;
|
||||
}
|
||||
@ -474,26 +483,28 @@ class page extends common
|
||||
) {
|
||||
foreach ($this->getHierarchy($pageId) as $parentId => $childId) {
|
||||
if ($this->getData(['page', $childId, 'parentPageId']) === $pageId) {
|
||||
$this->setData(['page', $childId, 'position', 0]);
|
||||
$this->setData(['page', $childId, 'position', 0], false);
|
||||
}
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('page');
|
||||
}
|
||||
|
||||
// La page est une barre latérale qui a été renommée : changer le nom de la barre dans les pages qui l'utilisent
|
||||
if ($this->getinput('pageEditBlock') === 'bar') {
|
||||
foreach ($this->getHierarchy() as $eachPageId => $parentId) {
|
||||
if ($this->getData(['page', $eachPageId, 'barRight']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $eachPageId, 'barRight', $pageId]);
|
||||
$this->setData(['page', $eachPageId, 'barRight', $pageId], false);
|
||||
}
|
||||
if ($this->getData(['page', $eachPageId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId]);
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId], false);
|
||||
}
|
||||
foreach ($parentId as $childId) {
|
||||
if ($this->getData(['page', $childId, 'barRight']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barRight', $pageId]);
|
||||
$this->setData(['page', $childId, 'barRight', $pageId], false);
|
||||
}
|
||||
if ($this->getData(['page', $childId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId]);
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -709,9 +720,30 @@ class page extends common
|
||||
{
|
||||
$p = $this->getData(['page']);
|
||||
$d = array_map(function ($d) {
|
||||
unset ($d["css"], $d["js"]);
|
||||
unset($d["css"], $d["js"]);
|
||||
return $d;
|
||||
}, $p);
|
||||
return json_encode($d);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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,
|
||||
]);
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
*/
|
||||
$("#pageEditDelete").on("click", function() {
|
||||
$("#pageEditDelete").on("click", function() {
|
||||
var _this = $(this);
|
||||
var message_delete = "<?php echo helper::translate('Confirmer la suppression de la page'); ?>";
|
||||
return core.confirm(message_delete, function() {
|
||||
@ -67,16 +67,19 @@ $( document ).ready(function() {
|
||||
/**
|
||||
* Sélection des onglets
|
||||
*/
|
||||
var pageLayout = getCookie("pageLayout");
|
||||
if (pageLayout == null) {
|
||||
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
|
||||
|
||||
// Non défini, valeur par défaut
|
||||
if (pageLayout == "") {
|
||||
pageLayout = "content";
|
||||
setCookie("pageLayout", "content");
|
||||
}
|
||||
// Tout cacher
|
||||
$("#pageEditContentContainer").hide();
|
||||
$("#pageEditExtensionContainer").hide();
|
||||
$("#pageEditPositionContainer").hide();
|
||||
$("#pageEditLayoutContainer").hide();
|
||||
$("#pageEditPermissionContainer").hide();
|
||||
// Afficher la bonne tab
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Container").show();
|
||||
$("#pageEdit" + capitalizeFirstLetter(pageLayout) + "Button").addClass("activeButton");
|
||||
|
||||
@ -295,7 +298,6 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "content");
|
||||
});
|
||||
$("#pageEditExtensionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -308,7 +310,6 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "extension");
|
||||
});
|
||||
$("#PageEditPositionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -321,7 +322,6 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").addClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "position");
|
||||
});
|
||||
$("#pageEditLayoutButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -334,7 +334,6 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").addClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "layout");
|
||||
});
|
||||
$("#pageEditPermissionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -347,7 +346,6 @@ $( document ).ready(function() {
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").addClass("activeButton");
|
||||
setCookie("pageLayout", "permission");
|
||||
});
|
||||
|
||||
/**
|
||||
@ -722,30 +720,6 @@ function buildPagesList(extraPosition) {
|
||||
positionDOM.val(positionSelected);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cookies
|
||||
*/
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define function to capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
|
@ -7,26 +7,17 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /**echo template::button('pageEditHelp', [
|
||||
'href' => 'https://doc.zwiicms.fr/edition-des-pages',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'class' => 'buttonHelp',
|
||||
'help' => 'Consulter l\'aide en ligne'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col1 offset6">
|
||||
<div class="col1 offset7">
|
||||
<?php echo template::button('pageEditDelete', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('trash'),
|
||||
'help' => 'Effacer la page'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('pageEditDuplicate', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'value' => template::ico('clone'),
|
||||
'help' => 'Dupliquer la page'
|
||||
]); ?>
|
||||
@ -37,27 +28,31 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab">
|
||||
<?php echo template::button('pageEditContentButton', [
|
||||
'value' => 'Contenu',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('PageEditPositionButton', [
|
||||
<?php echo template::button('pageEditPositionButton', [
|
||||
'value' => 'Menu',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditExtensionButton', [
|
||||
'value' => 'Extension',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditLayoutButton', [
|
||||
'value' => 'Mise en page',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPermissionButton', [
|
||||
'value' => 'Permission',
|
||||
'class' => 'buttonTab'
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
@ -67,11 +62,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Titres'); ?>
|
||||
<!--<span id="infoHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/informations-generales" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col8">
|
||||
@ -120,11 +110,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Emplacement dans le menu'); ?>
|
||||
<!--<span id="positionHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/emplacement-dans-le-menu" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -176,11 +161,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Options avancées'); ?>
|
||||
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -195,7 +175,8 @@
|
||||
'help' => 'Sélectionnez une image ou une icône de petite dimension',
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Icône',
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl']),
|
||||
'folder' => $this->getData(['page', $this->getUrl(2), 'iconUrl']) ? dirname($this->getData(['page', $this->getUrl(2), 'iconUrl'])) : '',
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -292,11 +273,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Mise en page'); ?>
|
||||
<!--<span id="layoutHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/mise-en-page-2" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -372,11 +348,6 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Permission et référencement'); ?>
|
||||
<!--<span id="seoHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/permission-et-referencement" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -424,5 +395,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php echo template::formClose(); ?>
|
@ -22,7 +22,7 @@ class plugin extends common
|
||||
'delete' => self::GROUP_ADMIN,
|
||||
'save' => self::GROUP_ADMIN,
|
||||
'store' => self::GROUP_ADMIN,
|
||||
'item' => self::GROUP_ADMIN,
|
||||
//'item' => self::GROUP_ADMIN,
|
||||
// détail d'un objet
|
||||
'upload' => self::GROUP_ADMIN,
|
||||
// Téléverser catalogue
|
||||
@ -330,6 +330,7 @@ class plugin extends common
|
||||
'state' => $r['success']
|
||||
]);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'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
|
||||
*/
|
||||
@ -556,6 +566,9 @@ class plugin extends common
|
||||
}
|
||||
}
|
||||
|
||||
// Désactive l'icône rouge
|
||||
$this->setData(['core', 'updateModuleAvailable', false]);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Gestion des modules'),
|
||||
@ -592,7 +605,7 @@ class plugin extends common
|
||||
$fileName = $moduleId . str_replace('.', '-', $infoModule[$moduleId]['version']) . '.zip';
|
||||
|
||||
// Régénération du descripteur du module
|
||||
$this->secure_file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', $infoModule[$moduleId]);
|
||||
file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE));
|
||||
|
||||
// Construire l'archive
|
||||
$this->makeZip($tmpFolder . $fileName, self::MODULE_DIR . $moduleId);
|
||||
|
@ -419,7 +419,7 @@ class theme extends common
|
||||
]);
|
||||
|
||||
// Sauvegarder la configuration localisée
|
||||
$this->setData(['locale', 'legalPageId', $this->getInput('configLegalPageId')]);
|
||||
$this->setData(['locale', 'legalPageId', $this->getInput('configLegalPageId')], false);
|
||||
$this->setData(['locale', 'searchPageId', $this->getInput('configSearchPageId')]);
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -507,21 +507,23 @@ class theme extends common
|
||||
'featureContent' => $featureContent,
|
||||
'featureFiles' => $files
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
// Modification de la position du menu selon la position de la bannière
|
||||
if ($this->getData(['theme', 'header', 'position']) == 'site') {
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('body-', 'site-', $this->getData(['theme', 'menu', 'position']))]);
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('body-', 'site-', $this->getData(['theme', 'menu', 'position']))], false);
|
||||
}
|
||||
if ($this->getData(['theme', 'header', 'position']) == 'body') {
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('site-', 'body-', $this->getData(['theme', 'menu', 'position']))]);
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('site-', 'body-', $this->getData(['theme', 'menu', 'position']))], false);
|
||||
}
|
||||
// Menu accroché à la bannière qui devient cachée
|
||||
if (
|
||||
$this->getData(['theme', 'header', 'position']) == 'hide' &&
|
||||
in_array($this->getData(['theme', 'menu', 'position']), ['body-first', 'site-first', 'body-first', 'site-second'])
|
||||
) {
|
||||
$this->setData(['theme', 'menu', 'position', 'site']);
|
||||
$this->setData(['theme', 'menu', 'position', 'site'], false);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('theme');
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
@ -650,7 +652,7 @@ class theme extends common
|
||||
if (is_array($typeValue)) {
|
||||
foreach ($typeValue as $fontId => $fontValue) {
|
||||
// Recherche les correspondances
|
||||
$result = array_filter($fonts, function($value) use ($fontId) {
|
||||
$result = array_filter($fonts, function ($value) use ($fontId) {
|
||||
return $value == $fontId;
|
||||
});
|
||||
$keyResults = array_keys($result);
|
||||
@ -846,7 +848,7 @@ class theme extends common
|
||||
file_exists($this->getData(['font', 'files', $this->getUrl(3), 'resource']))
|
||||
) {
|
||||
|
||||
unlink($this->getData(['font', 'files', $this->getUrl(3), 'resource']));
|
||||
unlink($this->getData(['font', 'files', $this->getUrl(3), 'resource']));
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -921,7 +923,7 @@ class theme extends common
|
||||
'fontWeight' => $this->getInput('themeTitleFontWeight'),
|
||||
'textTransform' => $this->getInput('themeTitleTextTransform')
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'text',
|
||||
@ -931,7 +933,7 @@ class theme extends common
|
||||
'textColor' => $this->getInput('themeTextTextColor'),
|
||||
'linkColor' => $this->getInput('themeTextLinkColor')
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'site',
|
||||
@ -942,14 +944,14 @@ class theme extends common
|
||||
'width' => $this->getInput('themeSiteWidth'),
|
||||
'margin' => $this->getInput('themeSiteMargin', helper::FILTER_BOOLEAN)
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'button',
|
||||
[
|
||||
'backgroundColor' => $this->getInput('themeButtonBackgroundColor')
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'block',
|
||||
@ -957,7 +959,9 @@ class theme extends common
|
||||
'backgroundColor' => $this->getInput('themeBlockBackgroundColor'),
|
||||
'borderColor' => $this->getInput('themeBlockBorderColor')
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('theme');
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
|
@ -7,15 +7,7 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?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">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('themeBodySubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -35,7 +27,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::text('themeBodyToTopColor', [
|
||||
<?php echo template::text('themeBodyToTopColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => 'Le curseur horizontal règle le niveau de transparence.',
|
||||
'label' => 'Couleur icône haut de page',
|
||||
@ -68,7 +60,8 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Arrière plan',
|
||||
'type' => 1,
|
||||
'value' => $imageFile
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -20,6 +20,7 @@ $('#dataTables').DataTable({
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||
"columnDefs": [{
|
||||
target: 5,
|
||||
orderable: false,
|
||||
|
@ -7,15 +7,7 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /* echo template::button('themeHeaderHelp', [
|
||||
'href' => 'https://doc.zwiicms.fr/banniere',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'class' => 'buttonHelp'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('themeHeaderSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -158,13 +150,17 @@
|
||||
'label' => 'Image',
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'type' => 1,
|
||||
'value' => $imageFile
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
]);
|
||||
?>
|
||||
<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>
|
||||
</span>
|
||||
|
@ -7,22 +7,15 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php /* echo template::button('themeMenuHelp', [
|
||||
'href' => 'https://doc.zwiicms.fr/menu',
|
||||
'target' => '_blank',
|
||||
'value' => template::ico('help'),
|
||||
'class' => 'buttonHelp'
|
||||
]); */?>
|
||||
</div>
|
||||
<div class="col2 offset8">
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('themeMenuSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres'); ?>
|
||||
<h4>
|
||||
<?php echo helper::translate('Paramètres'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
@ -84,7 +77,8 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Contenu'); ?>
|
||||
<h4>
|
||||
<?php echo helper::translate('Contenu'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
@ -112,7 +106,8 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Logo du menu burger',
|
||||
'type' => 1,
|
||||
'value' => $imageFile
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
@ -123,7 +118,8 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Couleurs'); ?>
|
||||
<h4>
|
||||
<?php echo helper::translate('Couleurs'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
@ -164,7 +160,7 @@
|
||||
<?php
|
||||
echo template::checkbox('themeMenuActiveColorAuto', true, 'Couleur de fond automatique', [
|
||||
'checked' => $this->getData(['theme', 'menu', 'activeColorAuto']),
|
||||
]); ?>
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::text('themeMenuActiveColor', [
|
||||
@ -181,7 +177,8 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Mise en forme du texte'); ?>
|
||||
<h4>
|
||||
<?php echo helper::translate('Mise en forme du texte'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
|
@ -345,6 +345,7 @@ class user extends common
|
||||
'files' => $this->getInput('userEditFiles', helper::FILTER_BOOLEAN),
|
||||
'language' => $this->getInput('userEditLanguage', 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
|
||||
@ -415,7 +416,7 @@ class user extends common
|
||||
// Enregistre la date de la demande dans le compte utilisateur
|
||||
$this->setData(['user', $userId, 'forgot', time()]);
|
||||
// Crée un id unique pour la réinitialisation
|
||||
$uniqId = md5(json_encode($this->getData(['user', $userId])));
|
||||
$uniqId = md5(json_encode($this->getData(['user', $userId, 'forgot'])));
|
||||
// Envoi le mail
|
||||
$sent = $this->sendMail(
|
||||
$this->getData(['user', $userId, 'mail']),
|
||||
@ -574,7 +575,7 @@ class user extends common
|
||||
// Stoppe si le profil est affecté
|
||||
foreach ($groups as $userId) {
|
||||
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
||||
$profilUsed= false;
|
||||
$profilUsed = false;
|
||||
}
|
||||
}
|
||||
foreach ($this->getData(['profil']) as $groupId => $groupData) {
|
||||
@ -935,11 +936,11 @@ class user extends common
|
||||
// recherche les membres du groupe
|
||||
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||
$groups = array_keys($groups, $this->getUrl(2));
|
||||
$flag= true;
|
||||
$flag = true;
|
||||
// Stoppe si le profil est affecté
|
||||
foreach ($groups as $userId) {
|
||||
if ((string) $this->getData(['user', $userId, 'profil']) === $this->getUrl(3)) {
|
||||
$flag= false;
|
||||
$flag = false;
|
||||
}
|
||||
}
|
||||
if (
|
||||
@ -1030,8 +1031,8 @@ class user extends common
|
||||
$this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) < time()
|
||||
and $this->getData(['user', $userId, 'connectFail']) === $this->getData(['config', 'connect', 'attempt'])
|
||||
) {
|
||||
$this->setData(['user', $userId, 'connectFail', 0]);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
||||
$this->setData(['user', $userId, 'connectFail', 0], false);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0], false);
|
||||
}
|
||||
// Check la présence des variables et contrôle du blocage du compte si valeurs dépassées
|
||||
// Vérification du mot de passe et du groupe
|
||||
@ -1043,14 +1044,36 @@ class user extends common
|
||||
and $captcha === true
|
||||
) {
|
||||
// RAZ
|
||||
$this->setData(['user', $userId, 'connectFail', 0]);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
||||
// Expiration
|
||||
$this->setData(['user', $userId, 'connectFail', 0], false);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0], false);
|
||||
|
||||
// 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;
|
||||
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);
|
||||
switch ($this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN)) {
|
||||
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
|
||||
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']]);
|
||||
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']], false);
|
||||
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
|
||||
if (
|
||||
$this->getData(['config', 'maintenance'])
|
||||
@ -1064,8 +1087,9 @@ class user extends common
|
||||
} else {
|
||||
$logStatus = 'Connexion réussie';
|
||||
$pageId = $this->getUrl(2);
|
||||
if ($this->getData(['config', 'page404']) === $pageId
|
||||
|| $this->getData(['config', 'page403']) === $pageId
|
||||
if (
|
||||
$this->getData(['config', 'page404']) === $pageId
|
||||
|| $this->getData(['config', 'page403']) === $pageId
|
||||
) {
|
||||
$pageId = '';
|
||||
}
|
||||
@ -1082,12 +1106,12 @@ class user extends common
|
||||
$notification = helper::translate('Captcha, identifiant ou mot de passe incorrects');
|
||||
$logStatus = $captcha === true ? 'Erreur de mot de passe' : 'Erreur de captcha';
|
||||
// Cas 1 le nombre de connexions est inférieur aux tentatives autorisées : incrément compteur d'échec
|
||||
if ($this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
|
||||
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1]);
|
||||
if ($this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'], false)) {
|
||||
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1], false);
|
||||
}
|
||||
// Cas 2 la limite du nombre de connexion est atteinte : placer le timer
|
||||
if ($this->getdata(['user', $userId, 'connectFail']) == $this->getData(['config', 'connect', 'attempt'])) {
|
||||
$this->setData(['user', $userId, 'connectTimeout', time()]);
|
||||
$this->setData(['user', $userId, 'connectTimeout', time()], false);
|
||||
}
|
||||
// Cas 3 le délai de bloquage court
|
||||
if ($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time()) {
|
||||
@ -1100,6 +1124,8 @@ class user extends common
|
||||
]);
|
||||
}
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('user');
|
||||
}
|
||||
// Journalisation
|
||||
$this->saveLog($logStatus);
|
||||
@ -1123,7 +1149,8 @@ class user extends common
|
||||
public function logout()
|
||||
{
|
||||
helper::deleteCookie('ZWII_USER_ID');
|
||||
helper::deleteCookie('ZWII_USER_PASSWORD');
|
||||
//helper::deleteCookie('ZWII_USER_PASSWORD');
|
||||
helper::deleteCookie('ZWII_AUTH_KEY');
|
||||
|
||||
// Détruit la session
|
||||
session_destroy();
|
||||
@ -1177,11 +1204,11 @@ class user extends common
|
||||
$newPassword = $this->getInput('userResetNewPassword', helper::FILTER_PASSWORD, true);
|
||||
}
|
||||
// Modifie le mot de passe
|
||||
$this->setData(['user', $this->getUrl(2), 'password', $newPassword]);
|
||||
$this->setData(['user', $this->getUrl(2), 'password', $newPassword], false);
|
||||
// Réinitialise la date de la demande
|
||||
$this->setData(['user', $this->getUrl(2), 'forgot', 0]);
|
||||
$this->setData(['user', $this->getUrl(2), 'forgot', 0], false);
|
||||
// Réinitialise le blocage
|
||||
$this->setData(['user', $this->getUrl(2), 'connectFail', 0]);
|
||||
$this->setData(['user', $this->getUrl(2), 'connectFail', 0], false);
|
||||
$this->setData(['user', $this->getUrl(2), 'connectTimeout', 0]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -1296,7 +1323,7 @@ class user extends common
|
||||
"accessCsrf" => null,
|
||||
'tags' => $item['tags']
|
||||
]
|
||||
]);
|
||||
], false);
|
||||
// Icône de notification
|
||||
$item['notification'] = $create ? template::ico('check') : template::ico('cancel');
|
||||
// Envoi du mail
|
||||
@ -1337,6 +1364,8 @@ class user extends common
|
||||
}
|
||||
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('user');
|
||||
if (empty(self::$users)) {
|
||||
$notification = helper::translate('Rien à importer, erreur de format ou fichier incorrect');
|
||||
$success = false;
|
||||
|
@ -16,3 +16,4 @@
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
|
@ -29,6 +29,7 @@ $(document).ready((function () {
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||
"columnDefs": [
|
||||
{
|
||||
target: 5,
|
||||
|
@ -152,7 +152,7 @@
|
||||
<?php echo template::select('profilEditPath', $module::$sharePath, [
|
||||
'label' => 'Dossier',
|
||||
'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>
|
||||
|
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...",
|
||||
"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",
|
||||
"infoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
|
||||
"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.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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$thumbResult = create_img($targetFile, $targetFileThumb, 122, 91);
|
||||
$newWidth = 640;
|
||||
$newHeight = 480;
|
||||
$thumbResult = create_img($targetFile, $targetFileThumb, $newWidth, $newHeight);
|
||||
|
||||
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)
|
||||
exit('Accès interdit');
|
||||
// lecture du profil
|
||||
if (!is_null($profil)) {
|
||||
if (!is_null($profil) and $g['profil'][$group][$profil]['folder']['path'] !== '') {
|
||||
$file = $g['profil'][$group][$profil]['file'];
|
||||
$folder = $g['profil'][$group][$profil]['folder'];
|
||||
$uploadDir = $g['profil'][$group][$profil]['folder']['path'];
|
||||
@ -591,7 +591,7 @@ $config = array(
|
||||
// path_from_filemanager/test/test1/
|
||||
// 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
|
||||
'fixed_path_from_filemanager' => array('../../../site/file/thumb/'),
|
||||
//fixed path of the image folder from the current position on upload folder
|
||||
|
6
core/vendor/filemanager/dialog.php
vendored
6
core/vendor/filemanager/dialog.php
vendored
@ -59,12 +59,12 @@ if (checkRelativePath($subdir_path)) {
|
||||
}
|
||||
|
||||
if ($subdir == "") {
|
||||
if (!empty($_COOKIE['last_position']) && strpos($_COOKIE['last_position'], '.') === false) {
|
||||
$subdir = trim($_COOKIE['last_position']);
|
||||
if (!empty($_COOKIE['ZWII_RFM_FOLDER']) && strpos($_COOKIE['ZWII_RFM_FOLDER'], '.') === false) {
|
||||
$subdir = trim($_COOKIE['ZWII_RFM_FOLDER']);
|
||||
}
|
||||
}
|
||||
//remember last position
|
||||
setcookie('last_position', $subdir, time() + (86400 * 7));
|
||||
setcookie('ZWII_RFM_FOLDER', $subdir, time() + (86400 * 7));
|
||||
|
||||
if ($subdir == "/") {
|
||||
$subdir = "";
|
||||
|
25
index.php
25
index.php
@ -19,6 +19,31 @@
|
||||
*/
|
||||
// Remplace la directive htaccess
|
||||
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']);
|
||||
|
||||
// Si le chemin est vide (ce qui peut arriver si le site est à la racine), définis-le comme '/'
|
||||
if ($scriptPath === '/' || $scriptPath === '\\' || $scriptPath === '.') {
|
||||
$scriptPath = '/';
|
||||
}
|
||||
|
||||
// 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'], // Domaine 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
|
||||
session_start();
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
class blog extends common
|
||||
{
|
||||
|
||||
const VERSION = '7.7';
|
||||
const VERSION = '8.0';
|
||||
const REALNAME = 'Blog';
|
||||
const DELETE = true;
|
||||
const UPDATE = '0.0';
|
||||
@ -42,9 +42,6 @@ class blog extends common
|
||||
|
||||
public static $articles = [];
|
||||
|
||||
// Signature de l'article
|
||||
public static $articleSignature = '';
|
||||
|
||||
// Signature du commentaire
|
||||
public static $editCommentSignature = '';
|
||||
|
||||
@ -174,10 +171,13 @@ class blog extends common
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'timeFormat', '%H:%M']);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.5']);
|
||||
}
|
||||
// Version 7.4
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.4', '<')) {
|
||||
// Version 8.0
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '8.0', '<')) {
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '7.4']);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showTime', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showDate', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showPseudo', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '8.0']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,9 +196,11 @@ class blog extends common
|
||||
$feeds = new \FeedWriter\RSS2();
|
||||
|
||||
// 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->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->setDate(date('r', time()));
|
||||
$feeds->addGenerator();
|
||||
@ -576,7 +578,10 @@ class blog extends common
|
||||
'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true),
|
||||
'dateFormat' => $this->getInput('blogOptionDateFormat'),
|
||||
'timeFormat' => $this->getInput('blogOptionTimeFormat'),
|
||||
'buttonBack' => $this->getInput('newsOptionButtonBack'),
|
||||
'buttonBack' => $this->getInput('blogOptionButtonBack', helper::FILTER_BOOLEAN),
|
||||
'showDate' => $this->getInput('blogOptionShowDate', helper::FILTER_BOOLEAN),
|
||||
'showTime' => $this->getInput('blogOptionShowTime', helper::FILTER_BOOLEAN),
|
||||
'showPseudo' => $this->getInput('blogOptionShowPseudo', helper::FILTER_BOOLEAN),
|
||||
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
|
||||
]
|
||||
]);
|
||||
@ -594,7 +599,6 @@ class blog extends common
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Suppression
|
||||
*/
|
||||
@ -747,7 +751,7 @@ class blog extends common
|
||||
) {
|
||||
// Check la captcha
|
||||
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 password_verify($this->getInput('blogArticleCaptcha', helper::FILTER_INT), $this->getInput('blogArticleCaptchaResult')) === false
|
||||
) {
|
||||
@ -755,7 +759,7 @@ class blog extends common
|
||||
}
|
||||
// Crée le commentaire
|
||||
$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([
|
||||
'module', $this->getUrl(0),
|
||||
'posts', $this->getUrl(1),
|
||||
@ -826,10 +830,8 @@ class blog extends common
|
||||
$pagination = helper::pagination($commentIds, $this->getUrl(), $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']), '#comment');
|
||||
// Liste des pages
|
||||
self::$pages = $pagination['pages'];
|
||||
// Signature de l'article
|
||||
self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
|
||||
// Signature du commentaire édité
|
||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
if ($this->isConnected() === true) {
|
||||
self::$editCommentSignature = $this->signature($this->getUser('id'));
|
||||
}
|
||||
// Commentaires en fonction de la pagination
|
||||
|
@ -1,3 +1,14 @@
|
||||
# Version 8.00
|
||||
- Ajoute trois nouvelles options pour afficher ou masquer le pseudo, la date et l'heure de l'article.
|
||||
- Corrige un bug d'affichage des articles lorsque le thème Moderne est sélectionné.
|
||||
- Corrige un bug dans la méthode de tronquage de l'article, nécessite Zwii 13.5
|
||||
- Corrige un mauvais format de la propriété buttonBack non stockée au type booléen.
|
||||
# Version 7.11
|
||||
- Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ.
|
||||
# Version 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
|
||||
|
@ -1 +1 @@
|
||||
{"name":"blog","realName":"Blog","version":"7.2","update":"0.0","delete":true,"dataDirectory":""}
|
||||
{"name":"blog","realName":"Blog","version":"7.12","update":"0.0","delete":true,"dataDirectory":""}
|
@ -18,14 +18,36 @@
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col6 newsDate textAlignRight">
|
||||
<!-- bloc signature et date -->
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $module::$articleSignature; ?>
|
||||
<?php echo template::ico('calendar-empty'); ?>
|
||||
<?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 signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId'])) ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- bloc date -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
|| $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
&& $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo ' - '; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_OWNER
|
||||
@ -88,7 +110,7 @@
|
||||
'readonly' => true
|
||||
]); ?>
|
||||
<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', [
|
||||
'label' => 'Nom',
|
||||
'readonly' => true,
|
||||
@ -122,7 +144,7 @@
|
||||
'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength'])
|
||||
]); ?>
|
||||
<div id="blogArticleContentAlarm"> </div>
|
||||
<?php if ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
|
||||
<?php if ($this->isConnected() === false): ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::captcha('blogArticleCaptcha', [
|
||||
|
@ -1,153 +1,154 @@
|
||||
<?php echo template::formOpen('blogEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('blogEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'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 class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('blogEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</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 class="col6">
|
||||
<?php echo template::text('blogEditPermalink', [
|
||||
'label' => 'Permalink',
|
||||
'value' => $this->getUrl(2)
|
||||
]); ?>
|
||||
</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 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 class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::file('blogEditPicture', [
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'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 class="col6">
|
||||
<?php echo template::text('blogEditPermalink', [
|
||||
'label' => 'Permalink',
|
||||
'value' => $this->getUrl(2)
|
||||
]); ?>
|
||||
</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 class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::file('blogEditPicture', [
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'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>
|
||||
<?php echo template::textarea('blogEditContent', [
|
||||
'class' => 'editorWysiwyg',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
|
||||
]); ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Options de publication');?></h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditUserId', $module::$users, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getUser('id'),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::date('blogEditPublishedOn', [
|
||||
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Publication',
|
||||
'value' => floor($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) / 60) * 60
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditConsent', $module::$articleConsent , [
|
||||
'label' => 'Édition - Suppression',
|
||||
'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>
|
||||
<?php echo template::textarea('blogEditContent', [
|
||||
'class' => 'editorWysiwyg',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content'])
|
||||
]); ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Options de publication'); ?></h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditUserId', $module::$users, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getUser('id'),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::date('blogEditPublishedOn', [
|
||||
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
|
||||
'type' => 'datetime-local',
|
||||
'label' => 'Publication',
|
||||
'value' => floor($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) / 60) * 60
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditConsent', $module::$articleConsent, [
|
||||
'label' => 'Édition - Suppression',
|
||||
'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 class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Commentaires');?></h4>
|
||||
<div class="row">
|
||||
<div class="col4 ">
|
||||
<?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 ">
|
||||
<?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">
|
||||
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength,[
|
||||
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
||||
'label' => 'Caractères par commentaire',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Commentaires'); ?></h4>
|
||||
<div class="row">
|
||||
<div class="col4 ">
|
||||
<?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 ">
|
||||
<?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">
|
||||
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength, [
|
||||
'help' => 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.',
|
||||
'label' => 'Caractères par commentaire',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength'])
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3 commentOptionsWrapper offset2">
|
||||
<?php echo template::checkbox('blogEditCommentNotification', true, 'Notification par email', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']),
|
||||
]); ?>
|
||||
</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 class="col4 commentOptionsWrapper">
|
||||
<?php echo template::select('blogEditCommentGroupNotification', $module::$groupNews, [
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']),
|
||||
]); ?>
|
||||
</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>
|
||||
<?php echo template::formClose(); ?>
|
@ -24,11 +24,32 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6 blogEdit">
|
||||
<!-- bloc signature et date -->
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
|
||||
<?php echo template::ico('calendar-empty'); ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
|
||||
<?php endif; ?>
|
||||
<!-- bloc Date -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
|| $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
&& $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo ' - '; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -51,7 +72,7 @@
|
||||
<div class="col6 blogEdit">
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER
|
||||
@ -103,18 +124,19 @@
|
||||
file_exists(self::FILE_DIR . 'source/' . $article['picture'])
|
||||
): ?>
|
||||
<div class="col3">
|
||||
<?php // Déterminer le nom de la miniature
|
||||
$parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
|
||||
$thumb = 'mini_' . $parts['basename'];
|
||||
// Créer la miniature si manquante
|
||||
if (!file_exists(self::FILE_DIR . 'thumb/' . $thumb)) {
|
||||
$this->makeThumb(
|
||||
self::FILE_DIR . 'source/' . $article['picture'],
|
||||
self::FILE_DIR . 'thumb/' . $thumb,
|
||||
self::THUMBS_WIDTH
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
// Déterminer le nom de la miniature
|
||||
$parts = pathinfo($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
|
||||
$thumb = 'mini_' . $parts['basename'];
|
||||
// Créer la miniature si manquante
|
||||
if (!file_exists(self::FILE_DIR . 'thumb/' . $thumb)) {
|
||||
$this->makeThumb(
|
||||
self::FILE_DIR . 'source/' . $article['picture'],
|
||||
self::FILE_DIR . 'thumb/' . $thumb,
|
||||
self::THUMBS_WIDTH
|
||||
);
|
||||
}
|
||||
?>
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
|
||||
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>"
|
||||
alt="<?php echo $article['picture']; ?>">
|
||||
@ -138,21 +160,46 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="blogDate">
|
||||
<!-- bloc signature et date -->
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
|
||||
<?php echo template::ico('calendar-empty'); ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
</div>
|
||||
<div class="blogContent">
|
||||
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>
|
||||
<?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
|
||||
<div class="readMoreContainer">
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
||||
<button class="readMoreButton">
|
||||
<?php echo helper::translate('Lire la suite'); ?>
|
||||
</button>
|
||||
</a>
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?>
|
||||
<?php endif; ?> <!-- bloc date -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
|| $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
&& $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo ' - '; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<div class="blogContent">
|
||||
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']); ?>
|
||||
<?php if ($lenght > 0): ?>
|
||||
<?php ?>
|
||||
<?php echo helper::subword($article['content'], 0, $lenght); ?>...
|
||||
<div class="readMoreContainer">
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
|
||||
<button class="readMoreButton">
|
||||
<?php echo helper::translate('Lire la suite'); ?>
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php echo $article['content']; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
40
module/blog/view/option/option.js.php
Normal file
40
module/blog/view/option/option.js.php
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* This file is part of Zwii.
|
||||
*
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Gestion du changement de la case "Afficher la date"
|
||||
$('#blogOptionShowDate').change(function() {
|
||||
var showDateChecked = $(this).is(':checked');
|
||||
|
||||
// Afficher ou masquer le wrapper de l'heure selon l'état de la date
|
||||
if (showDateChecked) {
|
||||
$('.timeWrapper').show();
|
||||
} else {
|
||||
$('.timeWrapper').hide();
|
||||
// Désactiver l'option "Afficher l'heure" lorsque la date est désactivée
|
||||
$('#blogOptionShowTime').prop('checked', false).trigger('change');
|
||||
}
|
||||
|
||||
// Afficher ou masquer le format de la date
|
||||
$('#blogOptionDateFormatWrapper').toggle(showDateChecked);
|
||||
}).trigger('change'); // Déclenchement au chargement de la page
|
||||
|
||||
// Gestion du changement de la case "Afficher l'heure"
|
||||
$('#blogOptionShowTime').change(function() {
|
||||
var showTimeChecked = $(this).is(':checked');
|
||||
|
||||
// Afficher ou masquer le format de l'heure
|
||||
$('#blogOptionTimeFormatWrapper').toggle(showTimeChecked);
|
||||
}).trigger('change'); // Déclenchement au chargement de la page
|
||||
});
|
@ -17,32 +17,36 @@
|
||||
<h4>
|
||||
<?php echo helper::translate('Paramètres'); ?>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('blogOptionButtonBack', true, 'Bouton de retour', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('blogOptionShowPseudo', true, 'Signature', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showPseudo'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('blogOptionArticlesLayout', $module::$articlesLayout, [
|
||||
'label' => 'Disposition',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
|
||||
<?php echo template::checkbox('blogOptionShowDate', true, 'Afficher la date', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showDate']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('blogOptionArticlesLenght', $module::$articlesLenght, [
|
||||
'label' => 'Aperçus',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('blogOptionItemsperPage', $module::$ArticlesListed, [
|
||||
'label' => 'Articles par page',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('blogOptionDateFormat', $module::$dateFormats, [
|
||||
'label' => 'Format des dates',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<div class="col3 timeWrapper">
|
||||
<?php echo template::checkbox('blogOptionShowTime', true, 'Afficher l\'heure', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showTime']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 timeWrapper">
|
||||
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
|
||||
'label' => 'Format des heures',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||
@ -50,19 +54,34 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogOptionArticlesLayout', $module::$articlesLayout, [
|
||||
'label' => 'Disposition',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogOptionArticlesLenght', $module::$articlesLenght, [
|
||||
'label' => 'Aperçus',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogOptionItemsperPage', $module::$ArticlesListed, [
|
||||
'label' => 'Articles par page',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('blogOptionShowFeeds', true, 'Lien du flux RSS', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('blogOptionFeedslabel', [
|
||||
'label' => 'Texte de l\'étiquette',
|
||||
'label' => 'Texte de l\'étiquette RSS',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,3 +1,5 @@
|
||||
# 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
|
||||
|
@ -17,7 +17,7 @@
|
||||
class form extends common
|
||||
{
|
||||
|
||||
const VERSION = '4.3';
|
||||
const VERSION = '4.4';
|
||||
const REALNAME = 'Formulaire';
|
||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<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="col6">
|
||||
<?php echo template::checkbox('formOptionCaptcha', true, 'Captcha', [
|
||||
@ -49,7 +49,7 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Gabarit');?></h4>
|
||||
<h4><?php echo helper::translate('Gabarit'); ?></h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('formOptionAlign', $module::$optionAlign, [
|
||||
@ -78,7 +78,7 @@
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<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 :', [
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
||||
@ -128,10 +128,10 @@
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::file('formOptionLogo', [
|
||||
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'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 class="col4">
|
||||
@ -153,4 +153,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -27,8 +27,6 @@ $( document ).ready(function() {
|
||||
serializeRegexp: ""
|
||||
});
|
||||
|
||||
console.log($("#galleryEditSort").val());
|
||||
|
||||
if ($("#galleryEditSort").val() !== "SORT_HAND") {
|
||||
$("#galleryTable tr").addClass("nodrag nodrop");
|
||||
$(".zwiico-sort").hide();
|
||||
|
@ -1,3 +1,10 @@
|
||||
# Versions 6.0
|
||||
- Ajoute trois nouvelles options pour afficher ou masquer la signature, la date et l'heure de l'article.
|
||||
- Corrige un mauvais format de la propriété buttonBack non stockée au type booléen.
|
||||
# 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
|
||||
|
@ -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",
|
||||
"Couleur de la bordure": "Randfarbe",
|
||||
"Couleur du fond": "Bodenfarbe",
|
||||
"Etiquette RSS": "RSS -Label",
|
||||
"Étiquette RSS": "RSS -Label",
|
||||
"Fine": "Bußgeld",
|
||||
"Flux limité aux articles de la première page.": "Flow Limited auf Artikel auf der ersten Seite.",
|
||||
"Informations générales": "Allgemeine Informationen",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Draft copy",
|
||||
"Couleur de la bordure": "Border color",
|
||||
"Couleur du fond": "Bottom color",
|
||||
"Etiquette RSS": "RSS label",
|
||||
"Étiquette RSS": "RSS label",
|
||||
"Fine": "Fine",
|
||||
"Flux limité aux articles de la première page.": "Flow limited to articles on the first page.",
|
||||
"Informations générales": "General informations",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Borrador",
|
||||
"Couleur de la bordure": "Color de bordillo",
|
||||
"Couleur du fond": "Color de fondo",
|
||||
"Etiquette RSS": "",
|
||||
"Étiquette RSS": "",
|
||||
"Fine": "Fino",
|
||||
"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",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "",
|
||||
"Couleur de la bordure": "",
|
||||
"Couleur du fond": "",
|
||||
"Etiquette RSS": "",
|
||||
"Étiquette RSS": "",
|
||||
"Fine": "",
|
||||
"Flux limité aux articles de la première page.": "",
|
||||
"Informations générales": "",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Σχέδιο",
|
||||
"Couleur de la bordure": "Χρώμα γραμμής",
|
||||
"Couleur du fond": "Χρώμα του φόντου",
|
||||
"Etiquette RSS": "Ετικέτα RSS",
|
||||
"Étiquette RSS": "Ετικέτα RSS",
|
||||
"Fine": "Πολύ λεπτή γραμμήλεπτή γραμμή",
|
||||
"Flux limité aux articles de la première page.": "Ροή περιορίζεται σε άρθρα στην πρώτη σελίδα.",
|
||||
"Informations générales": "Γενικές πληροφορίες",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Progetto di copia",
|
||||
"Couleur de la bordure": "Colore del bordo",
|
||||
"Couleur du fond": "Colore inferiore",
|
||||
"Etiquette RSS": "Etichetta RSS",
|
||||
"Étiquette RSS": "Etichetta RSS",
|
||||
"Fine": "Bene",
|
||||
"Flux limité aux articles de la première page.": "Flusso limitato agli articoli nella prima pagina.",
|
||||
"Informations générales": "Informazioni generali",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Cópia rascunho",
|
||||
"Couleur de la bordure": "Cor da borda",
|
||||
"Couleur du fond": "Cor inferior",
|
||||
"Etiquette RSS": "Rótulo RSS",
|
||||
"Étiquette RSS": "Rótulo RSS",
|
||||
"Fine": "Multar",
|
||||
"Flux limité aux articles de la première page.": "Fluxo limitado a artigos na primeira página.",
|
||||
"Informations générales": "Informações gerais",
|
||||
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Taslak",
|
||||
"Couleur de la bordure": "Çerçeve rengi",
|
||||
"Couleur du fond": "Arka plan rengi",
|
||||
"Etiquette RSS": "RSS etiketi",
|
||||
"Étiquette RSS": "RSS etiketi",
|
||||
"Fine": "İnce",
|
||||
"Flux limité aux articles de la première page.": "İlk sayfadaki makalelerle sınırlıdır.",
|
||||
"Informations générales": "Genel bilgiler",
|
||||
|
@ -16,7 +16,7 @@
|
||||
class news extends common
|
||||
{
|
||||
|
||||
const VERSION = '5.6';
|
||||
const VERSION = '6.0';
|
||||
const REALNAME = 'News';
|
||||
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
||||
|
||||
@ -124,9 +124,12 @@ class news extends common
|
||||
$feeds = new \FeedWriter\RSS2();
|
||||
|
||||
// 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->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->setDate(date('r', time()));
|
||||
$feeds->addGenerator();
|
||||
@ -172,7 +175,8 @@ class news extends common
|
||||
$publishedOn = $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true);
|
||||
$publishedOff = $this->getInput('newsAddPublishedOff') ? $this->getInput('newsAddPublishedOff', helper::FILTER_DATETIME) : '';
|
||||
$this->setData([
|
||||
'module', $this->getUrl(0),
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
'posts',
|
||||
$newsId,
|
||||
[
|
||||
@ -286,7 +290,8 @@ class news extends common
|
||||
// Fin feuille de style
|
||||
|
||||
$this->setData([
|
||||
'module', $this->getUrl(0),
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
'theme',
|
||||
[
|
||||
'style' => $success ? self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' : '',
|
||||
@ -298,7 +303,8 @@ class news extends common
|
||||
]);
|
||||
|
||||
$this->setData([
|
||||
'module', $this->getUrl(0),
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
'config',
|
||||
[
|
||||
'feeds' => $this->getInput('newsOptionShowFeeds', helper::FILTER_BOOLEAN),
|
||||
@ -308,7 +314,10 @@ class news extends common
|
||||
'height' => $this->getInput('newsOptionHeight', helper::FILTER_INT, true),
|
||||
'dateFormat' => $this->getInput('newsOptionDateFormat'),
|
||||
'timeFormat' => $this->getInput('newsOptionTimeFormat'),
|
||||
'buttonBack' => $this->getInput('newsOptionButtonBack'),
|
||||
'buttonBack' => $this->getInput('newsOptionButtonBack', helper::FILTER_BOOLEAN),
|
||||
'showDate' => $this->getInput('newsOptionShowDate', helper::FILTER_BOOLEAN),
|
||||
'showTime' => $this->getInput('newsOptionShowTime', helper::FILTER_BOOLEAN),
|
||||
'showPseudo' => $this->getInput('newsOptionShowPseudo', helper::FILTER_BOOLEAN),
|
||||
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
|
||||
]
|
||||
]);
|
||||
@ -316,7 +325,7 @@ class news extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/option',
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'state' => true
|
||||
]);
|
||||
@ -426,7 +435,8 @@ class news extends common
|
||||
$publishedOn = $this->getInput('newsEditPublishedOn', helper::FILTER_DATETIME, true);
|
||||
$publishedOff = $this->getInput('newsEditPublishedOff') ? $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME) : '';
|
||||
$this->setData([
|
||||
'module', $this->getUrl(0),
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
'posts',
|
||||
$newsId,
|
||||
[
|
||||
@ -488,6 +498,8 @@ class news extends common
|
||||
}
|
||||
// L'article existe
|
||||
else {
|
||||
self::$dateFormat = $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']);
|
||||
self::$timeFormat = $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']);
|
||||
self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']));
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -607,6 +619,15 @@ class news extends common
|
||||
// Mettre à jour la version
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '5.3']);
|
||||
}
|
||||
// Mise à jour 6.0
|
||||
if (version_compare($versionData, '6.0', '<')) {
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showTime', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showDate', true]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'showPseudo', true]);
|
||||
// Mettre à jour la version
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -12,32 +12,50 @@
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col6 newsDate textAlignRight">
|
||||
<!-- bloc signature et date -->
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $module::$articleSignature . ' - '; ?>
|
||||
<?php echo template::ico('calendar-empty'); ?>
|
||||
<?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 signature -->
|
||||
<?php if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId'])); ?>
|
||||
<?php endif; ?>
|
||||
<!-- bloc date -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
|| $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
&& $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo ' - '; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?> <!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getUser('group') === self::GROUP_ADMIN)
|
||||
)
|
||||
): ?>
|
||||
-
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>">
|
||||
<?php echo template::ico('pencil'); ?>
|
||||
<?php echo template::ico('pencil', ['margin' => 'left']); ?>
|
||||
<?php echo helper::translate('Éditer'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<!-- Bloc RSS-->
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?>
|
||||
-
|
||||
<div id="rssFeed">
|
||||
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>"
|
||||
target="_blank">
|
||||
<img src='module/news/ressource/feed-icon-16.gif' />
|
||||
<img src='module/news/ressource/feed-icon-16.gif' />
|
||||
<?php
|
||||
echo '<p>' . $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) . '</p>';
|
||||
?>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php echo template::formOpen('newsEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<div class="col1">
|
||||
<?php echo template::button('newsEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset6">
|
||||
<div class="col2 offset7">
|
||||
<?php echo template::button('newsEditDraft', [
|
||||
'uniqueSubmission' => true,
|
||||
'value' => helper::translate('Brouillon')
|
||||
|
@ -1,5 +1,6 @@
|
||||
<?php if ($module::$news): ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), 'theme', 'style']);?> "/>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="<?php echo helper::baseUrl(false) . $this->getData(['module', $this->getUrl(0), 'theme', 'style']); ?> " />
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'feeds'])): ?>
|
||||
<div id="rssFeed">
|
||||
<a type="application/rss+xml" href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/rss'; ?>" target="_blank">
|
||||
@ -20,22 +21,42 @@
|
||||
<?php echo '<a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
|
||||
</h2>
|
||||
<div class="newsSignature">
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $news['userId'] . ' - '; ?>
|
||||
<?php echo template::ico('calendar-empty'); ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $news['publishedOn'], self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $news['publishedOn'], self::$i18nUI); ?>
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('user'); ?>
|
||||
<?php echo $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'userId'])); ?>
|
||||
<?php endif; ?>
|
||||
<!-- bloc Date -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
|| $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo template::ico('calendar-empty', ['margin' => 'left']); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showDate']) === true
|
||||
&& $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true
|
||||
): ?>
|
||||
<?php echo ' - '; ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?>
|
||||
<?php echo helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'publishedOn']), self::$i18nUI); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getUser('group') === self::GROUP_ADMIN)
|
||||
)
|
||||
): ?>
|
||||
-
|
||||
<a
|
||||
href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>">
|
||||
<?php echo template::ico('pencil'); ?> Éditer
|
||||
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>">
|
||||
<?php echo template::ico('pencil', ['margin' => 'left']); ?> Éditer
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -51,7 +72,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
<?php echo $module::$pages; ?>
|
||||
|
40
module/news/view/option/option.js.php
Normal file
40
module/news/view/option/option.js.php
Normal file
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* This file is part of Zwii.
|
||||
*
|
||||
* For full copyright and license information, please see the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
* @author Rémi Jean <remi.jean@outlook.com>
|
||||
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||
* @link http://zwiicms.fr/
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
// Gestion du changement de la case "Afficher la date"
|
||||
$('#newsOptionShowDate').change(function() {
|
||||
var showDateChecked = $(this).is(':checked');
|
||||
|
||||
// Afficher ou masquer le wrapper de l'heure selon l'état de la date
|
||||
if (showDateChecked) {
|
||||
$('.timeWrapper').show();
|
||||
} else {
|
||||
$('.timeWrapper').hide();
|
||||
// Désactiver l'option "Afficher l'heure" lorsque la date est désactivée
|
||||
$('#newsOptionShowTime').prop('checked', false).trigger('change');
|
||||
}
|
||||
|
||||
// Afficher ou masquer le format de la date
|
||||
$('#newsOptionDateFormatWrapper').toggle(showDateChecked);
|
||||
}).trigger('change'); // Déclenchement au chargement de la page
|
||||
|
||||
// Gestion du changement de la case "Afficher l'heure"
|
||||
$('#newsOptionShowTime').change(function() {
|
||||
var showTimeChecked = $(this).is(':checked');
|
||||
|
||||
// Afficher ou masquer le format de l'heure
|
||||
$('#newsOptionTimeFormatWrapper').toggle(showTimeChecked);
|
||||
}).trigger('change'); // Déclenchement au chargement de la page
|
||||
});
|
@ -1,111 +1,130 @@
|
||||
<?php echo template::formOpen('newsOption'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('newsOptionBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('newsOptionSubmit'); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('newsOptionBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres'); ?></h4>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::select('newsOptionItemsperCol', $module::$columns, [
|
||||
'label' => 'Nombre de colonnes',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('newsOptionItemsperPage', $module::$itemsList, [
|
||||
'label' => 'Articles par page',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::select('newsOptionHeight', $module::$height, [
|
||||
'label' => 'Abrégé de l\'article',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsOptionDateFormat', $module::$dateFormats, [
|
||||
'label' => 'Format des dates',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsOptionTimeFormat', $module::$timeFormats, [
|
||||
'label' => 'Format des heures',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('newsOptionSubmit'); ?>
|
||||
</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::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
|
||||
'help' => 'Flux limité aux articles de la première page.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('newsOptionButtonBack', true, 'Bouton de retour', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('newsOptionFeedslabel', [
|
||||
'label' => 'Etiquette RSS',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('newsOptionShowPseudo', true, 'Signature', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showPseudo'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::checkbox('newsOptionShowDate', true, 'Afficher la date', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showDate']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsOptionDateFormat', $module::$dateFormats, [
|
||||
'label' => 'Format des dates',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 timeWrapper">
|
||||
<?php echo template::checkbox('newsOptionShowTime', true, 'Afficher l\'heure', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showTime']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 timeWrapper">
|
||||
<?php echo template::select('newsOptionTimeFormat', $module::$timeFormats, [
|
||||
'label' => 'Format des heures',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('newsOptionItemsperCol', $module::$columns, [
|
||||
'label' => 'Nombre de colonnes',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperCol'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('newsOptionItemsperPage', $module::$itemsList, [
|
||||
'label' => 'Articles par page',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('newsOptionHeight', $module::$height, [
|
||||
'label' => 'Abrégé de l\'article',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'height'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::checkbox('newsOptionShowFeeds', true, 'Lien du flux RSS', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'feeds']),
|
||||
'help' => 'Flux limité aux articles de la première page.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col6">
|
||||
<?php echo template::text('newsOptionFeedslabel', [
|
||||
'label' => 'Texte de l\'étiquette RSS',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Thème');?></h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsThemeBorderStyle', $module::$borderStyle, [
|
||||
'label' => 'Bordure',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsThemeBorderWidth', $module::$borderWidth, [
|
||||
'label' => 'Épaisseur',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::text('newsThemeBorderColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
|
||||
'label' => 'Couleur de la bordure',
|
||||
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::text('newsThemeBackgroundColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
|
||||
'label' => 'Couleur du fond',
|
||||
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Thème'); ?></h4>
|
||||
<div class="row">
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsThemeBorderStyle', $module::$borderStyle, [
|
||||
'label' => 'Bordure',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderStyle'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsThemeBorderWidth', $module::$borderWidth, [
|
||||
'label' => 'Épaisseur',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderWidth'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::text('newsThemeBorderColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
|
||||
'label' => 'Couleur de la bordure',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'theme', 'borderColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::text('newsThemeBackgroundColor', [
|
||||
'class' => 'colorPicker',
|
||||
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
|
||||
'label' => 'Couleur du fond',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'theme', 'backgroundColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<div class="moduleVersion">Version n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
|
@ -58,7 +58,7 @@ class redirection extends common
|
||||
{
|
||||
// Message si l'utilisateur peut éditer la page
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
$this->isConnected() === true
|
||||
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||
&& $this->getUrl(1) !== 'force'
|
||||
) {
|
||||
|
@ -1,3 +1,12 @@
|
||||
# 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
|
||||
|
@ -27,7 +27,7 @@ class slider extends common
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
const VERSION = '6.4';
|
||||
const VERSION = '7.2';
|
||||
const REALNAME = 'Carrousel';
|
||||
const DELETE = true;
|
||||
const UPDATE = '0.0';
|
||||
@ -57,6 +57,7 @@ class slider extends common
|
||||
false => 'Puces invisibles'
|
||||
];
|
||||
|
||||
|
||||
public static $auto = [
|
||||
true => 'Active',
|
||||
false => 'Inactive'
|
||||
@ -76,7 +77,7 @@ class slider extends common
|
||||
1920 => '1920 pixels',
|
||||
0 => 'Largeur de l\'écran'
|
||||
];
|
||||
public static $selectedMaxwidth = 0;
|
||||
public static $selectedMaxwidth = 640;
|
||||
|
||||
// Transition
|
||||
public static $speed = [
|
||||
@ -125,12 +126,17 @@ class slider extends common
|
||||
|
||||
//Choix du tri
|
||||
public static $sort = [
|
||||
'asc' => 'Alphabétique naturel',
|
||||
'dsc' => 'Alphabétique naturel inverse',
|
||||
'dsc' => 'Alphabétique naturel',
|
||||
'asc' => 'Alphabétique naturel inverse',
|
||||
'rand' => 'Aléatoire',
|
||||
'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
|
||||
*/
|
||||
@ -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', 'sort'])) {
|
||||
case 'dsc':
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'asc':
|
||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'dsc':
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
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':
|
||||
default:
|
||||
break;
|
||||
@ -331,7 +349,8 @@ class slider extends common
|
||||
'speed' => $speed,
|
||||
'timeout' => $timeout,
|
||||
'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']),
|
||||
'legends' => $this->getData(['module', $this->getUrl(0), 'legends']),
|
||||
@ -353,7 +372,7 @@ class slider extends common
|
||||
// Sélection largeur de l'écran
|
||||
self::$selectedMaxwidth = array_key_exists($this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth']), self::$screenWidth)
|
||||
? $this->getData(['module', $this->getUrl(0), 'theme', 'maxWidth'])
|
||||
: 0;
|
||||
: 640;
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -378,23 +397,18 @@ class slider extends common
|
||||
if ($fileInfos->isDot() === false and $fileInfos->isFile() and @getimagesize($fileInfos->getPathname())) {
|
||||
self::$pictures[$directory . '/' . $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
|
||||
switch ($this->getData(['module', $galleryId, 'theme', 'sort'])) {
|
||||
case 'desc':
|
||||
uksort(self::$pictures, function ($a, $b) {
|
||||
return strcmp(basename($a), basename($b));
|
||||
});
|
||||
break;
|
||||
switch ($this->getData(['module', $this->getUrl(0), 'theme', 'sort'])) {
|
||||
case 'asc':
|
||||
uksort(self::$pictures, function ($a, $b) {
|
||||
return strcmp(basename($b), basename($a));
|
||||
});
|
||||
krsort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'dsc':
|
||||
ksort(self::$pictures, SORT_NATURAL | SORT_FLAG_CASE);
|
||||
break;
|
||||
case 'rand':
|
||||
// Récupérer les clés du tableau
|
||||
@ -410,7 +424,6 @@ class slider extends common
|
||||
self::$pictures = $shuffledPictures;
|
||||
break;
|
||||
case 'none':
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -448,7 +461,6 @@ class slider extends common
|
||||
private function init()
|
||||
{
|
||||
if (is_null($this->getData(['module', $this->getUrl(0), 'theme']))) {
|
||||
|
||||
$this->setData([
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
|
@ -15,222 +15,236 @@
|
||||
/*! http://responsiveslides.com v1.55 by @arielsalminen */
|
||||
|
||||
.rslides {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
position: relative;
|
||||
list-style: none;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.rslides li {
|
||||
-webkit-backface-visibility: hidden;
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
.rslides li {
|
||||
-webkit-backface-visibility: hidden;
|
||||
position: absolute;
|
||||
display: none;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.rslides li:first-child {
|
||||
position: relative;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
.rslides li:first-child {
|
||||
position: relative;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.rslides img {
|
||||
display: block;
|
||||
height: auto;
|
||||
float: left;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
}
|
||||
.rslides img {
|
||||
display: block;
|
||||
height: auto;
|
||||
float: left;
|
||||
width: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
#wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font: 600 28px/36px sans-serif;
|
||||
margin: 50px 0;
|
||||
}
|
||||
.rslides h1 {
|
||||
font: 600 28px/36px sans-serif;
|
||||
margin: 50px 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
font: 600 18px/24px sans-serif;
|
||||
color: #999;
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
.rslides h3 {
|
||||
font: 600 18px/24px sans-serif;
|
||||
color: #999;
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #222;
|
||||
}
|
||||
.rslides a {
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.rslides {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.rslides_container {
|
||||
margin-bottom: 50px;
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
.rslides {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.centered-btns_nav {
|
||||
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;
|
||||
}
|
||||
.rslides_container {
|
||||
margin-bottom: 50px;
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.centered-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
.centered-btns_nav {
|
||||
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 {
|
||||
left: auto;
|
||||
background-position: right top;
|
||||
right: 0;
|
||||
}
|
||||
.centered-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.transparent-btns_nav {
|
||||
z-index: 3;
|
||||
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%;
|
||||
}
|
||||
.centered-btns_nav.next {
|
||||
left: auto;
|
||||
background-position: right top;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.transparent-btns_nav.next {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
.transparent-btns_nav {
|
||||
z-index: 3;
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
.transparent-btns_nav.next {
|
||||
left: auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.large-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
.large-btns_nav {
|
||||
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 {
|
||||
left: auto;
|
||||
background-position: right 50%;
|
||||
right: 0;
|
||||
}
|
||||
.large-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.large-btns_nav.next {
|
||||
left: auto;
|
||||
background-position: right 50%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Boutons blancs
|
||||
*/
|
||||
.white-btns_nav {
|
||||
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: transparent url("module/slider/view/index/white.gif") no-repeat left 50%;
|
||||
width: 38px;
|
||||
}
|
||||
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: transparent url("module/slider/view/index/white.gif") no-repeat left 50%;
|
||||
width: 38px;
|
||||
}
|
||||
|
||||
.white-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
.white-btns_nav:active {
|
||||
opacity: 1.0;
|
||||
}
|
||||
|
||||
.white-btns_nav.next {
|
||||
left: auto;
|
||||
background-position: right 50%;
|
||||
right: 0;
|
||||
}
|
||||
.white-btns_nav.next {
|
||||
left: auto;
|
||||
background-position: right 50%;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
Boutons blancs
|
||||
*/
|
||||
.centered-btns_nav:focus,
|
||||
.transparent-btns_nav:focus,
|
||||
.centered-btns_nav:focus,
|
||||
.transparent-btns_nav:focus,
|
||||
.large-btns_nav:focus,
|
||||
.white-btns_nav:focus {
|
||||
outline: none;
|
||||
}
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.centered-btns_tabs,
|
||||
.transparent-btns_tabs,
|
||||
.centered-btns_tabs,
|
||||
.transparent-btns_tabs,
|
||||
.large-btns_tabs,
|
||||
.white-btns_tabs {
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
}
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.centered-btns_tabs li,
|
||||
.transparent-btns_tabs li,
|
||||
.centered-btns_tabs li,
|
||||
.transparent-btns_tabs li,
|
||||
.large-btns_tabs li,
|
||||
.white-btns_tabs li {
|
||||
display: inline;
|
||||
float: none;
|
||||
_float: left;
|
||||
*float: left;
|
||||
margin-right: 5px;
|
||||
}
|
||||
display: inline;
|
||||
float: none;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.centered-btns_tabs a,
|
||||
.transparent-btns_tabs a,
|
||||
.centered-btns_tabs a,
|
||||
.transparent-btns_tabs a,
|
||||
.large-btns_tabs a,
|
||||
.white-btns_tabs a {
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
background: #ccc;
|
||||
.white-btns_tabs a {
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
-webkit-border-radius: 15px;
|
||||
-moz-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
background: #ccc;
|
||||
background: rgba(0, 0, 0, .2);
|
||||
display: inline-block;
|
||||
_display: block;
|
||||
*display: block;
|
||||
display: inline-block;
|
||||
/*display: block;*/
|
||||
-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);
|
||||
box-shadow: inset 0 0 2px 0 rgba(0, 0, 0, .3);
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
}
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
}
|
||||
|
||||
.centered-btns_here a,
|
||||
.transparent-btns_here a,
|
||||
.centered-btns_here a,
|
||||
.transparent-btns_here a,
|
||||
.large-btns_here a,
|
||||
.white-btns_here a {
|
||||
background: #222;
|
||||
background: rgba(0,0,0, .8);
|
||||
}
|
||||
background: #222;
|
||||
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 () {
|
||||
|
||||
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']); ?>";
|
||||
// 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%");
|
||||
$(function () {
|
||||
$("#sliders").responsiveSlides({
|
||||
|
@ -2,15 +2,17 @@
|
||||
<div id="wrapper">
|
||||
<div class="rslides_container">
|
||||
<ul class="rslides" id="sliders">
|
||||
<!--id="<?php echo $this->getData(['module', $this->getUrl(0), 'config', 'boutonsVisibles']); ?>"> -->
|
||||
<?php foreach ($module::$pictures as $picture => $options): ?>
|
||||
<?php if (!empty($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; ?>
|
||||
<li>
|
||||
<img src="<?php echo helper::baseUrl(false) . $picture; ?>" alt="<?php echo $options['legend']; ?>">
|
||||
</li>
|
||||
<?php if (!empty($options['uri'])): ?>
|
||||
</li>
|
||||
<?php if (!empty($options['uri'])): ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
|
@ -53,26 +53,33 @@
|
||||
<div class="block">
|
||||
<h4>Navigation</h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderThemeTri', $module::$sort, [
|
||||
<div class="col3">
|
||||
<?php echo template::select('sliderThemeSort', $module::$sort, [
|
||||
'label' => 'Tri des images',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'sort'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<div class="col3">
|
||||
<?php echo template::select('sliderThemePager', $module::$pager, [
|
||||
'label' => 'Puces horizontales',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'pager']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<div class="col3">
|
||||
<?php echo template::select('sliderThemeNameSpace', $module::$namespace, [
|
||||
'label' => 'Boutons latéraux',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'namespace'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
<?php echo template::select('sliderThemeCaption', $module::$caption, [
|
||||
'label' => 'Légendes',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'theme', 'caption'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
@ -1,35 +1,35 @@
|
||||
|
||||
<?php echo template::formOpen('galleryUpdateForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('galleryUpdateBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('galleryUpdateSubmit'); ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('galleryUpdateBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Dossier de la galerie</h4>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::hidden('galleryUpdateDirectoryOld', [
|
||||
'noDirty' => true, // Désactivé à cause des modifications en ajax
|
||||
]); ?>
|
||||
<?php echo template::select('galleryUpdateDirectory', [], [
|
||||
'label' => 'Dossier cible',
|
||||
'noDirty' => true, // Désactivé à cause des modifications en ajax,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('galleryUpdateSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4>Dossier de la galerie</h4>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::hidden('galleryUpdateDirectoryOld', [
|
||||
'noDirty' => true, // Désactivé à cause des modifications en ajax
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'directory']),
|
||||
]); ?>
|
||||
<?php echo template::select('galleryUpdateDirectory', [], [
|
||||
'label' => 'Dossier cible',
|
||||
'noDirty' => true, // Désactivé à cause des modifications en ajax,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<div class="moduleVersion">Module Slider version n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
|
60
tmplog.txt
Normal file
60
tmplog.txt
Normal file
@ -0,0 +1,60 @@
|
||||
[JsonDb][17:33:28.696300]--site/data/user.json
|
||||
[JsonDb][17:33:30.923100]--site/data/config.json
|
||||
[JsonDb][17:33:39.929400]--site/data/fr_FR/page.json
|
||||
[SecurePut][17:33:39.932300]--site/data/fr_FR/content/accueil.html
|
||||
[SecurePut][17:33:39.935700]--site/data/fr_FR/content/enfant.html
|
||||
[SecurePut][17:33:39.938700]--site/data/fr_FR/content/privee.html
|
||||
[SecurePut][17:33:39.940500]--site/data/fr_FR/content/mise-en-page.html
|
||||
[SecurePut][17:33:39.942300]--site/data/fr_FR/content/menu-lateral.html
|
||||
[SecurePut][17:33:39.944900]--site/data/fr_FR/content/blog.html
|
||||
[SecurePut][17:33:39.947400]--site/data/fr_FR/content/galeries.html
|
||||
[SecurePut][17:33:39.949500]--site/data/fr_FR/content/site-de-zwii.html
|
||||
[SecurePut][17:33:39.952400]--site/data/fr_FR/content/contact.html
|
||||
[SecurePut][17:33:39.954800]--site/data/fr_FR/content/barre.html
|
||||
[SecurePut][17:33:39.957200]--site/data/fr_FR/content/barrelateraleavecmenu.html
|
||||
[SecurePut][17:33:39.960100]--site/data/fr_FR/content/mentions-legales.html
|
||||
[SecurePut][17:33:39.962300]--site/data/fr_FR/content/erreur302.html
|
||||
[SecurePut][17:33:39.964600]--site/data/fr_FR/content/erreur403.html
|
||||
[SecurePut][17:33:39.967200]--site/data/fr_FR/content/erreur404.html
|
||||
[SecurePut][17:33:39.969200]--site/data/fr_FR/content/recherche.html
|
||||
[JsonDb][17:33:39.971800]--site/data/fr_FR/module.json
|
||||
[SecurePut][17:33:39.975600]--site/data/fr_FR/content/accueil.html
|
||||
[JsonDb][17:33:39.979800]--site/data/fr_FR/locale.json
|
||||
[SecurePut][17:33:39.982100]--site/data/fr_FR/content/accueil.html
|
||||
[JsonDb][17:33:40.236800]--site/data/user.json
|
||||
[JsonDb][17:33:41.108200]--site/data/config.json
|
||||
[JsonDb][16:39:49.897300]--site/data/user.json
|
||||
[JsonDb][16:40:24.088000]--site/data/user.json
|
||||
[JsonDb][16:40:25.205100]--site/data/user.json
|
||||
[JsonDb][16:40:25.222500]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.225500]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.228800]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.232500]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.272700]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.305900]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.309400]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.347700]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.380400]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.425500]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.467600]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:25.508100]--site/data/fr_FR/module.json
|
||||
[JsonDb][16:40:26.909300]--site/data/user.json
|
||||
[JsonDb][16:40:28.342200]--site/data/user.json
|
||||
[JsonDb][16:40:35.539700]--site/data/user.json
|
||||
[JsonDb][16:46:38.876100]--site/data/user.json
|
||||
[JsonDb][17:00:43.742000]--site/data/user.json
|
||||
[SecurePut][17:00:43.757100]--site/data/font/font.html
|
||||
[SecurePut][17:00:43.759700]--site/data/font/font.css
|
||||
[JsonDb][17:00:45.950500]--site/data/user.json
|
||||
[SecurePut][17:00:45.982300]--site/data/font/font.html
|
||||
[SecurePut][17:00:45.984900]--site/data/font/font.css
|
||||
[JsonDb][17:00:50.370800]--site/data/user.json
|
||||
[SecurePut][17:00:50.386000]--site/data/font/font.html
|
||||
[SecurePut][17:00:50.388700]--site/data/font/font.css
|
||||
[JsonDb][17:00:51.923600]--site/data/user.json
|
||||
[SecurePut][17:00:51.932700]--site/data/font/font.html
|
||||
[SecurePut][17:00:51.935700]--site/data/font/font.css
|
||||
[JsonDb][17:00:54.354900]--site/data/user.json
|
||||
[JsonDb][17:00:57.097400]--site/data/user.json
|
||||
[JsonDb][17:00:59.142200]--site/data/user.json
|
||||
[JsonDb][17:01:01.703400]--site/data/user.json
|
Loading…
Reference in New Issue
Block a user