[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
*/ */
@ -1965,6 +1974,56 @@ class layout extends common {
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>';
}
?>
<!-- Pied de page -->
<footer <?php if($this->getData(['theme', 'footer', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>> <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 -->
<?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>
</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="container-large">
<div class="row" id="footerbody"> <?php endif?>
<div class="col4" id="footerbodyLeft"> <!-- bloc gauche --> <!-- Mise en page -->
<?php <?php switch($this->getData(['theme', 'footer', 'template'])) {
if($this->getData(['theme', 'footer', 'textPosition']) === 'left') { case '1' :
$layout->showFooterText(); } $class['left'] = "displayNone";
?> $class['center'] = "col12";
<?php $class['right'] = "displayNone";
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'left') { break;
$layout->showSocials(); } case '2' :
?> $class['left'] = "col6";
<?php $class['center'] = "displayNone";
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'left') { $class['right'] = "col6";
$layout->showCopyright(); } break;
case '3' :
$class['left'] = "col4";
$class['center'] = "col4";
$class['right'] = "col4";
break;
}?>
<div class="row" id="footer<?php echo $position; ?>">
<div class="<?php echo $class['left'];?>" id="footer<?php echo $position; ?>Left"> <!-- bloc gauche -->
<?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> </div>
<div class="col4" id="footerbodyCenter"> <!-- bloc central --> <div class="<?php echo $class['center'];?>" id="footer<?php echo $position; ?>Center"> <!-- bloc central -->
<?php <?php if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { $layout->showFooterText(); }
if($this->getData(['theme', 'footer', 'textPosition']) === 'center') { if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') { $layout->showSocials(); }
$layout->showFooterText(); } if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') { $layout->showCopyright(); }
?>
<?php
if($this->getData(['theme', 'footer', 'socialsPosition']) === 'center') {
$layout->showSocials(); }
?>
<?php
if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'center') {
$layout->showCopyright(); }
?> ?>
</div> </div>
<div class="col4" id="footerbodyRight"> <!-- bloc droite --> <div class="<?php echo $class['right'];?>" id="footer<?php echo $position; ?>Right"> <!-- bloc droite -->
<?php <?php if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { $layout->showFooterText(); }
if($this->getData(['theme', 'footer', 'textPosition']) === 'right') { if($this->getData(['theme', 'footer', 'socialsPosition']) === 'right') { $layout->showSocials(); }
$layout->showFooterText(); } if($this->getData(['theme', 'footer', 'copyrightPosition']) === 'right') { $layout->showCopyright(); }
?> ?>
<?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

@ -97,6 +97,8 @@
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">
<h4>Mise en page</h4> <h4>Mise en page</h4>
<div class="row">
<div class="col4">
<?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [ <?php echo template::select('themeFooterTemplate', $module::$footerTemplate, [
'label' => 'Nombre de colonnes', 'label' => 'Nombre de colonnes',
'selected' => $this->getData(['theme', 'footer', 'template']), 'selected' => $this->getData(['theme', 'footer', 'template']),
@ -104,68 +106,62 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
</div>
<div class="row"> <div class="row">
<div class="col12"> <div class="col4">
<div class="block"> <p><strong>Contenu personnalisé texte ou HTML :</strong></p>
<h4>Contenu personnalisé</h4>
<?php echo template::textarea('themeFooterText', [
//'label' => 'Contenu (texte ou HTML)',
'value' => $this->getData(['theme', 'footer', 'text']),
'class' => 'editorWysiwyg'
]); ?>
</div>
</div>
</div>
<div class="row">
<div class="col6">
<div class="block">
<h4>Contenu personnalisé</h4>
<?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [ <?php echo template::select('themeFooterTextPosition', $module::$footerblocks, [
'label' => 'Emplacement', 'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'textPosition']), 'selected' => $this->getData(['theme', 'footer', 'textPosition']),
'class' => 'themeFooterPosition' 'class' => 'themeFooterPosition'
]); ?> ]); ?>
<?php echo template::select('themeFooterTextAlign', $module::$aligns, [ <?php echo template::select('themeFooterTextAlign', $module::$aligns, [
'label' => 'Alignement horizontal', 'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'textAlign']) 'selected' => $this->getData(['theme', 'footer', 'textAlign'])
]); ?> ]); ?>
</div> </div>
</div> <div class="col4">
<div class="col6"> <p><strong>Réseaux sociaux :</strong></p>
<div class="block">
<h4>Contenu réseaux sociaux</h4>
<?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [ <?php echo template::select('themeFooterSocialsPosition', $module::$footerblocks, [
'label' => 'Emplacement', 'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'socialsPosition']), 'selected' => $this->getData(['theme', 'footer', 'socialsPosition']),
'class' => 'themeFooterPosition' 'class' => 'themeFooterPosition'
]); ?> ]); ?>
<?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [ <?php echo template::select('themeFooterSocialsAlign', $module::$aligns, [
'label' => 'Alignement horizontal', 'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'socialsAlign']) 'selected' => $this->getData(['theme', 'footer', 'socialsAlign'])
]); ?> ]); ?>
</div> </div>
</div> <div class="col4">
</div> <p><strong>Info et copyright :</strong></p>
<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, [ <?php echo template::select('themeFooterCopyrightPosition', $module::$footerblocks, [
'label' => 'Emplacement', 'label' => 'Emplacement',
'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']), 'selected' => $this->getData(['theme', 'footer', 'copyrightPosition']),
'class' => 'themeFooterPosition' 'class' => 'themeFooterPosition'
]); ?> ]); ?>
<?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [ <?php echo template::select('themeFooterCopyrightAlign', $module::$aligns, [
'label' => 'Alignement horizontal', 'label' => 'Alignement',
'selected' => $this->getData(['theme', 'footer', 'copyrightAlign']) 'selected' => $this->getData(['theme', 'footer', 'copyrightAlign'])
]); ?> ]); ?>
</div> </div>
<div class="col6 offset1"> </div>
<p>Insérer les éléments suivants :</p> </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"> <div class="row">
<?php echo template::checkbox('themefooterDisplayCopyright', true, 'Mention "Motorisé par"', [ <?php echo template::checkbox('themefooterDisplayCopyright', true, 'Mention "Motorisé par"', [
'checked' => $this->getData(['theme', 'footer','displayCopyright']) 'checked' => $this->getData(['theme', 'footer','displayCopyright'])
@ -176,6 +172,8 @@
'checked' => $this->getData(['theme', 'footer','displayVersion']) 'checked' => $this->getData(['theme', 'footer','displayVersion'])
]); ?> ]); ?>
</div> </div>
</div>
<div class="col6">
<div class="row"> <div class="row">
<?php echo template::checkbox('themefooterDisplaySiteMap', true, 'Plan du site', [ <?php echo template::checkbox('themefooterDisplaySiteMap', true, 'Plan du site', [
'checked' => $this->getData(['theme', 'footer', 'displaySiteMap']), 'checked' => $this->getData(['theme', 'footer', 'displaySiteMap']),
@ -189,8 +187,14 @@
</div> </div>
</div> </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> </div>
</div> </div>
<div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>