|
35 | 35 |
|
36 | 36 | //die('HHH'); |
37 | 37 |
|
38 | | -if($_GET["nav"] == 'top') { |
| 38 | +//** Top Naviation |
| 39 | +if(isset($_GET['nav']) && $_GET['nav'] == 'top') { |
39 | 40 |
|
40 | | - $app->tpl->newTemplate("topnav.tpl.htm"); |
| 41 | + $app->tpl->newTemplate('topnav.tpl.htm'); |
41 | 42 |
|
42 | | - // Checke User Login and current module |
43 | | - if(!is_array($_SESSION["s"]['user']) or !is_array($_SESSION["s"]["module"])) { |
44 | | - // Loading Login Module |
| 43 | + //* Check User Login and current module |
| 44 | + if(!isset($_SESSION['s']['user']) or !is_array($_SESSION['s']['user']) or !is_array($_SESSION['s']['module'])) { |
| 45 | + //* Loading Login Module |
45 | 46 | include_once('login/lib/module.conf.php'); |
46 | | - $_SESSION["s"]['module'] = $module; |
47 | | - $topnav[] = array( 'title' => "Login", |
| 47 | + $_SESSION['s']['module'] = $module; |
| 48 | + $topnav[] = array( 'title' => 'Login', |
48 | 49 | 'active' => 1); |
49 | 50 | $module = null; |
50 | 51 | unset($module); |
51 | 52 | } else { |
52 | | - // Loading modules of the user and building top navigation |
53 | | - $modules = explode(',',$_SESSION["s"]["user"]["modules"]); |
| 53 | + //* Loading modules of the user and building top navigation |
| 54 | + $modules = explode(',', $_SESSION['s']['user']['modules']); |
54 | 55 | if(is_array($modules)) { |
55 | 56 | foreach($modules as $mt) { |
56 | | - if(is_file($mt."/lib/module.conf.php")) { |
57 | | - include_once($mt."/lib/module.conf.php"); |
58 | | - $active = ($module["name"] == $_SESSION["s"]["module"]["name"])?1:0; |
59 | | - $topnav[] = array( 'title' => $app->lng($module["title"]), |
60 | | - 'active' => $active, |
61 | | - 'module' => $module["name"]); |
| 57 | + if(is_file($mt.'/lib/module.conf.php')) { |
| 58 | + include_once($mt.'/lib/module.conf.php'); |
| 59 | + $active = ($module['name'] == $_SESSION['s']['module']['name']) ? 1 : 0; |
| 60 | + $topnav[] = array( 'title' => $app->lng($module['title']), |
| 61 | + 'active' => $active, |
| 62 | + 'module' => $module['name']); |
62 | 63 | } |
63 | 64 | } |
64 | 65 | } |
65 | 66 | } |
66 | 67 |
|
67 | | - // Topnavigation |
| 68 | + //* Topnavigation |
68 | 69 | $app->tpl->setLoop('nav_top',$topnav); |
69 | 70 |
|
70 | 71 | } |
71 | 72 |
|
72 | | -if($_GET["nav"] == 'side') { |
| 73 | +//** Side Naviation |
| 74 | +if(isset($_GET['nav']) && $_GET['nav'] == 'side') { |
73 | 75 |
|
74 | | - $app->tpl->newTemplate("sidenav.tpl.htm"); |
| 76 | + $app->tpl->newTemplate('sidenav.tpl.htm'); |
75 | 77 |
|
76 | | - // translating module navigation |
| 78 | + //* translating module navigation |
77 | 79 | $nav_translated = array(); |
78 | | - if(is_array($_SESSION["s"]["module"]["nav"])) { |
79 | | - foreach($_SESSION["s"]["module"]["nav"] as $nav) { |
| 80 | + if(isset($_SESSION['s']['module']['nav']) && is_array($_SESSION['s']['module']['nav'])) { |
| 81 | + foreach($_SESSION['s']['module']['nav'] as $nav) { |
80 | 82 | $tmp_items = array(); |
81 | | - foreach($nav["items"] as $item) { |
82 | | - $item["title"] = $app->lng($item["title"]); |
| 83 | + foreach($nav['items'] as $item) { |
| 84 | + $item['title'] = $app->lng($item['title']); |
83 | 85 | $tmp_items[] = $item; |
84 | 86 | } |
85 | | - $nav["title"] = $app->lng($nav["title"]); |
86 | | - $nav["items"] = $tmp_items; |
| 87 | + $nav['title'] = $app->lng($nav['title']); |
| 88 | + $nav['items'] = $tmp_items; |
87 | 89 | $nav_translated[] = $nav; |
88 | 90 | } |
89 | 91 | } else { |
|
0 commit comments