diff --git a/CHANGES.md b/CHANGES.md index 1fdfabb8..43ae8d78 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,15 @@ # Changelog ## version 10.4.00 +Corrections : + - Bug de pages non accessibles dans le menu suite à la création d'entrées fantômes dans le fichier de données de modules. + - Nettoyage du fichiers des données de modules des entrées fantômes. + - Thème : déformation des images en arrière-plan dans les modes responsives cover et contain lorsque la longueur de la page change. L'image en arrière-plan est désormais placée dans la balise html et l'option fixe s'active lorsque cover ou contain sont sélectionnés. + - Thème : déformation du sélecteur de fichiers dans certains formats de page. + - Module Form : mauvais affichage du guillemet et de l'apostrophe dans les noms des champs lors de l'édition. + - Thème : faille CSRF, protection de la réinitialisation des fichiers de thème. - Modifications : + - Filtrage des URL générées par facebook (FBCLID) occasionnant une erreur 404 - Captcha arithmétique, activation recommandée dans la configuration. - Module User - Pour les articles de blog et de news, choix de la signature, nom+prenom ; nom+prenom ; id ; pseudo @@ -15,9 +23,9 @@ - Approbation des commentaires - Gestion des thèmes : - Bouton de réinitialisation avec confirmation - - Traduction automatique dans la langue du navigateur. - Amélioration de la structure du flux RSS. + ## Version 10.3.13 Modifications : - Système de données (JsonDB) : diff --git a/core/core.php b/core/core.php index 95995258..3f47ba4d 100755 --- a/core/core.php +++ b/core/core.php @@ -44,7 +44,7 @@ class common { const ACCESS_TIMER = 1800; // Numéro de version - const ZWII_VERSION = '10.4.00.013'; + const ZWII_VERSION = '10.4.00.015'; const ZWII_UPDATE_CHANNEL = "v10"; public static $actions = []; @@ -192,10 +192,6 @@ class common { $this->input['_COOKIE'] = $_COOKIE; } - // Déterminer le dossier de langues - if (isset($_POST['ZWII_USER_I18N'])) { - self::$i18nCurrent = $_POST['ZWII_USER_I18N']; - } // Instanciation de la classe des entrées / sorties // Récupère les descripteurs @@ -236,30 +232,6 @@ class common { $this->user = $this->getData(['user', $this->getInput('ZWII_USER_ID')]); } - // Traduction du site avec le script Google - if ( $this->getData(['config','translate','scriptGoogle'])) { - // Lire la langue stockée dans le cookie (choix manuel) - if ( isset($_COOKIE['ZWII_USER_I18N']) ) { - $lan_cookie = $_COOKIE['ZWII_USER_I18N']; - } - // Lire la langue du navigateur - if ( $this->getData(['config','translate','autoDetect'])) { - $lan_browser = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); - } - - // Priorité : choix manuel - navigateur - fr - $lan = isset($lan_cookie) ? $lan_cookie : (isset($lan_browser) ? $lan_browser : 'fr'); - - // Changer la locale - if ( $lan !== 'fr') { - setlocale (LC_TIME, $lan . '_' . strtoupper ($lan) ); - // Charge la librairie Google Translate - setrawcookie("googtrans", '/fr/'. $lan, time() + 3600, helper::baseUrl()); - } else { - setrawcookie("googtrans", '/fr/fr', time() + 3600, helper::baseUrl()); - } - } - // Construit la liste des pages parents/enfants if($this->hierarchy['all'] === []) { $pages = helper::arrayCollumn($this->getData(['page']), 'position', 'SORT_ASC'); @@ -561,16 +533,7 @@ class common { // Une partie de l'url else { $url = explode('/', $this->url); - if (array_key_exists($key, $url) ) { - if (strpos($url[$key],'fbclid=') === false) { - $result = $url[$key]; - } else { - $result = $key === 0 ? $this->getData(['config','homePageId']) : ''; - } - } else { - $result = null; - } - return $result; + return array_key_exists($key, $url) ? $url[$key] : null; } } @@ -1536,12 +1499,8 @@ class common { foreach ($pageList as $parentKey => $parent) { //La page est un blog if ($this->getData(['page',$parent,'moduleId']) === 'blog' ) { - //echo "
".$parent;
 					$articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $parent, 'posts']), 'publishedOn', 'SORT_DESC'));
