Completed
Branch master (c92e39)
by Michael
02:32
created

admin/menu.php (2 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
9
10
11
if (!isset($moduleDirName)) {
12
    $moduleDirName = basename(dirname(__DIR__));
13
}
14
15
if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
0 ignored issues
show
This if statement is empty and can be removed.

This check looks for the bodies of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These if bodies can be removed. If you have an empty if but statements in the else branch, consider inverting the condition.

if (rand(1, 6) > 3) {
//print "Check failed";
} else {
    print "Check succeeded";
}

could be turned into

if (rand(1, 6) <= 3) {
    print "Check succeeded";
}

This is much more concise to read.

Loading history...
16
} else {
17
    $moduleHelper = Xmf\Module\Helper::getHelper('system');
18
}
19
$adminObject = \Xmf\Module\Admin::getInstance();
20
21
$pathIcon32    = \Xmf\Module\Admin::menuIconPath('');
22
//$pathModIcon32 = $moduleHelper->getModule()->getInfo('modicons32');
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
24
$moduleHelper->loadLanguage('modinfo');
25
26
$adminObject              = array();
27
$i                      = 0;
28
$adminmenu[$i]['title'] = _AM_MODULEADMIN_HOME;
29
$adminmenu[$i]['link']  = 'admin/index.php';
30
$adminmenu[$i]['icon']  = $pathIcon32 . '/home.png';
31
++$i;
32
$adminmenu[$i]['title'] = _MI_SF_ADMENU1;
33
$adminmenu[$i]['link']  = 'admin/main.php';
34
$adminmenu[$i]['icon']  = $pathIcon32 . '/manage.png';
35
36
++$i;
37
$adminmenu[$i]['title'] = _MI_SF_ADMENU2;
38
$adminmenu[$i]['link']  = 'admin/category.php';
39
$adminmenu[$i]['icon']  = $pathIcon32 . '/category.png';
40
++$i;
41
$adminmenu[$i]['title'] = _MI_SF_ADMENU3;
42
$adminmenu[$i]['link']  = 'admin/faq.php';
43
$adminmenu[$i]['icon']  = $pathIcon32 . '/search.png';
44
++$i;
45
$adminmenu[$i]['title'] = _MI_SF_ADMENU4;
46
$adminmenu[$i]['link']  = 'admin/question.php';
47
$adminmenu[$i]['icon']  = $pathIcon32 . '/faq.png';
48
++$i;
49
$adminmenu[$i]['title'] = _MI_SF_ADMENU5;
50
$adminmenu[$i]['link']  = 'admin/permissions.php';
51
$adminmenu[$i]['icon']  = $pathIcon32 . '/permissions.png';
52
++$i;
53
$adminmenu[$i]['title'] = _MI_SF_ADMENU8;
54
$adminmenu[$i]['link']  = 'admin/import.php';
55
$adminmenu[$i]['icon']  = $pathIcon32 . '/download.png';
56
++$i;
57
$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
58
$adminmenu[$i]['link']  = 'admin/about.php';
59
$adminmenu[$i]['icon']  = $pathIcon32 . '/about.png';
60
//++$i;
61
//$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
62
//$adminmenu[$i]["link"]  = "admin/about2.php";
63
//$adminmenu[$i]["icon"]  = $pathIcon32 . '/about.png';
64
//-------------------------------
65
// Index
66
//$adminmenu[0]['title'] = _MI_SF_ADMENU1;
67
//$adminmenu[0]['link'] = "admin/index.php";
68
// Category
69
//$adminmenu[1]['title'] = _MI_SF_ADMENU2;
70
//$adminmenu[1]['link'] = "admin/category.php";
71
// faqs
72
//$adminmenu[2]['title'] = _MI_SF_ADMENU3;
73
//$adminmenu[2]['link'] = "admin/faq.php";
74
// Questions
75
//$adminmenu[3]['title'] = _MI_SF_ADMENU4;
76
//$adminmenu[3]['link'] = "admin/question.php";
77
//// Permissions
78
//$adminmenu[4]['title'] = _MI_SF_ADMENU5;
79
//$adminmenu[4]['link'] = "admin/permissions.php";
80
//// Blocks and Groups
81
//$adminmenu[5]['title'] = _MI_SF_ADMENU6;
82
//$adminmenu[5]['link'] = "admin/myblocksadmin.php";
83
// Goto Module
84
//$adminmenu[6]['title'] = _MI_SF_ADMENU7;
85
//$adminmenu[6]['link'] = "index.php";
86