body et head en php

This commit is contained in:
Deltacms 2023-09-18 09:00:34 +02:00
parent ebe99bf9da
commit 892db37aab
7 changed files with 23 additions and 9 deletions

View File

@ -14,7 +14,9 @@
- Blog 6.8 et News 4.7 : les dates s'adaptent automatiquement à la traduction rédigée, - Blog 6.8 et News 4.7 : les dates s'adaptent automatiquement à la traduction rédigée,
- Blog 6.8 et News 4.7 : amélioration de la navigation entre les articles, - Blog 6.8 et News 4.7 : amélioration de la navigation entre les articles,
- Theme / Footer : amélioration, 'Qui est en ligne ?' s'affiche dans la langue de rédaction du site avec les labels réglables dans Configuration / Localisation. - Theme / Footer : amélioration, 'Qui est en ligne ?' s'affiche dans la langue de rédaction du site avec les labels réglables dans Configuration / Localisation.
- Scripts : les fichiers body.inc.html et head.inc.html sont renommés body.inc.php et head.inc.php
- Correction : - Correction :
- Langues : la langue originale de rédaction du site choisie à l'installation peut être modifiée
- Slider 4.8 / Configuration : les liens sur les images étaient modifiés au changement de l'ordre des pages. - Slider 4.8 / Configuration : les liens sur les images étaient modifiés au changement de l'ordre des pages.
## Version 4.4.10 de Deltacms ## Version 4.4.10 de Deltacms

View File

@ -1255,8 +1255,8 @@ class common {
in_array($this->getUrl(1),$pattern) ) in_array($this->getUrl(1),$pattern) )
) { // Pleine page en mode configuration ) { // Pleine page en mode configuration
$this->showContent(); $this->showContent();
if (file_exists(self::DATA_DIR . 'body.inc.html')) { if (file_exists(self::DATA_DIR . 'body.inc.php')) {
include( self::DATA_DIR . 'body.inc.html'); include( self::DATA_DIR . 'body.inc.php');
} }
if($this->getData(['config', 'statislite', 'enable'])){ if($this->getData(['config', 'statislite', 'enable'])){
if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php"; if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php";
@ -1290,8 +1290,8 @@ class common {
*/ */
echo '<div class="'. $content . '" id="contentSite">'; echo '<div class="'. $content . '" id="contentSite">';
$this->showContent(); $this->showContent();
if (file_exists(self::DATA_DIR . 'body.inc.html')) { if (file_exists(self::DATA_DIR . 'body.inc.php')) {
include(self::DATA_DIR . 'body.inc.html'); include(self::DATA_DIR . 'body.inc.php');
} }
if($this->getData(['config', 'statislite', 'enable'])){ if($this->getData(['config', 'statislite', 'enable'])){
if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php"; if(is_dir("./module/statislite")) include "./module/statislite/include/stat.php";

View File

@ -164,6 +164,8 @@ if ($this->getData(['core', 'dataVersion']) < 4501) {
$this->setData(['locale', 'editorLabel', $groupWhoIs[2] ]); $this->setData(['locale', 'editorLabel', $groupWhoIs[2] ]);
$this->setData(['locale', 'moderatorLabel', $groupWhoIs[3] ]); $this->setData(['locale', 'moderatorLabel', $groupWhoIs[3] ]);
$this->setData(['locale', 'administratorLabel', $groupWhoIs[4] ]); $this->setData(['locale', 'administratorLabel', $groupWhoIs[4] ]);
if( is_file('./site/data/body.inc.html')) rename('./site/data/body.inc.html', './site/data/body.inc.php' );
if( is_file('./site/data/head.inc.html')) rename('./site/data/head.inc.html', './site/data/head.inc.php' );
$this->setData(['core', 'dataVersion', 4501]); $this->setData(['core', 'dataVersion', 4501]);
} }
?> ?>

View File

@ -32,7 +32,7 @@ else { echo '<html lang="'.$lang.'">'; }
AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?> AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?>
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl(). $this->getUrl(0) . '/rss';?>" title="fLUX rss"> <link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl(). $this->getUrl(0) . '/rss';?>" title="fLUX rss">
<?php endif; <?php endif;
if (file_exists(self::DATA_DIR .'head.inc.html')) include(self::DATA_DIR .'head.inc.html'); ?> if (file_exists(self::DATA_DIR .'head.inc.php')) include(self::DATA_DIR .'head.inc.php'); ?>
</head> </head>
<body> <body>
<?php //Barre d'administration <?php //Barre d'administration

View File

@ -621,10 +621,10 @@ class config extends common {
if($this->isPost()) { if($this->isPost()) {
// Ecrire les fichiers de script // Ecrire les fichiers de script
if ($this->geturl(2) === 'head') { if ($this->geturl(2) === 'head') {
file_put_contents(self::DATA_DIR . 'head.inc.html',$this->getInput('configScriptHead',null)); file_put_contents(self::DATA_DIR . 'head.inc.php',$this->getInput('configScriptHead',null));
} }
if ($this->geturl(2) === 'body') { if ($this->geturl(2) === 'body') {
file_put_contents(self::DATA_DIR . 'body.inc.html',$this->getInput('configScriptBody',null)); file_put_contents(self::DATA_DIR . 'body.inc.php',$this->getInput('configScriptBody',null));
} }
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -23,7 +23,7 @@ echo template::formOpen('configScript'); ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::textarea('configScriptHead', [ <?php echo template::textarea('configScriptHead', [
'value' => file_exists( self::DATA_DIR . 'head.inc.html') ? file_get_contents (self::DATA_DIR . 'head.inc.html') : '' , 'value' => file_exists( self::DATA_DIR . 'head.inc.php') ? file_get_contents (self::DATA_DIR . 'head.inc.php') : '' ,
'class' => 'editor' 'class' => 'editor'
]); ?> ]); ?>
</div> </div>
@ -33,7 +33,7 @@ echo template::formOpen('configScript'); ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php echo template::textarea('configScriptBody', [ <?php echo template::textarea('configScriptBody', [
'value' => file_exists( self::DATA_DIR . 'body.inc.html') ? file_get_contents (self::DATA_DIR . 'body.inc.html') : '' , 'value' => file_exists( self::DATA_DIR . 'body.inc.php') ? file_get_contents (self::DATA_DIR . 'body.inc.php') : '' ,
'class' => 'editor' 'class' => 'editor'
]); ?> ]); ?>
</div> </div>

View File

@ -124,6 +124,16 @@ class translate extends common {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
// Si la langue originale du site est modifiée
if( $this->getData(['config', 'i18n', 'langBase']) !== $this->getInput('translateLangBase') ){
// Sauvegarde du dossier 'base' dans un dossier code ISO de l'ancienne langue originale du site
$this->copyDir('./site/data/base', './site/data/'. $this->getData(['config', 'i18n', 'langBase']));
// La nouvelle langue originale du site était une langue en traduction rédigée
if( is_dir('./site/data/'.$this->getInput('translateLangBase'))){
$this->removeDir('./site/data/base');
rename('./site/data/'. $this->getInput('translateLangBase') , './site/data/base');
}
}
// Edition des langues // Edition des langues
foreach (self::$i18nList as $keyi18n => $value) { foreach (self::$i18nList as $keyi18n => $value) {
if ($keyi18n === 'base') continue; if ($keyi18n === 'base') continue;