Completed
Branch master (1b2f30)
by Michael
06:29 queued 03:22
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
// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% 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...
10
11
$path = dirname(dirname(dirname(__DIR__)));
12
include_once $path . '/mainfile.php';
13
14
$dirname         = basename(dirname(__DIR__));
15
$moduleHandler   = xoops_getHandler('module');
16
$module          = $moduleHandler->getByDirname($dirname);
17
$pathIcon32      = $module->getInfo('icons32');
18
$pathModuleAdmin = $module->getInfo('dirmoduleadmin');
19
$pathLanguage    = $path . $pathModuleAdmin;
20
21
if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) {
22
    $fileinc = $pathLanguage . '/language/english/main.php';
23
}
24
25
include_once $fileinc;
26
27
$adminmenu              = array();
28
$i                      = 0;
29
$adminmenu[$i]['title'] = _AM_MODULEADMIN_HOME;
30
$adminmenu[$i]['link']  = 'admin/index.php';
31
$adminmenu[$i]['icon']  = $pathIcon32 . '/home.png';
32
++$i;
33
$adminmenu[$i]['title'] = _MI_SF_ADMENU1;
34
$adminmenu[$i]['link']  = 'admin/main.php';
35
$adminmenu[$i]['icon']  = $pathIcon32 . '/manage.png';
36
37
++$i;
38
$adminmenu[$i]['title'] = _MI_SF_ADMENU2;
39
$adminmenu[$i]['link']  = 'admin/category.php';
40
$adminmenu[$i]['icon']  = $pathIcon32 . '/category.png';
41
++$i;
42
$adminmenu[$i]['title'] = _MI_SF_ADMENU3;
43
$adminmenu[$i]['link']  = 'admin/faq.php';
44
$adminmenu[$i]['icon']  = $pathIcon32 . '/search.png';
45
++$i;
46
$adminmenu[$i]['title'] = _MI_SF_ADMENU4;
47
$adminmenu[$i]['link']  = 'admin/question.php';
48
$adminmenu[$i]['icon']  = $pathIcon32 . '/faq.png';
49
++$i;
50
$adminmenu[$i]['title'] = _MI_SF_ADMENU5;
51
$adminmenu[$i]['link']  = 'admin/permissions.php';
52
$adminmenu[$i]['icon']  = $pathIcon32 . '/permissions.png';
53
++$i;
54
$adminmenu[$i]['title'] = _MI_SF_ADMENU8;
55
$adminmenu[$i]['link']  = 'admin/import.php';
56
$adminmenu[$i]['icon']  = $pathIcon32 . '/download.png';
57
++$i;
58
$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
59
$adminmenu[$i]['link']  = 'admin/about.php';
60
$adminmenu[$i]['icon']  = $pathIcon32 . '/about.png';
61
//++$i;
0 ignored issues
show
Unused Code Comprehensibility introduced by
61% 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...
62
//$adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
63
//$adminmenu[$i]["link"]  = "admin/about2.php";
64
//$adminmenu[$i]["icon"]  = $pathIcon32 . '/about.png';
65
//-------------------------------
66
// Index
67
//$adminmenu[0]['title'] = _MI_SF_ADMENU1;
68
//$adminmenu[0]['link'] = "admin/index.php";
69
// Category
70
//$adminmenu[1]['title'] = _MI_SF_ADMENU2;
71
//$adminmenu[1]['link'] = "admin/category.php";
72
// faqs
73
//$adminmenu[2]['title'] = _MI_SF_ADMENU3;
74
//$adminmenu[2]['link'] = "admin/faq.php";
75
// Questions
76
//$adminmenu[3]['title'] = _MI_SF_ADMENU4;
77
//$adminmenu[3]['link'] = "admin/question.php";
78
//// Permissions
79
//$adminmenu[4]['title'] = _MI_SF_ADMENU5;
80
//$adminmenu[4]['link'] = "admin/permissions.php";
81
//// Blocks and Groups
82
//$adminmenu[5]['title'] = _MI_SF_ADMENU6;
83
//$adminmenu[5]['link'] = "admin/myblocksadmin.php";
84
// Goto Module
85
//$adminmenu[6]['title'] = _MI_SF_ADMENU7;
86
//$adminmenu[6]['link'] = "index.php";
87