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 (https://www.gnu.org/licenses/gpl-2.0.html) |
15
|
|
|
* @author XOOPS Development Team |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
use Xmf\Module\Admin; |
19
|
|
|
use XoopsModules\Xsitemap\{ |
20
|
|
|
Helper, |
21
|
|
|
Utility, |
22
|
|
|
PluginHandler |
23
|
|
|
}; |
24
|
|
|
|
25
|
|
|
/** @var Helper $helper */ |
26
|
|
|
/** @var Utility $utility */ |
27
|
|
|
/** @var PluginHandler $pluginHandler */ |
28
|
|
|
|
29
|
|
|
require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
30
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
31
|
|
|
$moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
32
|
|
|
$db = \XoopsDatabaseFactory::getDatabaseConnection(); |
33
|
|
|
$helper = Helper::getInstance(); |
34
|
|
|
$utility = new Utility(); |
35
|
|
|
//$configurator = new Configurator(); |
36
|
|
|
$helper->loadLanguage('common'); |
37
|
|
|
if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
38
|
|
|
define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
39
|
|
|
define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
40
|
|
|
define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
41
|
|
|
define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
42
|
|
|
define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
43
|
|
|
define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
44
|
|
|
define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
45
|
|
|
define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($moduleDirNameUpper . '_DIRNAME')); |
46
|
|
|
define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
47
|
|
|
define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
48
|
|
|
define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
49
|
|
|
define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
50
|
|
|
define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
$helper->loadLanguage('common'); |
54
|
|
|
$pathIcon16 = Admin::iconUrl('', 16); |
55
|
|
|
$pathIcon32 = Admin::iconUrl('', 32); |
56
|
|
|
$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
57
|
|
|
$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
58
|
|
|
$debug = false; |
59
|
|
|
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
60
|
|
|
require_once $GLOBALS['xoops']->path('class/template.php'); |
61
|
|
|
$xoopsTpl = new \XoopsTpl(); |
62
|
|
|
} |
63
|
|
|
$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
64
|
|
|
// Local icons path |
65
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
|
|
|
66
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
67
|
|
|
//module handlers |
68
|
|
|
$pluginHandler = $helper->getHandler('Plugin'); |
69
|
|
|
|