|
1 | 1 | <?php |
2 | | -// |
3 | | -// ------------------------------------------------------------------------ // |
4 | | -// XOOPS - PHP Content Management System // |
5 | | -// Copyright (c) 2000-2016 XOOPS.org // |
6 | | -// <http://xoops.org/> // |
7 | | -// ------------------------------------------------------------------------ // |
8 | | -// This program is free software; you can redistribute it and/or modify // |
9 | | -// it under the terms of the GNU General Public License as published by // |
10 | | -// the Free Software Foundation; either version 2 of the License, or // |
11 | | -// (at your option) any later version. // |
12 | | -// // |
13 | | -// You may not change or alter any portion of this comment or credits // |
14 | | -// of supporting developers from this source code or any supporting // |
15 | | -// source code which is considered copyrighted (c) material of the // |
16 | | -// original comment or credit authors. // |
17 | | -// // |
18 | | -// This program is distributed in the hope that it will be useful, // |
19 | | -// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
20 | | -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
21 | | -// GNU General Public License for more details. // |
22 | | -// // |
23 | | -// You should have received a copy of the GNU General Public License // |
24 | | -// along with this program; if not, write to the Free Software // |
25 | | -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
26 | | -// ------------------------------------------------------------------------ // |
27 | | - |
28 | | -$path = dirname(dirname(dirname(__DIR__))); |
29 | | -include_once $path . '/mainfile.php'; |
30 | | -include_once $path . '/include/cp_functions.php'; |
31 | | -require_once $path . '/include/cp_header.php'; |
32 | | - |
33 | | -global $xoopsModule; |
| 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 {@link https://xoops.org/ XOOPS Project} |
| 14 | + * @license {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later} |
| 15 | + * @package extcal |
| 16 | + * @since |
| 17 | + * @author XOOPS Development Team, |
| 18 | + */ |
| 19 | + |
| 20 | +use XoopsModules\Extcal\{ |
| 21 | + Helper, |
| 22 | + Utility, |
| 23 | + CategoryHandler, |
| 24 | + EventHandler, |
| 25 | + EventmemberHandler, |
| 26 | + EventNotMemberHandler, |
| 27 | + FileHandler, |
| 28 | + LocationHandler |
| 29 | +}; |
| 30 | + |
| 31 | +require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php'; |
| 32 | +require_once $GLOBALS['xoops']->path('www/class/xoopsformloader.php'); |
| 33 | +require_once dirname(__DIR__) . '/include/constantes.php'; |
| 34 | + |
| 35 | +require_once dirname(__DIR__) . '/preloads/autoloader.php'; |
34 | 36 |
|
35 | 37 | $moduleDirName = basename(dirname(__DIR__)); |
| 38 | +$moduleDirNameUpper = mb_strtoupper($moduleDirName); |
| 39 | + |
| 40 | +/** @var Helper $helper */ |
| 41 | +$helper = Helper::getInstance(); |
| 42 | +/** @var Xmf\Module\Admin $adminObject */ |
| 43 | +$adminObject = \Xmf\Module\Admin::getInstance(); |
| 44 | +$utility = new Utility(); |
| 45 | + |
| 46 | +require_once dirname(__DIR__) . '/include/common.php'; |
36 | 47 |
|
37 | | -xoops_load('XoopsRequest'); |
| 48 | +$adminObject = \Xmf\Module\Admin::getInstance(); |
| 49 | + |
| 50 | +$pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16); |
| 51 | +$pathIcon32 = \Xmf\Module\Admin::iconUrl('', 32); |
| 52 | +$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
38 | 53 |
|
39 | 54 | // Load language files |
40 | | -xoops_loadLanguage('admin', $moduleDirName); |
41 | | -xoops_loadLanguage('modinfo', $moduleDirName); |
42 | | -xoops_loadLanguage('main', $moduleDirName); |
43 | | - |
44 | | -$pathIcon16 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('sysicons16')); |
45 | | -$pathIcon32 = $GLOBALS['xoops']->url('www/' . $GLOBALS['xoopsModule']->getInfo('sysicons32')); |
46 | | -$xoopsModuleAdminPath = $GLOBALS['xoops']->path('www/' . $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin')); |
47 | | -require_once $xoopsModuleAdminPath . '/moduleadmin.php'; |
48 | | - |
49 | | -/** @var ExtcalCatHandler $catHandler */ |
50 | | -$catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE); |
51 | | -/** @var ExtcalEventHandler $eventHandler */ |
52 | | -$eventHandler = xoops_getModuleHandler(_EXTCAL_CLS_EVENT, _EXTCAL_MODULE); |
53 | | -/** @var ExtcalEventmemberHandler $eventMemberHandler */ |
54 | | -$eventMemberHandler = xoops_getModuleHandler(_EXTCAL_CLS_MEMBER, _EXTCAL_MODULE); |
55 | | -//xoops_cp_header(); |
56 | | -$adminObject = new ModuleAdmin(); |
| 55 | +$helper->loadLanguage('admin'); |
| 56 | +$helper->loadLanguage('modinfo'); |
| 57 | +$helper->loadLanguage('main'); |
| 58 | +$helper->loadLanguage('common'); |
| 59 | + |
| 60 | + |
| 61 | +$myts = \MyTextSanitizer::getInstance(); |
| 62 | + |
| 63 | +if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
| 64 | + require_once $GLOBALS['xoops']->path('class/template.php'); |
| 65 | + $xoopsTpl = new \XoopsTpl(); |
| 66 | +} |
| 67 | + |
| 68 | +/** @var CategoryHandler $categoryHandler */ |
| 69 | +$categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT); |
| 70 | +/** @var EventHandler $eventHandler */ |
| 71 | +$eventHandler = $helper->getHandler(_EXTCAL_CLN_EVENT); |
| 72 | +/** @var EventmemberHandler $eventmemberHandler */ |
| 73 | +$eventmemberHandler = $helper->getHandler(_EXTCAL_CLN_MEMBER); |
| 74 | +/** @var EventNotMemberHandler $eventNotMemberHandler */ |
| 75 | +$eventNotMemberHandler = $helper->getHandler(_EXTCAL_CLN_NOT_MEMBER); |
| 76 | +/** @var FileHandler $fileHandler */ |
| 77 | +$fileHandler = $helper->getHandler(_EXTCAL_CLN_FILE); |
| 78 | +/** @var LocationHandler $locationHandler */ |
| 79 | +$locationHandler = $helper->getHandler(_EXTCAL_CLN_LOCATION); |
0 commit comments