1
|
|
|
<?php declare(strict_types=1); |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* You may not change or alter any portion of this comment or credits |
5
|
|
|
* of supporting developers from this source code or any supporting source code |
6
|
|
|
* which is considered copyrighted (c) material of the original comment or credit authors. |
7
|
|
|
* |
8
|
|
|
* This program is distributed in the hope that it will be useful, |
9
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
10
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
15
|
|
|
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
16
|
|
|
* @author XOOPS Development Team |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
use Xmf\Module\Admin; |
20
|
|
|
use XoopsModules\Xhttperror; |
21
|
|
|
|
22
|
|
|
require_once dirname(__DIR__) . '/preloads/autoloader.php'; |
23
|
|
|
|
24
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
25
|
|
|
$moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName |
26
|
|
|
|
27
|
|
|
//define('XHTTPERROR_PATH', XOOPS_ROOT_PATH . '/modules/xhttperror'); |
28
|
|
|
//define('XHTTPERROR_URL', XOOPS_URL . '/modules/xhttperror'); |
29
|
|
|
|
30
|
|
|
// module information |
31
|
|
|
//$mod_img = XHTTPERROR_URL . '/assets/images/xhttperror_slogo.png'; |
32
|
|
|
//$mod_copyright = "<a href='http://luciorota.altervista.org/xoops/' title='luciorota.altervista.org/xoops' target='_blank'>"; |
33
|
|
|
//$mod_copyright .= "<img src='" . $mod_img . "' alt='luciorota.altervista.org/xoops'>"; |
34
|
|
|
//$mod_copyright .= '</a>'; |
35
|
|
|
|
36
|
|
|
/** @var \XoopsDatabase $db */ |
37
|
|
|
/** @var Xhttperror\Helper $helper */ |
38
|
|
|
/** @var Xhttperror\Utility $utility */ |
39
|
|
|
$db = \XoopsDatabaseFactory::getDatabaseConnection(); |
40
|
|
|
$helper = Xhttperror\Helper::getInstance(); |
41
|
|
|
$utility = new Xhttperror\Utility(); |
42
|
|
|
//$configurator = new Xhttperror\Common\Configurator(); |
43
|
|
|
|
44
|
|
|
$helper->loadLanguage('common'); |
45
|
|
|
|
46
|
|
|
//handlers |
47
|
|
|
//$categoryHandler = new Xhttperror\CategoryHandler($db); |
48
|
|
|
//$downloadHandler = new Xhttperror\DownloadHandler($db); |
49
|
|
|
|
50
|
|
|
if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
51
|
|
|
define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
52
|
|
|
define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
53
|
|
|
define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
54
|
|
|
define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
55
|
|
|
define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
56
|
|
|
define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
57
|
|
|
define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
58
|
|
|
define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
59
|
|
|
define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
60
|
|
|
define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
61
|
|
|
define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
62
|
|
|
define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
63
|
|
|
define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
$pathIcon16 = Admin::iconUrl('', 16); |
67
|
|
|
$pathIcon32 = Admin::iconUrl('', 32); |
68
|
|
|
//$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
69
|
|
|
//$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
70
|
|
|
|
71
|
|
|
$icons = [ |
72
|
|
|
'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
73
|
|
|
'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
74
|
|
|
'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
75
|
|
|
'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
76
|
|
|
'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
77
|
|
|
'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
78
|
|
|
'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
79
|
|
|
'0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
80
|
|
|
'1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
81
|
|
|
]; |
82
|
|
|
|
83
|
|
|
$debug = false; |
84
|
|
|
|
85
|
|
|
// MyTextSanitizer object |
86
|
|
|
$myts = \MyTextSanitizer::getInstance(); |
87
|
|
|
|
88
|
|
|
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
89
|
|
|
require_once $GLOBALS['xoops']->path('class/template.php'); |
90
|
|
|
$GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
94
|
|
|
// Local icons path |
95
|
|
|
if (is_object($helper->getModule())) { |
96
|
|
|
$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
97
|
|
|
$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
98
|
|
|
|
99
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
|
|
|
100
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
101
|
|
|
} |
102
|
|
|
|