Passed
Push — master ( 3101ac...81e6e3 )
by Goffy
03:23
created

admin/header.php (1 issue)

Severity
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
 * wgEvents module for xoops
15
 *
16
 * @copyright    2021 XOOPS Project (https://xoops.org)
17
 * @license      GPL 2.0 or later
18
 * @package      wgevents
19
 * @author       Goffy - Wedega - Email:[email protected] - Website:https://xoops.wedega.com
20
 */
21
22
require \dirname(__DIR__, 3) . '/include/cp_header.php';
23
require_once \dirname(__DIR__) . '/include/common.php';
24
25
$sysPathIcon16   = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons16');
26
$sysPathIcon32   = '../' . $GLOBALS['xoopsModule']->getInfo('sysicons32');
27
$pathModuleAdmin = $GLOBALS['xoopsModule']->getInfo('dirmoduleadmin');
28
$modPathIcon16   = \WGEVENTS_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons16') . '/';
29
$modPathIcon32   = \WGEVENTS_URL . '/' . $GLOBALS['xoopsModule']->getInfo('modicons32') . '/';
30
31
// Get instance of module
32
$helper = \XoopsModules\Wgevents\Helper::getInstance();
33
$eventHandler = $helper->getHandler('Event');
34
$categoryHandler = $helper->getHandler('Category');
35
$registrationHandler = $helper->getHandler('Registration');
36
$registrationhistHandler = $helper->getHandler('Registrationhist');
37
$questionHandler = $helper->getHandler('Question');
38
$answerHandler = $helper->getHandler('Answer');
39
$answerhistHandler = $helper->getHandler('Answerhist');
40
$textblockHandler = $helper->getHandler('Textblock');
41
$fieldHandler = $helper->getHandler('Field');
42
$logHandler = $helper->getHandler('Log');
43
$accountHandler = $helper->getHandler('Account');
44
$taskHandler = $helper->getHandler('Task');
45
$importHandler = $helper->getHandler('Import');
46
$mailHandler = $helper->getHandler('Mail');
47
$myts = MyTextSanitizer::getInstance();
48
// 
49
if (!isset($xoopsTpl) || !\is_object($xoopsTpl)) {
50
    require_once \XOOPS_ROOT_PATH . '/class/template.php';
51
    $xoopsTpl = new \XoopsTpl();
52
}
53
54
// Load languages
55
\xoops_loadLanguage('admin');
56
\xoops_loadLanguage('main');
57
\xoops_loadLanguage('modinfo');
58
59
// Local admin menu class
60
if (\file_exists($GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php'))) {
61
    require_once $GLOBALS['xoops']->path($pathModuleAdmin.'/moduleadmin.php');
62
} else {
63
    \redirect_header('../../../admin.php', 5, \_AM_MODULEADMIN_MISSING);
64
}
65
66
xoops_cp_header();
67
68
// System icons path
69
$GLOBALS['xoopsTpl']->assign('sysPathIcon16', $sysPathIcon16);
70
$GLOBALS['xoopsTpl']->assign('sysPathIcon32', $sysPathIcon32);
71
$GLOBALS['xoopsTpl']->assign('modPathIcon16', $modPathIcon16);
72
$GLOBALS['xoopsTpl']->assign('modPathIcon32', $modPathIcon32);
73
74
$adminObject = \Xmf\Module\Admin::getInstance();
75
$style = \WGEVENTS_URL . '/assets/css/admin/style.css';
76
77
// tablesorter
78
$GLOBALS['xoopsTpl']->assign('tablesorter_allrows', \_AM_WGEVENTS_TABLESORTER_SHOW_ALL);
79
$GLOBALS['xoopsTpl']->assign('tablesorter_of', \_AM_WGEVENTS_TABLESORTER_OF);
80
$GLOBALS['xoopsTpl']->assign('tablesorter_total', \_AM_WGEVENTS_TABLESORTER_TOTALROWS);
81
$GLOBALS['xoopsTpl']->assign('tablesorter_pagesize', $helper->getConfig('adminpager'));
82
if ('d.m.Y' == _SHORTDATESTRING) {
0 ignored issues
show
The condition 'd.m.Y' == _SHORTDATESTRING is always false.
Loading history...
83
    $dateformat = 'ddmmyyyy';
84
} else {
85
    $dateformat = 'mmddyyyy';
86
}
87
$GLOBALS['xoopsTpl']->assign('tablesorter_dateformat', $dateformat);
88
89
$xoTheme->addStylesheet($helper->url('assets/js/tablesorter/css/jquery.tablesorter.pager.min.css'));
90
$tablesorterTheme = $helper->getConfig('tablesorter_admin');
91
$xoTheme->addStylesheet($helper->url('assets/js/tablesorter/css/theme.' . $tablesorterTheme . '.min.css'));
92
$GLOBALS['xoopsTpl']->assign('tablesorter_theme', $tablesorterTheme);
93
94