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\Lexikon\{ |
20
|
|
|
Common\Configurator, |
21
|
|
|
Helper, |
22
|
|
|
Utility, |
23
|
|
|
EntriesHandler, |
24
|
|
|
CategoriesHandler |
25
|
|
|
}; |
26
|
|
|
/** @var Helper $helper */ |
27
|
|
|
/** @var Utility $utility */ |
28
|
|
|
|
29
|
|
|
require \dirname(__DIR__) . '/preloads/autoloader.php'; |
30
|
|
|
|
31
|
|
|
$moduleDirName = \basename(\dirname(__DIR__)); |
32
|
|
|
$moduleDirNameUpper = mb_strtoupper($moduleDirName); |
33
|
|
|
|
34
|
|
|
$db = \XoopsDatabaseFactory::getDatabaseConnection(); |
35
|
|
|
$helper = Helper::getInstance(); |
36
|
|
|
$utility = new Utility(); |
37
|
|
|
//$configurator = new Configurator(); |
38
|
|
|
|
39
|
|
|
$helper->loadLanguage('common'); |
40
|
|
|
|
41
|
|
|
$entriesHandler = new EntriesHandler($db); |
42
|
|
|
$categoriesHandler = new CategoriesHandler($db); |
43
|
|
|
|
44
|
|
|
$pathIcon16 = Admin::iconUrl('', 16); |
45
|
|
|
$pathIcon32 = Admin::iconUrl('', 32); |
46
|
|
|
//$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
47
|
|
|
//$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
48
|
|
|
|
49
|
|
|
if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
50
|
|
|
define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
51
|
|
|
define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
52
|
|
|
define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
53
|
|
|
define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName); |
54
|
|
|
define($moduleDirNameUpper . '_IMAGES_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
55
|
|
|
define($moduleDirNameUpper . '_IMAGES_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images/'); |
56
|
|
|
define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
57
|
|
|
define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
58
|
|
|
define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
59
|
|
|
// define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
60
|
|
|
define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
61
|
|
|
define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
62
|
|
|
define($moduleDirNameUpper . '_CAT_IMAGES_URL', XOOPS_UPLOAD_URL . ' / ' . constant($moduleDirNameUpper . '_DIRNAME') . '/images/category'); |
63
|
|
|
define($moduleDirNameUpper . '_CAT_IMAGES_PATH', XOOPS_UPLOAD_PATH . '/' . constant($moduleDirNameUpper . '_DIRNAME') . ' / images / category'); |
64
|
|
|
define($moduleDirNameUpper . '_CACHE_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/'); |
65
|
|
|
define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', $pathIcon32 . '/xoopsmicrobutton.gif'); |
66
|
|
|
define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
$icons = [ |
70
|
|
|
'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
71
|
|
|
'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
72
|
|
|
'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
73
|
|
|
'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
74
|
|
|
'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
75
|
|
|
'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
76
|
|
|
'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
77
|
|
|
'0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
78
|
|
|
'1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
79
|
|
|
]; |
80
|
|
|
|
81
|
|
|
$debug = false; |
82
|
|
|
|
83
|
|
|
// MyTextSanitizer object |
84
|
|
|
$myts = \MyTextSanitizer::getInstance(); |
85
|
|
|
|
86
|
|
|
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
87
|
|
|
require_once $GLOBALS['xoops']->path('class/template.php'); |
88
|
|
|
$GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
92
|
|
|
// Local icons path |
93
|
|
|
if (is_object($helper->getModule())) { |
94
|
|
|
$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
95
|
|
|
$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
96
|
|
|
|
97
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
|
|
|
98
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
99
|
|
|
} |
100
|
|
|
|