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
|
|
|
use Xoopsmodules\instruction; |
13
|
|
|
|
14
|
|
|
//include __DIR__ . '/../preloads/autoloader.php'; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @copyright XOOPS Project https://xoops.org/ |
18
|
|
|
* @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html) |
19
|
|
|
* @package |
20
|
|
|
* @since |
21
|
|
|
* @author XOOPS Development Team |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
//if (!defined('INSTRUCTION_MODULE_PATH')) { |
25
|
|
|
// define('INSTRUCTION_DIRNAME', basename(dirname(__DIR__))); |
26
|
|
|
// define('INSTRUCTION_URL', XOOPS_URL . '/modules/' . INSTRUCTION_DIRNAME); |
27
|
|
|
// define('INSTRUCTION_IMAGE_URL', INSTRUCTION_URL . '/assets/images/'); |
28
|
|
|
// define('INSTRUCTION_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . INSTRUCTION_DIRNAME); |
29
|
|
|
// define('INSTRUCTION_IMAGE_PATH', INSTRUCTION_ROOT_PATH . '/assets/images'); |
30
|
|
|
// define('INSTRUCTION_ADMIN_URL', INSTRUCTION_URL . '/admin/'); |
31
|
|
|
// define('INSTRUCTION_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . INSTRUCTION_DIRNAME); |
32
|
|
|
// define('INSTRUCTION_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . INSTRUCTION_DIRNAME); |
33
|
|
|
//} |
34
|
|
|
//xoops_loadLanguage('common', INSTRUCTION_DIRNAME); |
35
|
|
|
|
36
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/Utility.php'; |
37
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/include/constants.php'; |
38
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/include/seo_functions.php'; |
39
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/metagen.php'; |
40
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/session.php'; |
41
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/xoalbum.php'; |
42
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/request.php'; |
43
|
|
|
|
44
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/Helper.php'; |
45
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/InstructionHandler.php'; |
46
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/CategoryHandler.php'; |
47
|
|
|
//require_once INSTRUCTION_ROOT_PATH . '/class/PageHandler.php'; |
48
|
|
|
|
49
|
|
|
require_once __DIR__ . '/../class/Helper.php'; |
50
|
|
|
require_once __DIR__ . '/../class/Utility.php'; |
51
|
|
|
require_once __DIR__ . '/../class/InstructionHandler.php'; |
52
|
|
|
require_once __DIR__ . '/../class/CategoryHandler.php'; |
53
|
|
|
require_once __DIR__ . '/../class/PageHandler.php'; |
54
|
|
|
|
55
|
|
|
//xoops_load('constants', INSTRUCTION_DIRNAME); |
56
|
|
|
//xoops_load('utility', INSTRUCTION_DIRNAME); |
57
|
|
|
|
58
|
|
|
///** @var Xoopsmodules\instruction\Helper $helper */ |
59
|
|
|
//$helper = instruction\Helper::getInstance(); |
60
|
|
|
|
61
|
|
|
// Объявляем объекты |
62
|
|
|
//$instructionHandler = xoops_getModuleHandler('instruction', 'instruction'); |
63
|
|
|
//$categoryHandler = xoops_getModuleHandler('category', 'instruction'); |
64
|
|
|
//$pageHandler = xoops_getModuleHandler( 'page', 'instruction' ); |
65
|
|
|
|
66
|
|
|
$db = \XoopsDatabaseFactory::getDatabase(); |
67
|
|
|
|
68
|
|
|
$helper = instruction\Helper::getInstance(); |
69
|
|
|
/** @var \Xoopsmodules\instruction\Utility $utility */ |
70
|
|
|
$utility = new instruction\Utility(); |
71
|
|
|
/** @var \Xoopsmodules\instruction\InstructionHandler $instructionHandler */ |
72
|
|
|
$instructionHandler = new instruction\InstructionHandler($db); |
73
|
|
|
/** @var \Xoopsmodules\instruction\CategoryHandler $categoryHandler */ |
74
|
|
|
$categoryHandler = new instruction\CategoryHandler($db); |
75
|
|
|
/** @var \Xoopsmodules\instruction\PageHandler $pageHandler */ |
76
|
|
|
$pageHandler = new instruction\PageHandler($db); |
77
|
|
|
|
78
|
|
|
$helper->loadLanguage('common'); |
79
|
|
|
|
80
|
|
|
$pathIcon16 = Xmf\Module\Admin::iconUrl('', 16); |
81
|
|
|
$pathIcon32 = Xmf\Module\Admin::iconUrl('', 32); |
82
|
|
|
$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
83
|
|
|
$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
84
|
|
|
|
85
|
|
|
|
86
|
|
|
$debug = false; |
87
|
|
|
|
88
|
|
View Code Duplication |
if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
|
|
|
|
89
|
|
|
require_once $GLOBALS['xoops']->path('class/template.php'); |
90
|
|
|
$xoopsTpl = new \XoopsTpl(); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
$moduleDirName = basename(dirname(__DIR__)); |
94
|
|
|
$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName); |
95
|
|
|
|
96
|
|
|
// Local icons path |
97
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
98
|
|
|
$GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
99
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.