Deltacms/core/layout/main.php

257 lines
12 KiB
PHP
Raw Normal View History

2022-01-31 09:10:49 +01:00
<!DOCTYPE html>
2022-03-21 08:32:27 +01:00
<?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.'">'; }
2022-03-21 08:32:27 +01:00
?>
2022-01-31 09:10:49 +01:00
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
2023-02-15 00:52:04 +01:00
<meta name="generator" content="DeltaCMS <?=common::DELTA_VERSION?>">
2022-09-02 08:44:18 +02:00
<?php
$this->showMetaTitle();
2022-12-29 08:31:27 +01:00
if( $this->getData(['config', 'social', 'headFacebook' ]) === true) $this->showMetaPropertyFacebook();
2022-09-02 08:44:18 +02:00
?>
2023-02-07 16:53:49 +01:00
<base href="<?php echo helper::baseUrl(true); ?>">
<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">
2023-02-06 17:43:22 +01:00
<?php $this->showStyle();
2023-02-07 16:53:49 +01:00
$this->showSharedVariables();
2023-02-06 17:43:22 +01:00
$this->sortVendor();
$this->showVendor('css'); echo PHP_EOL;?>
2023-02-07 16:53:49 +01:00
<link rel="stylesheet" href="<?php echo self::DATA_DIR; ?>custom.css">
2023-02-02 22:10:01 +01:00
<?php
$this->showFavicon();
2023-02-06 17:43:22 +01:00
$this->showVendor('jshead');
2023-02-02 22:10:01 +01:00
?>
2022-01-31 09:10:49 +01:00
<!-- 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');
}?>
2023-01-22 15:06:00 +01:00
<?php
2022-05-01 11:45:17 +02:00
if( isset ($_SESSION['screenshot'] )){
2022-05-30 09:05:11 +02:00
if( $_SESSION['screenshot'] === 'on'){?>
2023-02-03 17:37:59 +01:00
<script src="core/vendor/screenshot/html2canvas.min.js"></script>
2022-05-01 11:45:17 +02:00
<?php } }?>
2022-01-31 09:10:49 +01:00
</head>
<body>
<!-- Barre d'administration -->
<?php if($this->getUser('group') > self::GROUP_MEMBER): ?>
<?php $this->showBar(); ?>
<?php endif;?>
<!-- Notifications -->
<?php $this->showNotification(); ?>
2023-01-22 15:06:00 +01:00
2022-01-31 09:10:49 +01:00
<!-- Taille du Logo pour le menu burger -->
2023-01-22 15:06:00 +01:00
<?php $fileLogo = './site/file/source/'. $this->getData(['theme', 'menu', 'burgerLogo']);
if( $this->getData(['theme','menu','burgerContent']) === 'logo'
&& file_exists( $fileLogo)
2022-01-31 09:10:49 +01:00
&& $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;
}
} ?>
2023-01-22 15:06:00 +01:00
2022-01-31 09:10:49 +01:00
<!-- div screenshot -->
2022-05-01 11:45:17 +02:00
<?php if( isset ($_SESSION['screenshot'] )){
if( $_SESSION['screenshot'] === 'on'){ ?>
<div id="main_screenshot">
<?php }} ?>
2022-01-31 09:10:49 +01:00
<!-- 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 -->
2022-10-10 09:10:39 +02:00
<?php $homePageOnly = false;
if( $this->getUrl(0) !== 'theme' ){
if( $this->getUrl(0) !== $this->getData(['locale', 'homePageId' ]) && $this->getData(['theme','header','homePageOnly']) === true) $homePageOnly = true;
}?>
2022-01-31 09:10:49 +01:00
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<?php
2022-10-10 09:10:39 +02:00
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
2022-01-31 09:10:49 +01:00
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
$headerClass .= $this->getData(['theme', 'header', 'wide']) === 'none' ? '' : 'container';
?>
2022-12-18 12:06:32 +01:00
<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) . '">' : ''; ?>
2022-01-31 09:10:49 +01: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')
): ?>
<span class="notranslate" id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
2022-10-10 09:10:39 +02:00
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
2022-12-18 12:06:32 +01:00
<?php } elseif( $this->getData(['theme','header','feature']) === 'feature') { ?>
2022-01-31 09:10:49 +01:00
<div id="featureContent">
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
2022-12-18 12:06:32 +01:00
<?php } else { ?>
<!-- Swiper -->
2022-12-18 14:41:47 +01:00
<?php if( ! $homePageOnly) echo $this->getData(['theme','header','swiperContent']);?>
2022-12-18 12:06:32 +01:00
<?php } ?>
2023-01-22 15:06:00 +01:00
</header>
2022-01-31 09:10:49 +01:00
<?php endif; ?>
<!-- Menu dans le fond du site après la bannière -->
<?php if($this->getData(['theme', 'menu', 'position']) === 'body-second'): ?>
<nav>
<!-- 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
2022-10-10 09:10:39 +02:00
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
2022-01-31 09:10:49 +01:00
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
2022-09-02 08:44:18 +02:00
?>
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"';?>>
2022-12-18 12:06:32 +01:00
<?php if ($this->getData(['theme','header','feature']) === 'wallpaper' ){ ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '<a class="headertitle" href="' . helper::baseUrl(false) . '">' : ''; ?>
2022-09-02 08:44:18 +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')
): ?>
<span class="notranslate" id="themeHeaderTitle"><?php echo $this->getData(['locale', 'title']); ?></span>
2022-01-31 09:10:49 +01:00
<?php else: ?>
2022-09-02 08:44:18 +02:00
<span id="themeHeaderTitle">&nbsp;</span>
2022-01-31 09:10:49 +01:00
<?php endif; ?>
2022-10-10 09:10:39 +02:00
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
2022-12-18 12:06:32 +01:00
<?php } elseif($this->getData(['theme','header','feature']) === 'feature' ){?>
2022-09-02 08:44:18 +02:00
<div id="featureContent">
2022-12-18 12:06:32 +01:00
<?php echo $this->getData(['theme','header','featureContent']);?>
2022-10-10 09:10:39 +02:00
</div>
2022-12-18 12:06:32 +01:00
<?php } else { ?>
<!-- Swiper -->
2022-12-18 14:41:47 +01:00
<?php if( ! $homePageOnly) echo $this->getData(['theme','header','swiperContent']); ?>
2022-12-18 12:06:32 +01:00
<?php } ?>
2022-01-31 09:10:49 +01:00
</header>
2022-10-10 09:10:39 +02:00
<?php endif; ?>
2022-01-31 09:10:49 +01: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 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; ?>
2023-01-22 15:06:00 +01:00
2022-01-31 09:10:49 +01:00
<!-- Corps de page -->
<?php $this->showSection();?>
2022-09-11 09:42:42 +02:00
2022-01-31 09:10:49 +01:00
<!-- 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 -->
2022-05-01 11:45:17 +02:00
<?php if( isset ($_SESSION['screenshot'] )){
if( $_SESSION['screenshot'] === 'on'){ ?>
</div>
2023-01-22 16:12:17 +01:00
<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>
2022-05-01 11:45:17 +02:00
<?php }}?>
2023-01-22 15:06:00 +01:00
2022-01-31 09:10:49 +01:00
<!-- Lien remonter en haut -->
<div id="backToTop"><?php echo template::ico('up'); ?></div>
2023-01-22 15:06:00 +01:00
<!-- Affichage du consentement aux cookies-->
2022-01-31 09:10:49 +01:00
<?php $this->showCookies(); ?>
<!-- Les scripts -->
2023-02-06 17:43:22 +01:00
<?php $this->showVendor('jsbody'); ?>
<?php $this->showScript();?>
2022-01-31 09:10:49 +01:00
</body>
</html>