Merge branch 'extra_footer' of https://github.com/fredtempez/ZwiiCMS into extra_footer

This commit is contained in:
fredtempez 2019-06-23 08:09:20 +02:00
commit bc66591ccf
9 changed files with 518 additions and 321 deletions

13
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [
]
}

22
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
// Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
// Pointez pour afficher la description des attributs existants.
// Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}

View File

@ -32,7 +32,7 @@ class common {
const TEMP_DIR = 'site/tmp/'; const TEMP_DIR = 'site/tmp/';
// Numéro de version // Numéro de version
const ZWII_VERSION = '9.1.13'; const ZWII_VERSION = '9.1.14.dev';
public static $actions = []; public static $actions = [];
public static $coreModuleIds = [ public static $coreModuleIds = [
@ -921,6 +921,12 @@ class common {
$this->setData(['core', 'dataVersion', 9100]); $this->setData(['core', 'dataVersion', 9100]);
$this->SaveData(); $this->SaveData();
} }
// Version 9.1.13
if($this->getData(['core', 'dataVersion']) < 9113) {
$this->setData(['theme','footer','template', 3 ]);
$this->setData(['core', 'dataVersion', 9113]);
$this->SaveData();
}
} }
} }
@ -1077,13 +1083,15 @@ class core extends common {
// Pied de page // Pied de page
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor'])); $colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
if($this->getData(['theme', 'footer', 'margin'])) { if($this->getData(['theme', 'footer', 'margin'])) {
$css .= 'footer{margin:0 20px 20px}'; $css .= 'footer{margin:0 10px 10px;padding: 1px 10px;}';
} else {
$css .= 'footer{margin:0;padding:0}';
} }
$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 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 {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
$css .= 'footer .container-large > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}'; $css .= '#footersiteLeft, #footersiteCenter, #footersiteRight {padding:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
$css .= '#footerSocials{text-align:' . $this->getData(['theme', 'footer', 'socialsAlign']) . '}'; $css .= '#footerSocials{text-align:' . $this->getData(['theme', 'footer', 'socialsAlign']) . '}';
$css .= '#footerText{text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}'; $css .= '#footerText{text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}';
$css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}'; $css .= '#footerCopyright{text-align:' . $this->getData(['theme', 'footer', 'copyrightAlign']) . '}';
@ -1918,6 +1926,15 @@ class layout extends common {
} }
} }
/**
* Affiche le texte du footer
*/
public function showFooterText() {
if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') {
echo '<div id="footerText"><span id="footerFontText">' . nl2br($footerText) . '</span></div>';
}
}
/** /**
* Affiche le copyright * Affiche le copyright
*/ */
@ -1938,12 +1955,20 @@ class layout extends common {
$items .= $this->getData(['theme','footer','displayVersion']) === false ? ' class="displayNone"' : ''; $items .= $this->getData(['theme','footer','displayVersion']) === false ? ' class="displayNone"' : '';
$items .= '><wbr>&nbsp;'. common::ZWII_VERSION ; $items .= '><wbr>&nbsp;'. common::ZWII_VERSION ;
$items .= '</span>'; $items .= '</span>';
// Affichage du lien de connexion // Affichage du sitemap
$items .= '<span id="footerDisplaySiteMap"'; $items .= '<span id="footerDisplaySiteMap"';
$items .= $this->getData(['theme','footer','displaySiteMap']) === false? ' class="displayNone"' : ''; $items .= $this->getData(['theme','footer','displaySiteMap']) === false? ' class="displayNone"' : '';
$items .= '><wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a>'; $items .= '><wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a>';
$items .= '</span>'; $items .= '</span>';
if( // Affichage des mentions légales
$items .= '<span id="footerDisplayLegal"';
$items .= $this->getData(['theme','footer','legalPageId']) === '' ? ' class="displayNone" >' : '>';
if ($this->getData(['theme','footer','legalPageId']) !== '') {
$items .= '<wbr>&nbsp;|&nbsp;<a href="' . helper::baseUrl() . $this->getData(['theme','footer','legalPageId']) . '" data-tippy-content="Mentions Légales">Mentions légales</a>';
}
$items .= '</span>';
// Affichage du lien de connexion
if(
( (
$this->getData(['theme', 'footer', 'loginLink']) $this->getData(['theme', 'footer', 'loginLink'])
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
@ -1959,7 +1984,57 @@ class layout extends common {
// Fermeture du bloc copyright // Fermeture du bloc copyright
$items .= '</span></div>'; $items .= '</span></div>';
echo $items; echo $items;
} }
/**
* Affiche les réseaux sociaux
*/
public function showSocials() {
$socials = '';
foreach($this->getData(['config', 'social']) as $socialName => $socialId) {
switch($socialName) {
case 'facebookId':
$socialUrl = 'https://www.facebook.com/';
$title = 'Facebook';
break;
case 'linkedinId':
$socialUrl = 'https://fr.linkedin.com/in/';
$title = 'Linkedin';
break;
case 'instagramId':
$socialUrl = 'https://www.instagram.com/';
$title = 'Instagram';
break;
case 'pinterestId':
$socialUrl = 'https://pinterest.com/';
$title = 'Pinterest';
break;
case 'twitterId':
$socialUrl = 'https://twitter.com/';
$title = 'Twitter';
break;
case 'youtubeId':
$socialUrl = 'https://www.youtube.com/channel/';
$title = 'YouTube';
break;
case 'githubId':
$socialUrl = 'https://www.github.com/';
$title = 'Github';
break;
default:
$socialUrl = '';
}
if($socialId !== '') {
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" data-tippy-content="' . $title . '">' . template::ico(substr($socialName, 0, -2)) . '</a>';
}
}
if($socials !== '') {
echo '<div id="footerSocials">' . $socials . '</div>';
}
}
/** /**
* Affiche le favicon * Affiche le favicon
@ -1975,14 +2050,6 @@ class layout extends common {
} }
} }
/**
* Affiche le texte du footer
*/
public function showFooterText() {
if($footerText = $this->getData(['theme', 'footer', 'text']) OR $this->getUrl(0) === 'theme') {
echo '<div id="footerText"><span id="footerFontText">' . nl2br($footerText) . '</span></div>';
}
}
/** /**
* Affiche le menu * Affiche le menu
@ -2383,53 +2450,6 @@ class layout extends common {
} }
} }
/**
* Affiche les réseaux sociaux
*/
public function showSocials() {
$socials = '';
foreach($this->getData(['config', 'social']) as $socialName => $socialId) {
switch($socialName) {
case 'facebookId':
$socialUrl = 'https://www.facebook.com/';
$title = 'Facebook';
break;
case 'linkedinId':
$socialUrl = 'https://fr.linkedin.com/in/';
$title = 'Linkedin';
break;
case 'instagramId':
$socialUrl = 'https://www.instagram.com/';
$title = 'Instagram';
break;
case 'pinterestId':
$socialUrl = 'https://pinterest.com/';
$title = 'Pinterest';
break;
case 'twitterId':
$socialUrl = 'https://twitter.com/';
$title = 'Twitter';
break;
case 'youtubeId':
$socialUrl = 'https://www.youtube.com/channel/';
$title = 'YouTube';
break;
case 'githubId':
$socialUrl = 'https://www.github.com/';
$title = 'Github';
break;
default:
$socialUrl = '';
}
if($socialId !== '') {
$socials .= '<a href="' . $socialUrl . $socialId . '" onclick="window.open(this.href);return false" data-tippy-content="' . $title . '">' . template::ico(substr($socialName, 0, -2)) . '</a>';
}
}
if($socials !== '') {
echo '<div id="footerSocials">' . $socials . '</div>';
}
}
/** /**
* Affiche l'import des librairies * Affiche l'import des librairies
*/ */

View File

@ -570,13 +570,21 @@ body > footer {
} }
footer { footer {
padding: 1px 20px; padding: 1px 20px;
}
#footersiteRight, #footersiteLeft, #footersiteCenter {
vertical-align: middle; vertical-align: middle;
} }
#footersite {
margin: 0;
}
#footerLoginLink, #footerLoginLink,
#footerDisplayCopyright, #footerDisplayCopyright,
#footerDisplayVersion, #footerDisplayVersion,
#footerDisplaySiteMap, #footerDisplaySiteMap,
#footerDisplayLegal,
#footerZwiiCMS { #footerZwiiCMS {
font-size: inherit; font-size: inherit;
} }

