ZwiiCMS/core/layout/main.php

284 lines
11 KiB
PHP
Raw Normal View History

2019-05-02 13:21:48 +02:00
<?php $layout = new layout($this); ?>
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#" lang="fr">
2019-09-17 18:22:43 +02:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php $layout->showMetaTitle(); ?>
<?php $layout->showMetaDescription(); ?>
<?php $layout->showMetaType(); ?>
<?php $layout->showMetaImage(); ?>
2019-09-17 18:22:43 +02:00
<?php $layout->showFavicon(); ?>
<?php $layout->showVendor(); ?>
<?php $layout->showAnalytics(); ?>
2019-09-17 18:22:43 +02:00
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
2020-03-23 16:16:45 +01:00
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR.'custom.css'); ?>">
2019-09-17 18:22:43 +02:00
<?php $layout->showStyle(); ?>
2020-03-23 16:16:45 +01:00
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
include(self::DATA_DIR .'head.inc.html');
2019-09-17 18:22:43 +02:00
}?>
</head>
<body>
<?php if($this->getUser('group') > self::GROUP_MEMBER): ?>
<?php $layout->showBar(); ?>
<?php endif;?>
2019-09-17 18:22:43 +02:00
<?php $layout->showNotification(); ?>
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
<!-- Menu dans le fond du site avant la bannière -->
2020-09-25 16:19:07 +02:00
<!-- Détermine si le menu est fixe en haut de page lorsque l'utilisateur n'est pas connecté -->
<?php
if ( $this->getData(['theme', 'menu', 'position']) === 'top'
AND $this->getData(['theme', 'menu', 'fixed']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') > 1) {
2020-09-25 16:19:07 +02:00
echo '<nav id="navfixedconnected" >';
} else {
echo '<nav id="navfixedlogout" >';
2020-09-25 11:49:11 +02:00
}
2020-09-25 16:19:07 +02:00
?>
<!-- Menu Burger -->
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
2019-09-17 18:22:43 +02:00
<div id="menu" class="
<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';}
?>">
2020-09-25 16:19:07 +02:00
<?php $layout->showMenu(); ?>
2019-09-17 18:22:43 +02:00
</div> <!--fin menu -->
</nav>
<?php endif; ?>
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<!-- Bannière dans le fond du site -->
<header>
<?php
2019-11-09 19:03:03 +01:00
if ($this->getData(['theme','header','linkHomePage'])){
2019-09-17 18:22:43 +02:00
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
2019-11-11 08:57:14 +01:00
<div id="headerContainer" class="container">
2019-09-17 18:22:43 +02:00
<?php if(
$this->getData(['theme', 'header', 'textHide']) === false
// Affiche toujours le titre de la bannière pour l'édition du thème
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
2019-11-09 15:36:14 +01:00
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
2019-09-17 18:22:43 +02:00
<?php endif; ?>
2019-11-12 21:36:02 +01:00
</div> <!--fin container -->
2019-09-17 18:22:43 +02:00
<?php
2019-11-09 19:03:03 +01:00
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";}
?>
2019-09-17 18:22:43 +02:00
</header>
2019-05-02 13:21:48 +02:00
<?php endif; ?>
2019-09-17 18:22:43 +02:00
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-second'): ?>
<!-- Menu dans le fond du site après la bannière -->
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
2019-09-17 18:22:43 +02:00
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
</nav>
<?php endif; ?>
<!-- Site -->
<div id="site" class="container">
<?php if($this->getData(['theme', 'menu', 'position']) === 'site-first'): ?>
<!-- Menu dans le site avant la bannière -->
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
2019-09-17 18:22:43 +02:00
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
</nav>
<?php endif; ?>
2019-05-02 13:21:48 +02:00
<?php if(
2019-09-17 18:22:43 +02:00
$this->getData(['theme', 'header', 'position']) === 'site'
// Affiche toujours la bannière pour l'édition du thème
OR (
$this->getData(['theme', 'header', 'position']) === 'hide'
AND $this->getUrl(0) === 'theme'
)
2019-05-02 13:21:48 +02:00
): ?>
2019-09-17 18:22:43 +02:00
<!-- Bannière dans le site -->
<?php
2019-11-09 19:03:03 +01:00
if ($this->getData(['theme','header','linkHomePage'])){
2019-09-17 18:22:43 +02:00
echo "<a href='" . helper::baseUrl(false) . "'>" ;} ?>
<header <?php if($this->getData(['theme', 'header', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
2019-11-11 08:57:14 +01:00
<div id="headerContainer" class="container">
<?php if(
$this->getData(['theme', 'header', 'textHide']) === false
// Affiche toujours le titre de la bannière pour l'édition du thème
OR ($this->getUrl(0) === 'theme' AND $this->getUrl(1) === 'header')
): ?>
<span id="themeHeaderTitle"><?php echo $this->getData(['config', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
</div> <!--fin container -->
2019-09-17 18:22:43 +02:00
</header>
<?php
2019-11-09 19:03:03 +01:00
if ($this->getData(['theme','header','linkHomePage'])){echo "</a>";} ?>
2019-05-02 13:21:48 +02:00
<?php endif; ?>
2019-09-17 18:22:43 +02:00
<?php if(
$this->getData(['theme', 'menu', 'position']) === 'site-second' ||
$this->getData(['theme', 'menu', 'position']) === 'site'
// Affiche toujours le menu pour l'édition du thème
OR (
$this->getData(['theme', 'menu', 'position']) === 'hide'
AND $this->getUrl(0) === 'theme'
)
): ?>
<!-- Menu dans le site après la bannière -->
<nav <?php if($this->getData(['theme', 'menu', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerTitle']) === true ): ?>
<div id="burgerText"><?php echo $this->getData(['config','title']);?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
2019-09-17 18:22:43 +02:00
<div id="menu" class="container"><?php $layout->showMenu(); ?></div>
</nav>
<?php endif; ?>
<!-- Corps de page -->
<section>
<?php
2019-09-17 18:22:43 +02:00
// Gabarit :
// Récupérer la config de la page courante
$blocks = explode('-',$this->getData(['page',$this->getUrl(0),'block']));
// Initialiser
$blockleft=$blockright="";
switch (sizeof($blocks)) {
case 1 : // une colonne
$content = 'col'. $blocks[0] ;
break;
case 2 : // 2 blocs
2019-09-17 18:22:43 +02:00
if ($blocks[0] < $blocks[1]) { // détermine la position de la colonne
$blockleft = 'col'. $blocks[0];
$content = 'col'. $blocks[1] ;
} else {
$content = 'col' . $blocks[0];
$blockright = 'col' . $blocks[1];
2019-09-17 18:22:43 +02:00
}
break;
case 3 : // 3 blocs
2019-09-17 18:22:43 +02:00
$blockleft = 'col' . $blocks[0];
$content = 'col' . $blocks[1];
$blockright = 'col' . $blocks[2];
2019-09-17 18:22:43 +02:00
}
// Page pleine pour la configuration des modules et l'édition des pages sauf l'affichage d'un article de blog
2019-09-17 18:22:43 +02:00
$pattern = ['config','edit','add','comment','data'];
if ((sizeof($blocks) === 1 ||
2019-09-17 18:22:43 +02:00
in_array($this->getUrl(1),$pattern) )
) { // Pleine page en mode configuration
$layout->showContent();
2020-03-23 16:16:45 +01:00
if (file_exists(self::DATA_DIR . 'body.inc.html')) {
include( self::DATA_DIR . 'body.inc.html');
}
2019-09-17 18:22:43 +02:00
} else {
?>
<div class="row siteContainer">
<?php
if ($blockleft !== "") :?>
2020-09-02 09:03:01 +02:00
<div class="<?php echo $blockleft; ?>" id="contentLeft"><aside><?php $layout->showBarContentLeft(); ?></aside></div>
2019-09-17 18:22:43 +02:00
<?php endif; ?>
<div class="<?php echo $content; ?>" id="contentSite"><?php $layout->showContent();
2020-03-23 16:16:45 +01:00
if (file_exists(self::DATA_DIR . 'body.inc.html')) {
include(self::DATA_DIR . 'body.inc.html');
2019-09-17 18:22:43 +02:00
}
?>
</div>
<?php
if ($blockright !== "") :?>
2020-09-02 09:03:01 +02:00
<div class="<?php echo $blockright; ?>" id="contentRight"><aside><?php $layout->showBarContentRight(); ?></aside></div>
<?php endif; ?>
2019-09-17 18:22:43 +02:00
</div>
<?php }
?>
</section>
<!-- footer -->
<?php
// Déterminer la position
2020-04-27 09:12:52 +02:00
$positionFixed = '';
2019-09-17 18:22:43 +02:00
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'
)
) { $position = 'site';
} else {
2019-09-17 18:22:43 +02:00
$position = 'body';
2020-02-02 19:14:57 +01:00
if ( $this->getData(['theme', 'footer', 'fixed']) === true) {
$positionFixed = 'footerbodyFixed';
}
echo '</div>';
2019-09-17 18:22:43 +02:00
}
?>
<!-- Pied de page -->
2019-09-17 18:22:43 +02:00
<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">
<?php else: ?>
2020-02-02 19:14:57 +01:00
<div class="container-large <?php echo $positionFixed; ?>"><div class="row" id="footerbody">
2019-09-17 18:22:43 +02:00
<?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;
case '4' :
$class['left'] = "col12";
$class['center'] = "col12";
$class['right'] = "col12";
break;
}?>
<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>
<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>
2019-05-02 13:21:48 +02:00
</div>
2019-09-17 18:22:43 +02:00
</footer>
2019-09-18 18:31:40 +02:00
<?php
if ($this->getData(['theme', 'footer', 'position']) === 'site') {
echo '</div>';
} ?>
2019-09-17 18:22:43 +02:00
<!-- Lien remonter en haut -->
<div id="backToTop"><?php echo template::ico('up'); ?></div>
<?php $layout->showScript();?>
2019-05-02 13:21:48 +02:00
</body>
2019-07-04 12:38:23 +02:00
</html>