diff --git a/head.php b/head.php index 6dd146373e19110adbff5da423e6ac18bda1370e..11624ce5fc322b817aace7a4189a9ec26bbf6f3d 100644 --- a/head.php +++ b/head.php @@ -1,6 +1,6 @@ <?php if (!$pageIsHome) { - + $pageTitle .= " - " . "Cesium Ğ1"; } @@ -19,7 +19,7 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds; <title><?php echo $pageTitle; ?></title> <link type="image/x-icon" rel="shortcut icon" href="<?php echo $rootURL; ?>/img/favicon.png" /> <meta name="generator" content="BorisPaing" /> - + <meta name="description" content="<?php echo $pageDescription; ?>" /> @@ -27,83 +27,83 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds; <meta property="og:description" content="<?php echo $pageDescription; ?>" /> <meta property="og:url" content="http://cesium.app/" /> <meta property="og:site_name" content="Cesium Ğ1" /> - + <meta property="og:image" content="<?php echo $rootURL . '/i18n/' . LANG_FOLDER . '/contents' . dgettext('menu', '/accueil') . dgettext('home', '/Cesium-G1-maquette.png'); ?>" /> <meta property="og:type" content="website" /> <meta name="twitter:description" content="<?php echo $pageDescription; ?>" /> <meta name="twitter:title" content="<?php echo $pageTitle; ?>" /> - + <meta name="twitter:image" content="<?php echo $rootURL . '/i18n/' . LANG_FOLDER . '/contents' . dgettext('menu', '/accueil') . dgettext('home', '/Cesium-G1-maquette.png'); ?>" /> <meta name="twitter:card" content="summary_large_image" /> - + <script type="text/javascript" src="<?php echo $rootURL; ?>/lib/lazyImg.min.js"></script> - + <?php foreach ($availableLanguages as $isoCode => $v) { - echo '<link rel="alternate" hreflang="'. $isoCode .'" href="'. $rootURL .'/'. $isoCode .'/" />'; + echo '<link rel="alternate" hreflang="'. $isoCode .'" href="'. $rootURL .'/'. $isoCode .'/" />'; } ?> - + <?php - + if ($_SERVER['SERVER_NAME'] == 'localhost') { - + echo ' <link rel="stylesheet/less" type="text/css" href="' . $rootURL . '/lib/style.less" /> <script src="' . $rootURL . '/lib/less-3.9.0.min.js" ></script> '; - + } else { - + echo '<link rel="stylesheet" type="text/css" media="screen" href="' . $rootURL . '/lib/style.css" />'; - + } - + ?> - + <?php if (FUNDING_ALT) echo '<link type="text/css" rel="stylesheet" media="screen" href="'. $rootURL .'/lib/style-funding-alt-1.css" />'; ?> - + </head> <body id="<?php echo $bodyIds; ?>"> <?php $menu = array( [ - 'uri' => dgettext('menu', '/'), + 'uri' => dgettext('menu', '/'), 'label' => dgettext('menu', 'Accueil') - ], + ], [ - 'uri' => dgettext('menu', '/fonctionnalites'), + 'uri' => dgettext('menu', '/fonctionnalites'), 'label' => dgettext('menu', 'Fonctionnalités') - ], + ], [ - 'uri' => dgettext('menu', '/telechargement'), + 'uri' => dgettext('menu', '/telechargement'), 'label' => dgettext('menu', 'Télécharger') ], - [ - 'uri' => 'https://demo.cesium.app', - 'label' => dgettext('menu', 'Demo') - ], + [ + 'url' => 'https://demo.cesium.app', + 'label' => dgettext('menu', 'Demo') + ], [ - 'uri' => dgettext('menu', '/tutoriel-cesium') . '/', + 'uri' => dgettext('menu', '/tutoriel-cesium') . '/', 'label' => dgettext('menu', 'Tutoriel') ], [ - 'uri' => dgettext('menu', '/merci'), - 'label' => '❤ ' . dgettext('menu', 'Encouragez-nous !'), + 'uri' => dgettext('menu', '/merci'), + 'label' => '❤ ' . dgettext('menu', 'Encouragez-nous !'), 'class' => 'support-us' // ❤ ] ); ?> - + <header> <?php - + $element = $pageIsHome ? 'h1' : 'h2'; - + echo ' <'. $element .'> <a href="'. parseURI("/") .'"> @@ -111,7 +111,7 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds; </a> </'. $element .'>'; ?> - + <p> <a href="<?php echo parseURI("/"); ?>"> <img src="<?php echo $rootURL; ?>/lib/logo-cesium.svg" alt="logo Cesium Ğ1" /> @@ -130,16 +130,25 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds; for ($i = 0; $i < $itemsNb; ++$i) { $classes = ''; - - $classes .= ($_SERVER['REQUEST_URI'] == parseURI($menu[$i]['uri'])) ? ' active' : ''; - + + $classes .= isset($menu[$i]['class']) ? ' '. $menu[$i]['class'] . '"' : ''; - + + if (isset($menu[$i]['uri'])) { + + $classes .= ($_SERVER['REQUEST_URI'] == parseURI($menu[$i]['uri'])) ? ' active' : ''; + $href = parseURI($menu[$i]['uri']); + + } else { + + $href = $menu[$i]['url']; + } + $classes = !empty($classes) ? ' class="'. $classes .'"' : ''; - + echo ' <li'. $classes . '> - <a role="menuitem" href="'. parseURI($menu[$i]['uri']) . '"> + <a role="menuitem" href="'. $href . '"> <span>'. $menu[$i]['label'] .'</span> </a> </li>'; @@ -149,5 +158,5 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds; </ul> </nav> </header> - + <main>