Passed
Push — master ( 005d4f...8b5e26 )
by Michael
06:49
created

loadAdminConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits of
4
 supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit
6
 authors.
7
8
 This program is distributed in the hope that it will be useful, but
9
 WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
/**
13
 * Module: Pedigree
14
 *
15
 * @package   XoopsModules\Pedigree
16
 * @author    XOOPS Module Development Team
17
 * @copyright Copyright (c) 2001-2019 {@link https://xoops.org XOOPS Project}
18
 * @license   https://www.gnu.org/licenses/gpl-2.0.html GNU Public License
19
 * @since     1.32
20
 */
21
22
use Xmf\Request;
23
use XoopsModules\Pedigree\{
24
    Common,
25
    Constants,
26
    Common\TestdataButtons,
27
    Utility
28
};
29
30
/**
31
 * @var \Xmf\Module\Admin $adminObject
32
 * @var \XoopsModules\Pedigree\Helper $helper
33
 */
34
require_once __DIR__ . '/admin_header.php';
35
xoops_cp_header();
36
37
//check or upload folders
38
$configurator = new Common\Configurator();
39
foreach (array_keys($configurator->uploadFolders) as $i) {
40
    Utility::createFolder($configurator->uploadFolders[$i]);
41
    $adminObject->addConfigBoxLine($configurator->uploadFolders[$i], 'folder');
42
}
43
44
$adminObject->displayNavigation(basename(__FILE__));
45
46
//check for latest release
47
$newRelease = Utility::checkVerModule($helper);
48
if (!empty($newRelease)) {
49
    $adminObject->addItemButton($newRelease[0], $newRelease[1], 'download', 'style="color: Red"');
50
}
51
52
//------------- Test Data ----------------------------
53
54
if (Constants::DISP_SAMPLE_BTN == $helper->getConfig('displaySampleButton')) {
55
    TestdataButtons::loadButtonConfig($adminObject);
56
    $adminObject->displayButton('left', '');
57
}
58
//------------- End Test Data ----------------------------
59
60
//------------- Test Data Buttons ----------------------------
61
62
$op = Request::getCmd('op', '', 'GET');
63
64
switch ($op) {
65
    case 'hide_buttons':
66
        TestdataButtons::hideButtons();
67
        break;
68
    case 'show_buttons':
69
        TestdataButtons::showButtons();
70
        break;
71
}
72
//------------- End Test Data Buttons ----------------------------
73
74
75
$adminObject->displayIndex();
76
echo Utility::getServerStats();
77
78
require __DIR__ . '/admin_footer.php';
79