Compare commits
No commits in common. "master" and "13.1.04" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,4 +10,3 @@ core/vendor/tinymce/link_list.json
|
||||
robots.txt
|
||||
sitemap.xml
|
||||
.gitignore
|
||||
core/module/config/tool/data.key
|
11
.htaccess
11
.htaccess
@ -32,16 +32,5 @@ 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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
126
CHANGES.md
126
CHANGES.md
@ -1,130 +1,11 @@
|
||||
# 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
|
||||
|
||||
Cette modification évite les problèmes d'édition de langues différentes dans des onglets différents du même navigateur.
|
||||
|
||||
## Version 13.2.02
|
||||
|
||||
Corrige un warning quand un module blog ou news ne contient pas d'article.
|
||||
|
||||
## Version 13.2.01
|
||||
|
||||
### Correction
|
||||
|
||||
Modification de la fonction d'écriture des données de la classe jsonDB dans le but de s'assurer de l'intégrité des données écrites. Un trafic intense en pointe sur des fichiers volumineux et sur un serveur peu puissant pouvait occasionner des erreurs d'écriture ou un mauvais formatage des données json.
|
||||
|
||||
## Version 13.1.08
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige des erreurs quand une page parente ou des pages enfants ont des permissions limitées.
|
||||
- Module Search 3.1 : initialisation du module après installation dans une page sans configuration par l'utilisateur.
|
||||
|
||||
### Améliorations
|
||||
|
||||
- Sauvegarde de l'état des sélecteurs dans les tables des fontes et des utilisateurs.
|
||||
- Ajoute des contrôles d'intégrité des bases de données Json lors des opérations de chargement et de sauvegarde.
|
||||
- Fournit une interface pour le contrôle des sauvegardes automatisées et de leur nettoyage par script CRON.
|
||||
|
||||
## Version 13.1.07
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige une dépréciation de la sortie de la fonction Usort dans RFM.
|
||||
- Module slider 6.4 : corrige plusieurs bugs dans les fonctions de tri
|
||||
|
||||
## Version 13.1.06
|
||||
|
||||
### Corrections
|
||||
|
||||
- Ajout d'utilisateur, étiquette non sauvegardée.
|
||||
- Slider, corrige un tri non pris en compte.
|
||||
|
||||
## Version 13.1.05
|
||||
|
||||
### Corrections
|
||||
|
||||
- Corrige définitivement la fonction delete de la classe dot.
|
||||
- Branche de mise à jour de la version 13.1.04 incorrecte.
|
||||
# Changelog
|
||||
|
||||
## Version 13.1.04
|
||||
|
||||
### Corrections
|
||||
|
||||
- Evite une notice dans l'onglet social de la configuration lorsque l'image opengraph n'est pas spécifiée.
|
||||
- Corrige une erreur dans la classe dot (fonction delete appelée statiquement)
|
||||
- Ajoute une protection supplémentaire dans la classe jsonDb pour éviter l'enregistrement accidentel de données nulles.
|
||||
- Ne redirige pas vers une page d'erreur (403 ou 404) après un login.
|
||||
|
||||
### Améliorations
|
||||
@ -132,7 +13,6 @@ Modification de la fonction d'écriture des données de la classe jsonDB dans le
|
||||
- Mise à jour en ligne :restauration de la réécriture dans le fichier .htaccess de la racine, utilisation d'un fichier drapeau *.rewrite* pour conserver l'état de la réécriture afin de dédier la variable ```data``` (XHR) aux messages d'erreur.
|
||||
- Journalise les erreurs de mise à jour automatique.
|
||||
|
||||
|
||||
## Version 13.1.03
|
||||
|
||||
### Corrections
|
||||
@ -848,7 +728,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.
|
||||
- Étiquette dans le footer permettant d'afficher la popup des cookies.
|
||||
- Etiquette 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.5.00
|
||||
# ZwiiCMS 13.1.04
|
||||
|
||||
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.5.00
|
||||
# ZwiiCMS 13.1.04
|
||||
|
||||
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; // filtre pour le champ de formulaire A conserver pour la compatibilité
|
||||
const FILTER_DATETIME = 2;
|
||||
const FILTER_FLOAT = 3;
|
||||
const FILTER_ID = 4;
|
||||
const FILTER_INT = 5;
|
||||
@ -16,14 +16,8 @@ class helper
|
||||
const FILTER_PASSWORD = 7;
|
||||
const FILTER_STRING_LONG = 8;
|
||||
const FILTER_STRING_SHORT = 9;
|
||||
const FILTER_TIMESTAMP = 10; // Saisie d'une date en locatime
|
||||
const FILTER_TIMESTAMP = 10;
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -83,7 +77,7 @@ class helper
|
||||
// Créer la variable
|
||||
$data = array_merge($data, [$text => '']);
|
||||
}
|
||||
file_put_contents('site/i18n/' . $to . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
file_put_contents('site/i18n/' . $to . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
|
||||
}
|
||||
}
|
||||
@ -344,12 +338,13 @@ class helper
|
||||
{
|
||||
// N'interroge que le serveur Apache
|
||||
if (strpos($_SERVER["SERVER_SOFTWARE"], 'Apache') > 0) {
|
||||
self::$rewriteStatus = false;
|
||||
} else {
|
||||
self::$rewriteStatus === false;
|
||||
} elseif (self::$rewriteStatus === null) {
|
||||
// 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 = (strpos($htaccess[1], 'RewriteEngine on') !== false);
|
||||
//self::$rewriteStatus = (empty($htaccess[1]) === false);
|
||||
self::$rewriteStatus = (strpos($htaccess[1], 'RewriteEngine on') > 0) ? true : false;
|
||||
}
|
||||
return self::$rewriteStatus;
|
||||
}
|
||||
@ -408,8 +403,8 @@ class helper
|
||||
*/
|
||||
public static function deleteCookie($cookieKey)
|
||||
{
|
||||
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
||||
unset($_COOKIE[$cookieKey]);
|
||||
setcookie($cookieKey, '', time() - 3600, helper::baseUrl(false, false), '', false, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -432,8 +427,7 @@ class helper
|
||||
$text = (int) $date->format('U');
|
||||
break;
|
||||
case self::FILTER_FLOAT:
|
||||
$text = str_replace(',', '.', $text); // Remplacer les virgules par des points
|
||||
$text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION);
|
||||
$text = filter_var($text, FILTER_SANITIZE_NUMBER_FLOAT);
|
||||
$text = (float) $text;
|
||||
break;
|
||||
case self::FILTER_ID:
|
||||
@ -480,11 +474,6 @@ 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;
|
||||
}
|
||||
@ -673,35 +662,13 @@ class helper
|
||||
public static function subword($text, $start, $length)
|
||||
{
|
||||
$text = trim($text);
|
||||
|
||||
// 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
|
||||
if (strlen($text) > $length) {
|
||||
$text = mb_substr($text, $start, $length);
|
||||
|
||||
// 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);
|
||||
$text = mb_substr($text, 0, min(mb_strlen($text), mb_strrpos($text, ' ')));
|
||||
}
|
||||
|
||||
// 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
|
||||
|
@ -141,7 +141,7 @@ class Dot implements \ArrayAccess, \Iterator, \Countable
|
||||
} elseif (is_array($key)) {
|
||||
// Iterate array of paths
|
||||
foreach ($key as $k) {
|
||||
self::deleteValue($array, $k);
|
||||
delete($k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -18,12 +18,6 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
protected $db = '';
|
||||
protected $data = null;
|
||||
protected $config = [];
|
||||
// Tentative d'encodage après échec
|
||||
const MAX_JSON_ENCODE_ATTEMPTS = 5;
|
||||
// Tentative d'écriture après échec
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
// Délais entre deux tentaives
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
public function __construct($config = [])
|
||||
{
|
||||
@ -127,10 +121,10 @@ class JsonDb extends \Prowebcraft\Dot
|
||||
} else {
|
||||
if ($this->config['backup']) {
|
||||
try {
|
||||
//todo make backup of database
|
||||
copy($this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'], $this->config['dir'] . DIRECTORY_SEPARATOR . $this->config['name'] . '.backup');
|
||||
} catch (\Exception $e) {
|
||||
error_log('Erreur de chargement : ' . $e);
|
||||
exit('Erreur de chargement : ' . $e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,44 +142,20 @@ 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);
|
||||
|
||||
// Vérifie la longueur de la chaîne JSON encodée
|
||||
$encoded_length = strlen($encoded_data);
|
||||
|
||||
// Initialise le compteur de tentatives
|
||||
$attempt = 0;
|
||||
|
||||
// Tente d'encoder les données en JSON et de les sauvegarder jusqu'à 5 fois en cas d'échec
|
||||
while ($attempt < 5) {
|
||||
// Essaye d'écrire les données encodées dans le fichier de base de données
|
||||
$write_result = file_put_contents($this->db, $encoded_data, LOCK_EX); // Les utilisateurs multiples obtiennent un verrou
|
||||
|
||||
//$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
|
||||
$v = json_encode($this->data, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT);
|
||||
$l = strlen($v);
|
||||
$t = 0;
|
||||
while ($t < 5) {
|
||||
$w = file_put_contents($this->db, $v); // Multi user get a locker
|
||||
if ($w == $l) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempt++;
|
||||
|
||||
// Attente
|
||||
sleep(1);
|
||||
$t++;
|
||||
}
|
||||
|
||||
// Vérifie si l'écriture a échoué même après plusieurs tentatives
|
||||
if ($write_result !== $encoded_length) {
|
||||
// Enregistre un message d'erreur dans le journal des erreurs
|
||||
if ($w !== $l) {
|
||||
error_log('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
|
||||
// Affiche un message d'erreur et termine le script
|
||||
exit('Erreur d\'écriture, les données n\'ont pas été sauvegardées.');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -82,25 +82,17 @@ class layout extends common
|
||||
$content = 'col' . $blocks[1];
|
||||
$blockright = 'col' . $blocks[2];
|
||||
}
|
||||
// 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'];
|
||||
// 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'];
|
||||
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')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'top' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'top') {
|
||||
$this->showNavButtons('top');
|
||||
}
|
||||
$this->showContent();
|
||||
if (
|
||||
($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom'
|
||||
|| $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom')
|
||||
&& in_array($this->getUrl(1), $pattern) === false
|
||||
) {
|
||||
if ($this->getData(['page', $this->getUrl(0), 'navLeft']) === 'bottom' || $this->getData(['page', $this->getUrl(0), 'navRight']) === 'bottom') {
|
||||
$this->showNavButtons('bottom');
|
||||
}
|
||||
} else {
|
||||
@ -159,7 +151,7 @@ class layout extends common
|
||||
}
|
||||
echo '</div>';
|
||||
}
|
||||
echo '</section></main>';
|
||||
echo '</main></section>';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -338,7 +330,7 @@ class layout extends common
|
||||
// Affichage du lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'footer', 'loginLink'])
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -501,7 +493,7 @@ class layout extends common
|
||||
// Lien de connexion
|
||||
if (
|
||||
($this->getData(['theme', 'menu', 'loginLink'])
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
)
|
||||
or $this->getUrl(0) === 'theme'
|
||||
) {
|
||||
@ -588,9 +580,9 @@ class layout extends common
|
||||
|
||||
if (
|
||||
($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
@ -654,9 +646,9 @@ class layout extends common
|
||||
$items .= '<li id=' . $childKey . '>';
|
||||
if (
|
||||
($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
@ -750,7 +742,7 @@ class layout extends common
|
||||
$items .= '<li class="menuSideChild">';
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) {
|
||||
$items .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -774,7 +766,7 @@ class layout extends common
|
||||
|
||||
if (
|
||||
$this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) {
|
||||
$itemsChildren .= '<a href="' . $this->getUrl(1) . '">';
|
||||
} else {
|
||||
@ -910,7 +902,7 @@ class layout extends common
|
||||
*/
|
||||
public function showBar()
|
||||
{
|
||||
if ($this->isConnected() === true) {
|
||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
// Items de gauche
|
||||
$leftItems = '';
|
||||
// Sélecteur de langues
|
||||
@ -988,7 +980,7 @@ class layout extends common
|
||||
// Bouton Ajouter une page
|
||||
if ($this->getUser('permission', 'page', 'add')) {
|
||||
$leftItems .= '<li>' . template::ico('plus', [
|
||||
'href' => helper::baseUrl() . 'page/add/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/add',
|
||||
'help' => 'Nouvelle page ou barre latérale'
|
||||
]) . '</li>';
|
||||
}
|
||||
@ -998,27 +990,23 @@ 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'])) and
|
||||
or (!is_null($this->getData(['page', $this->getUrl(2), 'moduleId'])) &&
|
||||
!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')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
) {
|
||||
if ($this->getUser('permission', 'page', 'edit')) {
|
||||
$leftItems .= '<li>' . template::ico('pencil', [
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'help' => 'Éditer la page'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Bouton Editer le module d'une page
|
||||
if (
|
||||
$this->getUser('permission', 'page', 'module')
|
||||
and $this->geturl(1) !== 'edit'
|
||||
and $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
||||
&& $this->getData(['page', $this->getUrl(0), 'moduleId'])
|
||||
) {
|
||||
$leftItems .= '<li>' . template::ico('gear', [
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
@ -1028,10 +1016,9 @@ 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,
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0),
|
||||
'help' => 'Dupliquer la page'
|
||||
])
|
||||
. '</li>';
|
||||
@ -1039,11 +1026,9 @@ 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,
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(0),
|
||||
'help' => 'Supprimer la page',
|
||||
'id' => 'pageDelete'
|
||||
])
|
||||
@ -1071,14 +1056,18 @@ class layout extends common
|
||||
'help' => 'Thème',
|
||||
'href' => helper::baseUrl() . 'theme'
|
||||
]) . '</li>';
|
||||
$rightItems .= '<li>' . template::ico('users', [
|
||||
'help' => 'Utilisateurs',
|
||||
'href' => helper::baseUrl() . 'user'
|
||||
$rightItems .= '<li>' . template::ico('puzzle', [
|
||||
'help' => 'Modules',
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</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']);
|
||||
@ -1090,55 +1079,21 @@ class layout extends common
|
||||
$today > $checkUpdate + $this->getData(['config', 'autoUpdateDelay', 86400])
|
||||
) {
|
||||
// Dernier auto controle
|
||||
$this->setData(['core', 'lastAutoUpdate', $today], false);
|
||||
$this->setData(['core', 'lastAutoUpdate', $today]);
|
||||
if (
|
||||
helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL)
|
||||
) {
|
||||
$this->setData(['core', 'updateAvailable', true], false);
|
||||
$this->setData(['core', 'updateAvailable', true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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')
|
||||
@ -1226,7 +1181,7 @@ class layout extends common
|
||||
$vars = 'var baseUrl = ' . json_encode(helper::baseUrl(false)) . ';';
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||
) {
|
||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||
@ -1275,8 +1230,8 @@ class layout extends common
|
||||
public function showi18n($lang)
|
||||
{
|
||||
if (
|
||||
(isset($_SESSION['ZWII_SITE_CONTENT'])
|
||||
and $_SESSION['ZWII_SITE_CONTENT'] === $lang
|
||||
(isset($_SESSION['ZWII_CONTENT'])
|
||||
and $_SESSION['ZWII_CONTENT'] === $lang
|
||||
)
|
||||
) {
|
||||
$select = ' class="i18nFlagSelected" ';
|
||||
|
@ -11,16 +11,16 @@ class core extends common
|
||||
parent::__construct();
|
||||
// Token CSRF
|
||||
if (empty($_SESSION['csrf'])) {
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(64));
|
||||
$_SESSION['csrf'] = bin2hex(openssl_random_pseudo_bytes(128));
|
||||
}
|
||||
|
||||
// Fuseau horaire
|
||||
common::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
||||
date_default_timezone_set(common::$timezone);
|
||||
self::$timezone = $this->getData(['config', 'timezone']); // Utile pour transmettre le timezone à la classe helper
|
||||
date_default_timezone_set(self::$timezone);
|
||||
// Supprime les fichiers temporaires
|
||||
$lastClearTmp = mktime(0, 0, 0);
|
||||
if ($lastClearTmp > $this->getData(['core', 'lastClearTmp']) + 86400) {
|
||||
$iterator = new DirectoryIterator(common::TEMP_DIR);
|
||||
$iterator = new DirectoryIterator(self::TEMP_DIR);
|
||||
foreach ($iterator as $fileInfos) {
|
||||
if (
|
||||
$fileInfos->isFile() &&
|
||||
@ -32,6 +32,8 @@ 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);
|
||||
@ -41,11 +43,11 @@ class core extends common
|
||||
and $this->getData(['user']) // Pas de backup pendant l'installation
|
||||
) {
|
||||
// Copie des fichier de données
|
||||
helper::autoBackup(common::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||
helper::autoBackup(self::BACKUP_DIR, ['backup', 'tmp', 'file']);
|
||||
// Date du dernier backup
|
||||
$this->setData(['core', 'lastBackup', $lastBackup]);
|
||||
// Supprime les backups de plus de 30 jours
|
||||
$iterator = new DirectoryIterator(common::BACKUP_DIR);
|
||||
$iterator = new DirectoryIterator(self::BACKUP_DIR);
|
||||
foreach ($iterator as $fileInfos) {
|
||||
if (
|
||||
$fileInfos->isFile()
|
||||
@ -58,23 +60,23 @@ class core extends common
|
||||
}
|
||||
|
||||
// Crée le fichier de personnalisation avancée
|
||||
if (file_exists(common::DATA_DIR . 'custom.css') === false) {
|
||||
$this->secure_file_put_contents(common::DATA_DIR . 'custom.css', file_get_contents('core/module/theme/resource/custom.css'));
|
||||
chmod(common::DATA_DIR . 'custom.css', 0755);
|
||||
if (file_exists(self::DATA_DIR . 'custom.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'custom.css', file_get_contents('core/module/theme/resource/custom.css'));
|
||||
chmod(self::DATA_DIR . 'custom.css', 0755);
|
||||
}
|
||||
// Crée le fichier de personnalisation
|
||||
if (file_exists(common::DATA_DIR . 'theme.css') === false) {
|
||||
$this->secure_file_put_contents(common::DATA_DIR . 'theme.css', '');
|
||||
chmod(common::DATA_DIR . 'theme.css', 0755);
|
||||
if (file_exists(self::DATA_DIR . 'theme.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'theme.css', '');
|
||||
chmod(self::DATA_DIR . 'theme.css', 0755);
|
||||
}
|
||||
// Crée le fichier de personnalisation de l'administration
|
||||
if (file_exists(common::DATA_DIR . 'admin.css') === false) {
|
||||
$this->secure_file_put_contents(common::DATA_DIR . 'admin.css', '');
|
||||
chmod(common::DATA_DIR . 'admin.css', 0755);
|
||||
if (file_exists(self::DATA_DIR . 'admin.css') === false) {
|
||||
file_put_contents(self::DATA_DIR . 'admin.css', '');
|
||||
chmod(self::DATA_DIR . 'admin.css', 0755);
|
||||
}
|
||||
|
||||
// Check la version rafraichissement du theme
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . 'theme.css'));
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'theme.css'));
|
||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['theme'])))) {
|
||||
// Version
|
||||
$css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/';
|
||||
@ -90,7 +92,7 @@ class core extends common
|
||||
// Fonts disponibles
|
||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||
|
||||
// Fontes installées
|
||||
$fonts = [
|
||||
@ -271,7 +273,7 @@ class core extends common
|
||||
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
|
||||
|
||||
// Enregistre la personnalisation
|
||||
$this->secure_file_put_contents(common::DATA_DIR . 'theme.css', $css);
|
||||
file_put_contents(self::DATA_DIR . 'theme.css', $css);
|
||||
|
||||
// Effacer le cache pour tenir compte de la couleur de fond TinyMCE
|
||||
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
|
||||
@ -282,7 +284,7 @@ class core extends common
|
||||
}
|
||||
|
||||
// Check la version rafraichissement du theme admin
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(common::DATA_DIR . 'admin.css'));
|
||||
$cssVersion = preg_split('/\*+/', file_get_contents(self::DATA_DIR . 'admin.css'));
|
||||
if (empty($cssVersion[1]) or $cssVersion[1] !== md5(json_encode($this->getData(['admin'])))) {
|
||||
|
||||
// Version
|
||||
@ -291,7 +293,7 @@ class core extends common
|
||||
// Fonts disponibles
|
||||
$fontsAvailable['files'] = $this->getData(['font', 'files']);
|
||||
$fontsAvailable['imported'] = $this->getData(['font', 'imported']);
|
||||
$fontsAvailable['websafe'] = common::$fontsWebSafe;
|
||||
$fontsAvailable['websafe'] = self::$fontsWebSafe;
|
||||
|
||||
/**
|
||||
* Import des polices de caractères
|
||||
@ -365,7 +367,7 @@ class core extends common
|
||||
// Bordure du contour TinyMCE
|
||||
$css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}';
|
||||
// Enregistre la personnalisation
|
||||
$this->secure_file_put_contents(common::DATA_DIR . 'admin.css', $css);
|
||||
file_put_contents(self::DATA_DIR . 'admin.css', $css);
|
||||
}
|
||||
}
|
||||
/**
|
||||
@ -381,8 +383,8 @@ class core extends common
|
||||
require 'core/module/' . $classPath;
|
||||
}
|
||||
// Module
|
||||
elseif (is_readable(common::MODULE_DIR . $classPath)) {
|
||||
require common::MODULE_DIR . $classPath;
|
||||
elseif (is_readable(self::MODULE_DIR . $classPath)) {
|
||||
require self::MODULE_DIR . $classPath;
|
||||
}
|
||||
// Librairie
|
||||
elseif (is_readable('core/vendor/' . $classPath)) {
|
||||
@ -413,8 +415,8 @@ class core extends common
|
||||
|
||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
and ($this->getUser('group') === common::GROUP_BANNED
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and ($this->getUser('group') === self::GROUP_BANNED
|
||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
)
|
||||
@ -427,9 +429,9 @@ class core extends common
|
||||
$this->getData(['config', 'maintenance'])
|
||||
and in_array($this->getUrl(0), ['maintenance', 'user']) === false
|
||||
and $this->getUrl(1) !== 'login'
|
||||
and ($this->isConnected() === false
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('group') < common::GROUP_ADMIN
|
||||
and ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::GROUP_ADMIN
|
||||
)
|
||||
)
|
||||
) {
|
||||
@ -442,12 +444,32 @@ class core extends common
|
||||
exit();
|
||||
}
|
||||
|
||||
// Pour éviter une 404 sur une langue étrangère, bascule dans la langue correcte.
|
||||
if (is_null($this->getData(['page', $this->getUrl(0)]))) {
|
||||
foreach (self::$languages as $key => $value) {
|
||||
if (
|
||||
is_dir(self::DATA_DIR . $key) &&
|
||||
file_exists(self::DATA_DIR . $key . '/page.json')
|
||||
) {
|
||||
$pagesId = json_decode(file_get_contents(self::DATA_DIR . $key . '/page.json'), true);
|
||||
if (
|
||||
is_array($pagesId['page']) &&
|
||||
array_key_exists($this->getUrl(0), $pagesId['page'])
|
||||
) {
|
||||
$_SESSION['ZWII_CONTENT'] = $key;
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl(0));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check l'accès à la page
|
||||
$access = null;
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
if (
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||
@ -464,22 +486,14 @@ 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->isConnected() === false
|
||||
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') < self::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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -501,9 +515,9 @@ class core extends common
|
||||
$this->getUser('id') &&
|
||||
$userId !== $this->getUser('id') &&
|
||||
$this->getData(['user', $userId, 'accessUrl']) === $this->getUrl() &&
|
||||
array_intersect($t, common::$concurrentAccess) &&
|
||||
//array_intersect($t, common::$accessExclude) !== false &&
|
||||
time() < $this->getData(['user', $userId, 'accessTimer']) + common::ACCESS_TIMER
|
||||
array_intersect($t, self::$concurrentAccess) &&
|
||||
//array_intersect($t, self::$accessExclude) !== false &&
|
||||
time() < $this->getData(['user', $userId, 'accessTimer']) + self::ACCESS_TIMER
|
||||
) {
|
||||
$access = false;
|
||||
$accessInfo['userName'] = $this->getData(['user', $userId, 'lastname']) . ' ' . $this->getData(['user', $userId, 'firstname']);
|
||||
@ -513,11 +527,10 @@ class core extends common
|
||||
}
|
||||
// Accès concurrent stocke la page visitée
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
&& $this->getUser('id')
|
||||
&& !$this->isPost()
|
||||
) {
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()], false);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessUrl', $this->getUrl()]);
|
||||
$this->setData(['user', $this->getUser('id'), 'accessTimer', time()]);
|
||||
}
|
||||
// Breadcrumb
|
||||
@ -541,10 +554,10 @@ class core extends common
|
||||
$inlineScript[] = $this->getData(['page', $this->getUrl(0), 'js']) === null ? '' : $this->getData(['page', $this->getUrl(0), 'js']);
|
||||
|
||||
// Importe le contenu, le CSS et le script des barres
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), common::$siteContent) : '';
|
||||
$contentRight = $this->getData(['page', $this->getUrl(0), 'barRight']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barRight']), self::$siteContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barRight']), 'js']);
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), common::$siteContent) : '';
|
||||
$contentLeft = $this->getData(['page', $this->getUrl(0), 'barLeft']) ? $this->getPage($this->getData(['page', $this->getUrl(0), 'barLeft']), self::$siteContent) : '';
|
||||
$inlineStyle[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'css']);
|
||||
$inlineScript[] = $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']) === null ? '' : $this->getData(['page', $this->getData(['page', $this->getUrl(0), 'barLeft']), 'js']);
|
||||
|
||||
@ -562,7 +575,7 @@ class core extends common
|
||||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
'content' => $this->getPage($this->getUrl(0), common::$siteContent),
|
||||
'content' => $this->getPage($this->getUrl(0), self::$siteContent),
|
||||
'metaDescription' => $this->getData(['page', $this->getUrl(0), 'metaDescription']),
|
||||
'metaTitle' => $this->getData(['page', $this->getUrl(0), 'metaTitle']),
|
||||
'typeMenu' => $this->getData(['page', $this->getUrl(0), 'typeMenu']),
|
||||
@ -588,7 +601,7 @@ class core extends common
|
||||
: $this->getData(['page', $this->getUrl(0), 'metaDescription']);
|
||||
|
||||
// Importe le CSS de la page principale
|
||||
$pageContent = $this->getPage($this->getUrl(0), common::$siteContent);
|
||||
$pageContent = $this->getPage($this->getUrl(0), self::$siteContent);
|
||||
|
||||
$this->addOutput([
|
||||
'title' => $title,
|
||||
@ -633,8 +646,8 @@ class core extends common
|
||||
$output = $module->output;
|
||||
// Check le groupe de l'utilisateur
|
||||
if (
|
||||
($module::$actions[$action] === common::GROUP_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
($module::$actions[$action] === self::GROUP_VISITOR
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and $this->getUser('group') >= $module::$actions[$action]
|
||||
and $this->getUser('permission', $moduleId, $action)
|
||||
)
|
||||
@ -646,10 +659,10 @@ class core extends common
|
||||
foreach ($_POST as $postId => $postValue) {
|
||||
if (is_array($postValue)) {
|
||||
foreach ($postValue as $subPostId => $subPostValue) {
|
||||
common::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
||||
self::$inputBefore[$postId . '_' . $subPostId] = $subPostValue;
|
||||
}
|
||||
} else {
|
||||
common::$inputBefore[$postId] = $postValue;
|
||||
self::$inputBefore[$postId] = $postValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -689,9 +702,9 @@ class core extends common
|
||||
// Contenu par vue
|
||||
elseif ($output['view']) {
|
||||
// Chemin en fonction d'un module du coeur ou d'un module
|
||||
$modulePath = in_array($moduleId, common::$coreModuleIds) ? 'core/' : '';
|
||||
$modulePath = in_array($moduleId, self::$coreModuleIds) ? 'core/' : '';
|
||||
// CSS
|
||||
$stylePath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
||||
$stylePath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.css';
|
||||
if (file_exists($stylePath)) {
|
||||
$this->addOutput([
|
||||
'style' => file_get_contents($stylePath)
|
||||
@ -704,7 +717,7 @@ class core extends common
|
||||
}
|
||||
|
||||
// JS
|
||||
$scriptPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
||||
$scriptPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.js.php';
|
||||
if (file_exists($scriptPath)) {
|
||||
ob_start();
|
||||
include $scriptPath;
|
||||
@ -713,7 +726,7 @@ class core extends common
|
||||
]);
|
||||
}
|
||||
// Vue
|
||||
$viewPath = $modulePath . common::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
||||
$viewPath = $modulePath . self::MODULE_DIR . $moduleId . '/view/' . $output['view'] . '/' . $output['view'] . '.php';
|
||||
if (file_exists($viewPath)) {
|
||||
ob_start();
|
||||
include $viewPath;
|
||||
@ -722,7 +735,7 @@ class core extends common
|
||||
$this->addOutput([
|
||||
'content' => ob_get_clean() . ($output['showPageContent'] ? $pageContent : '')
|
||||
]);
|
||||
} elseif ($modpos === 'free' && strstr($pageContent, '[MODULE]')) {
|
||||
} else if ($modpos === 'free') {
|
||||
if (strstr($pageContent, '[MODULE]', true) === false) {
|
||||
$begin = strstr($pageContent, '[]', true);
|
||||
} else {
|
||||
@ -800,29 +813,6 @@ class core extends common
|
||||
}
|
||||
} elseif ($this->output['content'] === '') {
|
||||
http_response_code(404);
|
||||
// Pour éviter une 404, bascule dans l'espace correct si la page existe dans cette langue.
|
||||
// Parcourir les espaces
|
||||
foreach (common::$languages as $langId => $value) {
|
||||
;
|
||||
if (
|
||||
// l'espace existe
|
||||
is_dir(common::DATA_DIR . $langId) &&
|
||||
file_exists(common::DATA_DIR . $langId . '/page.json')
|
||||
) {
|
||||
// Lire les données des pages
|
||||
$pagesId = json_decode(file_get_contents(common::DATA_DIR . $langId . '/page.json'), true);
|
||||
if (
|
||||
// La page existe
|
||||
is_array($pagesId['page']) &&
|
||||
array_key_exists($this->getUrl(0), $pagesId['page'])
|
||||
) {
|
||||
// Basculer
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $langId;
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (
|
||||
$this->getData(['locale', 'page404']) !== 'none'
|
||||
and $this->getData(['page', $this->getData(['locale', 'page404'])])
|
||||
@ -854,25 +844,25 @@ class core extends common
|
||||
}
|
||||
switch ($this->output['display']) {
|
||||
// Layout brut
|
||||
case common::DISPLAY_RAW:
|
||||
case self::DISPLAY_RAW:
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout vide
|
||||
case common::DISPLAY_LAYOUT_BLANK:
|
||||
case self::DISPLAY_LAYOUT_BLANK:
|
||||
require 'core/layout/blank.php';
|
||||
break;
|
||||
// Affichage en JSON
|
||||
case common::DISPLAY_JSON:
|
||||
case self::DISPLAY_JSON:
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($this->output['content']);
|
||||
break;
|
||||
// RSS feed
|
||||
case common::DISPLAY_RSS:
|
||||
case self::DISPLAY_RSS:
|
||||
header('Content-type: application/rss+xml; charset=UTF-8');
|
||||
echo $this->output['content'];
|
||||
break;
|
||||
// Layout allégé
|
||||
case common::DISPLAY_LAYOUT_LIGHT:
|
||||
case self::DISPLAY_LAYOUT_LIGHT:
|
||||
ob_start();
|
||||
require 'core/layout/light.php';
|
||||
$content = ob_get_clean();
|
||||
@ -883,7 +873,7 @@ class core extends common
|
||||
echo $content;
|
||||
break;
|
||||
// Layout principal
|
||||
case common::DISPLAY_LAYOUT_MAIN:
|
||||
case self::DISPLAY_LAYOUT_MAIN:
|
||||
ob_start();
|
||||
require 'core/layout/main.php';
|
||||
$content = ob_get_clean();
|
||||
|
@ -128,17 +128,7 @@ 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
|
||||
|
@ -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 seule ; time heure seule ; datetime-local (jour et heure)
|
||||
* @param string type date time datetime-local month week
|
||||
* @return string
|
||||
*/
|
||||
public static function date($nameId, array $attributes = [])
|
||||
@ -244,32 +244,17 @@ 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'], $filter) : '');
|
||||
$attributes['value'] = ($attributes['value'] ? helper::filter($attributes['value'], helper::FILTER_TIMESTAMP) : '');
|
||||
}
|
||||
// Début du wrapper
|
||||
$html = '<div id="' . $attributes['id'] . 'Wrapper" class="inputWrapper ' . $attributes['classWrapper'] . '">';
|
||||
@ -325,7 +310,6 @@ class template
|
||||
'name' => $nameId,
|
||||
'type' => 2,
|
||||
'value' => '',
|
||||
'folder' => '',
|
||||
'language' => 'fr_FR'
|
||||
], $attributes);
|
||||
// Traduction de l'aide et de l'étiquette
|
||||
@ -368,8 +352,6 @@ class template
|
||||
'&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"
|
||||
@ -512,8 +494,8 @@ class template
|
||||
$lang = $langId;
|
||||
break;
|
||||
case 'selected':
|
||||
if (isset($_SESSION['ZWII_SITE_CONTENT'])) {
|
||||
$lang = $_SESSION['ZWII_SITE_CONTENT'];
|
||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
||||
$lang = $_SESSION['ZWII_CONTENT'];
|
||||
} else {
|
||||
$lang = 'fr_FR';
|
||||
}
|
||||
@ -923,7 +905,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,14 +216,12 @@ 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=lax; " + domain + path + expires;
|
||||
document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + expires;
|
||||
});
|
||||
|
||||
|
||||
@ -464,7 +462,7 @@ $(document).ready(function () {
|
||||
/**
|
||||
* Chargement paresseux des images et des iframes
|
||||
*/
|
||||
$("img").attr("loading", "lazy");
|
||||
$("img,picture,iframe").attr("loading", "lazy");
|
||||
|
||||
/**
|
||||
* Effet accordéon
|
||||
@ -534,7 +532,7 @@ $(document).ready(function () {
|
||||
var langSelected = $(this).val();
|
||||
var langSelected = langSelected.split("/");
|
||||
// Lit le cookie de langue
|
||||
var langSession = "<?php echo isset($_SESSION['ZWII_SITE_CONTENT']) ? $_SESSION['ZWII_SITE_CONTENT'] : '';?>";
|
||||
var langSession = "<?php echo isset($_SESSION['ZWII_CONTENT']) ? $_SESSION['ZWII_CONTENT'] : '';?>";
|
||||
// Découpe l'URL pour exclure le changement de page avec le thème
|
||||
var url = window.location;
|
||||
var currentUrl = url.href.split("/");
|
||||
|
172
core/core.php
172
core/core.php
@ -51,34 +51,15 @@ class common
|
||||
const ACCESS_TIMER = 1800;
|
||||
|
||||
// Numéro de version
|
||||
const ZWII_VERSION = '13.5.00';
|
||||
const ZWII_VERSION = '13.1.04';
|
||||
|
||||
// URL autoupdate
|
||||
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/cms-update/raw/branch/master/';
|
||||
|
||||
/**
|
||||
* 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';
|
||||
const ZWII_UPDATE_CHANNEL = 'test';
|
||||
|
||||
// Valeurs possibles multiple de 10, 10 autorise 9 profils, 100 autorise 99 profils
|
||||
const MAX_PROFILS = 10;
|
||||
|
||||
const MAX_FILE_WRITE_ATTEMPTS = 5;
|
||||
|
||||
/**
|
||||
* Nombre maximal de tentatives d'encodage JSON
|
||||
*/
|
||||
const MAX_JSON_ENCODE_ATTEMPTS = 3;
|
||||
|
||||
/**
|
||||
* Temps d'attente entre les tentatives en secondes
|
||||
*/
|
||||
const RETRY_DELAY_SECONDS = 1;
|
||||
|
||||
|
||||
public static $actions = [];
|
||||
public static $coreModuleIds = [
|
||||
@ -338,19 +319,6 @@ 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)) {
|
||||
@ -361,21 +329,19 @@ class common
|
||||
}
|
||||
|
||||
// Déterminer la langue du contenu du site
|
||||
if (isset($_SESSION['ZWII_SITE_CONTENT'])) {
|
||||
if (isset($_SESSION['ZWII_CONTENT'])) {
|
||||
// Déterminé par la session présente
|
||||
self::$siteContent = $_SESSION['ZWII_SITE_CONTENT'];
|
||||
self::$siteContent = $_SESSION['ZWII_CONTENT'];
|
||||
} else {
|
||||
// Détermine la langue par défaut
|
||||
foreach (self::$languages as $key => $value) {
|
||||
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
||||
self::$siteContent = $key;
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $key;
|
||||
$_SESSION['ZWII_CONTENT'] = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Localisation
|
||||
\setlocale(LC_ALL, self::$siteContent . '.UTF8');
|
||||
|
||||
// Instanciation de la classe des entrées / sorties
|
||||
@ -453,9 +419,6 @@ 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 (
|
||||
@ -477,21 +440,6 @@ 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');
|
||||
|
||||
@ -559,7 +507,7 @@ class common
|
||||
* Sauvegarde des données
|
||||
* @param array $keys Clé(s) des données
|
||||
*/
|
||||
public function setData($keys = [], $save = true)
|
||||
public function setData($keys = [])
|
||||
{
|
||||
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
|
||||
if (
|
||||
@ -587,7 +535,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], $save));
|
||||
$success = is_object($db->set($query, $keys[count($keys) - 1], true));
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
@ -641,48 +589,7 @@ class common
|
||||
public function setPage($page, $value, $lang)
|
||||
{
|
||||
|
||||
return $this->secure_file_put_contents(self::DATA_DIR . $lang . '/content/' . $page . '.html', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Écrit les données dans un fichier avec plusieurs tentatives d'écriture et verrouillage
|
||||
*
|
||||
* @param string $filename Le nom du fichier
|
||||
* @param string $data Les données à écrire dans le fichier
|
||||
* @param int $flags Les drapeaux optionnels à passer à la fonction $this->secure_file_put_contents
|
||||
* @return bool True si l'écriture a réussi, sinon false
|
||||
*/
|
||||
function secure_file_put_contents($filename, $data, $flags = 0)
|
||||
{
|
||||
|
||||
// Initialise le compteur de tentatives
|
||||
$attempts = 0;
|
||||
|
||||
// Vérifie la longueur des données
|
||||
$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
|
||||
break;
|
||||
}
|
||||
|
||||
// Incrémente le compteur de tentatives
|
||||
$attempts++;
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
// Échec de l'écriture après plusieurs tentatives
|
||||
// Etat de l'écriture
|
||||
return ($attempts < 5);
|
||||
return file_put_contents(self::DATA_DIR . $lang . '/content/' . $page . '.html', $value);
|
||||
}
|
||||
|
||||
|
||||
@ -743,11 +650,11 @@ class common
|
||||
mkdir(self::DATA_DIR . $lang . '/content', 0755);
|
||||
}
|
||||
// Site en français avec site exemple
|
||||
if ($lang == 'fr_FR' && $sampleSite === true && $module === 'page') {
|
||||
if ($lang == 'fr_FR' && $sampleSite === true) {
|
||||
$this->setData([$module, init::$siteTemplate[$module]]);
|
||||
// Création des pages
|
||||
foreach (init::$siteContent as $key => $value) {
|
||||
$this->setPage($key, $value['content'], 'fr_FR');
|
||||
$this->setPage($key, $value, 'fr_FR');
|
||||
}
|
||||
// Version en langue étrangère ou fr_FR sans site de test
|
||||
} else {
|
||||
@ -768,17 +675,6 @@ 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
|
||||
@ -821,7 +717,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->isConnected() === true
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
@ -840,21 +736,21 @@ class common
|
||||
}
|
||||
// Enfants
|
||||
foreach ($pages as $pageId => $pagePosition) {
|
||||
|
||||
if (
|
||||
// Page parent
|
||||
$parentId = $this->getData(['page', $pageId, 'parentPageId'])
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and (
|
||||
(
|
||||
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
and
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
and $this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
)
|
||||
or (
|
||||
$this->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'])
|
||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
//and $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $this->$parentId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $this->$parentId, 'profil']))
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $this->$pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
|
||||
)
|
||||
)
|
||||
@ -1081,16 +977,6 @@ 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
|
||||
@ -1182,9 +1068,8 @@ class common
|
||||
}
|
||||
// Articles du blog
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog'
|
||||
&& !empty($this->getData(['module', $parentPageId]))
|
||||
&& $this->getData(['module', $parentPageId, 'posts'])
|
||||
$this->getData(['page', $parentPageId, 'moduleId']) === 'blog' &&
|
||||
!empty($this->getData(['module', $parentPageId]))
|
||||
) {
|
||||
foreach ($this->getData(['module', $parentPageId, 'posts']) as $articleId => $article) {
|
||||
if ($this->getData(['module', $parentPageId, 'posts', $articleId, 'state']) === true) {
|
||||
@ -1236,7 +1121,7 @@ class common
|
||||
}
|
||||
$sitemap->updateRobots();
|
||||
} else {
|
||||
$this->secure_file_put_contents('robots.txt', 'User-agent: *' . PHP_EOL . 'Disallow: /');
|
||||
file_put_contents('robots.txt', 'User-agent: *' . PHP_EOL . 'Disallow: /');
|
||||
}
|
||||
|
||||
// Submit your sitemaps to Google, Yahoo, Bing and Ask.com
|
||||
@ -1280,10 +1165,11 @@ class common
|
||||
$source_image = imagecreatefromwebp($src);
|
||||
break;
|
||||
case 'avif':
|
||||
$source_image = imagecreatefromavif($src);
|
||||
$source_image = function_exists('imagecreatefromavif') ? imagecreatefromavif($src) : null;
|
||||
break;
|
||||
}
|
||||
// Image valide
|
||||
if (is_object($source_image)) {
|
||||
if ($source_image) {
|
||||
$width = imagesx($source_image);
|
||||
$height = imagesy($source_image);
|
||||
/* find the "desired height" of this thumbnail, relative to the desired width */
|
||||
@ -1300,9 +1186,9 @@ class common
|
||||
return (imagepng($virtual_image, $dest));
|
||||
case 'image/gif':
|
||||
return (imagegif($virtual_image, $dest));
|
||||
case 'image/webp':
|
||||
case 'webp':
|
||||
return (imagewebp($virtual_image, $dest));
|
||||
case 'image/avif':
|
||||
case 'avif':
|
||||
return (imageavif($virtual_image, $dest));
|
||||
}
|
||||
} else {
|
||||
@ -1512,7 +1398,7 @@ class common
|
||||
$dataLog .= $message ? $this->getUrl() . ';' . $message : $this->getUrl();
|
||||
$dataLog .= PHP_EOL;
|
||||
if ($this->getData(['config', 'connect', 'log'])) {
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $dataLog, FILE_APPEND);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ if ($this->getData(['core', 'dataVersion']) < 10200) {
|
||||
}
|
||||
// Créer les en-têtes du journal
|
||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
// Init préservation htaccess
|
||||
$this->setData(['config', 'autoUpdateHtaccess', false]);
|
||||
// Options de barre de membre simple
|
||||
@ -459,7 +459,7 @@ if ($this->getData(['core', 'dataVersion']) < 11000) {
|
||||
}
|
||||
foreach ($hierarchy as $parentKey => $parent) {
|
||||
$content = $this->getData(['page', $parent, 'content']);
|
||||
//$this->secure_file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $parent . '.html', $content);
|
||||
//file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $parent . '.html', $content);
|
||||
$this->setPage($parent, $content, 'fr');
|
||||
$this->setData(['page', $parent, 'content', $parent . '.html']);
|
||||
}
|
||||
@ -982,7 +982,7 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
|
||||
$d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
|
||||
$d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
|
||||
$t['locale'] = $d;
|
||||
$this->secure_file_put_contents(self::DATA_DIR . $key . '/locale.json', $t);
|
||||
file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1068,7 +1068,7 @@ if ($this->getData(['core', 'dataVersion']) < 13000) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $currentlanguage;
|
||||
$_SESSION['ZWII_CONTENT'] = $currentlanguage;
|
||||
|
||||
// Supprime la clé OpenOgraph
|
||||
$this->deleteData(['config', 'seo', 'keyApi']);
|
||||
|
@ -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;">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<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;">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<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;">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<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;">
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<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->isConnected() === true
|
||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
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,8 +30,7 @@ class config extends common
|
||||
'logReset' => self::GROUP_ADMIN,
|
||||
'logDownload' => self::GROUP_ADMIN,
|
||||
'blacklistReset' => self::GROUP_ADMIN,
|
||||
'blacklistDownload' => self::GROUP_ADMIN,
|
||||
'register' => self::GROUP_ADMIN,
|
||||
'blacklistDownload' => self::GROUP_ADMIN
|
||||
];
|
||||
|
||||
public static $timezones = [
|
||||
@ -212,7 +211,7 @@ class config extends common
|
||||
* Sitemap compressé et non compressé
|
||||
* Robots.txt
|
||||
*/
|
||||
public function sitemap()
|
||||
public function siteMap()
|
||||
{
|
||||
// La page n'existe pas
|
||||
if (
|
||||
@ -524,7 +523,7 @@ class config extends common
|
||||
) {
|
||||
// Ajout des lignes dans le .htaccess
|
||||
$fileContent = file_get_contents('.htaccess');
|
||||
$rewriteData =
|
||||
$rewriteData = PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL .
|
||||
'<IfModule mod_rewrite.c>' . PHP_EOL .
|
||||
"\tRewriteEngine on" . PHP_EOL .
|
||||
@ -533,9 +532,9 @@ class config extends common
|
||||
"\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL .
|
||||
"\tRewriteRule ^(.*)$ index.php?$1 [L]" . PHP_EOL .
|
||||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting';
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
$this->secure_file_put_contents(
|
||||
file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
@ -551,7 +550,7 @@ class config extends common
|
||||
$fileContent = file_get_contents('.htaccess');
|
||||
$fileContent = explode('# URL rewriting', $fileContent);
|
||||
$fileContent = $fileContent[0] . '# URL rewriting' . $fileContent[2];
|
||||
$this->secure_file_put_contents(
|
||||
file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
@ -655,10 +654,10 @@ class config extends common
|
||||
) {
|
||||
// Ecrire les fichiers de script
|
||||
if ($this->geturl(2) === 'head') {
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'head.inc.html', $this->getInput('configScriptHead', null));
|
||||
file_put_contents(self::DATA_DIR . 'head.inc.html', $this->getInput('configScriptHead', null));
|
||||
}
|
||||
if ($this->geturl(2) === 'body') {
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'body.inc.html', $this->getInput('configScriptBody', null));
|
||||
file_put_contents(self::DATA_DIR . 'body.inc.html', $this->getInput('configScriptBody', null));
|
||||
}
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -700,7 +699,7 @@ class config extends common
|
||||
unlink(self::DATA_DIR . 'journal.log');
|
||||
// Créer les en-têtes des journaux
|
||||
$d = 'Date;Heure;IP;Id;Action' . PHP_EOL;
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
file_put_contents(self::DATA_DIR . 'journal.log', $d);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Configuration'),
|
||||
@ -776,7 +775,7 @@ class config extends common
|
||||
ob_start();
|
||||
$fileName = self::TEMP_DIR . 'blacklist.log';
|
||||
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
|
||||
$this->secure_file_put_contents($fileName, $d);
|
||||
file_put_contents($fileName, $d);
|
||||
if (file_exists($fileName)) {
|
||||
$d = $this->getData(['blacklist']);
|
||||
$data = '';
|
||||
@ -784,7 +783,7 @@ class config extends common
|
||||
$data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$i18nUI) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nUI);
|
||||
$data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL;
|
||||
}
|
||||
$this->secure_file_put_contents($fileName, $data, FILE_APPEND);
|
||||
file_put_contents($fileName, $data, FILE_APPEND);
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Transfer-Encoding: binary');
|
||||
@ -903,41 +902,4 @@ 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),
|
||||
]);
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
<Files "data.key">
|
||||
Order Allow,Deny
|
||||
Deny from all
|
||||
</Files>
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Ce script PHP est conçu pour être appelé via une requête HTTP GET avec une clé spécifique pour déclencher la création d'une archive ZIP de sauvegarde.
|
||||
|
||||
Exemple d'appel dans une URL :
|
||||
http://example.com/chemin/vers/autobackup.php?key=your_secret_key
|
||||
|
||||
La clé doit être fournie en tant que paramètre "key" dans l'URL et correspondre à celle stockée dans le fichier "data.key" pour que la création de l'archive soit autorisée. Si la clé est valide, le script parcourt le répertoire spécifié et ajoute les fichiers à l'archive ZIP. Si la clé est invalide ou absente, le script affiche un message d'erreur et termine son exécution.
|
||||
|
||||
*/
|
||||
|
||||
// Vérification de la clé
|
||||
if (isset ($_GET['key'])) {
|
||||
$key = $_GET['key'];
|
||||
$storedKey = file_get_contents('data.key');
|
||||
if ($key !== $storedKey) {
|
||||
http_response_code(401);
|
||||
exit();
|
||||
}
|
||||
// Création du ZIP
|
||||
$filter = ['backup', 'tmp'];
|
||||
$fileName = date('Y-m-d-H-i-s', time()) . '-rolling-backup.zip';
|
||||
$zip = new ZipArchive();
|
||||
$zip->open('../../../../site/backup/' . $fileName, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
||||
$directory = '../../../../site';
|
||||
$files = new RecursiveIteratorIterator(
|
||||
new RecursiveCallbackFilterIterator(
|
||||
new RecursiveDirectoryIterator(
|
||||
$directory,
|
||||
RecursiveDirectoryIterator::SKIP_DOTS
|
||||
),
|
||||
function ($fileInfo, $key, $iterator) use ($filter) {
|
||||
return $fileInfo->isFile() || !in_array($fileInfo->getBaseName(), $filter);
|
||||
}
|
||||
)
|
||||
);
|
||||
foreach ($files as $name => $file) {
|
||||
if (!$file->isDir()) {
|
||||
$filePath = $file->getRealPath();
|
||||
$relativePath = substr($filePath, strlen(realpath($directory)) + 1);
|
||||
$zip->addFile($filePath, $relativePath);
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
http_response_code(201);
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Ce script PHP est conçu pour supprimer les fichiers ayant l'extension 'tar.gz' dans un répertoire de sauvegarde si leur dernière modification remonte à un certain nombre de jours spécifié via une requête HTTP GET.
|
||||
|
||||
Exemple d'appel dans une URL avec le nombre de jours spécifié :
|
||||
http://example.com/chemin/vers/script.php?days=7&key=your_secret_key
|
||||
|
||||
Le script vérifie également la présence et la validité d'une clé spécifique pour déclencher son exécution. La clé doit être fournie en tant que paramètre "key" dans l'URL et correspondre à celle stockée dans le fichier "data.key" pour que la suppression des fichiers soit autorisée. Si la clé est invalide ou absente, le script affiche un message d'erreur et termine son exécution.
|
||||
|
||||
*/
|
||||
|
||||
// Vérification de la clé
|
||||
if (isset ($_GET['key'])) {
|
||||
// Récupération de la clé fournie en GET
|
||||
$key = $_GET['key'];
|
||||
|
||||
// Récupération de la clé stockée dans le fichier data.key
|
||||
$storedKey = file_get_contents('data.key');
|
||||
|
||||
// Vérification de correspondance entre les clés
|
||||
if ($key !== $storedKey) {
|
||||
http_response_code(401);
|
||||
exit();
|
||||
}
|
||||
|
||||
// Récupère le nombre de jours à partir de la variable GET 'days'
|
||||
$days = isset ($_GET['days']) ? (int) $_GET['days'] : 1; // Par défaut à 1 si non spécifié
|
||||
|
||||
// Chemin vers le répertoire contenant les fichiers
|
||||
$directory = '../../../../site/backup/'; // Remplacez par le chemin réel
|
||||
|
||||
// Convertit le nombre de jours en secondes
|
||||
$timeLimit = strtotime("-$days days");
|
||||
|
||||
// Crée un nouvel objet DirectoryIterator
|
||||
foreach (new DirectoryIterator($directory) as $file) {
|
||||
// Vérifie si l'élément courant est un fichier et a l'extension 'tar.gz'
|
||||
if ($file->isFile() && $file->getExtension() === 'tar.gz') {
|
||||
// Vérifie si le fichier a été modifié avant la limite de temps
|
||||
if ($file->getMTime() < $timeLimit) {
|
||||
// Supprime le fichier
|
||||
unlink($file->getRealPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Si la clé est manquante, affiche un message d'erreur et arrête l'exécution du script
|
||||
http_response_code(201);
|
||||
}
|
@ -66,10 +66,10 @@ $(document).ready(function () {
|
||||
$("#connectCaptchaStrong").prop("checked", false);
|
||||
}
|
||||
|
||||
var configLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'config']);?>";
|
||||
// Non défini, valeur par défaut
|
||||
if (configLayout == "") {
|
||||
var configLayout = getCookie("configLayout");
|
||||
if (configLayout == null) {
|
||||
configLayout = "setup";
|
||||
setCookie("configLayout", "setup");
|
||||
}
|
||||
|
||||
$("#socialContainer").hide();
|
||||
@ -166,6 +166,7 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "setup");
|
||||
});
|
||||
$("#configSocialButton").on("click", function () {
|
||||
$("#connectContainer").hide();
|
||||
@ -176,6 +177,7 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").addClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "social");
|
||||
});
|
||||
$("#configConnectButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -186,6 +188,7 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").addClass("activeButton");
|
||||
$("#configNetworkButton").removeClass("activeButton");
|
||||
setCookie("configLayout", "connect");
|
||||
});
|
||||
$("#configNetworkButton").on("click", function () {
|
||||
$("#setupContainer").hide();
|
||||
@ -196,6 +199,7 @@ $(document).ready(function () {
|
||||
$("#configSocialButton").removeClass("activeButton");
|
||||
$("#configConnectButton").removeClass("activeButton");
|
||||
$("#configNetworkButton").addClass("activeButton");
|
||||
setCookie("configLayout", "network");
|
||||
});
|
||||
|
||||
|
||||
@ -261,6 +265,7 @@ $(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 {
|
||||
@ -281,6 +286,28 @@ $(document).ready(function () {
|
||||
|
||||
});
|
||||
|
||||
|
||||
function setCookie(name, value, days) {
|
||||
var expires = "";
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
expires = "; expires=" + date.toUTCString();
|
||||
}
|
||||
document.cookie = name + "=" + (value || "") + expires + "; path=/; samesite=lax";
|
||||
}
|
||||
|
||||
function getCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
|
||||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Define function to capitalize the first letter of a string
|
||||
function capitalizeFirstLetter(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
|
@ -7,7 +7,16 @@
|
||||
'value' => template::ico('home')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset7">
|
||||
<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">
|
||||
<?php echo template::button('configLocaleButton', [
|
||||
'value' => 'Identité',
|
||||
'href' => helper::baseUrl() . 'language/site'
|
||||
@ -21,24 +30,20 @@
|
||||
<div class="tab">
|
||||
<?php echo template::button('configSetupButton', [
|
||||
'value' => 'Configuration',
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/setup'
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('configSocialButton', [
|
||||
'value' => 'Référencement',
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/social'
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
|
||||
<?php echo template::button('configConnectButton', [
|
||||
'value' => 'Connexion',
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/connect'
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('configNetworkButton', [
|
||||
'value' => 'Réseau',
|
||||
'class' => 'buttonTab',
|
||||
//'href' => helper::baseUrl() . 'config/register/network'
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<div class="col2 offset8">
|
||||
<?php echo template::submit('configManageSubmit', [
|
||||
'value' => 'Valider',
|
||||
'ico' => 'check'
|
||||
|
@ -3,6 +3,12 @@
|
||||
<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">
|
||||
@ -11,8 +17,7 @@
|
||||
'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']),
|
||||
'folder' => $this->getData(['config', 'favicon']) ? dirname($this->getData(['config', 'favicon'])) : ''
|
||||
'value' => $this->getData(['config', 'favicon'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -21,8 +26,7 @@
|
||||
'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']),
|
||||
'folder' => $this->getData(['config', 'faviconDark']) ? dirname($this->getData(['config', 'faviconDark'])) : ''
|
||||
'value' => $this->getData(['config', 'faviconDark'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -44,7 +48,7 @@
|
||||
<?php echo template::checkbox('configRewrite', true, 'Apache URL intelligentes', [
|
||||
'checked' => helper::checkRewrite(),
|
||||
'help' => 'Supprime le point d\'interrogation dans les URL, l\'option est indisponible avec les autres serveurs Web',
|
||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'Apache') === false and $module->isModRewriteEnabled()
|
||||
'disabled' => stripos($_SERVER["SERVER_SOFTWARE"], 'nginx')
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -55,6 +59,12 @@
|
||||
<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">
|
||||
@ -80,8 +90,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', [
|
||||
@ -99,6 +109,12 @@
|
||||
<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">
|
||||
@ -153,6 +169,12 @@
|
||||
<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">
|
||||
@ -176,21 +198,13 @@
|
||||
<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,6 +4,11 @@
|
||||
<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">
|
||||
@ -13,7 +18,6 @@
|
||||
'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')) .
|
||||
@ -80,6 +84,12 @@
|
||||
<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">
|
||||
|
@ -119,24 +119,24 @@ class install extends common
|
||||
self::$i18nUI = $_SESSION['ZWII_UI'];
|
||||
self::$i18nUI = array_key_exists(self::$i18nUI, self::$languages) ? self::$i18nUI : 'fr_FR';
|
||||
// par défaut le contenu est la langue d'installation
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = self::$i18nUI;
|
||||
$_SESSION['ZWII_CONTENT'] = self::$i18nUI;
|
||||
|
||||
// Création du dossier de langue avec le marqueur de langue par défaut
|
||||
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT'])) {
|
||||
mkdir(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT']);
|
||||
touch(self::DATA_DIR . $_SESSION['ZWII_SITE_CONTENT'] . '/.default');
|
||||
if (!is_dir(self::DATA_DIR . $_SESSION['ZWII_CONTENT'])) {
|
||||
mkdir(self::DATA_DIR . $_SESSION['ZWII_CONTENT']);
|
||||
touch(self::DATA_DIR . $_SESSION['ZWII_CONTENT'] . '/.default');
|
||||
}
|
||||
|
||||
// Installation du site de test
|
||||
if (
|
||||
$this->getInput('installDefaultData', helper::FILTER_BOOLEAN) === false
|
||||
&& $_SESSION['ZWII_SITE_CONTENT'] === 'fr_FR'
|
||||
&& $_SESSION['ZWII_CONTENT'] === 'fr_FR'
|
||||
) {
|
||||
$sample = true;
|
||||
}
|
||||
$this->initData('page', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||
$this->initData('module', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||
$this->initData('locale', $_SESSION['ZWII_SITE_CONTENT'], $sample);
|
||||
$this->initData('page', $_SESSION['ZWII_CONTENT'], $sample);
|
||||
$this->initData('module', $_SESSION['ZWII_CONTENT'], $sample);
|
||||
$this->initData('locale', $_SESSION['ZWII_CONTENT'], $sample);
|
||||
|
||||
// Création de l'utilisateur si les données sont complétées.
|
||||
// success retour de l'enregistrement des données
|
||||
@ -153,7 +153,7 @@ class install extends common
|
||||
'signature' => 1,
|
||||
'mail' => $userMail,
|
||||
'password' => $this->getInput('installPassword', helper::FILTER_PASSWORD, true),
|
||||
'language' => $_SESSION['ZWII_SITE_CONTENT']
|
||||
'language' => $_SESSION['ZWII_CONTENT']
|
||||
]
|
||||
]);
|
||||
|
||||
@ -172,16 +172,16 @@ class install extends common
|
||||
|
||||
// Nettoyage fr par défaut
|
||||
if (
|
||||
$_SESSION['ZWII_SITE_CONTENT'] !== 'fr_FR'
|
||||
$_SESSION['ZWII_CONTENT'] !== 'fr_FR'
|
||||
) {
|
||||
if (is_dir(self::DATA_DIR . 'fr_FR'))
|
||||
$this->deleteDir(self::DATA_DIR . 'fr_FR');
|
||||
}
|
||||
|
||||
// Sauvegarder la configuration du Proxy
|
||||
$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);
|
||||
$this->setData(['config', 'proxyType', $this->getInput('installProxyType')]);
|
||||
$this->setData(['config', 'proxyUrl', $this->getInput('installProxyUrl')]);
|
||||
$this->setData(['config', 'proxyPort', $this->getInput('installProxyPort', helper::FILTER_INT)]);
|
||||
|
||||
// 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'])], false);
|
||||
$this->setData(['config', 'smtp', 'from', 'no-reply@' . str_replace('www.', '', $_SERVER['HTTP_HOST'])]);
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -228,8 +228,6 @@ class install extends common
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('config');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -286,7 +284,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $message
|
||||
'data' => $success ? null : json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -294,7 +292,7 @@ class install extends common
|
||||
case 2:
|
||||
$success = true;
|
||||
$message = '';
|
||||
$this->secure_file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
||||
file_put_contents(self::TEMP_DIR . 'update.tar.gz', helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz'));
|
||||
$md5origin = helper::getUrlContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.md5');
|
||||
$md5origin = explode(' ', $md5origin);
|
||||
$md5target = md5_file(self::TEMP_DIR . 'update.tar.gz');
|
||||
@ -319,7 +317,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $message
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -362,7 +360,7 @@ class install extends common
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $message,
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
break;
|
||||
@ -403,7 +401,7 @@ class install extends common
|
||||
'</IfModule>' . PHP_EOL .
|
||||
'# URL rewriting' . PHP_EOL;
|
||||
$fileContent = str_replace('# URL rewriting', $rewriteData, $fileContent);
|
||||
$success = $this->secure_file_put_contents(
|
||||
$success = file_put_contents(
|
||||
'.htaccess',
|
||||
$fileContent
|
||||
);
|
||||
@ -434,13 +432,12 @@ class install extends common
|
||||
if (!empty($message)) {
|
||||
$this->saveLog($message);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'display' => self::DISPLAY_JSON,
|
||||
'content' => [
|
||||
'success' => $success,
|
||||
'data' => $message
|
||||
'data' => json_encode($message, JSON_UNESCAPED_UNICODE)
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
@ -1,12 +1,6 @@
|
||||
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");
|
||||
|
||||
@ -18,7 +12,7 @@ function step(i, data) {
|
||||
data: data
|
||||
},
|
||||
success: function (result) {
|
||||
setTimeout(function () {
|
||||
setTimeout((function () {
|
||||
if (4 === i) {
|
||||
$("#installUpdateSuccess").show();
|
||||
$("body").css("cursor", "default");
|
||||
@ -27,22 +21,16 @@ function step(i, data) {
|
||||
} else {
|
||||
step(i + 1, result.data);
|
||||
}
|
||||
}, 2000);
|
||||
}), 2e3)
|
||||
},
|
||||
error: function (xhr) {
|
||||
// Balance tout dans la console
|
||||
console.log(i);
|
||||
console.log(xhr.responseText);
|
||||
console.log(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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -59,33 +47,23 @@ function showError(step, message, errors) {
|
||||
// Trouver la position du premier "{" pour repérer le début du tableau
|
||||
const startOfArray = message.indexOf('{');
|
||||
|
||||
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);
|
||||
|
||||
try {
|
||||
const jsonData = JSON.parse(jsonString);
|
||||
|
||||
// Afficher les résultats si le parsing JSON est réussi
|
||||
// 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, ""));
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,7 @@ class language extends common
|
||||
is_array($descripteur['language'][$lang])
|
||||
) {
|
||||
if ($this->setData(['language', $lang, $descripteur['language'][$lang]])) {
|
||||
$success = $this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $languageData);
|
||||
$success = file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($languageData, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
|
||||
$success = is_int($success) ? true : false;
|
||||
}
|
||||
}
|
||||
@ -197,7 +197,7 @@ class language extends common
|
||||
) {
|
||||
if (file_exists(self::DATA_DIR . $key . '/.default')) {
|
||||
$messageLocale = helper::translate('Langue par défaut');
|
||||
} elseif (isset($_SESSION['ZWII_SITE_CONTENT']) && $_SESSION['ZWII_SITE_CONTENT'] === $key) {
|
||||
} elseif (isset($_SESSION['ZWII_CONTENT']) && $_SESSION['ZWII_CONTENT'] === $key) {
|
||||
$messageLocale = helper::translate('Langue du site sélectionnée');
|
||||
} else {
|
||||
$messageLocale = '';
|
||||
@ -430,7 +430,7 @@ class language extends common
|
||||
$this->setData(['locale', $data['locale']]);
|
||||
} else {
|
||||
// Sauver sur le disque
|
||||
$this->secure_file_put_contents(self::DATA_DIR . $lang . '/locale.json', $data);
|
||||
file_put_contents(self::DATA_DIR . $lang . '/locale.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -512,7 +512,7 @@ class language extends common
|
||||
$data[$key] = $target;
|
||||
}
|
||||
}
|
||||
$this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $data);
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
|
||||
// Mettre à jour le descripteur
|
||||
$this->setData([
|
||||
@ -546,7 +546,7 @@ class language extends common
|
||||
$data[$key] = '';
|
||||
}
|
||||
}
|
||||
$this->secure_file_put_contents(self::I18N_DIR . $lang . '.json', $data);
|
||||
file_put_contents(self::I18N_DIR . $lang . '.json', json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT), LOCK_EX);
|
||||
|
||||
// Tableau des chaines à traduire dans la langue sélectionnée
|
||||
foreach ($data as $key => $value) {
|
||||
@ -700,7 +700,7 @@ class language extends common
|
||||
) {
|
||||
|
||||
// Stocker la sélection
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $lang;
|
||||
$_SESSION['ZWII_CONTENT'] = $lang;
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
|
@ -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/Étiquettes-des-pages-speciales" target="_blank">
|
||||
<a href="https://doc.zwiicms.fr/etiquettes-des-pages-speciales" target="_blank">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
|
@ -23,8 +23,7 @@ class page extends common
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'duplicate' => self::GROUP_EDITOR,
|
||||
'jsEditor' => self::GROUP_EDITOR,
|
||||
'cssEditor' => self::GROUP_EDITOR,
|
||||
'register' => self::GROUP_EDITOR,
|
||||
'cssEditor' => self::GROUP_EDITOR
|
||||
];
|
||||
public static $pagesNoParentId = [
|
||||
'' => 'Aucune'
|
||||
@ -86,19 +85,8 @@ class page extends common
|
||||
*/
|
||||
public function duplicate()
|
||||
{
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
// Adresse sans le token
|
||||
$page = $this->getUrl(2);
|
||||
|
||||
// La page n'existe pas
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
@ -119,20 +107,18 @@ class page extends common
|
||||
$page
|
||||
]);
|
||||
// Ecriture
|
||||
$this->setData(['page', $pageId, $data], false);
|
||||
$this->setData(['page', $pageId, $data]);
|
||||
$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], false);
|
||||
$this->setData(['module', $pageId, $data]);
|
||||
$notification = helper::translate('Page et module dupliqués');
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('page');
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId . '/' . self::$siteContent,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $pageId,
|
||||
'notification' => $notification,
|
||||
'state' => true
|
||||
]);
|
||||
@ -145,16 +131,6 @@ class page extends common
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -201,11 +177,11 @@ class page extends common
|
||||
if (!is_dir(self::DATA_DIR . self::$siteContent . '/content')) {
|
||||
mkdir(self::DATA_DIR . self::$siteContent . '/content', 0755);
|
||||
}
|
||||
//$this->secure_file_put_contents(self::DATA_DIR . self::$siteContent . '/content/' . $pageId . '.html', '<p>Contenu de votre nouvelle page.</p>');
|
||||
//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);
|
||||
|
||||
// Ne met à jour le sitemap pour éviter un warning, de toute manière la nouvelle page doit être éditée.
|
||||
// $this->updateSitemap();
|
||||
// Met à jour le sitemap
|
||||
$this->updateSitemap();
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -222,16 +198,6 @@ class page extends common
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
// $url prend l'adresse sans le token
|
||||
$page = $this->getUrl(2);
|
||||
// La page n'existe pas
|
||||
@ -296,7 +262,7 @@ class page extends common
|
||||
elseif ($this->getHierarchy($page, null)) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $page . '/' . self::$siteContent,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $page,
|
||||
'notification' => helper::translate('Impossible de supprimer une page contenant des pages enfants')
|
||||
]);
|
||||
}
|
||||
@ -336,17 +302,6 @@ class page extends common
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
|
||||
// La session ne correspond pas au site ouvert dans cet onglet
|
||||
if (
|
||||
// Contrôle la présence de l'id de langue uniquement si l'id est fourni afin de ne pas bloquer les modules non mis à jour
|
||||
$this->getUrl(3) && $this->getUrl(3) != self::$siteContent
|
||||
) {
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $this->getUrl(3);
|
||||
header('Refresh:0; url=' . helper::baseUrl() . $this->getUrl());
|
||||
exit();
|
||||
}
|
||||
|
||||
// La page n'existe pas
|
||||
if (
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
@ -384,13 +339,11 @@ class page extends common
|
||||
$pageId = helper::increment($pageId, self::$moduleIds);
|
||||
// Met à jour les enfants
|
||||
foreach ($this->getHierarchy($this->getUrl(2), null) as $childrenPageId) {
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId], false);
|
||||
$this->setData(['page', $childrenPageId, 'parentPageId', $pageId]);
|
||||
}
|
||||
// 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)])], false);
|
||||
$this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]);
|
||||
$this->deleteData(['module', $this->getUrl(2)]);
|
||||
// Renommer le dossier du module
|
||||
$moduleId = $this->getData(['page', $this->getUrl(2), 'moduleId']);
|
||||
@ -401,10 +354,8 @@ 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], false);
|
||||
$this->setData(['module', $pageId, 'theme', 'style', $modulesData[$moduleId]['dataDirectory'] . $pageId]);
|
||||
}
|
||||
// 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)) {
|
||||
@ -424,22 +375,20 @@ 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], false);
|
||||
$this->setData(['locale', 'legalPageId', $pageId]);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'searchPageId'])) {
|
||||
$this->setData(['locale', 'searchPageId', $pageId], false);
|
||||
$this->setData(['locale', 'searchPageId', $pageId]);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page404'])) {
|
||||
$this->setData(['locale', 'page404', $pageId], false);
|
||||
$this->setData(['locale', 'page404', $pageId]);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page403'])) {
|
||||
$this->setData(['locale', 'page403', $pageId], false);
|
||||
$this->setData(['locale', 'page403', $pageId]);
|
||||
}
|
||||
if ($this->getUrl(2) === $this->getData(['locale', 'page302'])) {
|
||||
$this->setData(['locale', 'page302', $pageId], false);
|
||||
$this->setData(['locale', 'page302', $pageId]);
|
||||
}
|
||||
// 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());
|
||||
@ -458,7 +407,7 @@ class page extends common
|
||||
$lastPosition++;
|
||||
}
|
||||
// Change la position
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition], false);
|
||||
$this->setData(['page', $hierarchyPageId, 'position', $lastPosition]);
|
||||
// Incrémente pour la prochaine position
|
||||
$lastPosition++;
|
||||
}
|
||||
@ -483,28 +432,26 @@ class page extends common
|
||||
) {
|
||||
foreach ($this->getHierarchy($pageId) as $parentId => $childId) {
|
||||
if ($this->getData(['page', $childId, 'parentPageId']) === $pageId) {
|
||||
$this->setData(['page', $childId, 'position', 0], false);
|
||||
$this->setData(['page', $childId, 'position', 0]);
|
||||
}
|
||||
}
|
||||
// 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], false);
|
||||
$this->setData(['page', $eachPageId, 'barRight', $pageId]);
|
||||
}
|
||||
if ($this->getData(['page', $eachPageId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId], false);
|
||||
$this->setData(['page', $eachPageId, 'barLeft', $pageId]);
|
||||
}
|
||||
foreach ($parentId as $childId) {
|
||||
if ($this->getData(['page', $childId, 'barRight']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barRight', $pageId], false);
|
||||
$this->setData(['page', $childId, 'barRight', $pageId]);
|
||||
}
|
||||
if ($this->getData(['page', $childId, 'barLeft']) === $this->getUrl(2)) {
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId], false);
|
||||
$this->setData(['page', $childId, 'barLeft', $pageId]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -663,7 +610,7 @@ class page extends common
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
@ -698,7 +645,7 @@ class page extends common
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'redirect' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
@ -714,7 +661,7 @@ class page extends common
|
||||
|
||||
/**
|
||||
* Retourne les informations sur les pages en omettant les clés CSS et JS qui occasionnent des bugs d'affichage dans l'éditeur de page
|
||||
* @return string tableau associatif des pages dans le menu
|
||||
* @return array tableau associatif des pages dans le menu
|
||||
*/
|
||||
public function getPageInfo()
|
||||
{
|
||||
@ -724,26 +671,6 @@ class page extends common
|
||||
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,
|
||||
]);
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('pageCssEditorBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -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,19 +67,16 @@ $( document ).ready(function() {
|
||||
/**
|
||||
* Sélection des onglets
|
||||
*/
|
||||
var pageLayout = "<?php echo $this->getData(['user', $this->getUser('id'), 'view', 'page']);?>";
|
||||
|
||||
// Non défini, valeur par défaut
|
||||
if (pageLayout == "") {
|
||||
var pageLayout = getCookie("pageLayout");
|
||||
if (pageLayout == null) {
|
||||
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");
|
||||
|
||||
@ -298,6 +295,7 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "content");
|
||||
});
|
||||
$("#pageEditExtensionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -310,6 +308,7 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "extension");
|
||||
});
|
||||
$("#PageEditPositionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -322,6 +321,7 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").addClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "position");
|
||||
});
|
||||
$("#pageEditLayoutButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -334,6 +334,7 @@ $( document ).ready(function() {
|
||||
$("#PageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").addClass("activeButton");
|
||||
$("#pageEditPermissionButton").removeClass("activeButton");
|
||||
setCookie("pageLayout", "layout");
|
||||
});
|
||||
$("#pageEditPermissionButton").on("click", function () {
|
||||
$("#pageEditContentContainer").hide();
|
||||
@ -346,6 +347,7 @@ $( document ).ready(function() {
|
||||
$("#pageEditPositionButton").removeClass("activeButton");
|
||||
$("#pageEditLayoutButton").removeClass("activeButton");
|
||||
$("#pageEditPermissionButton").addClass("activeButton");
|
||||
setCookie("pageLayout", "permission");
|
||||
});
|
||||
|
||||
/**
|
||||
@ -720,6 +722,30 @@ 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,17 +7,26 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 offset7">
|
||||
<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">
|
||||
<?php echo template::button('pageEditDelete', [
|
||||
'class' => 'buttonRed',
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2),
|
||||
'value' => template::ico('trash'),
|
||||
'help' => 'Effacer la page'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1">
|
||||
<?php echo template::button('pageEditDuplicate', [
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2),
|
||||
'value' => template::ico('clone'),
|
||||
'help' => 'Dupliquer la page'
|
||||
]); ?>
|
||||
@ -28,31 +37,27 @@
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab">
|
||||
<?php echo template::button('pageEditContentButton', [
|
||||
'value' => 'Contenu',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/content/' . $this->geturl(2)
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPositionButton', [
|
||||
<?php echo template::button('PageEditPositionButton', [
|
||||
'value' => 'Menu',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/position/' . $this->geturl(2)
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditExtensionButton', [
|
||||
'value' => 'Extension',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/extension/' . $this->geturl(2)
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditLayoutButton', [
|
||||
'value' => 'Mise en page',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/layout/' . $this->geturl(2)
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
<?php echo template::button('pageEditPermissionButton', [
|
||||
'value' => 'Permission',
|
||||
'class' => 'buttonTab',
|
||||
'href' => helper::baseUrl() . 'page/register/permission/' . $this->geturl(2)
|
||||
'class' => 'buttonTab'
|
||||
]); ?>
|
||||
</div>
|
||||
|
||||
@ -62,6 +67,11 @@
|
||||
<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">
|
||||
@ -110,6 +120,11 @@
|
||||
<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">
|
||||
@ -161,6 +176,11 @@
|
||||
<div class="block">
|
||||
<h4>
|
||||
<?php echo helper::translate('Options avancées'); ?>
|
||||
<!--<span id="advancedHelpButton" class="helpDisplayButton">
|
||||
<a href="https://doc.zwiicms.fr/options-d-emplacement-avancee" target="_blank" title="Cliquer pour consulter l'aide en ligne">
|
||||
<?php //echo template::ico('help', ['margin' => 'left']); ?>
|
||||
</a>
|
||||
</span>-->
|
||||
</h4>
|
||||
<div class="blockContainer">
|
||||
<div class="row">
|
||||
@ -175,8 +195,7 @@
|
||||
'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']),
|
||||
'folder' => $this->getData(['page', $this->getUrl(2), 'iconUrl']) ? dirname($this->getData(['page', $this->getUrl(2), 'iconUrl'])) : '',
|
||||
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -273,6 +292,11 @@
|
||||
<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">
|
||||
@ -348,6 +372,11 @@
|
||||
<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">
|
||||
@ -395,4 +424,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php echo template::formClose(); ?>
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('pageJsEditorBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -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
|
||||
@ -314,7 +314,7 @@ class plugin extends common
|
||||
mkdir(self::FILE_DIR . 'source/modules', 0755);
|
||||
}
|
||||
// Sauver les données du fichiers
|
||||
$this->secure_file_put_contents(self::FILE_DIR . 'source/modules/' . $moduleFile, $moduleData);
|
||||
file_put_contents(self::FILE_DIR . 'source/modules/' . $moduleFile, $moduleData);
|
||||
|
||||
// Installation directe
|
||||
if (file_exists(self::FILE_DIR . 'source/modules/' . $moduleFile)) {
|
||||
@ -330,7 +330,6 @@ class plugin extends common
|
||||
'state' => $r['success']
|
||||
]);
|
||||
}
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'title' => helper::translate('Catalogue de modules'),
|
||||
@ -412,15 +411,6 @@ 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
|
||||
*/
|
||||
@ -566,9 +556,6 @@ 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'),
|
||||
|
@ -304,7 +304,7 @@ class theme extends common
|
||||
$this->isPost()
|
||||
) {
|
||||
// Enregistre le CSS
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'custom.css', $this->getInput('themeAdvancedCss', null));
|
||||
file_put_contents(self::DATA_DIR . 'custom.css', $this->getInput('themeAdvancedCss', null));
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
@ -419,7 +419,7 @@ class theme extends common
|
||||
]);
|
||||
|
||||
// Sauvegarder la configuration localisée
|
||||
$this->setData(['locale', 'legalPageId', $this->getInput('configLegalPageId')], false);
|
||||
$this->setData(['locale', 'legalPageId', $this->getInput('configLegalPageId')]);
|
||||
$this->setData(['locale', 'searchPageId', $this->getInput('configSearchPageId')]);
|
||||
|
||||
// Valeurs en sortie
|
||||
@ -507,23 +507,21 @@ 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']))], false);
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('body-', 'site-', $this->getData(['theme', 'menu', 'position']))]);
|
||||
}
|
||||
if ($this->getData(['theme', 'header', 'position']) == 'body') {
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('site-', 'body-', $this->getData(['theme', 'menu', 'position']))], false);
|
||||
$this->setData(['theme', 'menu', 'position', str_replace('site-', 'body-', $this->getData(['theme', 'menu', 'position']))]);
|
||||
}
|
||||
// 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'], false);
|
||||
$this->setData(['theme', 'menu', 'position', 'site']);
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('theme');
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
@ -652,7 +650,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);
|
||||
@ -923,7 +921,7 @@ class theme extends common
|
||||
'fontWeight' => $this->getInput('themeTitleFontWeight'),
|
||||
'textTransform' => $this->getInput('themeTitleTextTransform')
|
||||
]
|
||||
], false);
|
||||
]);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'text',
|
||||
@ -933,7 +931,7 @@ class theme extends common
|
||||
'textColor' => $this->getInput('themeTextTextColor'),
|
||||
'linkColor' => $this->getInput('themeTextLinkColor')
|
||||
]
|
||||
], false);
|
||||
]);
|
||||
$this->setData([
|
||||
'theme',
|
||||
'site',
|
||||
@ -944,14 +942,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',
|
||||
@ -959,9 +957,7 @@ 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'),
|
||||
@ -1294,7 +1290,7 @@ class theme extends common
|
||||
}
|
||||
// Sauvegarder la chaîne modifiée
|
||||
if ($count > 0) {
|
||||
$this->secure_file_put_contents($file, $data);
|
||||
file_put_contents($file, $data);
|
||||
}
|
||||
// Retourner le nombre d'occurrences
|
||||
return ($count);
|
||||
@ -1400,8 +1396,8 @@ class theme extends common
|
||||
}
|
||||
|
||||
// Enregistre la personnalisation
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'font/font.html', $fileContent);
|
||||
file_put_contents(self::DATA_DIR . 'font/font.html', $fileContent);
|
||||
// Enregistre la personnalisation
|
||||
$this->secure_file_put_contents(self::DATA_DIR . 'font/font.css', $fileContentCss);
|
||||
file_put_contents(self::DATA_DIR . 'font/font.css', $fileContentCss);
|
||||
}
|
||||
}
|
@ -7,7 +7,15 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<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">
|
||||
<?php echo template::submit('themeBodySubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -60,8 +68,7 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Arrière plan',
|
||||
'type' => 1,
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
'value' => $imageFile
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,8 +19,6 @@ $('#dataTables').DataTable({
|
||||
url: "core/vendor/datatables/french.json",
|
||||
},
|
||||
locale: 'fr',
|
||||
stateSave: true,
|
||||
"lengthMenu": [[10, 25, 50, -1], [10, 25, 50, "Tout"]],
|
||||
"columnDefs": [{
|
||||
target: 5,
|
||||
orderable: false,
|
||||
|
@ -7,7 +7,15 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<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">
|
||||
<?php echo template::submit('themeHeaderSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -150,17 +158,13 @@
|
||||
'label' => 'Image',
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'type' => 1,
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
'value' => $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,15 +7,22 @@
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset9">
|
||||
<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">
|
||||
<?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">
|
||||
@ -77,8 +84,7 @@
|
||||
<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">
|
||||
@ -106,8 +112,7 @@
|
||||
'language' => $this->getData(['user', $this->getUser('id'), 'language']),
|
||||
'label' => 'Logo du menu burger',
|
||||
'type' => 1,
|
||||
'value' => $imageFile,
|
||||
'folder' => $imageFile ? dirname($imageFile) : ''
|
||||
'value' => $imageFile
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
@ -118,8 +123,7 @@
|
||||
<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">
|
||||
@ -177,8 +181,7 @@
|
||||
<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">
|
||||
|
@ -133,7 +133,7 @@ class user extends common
|
||||
'accessTimer' => null,
|
||||
'accessCsrf' => null,
|
||||
'language' => $this->getInput('userAddLanguage', helper::FILTER_STRING_SHORT),
|
||||
'tags' => $this->getInput('userAddTags', helper::FILTER_STRING_SHORT),
|
||||
'tags' => ''
|
||||
]
|
||||
]);
|
||||
|
||||
@ -345,7 +345,6 @@ 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
|
||||
@ -416,7 +415,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, 'forgot'])));
|
||||
$uniqId = md5(json_encode($this->getData(['user', $userId])));
|
||||
// Envoi le mail
|
||||
$sent = $this->sendMail(
|
||||
$this->getData(['user', $userId, 'mail']),
|
||||
@ -575,7 +574,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) {
|
||||
@ -740,9 +739,9 @@ class user extends common
|
||||
}
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('site/file/source');
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Liste des modules installés
|
||||
@ -897,9 +896,9 @@ class user extends common
|
||||
}
|
||||
|
||||
// Chemin vers les dossiers du gestionnaire de fichier
|
||||
self::$sharePath = $this->getSubdirectories('site/file/source');
|
||||
self::$sharePath = $this->getSubdirectories('./site/file/source');
|
||||
self::$sharePath = array_flip(self::$sharePath);
|
||||
self::$sharePath = array_merge(['site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge(['./site/file/source/' => 'Tous les dossiers'], self::$sharePath);
|
||||
self::$sharePath = array_merge([null => 'Aucun dossier'], self::$sharePath);
|
||||
|
||||
// Liste des modules installés
|
||||
@ -936,11 +935,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 (
|
||||
@ -1031,8 +1030,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], false);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0], false);
|
||||
$this->setData(['user', $userId, 'connectFail', 0]);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
||||
}
|
||||
// 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
|
||||
@ -1044,36 +1043,14 @@ class user extends common
|
||||
and $captcha === true
|
||||
) {
|
||||
// RAZ
|
||||
$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
|
||||
$this->setData(['user', $userId, 'connectFail', 0]);
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0]);
|
||||
// Expiration
|
||||
$expire = $this->getInput('userLoginLongTime', helper::FILTER_BOOLEAN) === true ? strtotime("+1 year") : 0;
|
||||
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;
|
||||
}
|
||||
|
||||
setcookie('ZWII_USER_PASSWORD', $this->getData(['user', $userId, 'password']), $expire, helper::baseUrl(false, false), '', helper::isHttps(), true);
|
||||
// Accès multiples avec le même compte
|
||||
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']], false);
|
||||
$this->setData(['user', $userId, 'accessCsrf', $_SESSION['csrf']]);
|
||||
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
|
||||
if (
|
||||
$this->getData(['config', 'maintenance'])
|
||||
@ -1087,8 +1064,7 @@ class user extends common
|
||||
} else {
|
||||
$logStatus = 'Connexion réussie';
|
||||
$pageId = $this->getUrl(2);
|
||||
if (
|
||||
$this->getData(['config', 'page404']) === $pageId
|
||||
if ($this->getData(['config', 'page404']) === $pageId
|
||||
|| $this->getData(['config', 'page403']) === $pageId
|
||||
) {
|
||||
$pageId = '';
|
||||
@ -1106,12 +1082,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'], false)) {
|
||||
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1], false);
|
||||
if ($this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])) {
|
||||
$this->setData(['user', $userId, 'connectFail', $this->getdata(['user', $userId, 'connectFail']) + 1]);
|
||||
}
|
||||
// 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()], false);
|
||||
$this->setData(['user', $userId, 'connectTimeout', time()]);
|
||||
}
|
||||
// Cas 3 le délai de bloquage court
|
||||
if ($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout']) > time()) {
|
||||
@ -1124,8 +1100,6 @@ class user extends common
|
||||
]);
|
||||
}
|
||||
}
|
||||
// Force la sauvegarde
|
||||
$this->saveDB('user');
|
||||
}
|
||||
// Journalisation
|
||||
$this->saveLog($logStatus);
|
||||
@ -1149,8 +1123,7 @@ class user extends common
|
||||
public function logout()
|
||||
{
|
||||
helper::deleteCookie('ZWII_USER_ID');
|
||||
//helper::deleteCookie('ZWII_USER_PASSWORD');
|
||||
helper::deleteCookie('ZWII_AUTH_KEY');
|
||||
helper::deleteCookie('ZWII_USER_PASSWORD');
|
||||
|
||||
// Détruit la session
|
||||
session_destroy();
|
||||
@ -1204,11 +1177,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], false);
|
||||
$this->setData(['user', $this->getUrl(2), 'password', $newPassword]);
|
||||
// Réinitialise la date de la demande
|
||||
$this->setData(['user', $this->getUrl(2), 'forgot', 0], false);
|
||||
$this->setData(['user', $this->getUrl(2), 'forgot', 0]);
|
||||
// Réinitialise le blocage
|
||||
$this->setData(['user', $this->getUrl(2), 'connectFail', 0], false);
|
||||
$this->setData(['user', $this->getUrl(2), 'connectFail', 0]);
|
||||
$this->setData(['user', $this->getUrl(2), 'connectTimeout', 0]);
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -1323,7 +1296,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
|
||||
@ -1364,8 +1337,6 @@ 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,4 +16,3 @@
|
||||
/** NE PAS EFFACER
|
||||
* admin.css
|
||||
*/
|
||||
|
||||
|
@ -28,8 +28,6 @@ $(document).ready((function () {
|
||||
url: "core/vendor/datatables/french.json",
|
||||
},
|
||||
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
13
core/vendor/datatables/datatables.custom.css
vendored
@ -1,13 +0,0 @@
|
||||
.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,5 +1,4 @@
|
||||
[
|
||||
"datatables.min.js",
|
||||
"datatables.min.css",
|
||||
"datatables.custom.css"
|
||||
"datatables.min.css"
|
||||
]
|
6
core/vendor/filemanager/UploadHandler.php
vendored
6
core/vendor/filemanager/UploadHandler.php
vendored
@ -1505,9 +1505,9 @@ class UploadHandler
|
||||
$magicianObj -> saveImage($targetFile);
|
||||
}
|
||||
|
||||
$newWidth = 640;
|
||||
$newHeight = 480;
|
||||
$thumbResult = create_img($targetFile, $targetFileThumb, $newWidth, $newHeight);
|
||||
|
||||
|
||||
$thumbResult = create_img($targetFile, $targetFileThumb, 122, 91);
|
||||
|
||||
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) and $g['profil'][$group][$profil]['folder']['path'] !== '') {
|
||||
if (!is_null($profil)) {
|
||||
$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' => false,
|
||||
'fixed_image_creation' => true,
|
||||
//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
|
||||
|
44
core/vendor/filemanager/dialog.php
vendored
44
core/vendor/filemanager/dialog.php
vendored
@ -59,12 +59,12 @@ if (checkRelativePath($subdir_path)) {
|
||||
}
|
||||
|
||||
if ($subdir == "") {
|
||||
if (!empty($_COOKIE['ZWII_RFM_FOLDER']) && strpos($_COOKIE['ZWII_RFM_FOLDER'], '.') === false) {
|
||||
$subdir = trim($_COOKIE['ZWII_RFM_FOLDER']);
|
||||
if (!empty($_COOKIE['last_position']) && strpos($_COOKIE['last_position'], '.') === false) {
|
||||
$subdir = trim($_COOKIE['last_position']);
|
||||
}
|
||||
}
|
||||
//remember last position
|
||||
setcookie('ZWII_RFM_FOLDER', $subdir, time() + (86400 * 7));
|
||||
setcookie('last_position', $subdir, time() + (86400 * 7));
|
||||
|
||||
if ($subdir == "/") {
|
||||
$subdir = "";
|
||||
@ -864,54 +864,50 @@ if ($config['upload_files']) { ?>
|
||||
|
||||
switch ($sort_by) {
|
||||
case 'date':
|
||||
//usort($sorted, 'dateSort');
|
||||
usort($sorted, function($x, $y) use ($descending) {
|
||||
if ($x['is_dir'] !== $y['is_dir']) {
|
||||
return $y['is_dir'] ? 1 : -1;
|
||||
} else {
|
||||
if ($descending) {
|
||||
return ($x['size'] < $y['size']) ? -1 : ($x['size'] > $y['size'] ? 1 : 0);
|
||||
} else {
|
||||
return ($x['size'] > $y['size']) ? -1 : ($x['size'] < $y['size'] ? 1 : 0);
|
||||
}
|
||||
return ($descending)
|
||||
? $x['size'] < $y['size']
|
||||
: $x['size'] >= $y['size'];
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'size':
|
||||
//usort($sorted, 'sizeSort');
|
||||
usort($sorted, function($x, $y) use ($descending) {
|
||||
if ($x['is_dir'] !== $y['is_dir']) {
|
||||
return $y['is_dir'] ? 1 : -1;
|
||||
} else {
|
||||
if ($descending) {
|
||||
return ($x['date'] < $y['date']) ? -1 : ($x['date'] > $y['date'] ? 1 : 0);
|
||||
} else {
|
||||
return ($x['date'] > $y['date']) ? -1 : ($x['date'] < $y['date'] ? 1 : 0);
|
||||
}
|
||||
return ($descending)
|
||||
? $x['date'] < $y['date']
|
||||
: $x['date'] >= $y['date'];
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'extension':
|
||||
//usort($sorted, 'extensionSort');
|
||||
usort($sorted, function($x, $y) use ($descending) {
|
||||
if ($x['is_dir'] !== $y['is_dir']) {
|
||||
return $y['is_dir'] ? 1 : -1;
|
||||
} else {
|
||||
if ($descending) {
|
||||
return strcasecmp($x['extension'], $y['extension']);
|
||||
} else {
|
||||
return -strcasecmp($x['extension'], $y['extension']);
|
||||
}
|
||||
return ($descending)
|
||||
? ($x['extension'] < $y['extension'] ? 1 : 0)
|
||||
: ($x['extension'] >= $y['extension'] ? 1 : 0);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
default:
|
||||
// usort($sorted, 'filenameSort');
|
||||
usort($sorted, function($x, $y) use ($descending) {
|
||||
if ($x['is_dir'] !== $y['is_dir']) {
|
||||
return $y['is_dir'] ? 1 : -1;
|
||||
} else {
|
||||
if ($descending) {
|
||||
return strcasecmp($x['file_lcase'], $y['file_lcase']);
|
||||
} else {
|
||||
return -strcasecmp($x['file_lcase'], $y['file_lcase']);
|
||||
}
|
||||
return ($descending)
|
||||
? ($x['file_lcase'] < $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1))
|
||||
: ($x['file_lcase'] >= $y['file_lcase'] ? 1 : ($x['file_lcase'] == $y['file_lcase'] ? 0 : -1));
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
25
index.php
25
index.php
@ -19,31 +19,6 @@
|
||||
*/
|
||||
// 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 = '8.0';
|
||||
const VERSION = '7.5';
|
||||
const REALNAME = 'Blog';
|
||||
const DELETE = true;
|
||||
const UPDATE = '0.0';
|
||||
@ -42,6 +42,9 @@ class blog extends common
|
||||
|
||||
public static $articles = [];
|
||||
|
||||
// Signature de l'article
|
||||
public static $articleSignature = '';
|
||||
|
||||
// Signature du commentaire
|
||||
public static $editCommentSignature = '';
|
||||
|
||||
@ -171,13 +174,10 @@ 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 8.0
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '8.0', '<')) {
|
||||
// Version 7.4
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.4', '<')) {
|
||||
$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]);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '8.0']);
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData', '7.4']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,11 +196,9 @@ class blog extends common
|
||||
$feeds = new \FeedWriter\RSS2();
|
||||
|
||||
// En-tête
|
||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']) ? $this->getData(['page', $this->getUrl(0), 'title']): '');
|
||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']));
|
||||
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
||||
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();
|
||||
@ -578,10 +576,7 @@ class blog extends common
|
||||
'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true),
|
||||
'dateFormat' => $this->getInput('blogOptionDateFormat'),
|
||||
'timeFormat' => $this->getInput('blogOptionTimeFormat'),
|
||||
'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),
|
||||
'buttonBack' => $this->getInput('newsOptionButtonBack'),
|
||||
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
|
||||
]
|
||||
]);
|
||||
@ -599,6 +594,7 @@ class blog extends common
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Suppression
|
||||
*/
|
||||
@ -751,7 +747,7 @@ class blog extends common
|
||||
) {
|
||||
// Check la captcha
|
||||
if (
|
||||
$this->isConnected() === false
|
||||
$this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
|
||||
//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
|
||||
) {
|
||||
@ -759,7 +755,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', null, true);
|
||||
$content = $this->getInput('blogArticleContent', false);
|
||||
$this->setData([
|
||||
'module', $this->getUrl(0),
|
||||
'posts', $this->getUrl(1),
|
||||
@ -830,8 +826,10 @@ 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->isConnected() === true) {
|
||||
if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
self::$editCommentSignature = $this->signature($this->getUser('id'));
|
||||
}
|
||||
// Commentaires en fonction de la pagination
|
||||
|
@ -1,18 +1,3 @@
|
||||
# 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
|
||||
- Mise à jour RSS Feed
|
||||
# Version 7.5
|
||||
- Bug paramètre de localisation erroné
|
||||
# Version 7.4
|
||||
|
@ -1 +1 @@
|
||||
{"name":"blog","realName":"Blog","version":"7.12","update":"0.0","delete":true,"dataDirectory":""}
|
||||
{"name":"blog","realName":"Blog","version":"7.2","update":"0.0","delete":true,"dataDirectory":""}
|
74
module/blog/vendor/FeedWriter/CHANGELOG.md
vendored
74
module/blog/vendor/FeedWriter/CHANGELOG.md
vendored
@ -1,74 +0,0 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/) .
|
||||
|
||||
## [v1.1.2] - 2023-05-25
|
||||
### Changed
|
||||
- Throw an exception if required feed elements are set with ```NULL``` value. See issue #46.
|
||||
|
||||
## [v1.1.1] - 2016-11-19
|
||||
### Changed
|
||||
- Improved the documentation.
|
||||
- Changed to PSR-4 autoloader in composer.json.
|
||||
|
||||
### Fixed
|
||||
- Item::addElement did not method chain in error conditions.
|
||||
|
||||
## [v1.1.0] - 2016-11-08
|
||||
### Added
|
||||
- Support for multiple element values.
|
||||
- Support for a feed description in ATOM feeds.
|
||||
- Support for ATOM feeds without ```link``` elements.
|
||||
- Support for a feed image in RSS 1.0 and ATOM feeds.
|
||||
|
||||
### Changed
|
||||
- The script does now throw Exceptions instead of stopping the PHP interpreter on error conditions.
|
||||
- The unique identifier for ATOM feeds / entries use the feed / entry title for generating the ID (previously the feed / entry link).
|
||||
- Some URI schemes for ```Item::setId``` were wrongly allowed.
|
||||
- The parameter order of the ```Feed::setImage``` method was changed.
|
||||
|
||||
### Fixed
|
||||
- Fixed slow generation of the feed with huge amounts of feed entries (like 40k entries).
|
||||
- Fixed PHP warning when ```Feed::setChannelAbout``` for RSS 1.0 feeds was not called.
|
||||
- A feed element was generated twice if the element content & attribute value was ```NULL```.
|
||||
- The detection of twice the same link with ```rel=alternate```, ```hreflang``` & ```type``` did not work.
|
||||
|
||||
### Removed
|
||||
- The deprecated method ```Item::setEnclosure``` was removed. Use ```Item::addEnclosure``` instead.
|
||||
|
||||
## [v1.0.4] - 2016-04-17
|
||||
### Changed
|
||||
- The unique identifier for ATOM feed entries is now compliant to the ATOM standard.
|
||||
|
||||
### Fixed
|
||||
- Filter more invalid XML chars.
|
||||
- Fixed a PHP warning displayed if ```Feed::setTitle``` or ```Feed::setLink``` was not called.
|
||||
|
||||
## [v1.0.3] - 2015-11-11
|
||||
### Added
|
||||
- Method for removing tags which were CDATA encoded.
|
||||
|
||||
### Fixed
|
||||
- Fixed error when the filtering of invalid XML chars failed.
|
||||
- Fixed missing docblock documentation.
|
||||
|
||||
## [v1.0.2] - 2015-01-23
|
||||
### Fixed
|
||||
- Fixed a wrong docblock return data type.
|
||||
|
||||
## [v1.0.1] - 2014-09-21
|
||||
### Fixed
|
||||
- Filter invalid XML chars.
|
||||
|
||||
## v1.0 - 2014-09-14
|
||||
|
||||
|
||||
[Unreleased]: https://github.com/mibe/FeedWriter/compare/v1.1.2...HEAD
|
||||
[v1.1.2]: https://github.com/mibe/FeedWriter/compare/v1.1.1...v1.1.2
|
||||
[v1.1.1]: https://github.com/mibe/FeedWriter/compare/v1.1.0...v1.1.1
|
||||
[v1.1.0]: https://github.com/mibe/FeedWriter/compare/v1.0.4...v1.1.0
|
||||
[v1.0.4]: https://github.com/mibe/FeedWriter/compare/v1.0.3...v1.0.4
|
||||
[v1.0.3]: https://github.com/mibe/FeedWriter/compare/v1.0.2...v1.0.3
|
||||
[v1.0.2]: https://github.com/mibe/FeedWriter/compare/v1.0.1...v1.0.2
|
||||
[v1.0.1]: https://github.com/mibe/FeedWriter/compare/v1.0...v1.0.1
|
39
module/blog/vendor/FeedWriter/Feed.php
vendored
39
module/blog/vendor/FeedWriter/Feed.php
vendored
@ -2,11 +2,10 @@
|
||||
namespace FeedWriter;
|
||||
|
||||
use \DateTime;
|
||||
use \DateTimeInterface;
|
||||
|
||||
/*
|
||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||
* Copyright (C) 2010-2016, 2022 Michael Bemmerl <mail@mx-server.de>
|
||||
* Copyright (C) 2010-2016 Michael Bemmerl <mail@mx-server.de>
|
||||
*
|
||||
* This file is part of the "Universal Feed Writer" project.
|
||||
*
|
||||
@ -77,13 +76,6 @@ abstract class Feed
|
||||
*/
|
||||
private $version = null;
|
||||
|
||||
/**
|
||||
* Contains the encoding of this feed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $encoding = 'utf-8';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -95,6 +87,9 @@ abstract class Feed
|
||||
{
|
||||
$this->version = $version;
|
||||
|
||||
// Setting default encoding
|
||||
$this->encoding = 'utf-8';
|
||||
|
||||
// Setting default value for essential channel element
|
||||
$this->setTitle($version . ' Feed');
|
||||
|
||||
@ -401,13 +396,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $title value of 'title' channel tag
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the title is empty or NULL.
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
if (empty($title))
|
||||
throw new \InvalidArgumentException('The title may not be empty or NULL.');
|
||||
|
||||
return $this->setChannelElement('title', $title);
|
||||
}
|
||||
|
||||
@ -415,15 +406,15 @@ abstract class Feed
|
||||
* Set the date when the feed was lastly updated.
|
||||
*
|
||||
* This adds the 'updated' element to the feed. The value of the date parameter
|
||||
* can be either a class implementing DateTimeInterface, an integer containing a UNIX
|
||||
* can be either an instance of the DateTime class, an integer containing a UNIX
|
||||
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
||||
*
|
||||
* Not supported in RSS1 feeds.
|
||||
*
|
||||
* @access public
|
||||
* @param DateTimeInterface|int|string Date which should be used.
|
||||
* @param DateTime|int|string Date which should be used.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.
|
||||
* @throws \InvalidArgumentException if the given date is not an instance of DateTime, a UNIX timestamp or a date string.
|
||||
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
||||
*/
|
||||
public function setDate($date)
|
||||
@ -434,7 +425,7 @@ abstract class Feed
|
||||
// The feeds have different date formats.
|
||||
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
||||
|
||||
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||
if ($date instanceof DateTime)
|
||||
$date = $date->format($format);
|
||||
else if(is_numeric($date) && $date >= 0)
|
||||
$date = date($format, $date);
|
||||
@ -447,7 +438,7 @@ abstract class Feed
|
||||
$date = date($format, $timestamp);
|
||||
}
|
||||
else
|
||||
throw new \InvalidArgumentException('The given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.');
|
||||
throw new \InvalidArgumentException('The given date is not an instance of DateTime, a UNIX timestamp or a date string.');
|
||||
|
||||
if ($this->version == Feed::ATOM)
|
||||
$this->setChannelElement('updated', $date);
|
||||
@ -463,13 +454,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $description Description of the feed.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the description is empty or NULL.
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
if (empty($description))
|
||||
throw new \InvalidArgumentException('The description may not be empty or NULL.');
|
||||
|
||||
if ($this->version != Feed::ATOM)
|
||||
$this->setChannelElement('description', $description);
|
||||
else
|
||||
@ -484,13 +471,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $link value of 'link' channel tag
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the link is empty or NULL.
|
||||
*/
|
||||
public function setLink($link)
|
||||
{
|
||||
if (empty($link))
|
||||
throw new \InvalidArgumentException('The link may not be empty or NULL.');
|
||||
|
||||
if ($this->version == Feed::ATOM)
|
||||
$this->setAtomLink($link);
|
||||
else
|
||||
@ -684,7 +667,7 @@ abstract class Feed
|
||||
/**
|
||||
* Replace invalid XML characters.
|
||||
*
|
||||
* @link https://web.archive.org/web/20160608013721/http://www.phpwact.org:80/php/i18n/charsets#xml See utf8_for_xml() function
|
||||
* @link http://www.phpwact.org/php/i18n/charsets#xml See utf8_for_xml() function
|
||||
* @link http://www.w3.org/TR/REC-xml/#charsets
|
||||
* @link https://github.com/mibe/FeedWriter/issues/30
|
||||
*
|
||||
@ -923,7 +906,7 @@ abstract class Feed
|
||||
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
||||
|
||||
// An image has its own element after the channel elements.
|
||||
if (array_key_exists('Image', $this->data))
|
||||
if (array_key_exists('image', $this->data))
|
||||
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
||||
} else if ($this->version == Feed::ATOM) {
|
||||
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
||||
|
16
module/blog/vendor/FeedWriter/Item.php
vendored
16
module/blog/vendor/FeedWriter/Item.php
vendored
@ -2,7 +2,6 @@
|
||||
namespace FeedWriter;
|
||||
|
||||
use \DateTime;
|
||||
use \DateTimeInterface;
|
||||
|
||||
/*
|
||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||
@ -218,19 +217,19 @@ class Item
|
||||
/**
|
||||
* Set the 'date' element of the feed item.
|
||||
*
|
||||
* The value of the date parameter can be either a class implementing
|
||||
* DateTimeInterface, an integer containing a UNIX timestamp or a string
|
||||
* The value of the date parameter can be either an instance of the
|
||||
* DateTime class, an integer containing a UNIX timestamp or a string
|
||||
* which is parseable by PHP's 'strtotime' function.
|
||||
*
|
||||
* @access public
|
||||
* @param DateTimeInterface|int|string $date Date which should be used.
|
||||
* @param DateTime|int|string $date Date which should be used.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the given date was not parseable.
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
if (!is_numeric($date)) {
|
||||
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||
if ($date instanceof DateTime)
|
||||
$date = $date->getTimestamp();
|
||||
else {
|
||||
$date = strtotime($date);
|
||||
@ -278,7 +277,7 @@ class Item
|
||||
* Attach a external media to the feed item.
|
||||
* Not supported in RSS 1.0 feeds.
|
||||
*
|
||||
* See RFC 6838 for syntactical correct MIME types.
|
||||
* See RFC 4288 for syntactical correct MIME types.
|
||||
*
|
||||
* Note that you should avoid the use of more than one enclosure in one item,
|
||||
* since some RSS aggregators don't support it.
|
||||
@ -289,8 +288,7 @@ class Item
|
||||
* @param string $type The MIME type attribute of the media.
|
||||
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
||||
* @return self
|
||||
* @link https://tools.ietf.org/html/rfc6838
|
||||
* @link http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
* @link https://tools.ietf.org/html/rfc4288
|
||||
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
||||
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
||||
*/
|
||||
@ -391,7 +389,7 @@ class Item
|
||||
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
||||
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
||||
// by using only permanent or historical schemes.
|
||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'bb', 'cap', 'cid', 'coap', 'coap+tcp', 'coap+ws', 'coaps', 'coaps+tcp', 'coaps+ws', 'crid', 'data', 'dav', 'dict', 'dns', 'drop', 'dtn', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'grd', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipn', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'leaptofrogans', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mt', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'p1', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp (OBSOLETE)', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'upt', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'wpid', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||
$found = FALSE;
|
||||
$checkId = strtolower($id);
|
||||
|
||||
|
8
module/blog/vendor/FeedWriter/README.md
vendored
8
module/blog/vendor/FeedWriter/README.md
vendored
@ -12,11 +12,6 @@ Once a feed is fully composed with its items, the feed class can generate the ne
|
||||
|
||||
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
||||
|
||||
## Installation
|
||||
You can install via [Composer](https://getcomposer.org/).
|
||||
|
||||
composer require mibe/feedwriter
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
||||
@ -45,6 +40,3 @@ In chronological order:
|
||||
- Pavel Khakhlou
|
||||
- Daniel
|
||||
- Tino Goratsch
|
||||
- John
|
||||
- Özgür Görgülü
|
||||
- Jan Tojnar
|
||||
|
@ -18,36 +18,14 @@
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col6 newsDate textAlignRight">
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<!-- bloc signature et date -->
|
||||
<?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; ?>
|
||||
<?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 edition -->
|
||||
<?php if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === $module::EDIT_OWNER
|
||||
@ -110,7 +88,7 @@
|
||||
'readonly' => true
|
||||
]); ?>
|
||||
<div id="blogArticleCommentWrapper" class="displayNone">
|
||||
<?php if ($this->isConnected() === true): ?>
|
||||
<?php if ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')): ?>
|
||||
<?php echo template::text('blogArticleUserName', [
|
||||
'label' => 'Nom',
|
||||
'readonly' => true,
|
||||
@ -144,7 +122,7 @@
|
||||
'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength'])
|
||||
]); ?>
|
||||
<div id="blogArticleContentAlarm"> </div>
|
||||
<?php if ($this->isConnected() === false): ?>
|
||||
<?php if ($this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')): ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo template::captcha('blogArticleCaptcha', [
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('blogConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0), 'posts',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php echo template::formOpen('blogEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php echo template::button('blogEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
@ -22,11 +22,11 @@
|
||||
'uniqueSubmission' => true
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Paramètres'); ?></h4>
|
||||
<h4><?php echo helper::translate('Paramètres');?></h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::text('blogEditTitle', [
|
||||
@ -48,8 +48,7 @@
|
||||
'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'])) : ''
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
@ -75,15 +74,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::textarea('blogEditContent', [
|
||||
</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="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Options de publication'); ?></h4>
|
||||
<h4><?php echo helper::translate('Options de publication');?></h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditUserId', $module::$users, [
|
||||
@ -101,7 +100,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('blogEditConsent', $module::$articleConsent, [
|
||||
<?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'
|
||||
@ -110,11 +109,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Commentaires'); ?></h4>
|
||||
<h4><?php echo helper::translate('Commentaires');?></h4>
|
||||
<div class="row">
|
||||
<div class="col4 ">
|
||||
<?php echo template::checkbox('blogEditCommentClose', true, 'Fermer les commentaires', [
|
||||
@ -128,7 +127,7 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4 commentOptionsWrapper">
|
||||
<?php echo template::select('blogEditCommentMaxlength', $module::$commentsLength, [
|
||||
<?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'])
|
||||
@ -150,5 +149,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
@ -24,32 +24,11 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col6 blogEdit">
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<!-- bloc signature et date -->
|
||||
<?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; ?>
|
||||
<?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>
|
||||
<div class="row">
|
||||
@ -72,7 +51,7 @@
|
||||
<div class="col6 blogEdit">
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === $module::EDIT_OWNER
|
||||
@ -124,8 +103,7 @@
|
||||
file_exists(self::FILE_DIR . 'source/' . $article['picture'])
|
||||
): ?>
|
||||
<div class="col3">
|
||||
<?php
|
||||
// Déterminer le nom de la miniature
|
||||
<?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
|
||||
@ -160,36 +138,15 @@
|
||||
</a>
|
||||
</div>
|
||||
<div class="blogDate">
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<!-- bloc signature et date -->
|
||||
<?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; ?>
|
||||
<?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']); ?>
|
||||
<?php if ($lenght > 0): ?>
|
||||
<?php ?>
|
||||
<?php echo helper::subword($article['content'], 0, $lenght); ?>...
|
||||
<?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">
|
||||
@ -197,10 +154,6 @@
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<?php echo $article['content']; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* 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,36 +17,32 @@
|
||||
<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::checkbox('blogOptionShowDate', true, 'Afficher la date', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showDate']),
|
||||
<?php echo template::select('blogOptionArticlesLayout', $module::$articlesLayout, [
|
||||
'label' => 'Disposition',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout'])
|
||||
]); ?>
|
||||
</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="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">
|
||||
<div class="col2">
|
||||
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
|
||||
'label' => 'Format des heures',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||
@ -54,34 +50,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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">
|
||||
<div class="col3">
|
||||
<?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 RSS',
|
||||
'label' => 'Texte de l\'étiquette',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,7 +1,3 @@
|
||||
# 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
|
||||
- Termes des commandes de profils
|
||||
# Version 4.1
|
||||
|
@ -17,7 +17,7 @@
|
||||
class form extends common
|
||||
{
|
||||
|
||||
const VERSION = '4.4';
|
||||
const VERSION = '4.2';
|
||||
const REALNAME = 'Formulaire';
|
||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('formConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -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']),
|
||||
'folder' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl']) ? dirname($this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])) : ''
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'logoUrl'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
@ -153,3 +153,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,5 +1,3 @@
|
||||
# Version 4.2
|
||||
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||
# Version 4.1
|
||||
- Termes des commandes de profils
|
||||
# Version 4.0
|
||||
|
@ -18,7 +18,7 @@ class gallery extends common
|
||||
{
|
||||
|
||||
|
||||
const VERSION = '4.2';
|
||||
const VERSION = '4.1';
|
||||
const REALNAME = 'Galerie';
|
||||
const DATADIRECTORY = self::DATA_DIR . 'gallery/';
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('galleryConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -27,6 +27,8 @@ $( document ).ready(function() {
|
||||
serializeRegexp: ""
|
||||
});
|
||||
|
||||
console.log($("#galleryEditSort").val());
|
||||
|
||||
if ($("#galleryEditSort").val() !== "SORT_HAND") {
|
||||
$("#galleryTable tr").addClass("nodrag nodrop");
|
||||
$(".zwiico-sort").hide();
|
||||
|
@ -1,14 +1,3 @@
|
||||
# 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
|
||||
- Mise à jour RSS Feed
|
||||
# Version 5.4
|
||||
- Bug paramètre de localisation erroné
|
||||
# Version 5.3
|
||||
|
@ -1 +1 @@
|
||||
{"name":"news","realName":"News","version":"5.9","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
||||
{"name":"news","realName":"News","version":"5.0","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}
|
@ -22,7 +22,7 @@
|
||||
"Brouillon": "Unorganisiert",
|
||||
"Couleur de la bordure": "Randfarbe",
|
||||
"Couleur du fond": "Bodenfarbe",
|
||||
"Étiquette RSS": "RSS -Label",
|
||||
"Etiquette 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",
|
||||
"Étiquette RSS": "RSS label",
|
||||
"Etiquette 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",
|
||||
"Étiquette RSS": "",
|
||||
"Etiquette 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": "",
|
||||
"Étiquette RSS": "",
|
||||
"Etiquette 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": "Χρώμα του φόντου",
|
||||
"Étiquette RSS": "Ετικέτα RSS",
|
||||
"Etiquette 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",
|
||||
"Étiquette RSS": "Etichetta RSS",
|
||||
"Etiquette 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",
|
||||
"Étiquette RSS": "Rótulo RSS",
|
||||
"Etiquette 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",
|
||||
"Étiquette RSS": "RSS etiketi",
|
||||
"Etiquette 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 = '6.0';
|
||||
const VERSION = '5.4';
|
||||
const REALNAME = 'News';
|
||||
const DATADIRECTORY = self::DATA_DIR . 'news/';
|
||||
|
||||
@ -124,12 +124,9 @@ class news extends common
|
||||
$feeds = new \FeedWriter\RSS2();
|
||||
|
||||
// En-tête
|
||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']) ? $this->getData(['page', $this->getUrl(0), 'title']) : '');
|
||||
$feeds->setTitle($this->getData(['page', $this->getUrl(0), 'title']));
|
||||
$feeds->setLink(helper::baseUrl() . $this->getUrl(0));
|
||||
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();
|
||||
@ -175,8 +172,7 @@ 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,
|
||||
[
|
||||
@ -290,8 +286,7 @@ 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' : '',
|
||||
@ -303,8 +298,7 @@ class news extends common
|
||||
]);
|
||||
|
||||
$this->setData([
|
||||
'module',
|
||||
$this->getUrl(0),
|
||||
'module', $this->getUrl(0),
|
||||
'config',
|
||||
[
|
||||
'feeds' => $this->getInput('newsOptionShowFeeds', helper::FILTER_BOOLEAN),
|
||||
@ -314,10 +308,7 @@ class news extends common
|
||||
'height' => $this->getInput('newsOptionHeight', helper::FILTER_INT, true),
|
||||
'dateFormat' => $this->getInput('newsOptionDateFormat'),
|
||||
'timeFormat' => $this->getInput('newsOptionTimeFormat'),
|
||||
'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),
|
||||
'buttonBack' => $this->getInput('newsOptionButtonBack'),
|
||||
'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']),
|
||||
]
|
||||
]);
|
||||
@ -325,7 +316,7 @@ class news extends common
|
||||
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/option',
|
||||
'notification' => helper::translate('Modifications enregistrées'),
|
||||
'state' => true
|
||||
]);
|
||||
@ -435,8 +426,7 @@ 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,
|
||||
[
|
||||
@ -498,8 +488,6 @@ 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([
|
||||
@ -619,15 +607,6 @@ 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']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
74
module/news/vendor/FeedWriter/CHANGELOG.md
vendored
74
module/news/vendor/FeedWriter/CHANGELOG.md
vendored
@ -1,74 +0,0 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/) .
|
||||
|
||||
## [v1.1.2] - 2023-05-25
|
||||
### Changed
|
||||
- Throw an exception if required feed elements are set with ```NULL``` value. See issue #46.
|
||||
|
||||
## [v1.1.1] - 2016-11-19
|
||||
### Changed
|
||||
- Improved the documentation.
|
||||
- Changed to PSR-4 autoloader in composer.json.
|
||||
|
||||
### Fixed
|
||||
- Item::addElement did not method chain in error conditions.
|
||||
|
||||
## [v1.1.0] - 2016-11-08
|
||||
### Added
|
||||
- Support for multiple element values.
|
||||
- Support for a feed description in ATOM feeds.
|
||||
- Support for ATOM feeds without ```link``` elements.
|
||||
- Support for a feed image in RSS 1.0 and ATOM feeds.
|
||||
|
||||
### Changed
|
||||
- The script does now throw Exceptions instead of stopping the PHP interpreter on error conditions.
|
||||
- The unique identifier for ATOM feeds / entries use the feed / entry title for generating the ID (previously the feed / entry link).
|
||||
- Some URI schemes for ```Item::setId``` were wrongly allowed.
|
||||
- The parameter order of the ```Feed::setImage``` method was changed.
|
||||
|
||||
### Fixed
|
||||
- Fixed slow generation of the feed with huge amounts of feed entries (like 40k entries).
|
||||
- Fixed PHP warning when ```Feed::setChannelAbout``` for RSS 1.0 feeds was not called.
|
||||
- A feed element was generated twice if the element content & attribute value was ```NULL```.
|
||||
- The detection of twice the same link with ```rel=alternate```, ```hreflang``` & ```type``` did not work.
|
||||
|
||||
### Removed
|
||||
- The deprecated method ```Item::setEnclosure``` was removed. Use ```Item::addEnclosure``` instead.
|
||||
|
||||
## [v1.0.4] - 2016-04-17
|
||||
### Changed
|
||||
- The unique identifier for ATOM feed entries is now compliant to the ATOM standard.
|
||||
|
||||
### Fixed
|
||||
- Filter more invalid XML chars.
|
||||
- Fixed a PHP warning displayed if ```Feed::setTitle``` or ```Feed::setLink``` was not called.
|
||||
|
||||
## [v1.0.3] - 2015-11-11
|
||||
### Added
|
||||
- Method for removing tags which were CDATA encoded.
|
||||
|
||||
### Fixed
|
||||
- Fixed error when the filtering of invalid XML chars failed.
|
||||
- Fixed missing docblock documentation.
|
||||
|
||||
## [v1.0.2] - 2015-01-23
|
||||
### Fixed
|
||||
- Fixed a wrong docblock return data type.
|
||||
|
||||
## [v1.0.1] - 2014-09-21
|
||||
### Fixed
|
||||
- Filter invalid XML chars.
|
||||
|
||||
## v1.0 - 2014-09-14
|
||||
|
||||
|
||||
[Unreleased]: https://github.com/mibe/FeedWriter/compare/v1.1.2...HEAD
|
||||
[v1.1.2]: https://github.com/mibe/FeedWriter/compare/v1.1.1...v1.1.2
|
||||
[v1.1.1]: https://github.com/mibe/FeedWriter/compare/v1.1.0...v1.1.1
|
||||
[v1.1.0]: https://github.com/mibe/FeedWriter/compare/v1.0.4...v1.1.0
|
||||
[v1.0.4]: https://github.com/mibe/FeedWriter/compare/v1.0.3...v1.0.4
|
||||
[v1.0.3]: https://github.com/mibe/FeedWriter/compare/v1.0.2...v1.0.3
|
||||
[v1.0.2]: https://github.com/mibe/FeedWriter/compare/v1.0.1...v1.0.2
|
||||
[v1.0.1]: https://github.com/mibe/FeedWriter/compare/v1.0...v1.0.1
|
39
module/news/vendor/FeedWriter/Feed.php
vendored
39
module/news/vendor/FeedWriter/Feed.php
vendored
@ -2,11 +2,10 @@
|
||||
namespace FeedWriter;
|
||||
|
||||
use \DateTime;
|
||||
use \DateTimeInterface;
|
||||
|
||||
/*
|
||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||
* Copyright (C) 2010-2016, 2022 Michael Bemmerl <mail@mx-server.de>
|
||||
* Copyright (C) 2010-2016 Michael Bemmerl <mail@mx-server.de>
|
||||
*
|
||||
* This file is part of the "Universal Feed Writer" project.
|
||||
*
|
||||
@ -77,13 +76,6 @@ abstract class Feed
|
||||
*/
|
||||
private $version = null;
|
||||
|
||||
/**
|
||||
* Contains the encoding of this feed.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private $encoding = 'utf-8';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -95,6 +87,9 @@ abstract class Feed
|
||||
{
|
||||
$this->version = $version;
|
||||
|
||||
// Setting default encoding
|
||||
$this->encoding = 'utf-8';
|
||||
|
||||
// Setting default value for essential channel element
|
||||
$this->setTitle($version . ' Feed');
|
||||
|
||||
@ -401,13 +396,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $title value of 'title' channel tag
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the title is empty or NULL.
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
if (empty($title))
|
||||
throw new \InvalidArgumentException('The title may not be empty or NULL.');
|
||||
|
||||
return $this->setChannelElement('title', $title);
|
||||
}
|
||||
|
||||
@ -415,15 +406,15 @@ abstract class Feed
|
||||
* Set the date when the feed was lastly updated.
|
||||
*
|
||||
* This adds the 'updated' element to the feed. The value of the date parameter
|
||||
* can be either a class implementing DateTimeInterface, an integer containing a UNIX
|
||||
* can be either an instance of the DateTime class, an integer containing a UNIX
|
||||
* timestamp or a string which is parseable by PHP's 'strtotime' function.
|
||||
*
|
||||
* Not supported in RSS1 feeds.
|
||||
*
|
||||
* @access public
|
||||
* @param DateTimeInterface|int|string Date which should be used.
|
||||
* @param DateTime|int|string Date which should be used.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.
|
||||
* @throws \InvalidArgumentException if the given date is not an instance of DateTime, a UNIX timestamp or a date string.
|
||||
* @throws InvalidOperationException if this method is called on an RSS1 feed.
|
||||
*/
|
||||
public function setDate($date)
|
||||
@ -434,7 +425,7 @@ abstract class Feed
|
||||
// The feeds have different date formats.
|
||||
$format = $this->version == Feed::ATOM ? \DATE_ATOM : \DATE_RSS;
|
||||
|
||||
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||
if ($date instanceof DateTime)
|
||||
$date = $date->format($format);
|
||||
else if(is_numeric($date) && $date >= 0)
|
||||
$date = date($format, $date);
|
||||
@ -447,7 +438,7 @@ abstract class Feed
|
||||
$date = date($format, $timestamp);
|
||||
}
|
||||
else
|
||||
throw new \InvalidArgumentException('The given date is not an implementation of DateTimeInterface, a UNIX timestamp or a date string.');
|
||||
throw new \InvalidArgumentException('The given date is not an instance of DateTime, a UNIX timestamp or a date string.');
|
||||
|
||||
if ($this->version == Feed::ATOM)
|
||||
$this->setChannelElement('updated', $date);
|
||||
@ -463,13 +454,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $description Description of the feed.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the description is empty or NULL.
|
||||
*/
|
||||
public function setDescription($description)
|
||||
{
|
||||
if (empty($description))
|
||||
throw new \InvalidArgumentException('The description may not be empty or NULL.');
|
||||
|
||||
if ($this->version != Feed::ATOM)
|
||||
$this->setChannelElement('description', $description);
|
||||
else
|
||||
@ -484,13 +471,9 @@ abstract class Feed
|
||||
* @access public
|
||||
* @param string $link value of 'link' channel tag
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the link is empty or NULL.
|
||||
*/
|
||||
public function setLink($link)
|
||||
{
|
||||
if (empty($link))
|
||||
throw new \InvalidArgumentException('The link may not be empty or NULL.');
|
||||
|
||||
if ($this->version == Feed::ATOM)
|
||||
$this->setAtomLink($link);
|
||||
else
|
||||
@ -684,7 +667,7 @@ abstract class Feed
|
||||
/**
|
||||
* Replace invalid XML characters.
|
||||
*
|
||||
* @link https://web.archive.org/web/20160608013721/http://www.phpwact.org:80/php/i18n/charsets#xml See utf8_for_xml() function
|
||||
* @link http://www.phpwact.org/php/i18n/charsets#xml See utf8_for_xml() function
|
||||
* @link http://www.w3.org/TR/REC-xml/#charsets
|
||||
* @link https://github.com/mibe/FeedWriter/issues/30
|
||||
*
|
||||
@ -923,7 +906,7 @@ abstract class Feed
|
||||
$out .= "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
|
||||
|
||||
// An image has its own element after the channel elements.
|
||||
if (array_key_exists('Image', $this->data))
|
||||
if (array_key_exists('image', $this->data))
|
||||
$out .= $this->makeNode('image', $this->data['Image'], array('rdf:about' => $this->data['Image']['url']));
|
||||
} else if ($this->version == Feed::ATOM) {
|
||||
// ATOM feeds have a unique feed ID. Use the title channel element as key.
|
||||
|
16
module/news/vendor/FeedWriter/Item.php
vendored
16
module/news/vendor/FeedWriter/Item.php
vendored
@ -2,7 +2,6 @@
|
||||
namespace FeedWriter;
|
||||
|
||||
use \DateTime;
|
||||
use \DateTimeInterface;
|
||||
|
||||
/*
|
||||
* Copyright (C) 2008 Anis uddin Ahmad <anisniit@gmail.com>
|
||||
@ -218,19 +217,19 @@ class Item
|
||||
/**
|
||||
* Set the 'date' element of the feed item.
|
||||
*
|
||||
* The value of the date parameter can be either a class implementing
|
||||
* DateTimeInterface, an integer containing a UNIX timestamp or a string
|
||||
* The value of the date parameter can be either an instance of the
|
||||
* DateTime class, an integer containing a UNIX timestamp or a string
|
||||
* which is parseable by PHP's 'strtotime' function.
|
||||
*
|
||||
* @access public
|
||||
* @param DateTimeInterface|int|string $date Date which should be used.
|
||||
* @param DateTime|int|string $date Date which should be used.
|
||||
* @return self
|
||||
* @throws \InvalidArgumentException if the given date was not parseable.
|
||||
*/
|
||||
public function setDate($date)
|
||||
{
|
||||
if (!is_numeric($date)) {
|
||||
if ($date instanceof DateTimeInterface || $date instanceof DateTime)
|
||||
if ($date instanceof DateTime)
|
||||
$date = $date->getTimestamp();
|
||||
else {
|
||||
$date = strtotime($date);
|
||||
@ -278,7 +277,7 @@ class Item
|
||||
* Attach a external media to the feed item.
|
||||
* Not supported in RSS 1.0 feeds.
|
||||
*
|
||||
* See RFC 6838 for syntactical correct MIME types.
|
||||
* See RFC 4288 for syntactical correct MIME types.
|
||||
*
|
||||
* Note that you should avoid the use of more than one enclosure in one item,
|
||||
* since some RSS aggregators don't support it.
|
||||
@ -289,8 +288,7 @@ class Item
|
||||
* @param string $type The MIME type attribute of the media.
|
||||
* @param boolean $multiple Specifies if multiple enclosures are allowed
|
||||
* @return self
|
||||
* @link https://tools.ietf.org/html/rfc6838
|
||||
* @link http://www.iana.org/assignments/media-types/media-types.xhtml
|
||||
* @link https://tools.ietf.org/html/rfc4288
|
||||
* @throws \InvalidArgumentException if the length or type parameter is invalid.
|
||||
* @throws InvalidOperationException if this method is called on RSS1 feeds.
|
||||
*/
|
||||
@ -391,7 +389,7 @@ class Item
|
||||
// Check if the given ID is an valid URI scheme (see RFC 4287 4.2.6)
|
||||
// The list of valid schemes was generated from http://www.iana.org/assignments/uri-schemes
|
||||
// by using only permanent or historical schemes.
|
||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'bb', 'cap', 'cid', 'coap', 'coap+tcp', 'coap+ws', 'coaps', 'coaps+tcp', 'coaps+ws', 'crid', 'data', 'dav', 'dict', 'dns', 'drop', 'dtn', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'grd', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipn', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'leaptofrogans', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mt', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'p1', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp (OBSOLETE)', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'upt', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'wpid', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||
$validSchemes = array('aaa', 'aaas', 'about', 'acap', 'acct', 'cap', 'cid', 'coap', 'coaps', 'crid', 'data', 'dav', 'dict', 'dns', 'example', 'fax', 'file', 'filesystem', 'ftp', 'geo', 'go', 'gopher', 'h323', 'http', 'https', 'iax', 'icap', 'im', 'imap', 'info', 'ipp', 'ipps', 'iris', 'iris.beep', 'iris.lwz', 'iris.xpc', 'iris.xpcs', 'jabber', 'ldap', 'mailserver', 'mailto', 'mid', 'modem', 'msrp', 'msrps', 'mtqp', 'mupdate', 'news', 'nfs', 'ni', 'nih', 'nntp', 'opaquelocktoken', 'pack', 'pkcs11', 'pop', 'pres', 'prospero', 'reload', 'rtsp', 'rtsps', 'rtspu', 'service', 'session', 'shttp', 'sieve', 'sip', 'sips', 'sms', 'snews', 'snmp', 'soap.beep', 'soap.beeps', 'stun', 'stuns', 'tag', 'tel', 'telnet', 'tftp', 'thismessage', 'tip', 'tn3270', 'turn', 'turns', 'tv', 'urn', 'vemmi', 'videotex', 'vnc', 'wais', 'ws', 'wss', 'xcon', 'xcon-userid', 'xmlrpc.beep', 'xmlrpc.beeps', 'xmpp', 'z39.50', 'z39.50r', 'z39.50s');
|
||||
$found = FALSE;
|
||||
$checkId = strtolower($id);
|
||||
|
||||
|
8
module/news/vendor/FeedWriter/README.md
vendored
8
module/news/vendor/FeedWriter/README.md
vendored
@ -12,11 +12,6 @@ Once a feed is fully composed with its items, the feed class can generate the ne
|
||||
|
||||
If you don't have **PHP 5.3** available on your system there is a version supporting **PHP 5.0** and above. See the `legacy-php-5.0` branch.
|
||||
|
||||
## Installation
|
||||
You can install via [Composer](https://getcomposer.org/).
|
||||
|
||||
composer require mibe/feedwriter
|
||||
|
||||
## Documentation
|
||||
|
||||
The documentation can be found in the `gh-pages` branch, or on [GitHub Pages](https://mibe.github.io/FeedWriter/).
|
||||
@ -45,6 +40,3 @@ In chronological order:
|
||||
- Pavel Khakhlou
|
||||
- Daniel
|
||||
- Tino Goratsch
|
||||
- John
|
||||
- Özgür Görgülü
|
||||
- Jan Tojnar
|
||||
|
@ -12,50 +12,32 @@
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="col6 newsDate textAlignRight">
|
||||
<!-- bloc signature -->
|
||||
<?php if (
|
||||
$this->getData(['module', $this->getUrl(0), 'config', 'showPseudo']) === true
|
||||
): ?>
|
||||
<!-- bloc signature et date -->
|
||||
<?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 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 -->
|
||||
<?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
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
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', ['margin' => 'left']); ?>
|
||||
<?php echo template::ico('pencil'); ?>
|
||||
<?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>';
|
||||
?>
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('newsConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),'posts',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?php echo template::formOpen('newsEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<div class="col2">
|
||||
<?php echo template::button('newsEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . $this->getUrl(0) . '/config',
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset7">
|
||||
<div class="col2 offset6">
|
||||
<?php echo template::button('newsEditDraft', [
|
||||
'uniqueSubmission' => true,
|
||||
'value' => helper::translate('Brouillon')
|
||||
|
@ -1,6 +1,5 @@
|
||||
<?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">
|
||||
@ -21,42 +20,22 @@
|
||||
<?php echo '<a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
|
||||
</h2>
|
||||
<div class="newsSignature">
|
||||
<!-- 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; ?>
|
||||
<?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 edition -->
|
||||
<?php if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
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', ['margin' => 'left']); ?> Éditer
|
||||
-
|
||||
<a
|
||||
href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>">
|
||||
<?php echo template::ico('pencil'); ?> Éditer
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -72,6 +51,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
<?php echo $module::$pages; ?>
|
||||
|
@ -1,40 +0,0 @@
|
||||
/**
|
||||
* 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
|
||||
});
|
@ -10,27 +10,28 @@
|
||||
<div class="col2 offset9">
|
||||
<?php echo template::submit('newsOptionSubmit'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</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 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="col6">
|
||||
<?php echo template::checkbox('newsOptionShowPseudo', true, 'Signature', [
|
||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showPseudo'])
|
||||
<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>
|
||||
<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 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">
|
||||
@ -39,12 +40,7 @@
|
||||
'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">
|
||||
<div class="col3">
|
||||
<?php echo template::select('newsOptionTimeFormat', $module::$timeFormats, [
|
||||
'label' => 'Format des heures',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||
@ -52,57 +48,42 @@
|
||||
</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">
|
||||
<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' => 'Texte de l\'étiquette RSS',
|
||||
'label' => 'Etiquette RSS',
|
||||
'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Thème'); ?></h4>
|
||||
<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'])
|
||||
'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'])
|
||||
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
@ -110,7 +91,7 @@
|
||||
'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'])
|
||||
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3">
|
||||
@ -118,13 +99,13 @@
|
||||
'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'])
|
||||
'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<div class="moduleVersion">Version n°
|
||||
<?php echo $module::VERSION; ?>
|
||||
|
@ -1,5 +1,3 @@
|
||||
# Version 2.2
|
||||
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||
# Version 2.1
|
||||
- Edition du module ou de la page impossible.
|
||||
# Version 2.0
|
||||
|
@ -16,7 +16,7 @@
|
||||
class redirection extends common
|
||||
{
|
||||
|
||||
const VERSION = '2.2';
|
||||
const VERSION = '2.1';
|
||||
const REALNAME = 'Redirection';
|
||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||
|
||||
@ -58,7 +58,7 @@ class redirection extends common
|
||||
{
|
||||
// Message si l'utilisateur peut éditer la page
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||
&& $this->getUrl(1) !== 'force'
|
||||
) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
<div class="col1">
|
||||
<?php echo template::button('redirectionConfigBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '/' . self::$siteContent,
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,7 +1,3 @@
|
||||
# Version 3.2
|
||||
- Contrôle de la variable de session liée au contenu. Evite des erreurs lorsque plusieurs onglets sont ouverts.
|
||||
# Version 3.1
|
||||
- Initialise un module installé dans une page sans avoir ouvert la page de configuration sans lancer de mise à jour.
|
||||
# Version 3.0
|
||||
- Gestion des permissions intégrée dans le module
|
||||
# Version 2.8
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user