Deltacms/core/layout/main.php

261 lines
13 KiB
PHP

<!DOCTYPE html>
<?php
$lang = $this->getData(['config', 'i18n', 'langBase']);
if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SITE') !== null && $this->getInput('DELTA_I18N_SITE') !== 'base') $lang = $this->getInput('DELTA_I18N_SITE');
if( $this->getData(['config', 'social', 'headFacebook' ]) === true) { echo '<html prefix="og: http://ogp.me/ns#" lang="'.$lang.'">'; }
else { echo '<html lang="'.$lang.'">'; }
?>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="DeltaCMS <?=common::DELTA_VERSION?>">
<?php
$this->showMetaTitle();
if( $this->getData(['config', 'social', 'headFacebook' ]) === true) $this->showMetaPropertyFacebook();
?>
<base href="<?php echo helper::baseUrl(true); ?>">
<link rel="stylesheet" href="core/vendor/normalize/normalize.min.css">
<link rel="stylesheet" href="core/layout/common.css">
<link rel="stylesheet" href="core/layout/mediaqueries.css">
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>theme.css">
<?php $this->showStyle();
$this->showSharedVariables();
$this->sortVendor();
$this->showVendor('css'); echo PHP_EOL;?>
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>custom.css">
<?php
$this->showFavicon();
$this->showVendor('jshead');
?>
<!-- Détection RSS -->
<?php if ( ( $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'blog'
OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'news' )
AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?>
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl(). $this->getUrl(0) . '/rss';?>" title="fLUX rss">
<?php endif; ?>
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
include(self::DATA_DIR .'head.inc.html');
}?>
<?php
if( isset ($_SESSION['screenshot'] )){
if( $_SESSION['screenshot'] === 'on'){?>
<script src="core/vendor/screenshot/html2canvas.min.js"></script>
<?php } }?>
</head>
<body>
<!-- Barre d'administration -->
<?php if($this->getUser('group') > self::GROUP_MEMBER): ?>
<?php $this->showBar(); ?>
<?php endif;?>
<!-- Notifications -->
<?php $this->showNotification(); ?>
<!-- Taille du Logo pour le menu burger -->
<?php $fileLogo = './site/file/source/'. $this->getData(['theme', 'menu', 'burgerLogo']);
if( $this->getData(['theme','menu','burgerContent']) === 'logo'
&& file_exists( $fileLogo)
&& $this->getData(['theme', 'menu', 'burgerLogo']) !== '' ){
$fontsize = $this->getData(['theme', 'text', 'fontSize']);
$pospx = strpos($fontsize, 'px');
$fontsize = (int) substr( $fontsize, 0, $pospx);
$height = $this->getData(['theme', 'menu', 'height']);
$pospx = strpos($height, 'px');
$height = (int) substr( $height, 0, $pospx);
$heightLogo = 2*($height + $fontsize) - 4;
$arrayImage = getimagesize( $fileLogo );
$heightImage = $arrayImage[1];
$widthImage = $arrayImage[0];
if( $heightImage !== 0 && $heightImage !== null){
$widthLogo = (int) ($widthImage * ( ($heightLogo - 1) / $heightImage));
}
else
{
$widthLogo = 30;
}
} ?>
<!-- div screenshot -->
<?php if( isset ($_SESSION['screenshot'] )){
if( $_SESSION['screenshot'] === 'on'){ ?>
<div id="main_screenshot">
<?php }} ?>
<!-- Menu dans le fond du site avant la bannière -->
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?>
<!-- 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('DELTA_USER_PASSWORD')
AND $this->getUser('group') > self::GROUP_MEMBER) {
echo '<nav id="navfixedconnected" >';
} else {
echo '<nav id="navfixedlogout" >';
}
?>
<!-- Menu Burger -->
<div id="toggle">
<?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'. $fileLogo .'" width="'. $widthLogo.'" height="'. $heightLogo .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<!-- fin du menu burger -->
<?php
$menuClass = $this->getData(['theme', 'menu', 'position']) === 'top' ? 'class="container-large"' : 'class="container"';
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
?>
<div id="menu" <?php echo $menuClass; ?> >
<?php $this->showMenu(); ?>
</div> <!--fin menu -->
</nav>
<?php endif; ?>
<!-- Bannière dans le fond du site -->
<?php $homePageOnly = false;
if( $this->getUrl(0) !== 'theme' ){
if( $this->getUrl(0) !== $this->getData(['locale', 'homePageId' ]) && $this->getData(['theme','header','homePageOnly']) === true) $homePageOnly = true;
}?>
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<?php
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
$headerClass .= $this->getData(['theme', 'header', 'wide']) === 'none' ? '' : 'container';
?>
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"'; ?> >
<?php if ($this->getData(['theme','header','feature']) === 'wallpaper' ) { ?>
<?php echo ($this->getData(['theme','header','linkHomePage']) ) ? '<a class="headertitle" href="' . helper::baseUrl(false) . '">' : ''; ?>
<?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 class="notranslate" id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
<?php } elseif( $this->getData(['theme','header','feature']) === 'feature') { ?>
<div id="featureContent">
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
<?php } else { ?>
<!-- Swiper -->
<?php if( ! $homePageOnly) echo $this->getData(['theme','header','swiperContent']);?>
<?php } ?>
</header>
<?php endif; ?>
<!-- Menu dans le fond du site après la bannière -->
<?php if( $this->getData(['theme', 'menu', 'position']) === 'body-second' ):
// Menu dans le fond du site après la bannière et bannière limitée au site
$navStyle = '';
if( $this->getData(['theme', 'header', 'position'])==='body' && $this->getData(['theme', 'header', 'wide'])==='container' ){
$navStyle = 'style="max-width:'. $this->getData(['theme', 'site', 'width']) . '; display: block; margin: auto;"';
}
?>
<nav <?php echo $navStyle; ?> >
<!-- Menu burger -->
<div id="toggle">
<?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'. $fileLogo .'" width="'. $widthLogo.'" height="'. $heightLogo .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<!-- fin du menu burger -->
<?php
$menuClass = $this->getData(['theme', 'menu', 'wide']) === 'none' ? 'class="container-large"' : 'class="container"';
?> <div id="menu" <?php echo $menuClass; ?> > <?php $this->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 echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'. $fileLogo .'" width="'. $widthLogo.'" height="'. $heightLogo .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav>
<?php endif; ?>
<?php if(
$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'
)
): ?>
<!-- Bannière dans le site -->
<?php
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
?>
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"';?>>
<?php if ($this->getData(['theme','header','feature']) === 'wallpaper' ){ ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '<a class="headertitle" href="' . helper::baseUrl(false) . '">' : ''; ?>
<?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 class="notranslate" id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
<?php } elseif($this->getData(['theme','header','feature']) === 'feature' ){?>
<div id="featureContent">
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
<?php } else { ?>
<!-- Swiper -->
<?php if( ! $homePageOnly) echo $this->getData(['theme','header','swiperContent']); ?>
<?php } ?>
</header>
<?php endif; ?>
<?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 echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'. $fileLogo .'" width="'. $widthLogo.'" height="'. $heightLogo .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav>
<?php endif; ?>
<!-- Corps de page -->
<?php $this->showSection();?>
<!-- footer -->
<?php $this->showFooter();?>
<!-- Fin du site -->
<?php echo $this->getData(['theme', 'footer', 'position']) === 'site'? '</div>' : '';?>
<!-- fin de la div main_screenshot et bouton screenshot -->
<?php if( isset ($_SESSION['screenshot'] )){
if( $_SESSION['screenshot'] === 'on'){ ?>
</div>
<div><button id="screenshot" class="buttonScreenshot" type="button" ><img src="<?php echo helper::baseUrl(false); ?>core/vendor/screenshot/appareil_photo.png" width="100px"/></button></div>
<?php }}?>
<!-- Lien remonter en haut -->
<div id="backToTop"><?php echo template::ico('up'); ?></div>
<!-- Affichage du consentement aux cookies-->
<?php $this->showCookies(); ?>
<!-- Les scripts -->
<?php $this->showVendor('jsbody'); ?>
<?php $this->showScript();?>
</body>
</html>