|
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 {@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 Xmf\Request; |
|
21
|
|
|
use XoopsModules\Extcal\{Helper, |
|
22
|
|
|
Perm |
|
23
|
|
|
}; |
|
24
|
|
|
|
|
25
|
|
|
require_once __DIR__ . '/include/constantes.php'; |
|
26
|
|
|
$params = ['view' => _EXTCAL_NAV_NEW_EVENT, 'file' => _EXTCAL_FILE_NEW_EVENT]; |
|
27
|
|
|
$GLOBALS['xoopsOption']['template_main'] = "extcal_view_{$params['view']}.tpl"; |
|
28
|
|
|
|
|
29
|
|
|
require_once __DIR__ . '/header.php'; |
|
30
|
|
|
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
31
|
|
|
|
|
32
|
|
|
$permHandler = Perm::getHandler(); |
|
33
|
|
|
$xoopsUser = $xoopsUser ?: null; |
|
34
|
|
|
|
|
35
|
|
|
if (0 == count($permHandler->getAuthorizedCat($xoopsUser, 'extcal_cat_submit')) |
|
|
|
|
|
|
36
|
|
|
&& 0 == count($permHandler->getAuthorizedCat($xoopsUser, 'extcal_cat_edit'))) { |
|
37
|
|
|
redirect_header('index.php', 3); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/* ========================================================================== */ |
|
41
|
|
|
|
|
42
|
|
|
// Tooltips include |
|
43
|
|
|
/** @var xos_opal_Theme $xoTheme */ |
|
44
|
|
|
$xoTheme->addScript('modules/extcal/assets/js/ToolTips.js'); |
|
45
|
|
|
$xoTheme->addStylesheet('modules/extcal/assets/css/infobulle.css'); |
|
46
|
|
|
|
|
47
|
|
|
$eventId = Request::getInt('event', 0, 'GET'); |
|
48
|
|
|
$action = Request::getString('action', 'edit', 'GET'); |
|
49
|
|
|
|
|
50
|
|
|
// Getting eXtCal object's handler |
|
51
|
|
|
$eventHandler = Helper::getInstance()->getHandler(_EXTCAL_CLN_EVENT); |
|
52
|
|
|
|
|
53
|
|
|
require_once XOOPS_ROOT_PATH . '/header.php'; |
|
54
|
|
|
|
|
55
|
|
|
// Title of the page |
|
56
|
|
|
$xoopsTpl->assign('xoops_pagetitle', _MI_EXTCAL_SUBMIT_EVENT); |
|
57
|
|
|
|
|
58
|
|
|
// Display the submit form |
|
59
|
|
|
/** @var \XoopsThemeForm $form */ |
|
60
|
|
|
$form = $eventHandler->getEventForm('user', $action, ['event_id' => $eventId]); |
|
|
|
|
|
|
61
|
|
|
$form->display(); |
|
62
|
|
|
|
|
63
|
|
|
require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
64
|
|
|
|