Browse Source

[9.0.08] footer font select

pull/5/head
fredtempez 3 years ago
parent
commit
7608571598
  1. 1
      .gitignore
  2. 38
      core/core.php
  3. 15
      core/layout/common.css
  4. 12
      core/module/theme/resource/custom.css
  5. 18
      core/module/theme/theme.php
  6. 5
      core/module/theme/view/footer/footer.js.php
  7. 36
      core/module/theme/view/footer/footer.php
  8. 1
      core/module/theme/view/header/header.js.php

1
.gitignore

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

38
core/core.php

@ -26,10 +26,10 @@ class common {
const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2;
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
// Numéro de version stable
const ZWII_VERSION = '9.0.08.dev';
const ZWII_VERSION = '9.0.08';
public static $actions = [];
@ -386,18 +386,22 @@ class common {
],
'footer' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
'font' => 'Open+Sans',
'fontSize' => '0.8em',
'fontWeight' => 'normal',
'height' => '10px',
'loginLink' => true,
'margin' => false,
'position' => 'site',
'textColor' => 'rgba(33, 34, 35, 1)',
'copyrightPosition' => 'center',
'copyrightAlign' => 'center',
'copyrightPosition' => 'right',
'copyrightAlign' => 'right',
'text' => 'Pied de page personnalisé',
'textPosition' => 'left',
'textAlign' => 'left',
'socialsPosition' => 'right',
'socialsAlign' => 'right'
'textAlign' => 'left',
'textTransform' => 'none',
'socialsPosition' => 'center',
'socialsAlign' => 'center'
],
'header' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)',
@ -1168,8 +1172,16 @@ class common {
$this->deleteData(['config', 'social', 'googleplusId']);
$this->setData(['core', 'dataVersion', 9001]);
$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'])) {
$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 a{color:' . $this->getData(['theme', 'footer', 'textColor']) . '}';
$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);
}
}
/**
* Auto-chargement des classes
* @param string $className Nom de la classe à charger
@ -2105,8 +2117,8 @@ class layout extends common {
*/
public function showCopyright() {
$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 .= '&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</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></span>';
if(
(
$this->getData(['theme', 'footer', 'loginLink'])
@ -2134,7 +2146,7 @@ class layout extends common {
*/
public function showFooterText() {
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>';
}
}

15
core/layout/common.css

@ -473,27 +473,14 @@ body > footer {
}
footer {
text-align: center;
font-size: .8em;
padding: 10px 20px;
vertical-align:middle;
vertical-align:middle;
}
footer .col4 {
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 {
color: #FFF;
padding: 9px;

12
core/module/theme/resource/custom.css

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

18
core/module/theme/theme.php

@ -89,6 +89,14 @@ class theme extends common {
'site' => 'Dans le 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 = [
'1.6em' => 'Très petite',
'1.8em' => 'Petite',
@ -273,7 +281,11 @@ class theme extends common {
'textColor' => $this->getInput('themeFooterTextColor'),
'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'),
'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
$this->addOutput([
@ -301,6 +313,7 @@ class theme extends common {
// Si une image est positionnée, l'arrière en transparent.
$this->setData(['theme', 'header', [
'backgroundColor' => $this->getInput('themeHeaderBackgroundColor'),
'textTransform' => $this->getInput('themeHeaderTextTransform'),
'font' => $this->getInput('themeHeaderFont'),
'fontSize' => $this->getInput('themeHeaderFontSize'),
'fontWeight' => $this->getInput('themeHeaderFontWeight'),
@ -312,8 +325,7 @@ class theme extends common {
'position' => $this->getInput('themeHeaderPosition'),
'textAlign' => $this->getInput('themeHeaderTextAlign'),
'textColor' => $this->getInput('themeHeaderTextColor'),
'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN),
'textTransform' => $this->getInput('themeHeaderTextTransform'),
'textHide' => $this->getInput('themeHeaderTextHide', helper::FILTER_BOOLEAN),
'linkHome' => $this->getInput('themeHeaderlinkHome',helper::FILTER_BOOLEAN),
'imageContainer' => $this->getInput('themeHeaderImageContainer')
]]);

5
core/module/theme/view/footer/footer.js.php

@ -15,6 +15,9 @@
* Aperçu en direct
*/
$("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
var colors = core.colorVariants($("#themeFooterBackgroundColor").val());
var textColor = $("#themeFooterTextColor").val();
@ -29,6 +32,8 @@ $("input, select").on("change", function() {
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
css += "#footerText{text-align:" + $("#themeFooterTextAlign").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
if($("#themeFooterMargin").is(":checked")) {
css += 'footer{margin:0 20px 20px}';

36
core/module/theme/view/footer/footer.php

@ -59,7 +59,40 @@
</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="col12">
<div class="block">
@ -75,7 +108,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col4">
<div class="block">

1
core/module/theme/view/header/header.js.php

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

Loading…
Cancel
Save