menu_responsive.ctp
6.24 KB
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
<?php
//$has_search_field = true;
// Variables passées à cet élément
//debug($this->viewVars);
$has_search_field = $has_search_field;
// Uniquement si connecté :
//$role == $role
//$USER_IS_UTILISATEUR = $USER_IS_UTILISATEUR;
// ...
?>
<!-- début menu -->
<nav class="navbar navbar-expand-xl navbar-light bg-light">
<!-- BOUTON MENU DEPLIANT MOBILE (3 traits horizontaux) -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- MENU HORIZONTAL -->
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<!-- RETOUR -->
<li class="nav-item">
<?=$this->Html->link('<i class="nav-link" id="police">Retour</i>', 'javascript:window.history.go(-1)', ['escape' => false])?>
</li>
<!-- ACCUEIL -->
<li class="nav-item">
<?=$this->Html->link('<i class="nav-link" id="police">Accueil</i>', ['controller' => 'pages','action' => 'home'], ['escape' => false]);?>
</li>
<!-- IF user is logued in -->
<?php if(isset($username) && $username != " "): ?>
<!-- MATÉRIEL -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">Matériel</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<?=$this->Html->link('<i class="dropdown-item">Nouveau</i>', ['controller' => 'Materiels','action' => 'add'], ['escape' => false]);?>
<?=$this->Html->link(
'<i class="dropdown-item">Ma liste</i>',
[
'controller' => 'Materiels',
'action' => 'index',
'age' => 0,
'MY' => $username
],
['escape' => false]
);?>
<?=$this->Html->link('<i class="dropdown-item">Tous</i>', ['controller' => 'Materiels','action' => 'index'], ['escape' => false])?>
<?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'materiels','action' => 'find'], ['escape' => false]);?>
</div>
</li>
<!-- SUIVI -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">Suivi</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<?=$this->Html->link('<i class="dropdown-item">Tous</i>', ['controller' => 'Suivis','action' => 'index'], ['escape' => false])?>
<?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'suivis','action' => 'find'], ['escape' => false]);?>
</div>
</li>
<!-- EMPRUNT -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="text-decoration-color: #17457F;">Emprunt</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<?=$this->Html->link('<i class="dropdown-item">Tous</i>', ['controller' => 'Emprunts','action' => 'index'], ['escape' => false]);?>
<?=$this->Html->link('<i class="dropdown-item">Rechercher</i>', ['controller' => 'emprunts','action' => 'find'], ['escape' => false])?>
</div>
</li>
<!-- Autres listes -->
<?php
//if (! $USER_IS_UTILISATEUR) {
if ($USER_IS_ADMIN_OR_MORE) {
echo '<li class="nav-item">';
echo $this->Html->link('<i class="nav-link aligner" id="police">Autres listes</i>', ['controller' => 'pages','action' => 'tools_sm'], ['escape' => false]);
echo '</li>';
}
?>
<!-- Outils -->
<?php
//if(isset($role) && !(in_array($role, ['Utilisateur']))):
if ($USER_IS_ADMIN_OR_MORE) {
echo '<li class="nav-item">';
echo $this->Html->link('<i class="nav-link" id="police">Outils</i>', ['controller' => 'pages','action' => 'tools'], ['escape' => false]);
echo '</li>';
}
?>
<!-- ENDIF user is logued in -->
<?php endif; ?>
<!-- A propos -->
<li class="nav-item">
<?=$this->Html->link('<i class="nav-link aligner" id="police">A propos</i>', ['controller' => 'pages','action' => 'about'], ['escape' => false])?>
</li>
</ul>
<!-- Champ Recherche -->
<div id="barre">
<?php
if ($has_search_field && isset($username) && $username != " ") {
echo $this->Form->create('Materiel', ['url' => '/materiels/find']);
echo '<input name="s_all_2" class="form-control mr-2 mr-sm-2 col-8 col-sm-6 col-md-6 col-lg-9" type="search" placeholder="Recherche (matériels)" aria-label="Search" id="MaterielSAll barre">';
echo $this->Form->button('Chercher', [ 'class'=>'btn btn-outline-success', 'type'=>'submit', 'name' => 'MaterielSAll', 'id' => 'MaterielSAll', 'style' => 'margin: 0px;' ]);
echo $this->Form->end();
}
?>
</div>
<!-- FIN MENU HORIZONTAL -->
</div>
</nav>
<!-- fin menu -->