[9.1.13] nouveau footer à tester

This commit is contained in:
fredtempez 2019-06-18 23:29:42 +02:00
parent c164d819e9
commit b1aa2df3d7
5 changed files with 207 additions and 242 deletions

View File

@ -1922,6 +1922,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
*/ */
@ -1963,7 +1972,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
@ -1979,14 +2038,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
@ -2387,53 +2438,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

@ -565,14 +565,17 @@ section:after {
} }
/* Pied de page */ /* Pied de page */
footer {
padding: 1px 20px;
}
body > footer { body > footer {
margin: 0 -10px; margin: 0 -10px;
} }
footer { #footersiteLeft, #footersiteCenter, #footersiteRight {
padding: 1px 20px;
vertical-align: middle; vertical-align: middle;
} }
#footerLoginLink, #footerLoginLink,
#footerDisplayCopyright, #footerDisplayCopyright,
#footerDisplayVersion, #footerDisplayVersion,

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="footer<?php echo $position; ?>">
$layout->showSocials(); } <div class="<?php echo $class['left'];?>" id="footer<?php echo $position; ?>Left"> <!-- bloc gauche -->
?> <?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> </div>
</footer> <div class="<?php echo $class['center'];?>" id="footer<?php echo $position; ?>Center"> <!-- bloc central -->
<?php endif; ?> <?php if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); }
</div> if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); }
<?php if($this->getData(['theme', 'footer', 'position']) === 'body'): ?> if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); }
<!-- Pied de page dans le fond du site --> ?>
<footer> </div>
<div class="container-large"> <div class="<?php echo $class['right'];?>" id="footer<?php echo $position; ?>Right"> <!-- bloc droite -->
<div class="row" id="footerbody"> <?php if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); }
<div class="col4" id="footerbodyLeft"> <!-- bloc gauche --> if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); }
<?php if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); }
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> </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

@ -295,7 +295,8 @@ class theme extends common {
'fontWeight' => $this->getInput('themeFooterFontWeight'), 'fontWeight' => $this->getInput('themeFooterFontWeight'),
'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN), 'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN),
'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN), 'displaySiteMap' => $this->getInput('themefooterDisplaySiteMap', helper::FILTER_BOOLEAN),
'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN) 'displayCopyright' => $this->getInput('themefooterDisplayCopyright', helper::FILTER_BOOLEAN),
'template' => $this->getInput('themeFooterTemplate',helper::FILTER_INT)
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -64,7 +64,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'])
@ -97,100 +97,104 @@
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Mise en page</h4> <h4>Mise en page</h4>
<?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [ <div class="row">
'label' => 'Nombre de colonnes', <div class="col4">
'selected' => $this->getData(['theme', 'footer', 'template']), <?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [
'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.' 'label' => 'Nombre de colonnes',
]); ?> 'selected' => $this->getData(['theme', 'footer', 'template']),
</div> 'help' => 'Le changement de la mise en page entraîne la réinitalisation de la position des contenus.'
</div> ]); ?>
</div> </div>
<div class="row"> </div>
<div class="col12"> <div class="row">
<div class="block"> <div class="col4">
<h4>Contenu personnalisé</h4> <p><strong>Contenu personnalisé texte ou HTML :</strong></p>
<?php echo template::textarea('themeFooterText', [ <?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [
//'label' => 'Contenu (texte ou HTML)', 'label' => 'Emplacement',
'value' => $this->getData(['theme', 'footer', 'text']), 'selected' => $this->getData(['theme', 'footer', 'textPosition']),
'class' => 'editorWysiwyg' 'class' => 'themeFooterPosition'
]); ?> ]); ?>
</div> <?php echo template::select('themeFooterTextAlign', $module::$aligns, [
</div> 'label' => 'Alignement',
</div> 'selected' => $this->getData(['theme', 'footer', 'textAlign'])
<div class="row"> ]); ?>
<div class="col6"> </div>
<div class="block"> <div class="col4">
<h4>Contenu personnalisé</h4> <p><strong>Réseaux sociaux :</strong></p>
<?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [ <?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [
'label' => 'Emplacement', 'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'textPosition']), 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']),
'class' => 'themeFooterPosition' 'class' => 'themeFooterPosition'
]); ?> ]); ?>
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [ <?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
'label' => 'Alignement horizontal', 'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'textAlign']) 'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?> ]); ?>
</div>
</div> <div class="col4">
</div> <p><strong>Info et copyright :</strong></p>
<div class="col6"> <?php echo template::select('themeFooterCopyrightPosition', $module::$footerblocks, [
<div class="block"> 'label' => 'Emplacement',
<h4>Contenu réseaux sociaux</h4> 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']),
<?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [ 'class' => 'themeFooterPosition'
'label' => 'Emplacement', ]); ?>
'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), <?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'class' => 'themeFooterPosition' 'label' => 'Alignement',
]); ?> 'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [ ]); ?>
'label' => 'Alignement horizontal',
'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block">
<h4>Contenu copyright</h4>
<div class="row">
<div class="col5">
<?php echo template::select('themeFooterCopyrightPosition', $module::$footerblocks, [
'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']),
'class' => 'themeFooterPosition'
]); ?>
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'label' => 'Alignement horizontal',
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
]); ?>
</div>
<div class="col6 offset1">
<p>Insérer 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> </div>
</div> </div>
<div> </div>
<div class="row">
<div class="col12">
<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">
<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>
<div class="row">
<div class="col12">
<p><em>La personnalisation des réseaux sociaux s'effectue dans la configuration du site.</em></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>