View File

@ -196,117 +196,70 @@
?> ?>
</section> </section>
<!-- footer --> <!-- footer -->
<?php if(
<?php
// Déterminer la position
if(
$this->getData(['theme', 'footer', 'position']) === 'site' $this->getData(['theme', 'footer', 'position']) === 'site'
// Affiche toujours le pied de page pour l'édition du thème // Affiche toujours le pied de page pour l'édition du thème
OR ( OR (
$this->getData(['theme', 'footer', 'position']) === 'hide' $this->getData(['theme', 'footer', 'position']) === 'hide'
AND $this->getUrl(0) === 'theme' AND $this->getUrl(0) === 'theme'
) )
): ?> ) { $position = 'site'; } else {
<!-- Pied de page dans le site --> $position = 'body';
echo '</div>';
<footer <?php if($this->getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>> }
?>
<!-- Pied de page -->
<footer <?php if($this->getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
<?php
if ($position === 'site'): ?>
<div class="container"> <div class="container">
<div class="row" id="footersite"> <?php else: ?>
<div class="col4" id="footersiteLeft"> <!-- bloc gauche --> <div class="container-large">
<?php <?php endif?>
if($this->getData(['theme', 'footer', 'textPosition']) === 'left') { <!-- Mise en page -->
$layout->showFooterText();} <?php switch($this->getData(['theme', 'footer', 'template'])) {
?> case '1' :
<?php $class['left'] = "displayNone";
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $class['center'] = "col12";
$layout->showSocials(); } $class['right'] = "displayNone";
?> break;
<?php case '2' :
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') { $class['left'] = "col6";
$layout->showCopyright(); } $class['center'] = "displayNone";
?> $class['right'] = "col6";
</div> break;
<div class="col4" id="footersiteCenter"> <!-- bloc central --> case '3' :
<?php $class['left'] = "col4";
if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { $class['center'] = "col4";
$layout->showFooterText(); } $class['right'] = "col4";
?> break;
<?php }?>
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { <div class="row" id="footersite">
$layout->showSocials(); } <div class="<?php echo $class['left'];?>" id="footer<?php echo $position;?>Left">
?> <?php if($this->getData(['theme', 'footer', 'textPosition']) === 'left') { $layout->showFooterText(); }
<?php if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { $layout->showSocials(); }
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {$layout->showCopyright(); }
$layout->showCopyright(); } ?>
?>
</div>
<div class="col4" id="footersiteRight"> <!-- bloc droite -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'right') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') {
$layout->showCopyright(); }
?>
</div>
</div>
</div>
</footer>
<?php endif; ?>
</div>
<?php if($this->getData(['theme', 'footer', 'position']) === 'body'): ?>
<!-- Pied de page dans le fond du site -->
<footer>
<div class="container-large">
<div class="row" id="footerbody">
<div class="col4" id="footerbodyLeft"> <!-- bloc gauche -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'left') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="footerbodyCenter"> <!-- bloc central -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'center') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') {
$layout->showCopyright(); }
?>
</div>
<div class="col4" id="footerbodyRight"> <!-- bloc droite -->
<?php
if($this->getData(['theme', 'footer', 'textPosition']) === 'right') {
$layout->showFooterText(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') {
$layout->showCopyright();}
?>
</div>
</div> </div>
<div class="<?php echo $class['center'];?>" id="footer<?php echo $position;?>Center">
<?php if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); }
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); }
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); }
?>
</div>
<div class="<?php echo $class['right'];?>" id="footer<?php echo $position;?>Right">
<?php if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); }
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); }
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); }
?>
</div>
</div> </div>
</footer> </footer>
<?php endif; ?> </div>
<!-- Lien remonter en haut --> <!-- Lien remonter en haut -->
<div id="backToTop"><?php echo template::ico('up'); ?></div> <div id="backToTop"><?php echo template::ico('up'); ?></div>
<?php $layout->showScript();?> <?php $layout->showScript();?>

