@@ -31,135 +31,135 @@ discard block |
||
31 | 31 | $op = $_REQUEST['op'] ?? 'list'; |
32 | 32 | $blocksCallHandler = $helper->getHandler('BlocksCall'); |
33 | 33 | switch ($op) { |
34 | - default: |
|
35 | - case 'list': |
|
36 | - /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | - $moduleHandler = xoops_getHandler('module'); |
|
38 | - $criteria = new \Criteria('isactive', 1); |
|
39 | - $generator_list = $moduleHandler->getList($criteria); |
|
40 | - $fields = [ |
|
41 | - 'bid', |
|
42 | - 'mid', |
|
43 | - 'name', |
|
44 | - 'title', |
|
45 | - 'desciption', |
|
46 | - 'bcachetime', |
|
47 | - 'bcachemodel', |
|
48 | - 'last_modified', |
|
49 | - ]; |
|
50 | - $blockscall_data = $blocksCallHandler->getAll(null, $fields, false, false); |
|
51 | - $cachetime = [ |
|
52 | - '0' => _NOCACHE, |
|
53 | - '30' => sprintf(_SECONDS, 30), |
|
54 | - '60' => _MINUTE, |
|
55 | - '300' => sprintf(_MINUTES, 5), |
|
56 | - '1800' => sprintf(_MINUTES, 30), |
|
57 | - '3600' => _HOUR, |
|
58 | - '18000' => sprintf(_HOURS, 5), |
|
59 | - '86400' => _DAY, |
|
60 | - '259200' => sprintf(_DAYS, 3), |
|
61 | - '604800' => _WEEK, |
|
62 | - '2592000' => _MONTH, |
|
63 | - ]; |
|
64 | - $cachemodel = ['0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER]; |
|
65 | - foreach ($blockscall_data as $k => $v) { |
|
66 | - $blockscall_data[$k]['mname'] = $generator_list[$v['mid']] ?? 'Not active'; |
|
67 | - $blockscall_data[$k]['bcachetime'] = $cachetime[$v['bcachetime']]; |
|
68 | - $blockscall_data[$k]['bcachemodel'] = $cachemodel[$v['bcachemodel']]; |
|
69 | - $blockscall_data[$k]['last_modified'] = formatTimestamp($v['last_modified']); |
|
34 | +default: |
|
35 | +case 'list': |
|
36 | + /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | + $moduleHandler = xoops_getHandler('module'); |
|
38 | + $criteria = new \Criteria('isactive', 1); |
|
39 | + $generator_list = $moduleHandler->getList($criteria); |
|
40 | + $fields = [ |
|
41 | + 'bid', |
|
42 | + 'mid', |
|
43 | + 'name', |
|
44 | + 'title', |
|
45 | + 'desciption', |
|
46 | + 'bcachetime', |
|
47 | + 'bcachemodel', |
|
48 | + 'last_modified', |
|
49 | + ]; |
|
50 | + $blockscall_data = $blocksCallHandler->getAll(null, $fields, false, false); |
|
51 | + $cachetime = [ |
|
52 | + '0' => _NOCACHE, |
|
53 | + '30' => sprintf(_SECONDS, 30), |
|
54 | + '60' => _MINUTE, |
|
55 | + '300' => sprintf(_MINUTES, 5), |
|
56 | + '1800' => sprintf(_MINUTES, 30), |
|
57 | + '3600' => _HOUR, |
|
58 | + '18000' => sprintf(_HOURS, 5), |
|
59 | + '86400' => _DAY, |
|
60 | + '259200' => sprintf(_DAYS, 3), |
|
61 | + '604800' => _WEEK, |
|
62 | + '2592000' => _MONTH, |
|
63 | + ]; |
|
64 | + $cachemodel = ['0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER]; |
|
65 | + foreach ($blockscall_data as $k => $v) { |
|
66 | + $blockscall_data[$k]['mname'] = $generator_list[$v['mid']] ?? 'Not active'; |
|
67 | + $blockscall_data[$k]['bcachetime'] = $cachetime[$v['bcachetime']]; |
|
68 | + $blockscall_data[$k]['bcachemodel'] = $cachemodel[$v['bcachemodel']]; |
|
69 | + $blockscall_data[$k]['last_modified'] = formatTimestamp($v['last_modified']); |
|
70 | + } |
|
71 | + $template_main = 'tools_admin_blockscall.tpl'; |
|
72 | + $xoopsTpl->assign('bc_data', $blockscall_data); |
|
73 | + break; |
|
74 | +case 'new': |
|
75 | + // Modules for blocks to be visible in |
|
76 | + /** @var \XoopsModuleHandler $moduleHandler */ |
|
77 | + $moduleHandler = xoops_getHandler('module'); |
|
78 | + $criteria = new \Criteria('isactive', 1); |
|
79 | + $generator_list = $moduleHandler->getList($criteria); |
|
80 | + unset($criteria); |
|
81 | + $generator_list[-1] = _AM_TOOLS_BC_ALLTYPES; |
|
82 | + ksort($generator_list); |
|
83 | + $selgen = Request::getInt('selgen', -1, 'GET'); |
|
84 | + |
|
85 | + //get blocks |
|
86 | + $criteria = new \CriteriaCompo(new \Criteria('mid', 0, '!=')); |
|
87 | + if (-1 != $selgen) { |
|
88 | + $criteria->add(new \Criteria('mid', $selgen)); |
|
89 | + } |
|
90 | + $fields = ['bid', 'mid', 'name', 'title']; |
|
91 | + $blocksHandler = $helper->getHandler('XoopsBlock'); |
|
92 | + $blocks_array = $blocksHandler->getAll($criteria, $fields, false, false); |
|
93 | + foreach ($blocks_array as $k => $v) { |
|
94 | + $blocks_array[$k]['mname'] = $generator_list[$v['mid']] ?? 'Not active'; |
|
95 | + } |
|
96 | + unset($criteria); |
|
97 | + |
|
98 | + $xoopsTpl->assign('selgen', $selgen); |
|
99 | + $xoopsTpl->assign('moduleslist', $generator_list); |
|
100 | + $xoopsTpl->assign('blocks', $blocks_array); |
|
101 | + $template_main = 'tools_admin_blockscall_new.tpl'; |
|
102 | + break; |
|
103 | +case 'create': |
|
104 | + |
|
105 | + $blocksHandler = $helper->getHandler('XoopsBlock'); |
|
106 | + $block_obj = $blocksHandler->get($_GET['bid']); |
|
107 | + $o_block = $block_obj->getValues(); |
|
108 | + |
|
109 | + if ('' != $o_block['template']) { |
|
110 | + /** @var \XoopsTplfileHandler $tplfileHandler */ |
|
111 | + $tplfileHandler = xoops_getHandler('tplfile'); |
|
112 | + $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $o_block['bid'], '', '', true); |
|
113 | + if (count($btemplate) > 0) { |
|
114 | + $tpl_source = $btemplate[0]->getVar('tpl_source', 'n'); |
|
115 | + } else { |
|
116 | + $btemplate2 = $tplfileHandler->find('default', 'block', $o_block['bid'], '', '', true); |
|
117 | + if (count($btemplate2) > 0) { |
|
118 | + $tpl_source = $btemplate2[0]->getVar('tpl_source', 'n'); |
|
119 | + } |
|
70 | 120 | } |
71 | - $template_main = 'tools_admin_blockscall.tpl'; |
|
72 | - $xoopsTpl->assign('bc_data', $blockscall_data); |
|
121 | + } |
|
122 | + |
|
123 | + $blocksCallObj = $blocksCallHandler->create(); |
|
124 | + $blocksCallObj->setVar('bid', $o_block['bid']); |
|
125 | + $blocksCallObj->setVar('mid', $o_block['mid']); |
|
126 | + $blocksCallObj->setVar('options', $o_block['options']); |
|
127 | + $blocksCallObj->setVar('name', $o_block['name']); |
|
128 | + $blocksCallObj->setVar('title', $o_block['title']); |
|
129 | + $blocksCallObj->setVar('content', $o_block['content']); |
|
130 | + $blocksCallObj->setVar('dirname', $o_block['dirname']); |
|
131 | + $blocksCallObj->setVar('func_file', $o_block['func_file']); |
|
132 | + $blocksCallObj->setVar('show_func', $o_block['show_func']); |
|
133 | + $blocksCallObj->setVar('edit_func', $o_block['edit_func']); |
|
134 | + $blocksCallObj->setVar('template', $o_block['template']); |
|
135 | + $blocksCallObj->setVar('tpl_content', $tpl_source); |
|
136 | + $blocksCallObj->setVar('bcachetime', $o_block['bcachetime']); |
|
137 | + $blocksCallObj->setVar('last_modified', time()); |
|
138 | + if ($blocksCallHandler->insert($blocksCallObj)) { |
|
139 | + redirect_header("blockscall.php?op=edit&bid={$blocksCallObj->getVar('bid')}", 3, sprintf(_AM_TOOLS_BC_CREATESUCCESS, $blocksCallObj->getVar('name'))); |
|
140 | + } |
|
141 | + |
|
142 | + break; |
|
143 | +case 'edit': |
|
144 | + |
|
145 | + $blocksCallObj = $blocksCallHandler->get($_GET['bid']); |
|
146 | + $block_data = $blocksCallObj->getValues(null, 'n'); |
|
147 | + $block_data['edit_form'] = $blocksCallObj->getOptions(); |
|
148 | + |
|
149 | + $blockoption = !empty($block_data['options']) ? "options=\"{$block_data['options']}\"" : ''; |
|
150 | + $cachetime = 0 != $block_data['bcachetime'] ? ' cachetime=' . $block_data['bcachetime'] : ''; |
|
151 | + if ($cachetime) { |
|
152 | + switch ($block_data['bcachemodel']) { |
|
153 | + case 0: |
|
154 | + $cachemodel = ' cachemodel=global'; |
|
73 | 155 | break; |
74 | - case 'new': |
|
75 | - // Modules for blocks to be visible in |
|
76 | - /** @var \XoopsModuleHandler $moduleHandler */ |
|
77 | - $moduleHandler = xoops_getHandler('module'); |
|
78 | - $criteria = new \Criteria('isactive', 1); |
|
79 | - $generator_list = $moduleHandler->getList($criteria); |
|
80 | - unset($criteria); |
|
81 | - $generator_list[-1] = _AM_TOOLS_BC_ALLTYPES; |
|
82 | - ksort($generator_list); |
|
83 | - $selgen = Request::getInt('selgen', -1, 'GET'); |
|
84 | - |
|
85 | - //get blocks |
|
86 | - $criteria = new \CriteriaCompo(new \Criteria('mid', 0, '!=')); |
|
87 | - if (-1 != $selgen) { |
|
88 | - $criteria->add(new \Criteria('mid', $selgen)); |
|
89 | - } |
|
90 | - $fields = ['bid', 'mid', 'name', 'title']; |
|
91 | - $blocksHandler = $helper->getHandler('XoopsBlock'); |
|
92 | - $blocks_array = $blocksHandler->getAll($criteria, $fields, false, false); |
|
93 | - foreach ($blocks_array as $k => $v) { |
|
94 | - $blocks_array[$k]['mname'] = $generator_list[$v['mid']] ?? 'Not active'; |
|
95 | - } |
|
96 | - unset($criteria); |
|
97 | - |
|
98 | - $xoopsTpl->assign('selgen', $selgen); |
|
99 | - $xoopsTpl->assign('moduleslist', $generator_list); |
|
100 | - $xoopsTpl->assign('blocks', $blocks_array); |
|
101 | - $template_main = 'tools_admin_blockscall_new.tpl'; |
|
156 | + case 1: |
|
157 | + $cachemodel = ' cachemodel=$xoopsUser->getGroups()'; |
|
102 | 158 | break; |
103 | - case 'create': |
|
104 | - |
|
105 | - $blocksHandler = $helper->getHandler('XoopsBlock'); |
|
106 | - $block_obj = $blocksHandler->get($_GET['bid']); |
|
107 | - $o_block = $block_obj->getValues(); |
|
108 | - |
|
109 | - if ('' != $o_block['template']) { |
|
110 | - /** @var \XoopsTplfileHandler $tplfileHandler */ |
|
111 | - $tplfileHandler = xoops_getHandler('tplfile'); |
|
112 | - $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $o_block['bid'], '', '', true); |
|
113 | - if (count($btemplate) > 0) { |
|
114 | - $tpl_source = $btemplate[0]->getVar('tpl_source', 'n'); |
|
115 | - } else { |
|
116 | - $btemplate2 = $tplfileHandler->find('default', 'block', $o_block['bid'], '', '', true); |
|
117 | - if (count($btemplate2) > 0) { |
|
118 | - $tpl_source = $btemplate2[0]->getVar('tpl_source', 'n'); |
|
119 | - } |
|
120 | - } |
|
121 | - } |
|
122 | - |
|
123 | - $blocksCallObj = $blocksCallHandler->create(); |
|
124 | - $blocksCallObj->setVar('bid', $o_block['bid']); |
|
125 | - $blocksCallObj->setVar('mid', $o_block['mid']); |
|
126 | - $blocksCallObj->setVar('options', $o_block['options']); |
|
127 | - $blocksCallObj->setVar('name', $o_block['name']); |
|
128 | - $blocksCallObj->setVar('title', $o_block['title']); |
|
129 | - $blocksCallObj->setVar('content', $o_block['content']); |
|
130 | - $blocksCallObj->setVar('dirname', $o_block['dirname']); |
|
131 | - $blocksCallObj->setVar('func_file', $o_block['func_file']); |
|
132 | - $blocksCallObj->setVar('show_func', $o_block['show_func']); |
|
133 | - $blocksCallObj->setVar('edit_func', $o_block['edit_func']); |
|
134 | - $blocksCallObj->setVar('template', $o_block['template']); |
|
135 | - $blocksCallObj->setVar('tpl_content', $tpl_source); |
|
136 | - $blocksCallObj->setVar('bcachetime', $o_block['bcachetime']); |
|
137 | - $blocksCallObj->setVar('last_modified', time()); |
|
138 | - if ($blocksCallHandler->insert($blocksCallObj)) { |
|
139 | - redirect_header("blockscall.php?op=edit&bid={$blocksCallObj->getVar('bid')}", 3, sprintf(_AM_TOOLS_BC_CREATESUCCESS, $blocksCallObj->getVar('name'))); |
|
140 | - } |
|
141 | - |
|
159 | + case 2: |
|
160 | + $cachemodel = ' cachemodel=$xoopsUser'; |
|
142 | 161 | break; |
143 | - case 'edit': |
|
144 | - |
|
145 | - $blocksCallObj = $blocksCallHandler->get($_GET['bid']); |
|
146 | - $block_data = $blocksCallObj->getValues(null, 'n'); |
|
147 | - $block_data['edit_form'] = $blocksCallObj->getOptions(); |
|
148 | - |
|
149 | - $blockoption = !empty($block_data['options']) ? "options=\"{$block_data['options']}\"" : ''; |
|
150 | - $cachetime = 0 != $block_data['bcachetime'] ? ' cachetime=' . $block_data['bcachetime'] : ''; |
|
151 | - if ($cachetime) { |
|
152 | - switch ($block_data['bcachemodel']) { |
|
153 | - case 0: |
|
154 | - $cachemodel = ' cachemodel=global'; |
|
155 | - break; |
|
156 | - case 1: |
|
157 | - $cachemodel = ' cachemodel=$xoopsUser->getGroups()'; |
|
158 | - break; |
|
159 | - case 2: |
|
160 | - $cachemodel = ' cachemodel=$xoopsUser'; |
|
161 | - break; |
|
162 | - } |
|
162 | + } |
|
163 | 163 | } else { |
164 | 164 | $cachemodel = ''; |
165 | 165 | } |
@@ -181,67 +181,67 @@ discard block |
||
181 | 181 | $template_main = 'tools_admin_blockscall_edit.tpl'; |
182 | 182 | |
183 | 183 | break; |
184 | - case 'save': |
|
185 | - $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
186 | - if (Request::hasVar('save', 'REQUEST') && 'blk' === $_REQUEST['save']) { |
|
187 | - if (Request::hasVar('options', 'REQUEST')) { |
|
188 | - $options = $_REQUEST['options']; |
|
189 | - $options_count = count($options); |
|
190 | - if ($options_count > 0) { |
|
191 | - //Convert array values to comma-separated |
|
192 | - for ($i = 0; $i < $options_count; ++$i) { |
|
193 | - if (is_array($options[$i])) { |
|
194 | - $options[$i] = implode(',', $options[$i]); |
|
195 | - } |
|
184 | +case 'save': |
|
185 | + $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
186 | + if (Request::hasVar('save', 'REQUEST') && 'blk' === $_REQUEST['save']) { |
|
187 | + if (Request::hasVar('options', 'REQUEST')) { |
|
188 | + $options = $_REQUEST['options']; |
|
189 | + $options_count = count($options); |
|
190 | + if ($options_count > 0) { |
|
191 | + //Convert array values to comma-separated |
|
192 | + for ($i = 0; $i < $options_count; ++$i) { |
|
193 | + if (is_array($options[$i])) { |
|
194 | + $options[$i] = implode(',', $options[$i]); |
|
196 | 195 | } |
197 | - $options = implode('|', $options); |
|
198 | - $blocksCallObj->setVar('options', $options); |
|
199 | 196 | } |
197 | + $options = implode('|', $options); |
|
198 | + $blocksCallObj->setVar('options', $options); |
|
200 | 199 | } |
201 | - $blocksCallObj->setVar('desciption', $_REQUEST['desc']); |
|
202 | - $blocksCallObj->setVar('bcachetime', $_REQUEST['bcachetime']); |
|
203 | - $blocksCallObj->setVar('bcachemodel', $_REQUEST['bcachemodel']); |
|
204 | - } elseif (Request::hasVar('save', 'REQUEST') && 'tpl' === $_REQUEST['save']) { |
|
205 | - $blocksCallObj->setVar('tpl_content', $_REQUEST['tpl_content']); |
|
206 | - } else { |
|
207 | - exit(); |
|
208 | 200 | } |
209 | - |
|
210 | - $blocksCallObj->setVar('last_modified', time()); |
|
211 | - if ($blocksCallHandler->insert($blocksCallObj)) { |
|
212 | - redirect_header("blockscall.php?op=edit&bid={$blocksCallObj->getVar('bid')}", 3, sprintf(_AM_TOOLS_BC_SAVEDSUCCESS, $blocksCallObj->getVar('name'))); |
|
201 | + $blocksCallObj->setVar('desciption', $_REQUEST['desc']); |
|
202 | + $blocksCallObj->setVar('bcachetime', $_REQUEST['bcachetime']); |
|
203 | + $blocksCallObj->setVar('bcachemodel', $_REQUEST['bcachemodel']); |
|
204 | + } elseif (Request::hasVar('save', 'REQUEST') && 'tpl' === $_REQUEST['save']) { |
|
205 | + $blocksCallObj->setVar('tpl_content', $_REQUEST['tpl_content']); |
|
206 | + } else { |
|
207 | + exit(); |
|
208 | + } |
|
209 | + |
|
210 | + $blocksCallObj->setVar('last_modified', time()); |
|
211 | + if ($blocksCallHandler->insert($blocksCallObj)) { |
|
212 | + redirect_header("blockscall.php?op=edit&bid={$blocksCallObj->getVar('bid')}", 3, sprintf(_AM_TOOLS_BC_SAVEDSUCCESS, $blocksCallObj->getVar('name'))); |
|
213 | + } |
|
214 | + break; |
|
215 | +case 'edittpl': |
|
216 | + $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
217 | + $block_data = $blocksCallObj->getValues(null, 'n'); |
|
218 | + require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
219 | + $form = new \XoopsThemeForm(_AM_TOOLS_BC_EDITTPL, 'form', 'blockscall.php', 'post', true); |
|
220 | + $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_BLOCK, $block_data['name'])); |
|
221 | + $form->addElement(new \XoopsFormTextArea(_AM_TOOLS_BC_TPLSOURCES, 'tpl_content', $block_data['tpl_content'], 10, 80)); |
|
222 | + $form->addElement(new \XoopsFormHidden('bid', $block_data['bid'])); |
|
223 | + $form->addElement(new \XoopsFormHidden('op', 'save')); |
|
224 | + $form->addElement(new \XoopsFormHidden('save', 'tpl')); |
|
225 | + $buttonTray = new \XoopsFormElementTray('', ' '); |
|
226 | + $buttonTray->addElement(new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit')); |
|
227 | + $form->addElement($buttonTray); |
|
228 | + $form->display(); |
|
229 | + break; |
|
230 | +case 'delete': |
|
231 | + $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
232 | + if (Request::hasVar('ok', 'REQUEST') && 1 == $_REQUEST['ok']) { |
|
233 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
234 | + redirect_header('blockscall.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
213 | 235 | } |
214 | - break; |
|
215 | - case 'edittpl': |
|
216 | - $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
217 | - $block_data = $blocksCallObj->getValues(null, 'n'); |
|
218 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
219 | - $form = new \XoopsThemeForm(_AM_TOOLS_BC_EDITTPL, 'form', 'blockscall.php', 'post', true); |
|
220 | - $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_BLOCK, $block_data['name'])); |
|
221 | - $form->addElement(new \XoopsFormTextArea(_AM_TOOLS_BC_TPLSOURCES, 'tpl_content', $block_data['tpl_content'], 10, 80)); |
|
222 | - $form->addElement(new \XoopsFormHidden('bid', $block_data['bid'])); |
|
223 | - $form->addElement(new \XoopsFormHidden('op', 'save')); |
|
224 | - $form->addElement(new \XoopsFormHidden('save', 'tpl')); |
|
225 | - $buttonTray = new \XoopsFormElementTray('', ' '); |
|
226 | - $buttonTray->addElement(new \XoopsFormButton('', 'submitblock', _SUBMIT, 'submit')); |
|
227 | - $form->addElement($buttonTray); |
|
228 | - $form->display(); |
|
229 | - break; |
|
230 | - case 'delete': |
|
231 | - $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
|
232 | - if (Request::hasVar('ok', 'REQUEST') && 1 == $_REQUEST['ok']) { |
|
233 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
234 | - redirect_header('blockscall.php', 3, implode(',', $GLOBALS['xoopsSecurity']->getErrors())); |
|
235 | - } |
|
236 | - if ($blocksCallHandler->delete($blocksCallObj)) { |
|
237 | - redirect_header('blockscall.php', 3, _AM_TOOLS_BC_DELETEDSUCCESS); |
|
238 | - } else { |
|
239 | - echo $blocksCallObj->getHtmlErrors(); |
|
240 | - } |
|
236 | + if ($blocksCallHandler->delete($blocksCallObj)) { |
|
237 | + redirect_header('blockscall.php', 3, _AM_TOOLS_BC_DELETEDSUCCESS); |
|
241 | 238 | } else { |
242 | - xoops_confirm(['ok' => 1, 'id' => $_REQUEST['bid'], 'op' => 'delete'], $_SERVER['REQUEST_URI'], sprintf(_AM_TOOLS_BC_RUSUREDEL, $blocksCallObj->getVar('name'))); |
|
239 | + echo $blocksCallObj->getHtmlErrors(); |
|
243 | 240 | } |
244 | - break; |
|
241 | + } else { |
|
242 | + xoops_confirm(['ok' => 1, 'id' => $_REQUEST['bid'], 'op' => 'delete'], $_SERVER['REQUEST_URI'], sprintf(_AM_TOOLS_BC_RUSUREDEL, $blocksCallObj->getVar('name'))); |
|
243 | + } |
|
244 | + break; |
|
245 | 245 | } |
246 | 246 | $css = '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/modules/tools/templates/style.css">'; |
247 | 247 | $xoopsTpl->assign('css', $css); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | use Xmf\Request; |
22 | 22 | /** @var Helper $helper */ |
23 | 23 | |
24 | -require_once __DIR__ . '/admin_header.php'; |
|
24 | +require_once __DIR__.'/admin_header.php'; |
|
25 | 25 | xoops_cp_header(); |
26 | 26 | |
27 | 27 | //loadModuleAdminMenu(2, ''); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | '604800' => _WEEK, |
62 | 62 | '2592000' => _MONTH, |
63 | 63 | ]; |
64 | - $cachemodel = ['0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER]; |
|
64 | + $cachemodel = ['0' => _AM_TOOLS_BC_GLOBAL, '1' => _AM_TOOLS_BC_GROUP, '2' => _AM_TOOLS_BC_USER]; |
|
65 | 65 | foreach ($blockscall_data as $k => $v) { |
66 | 66 | $blockscall_data[$k]['mname'] = $generator_list[$v['mid']] ?? 'Not active'; |
67 | 67 | $blockscall_data[$k]['bcachetime'] = $cachetime[$v['bcachetime']]; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $block_data['edit_form'] = $blocksCallObj->getOptions(); |
148 | 148 | |
149 | 149 | $blockoption = !empty($block_data['options']) ? "options=\"{$block_data['options']}\"" : ''; |
150 | - $cachetime = 0 != $block_data['bcachetime'] ? ' cachetime=' . $block_data['bcachetime'] : ''; |
|
150 | + $cachetime = 0 != $block_data['bcachetime'] ? ' cachetime='.$block_data['bcachetime'] : ''; |
|
151 | 151 | if ($cachetime) { |
152 | 152 | switch ($block_data['bcachemodel']) { |
153 | 153 | case 0: |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | {$block_data['tpl_content']} |
170 | 170 | <{/xoBlkTpl}> |
171 | 171 | EOF; |
172 | - $xoblk = <<<EOF |
|
172 | + $xoblk = <<<EOF |
|
173 | 173 | <{xoBlk module="{$block_data['dirname']}" file="{$block_data['func_file']}" show_func="{$block_data['show_func']}" $blockoption template="{$block_data['template']}"$cachetime$cachemodel}> |
174 | 174 | EOF; |
175 | 175 | |
176 | - require dirname(__DIR__) . '/include/blockform.php'; |
|
176 | + require dirname(__DIR__).'/include/blockform.php'; |
|
177 | 177 | |
178 | 178 | $xoopsTpl->assign('xoblktpl', $xoblktpl); |
179 | 179 | $xoopsTpl->assign('xoblk', $xoblk); |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | case 'edittpl': |
216 | 216 | $blocksCallObj = $blocksCallHandler->get($_REQUEST['bid']); |
217 | 217 | $block_data = $blocksCallObj->getValues(null, 'n'); |
218 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
218 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
219 | 219 | $form = new \XoopsThemeForm(_AM_TOOLS_BC_EDITTPL, 'form', 'blockscall.php', 'post', true); |
220 | 220 | $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_BLOCK, $block_data['name'])); |
221 | 221 | $form->addElement(new \XoopsFormTextArea(_AM_TOOLS_BC_TPLSOURCES, 'tpl_content', $block_data['tpl_content'], 10, 80)); |
@@ -243,6 +243,6 @@ discard block |
||
243 | 243 | } |
244 | 244 | break; |
245 | 245 | } |
246 | -$css = '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/modules/tools/templates/style.css">'; |
|
246 | +$css = '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/tools/templates/style.css">'; |
|
247 | 247 | $xoopsTpl->assign('css', $css); |
248 | -require_once __DIR__ . '/admin_footer.php'; |
|
248 | +require_once __DIR__.'/admin_footer.php'; |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | // extra module configs |
7 | 7 | $modversion['config'][] = [ |
8 | 8 | 'name' => 'imageConfigs', |
9 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
10 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
9 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG', |
|
10 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG_DSC', |
|
11 | 11 | 'formtype' => 'line_break', |
12 | 12 | 'valuetype' => 'textbox', |
13 | 13 | 'default' => 'head', |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | |
16 | 16 | $modversion['config'][] = [ |
17 | 17 | 'name' => 'imageWidth', |
18 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
19 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
18 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH', |
|
19 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH_DSC', |
|
20 | 20 | 'formtype' => 'textbox', |
21 | 21 | 'valuetype' => 'int', |
22 | 22 | 'default' => 1200, |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | $modversion['config'][] = [ |
26 | 26 | 'name' => 'imageHeight', |
27 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
28 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
27 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT', |
|
28 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT_DSC', |
|
29 | 29 | 'formtype' => 'textbox', |
30 | 30 | 'valuetype' => 'int', |
31 | 31 | 'default' => 800, |
@@ -33,10 +33,10 @@ discard block |
||
33 | 33 | |
34 | 34 | $modversion['config'][] = [ |
35 | 35 | 'name' => 'imageUploadPath', |
36 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
37 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
36 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH', |
|
37 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH_DSC', |
|
38 | 38 | 'formtype' => 'textbox', |
39 | 39 | 'valuetype' => 'text', |
40 | - 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
40 | + 'default' => 'uploads/'.$modversion['dirname'].'/images', |
|
41 | 41 | ]; |
42 | 42 |
@@ -16,12 +16,12 @@ |
||
16 | 16 | * @since 2.00 |
17 | 17 | * @author Susheng Yang <[email protected]> |
18 | 18 | */ |
19 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
20 | -$form = new \XoopsForm(_EDIT . _AM_TOOLS_BC_BLOCK, 'form', 'blockscall.php', 'post', true); |
|
19 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
20 | +$form = new \XoopsForm(_EDIT._AM_TOOLS_BC_BLOCK, 'form', 'blockscall.php', 'post', true); |
|
21 | 21 | $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_NAME, $block_data['name'])); |
22 | 22 | $form->addElement(new \XoopsFormText(_AM_TOOLS_BC_DESCRIPTION, 'desc', 60, 255, $block_data['desciption'])); |
23 | 23 | if ('' != $block_data['template']) { |
24 | - $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_CONTENT, '<a href="blockscall.php?op=edittpl&bid=' . $block_data['bid'] . '">' . _AM_TOOLS_BC_EDITTPL . '</a>')); |
|
24 | + $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_CONTENT, '<a href="blockscall.php?op=edittpl&bid='.$block_data['bid'].'">'._AM_TOOLS_BC_EDITTPL.'</a>')); |
|
25 | 25 | } |
26 | 26 | if (false !== $block_data['edit_form']) { |
27 | 27 | $form->addElement(new \XoopsFormLabel(_AM_TOOLS_BC_OPTIONS, $block_data['edit_form'])); |
@@ -26,6 +26,6 @@ |
||
26 | 26 | */ |
27 | 27 | public static function eventCoreIncludeCommonEnd($args) |
28 | 28 | { |
29 | - require_once __DIR__ . '/autoloader.php'; |
|
29 | + require_once __DIR__.'/autoloader.php'; |
|
30 | 30 | } |
31 | 31 | } |
@@ -4,12 +4,12 @@ discard block |
||
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register( |
7 | - static function ($class) { |
|
7 | + static function($class) { |
|
8 | 8 | // project-specific namespace prefix |
9 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
9 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
10 | 10 | |
11 | 11 | // base directory for the namespace prefix |
12 | - $baseDir = dirname(__DIR__) . '/class/'; |
|
12 | + $baseDir = dirname(__DIR__).'/class/'; |
|
13 | 13 | |
14 | 14 | // does the class use the namespace prefix? |
15 | 15 | $len = mb_strlen($prefix); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // replace the namespace prefix with the base directory, replace namespace |
25 | 25 | // separators with directory separators in the relative class name, append |
26 | 26 | // with .php |
27 | - $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php'; |
|
27 | + $file = $baseDir.str_replace('\\', '/', $relativeClass).'.php'; |
|
28 | 28 | |
29 | 29 | // if the file exists, require it |
30 | 30 | if (is_file($file)) { |
@@ -69,7 +69,7 @@ |
||
69 | 69 | { |
70 | 70 | $ret = false; |
71 | 71 | |
72 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
72 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
73 | 73 | if (!\class_exists($class)) { |
74 | 74 | throw new \RuntimeException("Class '$class' not found"); |
75 | 75 | } |
@@ -49,10 +49,10 @@ |
||
49 | 49 | if (!$edit_func) { |
50 | 50 | return false; |
51 | 51 | } |
52 | - if (is_file(XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'))) { |
|
52 | + if (is_file(XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'))) { |
|
53 | 53 | xoops_loadLanguage('blocks', $this->getVar('dirname')); |
54 | 54 | |
55 | - require_once XOOPS_ROOT_PATH . '/modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'); |
|
55 | + require_once XOOPS_ROOT_PATH.'/modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file'); |
|
56 | 56 | $options = explode('|', $this->getVar('options')); |
57 | 57 | $edit_form = $edit_func($options); |
58 | 58 | if (!$edit_form) { |
@@ -9,22 +9,6 @@ |
||
9 | 9 | * how to use |
10 | 10 | * The following code inserted in the template |
11 | 11 | * |
12 | - * @param string $module module dirname |
|
13 | - * @param string $file block function file |
|
14 | - * @param string $show_func show block function |
|
15 | - * @param string $options show block function's option |
|
16 | - * @param int $cachetime cachetime Unit for seconds |
|
17 | - * @param mixed $user Generate cache solution |
|
18 | - |
|
19 | -<{xoBlk |
|
20 | - module="ilog" |
|
21 | - file="ilog_block_tag.php" |
|
22 | - show_func="ilog_tag_block_cloud_show" |
|
23 | - options="100|0|150|80" |
|
24 | - template="ilog_tag_block_cloud.html" |
|
25 | - cachetime=10 |
|
26 | - user=admin |
|
27 | -}> |
|
28 | 12 | */ |
29 | 13 | function smarty_function_xoBlk( $params, $smarty ) |
30 | 14 | { |
@@ -26,19 +26,19 @@ |
||
26 | 26 | user=admin |
27 | 27 | }> |
28 | 28 | */ |
29 | -function smarty_function_xoBlk( $params, $smarty ) |
|
29 | +function smarty_function_xoBlk($params, $smarty) |
|
30 | 30 | { |
31 | 31 | /** @var Smarty $smarty */ |
32 | 32 | $old_caching = $smarty->caching; |
33 | 33 | $old_cache_lifetime = $smarty->cache_lifetime; |
34 | 34 | if (isset($params['cachetime'])) { |
35 | 35 | $smarty->caching = 2; |
36 | - $smarty->cache_lifetime = (int)$params['cachetime']; |
|
36 | + $smarty->cache_lifetime = (int) $params['cachetime']; |
|
37 | 37 | } else { |
38 | 38 | $smarty->caching = 0; |
39 | 39 | } |
40 | - $tplName = 'db:' . $params['template']; |
|
41 | - $params['cacheid'] = $params['cacheid'] ?? ('xoBlk_' . md5(var_export($params, true))); |
|
40 | + $tplName = 'db:'.$params['template']; |
|
41 | + $params['cacheid'] = $params['cacheid'] ?? ('xoBlk_'.md5(var_export($params, true))); |
|
42 | 42 | if (!isset($params['cachetime']) || !$smarty->is_cached($tplName, $params['cacheid'])) { |
43 | 43 | $myBlock = [ |
44 | 44 | 'dirname' => $params['module'], |
@@ -30,7 +30,6 @@ |
||
30 | 30 | use MyTextSanitizer; |
31 | 31 | use XoopsFormDhtmlTextArea; |
32 | 32 | use XoopsFormEditor; |
33 | -use XoopsFormTextArea; |
|
34 | 33 | use XoopsModules\Tools\{ |
35 | 34 | Helper |
36 | 35 | }; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | /** |
52 | 52 | * Access the only instance of this class |
53 | - * |
|
53 | + * |
|
54 | 54 | * @return SysUtility |
55 | 55 | * |
56 | 56 | */ |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | //$pathModIcon16 = XOOPS_URL . '/modules/' . $moduleDirName . '/' . $helper->getConfig('modicons16'); |
81 | 81 | $pathModIcon16 = $helper->url($helper->getModule()->getInfo('modicons16')); |
82 | 82 | |
83 | - $select_view = '<form name="form_switch" id="form_switch" action="' . Request::getString('REQUEST_URI', '', 'SERVER') . '" method="post"><span style="font-weight: bold;">' . $text . '</span>'; |
|
83 | + $select_view = '<form name="form_switch" id="form_switch" action="'.Request::getString('REQUEST_URI', '', 'SERVER').'" method="post"><span style="font-weight: bold;">'.$text.'</span>'; |
|
84 | 84 | //$sorts = $sort == 'asc' ? 'desc' : 'asc'; |
85 | 85 | if ($form_sort == $sort) { |
86 | 86 | $sel1 = 'asc' === $order ? 'selasc.png' : 'asc.png'; |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $sel1 = 'asc.png'; |
90 | 90 | $sel2 = 'desc.png'; |
91 | 91 | } |
92 | - $select_view .= ' <a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=asc"><img src="' . $pathModIcon16 . '/' . $sel1 . '" title="ASC" alt="ASC"></a>'; |
|
93 | - $select_view .= '<a href="' . Request::getString('SCRIPT_NAME', '', 'SERVER') . '?start=' . $start . '&sort=' . $form_sort . '&order=desc"><img src="' . $pathModIcon16 . '/' . $sel2 . '" title="DESC" alt="DESC"></a>'; |
|
92 | + $select_view .= ' <a href="'.Request::getString('SCRIPT_NAME', '', 'SERVER').'?start='.$start.'&sort='.$form_sort.'&order=asc"><img src="'.$pathModIcon16.'/'.$sel1.'" title="ASC" alt="ASC"></a>'; |
|
93 | + $select_view .= '<a href="'.Request::getString('SCRIPT_NAME', '', 'SERVER').'?start='.$start.'&sort='.$form_sort.'&order=desc"><img src="'.$pathModIcon16.'/'.$sel2.'" title="DESC" alt="DESC"></a>'; |
|
94 | 94 | $select_view .= '</form>'; |
95 | 95 | |
96 | 96 | return $select_view; |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | { |
106 | 106 | $cat_sql = ''; |
107 | 107 | if (\is_array($cats) && !empty($cats)) { |
108 | - $cat_sql = '(' . \current($cats); |
|
108 | + $cat_sql = '('.\current($cats); |
|
109 | 109 | \array_shift($cats); |
110 | 110 | foreach ($cats as $cat) { |
111 | - $cat_sql .= ',' . $cat; |
|
111 | + $cat_sql .= ','.$cat; |
|
112 | 112 | } |
113 | 113 | $cat_sql .= ')'; |
114 | 114 | } |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | // WHERE TABLE_NAME = '" . $table . "' AND COLUMN_NAME = '" . $columnName . "'") |
161 | 161 | // || exit ($GLOBALS['xoopsDB']->error()); |
162 | 162 | |
163 | - $sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "' . $table . '" AND COLUMN_NAME = "' . $columnName . '"'; |
|
163 | + $sql = 'SELECT COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = "'.$table.'" AND COLUMN_NAME = "'.$columnName.'"'; |
|
164 | 164 | $result = $GLOBALS['xoopsDB']->query($sql); |
165 | 165 | if (!$result) { |
166 | 166 | // exit($GLOBALS['xoopsDB']->error()); |
167 | - $logger = \XoopsLogger::getInstance(); |
|
167 | + $logger = \XoopsLogger::getInstance(); |
|
168 | 168 | $logger->handleError(\E_USER_WARNING, $sql, __FILE__, __LINE__); |
169 | 169 | return false; |
170 | 170 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | public static function cloneRecord($tableName, int $id_field, int $id) |
186 | 186 | { |
187 | 187 | $new_id = false; |
188 | - $logger = \XoopsLogger::getInstance(); |
|
188 | + $logger = \XoopsLogger::getInstance(); |
|
189 | 189 | $table = $GLOBALS['xoopsDB']->prefix($tableName); |
190 | 190 | // copy content of the record you wish to clone |
191 | 191 | $sql = "SELECT * FROM $table WHERE $id_field='$id' "; |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | // set the auto-incremented id's value to blank. |
199 | 199 | unset($tempTable[$id_field]); |
200 | 200 | // insert cloned copy of the original record |
201 | - $sql = "INSERT INTO $table (" . \implode(', ', \array_keys($tempTable)) . ") VALUES ('" . \implode("', '", \array_values($tempTable)) . "')"; |
|
201 | + $sql = "INSERT INTO $table (".\implode(', ', \array_keys($tempTable)).") VALUES ('".\implode("', '", \array_values($tempTable))."')"; |
|
202 | 202 | $result = $GLOBALS['xoopsDB']->queryF($sql); |
203 | 203 | if (!$result) { |
204 | 204 | // exit($GLOBALS['xoopsDB']->error()); |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | $openTags = []; |
230 | 230 | if ($considerHtml) { |
231 | 231 | // if the plain text is shorter than the maximum length, return the whole text |
232 | - if (\mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) { |
|
232 | + if (\mb_strlen(\preg_replace('/<.*?'.'>/', '', $text)) <= $length) { |
|
233 | 233 | return $text; |
234 | 234 | } |
235 | 235 | // splits all html-tags to scanable lines |
236 | - \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER); |
|
236 | + \preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER); |
|
237 | 237 | $total_length = \mb_strlen($ending); |
238 | 238 | //$openTags = []; |
239 | 239 | $truncate = ''; |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | unset($openTags[$pos]); |
252 | 252 | } |
253 | 253 | // if tag is an opening tag |
254 | - } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) { |
|
254 | + } elseif (\preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) { |
|
255 | 255 | // add tag to the beginning of $openTags list |
256 | 256 | \array_unshift($openTags, \mb_strtolower($tag_matchings[1])); |
257 | 257 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | if ($considerHtml) { |
310 | 310 | // close all unclosed html-tags |
311 | 311 | foreach ($openTags as $tag) { |
312 | - $truncate .= '</' . $tag . '>'; |
|
312 | + $truncate .= '</'.$tag.'>'; |
|
313 | 313 | } |
314 | 314 | } |
315 | 315 | |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | if (!@\mkdir($folder) && !\is_dir($folder)) { |
381 | 381 | throw new \RuntimeException(\sprintf('Unable to create the %s directory', $folder)); |
382 | 382 | } |
383 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
383 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
384 | 384 | } catch (\Exception $e) { |
385 | 385 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
386 | 386 | } |
@@ -394,9 +394,9 @@ discard block |
||
394 | 394 | public static function tableExists(string $tablename): bool |
395 | 395 | { |
396 | 396 | $trace = \debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
397 | - \trigger_error(__FUNCTION__ . " is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}"); |
|
397 | + \trigger_error(__FUNCTION__." is deprecated, called from {$trace[0]['file']} line {$trace[0]['line']}"); |
|
398 | 398 | $GLOBALS['xoopsLogger']->addDeprecated( |
399 | - \basename(\dirname(__DIR__, 2)) . ' Module: ' . __FUNCTION__ . ' function is deprecated, please use Xmf\Database\Tables method(s) instead.' . " Called from {$trace[0]['file']}line {$trace[0]['line']}" |
|
399 | + \basename(\dirname(__DIR__, 2)).' Module: '.__FUNCTION__.' function is deprecated, please use Xmf\Database\Tables method(s) instead.'." Called from {$trace[0]['file']}line {$trace[0]['line']}" |
|
400 | 400 | ); |
401 | 401 | $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'"); |
402 | 402 | |
@@ -413,6 +413,6 @@ discard block |
||
413 | 413 | public static function addField($field, $table) |
414 | 414 | { |
415 | 415 | global $xoopsDB; |
416 | - return $xoopsDB->queryF('ALTER TABLE ' . $table . " ADD $field;"); |
|
416 | + return $xoopsDB->queryF('ALTER TABLE '.$table." ADD $field;"); |
|
417 | 417 | } |
418 | 418 | } |