Completed
Push — master ( 72613d...069c91 )
by Michael
02:16
created

admin/admin_header.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
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    XOOPS Project (https://xoops.org)
14
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15
 * @package
16
 * @since
17
 * @author       XOOPS Development Team
18
 */
19
20
require_once __DIR__ . '/../../../include/cp_header.php';
21
require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php');
22
require_once __DIR__ . '/../class/utility.php';
23
require_once __DIR__ . '/../include/common.php';
24
25
$moduleDirName = basename(dirname(__DIR__));
26
27
if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) {
28
} else {
29
    $moduleHelper = Xmf\Module\Helper::getHelper('system');
30
}
31
$adminObject = \Xmf\Module\Admin::getInstance();
32
33
//require_once __DIR__ . '/../include/config.php';
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% 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...
34
35
//xoops_cp_header();
36
$adminObject = \Xmf\Module\Admin::getInstance();
37
38
$pathIcon16    = \Xmf\Module\Admin::iconUrl('', 16);
39
$pathIcon32    = \Xmf\Module\Admin::iconUrl('', 32);
40
$pathModIcon32 = $moduleHelper->getModule()->getInfo('modicons32');
41
42
$myts = MyTextSanitizer::getInstance();
43
44 View Code Duplication
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
45
    require_once $GLOBALS['xoops']->path('class/template.php');
46
    $xoopsTpl = new XoopsTpl();
47
}
48
49
//Module specific elements
50
//require_once $GLOBALS['xoops']->path("modules/{$moduleDirName}/include/functions.php");
51
//require_once $GLOBALS['xoops']->path("modules/{$moduleDirName}/include/config.php");
52
53
//Handlers
54
//$XXXHandler = xoops_getModuleHandler('XXX', $moduleDirName);
55
56
// Load language files
57
$moduleHelper->loadLanguage('admin');
58
$moduleHelper->loadLanguage('modinfo');
59
$moduleHelper->loadLanguage('main');
60
$moduleHelper->loadLanguage('common');
61