noalyss Version-9
menu.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4 \Noalyss\Dbg::echo_var(1,"LEVEL MENU IS {$level} access_code {$access_code}");
5
6
7?><div class="">
8 <?php
9 if ($level == 0) {
10 echo '<ul class="nav nav-pills nav-fill flex-row noprint" >';
11 }elseif ($level == 1) {
12 echo '<ul class="nav nav-pills nav-level2 noprint">';
13
14 } else {
15 echo '<ul class="nav nav-pills nav-level3 noprint">';
16 }
17 ?>
18
19
20 <?php
21 global $g_user;
22 // Display the menu
23 $class="nav-item ";
24 for($i=0;$i < count($amenu);$i++):
25 if ( (count($amenu)==1)) {
26?>
27 <li class="<?php echo $class?>">
28 <a class="nav-link active" href="do.php?gDossier=<?php echo Dossier::id()?>&ac=<?php echo $access_code?>" title="<?php echo h(gettext($amenu[$i]['me_description']))?>" >
29 <?php echo gettext($amenu[$i]['me_menu'])?>
30 </a>
31 </li>
32<?php
33 }
34 else {
35 $js="";
37 $class_link="nav-link";
38
39 if ( $amenu[$i]['me_url']!='')
40 {
41 $url=$amenu[$i]['me_url'];
42 }
43 elseif ($amenu[$i]['me_javascript'] != '')
44 {
45 $url="javascript:void(0)";
46 $js=sprintf(' onclick="%s"',$amenu[$i]['me_javascript']);
47 }
48 else
49 {
50 $a_request=explode('/', $access_code);
51 if ( isset($a_request [$level+1]) && $a_request[$level+1]==$amenu[$i]['me_code']) {
52 $class_link="nav-link active";
53 $class_list_element="nav-item li-active";
54 }
55 if ( $level == 0) {
56 $url=$a_request[0];
57
58 } elseif ($level == 1)
59 {
60 $url=$a_request[0].'/'.$a_request[1];
61
62 }
63 elseif ($level == 2)
64 {
65 $url=$a_request[0].'/'.$a_request[1].'/'.$a_request[2];
66
67 }
68 $url.='/'.$amenu[$i]['me_code'];
69 if ($url == $access_code ) { $class="nav-link active"; }
70 $url="do.php?gDossier=".Dossier::id()."&ac=".$url;
71 }
72
73
74?>
75<li class="<?=$class_list_element?>">
76 <a class="<?=$class_link?>" href="<?php echo $url;?>" <?php echo $js?> title="<?php if ( ! empty($amenu[$i]['me_description'])) echo h(gettext($amenu[$i]['me_description']))?>">
77 <?php if ( ! empty($amenu[$i]['me_menu'])) echo gettext($amenu[$i]['me_menu'])?>
78 </a>
79</li>
80
81
82<?php
83 } // end elseif ($level==0)
84
85 ?>
86 <?php
87 endfor;
88 ?>
89
90
91</ul>
92</div>
static echo_var($n_level, $msg, $print=true)
Display the value of a var if DEBUGNOALYSS is greater than $n_level, the debugging info has a certain...
Definition: dbg.php:45
$anc_filter title
if( $delta< 0) elseif( $delta==0)
$class_list_element
Definition: menu.php:36
$class
Definition: menu.php:23
global $g_user
Definition: menu.php:21
$class_link
Definition: menu.php:37
if(isset( $a_request[ $level+1]) &&$a_request[ $level+1]==$amenu[ $i][ 'me_code']) if( $level==0) elseif( $level==1) elseif($level==2) $url
Definition: menu.php:68
endfor