ModuleConfigurator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 42
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 29 1
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 http://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__ . '/../../../mainfile.php';
21
22
$moduleDirName = basename(dirname(__DIR__));
23
$capsDirName = strtoupper($moduleDirName);
24
25
if (!defined($capsDirName . '_DIRNAME')) {
26
//if (!defined(($capsDirName . '_DIRNAME'))) {
27
    define($capsDirName . '_DIRNAME', $GLOBALS['xoopsModule']->dirname());
28
    define($capsDirName . '_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($capsDirName . '_DIRNAME'));
29
    define($capsDirName . '_URL', XOOPS_URL . '/modules/' . constant($capsDirName . '_DIRNAME'));
30
    define($capsDirName . '_ADMIN', constant($capsDirName . '_URL') . '/admin/index.php');
31
    define($capsDirName . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($capsDirName . '_DIRNAME'));
32
    define($capsDirName . '_AUTHOR_LOGOIMG', constant($capsDirName . '_URL') . '/assets/images/logoModule.png');
33
}
34
35
// Define here the place where main upload path
36
37
//$img_dir = $GLOBALS['xoopsModuleConfig']['uploaddir'];
38
39
define($capsDirName . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' .$moduleDirName); // WITHOUT Trailing slash
40
//define("XXXXXX_UPLOAD_PATH", $img_dir); // WITHOUT Trailing slash
41
define($capsDirName . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
42
43
44
//constant($cloned_lang . '_CATEGORY_NOTIFY')
45
$uploadFolders = [
46
    constant($capsDirName . '_UPLOAD_PATH'),
47
    constant($capsDirName . '_UPLOAD_PATH') . '/thumbs'
48
];
49
50
$copyFiles = [
51
    constant($capsDirName . '_UPLOAD_PATH'),
52
    constant($capsDirName . '_UPLOAD_PATH') . '/thumbs'
53
];
54
/*
55
$oldFiles = [
56
    '/include/update_functions.php',
57
    '/include/install_functions.php'
58
];
59
*/
60
61
/**
62
 * Class ModuleConfigurator
63
 */
64
class ModuleConfigurator
65
{
66
    public $uploadFolders   = [];
67
    public $blankFiles  = [];
68
    public $templateFolders = [];
69
    public $oldFiles        = [];
70
    public $oldFolders      = [];
71
    public $name;
72
73
    /**
74
     * ModuleConfigurator constructor.
75
     */
76
    public function __construct()
77
    {
78
        $moduleDirName        = basename(dirname(__DIR__));
79
        $capsDirName          = strtoupper($moduleDirName);
80
        $this->name           = 'Module Configurator';
81
        $this->uploadFolders  = [
82
            constant($capsDirName . '_UPLOAD_PATH'),
83
            constant($capsDirName . '_UPLOAD_PATH') . '/thumbs',
84
        ];
85
        $this->blankFiles = [
86
            constant($capsDirName . '_UPLOAD_PATH'),
87
            constant($capsDirName . '_UPLOAD_PATH') . '/thumbs',
88
        ];
89
90
        $this->templateFolders = [
91
//            '/templates/',
92
//            '/templates/blocks/',
93
//            '/templates/admin/'
94
95
        ];
96
        $this->oldFiles        = [
97
//            '/admin/admin.css',
98
//            '/class/utilities.php',
99
        ];
100
        $this->oldFolders      = [
101
//            '/images',
102
//            '/style',
103
        ];
104
    }
105
}
106
107
// module information
108
$modCopyright
109
    = "<a href='http://xoops.org' title='XOOPS Project' target='_blank'>
110
                     <img src='" . constant($capsDirName . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>';
111