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
|
|
|
* @author Antiques Promotion (http://www.antiquespromotion.ca) |
20
|
|
|
*/ |
21
|
|
|
|
22
|
|
|
if (!defined('APCAL_BLOCK_THEDAYS_SCHEDULE_INCLUDED')) { |
23
|
|
|
define('APCAL_BLOCK_THEDAYS_SCHEDULE_INCLUDED', 1); |
24
|
|
|
|
25
|
|
|
// XOOPS 2.1/2.2 |
26
|
|
|
if (substr(XOOPS_VERSION, 6, 3) > 2.0) { |
27
|
|
|
$GLOBALS['apcal_blockinstance_object'] = $this; |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param $options |
32
|
|
|
* @return array |
33
|
|
|
*/ |
34
|
|
|
function apcal_thedays_schedule_show_tpl($options) |
35
|
|
|
{ |
36
|
|
|
global $xoopsConfig, $xoopsDB; |
37
|
|
|
|
38
|
|
|
$moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0]; |
39
|
|
|
$now_cid = empty($options[1]) ? 0 : (int)$options[1]; |
40
|
|
|
|
41
|
|
|
// setting physical & virtual paths |
42
|
|
|
$mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName"; |
43
|
|
|
$mod_url = XOOPS_URL . "/modules/$moduleDirName"; |
44
|
|
|
|
45
|
|
|
// defining class of APCal |
46
|
|
|
if (!class_exists('APCal_xoops')) { |
47
|
|
|
require_once "$mod_path/class/APCal.php"; |
48
|
|
|
require_once "$mod_path/class/APCal_xoops.php"; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
// creating an instance of APCal |
52
|
|
|
$cal = new APCal_xoops('', $xoopsConfig['language'], true); |
53
|
|
|
|
54
|
|
|
// cid ¤Ë¤è¤ë¹Ê¤ê¹þ¤ß |
55
|
|
|
$cal->now_cid = $now_cid; |
56
|
|
|
|
57
|
|
|
// setting properties of APCal |
58
|
|
|
$cal->conn = $GLOBALS['xoopsDB']->conn; |
59
|
|
|
include "$mod_path/include/read_configs.php"; |
60
|
|
|
$cal->base_url = $mod_url; |
61
|
|
|
$cal->base_path = $mod_path; |
62
|
|
|
$cal->images_url = "$mod_url/assets/images/$skin_folder"; |
|
|
|
|
63
|
|
|
$cal->images_path = "$mod_path/assets/images/$skin_folder"; |
64
|
|
|
|
65
|
|
|
// ¥Ö¥í¥Ã¥¯ÇÛÎó¤Î¼«Ê¬¼«¿È¤ò½ñ¤´¹¤¨¤ë title ¤Ë %s ¤ò´Þ¤á¤ë¤³¤È |
66
|
|
View Code Duplication |
if (substr(XOOPS_VERSION, 6, 3) > 2.0) { |
|
|
|
|
67
|
|
|
$title_fmt = $GLOBALS['apcal_blockinstance_object']->getVar('title'); |
68
|
|
|
$GLOBALS['apcal_blockinstance_object']->setVar('title', sprintf($title_fmt, sprintf(_APCAL_FMT_MD, $cal->month_short_names[date('n', $cal->unixtime)], |
69
|
|
|
$cal->date_short_names[date('j', $cal->unixtime)]))); |
70
|
|
|
} else { |
71
|
|
|
global $block_arr, $i; |
72
|
|
|
if (is_object($block_arr[$i])) { |
73
|
|
|
$title_fmt = $block_arr[$i]->getVar('title'); |
74
|
|
|
$title = sprintf($title_fmt, sprintf(_APCAL_FMT_MD, $cal->month_short_names[date('n', $cal->unixtime)], $cal->date_short_names[date('j', $cal->unixtime)])); |
75
|
|
|
$block_arr[$i]->setVar('title', $title); |
76
|
|
|
} |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
$block = $cal->get_blockarray_date_event("$mod_url/index.php"); |
80
|
|
|
|
81
|
|
|
return $block; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @param $options |
86
|
|
|
* @return string |
87
|
|
|
*/ |
88
|
|
View Code Duplication |
function apcal_thedays_schedule_edit($options) |
|
|
|
|
89
|
|
|
{ |
90
|
|
|
global $xoopsDB, $xoopsConfig; |
91
|
|
|
|
92
|
|
|
$moduleDirName = empty($options[0]) ? basename(dirname(__DIR__)) : $options[0]; |
93
|
|
|
$now_cid = empty($options[1]) ? 0 : (int)$options[1]; |
94
|
|
|
|
95
|
|
|
// setting physical & virtual paths |
96
|
|
|
$mod_path = XOOPS_ROOT_PATH . "/modules/$moduleDirName"; |
97
|
|
|
$mod_url = XOOPS_URL . "/modules/$moduleDirName"; |
98
|
|
|
|
99
|
|
|
// defining class of APCal |
100
|
|
|
require_once "$mod_path/class/APCal.php"; |
101
|
|
|
require_once "$mod_path/class/APCal_xoops.php"; |
102
|
|
|
|
103
|
|
|
// creating an instance of APCal |
104
|
|
|
$cal = new APCal_xoops(date('Y-n-j'), $xoopsConfig['language'], true); |
105
|
|
|
$cal->use_server_TZ = true; |
106
|
|
|
|
107
|
|
|
// setting properties of APCal |
108
|
|
|
$cal->conn = $GLOBALS['xoopsDB']->conn; |
109
|
|
|
include "$mod_path/include/read_configs.php"; |
110
|
|
|
$cal->base_url = $mod_url; |
111
|
|
|
$cal->base_path = $mod_path; |
112
|
|
|
$cal->images_url = "$mod_url/assets/images/$skin_folder"; |
|
|
|
|
113
|
|
|
$cal->images_path = "$mod_path/assets/images/$skin_folder"; |
114
|
|
|
|
115
|
|
|
$ret = "<input type='hidden' name='options[0]' value='$moduleDirName' />\n"; |
116
|
|
|
|
117
|
|
|
// ¥«¥Æ¥´¥ê¡¼ÁªÂò¥Ü¥Ã¥¯¥¹¤ÎÀ¸À® |
118
|
|
|
$ret .= _MB_APCAL_CATSEL . ':'; |
119
|
|
|
$ret .= "<select name='options[1]'>\n<option value='0'>" . _ALL . "</option>\n"; |
120
|
|
|
foreach ($cal->categories as $cid => $cat) { |
121
|
|
|
$selected = $now_cid == $cid ? 'selected' : ''; |
122
|
|
|
$depth_desc = str_repeat('-', (int)$cat->cat_depth); |
123
|
|
|
$cat_title4show = $cal->text_sanitizer_for_show($cat->cat_title); |
124
|
|
|
$ret .= "\t<option value='$cid' $selected>$depth_desc $cat_title4show</option>\n"; |
125
|
|
|
} |
126
|
|
|
$ret .= "</select>\n"; |
127
|
|
|
|
128
|
|
|
return $ret; |
129
|
|
|
} |
130
|
|
|
} |
131
|
|
|
|
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.