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/';
// Numéro de version
const ZWII_VERSION = '9.1.13';
const ZWII_VERSION = '9.1.14.dev';
public static $actions = [];
public static $coreModuleIds = [
@ -921,6 +921,12 @@ class common {
$this->setData(['core', 'dataVersion', 9100]);
$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
$colors = helper::colorVariants($this->getData(['theme', 'footer', 'backgroundColor']));
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{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}';
$css .= 'footer .container-large > div{margin:' . $this->getData(['theme', 'footer', 'height']) . ' 0}';
//$css .= 'footer .container > div {padding:' . $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 .= '#footerText{text-align:' . $this->getData(['theme', 'footer', 'textAlign']) . '}';
$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
*/
@ -1938,12 +1955,20 @@ class layout extends common {
$items .= $this->getData(['theme','footer','displayVersion']) === false ? ' class="displayNone"' : '';
$items .= '><wbr>&nbsp;'. common::ZWII_VERSION ;
$items .= '</span>';
// Affichage du lien de connexion
// Affichage du sitemap
$items .= '<span id="footerDisplaySiteMap"';
$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 .= '</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'])
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
@ -1959,7 +1984,57 @@ class layout extends common {
// Fermeture du bloc copyright
$items .= '</span></div>';
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
@ -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
@ -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
*/

View File

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

View File

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

View File

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

View File

@ -68,21 +68,34 @@ class theme extends common {
'Vollkorn' => 'Vollkorn'
];
public static $footerblocks = [
'hide' => 'Masqué',
'left' => 'Bloc Gauche',
'center' => 'Bloc Central',
'right' => 'Bloc Droite'
1 => [
'hide' => 'Masqué',
'center' => 'Affiché' ],
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 = [
'normal' => 'Maigre',
'bold' => 'Gras'
];
public static $footerHeights = [
'-5px' => 'Réduite',
'0px' => 'Très petite',
'5px' => 'Petite',
'10px' => 'Grande',
'15px' => 'Très grande'
'0' => 'Très petites',
'10px' => 'Petites',
'20px' => 'Grandes',
'30px' => 'Très grandes'
];
public static $footerPositions = [
'hide' => 'Caché',
@ -207,7 +220,12 @@ class theme extends common {
'auto auto' => 'Automatique',
'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é
@ -271,40 +289,59 @@ class theme extends common {
public function footer() {
// Soumission du formulaire
if($this->isPost()) {
$this->setData(['theme', 'footer', [
'backgroundColor' => $this->getInput('themeFooterBackgroundColor'),
'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'),
'height' => $this->getInput('themeFooterHeight'),
'loginLink' => $this->getInput('themeFooterLoginLink'),
'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN),
'position' => $this->getInput('themeFooterPosition'),
'socialsAlign' => $this->getInput('themeFooterSocialsAlign'),
'text' => $this->getInput('themeFooterText', null),
'textAlign' => $this->getInput('themeFooterTextAlign'),
'textColor' => $this->getInput('themeFooterTextColor'),
'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)
]]);
// Valeurs en sortie
$this->addOutput([
'notification' => 'Modifications enregistrées',
'redirect' => helper::baseUrl() . 'theme',
'state' => true
]);
if ( $this->getInput('themeFooterCopyrightPosition') === 'hide' &&
$this->getInput('themeFooterSocialsPosition') === 'hide' &&
$this->getInput('themeFooterTextPosition') === 'hide' ) {
// Valeurs en sortie
$this->addOutput([
'notification' => 'Sélectionnez au moment un contenu à afficher',
'redirect' => helper::baseUrl() . 'theme/footer',
'state' => false
]);
} else {
if ($this->getInput('themeFooterLegalCheck', helper::FILTER_BOOLEAN) === true ) {
$legalPageId = $this->getInput('themeFooterLegalPageId', helper::FILTER_ID);
} else {
$legalPageId = '';
}
$this->setData(['theme', 'footer', [
'backgroundColor' => $this->getInput('themeFooterBackgroundColor'),
'copyrightAlign' => $this->getInput('themeFooterCopyrightAlign'),
'height' => $this->getInput('themeFooterHeight'),
'loginLink' => $this->getInput('themeFooterLoginLink'),
'margin' => $this->getInput('themeFooterMargin', helper::FILTER_BOOLEAN),
'position' => $this->getInput('themeFooterPosition'),
'socialsAlign' => $this->getInput('themeFooterSocialsAlign'),
'text' => $this->getInput('themeFooterText', null),
'textAlign' => $this->getInput('themeFooterTextAlign'),
'textColor' => $this->getInput('themeFooterTextColor'),
'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
$this->addOutput([
'title' => 'Personnalisation du pied de page',
'vendor' => [
'tinycolorpicker'
'tinycolorpicker',
'tinymce'
],
'view' => 'footer'
]);

View File

@ -25,9 +25,9 @@ $("input, select").on("change", function() {
var css = "footer{background-color:" + colors.normal + ";color:" + textColor + "}";
css += "footer a{color:" + textColor + "}";
// 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-large > div{margin:" + $("#themeFooterHeight").val() + " 0}";
//css += "footer .container-large > div{margin:" + $("#themeFooterHeight").val() + " 0}";
//css += "footer .container-large > div{padding:0}";
// Alignement du contenu
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() + "}";
// Marge
if($("#themeFooterMargin").is(":checked")) {
css += 'footer{margin:0 20px 20px}';
css += 'footer{margin:0 10px 10px;padding: 1px 10px;}';
}
else {
css += 'footer{margin:0}';
css += 'footer{margin:0;padding:0}';
}
// Ajout du css au DOM
$("#themePreview").remove();
@ -63,24 +63,24 @@ $("input, select").on("change", function() {
}
});
// Position dans les blocs
// Bloc texte personnalisé
$("#themeFooterForm").on("change",function() {
$(".themeFooterContent").on("change",function() {
var position = $("#themeFooterPosition").val();
switch($("#themeFooterTextPosition").val()) {
case 'hide':
case "hide":
$("#footerText").hide();
break;
case 'left':
$("#footerText").show().appendTo("#footerbodyLeft");
$("#footerText").show().appendTo("#footersiteLeft");
case "left":
$("#footerText").show().appendTo("#footer" + position + "Left");
break;
case 'center':
$("#footerText").show().appendTo("#footerbodyCenter");
$("#footerText").show().appendTo("#footersiteCenter");
case "center":
$("#footerText").show().appendTo("#footer" + position + "Center");
break;
case 'right':
$("#footerText").show().appendTo("#footerbodyRight");
$("#footerText").show().appendTo("#footersiteRight");
case "right":
$("#footerText").show().appendTo("#footer" + position + "Right");
break;
}
switch($("#themeFooterSocialsPosition").val()) {
@ -88,40 +88,156 @@ $("#themeFooterForm").on("change",function() {
$("#footerSocials").hide();
break;
case 'left':
$("#footerSocials").show().appendTo("#footerbodyLeft");
$("#footerSocials").show().appendTo("#footersiteLeft");
$("#footerSocials").show().appendTo("#footer" + position + "Left");
break;
case 'center':
$("#footerSocials").show().appendTo("#footerbodyCenter");
$("#footerSocials").show().appendTo("#footersiteCenter");
$("#footerSocials").show().appendTo("#footer" + position + "Center");
break;
case 'right':
$("#footerSocials").show().appendTo("#footerbodyRight");
$("#footerSocials").show().appendTo("#footersiteRight");
$("#footerSocials").show().appendTo("#footer" + position + "Right");
break;
}
switch($("#themeFooterCopyrightPosition").val()) {
switch($("#themeFooterCopyrightPosition").val()) {
case 'hide':
$("#footerCopyright").hide();
break;
case 'left':
$("#footerCopyright").show().appendTo("#footerbodyLeft");
$("#footerCopyright").show().appendTo("#footersiteLeft");
$("#footerCopyright").show().appendTo("#footer" + position + "Left");
break;
case 'center':
$("#footerCopyright").show().appendTo("#footerbodyCenter");
$("#footerCopyright").show().appendTo("#footersiteCenter");
$("#footerCopyright").show().appendTo("#footer" + position + "Center");
break;
case 'right':
$("#footerCopyright").show().appendTo("#footerbodyRight");
$("#footerCopyright").show().appendTo("#footersiteRight");
$("#footerCopyright").show().appendTo("#footer" + position + "Right");
break;
}
}).trigger("change");
// 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
$("#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
$("#themeFooterText").on("change keydown keyup", function() {

View File

@ -15,7 +15,7 @@
<div class="row">
<div class="col6">
<div class="block">
<h4>Couleur</h4>
<h4>Couleurs</h4>
<div class="row">
<div class="col6">
<?php echo template::text('themeFooterBackgroundColor', [
@ -46,8 +46,9 @@
</div>
<div class="col6">
<?php echo template::select('themeFooterHeight', $module::$footerHeights, [
'label' => 'Hauteur',
'selected' => $this->getData(['theme', 'footer', 'height'])
'label' => 'Marges verticales',
'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>
@ -64,7 +65,7 @@
<div class="block">
<h4>Mise en forme du texte</h4>
<div class="row">
<div class="col3">
<div class="col3">
<?php echo template::select('themeFooterFont', $module::$fonts, [
'label' => 'Police',
'selected' => $this->getData(['theme', 'footer', 'font'])
@ -96,85 +97,120 @@
<div class="row">
<div class="col12">
<div class="block">
<h4>Contenu personnalisé</h4>
<?php echo template::textarea('themeFooterText', [
'label' => 'Contenu (texte ou HTML)',
'value' => $this->getData(['theme', 'footer', 'text'])
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4>Contenu personnalisé</h4>
<?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'textPosition'])
]); ?>
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [
'label' => 'Alignement horizontal',
'selected' => $this->getData(['theme', 'footer', 'textAlign'])
]); ?>
</div>
</div>
<div class="col6">
<div class="block">
<h4>Réseaux sociaux</h4>
<?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'socialsPosition'])
]); ?>
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
'label' => 'Alignement horizontal',
'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?>
<h4>Mise en page</h4>
<div class="row">
<div class="col4">
<?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 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="block">
<h4>Contenu des blocs</h4>
<?php echo template::textarea('themeFooterText', [
'label' => '<strong>Texte ou HTML personnalisé :</strong>',
'value' => $this->getData(['theme', 'footer', 'text']),
'class' => 'editorWysiwyg'
]); ?>
<div class="row">
<div class="col12">
<div class="block">
<h4>Contenu du bloc "Info et copyright" :</h4>
<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 class="col6">
<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>
<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>
<?php echo template::formClose(); ?>