-					//var_dump($articleIds);
 					foreach ($articleIds as $key => $article) {
-						//echo $article;
-						//echo "

"; // Droits les deux groupes $this->setData(['module', $parent, 'posts', $article,'editConsent', 3]); // Limite de taille 500 @@ -1579,13 +1538,29 @@ class common { $path = realpath('site/data'); foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) { - echo "$filename
"; if (strpos($filename,'back.json')) { rename($filename, str_replace('back.json','backup.json',$filename)); } } } + // Supprimer les fichiers CSS devenus inutiles du module search + if (file_exists('module/search/ressource/theme.css') ) + unlink('module/search/ressource/theme.css'); + if (file_exists('module/search/ressource/vartheme.css') ) + unlink('module/search/ressource/vartheme.css'); + $this->deleteData(['theme','search','keywordColor']); + + // Nettoyer les modules avec des données null + + $modules = $this->getData(['module']); + foreach($modules as $key => $value) { + if (is_null($value) ) { + unset($modules[$key]); + } + } + $this->setData (['module',$modules]); + $this->setData(['core', 'dataVersion', 10400]); /** @@ -1672,20 +1647,27 @@ class core extends common { $css = '/*' . md5(json_encode($this->getData(['theme']))) . '*/'; // Import des polices de caractères $css .= '@import url("https://fonts.googleapis.com/css?family=' . $this->getData(['theme', 'text', 'font']) . '|' . $this->getData(['theme', 'title', 'font']) . '|' . $this->getData(['theme', 'header', 'font']) . '|' . $this->getData(['theme', 'menu', 'font']) . '");'; - // Fond du site + // Fond du body $colors = helper::colorVariants($this->getData(['theme', 'body', 'backgroundColor'])); - $css .= 'body,div.mce-edit-area{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; - // Fond TinyMCe - $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ' !important}'; + // Body + $css .= 'body{font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; if($themeBodyImage = $this->getData(['theme', 'body', 'image'])) { - $css .= 'body,div.mce-edit-area{background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; - $css .= 'div.mce-edit-area{background-image:url("../file/source/' . $themeBodyImage . '") !important;background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; + // Image dans html pour éviter les déformations. + $css .= 'html{background-image:url("../file/source/' . $themeBodyImage . '");background-position:' . $this->getData(['theme', 'body', 'imagePosition']) . ';background-attachment:' . $this->getData(['theme', 'body', 'imageAttachment']) . ';background-size:' . $this->getData(['theme', 'body', 'imageSize']) . ';background-repeat:' . $this->getData(['theme', 'body', 'imageRepeat']) . '}'; + // Couleur du body transparente + $css .= 'body{background-color: rgba(0,0,0,0)}'; + } else { + // Pas d'image couleur du body + $css .= 'html{background-color:' . $colors['normal'] . ';}'; } // Icône BacktoTop $css .= '#backToTop {background-color:' .$this->getData(['theme', 'body', 'toTopbackgroundColor']). ';color:'.$this->getData(['theme', 'body', 'toTopColor']).';}'; // Site $colors = helper::colorVariants($this->getData(['theme', 'text', 'linkColor'])); $css .= 'a{color:' . $colors['normal'] . '}'; + // Fond TinyMCe + $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ' !important}'; + $css .= 'div.mce-edit-area{background-color:' . $colors['normal'] . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'text', 'font'])) . '",sans-serif}'; //$css .= 'a:hover:not(.inputFile, button){color:' . $colors['darken'] . '}'; $css .= 'body,.row > div{font-size:' . $this->getData(['theme', 'text', 'fontSize']) . '}'; $css .= 'body{color:' . $this->getData(['theme', 'text', 'textColor']) . '}'; @@ -1937,7 +1919,7 @@ class core extends common { $access = false; } } - // Empêcher l'accès aux page désactivée par URL directe + // Empêcher l'accès aux pages désactivées par URL directe if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) OR ( @@ -2188,21 +2170,6 @@ class core extends common { } } - // Chargement de la librairie googtrans - // Le multi langue est actif - if ($this->getData(['config','translate','scriptGoogle']) === true ) { - // la traduction auto est active - if ( $this->getData(['config','translate','autoDetect']) === true - // Cas des pages d'administration - AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') - OR ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - AND $this->getData(['config','translate','admin']) === true ) - ) { - $this->addOutput([ - 'vendor' => array_merge($this->output['vendor'], ['i18n']) - ]); - } - } // Erreurs if($access === 'login') { http_response_code(302); @@ -2339,26 +2306,6 @@ class layout extends common { echo $this->core->output['content']; - /** - * Affiche les crédits, conditions requis : - * La traduction est active et le site n'est pas en français. - * La fonction est activée. - */ - - if ( ( - ( $this->getData(['config','translate','scriptGoogle']) === true - AND substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) !== 'fr' - ) - OR ( isset($_COOKIES['ZWII_USER_I18N']) - AND array_key_exists($_COOKIES['ZWII_USER_I18N'],$this->i18nList - AND $_COOKIES['ZWII_USER_I18N'] !== 'fr' ) - ) - ) - AND $this->getData(['config','translate','showCredits']) === true - ) - { - echo '

'; - } } @@ -3047,20 +2994,4 @@ class layout extends common { } } } - /** - * Affiche le cadre avec les drapeaux - */ - public function showi18n() { - if ( $this->getData(['config','translate','scriptGoogle']) === true ) { - echo '
'; - } - } } diff --git a/core/layout/common.css b/core/layout/common.css index d96e1334..3a7f49da 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -1158,10 +1158,14 @@ textarea { } label { - display: inline-block; + display: block; margin-bottom: 4px; } +.captcha label { + display:inline-block; +} + /* Simule le padding des cols pour les inputs en dehors des cols */ :not([class^="col"])>.inputWrapper { padding: 10px 0; diff --git a/core/layout/main.php b/core/layout/main.php index df3c1624..fb3eacfb 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -60,7 +60,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?> getData(['theme', 'header', 'position']) === 'body'): ?>
- showi18n();?> + showi18n();?> getData(['theme','header','linkHomePage'])){ echo "" ;} ?> @@ -154,7 +154,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
- showi18n();?> + showi18n();?> ' . PHP_EOL . "\tRewriteEngine on" . PHP_EOL . - "\tRewriteCond %{QUERY_STRING} ^(.*)&?fbclid=[^&]+&?(.*)$ [NC]". PHP_EOL . - "\tRewriteRule ^/?(.*)$ /$1?%1%2 [R=301,L]". PHP_EOL . "\tRewriteBase " . helper::baseUrl(false, false) . PHP_EOL . "\tRewriteCond %{REQUEST_FILENAME} !-f" . PHP_EOL . "\tRewriteCond %{REQUEST_FILENAME} !-d" . PHP_EOL . diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index c6ef26dd..1993a80c 100755 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -781,17 +781,7 @@ class init extends common { 'values' => '' ] ] - ], - 'locale' => [ - 'homePageId' => 'accueil', - 'page302' => 'erreur302', - 'page403' => 'erreur403', - 'page404' => 'erreur404', - 'legalPageId' => 'mentions-legales', - 'searchPageId' => 'recherche', - 'metaDescription' => 'Zwii est un CMS sans base de données qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.', - 'title' => 'Votre site en quelques clics !' - ], + ] ] ]; } diff --git a/core/module/page/page.php b/core/module/page/page.php index 53372e8a..88e6b37f 100755 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -317,8 +317,10 @@ class page extends common { $this->setData(['page', $childrenPageId, 'parentPageId', $pageId]); } // Change l'id de page dans les données des modules - $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]); - $this->deleteData(['module', $this->getUrl(2)]); + if ($this->getData(['module', $this->getUrl(2)]) !== null ) { + $this->setData(['module', $pageId, $this->getData(['module', $this->getUrl(2)])]); + $this->deleteData(['module', $this->getUrl(2)]); + } // Si la page correspond à la page d'accueil, change l'id dans la configuration du site if($this->getData(['locale', 'homePageId']) === $this->getUrl(2)) { $this->setData(['locale', 'homePageId', $pageId]); diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index a1820966..ff7c231e 100755 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -533,31 +533,43 @@ class theme extends common { * Réinitialisation de la personnalisation avancée */ public function reset() { - // Supprime le fichier de personnalisation avancée - $redirect =''; - switch ($this->getUrl(2)) { - case 'admin': - $this->initData('admin'); - $redirect = helper::baseUrl() . 'theme/admin'; - break; - case 'manage': - $this->initData('theme'); - $redirect = helper::baseUrl() . 'theme/manage'; - break; - case 'custom': - unlink(self::DATA_DIR.'custom.css'); - $redirect = helper::baseUrl() . 'theme/advanced'; - break; - default : - $redirect = helper::baseUrl() . 'theme'; - } + // $url prend l'adresse sans le token + $url = explode('&',$this->getUrl(2)); - // Valeurs en sortie - $this->addOutput([ - 'notification' => 'Réinitialisation effectuée', - 'redirect' => $redirect, - 'state' => true - ]); + if ( isset($_GET['csrf']) + AND $_GET['csrf'] === $_SESSION['csrf'] + ) { + // Réinitialisation + $redirect =''; + switch ($url[0]) { + case 'admin': + $this->initData('admin'); + $redirect = helper::baseUrl() . 'theme/admin'; + break; + case 'manage': + $this->initData('theme'); + $redirect = helper::baseUrl() . 'theme/manage'; + break; + case 'custom': + unlink(self::DATA_DIR.'custom.css'); + $redirect = helper::baseUrl() . 'theme/advanced'; + break; + default : + $redirect = helper::baseUrl() . 'theme'; + } + + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Réinitialisation effectuée', + 'redirect' => $redirect, + 'state' => true + ]); + } else { + // Valeurs en sortie + $this->addOutput([ + 'notification' => 'Jeton incorrect' + ]); + } } diff --git a/core/module/theme/view/admin/admin.php b/core/module/theme/view/admin/admin.php index 134e4bba..46c20ff3 100755 --- a/core/module/theme/view/admin/admin.php +++ b/core/module/theme/view/admin/admin.php @@ -16,7 +16,7 @@
'buttonRed', - 'href' => helper::baseUrl() . 'theme/reset/admin', + 'href' => helper::baseUrl() . 'theme/reset/admin' . '&csrf=' . $_SESSION['csrf'], 'value' => 'Réinitialiser', 'ico' => 'cancel' ]); ?> diff --git a/core/module/theme/view/advanced/advanced.php b/core/module/theme/view/advanced/advanced.php index c13fbd91..f1895306 100755 --- a/core/module/theme/view/advanced/advanced.php +++ b/core/module/theme/view/advanced/advanced.php @@ -10,7 +10,7 @@
helper::baseUrl() . 'theme/reset/custom', + 'href' => helper::baseUrl() . 'theme/reset/custom' . '&csrf=' . $_SESSION['csrf'], 'class' => 'buttonRed', 'ico' => 'cancel', 'value' => 'Réinitialiser' diff --git a/core/module/theme/view/body/body.js.php b/core/module/theme/view/body/body.js.php index 4b46e333..19a42926 100755 --- a/core/module/theme/view/body/body.js.php +++ b/core/module/theme/view/body/body.js.php @@ -21,15 +21,25 @@ $(document).ready(function(){ * Aperçu en direct */ $("input, select").on("change", function() { + + // Option fixe pour contain et cover + var themeBodyImageSize = $("#themeBodyImageSize").val(); + + if(themeBodyImageSize === "cover" || + themeBodyImageSize === "contain" ) { + $("#themeBodyImageAttachment").val("fixed"); + } + // Couleur du fond - var css = "body{background-color:" + $("#themeBodyBackgroundColor").val() + "}"; + var css = "html{background-color:" + $("#themeBodyBackgroundColor").val() + "}"; // Image du fond var themeBodyImage = $("#themeBodyImage").val(); if(themeBodyImage) { - css += "body{background-image:url('site/file/source/" + themeBodyImage + "');background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; + css += "html{background-image:url('site/file/source/" + themeBodyImage + "');background-repeat:" + $("#themeBodyImageRepeat").val() + ";background-position:" + $("#themeBodyImagePosition").val() + ";background-attachment:" + $("#themeBodyImageAttachment").val() + ";background-size:" + $("#themeBodyImageSize").val() + "}"; + css += "html{background-color:rgba(0,0,0,0);}"; } else { - css += "body{background-image:none}"; + css += "html{background-image:none}"; } css += '#backToTop {background-color:' + $("#themeBodyToTopBackground").val() + ';color:' + $("#themeBodyToTopColor").val() + ';}'; diff --git a/core/module/theme/view/manage/manage.php b/core/module/theme/view/manage/manage.php index 68de0814..42658cd9 100755 --- a/core/module/theme/view/manage/manage.php +++ b/core/module/theme/view/manage/manage.php @@ -11,7 +11,7 @@
'buttonRed', - 'href' => helper::baseUrl() . 'theme/reset/manage', + 'href' => helper::baseUrl() . 'theme/reset/manage' . '&csrf=' . $_SESSION['csrf'], 'value' => 'Réinitialiser', 'ico' => 'cancel' ]); ?> diff --git a/module/form/form.php b/module/form/form.php index 955f40f0..3b17c1f4 100755 --- a/module/form/form.php +++ b/module/form/form.php @@ -32,7 +32,7 @@ class form extends common { public static $pagination; - const FORM_VERSION = '2.5'; + const FORM_VERSION = '2.6'; // Objets const TYPE_MAIL = 'mail'; @@ -94,7 +94,7 @@ class form extends common { $inputs = []; foreach($this->getInput('formConfigPosition', null) as $index => $position) { $inputs[] = [ - 'name' => $this->getInput('formConfigName[' . $index . ']'), + 'name' => htmlspecialchars_decode($this->getInput('formConfigName[' . $index . ']'),ENT_QUOTES), 'position' => helper::filter($position, helper::FILTER_INT), 'required' => $this->getInput('formConfigRequired[' . $index . ']', helper::FILTER_BOOLEAN), 'type' => $this->getInput('formConfigType[' . $index . ']'), diff --git a/module/search/ressource/defaultdata.php b/module/search/ressource/defaultdata.php index 4eb9eaa6..d9d5a2a2 100755 --- a/module/search/ressource/defaultdata.php +++ b/module/search/ressource/defaultdata.php @@ -1,14 +1,10 @@ 'rgba(229, 229, 1, 1)' - ]; -} -class data extends search { +class init extends search { public static $defaultData = [ 'previewLength' => 100, 'resultHideContent' => false, 'placeHolder' => 'Un ou plusieurs mots-clés séparés par un espace ou par +', - 'submitText' => 'Rechercher' + 'submitText' => 'Rechercher', + 'keywordColor' => 'rgba(229, 229, 1, 1)' ]; } \ No newline at end of file diff --git a/module/search/ressource/theme.css b/module/search/ressource/theme.css deleted file mode 100755 index 63462103..00000000 --- a/module/search/ressource/theme.css +++ /dev/null @@ -1,11 +0,0 @@ -.searchTitle { - font: caption; - font-style: italic; - margin-left: 1em; -} -.searchKeyword { - background: var(--keywordColor); -} -.searchResult { - margin: .3em 0 .3em 1em; -} \ No newline at end of file diff --git a/module/search/ressource/vartheme.css b/module/search/ressource/vartheme.css deleted file mode 100755 index 9a5c4cdb..00000000 --- a/module/search/ressource/vartheme.css +++ /dev/null @@ -1,3 +0,0 @@ -.searchKeyword { - --keywordColor: #keywordColor#; -} diff --git a/module/search/search.php b/module/search/search.php index 4ad083e5..f84dfdeb 100755 --- a/module/search/search.php +++ b/module/search/search.php @@ -38,37 +38,31 @@ class search extends common { 400 => '400 caractères', ]; - // Message par défaut - public static $messagePlaceHolder = 'Un ou plusieurs mots-clés entre des espaces ou des guillemets'; - public static $messageButtontext = 'Rechercher'; - - const SEARCH_VERSION = '1.1'; + const SEARCH_VERSION = '1.2'; // Configuration vide public function config() { - // Initialisation des données de thème de la galerie dasn theme.json + // Création des valeurs de réglage par défaut + if ( $this->getData(['module', $this->getUrl(0)]) === null ) { + require_once('module/search/ressource/defaultdata.php'); + $this->setData(['module', $this->getUrl(0), init::$defaultData]); + } + if($this->isPost()) { // Soumission du formulaire - $this->setData(['theme', 'search', [ - 'keywordColor' => $this->getInput('searchKeywordColor') - ]]); $this->setData(['module', $this->getUrl(0), [ 'submitText' => $this->getInput('searchSubmitText'), 'placeHolder' => $this->getInput('searchPlaceHolder'), 'resultHideContent' => $this->getInput('searchResultHideContent',helper::FILTER_BOOLEAN), - 'previewLength' => $this->getInput('searchPreviewLength',helper::FILTER_INT) + 'previewLength' => $this->getInput('searchPreviewLength',helper::FILTER_INT), + 'keywordColor' => $this->getInput('searchKeywordColor') ]]); - // Création des fichiers CSS - $content = file_get_contents('module/search/ressource/vartheme.css'); - $themeCss = file_get_contents('module/search/ressource/theme.css'); - // Injection des variables - $content = str_replace('#keywordColor#',$this->getinput('searchKeywordColor'),$content ); - $success = file_put_contents('module/search/view/index/index.css',$content . $themeCss); + // Valeurs en sortie, affichage du formulaire $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(), - 'notification' => $success !== FALSE ? 'Modifications enregistrées' : 'Modifications non enregistées !', + 'notification' => $success !== FALSE ? 'Modifications enregistrées' : 'Modifications non enregistrées !', 'state' => $success !== FALSE ]); @@ -84,15 +78,11 @@ class search extends common { } public function index() { - // Création des valeurs de thème par défaut - if ( $this->getData(['theme', 'search']) === null ) { - require_once('module/search/ressource/defaultdata.php'); - $this->setData(['theme', 'search', theme::$defaultData]); - } + // Création des valeurs de réglage par défaut - if ( $this->getData(['module', 'search']) === null ) { + if ( $this->getData(['module', $this->getUrl(0)]) === null ) { require_once('module/search/ressource/defaultdata.php'); - $this->setData(['module', $this->getUrl(0), data::$defaultData]); + $this->setData(['module', $this->getUrl(0), init::$defaultData]); } if($this->isPost()) { @@ -241,7 +231,7 @@ class search extends common { // Découper l'aperçu $t = substr($contenu, $d ,$this->getData(['module',$this->getUrl(0),'previewLength'])); // Applique une mise en évidence - $t = preg_replace($keywords, '\1',$t); + $t = preg_replace($keywords, '\1',$t); // Sauver résultat $resultat .= '

'.$t.'...

'; $resultat .= '

' . count($matches[0]) . (count($matches[0]) === 1 ? ' correspondance

' : ' correspondances

'); diff --git a/module/search/view/config/config.php b/module/search/view/config/config.php index 8280ee9a..37a60653 100755 --- a/module/search/view/config/config.php +++ b/module/search/view/config/config.php @@ -59,7 +59,7 @@ 'class' => 'colorPicker', 'help' => 'Le curseur horizontal règle le niveau de transparence, le placer tout à la gauche pour un surlignement invisible.', 'label' => 'Surlignement', - 'value' => $this->getData(['theme', 'search', 'keywordColor']) + 'value' => $this->getData(['module', $this->getUrl(0), 'keywordColor']) ]); ?>

diff --git a/module/search/view/index/index.css b/module/search/view/index/index.css index 8e5dc743..f3b5d574 100755 --- a/module/search/view/index/index.css +++ b/module/search/view/index/index.css @@ -1,14 +1,10 @@ -.searchKeyword { - --keywordColor: rgba(229, 229, 1, 1); -} + .searchTitle { font: caption; font-style: italic; margin-left: 1em; } -.searchKeyword { - background: var(--keywordColor); -} + .searchResult { margin: .3em 0 .3em 1em; } \ No newline at end of file diff --git a/module/search/view/index/index.php b/module/search/view/index/index.php index 4399c591..5fa91623 100755 --- a/module/search/view/index/index.php +++ b/module/search/view/index/index.php @@ -4,13 +4,13 @@
$this->getData(['module', $this->getUrl(0), 'placeHolder']) ? $this->getData(['module', $this->getUrl(0), 'placeHolder']) : $module::$messagePlaceHolder, + 'placeholder' => $this->getData(['module', $this->getUrl(0), 'placeHolder']), 'value' => $module::$motclef ]); ?>
$this->getData(['module', $this->getUrl(0), 'submitText']) ? $this->getData(['module', $this->getUrl(0), 'submitText']) : $module::$messageButtontext + 'value' => $this->getData(['module', $this->getUrl(0), 'submitText']) ]); ?>
diff --git a/site/data/.htaccess b/site/data/.htaccess index ff0d5418..db3789af 100755 --- a/site/data/.htaccess +++ b/site/data/.htaccess @@ -1,5 +1,5 @@ # Bloque l'accès aux données - + Order deny,allow Deny from all - \ No newline at end of file + \ No newline at end of file