[9.0.08] footer font select

This commit is contained in:
fredtempez 2019-03-19 06:59:28 +01:00
parent eed74cbebb
commit 7608571598
8 changed files with 85 additions and 41 deletions

1
.gitignore vendored
View File

@ -28,3 +28,4 @@ core/vendor/tinymce/link_list.json
core/vendor/tinymce/link_list.json core/vendor/tinymce/link_list.json
site/tmp/.htaccess site/tmp/.htaccess
core/vendor/tinymce/link_list.json core/vendor/tinymce/link_list.json
site/tmp/.htaccess

View File

@ -26,10 +26,10 @@ class common {
const GROUP_MEMBER = 1; const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2; const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3; const GROUP_ADMIN = 3;
// Numéro de version de développement : // Numéro de version de développement, ajouter dev:
// Désactive l'update auto // Désactive l'update auto
// Numéro de version stable // Numéro de version stable
const ZWII_VERSION = '9.0.08.dev'; const ZWII_VERSION = '9.0.08';
public static $actions = []; public static $actions = [];
@ -386,18 +386,22 @@ class common {
], ],
'footer' => [ 'footer' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',
'font' => 'Open+Sans',
'fontSize' => '0.8em',
'fontWeight' => 'normal',
'height' => '10px', 'height' => '10px',
'loginLink' => true, 'loginLink' => true,
'margin' => false, 'margin' => false,
'position' => 'site', 'position' => 'site',
'textColor' => 'rgba(33, 34, 35, 1)', 'textColor' => 'rgba(33, 34, 35, 1)',
'copyrightPosition' => 'center', 'copyrightPosition' => 'right',
'copyrightAlign' => 'center', 'copyrightAlign' => 'right',
'text' => 'Pied de page personnalisé', 'text' => 'Pied de page personnalisé',
'textPosition' => 'left', 'textPosition' => 'left',
'textAlign' => 'left', 'textAlign' => 'left',
'socialsPosition' => 'right', 'textTransform' => 'none',
'socialsAlign' => 'right' 'socialsPosition' => 'center',
'socialsAlign' => 'center'
], ],
'header' => [ 'header' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',
@ -1168,8 +1172,16 @@ class common {
$this->deleteData(['config', 'social', 'googleplusId']); $this->deleteData(['config', 'social', 'googleplusId']);
$this->setData(['core', 'dataVersion', 9001]); $this->setData(['core', 'dataVersion', 9001]);
$this->SaveData(); $this->SaveData();
} }
// Version 9.0.08
if($this->getData(['core', 'dataVersion']) < 9008) {
$this->setData(['theme', 'footer', 'textTransform','none']);
$this->setData(['theme', 'footer', 'fontWeight','normal']);
$this->setData(['theme', 'footer', 'fontSize','0.8em']);
$this->setData(['theme', 'footer', 'font','Open+Sans']);
$this->setData(['core', 'dataVersion', 9008]);
$this->SaveData();
}
} }
} }
@ -1308,6 +1320,7 @@ class core extends common {
if($this->getData(['theme', 'footer', 'margin'])) { if($this->getData(['theme', 'footer', 'margin'])) {
$css .= 'footer{margin:0 20px 20px}'; $css .= 'footer{margin:0 20px 20px}';
} }
$css .= 'footer span{color:' . $this->getData(['theme', 'footer', 'textColor']) . ';font-family:"' . str_replace('+', ' ', $this->getData(['theme', 'footer', 'font'])) . '",sans-serif;font-weight:' . $this->getData(['theme', 'footer', 'fontWeight']) . ';font-size:' . $this->getData(['theme', 'footer', 'fontSize']) . ';text-transform:' . $this->getData(['theme', 'footer', 'textTransform']) . '}';
$css .= 'footer{background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; $css .= 'footer{background-color:' . $colors['normal'] . ';color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
$css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}'; $css .= 'footer a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
$css .= 'footer .container > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; $css .= 'footer .container > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
@ -1319,7 +1332,6 @@ class core extends common {
file_put_contents('site/data/theme.css', $css); file_put_contents('site/data/theme.css', $css);
} }
} }
/** /**
* Auto-chargement des classes * Auto-chargement des classes
* @param string $className Nom de la classe à charger * @param string $className Nom de la classe à charger
@ -2105,8 +2117,8 @@ class layout extends common {
*/ */
public function showCopyright() { public function showCopyright() {
$items = '<div id="footerCopyright">'; $items = '<div id="footerCopyright">';
$items .= 'Motorisé&nbsp;par&nbsp;<a href="http://zwiicms.com/" onclick="window.open(this.href);return false" data-tippy-content="Zwii CMS sans base de données, très léger et performant">Zwii</a>'; $items .= '<span>Motorisé&nbsp;par&nbsp;<a href="http://zwiicms.com/" onclick="window.open(this.href);return false" data-tippy-content="Zwii CMS sans base de données, très léger et performant">Zwii</a>';
$items .= '&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a>'; $items .= '&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a></span>';
if( if(
( (
$this->getData(['theme', 'footer', 'loginLink']) $this->getData(['theme', 'footer', 'loginLink'])
@ -2134,7 +2146,7 @@ class layout extends common {
*/ */
public function showFooterText() { public function showFooterText() {
if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') { if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') {
echo '<div id="footerText">' . nl2br($footerText) . '</div>'; echo '<div id="footerText"><span>' . nl2br($footerText) . '</span></div>';
} }
} }

View File

@ -473,27 +473,14 @@ body > footer {
} }
footer { footer {
text-align: center; text-align: center;
font-size: .8em;
padding: 10px 20px; padding: 10px 20px;
vertical-align:middle; vertical-align:middle;
} }
footer .col4 { footer .col4 {
vertical-align: middle; vertical-align: middle;
} }
footer #footerSocials {
font-size: 1.0em;
}
footer #footerSocials {
font-size: 1.0em;
}
footer #footerCopyright, #footerText {
font-size: 0.8em;
}
footer #footerSocials span { footer #footerSocials span {
color: #FFF; color: #FFF;
padding: 9px; padding: 9px;

View File

@ -8,7 +8,10 @@
*/ */
/* Grille du site */ /*
* Grille du site
* Barres et page
*/
#contentleft { #contentleft {
} }
#contentright { #contentright {
@ -63,13 +66,6 @@ footer #footersiteCenter, #footerbodyCenter {
footer #footersiteRight, #footerbodyRight { footer #footersiteRight, #footerbodyRight {
} }
/* footer bloc de chaque élément */
#footerText {
}
#footerSocials {
}
#footerCopyright {
}
/** /**

View File

@ -89,6 +89,14 @@ class theme extends common {
'site' => 'Dans le site', 'site' => 'Dans le site',
'body' => 'En dessous du site' 'body' => 'En dessous du site'
]; ];
public static $footerFontSizes = [
'.8em' => 'Très petite',
'.9em' => 'Petite',
'1em' => 'Normale',
'1.1em' => 'Moyenne',
'1.2em' => 'Grande',
'1.3em' => 'Très grande'
];
public static $headerFontSizes = [ public static $headerFontSizes = [
'1.6em' => 'Très petite', '1.6em' => 'Très petite',
'1.8em' => 'Petite', '1.8em' => 'Petite',
@ -273,7 +281,11 @@ class theme extends common {
'textColor' => $this->getInput('themeFooterTextColor'), 'textColor' => $this->getInput('themeFooterTextColor'),
'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'), 'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'),
'textPosition' => $this->getInput('themeFooterTextPosition'), 'textPosition' => $this->getInput('themeFooterTextPosition'),
'socialsPosition' => $this->getInput('themeFooterSocialsPosition') 'socialsPosition' => $this->getInput('themeFooterSocialsPosition'),
'textTransform' => $this->getInput('themeFootererTextTransform'),
'font' => $this->getInput('themeFooterFont'),
'fontSize' => $this->getInput('themeFooterFontSize'),
'fontWeight' => $this->getInput('themeFooterFontWeight')
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -301,6 +313,7 @@ class theme extends common {
// Si une image est positionnée, l'arrière en transparent. // Si une image est positionnée, l'arrière en transparent.
$this->setData(['theme', 'header', [ $this->setData(['theme', 'header', [
'backgroundColor' => $this->getInput('themeHeaderBackgroundColor'), 'backgroundColor' => $this->getInput('themeHeaderBackgroundColor'),
'textTransform' => $this->getInput('themeHeaderTextTransform'),
'font' => $this->getInput('themeHeaderFont'), 'font' => $this->getInput('themeHeaderFont'),
'fontSize' => $this->getInput('themeHeaderFontSize'), 'fontSize' => $this->getInput('themeHeaderFontSize'),
'fontWeight' => $this->getInput('themeHeaderFontWeight'), 'fontWeight' => $this->getInput('themeHeaderFontWeight'),
@ -312,8 +325,7 @@ class theme extends common {
'position' => $this->getInput('themeHeaderPosition'), 'position' => $this->getInput('themeHeaderPosition'),
'textAlign' => $this->getInput('themeHeaderTextAlign'), 'textAlign' => $this->getInput('themeHeaderTextAlign'),
'textColor' => $this->getInput('themeHeaderTextColor'), 'textColor' => $this->getInput('themeHeaderTextColor'),
'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN), 'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN),
'textTransform' => $this->getInput('themeHeaderTextTransform'),
'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN), 'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN),
'imageContainer' => $this->getInput('themeHeaderImageContainer') 'imageContainer' => $this->getInput('themeHeaderImageContainer')
]]); ]]);

View File

@ -15,6 +15,9 @@
* Aperçu en direct * Aperçu en direct
*/ */
$("input, select").on("change", function() { $("input, select").on("change", function() {
// Import des polices de caractères
var footerFont = $("#themeFooterFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + footerFont + "');";
// Couleurs du pied de page // Couleurs du pied de page
var colors = core.colorVariants($("#themeFooterBackgroundColor").val()); var colors = core.colorVariants($("#themeFooterBackgroundColor").val());
var textColor = $("#themeFooterTextColor").val(); var textColor = $("#themeFooterTextColor").val();
@ -29,6 +32,8 @@ $("input, select").on("change", function() {
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}"; css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
css += "#footerText{text-align:" + $("#themeFooterTextAlign").val() + "}"; css += "#footerText{text-align:" + $("#themeFooterTextAlign").val() + "}";
css += "#footerCopyright{text-align:" + $("#themeFooterCopyrightAlign").val() + "}"; css += "#footerCopyright{text-align:" + $("#themeFooterCopyrightAlign").val() + "}";
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
css += "footer span{color:" + $("#themeFooterTextColor").val() + ";font-family:'" + footerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeFooterFontWeight").val() + ";font-size:" + $("#themeFooterFontSize").val() + ";text-transform:" + $("#themeFooterTextTransform").val() + "}";
// Marge // Marge
if($("#themeFooterMargin").is(":checked")) { if($("#themeFooterMargin").is(":checked")) {
css += 'footer{margin:0 20px 20px}'; css += 'footer{margin:0 20px 20px}';

View File

@ -59,7 +59,40 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col3">
<?php echo template::select('themeFooterTextTransform', $module::$textTransforms, [
'label' => 'Caractères',
'selected' => $this->getData(['theme', 'footer', 'textTransform'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterFontWeight', $module::$fontWeights, [
'label' => 'Style',
'selected' => $this->getData(['theme', 'footer', 'fontWeight'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterFontSize', $module::$footerFontSizes, [
'label' => 'Taille',
'selected' => $this->getData(['theme', 'footer', 'fontSize'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('themeFooterFont', $module::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'footer', 'font'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
@ -75,7 +108,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col4"> <div class="col4">
<div class="block"> <div class="block">

View File

@ -16,7 +16,6 @@
$("input, select").on("change", function() { $("input, select").on("change", function() {
// Import des polices de caractères // Import des polices de caractères
var headerFont = $("#themeHeaderFont").val(); var headerFont = $("#themeHeaderFont").val();
var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');"; var css = "@import url('https://fonts.googleapis.com/css?family=" + headerFont + "');";
// Adaptation aux média // Adaptation aux média
css += "@media (max-width: 767px) {header{height:" + $("#themeHeaderHeight").val() + "/2;line-height:" + $("#themeHeaderHeight").val() + "/2;}}"; css += "@media (max-width: 767px) {header{height:" + $("#themeHeaderHeight").val() + "/2;line-height:" + $("#themeHeaderHeight").val() + "/2;}}";