-
Notifications
You must be signed in to change notification settings - Fork 6
/
_header.inc.php
315 lines (260 loc) · 12.5 KB
/
_header.inc.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<?php
use Ladecadanse\HtmlShrink;
use Ladecadanse\UserLevel;
?>
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<?php if (HtmlShrink::getHeadMetaRobots($nom_page)) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>
<title>
<?php
if (ENV !== 'prod')
{
echo '['.ENV.'] ';
}
if ($nom_page != "index")
{
echo $page_titre." — La décadanse";
}
else
{
echo "La décadanse — ".$page_titre;
}
?>
</title>
<meta name="description" content="<?php echo $page_description ?? '' ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<link rel="stylesheet" type="text/css" href="/web/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="/web/css/imprimer.css" media="print" />
<link rel="stylesheet" type="text/css" href="/web/css/global.css?<?php echo time() ?>" />
<link rel="stylesheet" type="text/css" href="/web/css/calendrier.css" media="screen" />
<?php
$cssFilePath = "/web/css/${nom_page}.css";
if (file_exists(__ROOT__ . $cssFilePath))
{
?>
<link rel="stylesheet" type="text/css" href="<?php echo $cssFilePath; ?>" media="screen" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="/web/css/diggstyle.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/vendor/harvesthq/chosen/chosen.css" media="screen" />
<?php
if (isset($extra_css) && is_array($extra_css)) {
foreach ($extra_css as $import)
{
?>
<link rel="stylesheet" type="text/css" href="/web/css/<?php echo $import ?>.css" media="screen" title="Normal" />
<?php
}
}
?>
<link rel="stylesheet" type="text/css" media="screen and (min-width:800px)" href="/web/css/desktop.css">
<link rel="stylesheet" type="text/css" media="screen and (max-width:800px)" href="/web/css/mobile.css">
<link rel="stylesheet" type="text/css" media="print" href="/web/css/imprimer.css" title="Imprimer" />
<link rel="stylesheet" type="text/css" href="/vendor/fortawesome/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="/vendor/dimsemenov/magnific-popup/dist/magnific-popup.css">
<link rel="stylesheet" type="text/css" href="/web/js/libs/Zebra_datepicker/css/default/zebra_datepicker.min.css">
<?php HtmlShrink::showLinkRss($nom_page); ?>
<link rel="shortcut icon" href="/web/interface/favicon.png" />
<link rel="apple-touch-icon" href="/web/interface/apple-icon.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/web/interface/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/web/interface/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/web/interface/apple-icon-152x152.png" />
<?php
if (GLITCHTIP_ENABLED)
{
?>
<script src="https://browser.sentry-cdn.com/7.60.0/bundle.min.js" crossorigin="anonymous"></script>
<script>
Sentry.init({
dsn: "<?php echo GLITCHTIP_DSN ?>",
tracesSampleRate: 0.01,
});
</script>
<?php
}
?>
<?php
if (MATOMO_ENABLED) {
?>
<!-- Matomo -->
<script>
'use strict';
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//tools.ladecadanse.ch/matomo/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<?php
}
?>
<?php
if (GOOGLE_ANALYTICS_ENABLED) {
?>
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo GOOGLE_ANALYTICS_ID; ?>"></script>
<script>
'use strict';
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '<?php echo GOOGLE_ANALYTICS_ID; ?>');
</script>
<?php
}
?>
</head>
<body>
<div id="global">
<a name="haut" id="haut"></a>
<header id="entete">
<div id="titre_site">
<a href="/<?php echo $url_query_region_1er ?>"><img src="/web/interface/logo_titre.jpg" alt="La décadanse" width="180" height="35" /></a>
</div>
<div id="entete_haut">
<a id="btn_menu_pratique" href="#" title="Menu"><i class="fa fa-bars" aria-hidden="true"></i></a>
<nav id="menu_pratique">
<ul>
<li><a href="https://github.com/agilare/ladecadanse/" aria-label="Watch agilare/ladecadanse on GitHub" style="font-size:1em" target="_blank"><i class="fa fa-github" aria-hidden="true"></i>
</a>
</li>
<?php
foreach ($glo_menu_pratique as $nom => $lien)
{
$menu_pratique_li = '';
if ($nom == "Faire un don")
$menu_pratique_li = ' style="background: #ffe771;border-radius: 0 0 3px 3px;padding:2px 0;" ';
$ici = '';
if (strstr($_SERVER['PHP_SELF'], $lien) )
{
$ici = " class=\"ici\"";
}
?>
<li <?php echo $ici; ?> <?php echo $menu_pratique_li; ?>><a href="<?php echo $lien; ?>" <?php echo $ici; ?>><?php echo $nom; ?></a></li>
<?php
}
$ici = '';
if (!isset($_SESSION['SidPersonne']))
{
if ( strstr($_SERVER['PHP_SELF'], "annoncerEvenement.php") )
{
$ici = ' ici ';
}
?>
<li class="<?php echo $ici; ?>" ><a href="/articles/annoncerEvenement.php" >Annoncer un événement</a></li>
<li class="<?php echo $ici; ?> only-mobile" ><a href="/articles/charte-editoriale.php">Charte éditoriale</a></li>
<?php
}
if (!isset($_SESSION['SidPersonne']))
{
$ici = '';
$ici_login = '';
if (strstr($_SERVER['PHP_SELF'], "user-login.php") )
{
$ici_login = " class=\"ici\"";
}
if ( strstr($_SERVER['PHP_SELF'], "user-register.php"))
{
$ici = " class=\"ici\"";
}
?>
<li <?php echo $ici; ?>><a href="/user-register.php" title="Créer un compte"><strong>Inscription</strong></a></li>
<li <?php echo $ici_login; ?> rel="nofollow"><a href="/user-login.php" title="Se connecter au site">Connexion</a></li>
<?php
}
else
{
if ((isset($_SESSION['Sgroupe']) && $_SESSION['Sgroupe'] <= UserLevel::ACTOR)) {
$ici = '';
if (strstr($_SERVER['PHP_SELF'], "evenement-edit.php") )
{
$ici = " class=\"ici\"";
}
?>
<li <?php echo $ici; ?>><a href="/evenement-edit.php?action=ajouter">Ajouter un événement</a></li>
<?php
}
$ici = '';
if (strstr($_SERVER['PHP_SELF'], "user.php") )
{
$ici = " class=\"ici\"";
}
?>
<li <?php echo $ici; ?>><a href="/user.php?idP=<?php echo $_SESSION['SidPersonne']; ?>"><?php echo $_SESSION['user']; ?></a></li>
<li><a href="/user-logout.php" >Sortir</a></li>
<?php
if ($_SESSION['Sgroupe'] <= 4) {
echo '<li><a href="/admin/index.php" title="Administration" >Admin</a></li>';
}
}
?>
</ul>
</nav> <!-- menu pratique -->
</div> <!-- Fin entete_haut -->
<div class="spacer"><!-- --></div>
<nav id="menu">
<ul>
<?php
$menu_principal = array("Agenda" => "evenement-agenda.php", "Lieux" => "lieux.php", "Organisateurs" => "organisateurs.php");
foreach ($menu_principal as $nom => $lien)
{
$ici = '';
if (strstr($_SERVER['PHP_SELF'], $lien)
|| ($lien == "/lieux.php" && strstr($_SERVER['PHP_SELF'], "lieu.php"))
|| ($lien == "/organisateurs.php" && strstr($_SERVER['PHP_SELF'], "organisateur.php"))
|| ($lien == "/evenement-agenda.php" && strstr($_SERVER['PHP_SELF'], "agenda.php"))
)
{
$ici = ' class="ici" ';
}
?>
<li <?php echo $ici; ?>
<?php
if ($nom == "Agenda")
{
?>
id="bouton_agenda">
<?php
echo "<a href=\"/" . $lien . "?" . $url_query_region_et . "\">" . $nom . "</a>";
?>
</li>
<li id="bouton_calendrier">
<a href="#" id="btn_calendrier" class="mobile"><img src="<?php echo $url_images_interface_icons ?>calendar_view_week.png" alt="Calendrier" width="16" height="16" /></a>
</li>
<?php
}
else
{
?>
><a href="/<?php echo $lien."?".$url_query_region; ?>"><?php echo $nom; ?></a></li>
<?php
}
}
?>
<li class="form_recherche">
<a href="#" id="btn_search"><i class="fa fa-search" aria-hidden="true"></i></a>
<form class="recherche" action="/evenement-search.php" method="get" enctype="application/x-www-form-urlencoded">
<input type="text" class="mots" name="mots" size="22" maxlength="100" placeholder="Rechercher un événement" /><input type="submit" class="submit" name="formulaire" value=" " /><input type="text" name="name_as" value="" class="name_as" id="name_as" />
</form>
</li>
</ul>
<div class="clear_mobile"></div>
<form class="recherche_mobile" action="/evenement-search.php" method="get" enctype="application/x-www-form-urlencoded">
<input type="text" class="mots" name="mots" size="35" maxlength="100" placeholder="Rechercher un événement" /><input type="submit" class="submit" name="formulaire" value="OK" /><input type="text" name="name_as" value="" class="name_as" id="name_as" />
</form>
</nav>
<!-- Fin Menu-->
</header>
<!-- Fin entete -->
<div class="spacer"><!-- --></div>
<!-- Début Conteneur -->
<div id="conteneur" <?php if (strstr(dirname($_SERVER['PHP_SELF']), 'admin') || in_array($nom_page, ['evenement-edit', 'evenement-report', 'lieu-edit', 'lieu-text-edit', 'organisateur-edit', 'contacteznous', 'user-login', 'user-edit', 'user-register'])) { ?>style="padding-right: 5px" <?php } ?> >