View File

@ -433,9 +433,9 @@ class install extends common {
'font' => 'Open+Sans', 'font' => 'Open+Sans',
'fontSize' => '.8em', 'fontSize' => '.8em',
'fontWeight' => 'normal', 'fontWeight' => 'normal',
'height' => '10px', 'height' => '0',
'loginLink' => true, 'loginLink' => true,
'margin' => false, 'margin' => true,
'position' => 'site', 'position' => 'site',
'textColor' => 'rgba(33, 34, 35, 1)', 'textColor' => 'rgba(33, 34, 35, 1)',
'copyrightPosition' => 'right', 'copyrightPosition' => 'right',
@ -449,7 +449,9 @@ class install extends common {
'displayVersion' => true, 'displayVersion' => true,
'displayVersion' => true, 'displayVersion' => true,
'displaySiteMap' => true, 'displaySiteMap' => true,
'displayCopyright' => true 'displayCopyright' => true,
'template' => '3',
'legalPageId' => ''
], ],
'header' => [ 'header' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',

View File

@ -68,21 +68,34 @@ class theme extends common {
'Vollkorn' => 'Vollkorn' 'Vollkorn' => 'Vollkorn'
]; ];
public static $footerblocks = [ public static $footerblocks = [
'hide' => 'Masqué', 1 => [
'left' => 'Bloc Gauche', 'hide' => 'Masqué',
'center' => 'Bloc Central', 'center' => 'Affiché' ],
'right' => 'Bloc Droite' 2 => [
'hide' => 'Masqué',
'left' => 'Bloc Gauche',
'right' => 'Bloc Droite' ],
3 => [
'hide' => 'Masqué',
'left' => 'Bloc Gauche',
'center' => 'Bloc Central',
'right' => 'Bloc Droite' ],
4 => [
'hide' => 'Masqué',
'top' => 'Bloc haut',
'middle' => 'Bloc au milieu',
'bottom' => 'Bloc inférieur' ]
]; ];
public static $fontWeights = [ public static $fontWeights = [
'normal' => 'Maigre', 'normal' => 'Maigre',
'bold' => 'Gras' 'bold' => 'Gras'
]; ];
public static $footerHeights = [ public static $footerHeights = [
'-5px' => 'Réduite', '0' => 'Très petites',
'0px' => 'Très petite', '10px' => 'Petites',
'5px' => 'Petite', '20px' => 'Grandes',
'10px' => 'Grande', '30px' => 'Très grandes'
'15px' => 'Très grande'
]; ];
public static $footerPositions = [ public static $footerPositions = [
'hide' => 'Caché', 'hide' => 'Caché',
@ -207,7 +220,12 @@ class theme extends common {
'auto auto' => 'Automatique', 'auto auto' => 'Automatique',
'100% 100%' => 'Image étirée' '100% 100%' => 'Image étirée'
]; ];
public static $footerTemplate = [
'1' => 'Colonne unique',
'2' => 'Colonnes, 2 bloc 50% - 50%',
'3' => 'Colonnes, 3 blocs 33% - 33% - 33%',
'4' => 'Trois lignes en pleine largeur'
];
/** /**
* Mode avancé * Mode avancé
@ -271,40 +289,59 @@ class theme extends common {
public function footer() { public function footer() {
// Soumission du formulaire // Soumission du formulaire
if($this->isPost()) { if($this->isPost()) {
$this->setData(['theme', 'footer', [ if ( $this->getInput('themeFooterCopyrightPosition') === 'hide' &&
'backgroundColor' => $this->getInput('themeFooterBackgroundColor'), $this->getInput('themeFooterSocialsPosition') === 'hide' &&
'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'), $this->getInput('themeFooterTextPosition') === 'hide' ) {
'height' => $this->getInput('themeFooterHeight'), // Valeurs en sortie
'loginLink' => $this->getInput('themeFooterLoginLink'), $this->addOutput([
'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN), 'notification' => 'Sélectionnez au moment un contenu à afficher',
'position' => $this->getInput('themeFooterPosition'), 'redirect' => helper::baseUrl() . 'theme/footer',
'socialsAlign' => $this->getInput('themeFooterSocialsAlign'), 'state' => false
'text' => $this->getInput('themeFooterText', null), ]);
'textAlign' => $this->getInput('themeFooterTextAlign'), } else {
'textColor' => $this->getInput('themeFooterTextColor'), if ($this->getInput('themeFooterLegalCheck', helper::FILTER_BOOLEAN) === true ) {
'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'), $legalPageId = $this->getInput('themeFooterLegalPageId', helper::FILTER_ID);
'textPosition' => $this->getInput('themeFooterTextPosition'), } else {
'socialsPosition' => $this->getInput('themeFooterSocialsPosition'), $legalPageId = '';
'textTransform' => $this->getInput('themeFooterTextTransform'), }
'font' => $this->getInput('themeFooterFont'), $this->setData(['theme', 'footer', [
'fontSize' => $this->getInput('themeFooterFontSize'), 'backgroundColor' => $this->getInput('themeFooterBackgroundColor'),
'fontWeight' => $this->getInput('themeFooterFontWeight'), 'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'),
'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN), 'height' => $this->getInput('themeFooterHeight'),
'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN), 'loginLink' => $this->getInput('themeFooterLoginLink'),
'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN) 'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN),
]]); 'position' => $this->getInput('themeFooterPosition'),
// Valeurs en sortie 'socialsAlign' => $this->getInput('themeFooterSocialsAlign'),
$this->addOutput([ 'text' => $this->getInput('themeFooterText', null),
'notification' => 'Modifications enregistrées', 'textAlign' => $this->getInput('themeFooterTextAlign'),
'redirect' => helper::baseUrl() . 'theme', 'textColor' => $this->getInput('themeFooterTextColor'),
'state' => true 'copyrightPosition' => $this->getInput('themeFooterCopyrightPosition'),
]); 'textPosition' => $this->getInput('themeFooterTextPosition'),
'socialsPosition' => $this->getInput('themeFooterSocialsPosition'),
'textTransform' => $this->getInput('themeFooterTextTransform'),
'font' => $this->getInput('themeFooterFont'),
'fontSize' => $this->getInput('themeFooterFontSize'),
'fontWeight' => $this->getInput('themeFooterFontWeight'),
'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN),
'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN),
'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN),
'template' => $this->getInput('themeFooterTemplate'),
'legalPageId' => $legalPageId
]]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Modifications enregistrées',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
}
} }
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'title' => 'Personnalisation du pied de page', 'title' => 'Personnalisation du pied de page',
'vendor' => [ 'vendor' => [
'tinycolorpicker' 'tinycolorpicker',
'tinymce'
], ],
'view' => 'footer' 'view' => 'footer'
]); ]);

View File

@ -25,9 +25,9 @@ $("input, select").on("change", function() {
var css = "footer{background-color:" + colors.normal + ";color:" + textColor + "}"; var css = "footer{background-color:" + colors.normal + ";color:" + textColor + "}";
css += "footer a{color:" + textColor + "}"; css += "footer a{color:" + textColor + "}";
// Hauteur du pied de page // Hauteur du pied de page
css += "footer .container > div{margin:" + $("#themeFooterHeight").val() + " 0}"; css += "#footersiteLeft, #footersiteCenter, #footersiteRight {margin:" + $("#themeFooterHeight").val() + " 0}";
//css += "footer .container > div{padding:0}"; //css += "footer .container > div{padding:0}";
css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}"; //css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}";
//css += "footer .container-large > div{padding:0}"; //css += "footer .container-large > div{padding:0}";
// Alignement du contenu // Alignement du contenu
css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}"; css += "#footerSocials{text-align:" + $("#themeFooterSocialsAlign").val() + "}";
@ -37,10 +37,10 @@ $("input, select").on("change", function() {
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() + "}"; 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 10px 10px;padding: 1px 10px;}';
} }
else { else {
css += 'footer{margin:0}'; css += 'footer{margin:0;padding:0}';
} }
// Ajout du css au DOM // Ajout du css au DOM
$("#themePreview").remove(); $("#themePreview").remove();
@ -63,24 +63,24 @@ $("input, select").on("change", function() {
} }
}); });
// Position dans les blocs // Position dans les blocs
// Bloc texte personnalisé // Bloc texte personnalisé
$("#themeFooterForm").on("change",function() { $(".themeFooterContent").on("change",function() {
var position = $("#themeFooterPosition").val();
switch($("#themeFooterTextPosition").val()) { switch($("#themeFooterTextPosition").val()) {
case 'hide': case "hide":
$("#footerText").hide(); $("#footerText").hide();
break; break;
case 'left': case "left":
$("#footerText").show().appendTo("#footerbodyLeft"); $("#footerText").show().appendTo("#footer" + position + "Left");
$("#footerText").show().appendTo("#footersiteLeft");
break; break;
case 'center': case "center":
$("#footerText").show().appendTo("#footerbodyCenter"); $("#footerText").show().appendTo("#footer" + position + "Center");
$("#footerText").show().appendTo("#footersiteCenter");
break; break;
case 'right': case "right":
$("#footerText").show().appendTo("#footerbodyRight"); $("#footerText").show().appendTo("#footer" + position + "Right");
$("#footerText").show().appendTo("#footersiteRight");
break; break;
} }
switch($("#themeFooterSocialsPosition").val()) { switch($("#themeFooterSocialsPosition").val()) {
@ -88,40 +88,156 @@ $("#themeFooterForm").on("change",function() {
$("#footerSocials").hide(); $("#footerSocials").hide();
break; break;
case 'left': case 'left':
$("#footerSocials").show().appendTo("#footerbodyLeft"); $("#footerSocials").show().appendTo("#footer" + position + "Left");
$("#footerSocials").show().appendTo("#footersiteLeft");
break; break;
case 'center': case 'center':
$("#footerSocials").show().appendTo("#footerbodyCenter"); $("#footerSocials").show().appendTo("#footer" + position + "Center");
$("#footerSocials").show().appendTo("#footersiteCenter");
break; break;
case 'right': case 'right':
$("#footerSocials").show().appendTo("#footerbodyRight"); $("#footerSocials").show().appendTo("#footer" + position + "Right");
$("#footerSocials").show().appendTo("#footersiteRight");
break; break;
} }
switch($("#themeFooterCopyrightPosition").val()) { switch($("#themeFooterCopyrightPosition").val()) {
case 'hide': case 'hide':
$("#footerCopyright").hide(); $("#footerCopyright").hide();
break; break;
case 'left': case 'left':
$("#footerCopyright").show().appendTo("#footerbodyLeft"); $("#footerCopyright").show().appendTo("#footer" + position + "Left");
$("#footerCopyright").show().appendTo("#footersiteLeft");
break; break;
case 'center': case 'center':
$("#footerCopyright").show().appendTo("#footerbodyCenter"); $("#footerCopyright").show().appendTo("#footer" + position + "Center");
$("#footerCopyright").show().appendTo("#footersiteCenter");
break; break;
case 'right': case 'right':
$("#footerCopyright").show().appendTo("#footerbodyRight"); $("#footerCopyright").show().appendTo("#footer" + position + "Right");
$("#footerCopyright").show().appendTo("#footersiteRight");
break; break;
} }
}).trigger("change"); }).trigger("change");
// Fin Position dans les blocs // Fin Position dans les blocs
// Modification dynamique de la mise en page
$("#themeFooterTemplate").on("change",function() {
// Nettoyage des sélecteurs des contenus
var newOptions = {
4: {'hide' : 'Masqué', 'top' : 'Bloc en haut', 'middle' : 'Bloc au milieu', 'bottom' : 'Bloc inférieur'} ,
3: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'center': 'Bloc Central', 'right': 'Bloc Droite'} ,
2: {'hide': 'Masqué', 'left': 'Bloc Gauche', 'right': 'Bloc Droite'} ,
1: {'hide': 'Masqué', 'center': 'Affiché'}
};
var $el = $(".themeFooterContent");
$el.empty();
// Eléments des position de contenus
$.each(newOptions[$("#themeFooterTemplate").val()], function(key,value) {
$el.append($("<option></option>")
.attr("value", key).text(value));
});
var position = $("#themeFooterPosition").val();
// Masquer les contenus
$("#footerCopyright").hide();
$("#footerText").hide();
$("#footerSocials").hide();
switch($("#themeFooterTemplate").val()) {
case "1":
$("#footer" + position + "Left").css("display","none");
$("#footer" + position + "Center").css("display","");
$("#footer" + position + "Right").css("display","none");
// Dimension du bloc
$("#footer" + position + "Center").removeAttr('class');
$("#footer" + position + "Center").addClass("col12");
break;
case "2":
$("#footer" + position + "Left").css("display","");
$("#footer" + position + "Center").css("display","none");
$("#footer" + position + "Right").css("display","");
// Dimension de blocs
$("#footer" + position + "Left").removeAttr('class');
$("#footer" + position + "Right").removeAttr('class');
$("#footer" + position + "Left").addClass('col6');
$("#footer" + position + "Right").addClass('col6');
break;
case "3":
$("#footer" + position + "Left").css("display","");
$("#footer" + position + "Center").css("display","");
$("#footer" + position + "Right").css("display","");
// Dimension de blocs
$("#footer" + position + "Left").removeAttr('class');
$("#footer" + position + "Right").removeAttr('class');
$("#footer" + position + "center").removeAttr('class');
$("#footer" + position + "Left").addClass('col4');
$("#footer" + position + "Center").addClass('col4');
$("#footer" + position + "Right").addClass('col4');
break;
case "4":
$("#footer" + position + "Left").css("display","");
$("#footer" + position + "Left").removeAttr('class');
$("#footer" + position + "Left").addClass('col12');
//$("#footer" + position + "Left").css("footersite > " + "#footer" + position + "Left","order: " + $("#footer" + position + "Left").val() );
$("#footer" + position + "Center").css("display","");
$("#footer" + position + "center").removeAttr('class');
$("#footer" + position + "Center").addClass('col12');
//$("#footer" + position + "Center").css("footersite > " + "#footer" + position + "Center","order: " + $("#footer" + position + "Left").val() );
$("#footer" + position + "Right").css("display","");
$("#footer" + position + "Right").removeAttr('class');
$("#footer" + position + "Right").addClass('col12');
//$("#footer" + position + "Right").css("footersite > "+ "#footer" + position + "Right","order: " + $("#footer" + position + "Left").val() );
break;
}
});
// Désactivation des sélections multiples
$("#themeFooterSocialsPosition").on("change", function() {
if ($(this).prop('selectedIndex') >= 1 ) {
if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterTextPosition").prop('selectedIndex',0);
$("#footerText").hide();
}
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterCopyrightPosition").prop('selectedIndex',0);
$("#footerCopyright").hide();
}
}
}).trigger("change");
$("#themeFooterTextPosition").on("change", function() {
if ($(this).prop('selectedIndex') >= 1 ) {
if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterSocialsPosition").prop('selectedIndex',0);
$("#footerSocials").hide();
}
if ( $("#themeFooterCopyrightPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterCopyrightPosition").prop('selectedIndex',0);
$("#footerCopyright").hide();
}
}
}).trigger("change");
$("#themeFooterCopyrightPosition").on("change", function() {
if ($(this).prop('selectedIndex') >= 1 ) {
if ( $("#themeFooterTextPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterTextPosition").prop('selectedIndex',0);
$("#footerText").hide();
}
if ( $("#themeFooterSocialsPosition").prop('selectedIndex') === $(this).prop('selectedIndex') ) {
$("#themeFooterSocialsPosition").prop('selectedIndex',0);
$("#footerSocials").hide();
}
}
}).trigger("change");
// Mention Légales activation de la liste de choix
$("#themeFooterLegalCheck").on("change",function() {
if($(this).is(":checked")) {
$("#themeFooterLegalPageId").show();
$("#footerDisplayLegal").show();
} else {
$("#themeFooterLegalPageId").hide();
$("#footerDisplayLegal").hide();
}
});
// Lien de connexion // Lien de connexion
$("#themeFooterLoginLink").on("change", function() { $("#themeFooterLoginLink").on("change", function() {
@ -165,16 +281,6 @@ $("#themefooterDisplaySiteMap").on("change", function() {
// Numéro de version
$("#themefooterDisplayVersion").on("change", function() {
if($(this).is(":checked")) {
$("#footerDisplayVersion").show();
}
else {
$("#footerDisplayVersion").hide();
}
}).trigger("change");
// Aperçu du texte // Aperçu du texte
$("#themeFooterText").on("change keydown keyup", function() { $("#themeFooterText").on("change keydown keyup", function() {

View File

@ -15,7 +15,7 @@
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<div class="block"> <div class="block">
<h4>Couleur</h4> <h4>Couleurs</h4>
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::text('themeFooterBackgroundColor', [ <?php echo template::text('themeFooterBackgroundColor', [
@ -46,8 +46,9 @@
</div> </div>
<div class="col6"> <div class="col6">
<?php echo template::select('themeFooterHeight', $module::$footerHeights, [ <?php echo template::select('themeFooterHeight', $module::$footerHeights, [
'label' => 'Hauteur', 'label' => 'Marges verticales',
'selected' => $this->getData(['theme', 'footer', 'height']) 'selected' => $this->getData(['theme', 'footer', 'height']),
'help' => 'La hauteur du pied de page est dynmamique selon le contenu.Ces marges sont ajoutées au-dessus et en-dessous.'
]); ?> ]); ?>
</div> </div>
</div> </div>
@ -64,7 +65,7 @@
<div class="block"> <div class="block">
<h4>Mise en forme du texte</h4> <h4>Mise en forme du texte</h4>
<div class="row"> <div class="row">
<div class="col3"> <div class="col3">
<?php echo template::select('themeFooterFont', $module::$fonts, [ <?php echo template::select('themeFooterFont', $module::$fonts, [
'label' => 'Police', 'label' => 'Police',
'selected' => $this->getData(['theme', 'footer', 'font']) 'selected' => $this->getData(['theme', 'footer', 'font'])
@ -96,85 +97,120 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Contenu personnalisé</h4> <h4>Mise en page</h4>
<?php echo template::textarea('themeFooterText', [ <div class="row">
'label' => 'Contenu (texte ou HTML)', <div class="col4">
'value' => $this->getData(['theme', 'footer', 'text']) <?php
]); ?> $footerBlockPosition = $module::$footerblocks [$this->getData(['theme', 'footer', 'template'])];
?>
<?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [
'label' => 'Gabarits de mise en page',
'selected' => $this->getData(['theme', 'footer', 'template']),
'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.'
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<p><strong>Contenu personnalisé texte ou HTML :</strong></p>
<?php echo template::select('themeFooterTextPosition', $footerBlockPosition, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'textPosition']),
'class' => 'themeFooterContent'
]); ?>
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [
'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'textAlign'])
]); ?>
</div>
<div class="col4">
<p><strong>Réseaux sociaux :</strong></p>
<?php echo template::select('themeFooterSocialsPosition', $footerBlockPosition, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'socialsPosition']),
'class' => 'themeFooterContent'
]); ?>
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?>
</div>
<div class="col4">
<p><strong>Info et copyright :</strong></p>
<?php echo template::select('themeFooterCopyrightPosition', $footerBlockPosition, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']),
'class' => 'themeFooterContent'
]); ?>
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
]); ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col6"> <div class="col12">
<div class="block"> <div class="block">
<h4>Contenu personnalisé</h4> <h4>Contenu des blocs</h4>
<?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [ <?php echo template::textarea('themeFooterText', [
'label' => 'Emplacement', 'label' => '<strong>Texte ou HTML personnalisé :</strong>',
'selected' => $this->getData(['theme', 'footer', 'textPosition']) 'value' => $this->getData(['theme', 'footer', 'text']),
]); ?> 'class' => 'editorWysiwyg'
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [ ]); ?>
'label' => 'Alignement horizontal', <div class="row">
'selected' => $this->getData(['theme', 'footer', 'textAlign']) <div class="col12">
]); ?> <div class="block">
<h4>Contenu du bloc "Info et copyright" :</h4>
</div> <div class="row">
</div> <div class="col6">
<div class="col6"> <div class="row">
<div class="block"> <?php echo template::checkbox('themefooterDisplayCopyright', true, 'Mention "Motorisé par"', [
<h4>Réseaux sociaux</h4> 'checked' => $this->getData(['theme', 'footer','displayCopyright'])
<?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [ ]); ?>
'label' => 'Emplacement', </div>
'selected' => $this->getData(['theme', 'footer', 'socialsPosition']) <div class="row">
]); ?> <?php echo template::checkbox('themefooterDisplayVersion', true, 'Numéro de version', [
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [ 'checked' => $this->getData(['theme', 'footer','displayVersion'])
'label' => 'Alignement horizontal', ]); ?>
'selected' => $this->getData(['theme', 'footer', 'socialsAlign']) </div>
]); ?> </div>
</div> <div class="col6">
<div class="row">
<?php echo template::checkbox('themefooterDisplaySiteMap', true, 'Plan du site', [
'checked' => $this->getData(['theme', 'footer', 'displaySiteMap']),
'help' => 'Un plan du site permet un meilleur référencement.'
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('themeFooterLoginLink', true, 'Lien de connexion', [
'checked' => $this->getData(['theme', 'footer', 'loginLink'])
]); ?>
</div>
</div>
<div class="col3">
<div class="row">
<?php echo template::checkbox('themeFooterLegalCheck', true, 'Pages des mentions légales', [
'checked' => $this->getData(['theme', 'footer', 'legalPageId']) === '' ? false : true
]); ?>
<p></p>
</div>
</div>
<div class="col3">
<div class="row">
<?php echo template::select('themeFooterLegalPageId', helper::arrayCollumn($this->getData(['page']), 'title', 'SORT_ASC'), [
'class' => $this->getData(['theme', 'footer', 'legalPageId']) === '' ? 'displayNone' : '',
'selected' => $this->getData(['theme', 'footer', 'legalPageId'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Copyright</h4>
<div class="row">
<div class="col5">
<?php echo template::select('themeFooterCopyrightPosition', $module::$footerblocks, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'copyrightPosition'])
]); ?>
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'label' => 'Alignement horizontal',
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
]); ?>
</div>
<div class="col6 offset1">
<p>Afficher les éléments suivants :</p>
<div class="row">
<?php echo template::checkbox('themefooterDisplayCopyright', true, 'Mention "Motorisé par"', [
'checked' => $this->getData(['theme', 'footer','displayCopyright'])
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('themefooterDisplayVersion', true, 'Numéro de version', [
'checked' => $this->getData(['theme', 'footer','displayVersion'])
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('themefooterDisplaySiteMap', true, 'Plan du site', [
'checked' => $this->getData(['theme', 'footer', 'displaySiteMap']),
'help' => 'Un plan du site permet un meilleur référencement.'
]); ?>
</div>
<div class="row">
<?php echo template::checkbox('themeFooterLoginLink', true, 'Lien de connexion', [
'checked' => $this->getData(['theme', 'footer', 'loginLink'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>