@@ -5,13 +5,13 @@ discard block |
||
5 | 5 | // GIJOE <https://www.peak.ne.jp> // |
6 | 6 | // ------------------------------------------------------------------------- // |
7 | 7 | |
8 | -require_once __DIR__ . '/class/AltsysBreadcrumbs.class.php'; |
|
9 | -require_once __DIR__ . '/include/gtickets.php'; |
|
10 | -require_once __DIR__ . '/include/altsys_functions.php'; |
|
11 | -require_once __DIR__ . '/include/tpls_functions.php'; |
|
12 | -require_once __DIR__ . '/include/Text_Diff.php'; |
|
13 | -require_once __DIR__ . '/include/Text_Diff_Renderer.php'; |
|
14 | -require_once __DIR__ . '/include/Text_Diff_Renderer_unified.php'; |
|
8 | +require_once __DIR__.'/class/AltsysBreadcrumbs.class.php'; |
|
9 | +require_once __DIR__.'/include/gtickets.php'; |
|
10 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
11 | +require_once __DIR__.'/include/tpls_functions.php'; |
|
12 | +require_once __DIR__.'/include/Text_Diff.php'; |
|
13 | +require_once __DIR__.'/include/Text_Diff_Renderer.php'; |
|
14 | +require_once __DIR__.'/include/Text_Diff_Renderer_unified.php'; |
|
15 | 15 | |
16 | 16 | // only groups have 'module_admin' of 'altsys' can do that. |
17 | 17 | $moduleHandler = xoops_getHandler('module'); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // check $xoopsModule |
35 | 35 | if (!is_object($xoopsModule)) { |
36 | - redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM); |
|
36 | + redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // check access right (needs system_admin of tplset) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | 'tpl_refid' => 0, |
58 | 58 | 'tpl_module' => '_custom', |
59 | 59 | 'tpl_tplset' => $tpl_tplset, |
60 | - 'tpl_file' => '_custom_' . mb_substr(date('YmdHis'), 2, -2) . '.html', |
|
60 | + 'tpl_file' => '_custom_'.mb_substr(date('YmdHis'), 2, -2).'.html', |
|
61 | 61 | 'tpl_desc' => '', |
62 | 62 | 'tpl_lastmodified' => 0, |
63 | 63 | 'tpl_lastimported' => 0, |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | |
70 | 70 | $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
71 | 71 | |
72 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
72 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
73 | 73 | |
74 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE); |
|
74 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=_custom', _MYTPLSADMIN_CUSTOMTEMPLATE); |
|
75 | 75 | |
76 | 76 | $breadcrumbsObj->appendPath('', '_MYTPLSADMIN_CREATENEWCUSTOMTEMPLATE'); |
77 | 77 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | // get information from tplfile table |
91 | 91 | |
92 | - $sql = 'SELECT * FROM ' . $db->prefix('tplfile') . ' f NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC"; |
|
92 | + $sql = 'SELECT * FROM '.$db->prefix('tplfile').' f NATURAL LEFT JOIN '.$db->prefix('tplsource')." s WHERE f.tpl_file='$tpl_file4sql' ORDER BY f.tpl_tplset='$tpl_tplset4sql' DESC,f.tpl_tplset='default' DESC"; |
|
93 | 93 | |
94 | 94 | $tpl = $db->fetchArray($db->query($sql)); |
95 | 95 | |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | if ('altsys' != $mydirname && is_object($target_module)) { |
115 | 115 | // mytplsform in each modules |
116 | 116 | |
117 | - $mod_url = XOOPS_URL . '/modules/' . $target_module->getVar('dirname'); |
|
117 | + $mod_url = XOOPS_URL.'/modules/'.$target_module->getVar('dirname'); |
|
118 | 118 | |
119 | 119 | $modinfo = $target_module->getInfo(); |
120 | 120 | |
121 | - $breadcrumbsObj->appendPath($mod_url . '/' . @$modinfo['adminindex'], $target_mname); |
|
121 | + $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $target_mname); |
|
122 | 122 | |
123 | - $breadcrumbsObj->appendPath($mod_url . '/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN); |
|
123 | + $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', _MD_A_MYTPLSFORM_TPLSADMIN); |
|
124 | 124 | } else { |
125 | 125 | // mytplsform in altsys |
126 | 126 | |
127 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
127 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin', '_MI_ALTSYS_MENU_MYTPLSADMIN'); |
|
128 | 128 | |
129 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . htmlspecialchars($tpl['tpl_module'], ENT_QUOTES | ENT_HTML5), $target_mname); |
|
129 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.htmlspecialchars($tpl['tpl_module'], ENT_QUOTES | ENT_HTML5), $target_mname); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $breadcrumbsObj->appendPath('', _MD_A_MYTPLSFORM_EDIT); |
@@ -148,19 +148,19 @@ discard block |
||
148 | 148 | // Ticket Check |
149 | 149 | |
150 | 150 | if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
151 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
151 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
152 | 152 | } |
153 | 153 | |
154 | - $result = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='" . addslashes($tpl['tpl_tplset']) . "'"); |
|
154 | + $result = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_file='$tpl_file4sql' AND tpl_tplset='".addslashes($tpl['tpl_tplset'])."'"); |
|
155 | 155 | |
156 | 156 | while ([$tpl_id] = $db->fetchRow($result)) { |
157 | - $sql = 'UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes(($_POST['tpl_source'])) . "' WHERE tpl_id=$tpl_id"; |
|
157 | + $sql = 'UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes(($_POST['tpl_source']))."' WHERE tpl_id=$tpl_id"; |
|
158 | 158 | |
159 | 159 | if (!$db->query($sql)) { |
160 | 160 | die('SQL Error'); |
161 | 161 | } |
162 | 162 | |
163 | - $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id"); |
|
163 | + $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified=UNIX_TIMESTAMP() WHERE tpl_id=$tpl_id"); |
|
164 | 164 | |
165 | 165 | altsys_template_touch($tpl_id); |
166 | 166 | } |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | // continue or end ? |
169 | 169 | |
170 | 170 | if (!empty($_POST['do_modifycont'])) { |
171 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file=' . $tpl_file . '&tpl_tplset=' . $tpl_tplset . '&dirname=' . $tpl['tpl_module'] . '#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED); |
|
171 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsform&tpl_file='.$tpl_file.'&tpl_tplset='.$tpl_tplset.'&dirname='.$tpl['tpl_module'].'#altsys_tplsform_top', 1, _MD_A_MYTPLSFORM_UPDATED); |
|
172 | 172 | } else { |
173 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED); |
|
173 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_UPDATED); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | exit; |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | // Ticket Check |
181 | 181 | |
182 | 182 | if (!$xoopsGTicket->check(true, 'altsys_tplsform')) { |
183 | - redirect_header(XOOPS_URL . '/', 3, $xoopsGTicket->getErrors()); |
|
183 | + redirect_header(XOOPS_URL.'/', 3, $xoopsGTicket->getErrors()); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | $sql = 'INSERT INTO ' |
@@ -196,22 +196,22 @@ discard block |
||
196 | 196 | . "'"; |
197 | 197 | |
198 | 198 | if (!$db->query($sql)) { |
199 | - die('SQL Error' . __LINE__); |
|
199 | + die('SQL Error'.__LINE__); |
|
200 | 200 | } |
201 | 201 | |
202 | - $tpl_id = (int) $db->getInsertId(); |
|
202 | + $tpl_id = (int)$db->getInsertId(); |
|
203 | 203 | |
204 | - $sql = 'INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id=$tpl_id,tpl_source='" . addslashes(($_POST['tpl_source'])) . "'"; |
|
204 | + $sql = 'INSERT INTO '.$db->prefix('tplsource')." SET tpl_id=$tpl_id,tpl_source='".addslashes(($_POST['tpl_source']))."'"; |
|
205 | 205 | |
206 | 206 | if (!$db->query($sql)) { |
207 | - die('SQL Error' . __LINE__); |
|
207 | + die('SQL Error'.__LINE__); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | altsys_template_touch($tpl_id); |
211 | 211 | |
212 | 212 | // continue or end ? |
213 | 213 | |
214 | - redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED); |
|
214 | + redirect_header('index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$tpl['tpl_module'], 1, _MD_A_MYTPLSFORM_CREATED); |
|
215 | 215 | |
216 | 216 | exit; |
217 | 217 | } |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | // FORM stage // |
221 | 221 | //****************// |
222 | 222 | xoops_cp_header(); |
223 | -$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $mydirname; |
|
223 | +$mymenu_fake_uri = 'index.php?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$mydirname; |
|
224 | 224 | |
225 | 225 | // mymenu |
226 | 226 | altsys_include_mymenu(); |
227 | 227 | |
228 | -echo "<h3 style='text-align:" . _GLOBAL_LEFT . ";'>" . _MD_A_MYTPLSFORM_EDIT . ' : ' . htmlspecialchars($tpl['tpl_type'], ENT_QUOTES | ENT_HTML5) . ' : ' . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5) . ' (' . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5) . ")</h3>\n"; |
|
228 | +echo "<h3 style='text-align:"._GLOBAL_LEFT.";'>"._MD_A_MYTPLSFORM_EDIT.' : '.htmlspecialchars($tpl['tpl_type'], ENT_QUOTES | ENT_HTML5).' : '.htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5).' ('.htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5).")</h3>\n"; |
|
229 | 229 | |
230 | 230 | // diff from file to selected DB template |
231 | 231 | $basefilepath = tplsadmin_get_basefilepath($tpl['tpl_module'], $tpl['tpl_type'], $tpl['tpl_file']); |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | |
244 | 244 | foreach (explode("\n", $diff_str) as $line) { |
245 | 245 | if (0x2d == ord($line)) { |
246 | - $diff_from_file4disp .= "<span style='color:red;'>" . $line . "</span>\n"; |
|
246 | + $diff_from_file4disp .= "<span style='color:red;'>".$line."</span>\n"; |
|
247 | 247 | } elseif (0x2b == ord($line)) { |
248 | - $diff_from_file4disp .= "<span style='color:blue;'>" . $line . "</span>\n"; |
|
248 | + $diff_from_file4disp .= "<span style='color:blue;'>".$line."</span>\n"; |
|
249 | 249 | } else { |
250 | - $diff_from_file4disp .= $line . "\n"; |
|
250 | + $diff_from_file4disp .= $line."\n"; |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | error_reporting($original_error_level & ~E_NOTICE & ~E_WARNING); |
263 | 263 | |
264 | - [$default_source] = $db->fetchRow($db->query('SELECT tpl_source FROM ' . $db->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $db->prefix('tplsource') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl['tpl_file']) . "' AND tpl_module='" . addslashes($tpl['tpl_module']) . "'")); |
|
264 | + [$default_source] = $db->fetchRow($db->query('SELECT tpl_source FROM '.$db->prefix('tplfile').' NATURAL LEFT JOIN '.$db->prefix('tplsource')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl['tpl_file'])."' AND tpl_module='".addslashes($tpl['tpl_module'])."'")); |
|
265 | 265 | |
266 | 266 | $diff = new Text_Diff(explode("\n", $default_source), explode("\n", $tpl['tpl_source'])); |
267 | 267 | |
@@ -271,11 +271,11 @@ discard block |
||
271 | 271 | |
272 | 272 | foreach (explode("\n", $diff_str) as $line) { |
273 | 273 | if (0x2d == ord($line)) { |
274 | - $diff_from_default4disp .= "<span style='color:red;'>" . $line . "</span>\n"; |
|
274 | + $diff_from_default4disp .= "<span style='color:red;'>".$line."</span>\n"; |
|
275 | 275 | } elseif (0x2b == ord($line)) { |
276 | - $diff_from_default4disp .= "<span style='color:blue;'>" . $line . "</span>\n"; |
|
276 | + $diff_from_default4disp .= "<span style='color:blue;'>".$line."</span>\n"; |
|
277 | 277 | } else { |
278 | - $diff_from_default4disp .= $line . "\n"; |
|
278 | + $diff_from_default4disp .= $line."\n"; |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 | |
@@ -297,25 +297,25 @@ discard block |
||
297 | 297 | |
298 | 298 | echo " |
299 | 299 | <a name='altsys_tplsform_top' id='altsys_tplsform_top'></a> |
300 | -<form name='MainForm' id='altsys_tplsform' action='?mode=admin&lib=altsys&page=mytplsform&tpl_file=" . htmlspecialchars($tpl_file, ENT_QUOTES | ENT_HTML5) . '&tpl_tplset=' . htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5) . '&dirname=' . $target_mname . "' method='post'> |
|
301 | - " . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys_tplsform') . " |
|
302 | - <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>" . htmlspecialchars($tpl['tpl_source'], ENT_QUOTES | ENT_HTML5) . '</textarea> |
|
300 | +<form name='MainForm' id='altsys_tplsform' action='?mode=admin&lib=altsys&page=mytplsform&tpl_file=" . htmlspecialchars($tpl_file, ENT_QUOTES | ENT_HTML5).'&tpl_tplset='.htmlspecialchars($tpl['tpl_tplset'], ENT_QUOTES | ENT_HTML5).'&dirname='.$target_mname."' method='post'> |
|
301 | + " . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'altsys_tplsform')." |
|
302 | + <textarea name='tpl_source' id='altsys_tpl_source' wrap='off' style='width:600px;height:400px;'>" . htmlspecialchars($tpl['tpl_source'], ENT_QUOTES | ENT_HTML5).'</textarea> |
|
303 | 303 | <br> |
304 | 304 | '; |
305 | 305 | if ('create' == $edit_mode) { |
306 | 306 | // create form |
307 | 307 | |
308 | 308 | echo " |
309 | - <label for='tpl_file'>" . _MD_A_MYTPLSFORM_LABEL_TPLFILE . "</label> |
|
310 | - <input type='text' name='tpl_file' id='tpl_file' value='" . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5) . "' size='64'><br> |
|
311 | - <input type='submit' name='do_create' id='do_create' value='" . _MD_A_MYTPLSFORM_BTN_CREATE . "'>\n"; |
|
309 | + <label for='tpl_file'>" . _MD_A_MYTPLSFORM_LABEL_TPLFILE."</label> |
|
310 | + <input type='text' name='tpl_file' id='tpl_file' value='" . htmlspecialchars($tpl['tpl_file'], ENT_QUOTES | ENT_HTML5)."' size='64'><br> |
|
311 | + <input type='submit' name='do_create' id='do_create' value='" . _MD_A_MYTPLSFORM_BTN_CREATE."'>\n"; |
|
312 | 312 | } else { |
313 | 313 | // modify form |
314 | 314 | |
315 | 315 | echo " |
316 | - <input type='submit' name='do_modifycont' id='do_modifycont' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYCONT . "'> |
|
317 | - <input type='submit' name='do_modify' id='do_modify' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYEND . "'> |
|
318 | - <input type='reset' name='reset' value='" . _MD_A_MYTPLSFORM_BTN_RESET . "'> |
|
316 | + <input type='submit' name='do_modifycont' id='do_modifycont' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYCONT."'> |
|
317 | + <input type='submit' name='do_modify' id='do_modify' value='" . _MD_A_MYTPLSFORM_BTN_MODIFYEND."'> |
|
318 | + <input type='reset' name='reset' value='" . _MD_A_MYTPLSFORM_BTN_RESET."'> |
|
319 | 319 | </form>\n"; |
320 | 320 | } |
321 | 321 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once __DIR__ . '/include/altsys_functions.php'; |
|
3 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
4 | 4 | |
5 | 5 | // language file (modinfo.php) |
6 | 6 | altsys_include_language_file('modinfo'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'description' => '', |
39 | 39 | 'show_func' => 'b_altsys_admin_menu_show', |
40 | 40 | 'edit_func' => 'b_altsys_admin_menu_edit', |
41 | - 'options' => (string) $mydirname, |
|
41 | + 'options' => (string)$mydirname, |
|
42 | 42 | 'template' => '', // use "module" template instead |
43 | 43 | ]; |
44 | 44 | |
@@ -112,5 +112,5 @@ discard block |
||
112 | 112 | |
113 | 113 | // keep block's options |
114 | 114 | if (!defined('XOOPS_CUBE_LEGACY') && mb_substr(XOOPS_VERSION, 6, 3) < 2.1 && !empty($_POST['fct']) && !empty($_POST['op']) && 'modulesadmin' == $_POST['fct'] && 'update_ok' == $_POST['op'] && $_POST['dirname'] == $modversion['dirname']) { |
115 | - require __DIR__ . '/include/x20_keepblockoptions.inc.php'; |
|
115 | + require __DIR__.'/include/x20_keepblockoptions.inc.php'; |
|
116 | 116 | } |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | |
8 | 8 | error_reporting(0); |
9 | 9 | |
10 | -require_once __DIR__ . '/include/gtickets.php'; |
|
11 | -require_once __DIR__ . '/include/altsys_functions.php'; |
|
10 | +require_once __DIR__.'/include/gtickets.php'; |
|
11 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
12 | 12 | |
13 | 13 | // this page can be called only from altsys |
14 | 14 | if ('altsys' != $xoopsModule->getVar('dirname')) { |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | altsys_include_language_file('compilehookadmin'); |
20 | 20 | |
21 | 21 | if (!empty($_POST['download_zip'])) { |
22 | - require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php'; |
|
22 | + require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php'; |
|
23 | 23 | |
24 | 24 | $downloader = new \XoopsZipDownloader(); |
25 | 25 | |
26 | 26 | $do_download = true; |
27 | 27 | } elseif (!empty($_POST['download_tgz'])) { |
28 | - require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; |
|
28 | + require_once XOOPS_ROOT_PATH.'/class/tardownloader.php'; |
|
29 | 29 | |
30 | 30 | $downloader = new \XoopsTarDownloader(); |
31 | 31 | |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | break; |
52 | 52 | } |
53 | 53 | } |
54 | -$trs = $xoopsDB->query('SELECT DISTINCT tpl_file,tpl_source,tpl_lastmodified FROM ' . $xoopsDB->prefix('tplfile') . ' NATURAL LEFT JOIN ' . $xoopsDB->prefix('tplsource') . " WHERE tpl_tplset='" . addslashes($tplset) . "' ORDER BY tpl_file"); |
|
54 | +$trs = $xoopsDB->query('SELECT DISTINCT tpl_file,tpl_source,tpl_lastmodified FROM '.$xoopsDB->prefix('tplfile').' NATURAL LEFT JOIN '.$xoopsDB->prefix('tplsource')." WHERE tpl_tplset='".addslashes($tplset)."' ORDER BY tpl_file"); |
|
55 | 55 | if ($xoopsDB->getRowsNum($trs) <= 0) { |
56 | 56 | die(_TPLSADMIN_ERR_INVALIDTPLSET); |
57 | 57 | } |
58 | 58 | |
59 | 59 | while ([$tpl_file, $tpl_source, $tpl_lastmodified] = $xoopsDB->fetchRow($trs)) { |
60 | - $downloader->addFileData($tpl_source, $tplset . '/' . $tpl_file, $tpl_lastmodified); |
|
60 | + $downloader->addFileData($tpl_source, $tplset.'/'.$tpl_file, $tpl_lastmodified); |
|
61 | 61 | } |
62 | 62 | //bugfix by nao-pon ,echo is not necessary for downloader |
63 | -$downloader->download('template_' . $tplset, true); |
|
63 | +$downloader->download('template_'.$tplset, true); |
@@ -65,8 +65,8 @@ |
||
65 | 65 | require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
66 | 66 | $tpl = new D3Tpl(); |
67 | 67 | $tpl->assign([ |
68 | - 'adminmenu' => $adminmenu, |
|
69 | - ]); |
|
68 | + 'adminmenu' => $adminmenu, |
|
69 | + ]); |
|
70 | 70 | $tpl->display('db:altsys_inc_mymenu.tpl'); |
71 | 71 | //$tpl->display('db:inc_mymenu.tpl'); |
72 | 72 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // language files (modinfo.php) |
21 | 21 | altsys_include_language_file('modinfo'); |
22 | 22 | |
23 | -require __DIR__ . '/admin_menu.php'; |
|
23 | +require __DIR__.'/admin_menu.php'; |
|
24 | 24 | |
25 | 25 | $adminmenu = array_merge($adminmenu, $adminmenu4altsys); |
26 | 26 | |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | // link conversion from relative to absolute |
58 | 58 | foreach (array_keys($adminmenu) as $i) { |
59 | 59 | if (false === mb_stristr($adminmenu[$i]['link'], XOOPS_URL)) { |
60 | - $adminmenu[$i]['link'] = XOOPS_URL . "/modules/$mydirname/" . $adminmenu[$i]['link']; |
|
60 | + $adminmenu[$i]['link'] = XOOPS_URL."/modules/$mydirname/".$adminmenu[$i]['link']; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | // display |
65 | -require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
|
65 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
66 | 66 | $tpl = new D3Tpl(); |
67 | 67 | $tpl->assign([ |
68 | 68 | 'adminmenu' => $adminmenu, |
@@ -72,6 +72,6 @@ discard block |
||
72 | 72 | |
73 | 73 | // submenu |
74 | 74 | $page = preg_replace('/[^0-9a-zA-Z_-]/', '', @$_GET['page']); |
75 | -if (file_exists(__DIR__ . '/mymenusub/' . $page . '.php')) { |
|
76 | - require __DIR__ . '/mymenusub/' . $page . '.php'; |
|
75 | +if (file_exists(__DIR__.'/mymenusub/'.$page.'.php')) { |
|
76 | + require __DIR__.'/mymenusub/'.$page.'.php'; |
|
77 | 77 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_admin_menu.tpl' : trim($options[1]); |
16 | 16 | |
17 | 17 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
18 | - exit('Invalid mydirname'); |
|
18 | + exit('Invalid mydirname'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | if (!is_object(@$xoopsUser)) { |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_admin_menu.tpl' : trim((string) $options[1]); |
188 | 188 | |
189 | 189 | if (preg_match('/[^0-9a-zA-Z_-]/', (string) $mydirname)) { |
190 | - exit('Invalid mydirname'); |
|
190 | + exit('Invalid mydirname'); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $form = " |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once dirname(__DIR__) . '/include/altsys_functions.php'; |
|
3 | +require_once dirname(__DIR__).'/include/altsys_functions.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * @param $options |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $mydirname = empty($options[0]) ? 'altsys' : $options[0]; |
14 | 14 | |
15 | - $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_admin_menu.tpl' : trim($options[1]); |
|
15 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.tpl' : trim($options[1]); |
|
16 | 16 | |
17 | 17 | if (preg_match('/[^0-9a-zA-Z_-]/', $mydirname)) { |
18 | 18 | exit('Invalid mydirname'); |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | |
57 | 57 | $admin_mids = $grouppermHandler->getItemIds('module_admin', $xoopsUser->getGroups()); |
58 | 58 | |
59 | - $modules = $moduleHandler->getObjects(new \Criteria('mid', '(' . implode(',', $admin_mids) . ')', 'IN'), true); |
|
59 | + $modules = $moduleHandler->getObjects(new \Criteria('mid', '('.implode(',', $admin_mids).')', 'IN'), true); |
|
60 | 60 | |
61 | 61 | $block = [ |
62 | 62 | 'mydirname' => $mydirname, |
63 | - 'mod_url' => XOOPS_URL . '/modules/' . $mydirname, |
|
64 | - 'mod_imageurl' => XOOPS_URL . '/modules/' . $mydirname . '/' . $current_configs['images_dir'], |
|
63 | + 'mod_url' => XOOPS_URL.'/modules/'.$mydirname, |
|
64 | + 'mod_imageurl' => XOOPS_URL.'/modules/'.$mydirname.'/'.$current_configs['images_dir'], |
|
65 | 65 | 'mod_config' => $current_configs, |
66 | 66 | ]; |
67 | 67 | |
68 | 68 | foreach ($modules as $mod) { |
69 | - $mid = (int) $mod->getVar('mid'); |
|
69 | + $mid = (int)$mod->getVar('mid'); |
|
70 | 70 | |
71 | 71 | $dirname = $mod->getVar('dirname'); |
72 | 72 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | unset($adminmenu_use_altsys); |
82 | 82 | |
83 | - @require XOOPS_ROOT_PATH . '/modules/' . $dirname . '/' . @$modinfo['adminmenu']; |
|
83 | + @require XOOPS_ROOT_PATH.'/modules/'.$dirname.'/'.@$modinfo['adminmenu']; |
|
84 | 84 | |
85 | 85 | // from admin_menu.php etc. |
86 | 86 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $submenus4assign[] = [ |
97 | 97 | 'title' => htmlspecialchars($sub['title']), |
98 | - 'url' => XOOPS_URL . '/modules/' . $dirname . '/' . htmlspecialchars($link, ENT_QUOTES | ENT_HTML5), |
|
98 | + 'url' => XOOPS_URL.'/modules/'.$dirname.'/'.htmlspecialchars($link, ENT_QUOTES | ENT_HTML5), |
|
99 | 99 | ]; |
100 | 100 | } |
101 | 101 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | |
120 | 120 | $submenus4assign[] = [ |
121 | 121 | 'title' => htmlspecialchars($sub['title']), |
122 | - 'url' => 0 === strncmp((string) $sub['link'], 'http', 4) ? htmlspecialchars((string) $sub['link'], ENT_QUOTES | ENT_HTML5) : XOOPS_URL . '/modules/' . $dirname . '/' . htmlspecialchars((string) $sub['link'], ENT_QUOTES | ENT_HTML5), |
|
122 | + 'url' => 0 === strncmp((string)$sub['link'], 'http', 4) ? htmlspecialchars((string)$sub['link'], ENT_QUOTES | ENT_HTML5) : XOOPS_URL.'/modules/'.$dirname.'/'.htmlspecialchars((string)$sub['link'], ENT_QUOTES | ENT_HTML5), |
|
123 | 123 | ]; |
124 | 124 | } |
125 | 125 | } elseif (empty($adminmenu4altsys)) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (defined('XOOPS_CUBE_LEGACY') && !empty($modinfo['help'])) { |
138 | 138 | $submenus4assign[] = [ |
139 | 139 | 'title' => _HELP, |
140 | - 'url' => XOOPS_URL . '/modules/legacy/admin/index.php?action=Help&dirname=' . $dirname, |
|
140 | + 'url' => XOOPS_URL.'/modules/legacy/admin/index.php?action=Help&dirname='.$dirname, |
|
141 | 141 | ]; |
142 | 142 | } |
143 | 143 | } |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | 'name' => $mod->getVar('name'), |
149 | 149 | 'version_in_db' => sprintf('%.2f', $mod->getVar('version') / 100.0), |
150 | 150 | 'version_in_file' => sprintf('%.2f', $modinfo['version']), |
151 | - 'description' => htmlspecialchars((string) @$modinfo['description'], ENT_QUOTES | ENT_HTML5), |
|
152 | - 'image' => htmlspecialchars((string) $modinfo['image'], ENT_QUOTES | ENT_HTML5), |
|
151 | + 'description' => htmlspecialchars((string)@$modinfo['description'], ENT_QUOTES | ENT_HTML5), |
|
152 | + 'image' => htmlspecialchars((string)$modinfo['image'], ENT_QUOTES | ENT_HTML5), |
|
153 | 153 | 'isactive' => $mod->getVar('isactive'), |
154 | 154 | 'hasmain' => $mod->getVar('hasmain'), |
155 | 155 | 'hasadmin' => $mod->getVar('hasadmin'), |
156 | 156 | 'hasconfig' => $mod->getVar('hasconfig'), |
157 | 157 | 'weight' => $mod->getVar('weight'), |
158 | - 'adminindex' => htmlspecialchars((string) @$modinfo['adminindex'], ENT_QUOTES | ENT_HTML5), |
|
158 | + 'adminindex' => htmlspecialchars((string)@$modinfo['adminindex'], ENT_QUOTES | ENT_HTML5), |
|
159 | 159 | 'adminindex_absolute' => @$modinfo['adminindex_absolute'], |
160 | 160 | 'submenu' => $submenus4assign, |
161 | 161 | 'selected' => $mid == $mid_selected ? true : false, |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $block['modules'][] = $module4assign; |
166 | 166 | } |
167 | 167 | |
168 | - require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
|
168 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
169 | 169 | |
170 | 170 | $tpl = new D3Tpl(); |
171 | 171 | |
@@ -184,16 +184,16 @@ discard block |
||
184 | 184 | { |
185 | 185 | $mydirname = empty($options[0]) ? 'd3forum' : $options[0]; |
186 | 186 | |
187 | - $this_template = empty($options[1]) ? 'db:' . $mydirname . '_block_admin_menu.tpl' : trim((string) $options[1]); |
|
187 | + $this_template = empty($options[1]) ? 'db:'.$mydirname.'_block_admin_menu.tpl' : trim((string)$options[1]); |
|
188 | 188 | |
189 | - if (preg_match('/[^0-9a-zA-Z_-]/', (string) $mydirname)) { |
|
189 | + if (preg_match('/[^0-9a-zA-Z_-]/', (string)$mydirname)) { |
|
190 | 190 | exit('Invalid mydirname'); |
191 | 191 | } |
192 | 192 | |
193 | 193 | $form = " |
194 | 194 | <input type='hidden' name='options[0]' value='$mydirname'> |
195 | - <label for='this_template'>" . _MB_ALTSYS_THISTEMPLATE . "</label> : |
|
196 | - <input type='text' size='60' name='options[1]' id='this_template' value='" . htmlspecialchars($this_template, ENT_QUOTES | ENT_HTML5) . "'> |
|
195 | + <label for='this_template'>"._MB_ALTSYS_THISTEMPLATE."</label> : |
|
196 | + <input type='text' size='60' name='options[1]' id='this_template' value='" . htmlspecialchars($this_template, ENT_QUOTES | ENT_HTML5)."'> |
|
197 | 197 | <br> |
198 | 198 | \n"; |
199 | 199 |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | // $Id: MyBlocksAdminForXCL21.class.php ,ver 0.0.7.1 2011/01/27 16:10:00 domifara Exp $ |
3 | 3 | |
4 | -require_once __DIR__ . '/MyBlocksAdmin.class.php'; |
|
4 | +require_once __DIR__.'/MyBlocksAdmin.class.php'; |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Class MyBlocksAdminForXCL21 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $langman->read('admin.php', $this->target_dirname); |
49 | 49 | } |
50 | 50 | |
51 | - $bid = (int) $block_data['bid']; |
|
51 | + $bid = (int)$block_data['bid']; |
|
52 | 52 | |
53 | 53 | //HACK by domifara |
54 | 54 | |
@@ -70,6 +70,6 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function checkFck() |
72 | 72 | { |
73 | - return (!altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js')); |
|
73 | + return (!altsysUtils::isInstalledXclHtmleditor() && file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js')); |
|
74 | 74 | } |
75 | 75 | } |
@@ -288,11 +288,11 @@ discard block |
||
288 | 288 | // get selected targets |
289 | 289 | |
290 | 290 | if (is_array(@$block_data['bmodule'])) { |
291 | - // bmodule originated from request (preview etc.) |
|
291 | + // bmodule originated from request (preview etc.) |
|
292 | 292 | |
293 | 293 | $selected_mids = $block_data['bmodule']; |
294 | 294 | } else { |
295 | - // originated from the table of `block_module_link` |
|
295 | + // originated from the table of `block_module_link` |
|
296 | 296 | |
297 | 297 | $result = $this->db->query('SELECT module_id FROM ' . $this->db->prefix('block_module_link') . " WHERE block_id='$bid'"); |
298 | 298 | |
@@ -549,12 +549,12 @@ discard block |
||
549 | 549 | ]; |
550 | 550 | |
551 | 551 | $blocks4assign[] = [ |
552 | - 'name_raw' => $block_data['name'], |
|
553 | - 'title_raw' => $block_data['title'], |
|
554 | - 'cell_position' => $this->renderCell4BlockPosition($block_data), |
|
555 | - 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), |
|
556 | - 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), |
|
557 | - ] + $block_data; |
|
552 | + 'name_raw' => $block_data['name'], |
|
553 | + 'title_raw' => $block_data['title'], |
|
554 | + 'cell_position' => $this->renderCell4BlockPosition($block_data), |
|
555 | + 'cell_module_link' => $this->renderCell4BlockModuleLink($block_data), |
|
556 | + 'cell_group_perm' => $this->renderCell4BlockReadGroupPerm($block_data), |
|
557 | + ] + $block_data; |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | // display |
@@ -564,14 +564,14 @@ discard block |
||
564 | 564 | $tpl = new D3Tpl(); |
565 | 565 | |
566 | 566 | $tpl->assign([ |
567 | - 'target_mid' => $this->target_mid, |
|
568 | - 'target_dirname' => $this->target_dirname, |
|
569 | - 'target_mname' => $this->target_mname, |
|
570 | - 'language' => $this->lang, |
|
571 | - 'cachetime_options' => $this->cachetime_options, |
|
572 | - 'blocks' => $blocks4assign, |
|
573 | - 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin'), |
|
574 | - ]); |
|
567 | + 'target_mid' => $this->target_mid, |
|
568 | + 'target_dirname' => $this->target_dirname, |
|
569 | + 'target_mname' => $this->target_mname, |
|
570 | + 'language' => $this->lang, |
|
571 | + 'cachetime_options' => $this->cachetime_options, |
|
572 | + 'blocks' => $blocks4assign, |
|
573 | + 'gticket_hidden' => $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin'), |
|
574 | + ]); |
|
575 | 575 | |
576 | 576 | $tpl->display('db:altsys_main_myblocksadmin_list.tpl'); |
577 | 577 | } |
@@ -1250,18 +1250,18 @@ discard block |
||
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | $tpl->assign([ |
1253 | - 'target_dirname' => $this->target_dirname, |
|
1254 | - 'target_mname' => $this->target_mname, |
|
1255 | - 'language' => $this->lang, |
|
1256 | - 'cachetime_options' => $this->cachetime_options, |
|
1257 | - 'ctype_options' => $this->ctype_options, |
|
1258 | - 'block' => $block4assign, |
|
1259 | - 'op' => $next_op, |
|
1260 | - 'form_title' => $form_title, |
|
1261 | - 'submit_button' => $button_value, |
|
1262 | - 'common_fck_installed' => $this->checkFck(), |
|
1263 | - 'gticket_hidden' => $GLOBALS['xoopsSecurity']->getTokenHTML('myblocksadmin'), |
|
1264 | - ]); |
|
1253 | + 'target_dirname' => $this->target_dirname, |
|
1254 | + 'target_mname' => $this->target_mname, |
|
1255 | + 'language' => $this->lang, |
|
1256 | + 'cachetime_options' => $this->cachetime_options, |
|
1257 | + 'ctype_options' => $this->ctype_options, |
|
1258 | + 'block' => $block4assign, |
|
1259 | + 'op' => $next_op, |
|
1260 | + 'form_title' => $form_title, |
|
1261 | + 'submit_button' => $button_value, |
|
1262 | + 'common_fck_installed' => $this->checkFck(), |
|
1263 | + 'gticket_hidden' => $GLOBALS['xoopsSecurity']->getTokenHTML('myblocksadmin'), |
|
1264 | + ]); |
|
1265 | 1265 | |
1266 | 1266 | if (defined('XOOPS_CUBE_LEGACY')) { |
1267 | 1267 | $tpl->display('db:altsys_main_myblocksadmin_edit_4legacy.tpl'); |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $this->target_mid = $target_module->getVar('mid'); |
128 | 128 | |
129 | - $this->target_mname = $target_module->getVar('name') . ' ' . sprintf('(%2.2f)', (int)$target_module->getVar('version') / 100.0); |
|
129 | + $this->target_mname = $target_module->getVar('name').' '.sprintf('(%2.2f)', (int)$target_module->getVar('version') / 100.0); |
|
130 | 130 | |
131 | 131 | $this->target_dirname = $target_module->getVar('dirname'); |
132 | 132 | |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | |
137 | 137 | $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
138 | 138 | |
139 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
139 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
140 | 140 | |
141 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=' . $this->target_dirname, $this->target_mname); |
|
141 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, $this->target_mname); |
|
142 | 142 | } else { |
143 | 143 | // custom blocks |
144 | 144 | |
@@ -152,28 +152,28 @@ discard block |
||
152 | 152 | |
153 | 153 | $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
154 | 154 | |
155 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
155 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', '_MI_ALTSYS_MENU_MYBLOCKSADMIN'); |
|
156 | 156 | |
157 | - $breadcrumbsObj->appendPath(XOOPS_URL . '/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname=' . $this->target_dirname, '_MI_ALTSYS_MENU_CUSTOMBLOCKS'); |
|
157 | + $breadcrumbsObj->appendPath(XOOPS_URL.'/modules/altsys/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, '_MI_ALTSYS_MENU_CUSTOMBLOCKS'); |
|
158 | 158 | } |
159 | 159 | } else { |
160 | 160 | // myblocksadmin as a library |
161 | 161 | |
162 | 162 | $this->target_mid = $xoopsModule->getVar('mid'); |
163 | 163 | |
164 | - $this->target_mname = $xoopsModule->getVar('name') . ' ' . sprintf('(%2.2f)', $xoopsModule->getVar('version') / 100.0); |
|
164 | + $this->target_mname = $xoopsModule->getVar('name').' '.sprintf('(%2.2f)', $xoopsModule->getVar('version') / 100.0); |
|
165 | 165 | |
166 | 166 | $this->target_dirname = $xoopsModule->getVar('dirname'); |
167 | 167 | |
168 | - $mod_url = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname'); |
|
168 | + $mod_url = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname'); |
|
169 | 169 | |
170 | 170 | $modinfo = $xoopsModule->getInfo(); |
171 | 171 | |
172 | 172 | $breadcrumbsObj = AltsysBreadcrumbs::getInstance(); |
173 | 173 | |
174 | - $breadcrumbsObj->appendPath($mod_url . '/' . @$modinfo['adminindex'], $this->target_mname); |
|
174 | + $breadcrumbsObj->appendPath($mod_url.'/'.@$modinfo['adminindex'], $this->target_mname); |
|
175 | 175 | |
176 | - $breadcrumbsObj->appendPath($mod_url . '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', _MD_A_MYBLOCKSADMIN_BLOCKADMIN); |
|
176 | + $breadcrumbsObj->appendPath($mod_url.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin', _MD_A_MYBLOCKSADMIN_BLOCKADMIN); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | // read xoops_version.php of the target |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public function renderCell4BlockOptions($block_data) |
258 | 258 | { |
259 | - $bid = (int) $block_data['bid']; |
|
259 | + $bid = (int)$block_data['bid']; |
|
260 | 260 | |
261 | 261 | //HACK by domifara |
262 | 262 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function renderCell4BlockModuleLink($block_data) |
285 | 285 | { |
286 | - $bid = (int) $block_data['bid']; |
|
286 | + $bid = (int)$block_data['bid']; |
|
287 | 287 | |
288 | 288 | // get selected targets |
289 | 289 | |
@@ -294,12 +294,12 @@ discard block |
||
294 | 294 | } else { |
295 | 295 | // originated from the table of `block_module_link` |
296 | 296 | |
297 | - $result = $this->db->query('SELECT module_id FROM ' . $this->db->prefix('block_module_link') . " WHERE block_id='$bid'"); |
|
297 | + $result = $this->db->query('SELECT module_id FROM '.$this->db->prefix('block_module_link')." WHERE block_id='$bid'"); |
|
298 | 298 | |
299 | 299 | $selected_mids = []; |
300 | 300 | |
301 | 301 | while ([$selected_mid] = $this->db->fetchRow($result)) { |
302 | - $selected_mids[] = (int) $selected_mid; |
|
302 | + $selected_mids[] = (int)$selected_mid; |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | if (empty($selected_mids)) { |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function renderCell4BlockReadGroupPerm($block_data) |
353 | 353 | { |
354 | - $bid = (int) $block_data['bid']; |
|
354 | + $bid = (int)$block_data['bid']; |
|
355 | 355 | |
356 | 356 | // get selected targets |
357 | 357 | |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | } else { |
363 | 363 | // origined from the table of `group_perm` |
364 | 364 | |
365 | - $result = $this->db->query('SELECT gperm_groupid FROM ' . $this->db->prefix('group_permission') . " WHERE gperm_itemid='$bid' AND gperm_name='block_read'"); |
|
365 | + $result = $this->db->query('SELECT gperm_groupid FROM '.$this->db->prefix('group_permission')." WHERE gperm_itemid='$bid' AND gperm_name='block_read'"); |
|
366 | 366 | |
367 | 367 | $selected_gids = []; |
368 | 368 | |
369 | 369 | while ([$selected_gid] = $this->db->fetchRow($result)) { |
370 | - $selected_gids[] = (int) $selected_gid; |
|
370 | + $selected_gids[] = (int)$selected_gid; |
|
371 | 371 | } |
372 | 372 | |
373 | 373 | if (0 == $bid && empty($selected_gids)) { |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function renderCell4BlockPosition($block_data) |
417 | 417 | { |
418 | - $bid = (int) $block_data['bid']; |
|
418 | + $bid = (int)$block_data['bid']; |
|
419 | 419 | |
420 | - $side = (int) $block_data['side']; |
|
420 | + $side = (int)$block_data['side']; |
|
421 | 421 | |
422 | - $visible = (int) $block_data['visible']; |
|
422 | + $visible = (int)$block_data['visible']; |
|
423 | 423 | |
424 | 424 | $sseln = $ssel0 = $ssel1 = $ssel2 = $ssel3 = $ssel4 = ''; |
425 | 425 | |
@@ -464,31 +464,31 @@ discard block |
||
464 | 464 | |
465 | 465 | return " |
466 | 466 | <div class='blockposition $scol0'> |
467 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_SIDEBLOCK_LEFT . "' class='blockposition' $ssel0 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_SIDEBLOCK_LEFT . ";'> |
|
467 | + <input type='radio' name='sides[$bid]' value='".XOOPS_SIDEBLOCK_LEFT."' class='blockposition' $ssel0 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_SIDEBLOCK_LEFT.";'> |
|
468 | 468 | </div> |
469 | - <div style='float:" . _GLOBAL_LEFT . ";'>-</div> |
|
469 | + <div style='float:" . _GLOBAL_LEFT.";'>-</div> |
|
470 | 470 | <div class='blockposition $scol2'> |
471 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_LEFT . "' class='blockposition' $ssel2 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_LEFT . ";'> |
|
471 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_LEFT."' class='blockposition' $ssel2 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_LEFT.";'> |
|
472 | 472 | </div> |
473 | 473 | <div class='blockposition $scol3'> |
474 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_CENTER . "' class='blockposition' $ssel3 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_CENTER . ";'> |
|
474 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_CENTER."' class='blockposition' $ssel3 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_CENTER.";'> |
|
475 | 475 | </div> |
476 | 476 | <div class='blockposition $scol4'> |
477 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_RIGHT . "' class='blockposition' $ssel4 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_RIGHT . ";'> |
|
477 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_RIGHT."' class='blockposition' $ssel4 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_RIGHT.";'> |
|
478 | 478 | </div> |
479 | - <div style='float:" . _GLOBAL_LEFT . ";'>-</div> |
|
479 | + <div style='float:" . _GLOBAL_LEFT.";'>-</div> |
|
480 | 480 | <div class='blockposition $scol1'> |
481 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_SIDEBLOCK_RIGHT . "' class='blockposition' $ssel1 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_SIDEBLOCK_RIGHT . ";'> |
|
481 | + <input type='radio' name='sides[$bid]' value='".XOOPS_SIDEBLOCK_RIGHT."' class='blockposition' $ssel1 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_SIDEBLOCK_RIGHT.";'> |
|
482 | 482 | </div> |
483 | 483 | <br> |
484 | 484 | <br> |
485 | - <div style='float:" . _GLOBAL_LEFT . ";width:50px;' class='$stextbox'> |
|
486 | - <input type='text' name='extra_sides[$bid]' value='" . $value4extra_side . "' style='width:20px;' id='extra_side_$bid'> |
|
485 | + <div style='float:" . _GLOBAL_LEFT.";width:50px;' class='$stextbox'> |
|
486 | + <input type='text' name='extra_sides[$bid]' value='".$value4extra_side."' style='width:20px;' id='extra_side_$bid'> |
|
487 | 487 | </div> |
488 | 488 | <div class='blockposition $scoln'> |
489 | 489 | <input type='radio' name='sides[$bid]' value='-1' class='blockposition' $sseln onclick='document.getElementById(\"extra_side_$bid\").value=-1;'> |
490 | 490 | </div> |
491 | - <div style='float:" . _GLOBAL_LEFT . ";'>" . _NONE . '</div> |
|
491 | + <div style='float:"._GLOBAL_LEFT.";'>"._NONE.'</div> |
|
492 | 492 | '; |
493 | 493 | } |
494 | 494 | |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | |
501 | 501 | // main query |
502 | 502 | |
503 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newblocks') . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
503 | + $sql = 'SELECT * FROM '.$this->db->prefix('newblocks')." WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
504 | 504 | |
505 | 505 | $result = $this->db->query($sql); |
506 | 506 | |
@@ -536,13 +536,13 @@ discard block |
||
536 | 536 | |
537 | 537 | foreach ($block_arr as $i => $block) { |
538 | 538 | $block_data = [ |
539 | - 'bid' => (int) $block->getVar('bid'), |
|
539 | + 'bid' => (int)$block->getVar('bid'), |
|
540 | 540 | 'name' => $block->getVar('name', 'n'), |
541 | 541 | 'title' => $block->getVar('title', 'n'), |
542 | - 'weight' => (int) $block->getVar('weight'), |
|
543 | - 'bcachetime' => (int) $block->getVar('bcachetime'), |
|
544 | - 'side' => (int) $block->getVar('side'), |
|
545 | - 'visible' => (int) $block->getVar('visible'), |
|
542 | + 'weight' => (int)$block->getVar('weight'), |
|
543 | + 'bcachetime' => (int)$block->getVar('bcachetime'), |
|
544 | + 'side' => (int)$block->getVar('side'), |
|
545 | + 'visible' => (int)$block->getVar('visible'), |
|
546 | 546 | 'can_edit' => $this->canEdit($block), |
547 | 547 | 'can_delete' => $this->canDelete($block), |
548 | 548 | 'can_clone' => $this->canClone($block), |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | |
560 | 560 | // display |
561 | 561 | |
562 | - require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
|
562 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
563 | 563 | |
564 | 564 | $tpl = new D3Tpl(); |
565 | 565 | |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | return []; |
586 | 586 | } |
587 | 587 | |
588 | - require XOOPS_ROOT_PATH . '/modules/' . $this->target_dirname . '/xoops_version.php'; |
|
588 | + require XOOPS_ROOT_PATH.'/modules/'.$this->target_dirname.'/xoops_version.php'; |
|
589 | 589 | |
590 | 590 | if (empty($modversion['blocks'])) { |
591 | 591 | return []; |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | { |
599 | 599 | // query for getting blocks |
600 | 600 | |
601 | - $sql = 'SELECT * FROM ' . $this->db->prefix('newblocks') . " WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
601 | + $sql = 'SELECT * FROM '.$this->db->prefix('newblocks')." WHERE mid='$this->target_mid' ORDER BY visible DESC,side,weight"; |
|
602 | 602 | |
603 | 603 | $result = $this->db->query($sql); |
604 | 604 | |
@@ -635,9 +635,9 @@ discard block |
||
635 | 635 | // skip system (TODO) |
636 | 636 | |
637 | 637 | if ($this->target_mid > 1) { |
638 | - $form->addAppendix('module_admin', $this->target_mid, $this->target_mname . ' ' . _MD_A_MYBLOCKSADMIN_PERM_MADMIN); |
|
638 | + $form->addAppendix('module_admin', $this->target_mid, $this->target_mname.' '._MD_A_MYBLOCKSADMIN_PERM_MADMIN); |
|
639 | 639 | |
640 | - $form->addAppendix('module_read', $this->target_mid, $this->target_mname . ' ' . _MD_A_MYBLOCKSADMIN_PERM_MREAD); |
|
640 | + $form->addAppendix('module_read', $this->target_mid, $this->target_mname.' '._MD_A_MYBLOCKSADMIN_PERM_MREAD); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | foreach ($item_list as $item_id => $item_name) { |
@@ -708,25 +708,25 @@ discard block |
||
708 | 708 | $msg = _MD_A_MYBLOCKSADMIN_DBUPDATED; |
709 | 709 | |
710 | 710 | if (false !== $block->store()) { |
711 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
711 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
712 | 712 | |
713 | 713 | $xoopsTpl = new \XoopsTpl(); |
714 | 714 | |
715 | 715 | $xoopsTpl->xoops_setCaching(2); |
716 | 716 | |
717 | 717 | if ('' != $block->getVar('template')) { |
718 | - if ($xoopsTpl->isCached('db:' . $block->getVar('template'))) { |
|
719 | - if (!$xoopsTpl->clearCache('db:' . $block->getVar('template'))) { |
|
720 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
718 | + if ($xoopsTpl->isCached('db:'.$block->getVar('template'))) { |
|
719 | + if (!$xoopsTpl->clearCache('db:'.$block->getVar('template'))) { |
|
720 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
721 | 721 | } |
722 | 722 | } |
723 | - } elseif ($xoopsTpl->isCached('db:system_dummy.tpl', 'blk_' . $bid)) { |
|
724 | - if (!$xoopsTpl->clearCache('db:system_dummy.tpl', 'blk_' . $bid)) { |
|
725 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
723 | + } elseif ($xoopsTpl->isCached('db:system_dummy.tpl', 'blk_'.$bid)) { |
|
724 | + if (!$xoopsTpl->clearCache('db:system_dummy.tpl', 'blk_'.$bid)) { |
|
725 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
726 | 726 | } |
727 | 727 | } |
728 | 728 | } else { |
729 | - $msg = 'Failed update of block. ID:' . $bid; |
|
729 | + $msg = 'Failed update of block. ID:'.$bid; |
|
730 | 730 | } |
731 | 731 | |
732 | 732 | return $msg; |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | */ |
741 | 741 | public function updateBlockModuleLink($bid, $bmodules): void |
742 | 742 | { |
743 | - $bid = (int) $bid; |
|
743 | + $bid = (int)$bid; |
|
744 | 744 | |
745 | 745 | $table = $this->db->prefix('block_module_link'); |
746 | 746 | |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | $this->db->query($sql); |
750 | 750 | |
751 | 751 | foreach ($bmodules as $mid) { |
752 | - $mid = (int) $mid; |
|
752 | + $mid = (int)$mid; |
|
753 | 753 | |
754 | 754 | $sql = "INSERT INTO `$table` (`block_id`,`module_id`) VALUES ($bid,$mid)"; |
755 | 755 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | */ |
766 | 766 | public function updateBlockReadGroupPerm($bid, $req_gids): void |
767 | 767 | { |
768 | - $bid = (int) $bid; |
|
768 | + $bid = (int)$bid; |
|
769 | 769 | |
770 | 770 | $table = $this->db->prefix('group_permission'); |
771 | 771 | |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $this->db->query($sql); |
801 | 801 | |
802 | 802 | foreach ($req_gids as $gid) { |
803 | - $gid = (int) $gid; |
|
803 | + $gid = (int)$gid; |
|
804 | 804 | |
805 | 805 | $sql = "INSERT INTO `$table` (`gperm_groupid`,`gperm_itemid`,`gperm_modid`,`gperm_name`) VALUES ($gid,$bid,1,'block_read')"; |
806 | 806 | |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | */ |
841 | 841 | public function fetchRequest4Block($bid) |
842 | 842 | { |
843 | - $bid = (int) $bid; |
|
843 | + $bid = (int)$bid; |
|
844 | 844 | |
845 | 845 | (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
846 | 846 | |
@@ -858,13 +858,13 @@ discard block |
||
858 | 858 | |
859 | 859 | return [ |
860 | 860 | 'bid' => $bid, |
861 | - 'side' => (int) (@$_POST['sides'][$bid]), |
|
862 | - 'weight' => (int) (@$_POST['weights'][$bid]), |
|
861 | + 'side' => (int)(@$_POST['sides'][$bid]), |
|
862 | + 'weight' => (int)(@$_POST['weights'][$bid]), |
|
863 | 863 | 'visible' => $visible, |
864 | 864 | 'title' => (@$_POST['titles'][$bid]), |
865 | 865 | 'content' => (@$_POST['contents'][$bid]), |
866 | 866 | 'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]), |
867 | - 'bcachetime' => (int) (@$_POST['bcachetimes'][$bid]), |
|
867 | + 'bcachetime' => (int)(@$_POST['bcachetimes'][$bid]), |
|
868 | 868 | 'bmodule' => \is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : [0], |
869 | 869 | 'bgroup' => \is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : [], |
870 | 870 | 'options' => \is_array(@$_POST['options'][$bid]) ? $_POST['options'][$bid] : [], |
@@ -877,7 +877,7 @@ discard block |
||
877 | 877 | */ |
878 | 878 | public function do_delete($bid) |
879 | 879 | { |
880 | - $bid = (int) $bid; |
|
880 | + $bid = (int)$bid; |
|
881 | 881 | |
882 | 882 | //HACK by domifara |
883 | 883 | |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | */ |
914 | 914 | public function do_deleteBlockReadGroupPerm($bid): void |
915 | 915 | { |
916 | - $bid = (int) $bid; |
|
916 | + $bid = (int)$bid; |
|
917 | 917 | |
918 | 918 | $table = $this->db->prefix('group_permission'); |
919 | 919 | |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | */ |
928 | 928 | public function form_delete($bid): void |
929 | 929 | { |
930 | - $bid = (int) $bid; |
|
930 | + $bid = (int)$bid; |
|
931 | 931 | |
932 | 932 | //HACK by domifara |
933 | 933 | |
@@ -966,7 +966,7 @@ discard block |
||
966 | 966 | */ |
967 | 967 | public function do_clone($bid) |
968 | 968 | { |
969 | - $bid = (int) $bid; |
|
969 | + $bid = (int)$bid; |
|
970 | 970 | |
971 | 971 | $request = $this->fetchRequest4Block($bid); |
972 | 972 | |
@@ -1056,7 +1056,7 @@ discard block |
||
1056 | 1056 | do { |
1057 | 1057 | $func_num--; |
1058 | 1058 | |
1059 | - [$count] = $this->db->fetchRow($this->db->query('SELECT COUNT(*) FROM ' . $this->db->prefix('newblocks') . ' WHERE mid=' . (int) $mid . ' AND func_num=' . $func_num)); |
|
1059 | + [$count] = $this->db->fetchRow($this->db->query('SELECT COUNT(*) FROM '.$this->db->prefix('newblocks').' WHERE mid='.(int)$mid.' AND func_num='.$func_num)); |
|
1060 | 1060 | } while ($count > 0); |
1061 | 1061 | |
1062 | 1062 | return $func_num > 128 ? $func_num : 255; |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | */ |
1069 | 1069 | public function do_edit($bid) |
1070 | 1070 | { |
1071 | - $bid = (int) $bid; |
|
1071 | + $bid = (int)$bid; |
|
1072 | 1072 | |
1073 | 1073 | if ($bid <= 0) { |
1074 | 1074 | // new custom block |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | // permission copy |
1099 | 1099 | |
1100 | 1100 | foreach ($GLOBALS['xoopsUser']->getGroups() as $gid) { |
1101 | - $sql = 'INSERT INTO ' . $this->db->prefix('group_permission') . " (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ($gid, $bid, 1, 'block_read')"; |
|
1101 | + $sql = 'INSERT INTO '.$this->db->prefix('group_permission')." (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ($gid, $bid, 1, 'block_read')"; |
|
1102 | 1102 | |
1103 | 1103 | $this->db->query($sql); |
1104 | 1104 | } |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | */ |
1128 | 1128 | public function form_edit($bid, $mode = 'edit'): void |
1129 | 1129 | { |
1130 | - $bid = (int) $bid; |
|
1130 | + $bid = (int)$bid; |
|
1131 | 1131 | |
1132 | 1132 | //HACK by domifara |
1133 | 1133 | |
@@ -1209,10 +1209,10 @@ discard block |
||
1209 | 1209 | 'bid' => $bid, |
1210 | 1210 | 'name' => $block->getVar('name', 'n'), |
1211 | 1211 | 'title' => $block->getVar('title', 'n'), |
1212 | - 'weight' => (int) $block->getVar('weight'), |
|
1213 | - 'bcachetime' => (int) $block->getVar('bcachetime'), |
|
1214 | - 'side' => (int) $block->getVar('side'), |
|
1215 | - 'visible' => (int) $block->getVar('visible'), |
|
1212 | + 'weight' => (int)$block->getVar('weight'), |
|
1213 | + 'bcachetime' => (int)$block->getVar('bcachetime'), |
|
1214 | + 'side' => (int)$block->getVar('side'), |
|
1215 | + 'visible' => (int)$block->getVar('visible'), |
|
1216 | 1216 | 'template' => $block_template, |
1217 | 1217 | 'template_tplset' => $block_template_tplset, |
1218 | 1218 | 'options' => $block->getVar('options'), |
@@ -1235,7 +1235,7 @@ discard block |
||
1235 | 1235 | |
1236 | 1236 | // display |
1237 | 1237 | |
1238 | - require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
|
1238 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
1239 | 1239 | |
1240 | 1240 | $tpl = new D3Tpl(); |
1241 | 1241 | |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | if (defined('XOOPS_CUBE_LEGACY')) { |
1245 | 1245 | $tpl->assign('xoops_cube_legacy', true); |
1246 | 1246 | |
1247 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
1247 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
1248 | 1248 | } else { |
1249 | 1249 | $tpl->assign('xoops_cube_legacy', false); |
1250 | 1250 | } |
@@ -1275,7 +1275,7 @@ discard block |
||
1275 | 1275 | */ |
1276 | 1276 | public function checkFck() |
1277 | 1277 | { |
1278 | - return file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'); |
|
1278 | + return file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'); |
|
1279 | 1279 | } |
1280 | 1280 | |
1281 | 1281 | /** |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | */ |
1285 | 1285 | public function previewContent($block_data) |
1286 | 1286 | { |
1287 | - $bid = (int) $block_data['bid']; |
|
1287 | + $bid = (int)$block_data['bid']; |
|
1288 | 1288 | |
1289 | 1289 | if (!$block_data['is_custom']) { |
1290 | 1290 | return ''; |
@@ -1346,12 +1346,12 @@ discard block |
||
1346 | 1346 | // Ticket Check |
1347 | 1347 | |
1348 | 1348 | if (!$GLOBALS['xoopsSecurity']->check(true, 'myblocksadmin')) { |
1349 | - redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsSecurity']->getErrors()); |
|
1349 | + redirect_header(XOOPS_URL.'/', 3, $GLOBALS['xoopsSecurity']->getErrors()); |
|
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | $msg = ''; |
1353 | 1353 | |
1354 | - $bid = (int) (@$_GET['bid']); |
|
1354 | + $bid = (int)(@$_GET['bid']); |
|
1355 | 1355 | |
1356 | 1356 | if (!empty($_POST['preview'])) { |
1357 | 1357 | // preview |
@@ -1380,19 +1380,19 @@ discard block |
||
1380 | 1380 | } elseif (!empty($_POST['submit'])) { |
1381 | 1381 | // update module_admin,module_read,block_read |
1382 | 1382 | |
1383 | - include dirname(__DIR__) . '/include/mygroupperm.php'; |
|
1383 | + include dirname(__DIR__).'/include/mygroupperm.php'; |
|
1384 | 1384 | |
1385 | 1385 | $msg = _MD_A_MYBLOCKSADMIN_PERMUPDATED; |
1386 | 1386 | } |
1387 | 1387 | |
1388 | - redirect_header('?mode=admin&lib=altsys&page=myblocksadmin&dirname=' . $this->target_dirname, 1, $msg); |
|
1388 | + redirect_header('?mode=admin&lib=altsys&page=myblocksadmin&dirname='.$this->target_dirname, 1, $msg); |
|
1389 | 1389 | |
1390 | 1390 | exit; |
1391 | 1391 | } |
1392 | 1392 | |
1393 | 1393 | public function processGet(): void |
1394 | 1394 | { |
1395 | - $bid = (int) (@$_GET['bid']); |
|
1395 | + $bid = (int)(@$_GET['bid']); |
|
1396 | 1396 | |
1397 | 1397 | switch (@$_GET['op']) { |
1398 | 1398 | case 'clone': |
@@ -5,12 +5,12 @@ discard block |
||
5 | 5 | } |
6 | 6 | |
7 | 7 | if (!defined('XOOPS_TRUST_PATH') || XOOPS_TRUST_PATH == '') { |
8 | - header('Location: ' . XOOPS_URL . '/modules/altsys/setup_xoops_trust_path.php'); |
|
8 | + header('Location: '.XOOPS_URL.'/modules/altsys/setup_xoops_trust_path.php'); |
|
9 | 9 | |
10 | 10 | exit; |
11 | 11 | } |
12 | 12 | |
13 | -define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH . '/my_language'); |
|
13 | +define('ALTSYS_MYLANGUAGE_ROOT_PATH', XOOPS_ROOT_PATH.'/my_language'); |
|
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Class SetupAltsysLangMgr |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | -require_once XOOPS_ROOT_PATH . '/core/XCube_LanguageManager.class.php'; |
|
36 | -require_once XOOPS_ROOT_PATH . '/modules/legacy/kernel/Legacy_LanguageManager.class.php'; |
|
35 | +require_once XOOPS_ROOT_PATH.'/core/XCube_LanguageManager.class.php'; |
|
36 | +require_once XOOPS_ROOT_PATH.'/modules/legacy/kernel/Legacy_LanguageManager.class.php'; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Class AltsysLangMgr_LanguageManager |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function prepare(): void |
48 | 48 | { |
49 | - $langmanpath = XOOPS_TRUST_PATH . '/libs/altsys/class/D3LanguageManager.class.php'; |
|
49 | + $langmanpath = XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php'; |
|
50 | 50 | |
51 | 51 | if (!is_file($langmanpath)) { |
52 | 52 | die('install the latest altsys'); |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | $root = XCube_Root::getSingleton(); |
74 | 74 | |
75 | 75 | if (!empty($root->mContext->mXoopsConfig['theme_set'])) { |
76 | - $langdir = XOOPS_THEME_PATH . '/' . $root->mContext->mXoopsConfig['theme_set'] . '/language'; |
|
76 | + $langdir = XOOPS_THEME_PATH.'/'.$root->mContext->mXoopsConfig['theme_set'].'/language'; |
|
77 | 77 | |
78 | 78 | if (file_exists($langdir)) { |
79 | - $langfile = $langdir . '/' . $this->mLanguageName . '.php'; |
|
79 | + $langfile = $langdir.'/'.$this->mLanguageName.'.php'; |
|
80 | 80 | |
81 | - $engfile = $langdir . '/english.php'; |
|
81 | + $engfile = $langdir.'/english.php'; |
|
82 | 82 | |
83 | 83 | if (is_file($langfile)) { |
84 | 84 | require_once $langfile; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | // read normal |
95 | 95 | |
96 | - $this->langman->read($fileBodyName . '.php', $dirname); |
|
96 | + $this->langman->read($fileBodyName.'.php', $dirname); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | // I dare not to use langman... |
105 | 105 | |
106 | 106 | if (false === mb_strpos($type, '.') && $this->langman->my_language) { |
107 | - $mylang_file = $this->langman->my_language . '/' . $this->mLanguageName . '/' . $type . '.php'; |
|
107 | + $mylang_file = $this->langman->my_language.'/'.$this->mLanguageName.'/'.$type.'.php'; |
|
108 | 108 | |
109 | 109 | if (is_file($mylang_file)) { |
110 | 110 | require_once $mylang_file; |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
4 | -require_once XOOPS_TRUST_PATH . '/libs/altsys/include/altsys_functions.php'; |
|
3 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
4 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php'; |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * Class D3Tpl |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | parent::__construct(); |
21 | 21 | |
22 | 22 | if (in_array(altsys_get_core_type(), [ALTSYS_CORE_TYPE_X20S, ALTSYS_CORE_TYPE_X23P], true)) { |
23 | - array_unshift($this->plugins_dir, XOOPS_TRUST_PATH . '/libs/altsys/smarty_plugins'); |
|
23 | + array_unshift($this->plugins_dir, XOOPS_TRUST_PATH.'/libs/altsys/smarty_plugins'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | // for RTL users |