statislite update + texte header long

This commit is contained in:
Deltacms 2023-09-15 07:58:59 +02:00
parent 4fd4eaf9fa
commit 8d20fe4d8b
3 changed files with 30 additions and 21 deletions

View File

@ -2572,8 +2572,9 @@ class core extends common {
: '@media (min-width: 800px) {#site{margin: ' . $margin . ' auto ' . $marginBottomLarge . ' auto !important;}}@media (max-width: 799px) {#site{margin:0 auto ' . $marginBottomSmall . ' auto !important;}}#site.light{margin: 5% auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} ';
$css .= $this->getData(['theme', 'site', 'width']) === '75vw'
? '.button, button{font-size:0.8em;}'
: '';
$css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}';
: '';
$css .= '@media (min-width: 800px) { #site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;} }';
$css .= '@media (max-width: 799px) { #site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius: 0px; box-shadow: none;} }';
$colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor']));
$css .= '.speechBubble,.button,.button:hover,button[type=\'submit\'],.pagination a,.pagination a:hover,input[type=\'checkbox\']:checked + label:before,input[type=\'radio\']:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}';
$css .= '.helpButton span{color:' . $colors['normal'] . '}';
@ -2607,7 +2608,13 @@ class core extends common {
}
$colors = helper::colorVariants($this->getData(['theme', 'header', 'backgroundColor']));
$css .= 'header{background-color:' . $colors['normal'] . ';}';
// Calcul de la hauteur du bandeau du menu burger utilisé dans plusieurs cas
$fontsize = (int) str_replace('px', '', $this->getData(['theme', 'text', 'fontSize']));
$height = $this->getData(['theme', 'menu', 'height']);
$pospx = strpos($height, 'px');
$height = (int) substr( $height, 0, $pospx);
$bannerHeight = 2 * $height + 2 * $fontsize; // 2*height imposé par l'icône burger
// Bannière de type papier peint
if ($this->getData(['theme','header','feature']) === 'wallpaper' ) {
$css .= 'header #wallPaper{background-size:' . $this->getData(['theme','header','imageContainer']).'}';
@ -2622,6 +2629,16 @@ class core extends common {
}
$colors = helper::colorVariants($this->getData(['theme', 'header', 'textColor']));
$css .= 'header #wallPaper span{color:' . $colors['normal'] . ';font-family:"' . $this->getData(['fonts', $this->getData(['theme', 'header', 'font']), 'name']) . '",sans-serif;font-weight:' . $this->getData(['theme', 'header', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'header', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'header', 'textTransform']) . '}';
// En petit écran pour s'adapter à des textes longs
$titleLineHeight = str_replace(',','.',(str_replace(',','.',str_replace('em','',$this->getData(['theme', 'header', 'fontSize']))/2)+0.2)).'em';
//Si menu burger fixe et superposé à la bannière
if( $this->getData(['theme', 'menu', 'burgerFixed']) && $this->getData(['theme', 'menu', 'burgerOverlay'])) {
$titleMarginTop = strval($bannerHeight - 5).'px';
} else {
$titleMarginTop = ((int) str_replace('px','', $this->getData(['theme', 'header', 'height'])))/2 - $fontsize * ( str_replace('em','', $this->getData(['theme', 'header', 'fontSize'])));
$titleMarginTop = strval((int)$titleMarginTop).'px';
}
$css .= '@media (max-width: 799px) { header #themeHeaderTitle{ margin-top:'.$titleMarginTop.'; line-height:'.$titleLineHeight.';}}';
}
// Bannière au contenu personnalisé
@ -2634,21 +2651,15 @@ class core extends common {
}
// Pour le décalage de la bannière ou de la section, en petit écran burger fixe, calcul de la hauteur du bandeau du menu
$css .= '@media (max-width: 799px) {';
if( $this->getData(['theme', 'menu', 'position']) !== 'hide' && $this->getData(['theme', 'menu', 'burgerFixed']) === true ){
$fontsize = (int) str_replace('px', '', $this->getData(['theme', 'text', 'fontSize']));
$height = $this->getData(['theme', 'menu', 'height']);
$pospx = strpos($height, 'px');
$height = (int) substr( $height, 0, $pospx);
$bannerHeight = 2 * $height + 2 * $fontsize + 10; // 2*height imposé par l'icône burger
}
$css .= '@media (max-width: 799px) {';
$bannerHeight = $bannerHeight + 10;
// Décalage de la bannière en petit écran et burger fixe et bannière visible et non superposée
if( $this->getData(['theme', 'menu', 'position']) !== 'hide' && $this->getData(['theme', 'menu', 'burgerFixed']) === true
&& $this->getData(['theme', 'header', 'tinyHidden']) === false && $this->getData(['theme', 'menu', 'burgerOverlay']) === false){
$css .= '#site.container header, header.container { padding-top:'.$bannerHeight.'px;}';
} else {
$css .= '#site.container header, header.container { padding-top: 0;}';
}
if( $this->getData(['theme', 'menu', 'position']) !== 'hide' && $this->getData(['theme', 'menu', 'burgerFixed']) === true
&& $this->getData(['theme', 'header', 'tinyHidden']) === false && $this->getData(['theme', 'menu', 'burgerOverlay']) === false){
$css .= '#site.container header, header.container { padding-top:'.$bannerHeight.'px;}';
} else {
$css .= '#site.container header, header.container { padding-top: 0;}';
}
$css .= '}';
// Menu écran large couleurs

View File

@ -164,10 +164,6 @@ if ($this->getData(['core', 'dataVersion']) < 4501) {
$this->setData(['locale', 'editorLabel', $groupWhoIs[2] ]);
$this->setData(['locale', 'moderatorLabel', $groupWhoIs[3] ]);
$this->setData(['locale', 'administratorLabel', $groupWhoIs[4] ]);
if( is_dir('./site/data/statislite/module') ){
if ( !is_dir('./site/data/statislite/module/download_counter') ) mkdir('./site/data/statislite/module/download_counter', 0700);
copy('./module/statislite/ressource/download_counter/download_counter.php', './site/data/statislite/module/download_counter/download_counter.php');
}
$this->setData(['core', 'dataVersion', 4501]);
}
?>

View File

@ -99,6 +99,8 @@ class statislite extends common {
}
// Version 4.9
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.9', '<') ) {
if( !is_dir( self::DATAMODULE.'/download_counter' ))mkdir( self::DATAMODULE.'/download_counter', 0755);
copy('./module/statislite/ressource/download_counter/download_counter.php', self::DATAMODULE.'/download_counter/download_counter.php');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.9']);
}
}