Skip to content

Commit 6bb8787

Browse files
author
pedro_morgan
committed
* Silenced some warning with E_STRICT
* replaces " with ' where applicable
1 parent 4a6dba5 commit 6bb8787

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

interface/web/index.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
error_reporting(E_ALL|E_STRICT);
32+
3133
require_once('../lib/config.inc.php');
3234
require_once('../lib/app.inc.php');
3335

interface/web/nav.php

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,55 +35,57 @@
3535

3636
//die('HHH');
3737

38-
if($_GET["nav"] == 'top') {
38+
//** Top Naviation
39+
if(isset($_GET['nav']) && $_GET['nav'] == 'top') {
3940

40-
$app->tpl->newTemplate("topnav.tpl.htm");
41+
$app->tpl->newTemplate('topnav.tpl.htm');
4142

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
4546
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',
4849
'active' => 1);
4950
$module = null;
5051
unset($module);
5152
} 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']);
5455
if(is_array($modules)) {
5556
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']);
6263
}
6364
}
6465
}
6566
}
6667

67-
// Topnavigation
68+
//* Topnavigation
6869
$app->tpl->setLoop('nav_top',$topnav);
6970

7071
}
7172

72-
if($_GET["nav"] == 'side') {
73+
//** Side Naviation
74+
if(isset($_GET['nav']) && $_GET['nav'] == 'side') {
7375

74-
$app->tpl->newTemplate("sidenav.tpl.htm");
76+
$app->tpl->newTemplate('sidenav.tpl.htm');
7577

76-
// translating module navigation
78+
//* translating module navigation
7779
$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) {
8082
$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']);
8385
$tmp_items[] = $item;
8486
}
85-
$nav["title"] = $app->lng($nav["title"]);
86-
$nav["items"] = $tmp_items;
87+
$nav['title'] = $app->lng($nav['title']);
88+
$nav['items'] = $tmp_items;
8789
$nav_translated[] = $nav;
8890
}
8991
} else {

0 commit comments

Comments
 (0)