forked from poka-IT/cesium_website
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhead.php
162 lines (121 loc) · 4.33 KB
/
head.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
if (!$pageIsHome) {
$pageTitle .= " - " . "Cesium Ğ1";
}
$bodyIds = !isset($bodyIds) ? '' : $bodyIds;
?>
<!DOCTYPE html>
<html lang="fr-FR">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<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; ?>" />
<meta property="og:title" content="<?php echo $pageTitle; ?>"/>
<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 .'/" />';
}
?>
<?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', '/'),
'label' => dgettext('menu', 'Accueil')
],
[
'uri' => dgettext('menu', '/fonctionnalites'),
'label' => dgettext('menu', 'Fonctionnalités')
],
[
'uri' => dgettext('menu', '/telechargement'),
'label' => dgettext('menu', 'Télécharger')
],
[
'url' => 'https://demo.cesium.app',
'label' => dgettext('menu', 'Demo')
],
[
'uri' => dgettext('menu', '/tutoriel-cesium') . '/',
'label' => dgettext('menu', 'Tutoriel')
],
[
'uri' => dgettext('menu', '/merci'),
'label' => '❤ ' . dgettext('menu', 'Encouragez-nous !'),
'class' => 'support-us'
// ❤
]
);
?>
<header>
<?php
$element = $pageIsHome ? 'h1' : 'h2';
echo '
<'. $element .'>
<a href="'. parseURI("/") .'">
Cesium Ğ1
</a>
</'. $element .'>';
?>
<p>
<a href="<?php echo parseURI("/"); ?>">
<img src="<?php echo $rootURL; ?>/lib/logo-cesium.svg" alt="logo Cesium Ğ1" />
</a>
</p>
<nav>
<button><span>Afficher le menu</span></button>
<ul>
<?php
$itemsNb = count($menu);
for ($i = 0; $i < $itemsNb; ++$i)
{
$classes = '';
$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="'. $href . '">
<span>'. $menu[$i]['label'] .'</span>
</a>
</li>';
}
?>
</ul>
</nav>
</header>
<main>