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 http://xoops.org/ XOOPS Project} |
14
|
|
|
* @license {@link http://www.fsf.org/copyleft/gpl.html GNU public license} |
15
|
|
|
* @package |
16
|
|
|
* @since |
17
|
|
|
* @author XOOPS Development Team, |
18
|
|
|
* @author GIJ=CHECKMATE (PEAK Corp. http://www.peak.ne.jp/) |
19
|
|
|
*/ |
20
|
|
|
|
21
|
|
|
if (!defined('APCAL_BLOCK_MONTHLY_CALENDAR_INCLUDED')) { |
22
|
|
|
define('APCAL_BLOCK_MONTHLY_CALENDAR_INCLUDED', 1); |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @param $options |
26
|
|
|
* @return mixed |
27
|
|
|
*/ |
28
|
|
|
function apcal_monthly_calendar_show($options) |
29
|
|
|
{ |
30
|
|
|
global $xoopsConfig, $xoopsDB; |
31
|
|
|
|
32
|
|
|
|
33
|
|
|
$moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0]; |
34
|
|
|
xoops_loadLanguage('main', $moduleDirName); |
35
|
|
|
|
36
|
|
|
// setting physical & virtual paths |
37
|
|
|
$mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName"; |
38
|
|
|
$mod_url = XOOPS_URL . "/modules/$moduleDirName"; |
39
|
|
|
|
40
|
|
|
// defining class of APCal |
41
|
|
|
if (!class_exists('APCal_xoops')) { |
42
|
|
|
require_once "$mod_path/class/APCal.php"; |
43
|
|
|
require_once "$mod_path/class/APCal_xoops.php"; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
// creating an instance of APCal |
47
|
|
|
$cal = new APCal_xoops('', $xoopsConfig['language'], true); |
48
|
|
|
|
49
|
|
|
// ignoring cid from GET |
50
|
|
|
$cal->now_cid = 0; |
51
|
|
|
|
52
|
|
|
// setting properties of APCal |
53
|
|
|
$cal->conn = $GLOBALS['xoopsDB']->conn; |
54
|
|
|
include "$mod_path/include/read_configs.php"; |
55
|
|
|
$cal->base_url = $mod_url; |
56
|
|
|
$cal->base_path = $mod_path; |
57
|
|
|
$cal->images_url = "$mod_url/assets/images/$skin_folder"; |
|
|
|
|
58
|
|
|
$cal->images_path = "$mod_path/assets/images/$skin_folder"; |
59
|
|
|
|
60
|
|
|
$original_level = error_reporting(E_ALL ^ E_NOTICE); |
61
|
|
|
|
62
|
|
|
require_once "$mod_path/include/patTemplate.php"; |
63
|
|
|
$tmpl = new PatTemplate(); |
64
|
|
|
$tmpl->readTemplatesFromFile("$cal->images_path/default/block_monthly.tmpl.html"); |
65
|
|
|
|
66
|
|
|
// setting skin folder |
67
|
|
|
$tmpl->addVar('WholeBoard', 'SKINPATH', $cal->images_url); |
68
|
|
|
|
69
|
|
|
// setting language |
70
|
|
|
$tmpl->addVar('WholeBoard', 'LANG_PREV_MONTH', _MB_APCAL_PREV_MONTH); |
71
|
|
|
$tmpl->addVar('WholeBoard', 'LANG_NEXT_MONTH', _MB_APCAL_NEXT_MONTH); |
72
|
|
|
$tmpl->addVar('WholeBoard', 'LANG_YEAR', _MB_APCAL_YEAR); |
73
|
|
|
$tmpl->addVar('WholeBoard', 'LANG_MONTH', _MB_APCAL_MONTH); |
74
|
|
|
$tmpl->addVar('WholeBoard', 'LANG_JUMP', _MB_APCAL_JUMP); |
75
|
|
|
|
76
|
|
|
// Static parameter for the request |
77
|
|
|
$tmpl->addVar('WholeBoard', 'GET_TARGET', "$mod_url/index.php"); |
78
|
|
|
$tmpl->addVar('WholeBoard', 'QUERY_STRING', ''); |
79
|
|
|
|
80
|
|
|
// Variables required in header part etc. |
81
|
|
|
$tmpl->addVars('WholeBoard', $cal->get_calendar_information('M')); |
82
|
|
|
|
83
|
|
|
// BODY of the calendar |
84
|
|
|
$tmpl->addVar('WholeBoard', 'CALENDAR_BODY', $cal->get_monthly_html("$mod_url/index.php")); |
85
|
|
|
|
86
|
|
|
// legends of long events |
87
|
|
View Code Duplication |
foreach ($cal->long_event_legends as $bit => $legend) { |
|
|
|
|
88
|
|
|
$tmpl->addVar('LongEventLegends', 'BIT_MASK', 1 << ($bit - 1)); |
89
|
|
|
$tmpl->addVar('LongEventLegends', 'LEGEND_ALT', _APCAL_MB_ALLDAY_EVENT . " $bit"); |
90
|
|
|
$tmpl->addVar('LongEventLegends', 'LEGEND', $legend); |
91
|
|
|
$tmpl->addVar('LongEventLegends', 'SKINPATH', $cal->images_url); |
92
|
|
|
$tmpl->parseTemplate('LongEventLegends', 'a'); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
// content generated from PatTemplate |
96
|
|
|
$block['content'] = $tmpl->getParsedTemplate('WholeBoard'); |
|
|
|
|
97
|
|
|
error_reporting($original_level); |
98
|
|
|
|
99
|
|
|
return $block; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param $options |
104
|
|
|
* @return string |
105
|
|
|
*/ |
106
|
|
|
function apcal_monthly_calendar_edit($options) |
|
|
|
|
107
|
|
|
{ |
108
|
|
|
return ''; |
109
|
|
|
} |
110
|
|
|
} |
111
|
|
|
|
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.