This commit is contained in:
SylvainLelievre 2021-06-04 11:42:45 +02:00
commit dda001de7a
85 changed files with 233 additions and 389 deletions

27
.gitignore vendored
View File

@ -1,22 +1,7 @@
# Fichiers temporaires
site/tmp/*.zip
site/tmp/*.gz
site/tmp/*.png
# Sauvegardes
site/backup/*
# Fichiers de données
site/data/*.json
site/data/*.css
site/data/fr/*.json
site/data/fr/*.back
site/data/*.back
# Fichiers uploadés
site/file/source/
site/file/thumb/
site/*
# Dossiers vides dans GitHub
!.gitkeep
@ -27,18 +12,8 @@ site/file/thumb/
# Trucs
core/vendor/tinymce/link_list.json
site/tmp/.htaccess
.vscode/*
site/data/body.inc.html
site/data/head.inc.html
sitemap.xml.gz
sitemap.xml
robots.txt
site/data/journal.log
.DS_Store
site/.DS_Store
site/file/.DS_Store
site/data/es/
site/data/en/
site/data/de/
site/data/modules/*

View File

@ -13,6 +13,24 @@
- Suppression de l'option de backup individuel des fichiers de données, pour l'activer manuellement, créez un fichier vide .backup dans site/data
- Nouvelle option permettant de transférer les fichiers de sauvegarde automatiques dans le gestionnaire de fichiers.
## version 10.6.03
- Correction :
- Module actualités (news), version 3.3, le flux RSS affiche l'ensemble des articles plutôt que ceux de la page courante.
- Modifications :
- Installation : livraison des fichiers de thème du site de test dans une archive. Désormais, le dossier site ne contiendra que les fichiers de sécurité htaccess. Cette procédure permettra de ne plus différencier les archives d'installation et de mise à jour.
- Mises à jour : les mises à jour s'effectueront à partir de la forge plutôt que par le site.
## version 10.6.02
Correction :
- Bug lors du téléchargement des journaux.
## version 10.6.01
Corrections :
- Champs de formulaire, uniformisation de la hauteur (select, input, etc) identique à celle des boutons à 9px.
- Module search : texte d'aide dans la zone de saisie non pris en compte.
Modifications :
- News 3.2 : ajout au sélecteur de date d'un bouton d'effacement identique à celui du sélecteur de fichiers.
- News 3.2 : décoloration du texte, modification de l'effet blur.
## version 10.6.00
Cette version apporte aux modules une autonomie complète par rapport au noyau.

View File

@ -15,7 +15,7 @@ ZwiiCMS a été créé par un développeur de talent, [Rémi Jean](https://remij
## Téléchargement de ZwiiCMS
Pour télécharger la dernière version publiée, il faut vous rendre sur la page de téléchargement du [site](https://zwiicms.fr/telechargements)
Pour télécharger la dernière version publiée, il faut vous rendre sur la page de téléchargement du [site](https://zwiicms.fr/telechargement)
La version github est une **version de développement** qui peut encore contenir des bugs mais elle vous permet de tester les dernières nouveautés. Cette version n'est pas recommandée en production.

View File

@ -261,7 +261,7 @@ class helper {
* @return string
*/
public static function getOnlineVersion() {
return (helper::urlGetContents('http://zwiicms.fr/update/'. common::ZWII_UPDATE_CHANNEL . '/version'));
return (helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version'));
}

View File

@ -247,12 +247,18 @@ class template {
}
$html .= self::notice($attributes['id'], $notice);
// Date visible
$html .= '<div class="inputDateManagerWrapper">';
$html .= sprintf(
'<input type="text" class="datepicker %s" value="%s" %s>',
$attributes['class'],
$attributes['value'],
helper::sprintAttributes($attributes, ['class', 'value'])
);
$html .= self::button($attributes['id'] . 'Delete', [
'class' => 'inputDateDelete',
'value' => self::ico('cancel')
]);
$html .= '</div>';
// Fin du wrapper
$html .= '</div>';
// Retourne le html

View File

@ -288,6 +288,10 @@ core.start = function() {
$(".inputFileDelete").on("click", function() {
$(this).parents(".inputWrapper").find(".inputFileHidden").val("").trigger("change");
});
// Suppression de la date contenu dans le champ
$(".inputDateDelete").on("click", function() {
$(this).parents(".inputWrapper").find(".datepicker").val("").trigger("change");
});
// Confirmation de mise à jour
$("#barUpdate").on("click", function() {
return core.confirm("Effectuer la mise à jour ?", function() {

View File

@ -44,6 +44,7 @@ class common {
const ACCESS_TIMER = 1800;
// Numéro de version
const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/';
const ZWII_VERSION = '11.0.000';
const ZWII_UPDATE_CHANNEL = "v11";
@ -462,6 +463,77 @@ class common {
}
}
/**
* Sauvegarde des données
* @param array $keys Clé(s) des données
*/
public function setData($keys = []) {
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
if (!empty(self::$inputNotices)
OR empty($keys)) {
return false;
}
// Empêcher la sauvegarde d'une donnée nulle.
if (gettype($keys[count($keys) -1]) === NULL) {
return false;
}
// Descripteur
$db = $this->dataFiles[$keys[0]];
// Aiguillage
switch(count($keys)) {
case 2:
$db->set($keys[0],$keys[1], true);
break;
case 3:
$db->set($keys[0].'.'.$keys[1],$keys[2], true);
break;
case 4:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2],$keys[3], true);
break;
case 5:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3],$keys[4], true);
break;
case 6:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4],$keys[5], true);
break;
case 7:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5],$keys[6], true);
break;
case 8:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5].'.'.$keys[6],$keys[7], true );
break;
}
return true;
}
/**
* Initialisation des données
* @param array $module : nom du module à générer
* choix valides : core config user theme page module
*/
public function initData($module, $lang = 'fr', $sampleSite = false) {
// Tableau avec les données vierges
require_once('core/module/install/ressource/defaultdata.php');
// Stockage dans un sous-dossier localisé
// Le dossier de langue existe t-il ?
if (!file_exists(self::DATA_DIR . '/' . $lang)) {
mkdir (self::DATA_DIR . '/' . $lang);
}
$db = $this->dataFiles[$module];
if ($sampleSite === true) {
$db->set($module,init::$siteData[$module]);
} else {
$db->set($module,init::$defaultData[$module]);
}
$db->save;
}
/*
* Dummy function
* Compatibilité des modules avec v8 et v9
@ -883,8 +955,6 @@ class common {
* @return bool
*/
public function sendMail($to, $subject, $content, $replyTo = null) {
// Layout
ob_start();
include 'core/layout/mail.php';
@ -947,76 +1017,7 @@ class common {
}
}
/**
* Sauvegarde des données
* @param array $keys Clé(s) des données
*/
public function setData($keys = []) {
// Pas d'enregistrement lorsqu'une notice est présente ou tableau transmis vide
if (!empty(self::$inputNotices)
OR empty($keys)) {
return false;
}
// Empêcher la sauvegarde d'une donnée nulle.
if (gettype($keys[count($keys) -1]) === NULL) {
return false;
}
// Descripteur
$db = $this->dataFiles[$keys[0]];
// Aiguillage
switch(count($keys)) {
case 2:
$db->set($keys[0],$keys[1], true);
break;
case 3:
$db->set($keys[0].'.'.$keys[1],$keys[2], true);
break;
case 4:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2],$keys[3], true);
break;
case 5:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3],$keys[4], true);
break;
case 6:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4],$keys[5], true);
break;
case 7:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5],$keys[6], true);
break;
case 8:
$db->set($keys[0].'.'.$keys[1].'.'.$keys[2].'.'.$keys[3].'.'.$keys[4].'.'.$keys[5].'.'.$keys[6],$keys[7], true );
break;
}
return true;
}
/**
* Initialisation des données
* @param array $module : nom du module à générer
* choix valides : core config user theme page module
*/
public function initData($module, $lang = 'fr', $sampleSite = false) {
// Tableau avec les données vierges
require_once('core/module/install/ressource/defaultdata.php');
// Stockage dans un sous-dossier localisé
// Le dossier de langue existe t-il ?
if (!file_exists(self::DATA_DIR . '/' . $lang)) {
mkdir (self::DATA_DIR . '/' . $lang);
}
$db = $this->dataFiles[$module];
if ($sampleSite === true) {
$db->set($module,init::$siteData[$module]);
} else {
$db->set($module,init::$defaultData[$module]);
}
$db->save;
}
/**
* Effacer un dossier non vide.
@ -1338,7 +1339,7 @@ class common {
}
}
// Contrôle des options php.ini pour la mise à jour auto
if (helper::urlGetContents('http://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/version') === false) {
if (helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version') === false) {
$this->setData(['config','autoUpdate',false]);
}

View File

@ -1092,7 +1092,7 @@ input[type='password'],
.inputFile,
select,
textarea {
padding: 10px;
padding: 9px;
/* -1px à cause des bordures */
/*background: #FFF;*/
border: 1px solid #D8DFE3;
@ -1103,7 +1103,7 @@ textarea {
}
select {
padding: 7px;
padding: 9px;
}
input[type='email']:hover,
@ -1214,13 +1214,13 @@ label {
}
/* Upload de fichiers */
.inputFile {
.inputFile, .datepicker {
margin: 0;
display: inline-block;
width: 88%;
width: 88% !important;
}
.inputFileDelete {
.inputFileDelete, .inputDateDelete {
display: block;
width: 10%;
padding: 10px 0;
@ -1235,11 +1235,11 @@ label {
}
/* Empêche le débordement et les sauts de ligne */
.inputFileManagerWrapper {
.inputFileManagerWrapper, .inputDateManagerWrapper {
display: inline;
}
.inputFileManagerWrapper>.inputFile {
.inputFileManagerWrapper>.inputFile, .inputDateManagerWrapper>.inputFile {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;

View File

@ -1,22 +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-2021, Frédéric Tempez
* @license GNU General Public License, version 3
* @link http://zwiicms.fr/
*/
/**
* Éléments spécifiques
*/
/* Site */
section {
min-height: 0px;
}

View File

@ -1,27 +0,0 @@
<?php $layout = new layout($this);
$lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="<?php echo $lan;?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $layout->showMetaTitle(); ?>
<?php $layout->showMetaDescription(); ?>
<?php $layout->showMetaType(); ?>
<?php $layout->showMetaImage(); ?>
<?php $layout->showFavicon(); ?>
<?php $layout->showVendor(); ?>
<?php $layout->showStyle(); ?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/lity.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR.'custom.css'); ?>">
</head>
<body>
<?php $layout->showNotification(); ?>
<div id="site" class="container">
<section><?php $layout->showContent(); ?></section>
</div>
<?php $layout->showScript(); ?>
</body>
</html>

View File

@ -473,14 +473,13 @@ class addon extends common {
$fileName = $this->getUrl(2) . '.zip';
$this->makeZip ($fileName, $tmpFolder, []);
if (file_exists($fileName)) {
ob_start();
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName));
ob_clean();
ob_end_flush();
readfile( $fileName);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
unlink($fileName);
$this->removeDir($tmpFolder);
exit();

View File

@ -1,5 +1,9 @@
<h3>IMPORTER OU METTRE A JOUR</h3>
<p>Vous avez au préalable chargé le fichier zip du module sur votre serveur par 'Gérer les fichiers'.</p>
<p>Lors d'une mise à jour Zwii contrôle la version du module à installer, pour réinstaller un module de même numéro de version vous devez cocher 'Mise à jour forcée'.
Il est déconseillé d'installer un module plus ancien.</p>
<h3>EXPORTER IMPORTER</h3>
<p>Exporter produit une archive au nom du module contenant les pages concernées ainsi que les données et ressources utilisées par le module dans ces pages.</p>
<p>Vous pouvez vous en servir comme d'une sauvegarde partielle ou pour transférer les pages et les données du module vers un autre site.</p>
<p>Une fois le module installé l'import permet de restaurer les pages et les données sauvegardées. Vous avez au préalable transféré le fichier zip d'un export sur votre serveur par 'Gérer les fichiers'.
<p>Une fois le module installé l'import permet de restaurer les pages et les données sauvegardées. Vous devrez avoir au préalable transféré le fichier zip d'un export sur votre serveur par 'Gérer les fichiers'.
Si une page de même nom existe sur votre site vous serez invité à modifier son nom.</p>

View File

@ -662,19 +662,14 @@ class config extends common {
public function logDownload() {
$fileName = self::DATA_DIR . 'journal.log';
if (file_exists($fileName)) {
ob_start();
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName));
ob_clean();
ob_end_flush();
readfile( $fileName);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index'
]);
exit();
} else {
// Valeurs en sortie
$this->addOutput([
@ -689,6 +684,7 @@ class config extends common {
* Tableau des IP blacklistés
*/
public function blacklistDownload () {
ob_start();
$fileName = self::TEMP_DIR . 'blacklist.log';
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
file_put_contents($fileName,$d);
@ -705,17 +701,11 @@ class config extends common {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize($fileName));
ob_clean();
ob_end_flush();
readfile( $fileName);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_RAW
]);
unlink(self::TEMP_DIR . 'blacklist.log');
// Valeurs en sortie
$this->addOutput([
'title' => 'Configuration',
'view' => 'index'
]);
exit();
} else {
// Valeurs en sortie
$this->addOutput([

View File

@ -1,2 +1,10 @@
<h3>PAGES SPECIALES</h3>
En cours de rédaction.
<h3>MENTIONS LEGALES</h3>
<p>Pour faire apparaître un lien 'Mentions légales' dans le pied de page, vous sélectionnez la page puis
dans la barre d'administration vous sélectionnez 'Personnaliser les thèmes', vous cliquez sur le pied de page et vous cochez la case 'Mentions légales'.<br>
Vous pouvez personnaliser la page 'Mentions légales', accessible en choisissant cette page dans la barre d'administration, ou créer votre propre page.<br>
<a href="https://www.service-public.fr/professionnels-entreprises/vosdroits/F31228" target="_blank" rel="noopener">Ce site officiel vous indique les mentions obligatoires à y faire figurer</a></p>
<h3>RECHERCHE</h3>
<p>Pour faire apparaître un lien 'Recherche' dans le pied de page, vous procédez de manière similaire.</p>
<h3>ERREURS ET SITE EN MAINTENANCE</h3>
<p>Les pages par défaut sont 'Erreur403', 'Erreur 404' et 'Site en maintenance'. Vous pouvez les modifier, en les choisissant à partir de la barre
d'administration, ou créer vos propres pages orphelines (en édition de page sélectionnez dans le bloc 'Emplacement dans le menu' : 'Ne pas afficher').</p>

View File

@ -83,19 +83,7 @@ class install extends common {
'<strong>Identifiant du compte :</strong> ' . $this->getInput('installId') . '<br>',
null
);
// Créer les dossiers
if (!is_dir(self::FILE_DIR.'source/banniere/')) {
mkdir(self::FILE_DIR.'source/banniere/');}
if (!is_dir(self::FILE_DIR.'thumb/banniere/')) {
mkdir(self::FILE_DIR.'thumb/banniere/');
}
// Copier les fichiers
copy('core/module/install/ressource/file/source/banniere960.jpg',self::FILE_DIR.'source/banniere/banniere960.jpg');
copy('core/module/install/ressource/file/thumb/banniere960.jpg',self::FILE_DIR.'thumb/banniere/banniere960.jpg');
// Copie des icônes
copy('core/module/install/ressource/file/source/favicon.ico',self::FILE_DIR.'source/favicon.ico');
copy('core/module/install/ressource/file/source/faviconDark.ico',self::FILE_DIR.'source/faviconDark.ico');
// Configure certaines données par défaut
// Installation du site de test
if ($this->getInput('installDefaultData',helper::FILTER_BOOLEAN) === FALSE) {
$this->initData('page','fr',true);
$this->initData('module','fr',true);
@ -103,6 +91,25 @@ class install extends common {
$this->setData(['module', 'blog', 'posts', 'mon-deuxieme-article', 'userId', $userId]);
$this->setData(['module', 'blog', 'posts', 'mon-troisieme-article', 'userId', $userId]);
}
// Images exemples livrées dans tous les cas
try {
// Décompression dans le dossier de fichier temporaires
if (file_exists(self::TEMP_DIR . 'files.tar.gz')) {
unlink(self::TEMP_DIR . 'files.tar.gz');
}
if (file_exists(self::TEMP_DIR . 'files.tar')) {
unlink(self::TEMP_DIR . 'files.tar');
}
copy('core/module/install/ressource/files.tar.gz', self::TEMP_DIR . 'files.tar.gz');
$pharData = new PharData(self::TEMP_DIR . 'files.tar.gz');
$pharData->decompress();
// Installation
$pharData->extractTo(__DIR__ . '/../../../', null, true);
} catch (Exception $e) {
$success = $e->getMessage();
}
unlink(self::TEMP_DIR . 'files.tar.gz');
unlink(self::TEMP_DIR . 'files.tar');
// Stocker le dossier d'installation
$this->setData(['core', 'baseUrl', helper::baseUrl(false,false) ]);
// Créer sitemap
@ -160,7 +167,10 @@ class install extends common {
// Téléchargement
case 2:
// Téléchargement depuis le serveur de Zwii
$success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', helper::urlGetContents('https://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz')) !== false);
//$success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', helper::urlGetContents('https://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz')) !== false);
// URL sur le git
//$newVersion = helper::urlGetContents('https://zwiicms.fr/update/' . common::ZWII_UPDATE_CHANNEL . '/version');
$success = (file_put_contents(self::TEMP_DIR.'update.tar.gz', helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/update.tar.gz')) !== false);
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_JSON,
@ -246,7 +256,7 @@ class install extends common {
*/
public function update() {
// Nouvelle version
self::$newVersion = helper::urlGetContents('http://zwiicms.com/update/' . common::ZWII_UPDATE_CHANNEL . '/version');
self::$newVersion = helper::urlGetContents(common::ZWII_UPDATE_URL . common::ZWII_UPDATE_CHANNEL . '/version');
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,

View File

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

View File

@ -25,7 +25,7 @@ tinymce.init({
// Langue
language: "fr_FR",
// Plugins
plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker contextmenu fullscreen hr image imagetools link lists media paste searchreplace stickytoolbar tabfocus table template textcolor emoticons nonbreaking",
plugins: "advlist anchor autolink autoresize autosave codemirror colorpicker contextmenu fullscreen hr image link lists media paste searchreplace stickytoolbar tabfocus table template textcolor emoticons nonbreaking",
// Contenu de la barre d'outils
toolbar: "restoredraft | undo redo | formatselect bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist emoticons | table template | image media link | code fullscreen",
// Emoticons
@ -96,8 +96,10 @@ tinymce.init({
link_context_toolbar: true,
// Cache la barre de statut
statusbar: false,
// Active le copié collé à partir du Web
// Bloque le collage blob
paste_data_images: false,
// Bloque le lâché déplacé
paste_block_drop: true,
// Active le copié collé à partir du presse papier
paste_filter_drop: false,
/* Eviter BLOB à tester

View File

@ -15,7 +15,7 @@
class blog extends common {
const VERSION = '5.0';
const VERSION = '5.1';
const REALNAME = 'Blog';
const DELETE = true;
const UPDATE = '0.0';
@ -142,8 +142,8 @@ class blog extends common {
// Corps des articles
$articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
$articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC');
foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) {
if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) {
foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) {
if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) {
// Miniature
$parts = explode('/',$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']));
@ -163,11 +163,13 @@ class blog extends common {
$newsArticle->setAuthor($author,'no@mail.com');
$newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId);
$newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])));
$imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb);
if ( file_exists($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])) ) {
$imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb);
$newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb,
$imageData[0] * $imageData[1],
$imageData['mime']
);
);
}
$feeds->addItem($newsArticle);
}
}

View File

@ -4,21 +4,21 @@
<?php foreach($module::$articles as $articleId => $article): ?>
<div class="row rowArticle">
<div class="col3">
<?php
// Déterminer le nom de la miniature
$parts = explode('/',$article['picture']);
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $article['picture']);
// Créer la miniature si manquante
if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) {
$this->makeThumb( self::FILE_DIR . 'source/' . $article['picture'],
self::FILE_DIR . 'thumb/' . $thumb,
self::THUMBS_WIDTH);
}
?>
<?php if ( file_exists(self::FILE_DIR . 'source/' . $article['picture']) ): ?>
<?php // Déterminer le nom de la miniature
$parts = explode('/',$article['picture']);
$thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $article['picture']);
// Créer la miniature si manquante
if (!file_exists( self::FILE_DIR . 'thumb/' . $thumb) ) {
$this->makeThumb( self::FILE_DIR . 'source/' . $article['picture'],
self::FILE_DIR . 'thumb/' . $thumb,
self::THUMBS_WIDTH);
}
?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>" class="blogPicture">
<img src="<?php echo helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb; ?>" alt="<?php echo $article['picture']; ?>">
</a>
<?php endif;?>
</div>
<div class="col9">
<h1 class="blogTitle">

View File

@ -15,7 +15,7 @@
class news extends common {
const VERSION = '3.1';
const VERSION = '3.3';
const REALNAME = 'Actualités';
const DELETE = true;
const UPDATE = '0.0';
@ -68,10 +68,10 @@ class news extends common {
];
public static $itemsBlur = [
'100%' => 'Aucun',
'90%' => 'Faible',
'75%' => 'Modéré',
'60%' => 'Important',
'0%' => 'Aucun',
'15%' => 'Faible',
'30%' => 'Modéré',
'45%' => 'Important',
];
// Signature de l'article
@ -101,8 +101,6 @@ class news extends common {
$feeds->addGenerator();
// Corps des articles
$newsIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC');
// Articles de la première page uniquement
$newsIdsPublishedOns = array_slice($newsIdsPublishedOns, 0, $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) );
$newsIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC');
foreach($newsIdsPublishedOns as $newsId => $newsPublishedOn) {
if($newsPublishedOn <= time() AND $newsIdsStates[$newsId]) {
@ -136,10 +134,12 @@ class news extends common {
if($this->isPost()) {
// Crée la news
$newsId = helper::increment($this->getInput('newsAddTitle', helper::FILTER_ID), (array) $this->getData(['module', $this->getUrl(0)]));
$publishedOn = $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true);
$publishedOff = $this->getInput('newsAddPublishedOff' ) ? $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME) : '';
$this->setData(['module', $this->getUrl(0),'posts', $newsId, [
'content' => $this->getInput('newsAddContent', null),
'publishedOn' => $this->getInput('newsAddPublishedOn', helper::FILTER_DATETIME, true),
'publishedOff' => $this->getInput('newsAddPublishedOff', helper::FILTER_DATETIME),
'publishedOn' => $publishedOn,
'publishedOff' => $publishedOff,
'state' => $this->getInput('newsAddState', helper::FILTER_BOOLEAN),
'title' => $this->getInput('newsAddTitle', helper::FILTER_STRING_SHORT, true),
'userId' => $this->getInput('newsAddUserId', helper::FILTER_ID, true)
@ -185,8 +185,11 @@ class news extends common {
// Générer la feuille de CSS
$style = '.newsContent {height:' . $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT) . ';}';
$style .= '.newsBlur {background: linear-gradient(' . $this->getData(['theme', 'text', 'textColor']) . ' ' . $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) . ',rgba(255,255,255,0) );';
$style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}';
if ($this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) !== '100%') {
$style .= '.newsBlur {height: ' . $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) . ';}';
//$style .= '.newsBlur {background: linear-gradient(' . $this->getData(['theme', 'text', 'textColor']) . ' ' . $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) . ',rgba(255,255,255,0) );';
//$style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}';
}
// Dossier de l'instance
if (!is_dir(self::DATADIRECTORY . 'pages/' . $this->getUrl(0))) {
@ -331,7 +334,7 @@ class news extends common {
$this->deleteData(['module', $this->getUrl(0),'posts', $this->getUrl(2)]);
}
$publishedOn = $this->getInput('newsEditPublishedOn', helper::FILTER_DATETIME, true);
$publishedOff = $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME);
$publishedOff = $this->getInput('newsEditPublishedOff' ) ? $this->getInput('newsEditPublishedOff', helper::FILTER_DATETIME) : '';
$this->setData(['module', $this->getUrl(0),'posts', $newsId, [
'content' => $this->getInput('newsEditContent', null),
'publishedOn' => $publishedOn,
@ -480,6 +483,15 @@ class news extends common {
$this->setData(['module', $this->getUrl(0), 'theme', init::$defaultTheme]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
}
$versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]);
// Mise à jour 3.2
if (version_compare($versionData, '3.1', '<') ) {
$this->setData(['module',$this->getUrl(0),'theme', 'itemsBlur', '0%' ]);
// Mettre à jour la verison
$this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.2' ]);
}
}
/**
@ -508,8 +520,9 @@ class news extends common {
if ( !file_exists(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css')) {
// Générer la feuille de CSS
$style = '.newsContent {height: ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'itemsHeight' ]) .';}';
$style .= '.newsBlur {background: linear-gradient(' . $this->getData(['theme', 'text', 'textColor']) . ' ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'itemsBlur' ]) . ',rgba(255,255,255,0) );';
$style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}';
// Pas d'effet flou à l'initialisation
//$style .= '.newsBlur {background: linear-gradient(' . $this->getData(['theme', 'text', 'textColor']) . ' ' . $this->getData([ 'module', $this->getUrl(0), 'theme', 'itemsBlur' ]) . ',rgba(255,255,255,0) );';
//$style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}';
// Sauver la feuille de style
file_put_contents(self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' , $style );
// Stocker le nom de la feuille de style

View File

@ -5,10 +5,10 @@ class init extends search {
'feedsLabel' => '',
'itemsperPage' => 8,
'itemsperCol' => 12,
'versionData' => '3.0'
'versionData' => '3.2'
];
public static $defaultTheme = [
'itemsHeight' => 'auto',
'itemsBlur' => '100%'
'itemsBlur' => '0%'
];
}

View File

@ -56,7 +56,7 @@
</div>
<div class="col4">
<?php echo template::date('newsAddPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de déplublication, sélectionnez une date antérieure à la publication.',
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication',
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>

View File

@ -58,7 +58,7 @@
</div>
<div class="col4">
<?php echo template::date('newsEditPublishedOff', [
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de déplublication, sélectionnez une date antérieure à la publication.',
'help' => 'La news est consultable Jusqu\'à cette date si elle est spécifiée. Pour annuler la date de dépublication, sélectionnez une date antérieure à la publication.',
'label' => 'Date de dépublication',
'value' => $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(2), 'publishedOff'])
]); ?>

View File

@ -28,13 +28,16 @@
margin-left: 10px;
margin-bottom: 30px;
}
/*
.newsBlur {
background: linear-gradient(#333 90%,#FFF );
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}*/
width: 100%;
height: 50%;
position: absolute;
bottom: 0;
left: -20px;
z-index: 10;
backdrop-filter: blur(1px);
}
.newsSignature {

View File

@ -5,8 +5,10 @@
<h2 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo '<a href="'. helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '">' . $news['title'] . '</a>'; ?>
</h2>
<div class="newsContent newsBlur">
<div class="newsContent">
<?php echo $news['content']; ?>
<div class="newsBlur">
</div>
</div>
<div class="newsSignature">
<i class="far fa-calendar-alt"></i>
@ -36,7 +38,7 @@
<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' />
<?php
<?php
echo '<p>' . $this->getData(['module',$this->getUrl(0), 'config', 'feedsLabel']) . '</p>' ;
?>
</a>

View File

@ -104,6 +104,8 @@ class search extends common {
// Données de thème
$this->setData(['module', $this->getUrl(0), 'theme',init::$defaultTheme ]);
$this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . 'pages/' . $this->getUrl(0) . '/theme.css' ]);
// Recharger la page pour éviter une config vide
header("Refresh:0");
}
// Dossier de l'instance
@ -120,6 +122,7 @@ class search extends common {
// Stocker le nom de la feuille de style
$this->setData(['module', $this->getUrl(0) , 'theme', 'style', $fileCSS]);
}
}

View File

@ -4,7 +4,7 @@
<div class="row">
<div class="col9 verticalAlignMiddle">
<?php echo template::text('searchMotphraseclef', [
'placeholder' => isset($_COOKIE['ZWII_I18N_SITE'] ) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']):'Un ou plusieurs mots clef séparés par un espace',
'placeholder' => $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'config', 'placeHolder']):'Un ou plusieurs mots clef séparés par un espace',
'value' => $module::$motclef
]); ?>
</div>

View File

@ -1 +0,0 @@
.newsContent {height:200px;}

View File

@ -1 +0,0 @@
.newsContent {height:200px;}.newsBlur {background: linear-gradient(#333 90%,rgba(255,255,255,0) ); background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}

View File

@ -1 +0,0 @@
.newsContent {height:auto;}.newsBlur {background: linear-gradient(rgba(255, 255, 255, 1) 100%,rgba(255,255,255,0) ); background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}

View File

@ -1 +0,0 @@
.keywordColor {background:rgba(1, 41, 229, 1);}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 937 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -1,34 +0,0 @@
/google desktop|bot|spider|crawler|yahoo|findlinks|
search|;anonymous\.|alef\/|amagit|
answerbus|appie |appengine-google|apple(syndication|-pubsub)|ask jeeves|
barkrowler|berlin-fu-cow|biglotron|binlar|blog(dimension|lines)|
book(dog|mark)|bubing|butterfly|c4pc|caretcursor|
charlotte|csci_|ccubee|ce-preload|checker|
covario|crawl(y| annu)|curl\/|custo |darxi|
datacha0s|daumoa|dailyperfect|del\.icio\.us\b|depspid|
developers\.google\.com\/\+\/web\/snippet\/|digger|earthcom|ejupiter|ets v5|
europarchive|extractor|facebookexternalhit|fast[ mb-]|favorg|
feed(burner|fetcher)|(\b|c)fetch(\b|p|e)|finder|fleck|flyindex|
forvohun|funnelback|gigablastopensource|gnomit|goldfire server|
google-site(maps|-verification)|google-structureddatatestingtool|google (web preview|favicon)|grub|gt::www\/1\.02|
helix|heritrix|htdig|httping v2.5|httrack|
ia_archiver|ichiro|ina dlweb|indocrew|integromedb|
internetseer|interseek|ip\*works|jakarta|java\/|
l\.webis|larbin|libwww-p|link(dex| check(er)?|aider|fluence)|ltx|
lwp|mail\.ru|mama (casper|cyber)|mediapartners|metaspinner|
microsoft data access|minirank|morfeus |\+msie\+6\.0|msnptc|
net(sprint|vibes )|newsg8|newt activex|ng\/2|nnn\/ttt|
nutch(-|\d)|\bodp\b|oneriot|ozelot|(page_|slurpy )verifier|
page(bull|peeker)|panopta\.com|panscient|pflab|^php(\/| v)|
picmole|pi-?monster|pompos|powermarks|program shareware|
python|quantcast|qwantify|robozilla|(aide|magpie| )rss( |\/)|
rssingbot|rtgi|sagool|sbider|scooter|
scoutjet|scrapy|scrubby|shelob|silk|
siteexplorer|(sky|synaptic)walker|sohu |survey|sygol|
synapse|szukaj|t-h-u-n-d-e-r-s-t-o-n-e|tagyu|telnet0.|
\btest(\b|_)|tfc |theophrastus|thumb|twitturl|
unicorn|urlbase|vagabondo|validat(o|eu)r|voltron|
voracious|voyager\/|vse|wauuu|web( ?index|cow|moni|capture|pix|copier|stripper|corp|scan|mastercoffee|-sniffer)|
wget|wwwster|wysigot|xenu|xirq|
yacy|yandex|yellowjacket|yeti|yoono|
zion\/|^(dcs|mozilla\/5\.0|msie 6\.0|teoma|megaindex)$/i

View File

@ -1 +0,0 @@
/pages_stat|page-a-exclure/i

View File

@ -1,5 +0,0 @@
/votre_IP1|
votre_IP2|
exemple|
255\.255\.255\.255|
/

View File

@ -1,10 +0,0 @@
# Bloque l'accès aux données
<Files *.json>
Order deny,allow
Deny from all
</Files>
# Bloque l'accès htaccess
<Files .htaccess>
Order deny,allow
Deny from all
</Files>

View File

@ -1,10 +0,0 @@
# Bloque l'accès aux données
<Files *.json>
Order deny,allow
Deny from all
</Files>
# Bloque l'accès htaccess
<Files .htaccess>
Order deny,allow
Deny from all
</Files>

View File

@ -1,59 +0,0 @@
fr,français*
en,anglais*
de,allemand*
pt,portugais*
it,italien*
es,espagnol*
da,danois*
ca,catalan*
br,breton*
co,corse*
oc,occitan*
an,aragonais*
eo,esperanto*
ar,arabe*
bg,bulgare*
be,biélorusse*
bs,bosnien*
cs,tchèque*
cy,gallois*
el,grec*
et,estonien*
eu,basque*
fi,finois*
fo,féroïen*
ga,irlandais*
gd,écossais*
gl,galicien*
he,hébreu*
hi,hindi*
hr,croate*
hu,hongrois*
hy,arménien*
is,islandais*
ja,japonais*
ka,géorgien*
kl,groenlandais*
la,latin*
lb,luxembourgeois*
lt,lituanien*
lv,letton*
mk,macédonien*
mo,moldave*
no,norvégien*
nb,norvégien*
nn,norvégien*
nl,néerlandais*
pl,polonais*
ro,roumain*
ru,russe*
sc,sarde*
sh,serbo-croate*
sk,slovaque*
sl,slovène*
sq,albanais*
sr,serbe*
sv,suédois*
tr,turque*
uk,ukrainien*
zh,chinois

View File

@ -1,12 +0,0 @@
firefox,Firefox*
firebird,Firebird*
msie,Internet Explorer*
microsoft internet explorer,Internet Explorer*
opera,Opera*opr,Opera*
ucbrowser,UC Browser*
chromium,Chromium*
chrome,Chrome*
safari,Safari*
edge,Edge*
trident,Trident Internet Explorer*
ne_rien_ecrire,dessous

View File

@ -1,12 +0,0 @@
android 4,Android 4*
android 5,Android 5*android 6,Android 6*android 7,Android 7*android 8,Android 8*
android 9,Android 9*android 10,Android 10*android 11,Android 11*
android,Android*
linux,Linux*
cros,Chrome OS*
windows nt 5.1,Windows XP*windows nt 5.2,Windows XP 64*windows nt 6.0,Windows Vista.1*windows nt 6.1,Windows 7*
windows nt 6.2,Windows 8*windows nt 6.3,Windows 8.1*windows nt 10.0,Windows 10*
win,Windows*
ipad,Ipad Apple*iphone, Iphone Apple*mac os x,Apple Macintosh Mac OS X*
mac,Apple Macintosh*
ne_rien_ecrire,dessous

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 902 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB