@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | { |
30 | 30 | $this->language = preg_replace('/[^0-9a-zA-Z_-]/', '', @$GLOBALS['xoopsConfig']['language']); |
31 | 31 | |
32 | - $this->salt = mb_substr(md5(XOOPS_ROOT_PATH . XOOPS_DB_USER . XOOPS_DB_PREFIX), 0, 6); |
|
32 | + $this->salt = mb_substr(md5(XOOPS_ROOT_PATH.XOOPS_DB_USER.XOOPS_DB_PREFIX), 0, 6); |
|
33 | 33 | |
34 | 34 | // $this->cache_path = XOOPS_TRUST_PATH . '/cache'; |
35 | 35 | |
36 | - if (\defined('XOOPS_TRUST_PATH') and \file_exists(XOOPS_TRUST_PATH . '/cache')) { |
|
37 | - $this->cache_path = XOOPS_TRUST_PATH . '/cache'; |
|
36 | + if (\defined('XOOPS_TRUST_PATH') and \file_exists(XOOPS_TRUST_PATH.'/cache')) { |
|
37 | + $this->cache_path = XOOPS_TRUST_PATH.'/cache'; |
|
38 | 38 | } else { |
39 | 39 | // $this->cache_path = XOOPS_ROOT_PATH . '/cache'; |
40 | - $this->cache_path = XOOPS_VAR_PATH . '/caches/xoops_cache'; |
|
40 | + $this->cache_path = XOOPS_VAR_PATH.'/caches/xoops_cache'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function read($resource, $mydirname, $mytrustdirname = null, bool $read_once = true): void |
75 | 75 | { |
76 | - $d3file = XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/mytrustdirname.php'; |
|
76 | + $d3file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/mytrustdirname.php'; |
|
77 | 77 | |
78 | 78 | if (empty($mytrustdirname) && is_file($d3file)) { |
79 | 79 | require $d3file; |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | |
86 | 86 | $cache_file = $this->getCacheFileName($resource, $mydirname); |
87 | 87 | |
88 | - $root_file = XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/language/' . $this->language . '/' . $resource; |
|
88 | + $root_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->language.'/'.$resource; |
|
89 | 89 | |
90 | 90 | // language overriding by XOOPS_ROOT_PATH/my_language |
91 | 91 | |
92 | 92 | if ($this->my_language) { |
93 | - $mylang_file = $this->my_language . '/modules/' . $mydirname . '/' . $this->language . '/' . $resource; |
|
93 | + $mylang_file = $this->my_language.'/modules/'.$mydirname.'/'.$this->language.'/'.$resource; |
|
94 | 94 | |
95 | 95 | if (is_file($mylang_file)) { |
96 | 96 | require_once $mylang_file; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | if (empty($mytrustdirname)) { |
105 | 105 | // conventional module |
106 | 106 | |
107 | - $default_file = XOOPS_ROOT_PATH . '/modules/' . $mydirname . '/language/' . $this->default_language . '/' . $resource; |
|
107 | + $default_file = XOOPS_ROOT_PATH.'/modules/'.$mydirname.'/language/'.$this->default_language.'/'.$resource; |
|
108 | 108 | |
109 | 109 | if (is_file($cache_file)) { |
110 | 110 | require_once $cache_file; |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | } else { |
119 | 119 | // D3 modules |
120 | 120 | |
121 | - $trust_file = XOOPS_TRUST_PATH . '/modules/' . $mytrustdirname . '/language/' . $this->language . '/' . $resource; |
|
121 | + $trust_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->language.'/'.$resource; |
|
122 | 122 | |
123 | - $default_file = XOOPS_TRUST_PATH . '/modules/' . $mytrustdirname . '/language/' . $this->default_language . '/' . $resource; |
|
123 | + $default_file = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname.'/language/'.$this->default_language.'/'.$resource; |
|
124 | 124 | |
125 | 125 | if (is_file($cache_file)) { |
126 | 126 | require_once $cache_file; |
@@ -160,6 +160,6 @@ discard block |
||
160 | 160 | $language = $this->language; |
161 | 161 | } |
162 | 162 | |
163 | - return $this->cache_path . '/' . $this->cache_prefix . '_' . $this->salt . '_' . $mydirname . '_' . $language . '_' . $resource; |
|
163 | + return $this->cache_path.'/'.$this->cache_prefix.'_'.$this->salt.'_'.$mydirname.'_'.$language.'_'.$resource; |
|
164 | 164 | } |
165 | 165 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once __DIR__ . '/MyBlocksAdmin.class.php'; |
|
3 | +require_once __DIR__.'/MyBlocksAdmin.class.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Class MyBlocksAdminForX25 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | parent::construct(); |
17 | 17 | |
18 | - @require_once XOOPS_ROOT_PATH . '/modules/system/language/' . $this->lang . '/admin/blocksadmin.php'; |
|
18 | + @require_once XOOPS_ROOT_PATH.'/modules/system/language/'.$this->lang.'/admin/blocksadmin.php'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | //HACK by domifara for php5.3+ |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function renderCell4BlockPosition($block_data) |
50 | 50 | { |
51 | - $bid = (int) $block_data['bid']; |
|
51 | + $bid = (int)$block_data['bid']; |
|
52 | 52 | |
53 | - $side = (int) $block_data['side']; |
|
53 | + $side = (int)$block_data['side']; |
|
54 | 54 | |
55 | - $visible = (int) $block_data['visible']; |
|
55 | + $visible = (int)$block_data['visible']; |
|
56 | 56 | |
57 | 57 | $sseln = $ssel0 = $ssel1 = $ssel3 = $ssel4 = $ssel5 = $ssel7 = $ssel8 = $ssel9 = ''; |
58 | 58 | |
@@ -112,59 +112,59 @@ discard block |
||
112 | 112 | <tr> |
113 | 113 | <td rowspan='2'> |
114 | 114 | <div class='blockposition $scol0'> |
115 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_SIDEBLOCK_LEFT . "' class='blockposition' $ssel0 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_SIDEBLOCK_LEFT . ";'> |
|
115 | + <input type='radio' name='sides[$bid]' value='".XOOPS_SIDEBLOCK_LEFT."' class='blockposition' $ssel0 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_SIDEBLOCK_LEFT.";'> |
|
116 | 116 | </div> |
117 | - <div style='float:" . _GLOBAL_LEFT . ";'>-</div> |
|
117 | + <div style='float:" . _GLOBAL_LEFT.";'>-</div> |
|
118 | 118 | </td> |
119 | 119 | <td> |
120 | 120 | <div class='blockposition $scol3'> |
121 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_LEFT . "' class='blockposition' $ssel3 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_LEFT . ";'> |
|
121 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_LEFT."' class='blockposition' $ssel3 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_LEFT.";'> |
|
122 | 122 | </div> |
123 | 123 | </td> |
124 | 124 | <td> |
125 | 125 | <div class='blockposition $scol5'> |
126 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_CENTER . "' class='blockposition' $ssel5 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_CENTER . ";'> |
|
126 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_CENTER."' class='blockposition' $ssel5 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_CENTER.";'> |
|
127 | 127 | </div> |
128 | 128 | </td> |
129 | 129 | <td> |
130 | 130 | <div class='blockposition $scol4'> |
131 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_RIGHT . "' class='blockposition' $ssel4 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_RIGHT . ";'> |
|
131 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_RIGHT."' class='blockposition' $ssel4 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_RIGHT.";'> |
|
132 | 132 | </div> |
133 | 133 | </td> |
134 | 134 | <td rowspan='2'> |
135 | - <div style='float:" . _GLOBAL_LEFT . ";'>-</div> |
|
135 | + <div style='float:" . _GLOBAL_LEFT.";'>-</div> |
|
136 | 136 | <div class='blockposition $scol1'> |
137 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_SIDEBLOCK_RIGHT . "' class='blockposition' $ssel1 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_SIDEBLOCK_RIGHT . ";'> |
|
137 | + <input type='radio' name='sides[$bid]' value='".XOOPS_SIDEBLOCK_RIGHT."' class='blockposition' $ssel1 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_SIDEBLOCK_RIGHT.";'> |
|
138 | 138 | </div> |
139 | 139 | </td> |
140 | 140 | </tr> |
141 | 141 | <tr> |
142 | 142 | <td> |
143 | 143 | <div class='blockposition $scol7'> |
144 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_BOTTOMLEFT . "' class='blockposition' $ssel7 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_BOTTOMLEFT . ";'> |
|
144 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_BOTTOMLEFT."' class='blockposition' $ssel7 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_BOTTOMLEFT.";'> |
|
145 | 145 | </div> |
146 | 146 | </td> |
147 | 147 | <td> |
148 | 148 | <div class='blockposition $scol9'> |
149 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_BOTTOM . "' class='blockposition' $ssel9 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_BOTTOM . ";'> |
|
149 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_BOTTOM."' class='blockposition' $ssel9 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_BOTTOM.";'> |
|
150 | 150 | </div> |
151 | 151 | </td> |
152 | 152 | <td> |
153 | 153 | <div class='blockposition $scol8'> |
154 | - <input type='radio' name='sides[$bid]' value='" . XOOPS_CENTERBLOCK_BOTTOMRIGHT . "' class='blockposition' $ssel8 onclick='document.getElementById(\"extra_side_$bid\").value=" . XOOPS_CENTERBLOCK_BOTTOMRIGHT . ";'> |
|
154 | + <input type='radio' name='sides[$bid]' value='".XOOPS_CENTERBLOCK_BOTTOMRIGHT."' class='blockposition' $ssel8 onclick='document.getElementById(\"extra_side_$bid\").value=".XOOPS_CENTERBLOCK_BOTTOMRIGHT.";'> |
|
155 | 155 | </div> |
156 | 156 | |
157 | 157 | </td> |
158 | 158 | </tr> |
159 | 159 | <tr> |
160 | 160 | <td colspan='5'> |
161 | - <div style='float:" . _GLOBAL_LEFT . ";width:50px;' class='$stextbox'> |
|
162 | - <input type='text' name='extra_sides[$bid]' value='" . $value4extra_side . "' style='width:20px;' id='extra_side_$bid'> |
|
161 | + <div style='float:" . _GLOBAL_LEFT.";width:50px;' class='$stextbox'> |
|
162 | + <input type='text' name='extra_sides[$bid]' value='".$value4extra_side."' style='width:20px;' id='extra_side_$bid'> |
|
163 | 163 | </div> |
164 | 164 | <div class='blockposition $scoln'> |
165 | 165 | <input type='radio' name='sides[$bid]' value='-1' class='blockposition' $sseln onclick='document.getElementById(\"extra_side_$bid\").value=-1;'> |
166 | 166 | </div> |
167 | - <div style='float:" . _GLOBAL_LEFT . ";'>" . _NONE . '</div> |
|
167 | + <div style='float:"._GLOBAL_LEFT.";'>"._NONE.'</div> |
|
168 | 168 | </td> |
169 | 169 | </tr> |
170 | 170 | </table> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function form_edit($bid, $mode = 'edit'): void |
179 | 179 | { |
180 | - $bid = (int) $bid; |
|
180 | + $bid = (int)$bid; |
|
181 | 181 | |
182 | 182 | //HACK by domifara |
183 | 183 | |
@@ -251,10 +251,10 @@ discard block |
||
251 | 251 | 'bid' => $bid, |
252 | 252 | 'name' => $block->getVar('name', 'n'), |
253 | 253 | 'title' => $block->getVar('title', 'n'), |
254 | - 'weight' => (int) $block->getVar('weight'), |
|
255 | - 'bcachetime' => (int) $block->getVar('bcachetime'), |
|
256 | - 'side' => (int) $block->getVar('side'), |
|
257 | - 'visible' => (int) $block->getVar('visible'), |
|
254 | + 'weight' => (int)$block->getVar('weight'), |
|
255 | + 'bcachetime' => (int)$block->getVar('bcachetime'), |
|
256 | + 'side' => (int)$block->getVar('side'), |
|
257 | + 'visible' => (int)$block->getVar('visible'), |
|
258 | 258 | 'template' => $block_template, |
259 | 259 | 'template_tplset' => $block_template_tplset, |
260 | 260 | 'options' => $block->getVar('options'), |
@@ -277,13 +277,13 @@ discard block |
||
277 | 277 | |
278 | 278 | // display |
279 | 279 | |
280 | - require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3Tpl.class.php'; |
|
280 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3Tpl.class.php'; |
|
281 | 281 | |
282 | 282 | $tpl = new D3Tpl(); |
283 | 283 | |
284 | 284 | //dhtml |
285 | 285 | |
286 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
286 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
287 | 287 | |
288 | 288 | if ('H' == $block_data['ctype'] || empty($block_data['ctype'])) { |
289 | 289 | $editor_configs = []; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | $rendered = $form->render(); |
314 | 314 | |
315 | - $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">' . str_replace(['<textarea', '</textarea><br>'], ['</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'], $rendered) . '</div>'; |
|
315 | + $rendered = '<div id="textarea_content_bbcode_buttons_pre" style="display:block;">'.str_replace(['<textarea', '</textarea><br>'], ['</div><textarea', '</textarea><div id="textarea_content_bbcode_buttons_post" style="display:block;">'], $rendered).'</div>'; |
|
316 | 316 | |
317 | 317 | $tpl->assign('altsys_x25_dhtmltextarea', $rendered); |
318 | 318 | } |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | 'op' => $next_op, |
328 | 328 | 'form_title' => $form_title, |
329 | 329 | 'submit_button' => $button_value, |
330 | - 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH . '/common/fckeditor/fckeditor.js'), |
|
330 | + 'common_fck_installed' => file_exists(XOOPS_ROOT_PATH.'/common/fckeditor/fckeditor.js'), |
|
331 | 331 | 'gticket_hidden' => $GLOBALS['xoopsSecurity']->getTokenHTML('myblocksadmin'), |
332 | 332 | ]); |
333 | 333 | |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public function fetchRequest4Block($bid) |
344 | 344 | { |
345 | - $bid = (int) $bid; |
|
345 | + $bid = (int)$bid; |
|
346 | 346 | |
347 | 347 | (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
348 | 348 | |
@@ -360,13 +360,13 @@ discard block |
||
360 | 360 | |
361 | 361 | return [ |
362 | 362 | 'bid' => $bid, |
363 | - 'side' => (int) (@$_POST['sides'][$bid]), |
|
364 | - 'weight' => (int) (@$_POST['weights'][$bid]), |
|
363 | + 'side' => (int)(@$_POST['sides'][$bid]), |
|
364 | + 'weight' => (int)(@$_POST['weights'][$bid]), |
|
365 | 365 | 'visible' => $visible, |
366 | 366 | 'title' => (@$_POST['titles'][$bid]), |
367 | 367 | 'content' => (@$_POST['textarea_content']), |
368 | 368 | 'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]), |
369 | - 'bcachetime' => (int) (@$_POST['bcachetimes'][$bid]), |
|
369 | + 'bcachetime' => (int)(@$_POST['bcachetimes'][$bid]), |
|
370 | 370 | 'bmodule' => \is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : [0], |
371 | 371 | 'bgroup' => \is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : [], |
372 | 372 | 'options' => \is_array(@$_POST['options'][$bid]) ? $_POST['options'][$bid] : [], |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | */ |
380 | 380 | public function previewContent($block_data) |
381 | 381 | { |
382 | - $bid = (int) $block_data['bid']; |
|
382 | + $bid = (int)$block_data['bid']; |
|
383 | 383 | |
384 | 384 | if (!$block_data['is_custom']) { |
385 | 385 | return ''; |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $c_type = $block_data['ctype']; |
413 | 413 | |
414 | 414 | if ('H' == $c_type) { |
415 | - $ret = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N')); |
|
415 | + $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N')); |
|
416 | 416 | } elseif ('P' == $c_type) { |
417 | 417 | ob_start(); |
418 | 418 | |
@@ -422,17 +422,17 @@ discard block |
||
422 | 422 | |
423 | 423 | ob_end_clean(); |
424 | 424 | |
425 | - $ret = str_replace('{X_SITEURL}', XOOPS_URL . '/', $content); |
|
425 | + $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $content); |
|
426 | 426 | } elseif ('S' == $c_type) { |
427 | 427 | (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
428 | 428 | |
429 | - $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N')); |
|
429 | + $content = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N')); |
|
430 | 430 | |
431 | 431 | $ret = $myts->displayTarea($content, 1, 1); |
432 | 432 | } else { |
433 | 433 | (method_exists('MyTextSanitizer', 'sGetInstance') and $myts = MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance(); |
434 | 434 | |
435 | - $content = str_replace('{X_SITEURL}', XOOPS_URL . '/', $block->getVar('content', 'N')); |
|
435 | + $content = str_replace('{X_SITEURL}', XOOPS_URL.'/', $block->getVar('content', 'N')); |
|
436 | 436 | |
437 | 437 | $ret = $myts->displayTarea($content, 1, 0); |
438 | 438 | } |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // notification handler for D3 modules |
4 | 4 | |
5 | -require_once XOOPS_ROOT_PATH . '/include/notification_functions.php'; |
|
5 | +require_once XOOPS_ROOT_PATH.'/include/notification_functions.php'; |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * Class D3NotificationHandler |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | { |
38 | 38 | global $xoopsConfig; |
39 | 39 | |
40 | - $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; |
|
40 | + $mydirpath = XOOPS_ROOT_PATH.'/modules/'.$mydirname; |
|
41 | 41 | |
42 | - $mytrustdirpath = XOOPS_TRUST_PATH . '/modules/' . $mytrustdirname; |
|
42 | + $mytrustdirpath = XOOPS_TRUST_PATH.'/modules/'.$mytrustdirname; |
|
43 | 43 | |
44 | 44 | $language = empty($xoopsConfig['language']) ? 'english' : $xoopsConfig['language']; |
45 | 45 | |
@@ -142,11 +142,11 @@ discard block |
||
142 | 142 | |
143 | 143 | $criteria = new \CriteriaCompo(); |
144 | 144 | |
145 | - $criteria->add(new \Criteria('not_modid', (int) $mid)); |
|
145 | + $criteria->add(new \Criteria('not_modid', (int)$mid)); |
|
146 | 146 | |
147 | 147 | $criteria->add(new \Criteria('not_category', $category)); |
148 | 148 | |
149 | - $criteria->add(new \Criteria('not_itemid', (int) $item_id)); |
|
149 | + $criteria->add(new \Criteria('not_itemid', (int)$item_id)); |
|
150 | 150 | |
151 | 151 | $criteria->add(new \Criteria('not_event', $event)); |
152 | 152 | |
@@ -174,13 +174,13 @@ discard block |
||
174 | 174 | |
175 | 175 | $tags['X_MODULE'] = $module->getVar('name', 'n'); |
176 | 176 | |
177 | - $tags['X_MODULE_URL'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/'; |
|
177 | + $tags['X_MODULE_URL'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/'; |
|
178 | 178 | |
179 | 179 | $tags['X_NOTIFY_CATEGORY'] = $category; |
180 | 180 | |
181 | 181 | $tags['X_NOTIFY_EVENT'] = $event; |
182 | 182 | |
183 | - $template = $event_info['mail_template'] . '.tpl'; |
|
183 | + $template = $event_info['mail_template'].'.tpl'; |
|
184 | 184 | |
185 | 185 | $subject = $event_info['mail_subject']; |
186 | 186 | |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | |
200 | 200 | // TODO: don't show unsubscribe link if it is 'one-time' ?? |
201 | 201 | |
202 | - $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL . '/notifications.php'; |
|
202 | + $tags['X_UNSUBSCRIBE_URL'] = XOOPS_URL.'/notifications.php'; |
|
203 | 203 | |
204 | 204 | $tags = array_merge($tags, $extra_tags); |
205 | 205 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $this->mydirname = $mydirname; |
38 | 38 | |
39 | - $this->table = $db->prefix($mydirname ? $mydirname . '_' . $table_body : $table_body); |
|
39 | + $this->table = $db->prefix($mydirname ? $mydirname.'_'.$table_body : $table_body); |
|
40 | 40 | |
41 | 41 | $this->primary_key = $primary_key; |
42 | 42 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $module = $moduleHandler->getByDirname($this->mydirname); |
48 | 48 | |
49 | 49 | if (!empty($module)) { |
50 | - $this->mid = (int) $module->getVar('mid'); |
|
50 | + $this->mid = (int)$module->getVar('mid'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $this->page_name = $page_name; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function get_language_constant($name) |
63 | 63 | { |
64 | - return constant(mb_strtoupper('_MD_A_' . $this->dirname . '_' . $this->page_name . '_' . $name)); |
|
64 | + return constant(mb_strtoupper('_MD_A_'.$this->dirname.'_'.$this->page_name.'_'.$name)); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -74,23 +74,23 @@ discard block |
||
74 | 74 | switch ($col['type']) { |
75 | 75 | case 'text': |
76 | 76 | case 'blob': |
77 | - $length = empty($col['length']) ? 65535 : (int) $col['length']; |
|
77 | + $length = empty($col['length']) ? 65535 : (int)$col['length']; |
|
78 | 78 | |
79 | - return "`{$col['name']}`='" . addslashes(xoops_substr($value, 0, $length)) . "'"; |
|
79 | + return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'"; |
|
80 | 80 | case 'char': |
81 | 81 | case 'varchar': |
82 | 82 | case 'string': |
83 | - $length = empty($col['length']) ? 255 : (int) $col['length']; |
|
83 | + $length = empty($col['length']) ? 255 : (int)$col['length']; |
|
84 | 84 | |
85 | - return "`{$col['name']}`='" . addslashes(xoops_substr($value, 0, $length)) . "'"; |
|
85 | + return "`{$col['name']}`='".addslashes(xoops_substr($value, 0, $length))."'"; |
|
86 | 86 | case 'int': |
87 | 87 | case 'integer': |
88 | - $value = (int) $value; |
|
88 | + $value = (int)$value; |
|
89 | 89 | if (!empty($col['max'])) { |
90 | - $value = min($value, (int) $col['max']); |
|
90 | + $value = min($value, (int)$col['max']); |
|
91 | 91 | } |
92 | 92 | if (!empty($col['min'])) { |
93 | - $value = max($value, (int) $col['min']); |
|
93 | + $value = max($value, (int)$col['min']); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | return "`{$col['name']}`=$value"; |
@@ -119,21 +119,21 @@ discard block |
||
119 | 119 | continue; |
120 | 120 | } |
121 | 121 | |
122 | - $set4sql .= $this->get_set4sql(@$_POST[$col['name']], $col) . ','; |
|
122 | + $set4sql .= $this->get_set4sql(@$_POST[$col['name']], $col).','; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | if (!empty($set4sql)) { |
126 | 126 | if ($id > 0) { |
127 | 127 | // UPDATE |
128 | 128 | |
129 | - $db->queryF("UPDATE $this->table SET " . mb_substr($set4sql, 0, -1) . " WHERE $this->primary_key='" . addslashes($id) . "'"); |
|
129 | + $db->queryF("UPDATE $this->table SET ".mb_substr($set4sql, 0, -1)." WHERE $this->primary_key='".addslashes($id)."'"); |
|
130 | 130 | |
131 | 131 | return [$id, 'update']; |
132 | 132 | } |
133 | 133 | |
134 | 134 | // INSERT |
135 | 135 | |
136 | - $db->queryF("INSERT INTO $this->table SET " . mb_substr($set4sql, 0, -1)); |
|
136 | + $db->queryF("INSERT INTO $this->table SET ".mb_substr($set4sql, 0, -1)); |
|
137 | 137 | |
138 | 138 | return [$db->getInsertId(), 'insert']; |
139 | 139 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $ret = []; |
166 | 166 | |
167 | 167 | foreach (array_keys($_POST[$column4key]) as $id) { |
168 | - $id = (int) $id; // primary_key should be 'integer' |
|
168 | + $id = (int)$id; // primary_key should be 'integer' |
|
169 | 169 | |
170 | 170 | $set4sql = ''; |
171 | 171 | |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | continue; |
179 | 179 | } |
180 | 180 | |
181 | - $set4sql .= $this->get_set4sql(@$_POST[$col['name']][$id], $col) . ','; |
|
181 | + $set4sql .= $this->get_set4sql(@$_POST[$col['name']][$id], $col).','; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | if (!empty($set4sql)) { |
185 | 185 | $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id"); |
186 | 186 | |
187 | 187 | if (1 == $db->getRowsNum($result)) { |
188 | - $db->queryF("UPDATE $this->table SET " . mb_substr($set4sql, 0, -1) . " WHERE $this->primary_key=$id"); |
|
188 | + $db->queryF("UPDATE $this->table SET ".mb_substr($set4sql, 0, -1)." WHERE $this->primary_key=$id"); |
|
189 | 189 | |
190 | 190 | if (1 == $db->getAffectedRows()) { |
191 | 191 | $ret[$id] = $db->fetchArray($result); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $ret = []; |
210 | 210 | |
211 | 211 | foreach (array_keys($_POST['admin_main_checkboxes']) as $id) { |
212 | - $id = (int) $id; // primary_key should be 'integer' |
|
212 | + $id = (int)$id; // primary_key should be 'integer' |
|
213 | 213 | |
214 | 214 | $result = $db->query("SELECT * FROM $this->table WHERE $this->primary_key=$id"); |
215 | 215 | |
@@ -221,13 +221,13 @@ discard block |
||
221 | 221 | if ($delete_comments) { |
222 | 222 | // remove comments |
223 | 223 | |
224 | - $db->queryF('DELETE FROM ' . $db->prefix('xoopscomments') . " WHERE com_modid=$this->mid AND com_itemid=$id"); |
|
224 | + $db->queryF('DELETE FROM '.$db->prefix('xoopscomments')." WHERE com_modid=$this->mid AND com_itemid=$id"); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | if ($delete_notifications) { |
228 | 228 | // remove notifications |
229 | 229 | |
230 | - $db->queryF('DELETE FROM ' . $db->prefix('xoopsnotifications') . " WHERE not_modid=$this->mid AND not_itemid=$id"); |
|
230 | + $db->queryF('DELETE FROM '.$db->prefix('xoopsnotifications')." WHERE not_modid=$this->mid AND not_itemid=$id"); |
|
231 | 231 | } |
232 | 232 | } |
233 | 233 | } |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | break; |
305 | 305 | case 'text': |
306 | 306 | default: |
307 | - $size = empty($col['edit_size']) ? 32 : (int) $col['edit_size']; |
|
308 | - $length = empty($col['length']) ? 255 : (int) $col['length']; |
|
309 | - $lines[$col['name']] = "<input type='text' name='{$col['name']}' size='$size' maxlength='$length' value='" . htmlspecialchars($col['default_value'], ENT_QUOTES | ENT_HTML5) . "'>"; |
|
307 | + $size = empty($col['edit_size']) ? 32 : (int)$col['edit_size']; |
|
308 | + $length = empty($col['length']) ? 255 : (int)$col['length']; |
|
309 | + $lines[$col['name']] = "<input type='text' name='{$col['name']}' size='$size' maxlength='$length' value='".htmlspecialchars($col['default_value'], ENT_QUOTES | ENT_HTML5)."'>"; |
|
310 | 310 | break; |
311 | 311 | case false: |
312 | 312 | $lines[$col['name']] = htmlspecialchars($col['default_value'], ENT_QUOTES | ENT_HTML5); |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | <form action='' method='get' name='admin_control' id='admin_control'> |
346 | 346 | $hiddens |
347 | 347 | $controllers_html |
348 | - <input type='submit' value='" . _SUBMIT . "'> |
|
348 | + <input type='submit' value='"._SUBMIT."'> |
|
349 | 349 | </form>\n"; |
350 | 350 | } |
351 | 351 | |
@@ -357,12 +357,12 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function get_select($name, $options, $current_value) |
359 | 359 | { |
360 | - $ret = "<select name='" . htmlspecialchars($name, ENT_QUOTES | ENT_HTML5) . "'>\n"; |
|
360 | + $ret = "<select name='".htmlspecialchars($name, ENT_QUOTES | ENT_HTML5)."'>\n"; |
|
361 | 361 | |
362 | 362 | foreach ($options as $key => $val) { |
363 | 363 | $selected = $val == $current_value ? "selected='selected'" : ''; |
364 | 364 | |
365 | - $ret .= "<option value='" . htmlspecialchars($key, ENT_QUOTES | ENT_HTML5) . "' $selected>" . htmlspecialchars($val, ENT_QUOTES | ENT_HTML5) . "</option>\n"; |
|
365 | + $ret .= "<option value='".htmlspecialchars($key, ENT_QUOTES | ENT_HTML5)."' $selected>".htmlspecialchars($val, ENT_QUOTES | ENT_HTML5)."</option>\n"; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | $ret .= "</select>\n"; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | // this page can be called only from altsys |
14 | 14 | if ('altsys' != $xoopsModule->getVar('dirname')) { |
15 | - exit('this page can be called only from altsys'); |
|
15 | + exit('this page can be called only from altsys'); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // language file |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | $tplsvarsinfo_total = array_merge($tplsvarsinfo_total, $tplsvarsinfo); |
163 | 163 | } |
164 | 164 | } else { |
165 | - exit('XOOPS_COMPILE_PATH cannot be opened'); |
|
165 | + exit('XOOPS_COMPILE_PATH cannot be opened'); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | if (empty($tplsvarsinfo_total)) { |
169 | - exit(_TPLSADMIN_ERR_NOTPLSVARSINFO); |
|
169 | + exit(_TPLSADMIN_ERR_NOTPLSVARSINFO); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | // |
@@ -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')) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | continue; |
45 | 45 | } |
46 | 46 | |
47 | - convert_array2info_recursive($var_name . '.' . $key, $val, $sum_array_name); |
|
47 | + convert_array2info_recursive($var_name.'.'.$key, $val, $sum_array_name); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | case 'integer': |
57 | 57 | case 'float': |
58 | 58 | case 'double': |
59 | - $GLOBALS[$sum_array_name][$var_name] = (string) $var_value; |
|
59 | + $GLOBALS[$sum_array_name][$var_name] = (string)$var_value; |
|
60 | 60 | |
61 | 61 | return; |
62 | 62 | case 'null': |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | global $site_name; |
83 | 83 | |
84 | - return '<macromedia-extension name="XOOPS-' . $site_name . ' ' . $mxi_name . '" version="1.0" type="Suite" requires-restart="true"> |
|
84 | + return '<macromedia-extension name="XOOPS-'.$site_name.' '.$mxi_name.'" version="1.0" type="Suite" requires-restart="true"> |
|
85 | 85 | <products> |
86 | 86 | <product name="Dreamweaver" version="6" primary="true"> |
87 | 87 | </products> |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ]]></license-agreement> |
97 | 97 | <description><![CDATA[ |
98 | 98 | |
99 | -Usable template variables in ' . $mxi_name . ' |
|
99 | +Usable template variables in ' . $mxi_name.' |
|
100 | 100 | |
101 | 101 | ]]></description> |
102 | 102 | <ui-access><![CDATA[ |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | ]]></ui-access> |
109 | 109 | <files> |
110 | -' . $file_entries . ' |
|
110 | +' . $file_entries.' |
|
111 | 111 | </files> |
112 | 112 | <configuration-changes> |
113 | 113 | </configuration-changes> |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $tplsvarsinfo_mod_tpl = []; |
122 | 122 | $tplsvarsinfo_total = []; |
123 | 123 | |
124 | -if ($handler = opendir(XOOPS_COMPILE_PATH . '/')) { |
|
124 | +if ($handler = opendir(XOOPS_COMPILE_PATH.'/')) { |
|
125 | 125 | while (false !== ($file = readdir($handler))) { |
126 | 126 | // skip files other than tplsvars_* files |
127 | 127 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | continue; |
138 | 138 | } |
139 | 139 | |
140 | - $file_path = XOOPS_COMPILE_PATH . '/' . $file; |
|
140 | + $file_path = XOOPS_COMPILE_PATH.'/'.$file; |
|
141 | 141 | |
142 | 142 | $file_body = implode('', file($file_path)); |
143 | 143 | |
@@ -183,13 +183,13 @@ discard block |
||
183 | 183 | </snippet>'; |
184 | 184 | |
185 | 185 | if (!empty($_POST['as_dw_extension_zip'])) { |
186 | - require_once XOOPS_ROOT_PATH . '/class/zipdownloader.php'; |
|
186 | + require_once XOOPS_ROOT_PATH.'/class/zipdownloader.php'; |
|
187 | 187 | |
188 | 188 | $downloader = new \XoopsZipDownloader(); |
189 | 189 | |
190 | 190 | $do_download = true; |
191 | 191 | } elseif (!empty($_POST['as_dw_extension_tgz'])) { |
192 | - require_once XOOPS_ROOT_PATH . '/class/tardownloader.php'; |
|
192 | + require_once XOOPS_ROOT_PATH.'/class/tardownloader.php'; |
|
193 | 193 | |
194 | 194 | $downloader = new \XoopsTarDownloader(); |
195 | 195 | |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | |
223 | 223 | $snippet_body = sprintf($snippet_format, $name, $description); |
224 | 224 | |
225 | - $file_name = strtr($key, '.', '_') . '.csn'; |
|
225 | + $file_name = strtr($key, '.', '_').'.csn'; |
|
226 | 226 | |
227 | - $downloader->addFileData($snippet_body, $dw_snippets_dirname . '/' . $file_name); |
|
227 | + $downloader->addFileData($snippet_body, $dw_snippets_dirname.'/'.$file_name); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | // make a mxi file per module |
@@ -236,15 +236,15 @@ discard block |
||
236 | 236 | foreach ($tplsvarsinfo as $key => $val) { |
237 | 237 | $name = mb_substr($key, 1); |
238 | 238 | |
239 | - $file_name = strtr($key, '.', '_') . '.csn'; |
|
239 | + $file_name = strtr($key, '.', '_').'.csn'; |
|
240 | 240 | |
241 | - $file_entries .= "\t\t" . '<file name="' . $dw_snippets_dirname . '/' . $file_name . '" destination="$Dreamweaver/Configuration/Snippets/XOOPS-' . $site_name . '/' . $tpl_name . '">' . "\n"; |
|
241 | + $file_entries .= "\t\t".'<file name="'.$dw_snippets_dirname.'/'.$file_name.'" destination="$Dreamweaver/Configuration/Snippets/XOOPS-'.$site_name.'/'.$tpl_name.'">'."\n"; |
|
242 | 242 | } |
243 | 243 | } |
244 | 244 | |
245 | 245 | $mxi_body = get_mxi_body($mod_name, $file_entries); |
246 | 246 | |
247 | - $downloader->addFileData($mxi_body, $mod_name . '.mxi'); |
|
247 | + $downloader->addFileData($mxi_body, $mod_name.'.mxi'); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | //bugfix by nao-pon ,echo is not necessary for downloader |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if ('.zip' == mb_strtolower(mb_substr($orig_filename4check, -4))) { |
42 | 42 | // zip |
43 | 43 | |
44 | - // zip |
|
44 | + // zip |
|
45 | 45 | require_once __DIR__ . '/include/Archive_Zip.php'; |
46 | 46 | |
47 | 47 | $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } elseif ('.tgz' == mb_substr($orig_filename4check, -4) || '.tar.gz' == mb_substr($orig_filename4check, -7)) { |
57 | 57 | // tar.gz |
58 | 58 | |
59 | - // tar.gz |
|
59 | + // tar.gz |
|
60 | 60 | require_once XOOPS_ROOT_PATH . '/class/class.tar.php'; |
61 | 61 | |
62 | 62 | $tar = new tar(); |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | continue; |
99 | 99 | } |
100 | 100 | |
101 | - $pos = mb_strrpos( (string) $file['filename'], '/' ); |
|
101 | + $pos = mb_strrpos( (string) $file['filename'], '/' ); |
|
102 | 102 | |
103 | - $tpl_file = false === $pos ? $file['filename'] : mb_substr( (string) $file['filename'], $pos + 1 ); |
|
103 | + $tpl_file = false === $pos ? $file['filename'] : mb_substr( (string) $file['filename'], $pos + 1 ); |
|
104 | 104 | |
105 | - if ( tplsadmin_import_data( $tplset, $tpl_file, rtrim( (string) $file['content'] ), $file['mtime'] ) ) { |
|
105 | + if ( tplsadmin_import_data( $tplset, $tpl_file, rtrim( (string) $file['content'] ), $file['mtime'] ) ) { |
|
106 | 106 | $imported++; |
107 | 107 | } |
108 | 108 | } |
@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | // GIJOE <https://www.peak.ne.jp> // |
6 | 6 | // ------------------------------------------------------------------------- // |
7 | 7 | |
8 | -require_once __DIR__ . '/include/gtickets.php'; |
|
9 | -require_once __DIR__ . '/include/altsys_functions.php'; |
|
10 | -require_once __DIR__ . '/include/tpls_functions.php'; |
|
8 | +require_once __DIR__.'/include/gtickets.php'; |
|
9 | +require_once __DIR__.'/include/altsys_functions.php'; |
|
10 | +require_once __DIR__.'/include/tpls_functions.php'; |
|
11 | 11 | |
12 | 12 | // this page can be called only from altsys |
13 | 13 | if ('altsys' != $xoopsModule->getVar('dirname')) { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
21 | 21 | |
22 | -if (empty($_FILES['tplset_archive']['tmp_name']) || !is_uploaded_file(($_FILES['tplset_archive']['tmp_name'])??'')) { |
|
22 | +if (empty($_FILES['tplset_archive']['tmp_name']) || !is_uploaded_file(($_FILES['tplset_archive']['tmp_name']) ?? '')) { |
|
23 | 23 | die(_TPLSADMIN_ERR_NOTUPLOADED); |
24 | 24 | } |
25 | 25 | //fix for mb_http_output setting and for add any browsers |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | |
38 | 38 | // EXTRACT VIEW |
39 | 39 | |
40 | -$orig_filename4check = mb_strtolower( (string) $_FILES['tplset_archive']['name'] ); |
|
40 | +$orig_filename4check = mb_strtolower((string)$_FILES['tplset_archive']['name']); |
|
41 | 41 | if ('.zip' == mb_strtolower(mb_substr($orig_filename4check, -4))) { |
42 | 42 | // zip |
43 | 43 | |
44 | 44 | // zip |
45 | - require_once __DIR__ . '/include/Archive_Zip.php'; |
|
45 | + require_once __DIR__.'/include/Archive_Zip.php'; |
|
46 | 46 | |
47 | 47 | $reader = new Archive_Zip($_FILES['tplset_archive']['tmp_name']); |
48 | 48 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // tar.gz |
58 | 58 | |
59 | 59 | // tar.gz |
60 | - require_once XOOPS_ROOT_PATH . '/class/class.tar.php'; |
|
60 | + require_once XOOPS_ROOT_PATH.'/class/class.tar.php'; |
|
61 | 61 | |
62 | 62 | $tar = new tar(); |
63 | 63 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | // IMPORT VIEW |
89 | 89 | |
90 | 90 | $tplset = @$_POST['tplset']; |
91 | -if ( ! preg_match( '/^[0-9A-Za-z_-]{1,16}$/', (string) $tplset ) ) { |
|
91 | +if (!preg_match('/^[0-9A-Za-z_-]{1,16}$/', (string)$tplset)) { |
|
92 | 92 | die(_TPLSADMIN_ERR_INVALIDTPLSET); |
93 | 93 | } |
94 | 94 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | continue; |
99 | 99 | } |
100 | 100 | |
101 | - $pos = mb_strrpos( (string) $file['filename'], '/' ); |
|
101 | + $pos = mb_strrpos((string)$file['filename'], '/'); |
|
102 | 102 | |
103 | - $tpl_file = false === $pos ? $file['filename'] : mb_substr( (string) $file['filename'], $pos + 1 ); |
|
103 | + $tpl_file = false === $pos ? $file['filename'] : mb_substr((string)$file['filename'], $pos + 1); |
|
104 | 104 | |
105 | - if ( tplsadmin_import_data( $tplset, $tpl_file, rtrim( (string) $file['content'] ), $file['mtime'] ) ) { |
|
105 | + if (tplsadmin_import_data($tplset, $tpl_file, rtrim((string)$file['content']), $file['mtime'])) { |
|
106 | 106 | $imported++; |
107 | 107 | } |
108 | 108 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -eval(' function xoops_module_update_' . $mydirname . '( $module ) { return altsys_onupdate_base( $module , \'' . $mydirname . '\' ) ; } '); |
|
3 | +eval(' function xoops_module_update_'.$mydirname.'( $module ) { return altsys_onupdate_base( $module , \''.$mydirname.'\' ) ; } '); |
|
4 | 4 | |
5 | 5 | if (!function_exists('altsys_onupdate_base')) { |
6 | 6 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | if (defined('XOOPS_CUBE_LEGACY')) { |
20 | 20 | $root = XCube_Root::getSingleton(); |
21 | 21 | |
22 | - $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onupdate'); |
|
22 | + $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUpdate.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onupdate'); |
|
23 | 23 | |
24 | 24 | $msgs = []; |
25 | 25 | } elseif (!is_array($msgs)) { |
@@ -34,36 +34,36 @@ discard block |
||
34 | 34 | |
35 | 35 | // configs (Though I know it is not a recommended way...) |
36 | 36 | |
37 | - $check_sql = 'SHOW COLUMNS FROM ' . $db->prefix('config') . " LIKE 'conf_title'"; |
|
37 | + $check_sql = 'SHOW COLUMNS FROM '.$db->prefix('config')." LIKE 'conf_title'"; |
|
38 | 38 | |
39 | 39 | if (($result = $db->query($check_sql)) && ($myrow = $db->fetchArray($result)) && 'varchar(30)' == @$myrow['Type']) { |
40 | - $db->queryF('ALTER TABLE ' . $db->prefix('config') . " MODIFY `conf_title` VARCHAR(255) NOT NULL DEFAULT '', MODIFY `conf_desc` VARCHAR(255) NOT NULL DEFAULT ''"); |
|
40 | + $db->queryF('ALTER TABLE '.$db->prefix('config')." MODIFY `conf_title` VARCHAR(255) NOT NULL DEFAULT '', MODIFY `conf_desc` VARCHAR(255) NOT NULL DEFAULT ''"); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | // 0.4 -> 0.5 |
44 | 44 | |
45 | - $check_sql = 'SELECT COUNT(*) FROM ' . $db->prefix($mydirname . '_language_constants'); |
|
45 | + $check_sql = 'SELECT COUNT(*) FROM '.$db->prefix($mydirname.'_language_constants'); |
|
46 | 46 | |
47 | 47 | if (!$db->query($check_sql)) { |
48 | - $db->queryF('CREATE TABLE ' . $db->prefix($mydirname . '_language_constants') . " (mid SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,language VARCHAR(32) NOT NULL DEFAULT '',name VARCHAR(255) NOT NULL DEFAULT '',value TEXT,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM"); |
|
48 | + $db->queryF('CREATE TABLE '.$db->prefix($mydirname.'_language_constants')." (mid SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,language VARCHAR(32) NOT NULL DEFAULT '',name VARCHAR(255) NOT NULL DEFAULT '',value TEXT,PRIMARY KEY (mid,language,name)) ENGINE=MyISAM"); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // TEMPLATES (all templates have been already removed by modulesadmin) |
52 | 52 | |
53 | 53 | $tplfileHandler = xoops_getHandler('tplfile'); |
54 | 54 | |
55 | - $tpl_path = __DIR__ . '/templates'; |
|
55 | + $tpl_path = __DIR__.'/templates'; |
|
56 | 56 | |
57 | - if ($handler = @opendir($tpl_path . '/')) { |
|
57 | + if ($handler = @opendir($tpl_path.'/')) { |
|
58 | 58 | while (false !== ($file = readdir($handler))) { |
59 | 59 | if ('.' == mb_substr($file, 0, 1)) { |
60 | 60 | continue; |
61 | 61 | } |
62 | 62 | |
63 | - $file_path = $tpl_path . '/' . $file; |
|
63 | + $file_path = $tpl_path.'/'.$file; |
|
64 | 64 | |
65 | 65 | if (is_file($file_path)) { |
66 | - $mtime = (int) (@filemtime($file_path)); |
|
66 | + $mtime = (int)(@filemtime($file_path)); |
|
67 | 67 | |
68 | 68 | $tplfile = $tplfileHandler->create(); |
69 | 69 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $tplfile->setVar('tpl_tplset', 'default'); |
75 | 75 | |
76 | - $tplfile->setVar('tpl_file', $mydirname . '_' . $file); |
|
76 | + $tplfile->setVar('tpl_file', $mydirname.'_'.$file); |
|
77 | 77 | |
78 | 78 | $tplfile->setVar('tpl_desc', '', true); |
79 | 79 | |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | $tplfile->setVar('tpl_type', 'module'); |
87 | 87 | |
88 | 88 | if (!$tplfileHandler->insert($tplfile)) { |
89 | - $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>' . htmlspecialchars($mydirname . '_' . $file, ENT_QUOTES | ENT_HTML5) . '</b> to the database.</span>'; |
|
89 | + $msgs[] = '<span style="color:#ff0000;">ERROR: Could not insert template <b>'.htmlspecialchars($mydirname.'_'.$file, ENT_QUOTES | ENT_HTML5).'</b> to the database.</span>'; |
|
90 | 90 | } else { |
91 | 91 | $tplid = $tplfile->getVar('tpl_id'); |
92 | 92 | |
93 | - $msgs[] = 'Template <b>' . htmlspecialchars($mydirname . '_' . $file, ENT_QUOTES | ENT_HTML5) . '</b> added to the database. (ID: <b>' . $tplid . '</b>)'; |
|
93 | + $msgs[] = 'Template <b>'.htmlspecialchars($mydirname.'_'.$file, ENT_QUOTES | ENT_HTML5).'</b> added to the database. (ID: <b>'.$tplid.'</b>)'; |
|
94 | 94 | |
95 | 95 | // generate compiled file |
96 | 96 | |
97 | - require_once XOOPS_TRUST_PATH . '/libs/altsys/include/altsys_functions.php'; |
|
97 | + require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php'; |
|
98 | 98 | |
99 | 99 | altsys_clear_templates_c(); |
100 | 100 | |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | closedir($handler); |
112 | 112 | } |
113 | 113 | |
114 | - require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
114 | + require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
115 | 115 | |
116 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
116 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
117 | 117 | |
118 | 118 | xoops_template_clear_module_cache($mid); |
119 | 119 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -eval(' function xoops_module_uninstall_' . $mydirname . '( $module ) { return altsys_onuninstall_base( $module , \'' . $mydirname . '\' ) ; } '); |
|
3 | +eval(' function xoops_module_uninstall_'.$mydirname.'( $module ) { return altsys_onuninstall_base( $module , \''.$mydirname.'\' ) ; } '); |
|
4 | 4 | |
5 | 5 | if (!function_exists('altsys_onuninstall_base')) { |
6 | 6 | /** |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | if (defined('XOOPS_CUBE_LEGACY')) { |
20 | 20 | $root = XCube_Root::getSingleton(); |
21 | 21 | |
22 | - $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUninstall.' . ucfirst($mydirname) . '.Success', 'altsys_message_append_onuninstall'); |
|
22 | + $root->mDelegateManager->add('Legacy.Admin.Event.ModuleUninstall.'.ucfirst($mydirname).'.Success', 'altsys_message_append_onuninstall'); |
|
23 | 23 | |
24 | 24 | $ret = []; |
25 | 25 | } elseif (!is_array($ret)) { |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | |
33 | 33 | // TABLES (loading mysql.sql) |
34 | 34 | |
35 | - $sql_file_path = __DIR__ . '/sql/mysql.sql'; |
|
35 | + $sql_file_path = __DIR__.'/sql/mysql.sql'; |
|
36 | 36 | |
37 | - $prefix_mod = $db->prefix() . '_' . $mydirname; |
|
37 | + $prefix_mod = $db->prefix().'_'.$mydirname; |
|
38 | 38 | |
39 | 39 | if (is_file($sql_file_path)) { |
40 | - $ret[] = 'SQL file found at <b>' . htmlspecialchars($sql_file_path, ENT_QUOTES | ENT_HTML5) . '</b>.<br > Deleting tables...<br>'; |
|
40 | + $ret[] = 'SQL file found at <b>'.htmlspecialchars($sql_file_path, ENT_QUOTES | ENT_HTML5).'</b>.<br > Deleting tables...<br>'; |
|
41 | 41 | |
42 | 42 | $sql_lines = file($sql_file_path); |
43 | 43 | |
44 | 44 | foreach ($sql_lines as $sql_line) { |
45 | 45 | if (preg_match('/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i', $sql_line, $regs)) { |
46 | - $sql = 'DROP TABLE ' . addslashes($prefix_mod . '_' . $regs[1]); |
|
46 | + $sql = 'DROP TABLE '.addslashes($prefix_mod.'_'.$regs[1]); |
|
47 | 47 | |
48 | 48 | if (!$db->query($sql)) { |
49 | - $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>' . htmlspecialchars($prefix_mod . '_' . $regs[1], ENT_QUOTES | ENT_HTML5) . '<b>.</span><br>'; |
|
49 | + $ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1], ENT_QUOTES | ENT_HTML5).'<b>.</span><br>'; |
|
50 | 50 | } else { |
51 | - $ret[] = 'Table <b>' . htmlspecialchars($prefix_mod . '_' . $regs[1], ENT_QUOTES | ENT_HTML5) . '</b> dropped.<br>'; |
|
51 | + $ret[] = 'Table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1], ENT_QUOTES | ENT_HTML5).'</b> dropped.<br>'; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | } |
@@ -3,9 +3,9 @@ discard block |
||
3 | 3 | $xoopsOption['nocommon'] = 1; |
4 | 4 | define('_LEGACY_PREVENT_LOAD_CORE_', 1); |
5 | 5 | |
6 | -require \dirname(__DIR__, 2) . '/mainfile.php'; |
|
6 | +require \dirname(__DIR__, 2).'/mainfile.php'; |
|
7 | 7 | |
8 | -if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH !== '' && file_exists(XOOPS_TRUST_PATH . '/libs/altsys')) { |
|
8 | +if (defined('XOOPS_TRUST_PATH') && XOOPS_TRUST_PATH !== '' && file_exists(XOOPS_TRUST_PATH.'/libs/altsys')) { |
|
9 | 9 | exit('No problem with your XOOPS_TRUST_PATH'); |
10 | 10 | } |
11 | 11 | |
@@ -22,11 +22,11 @@ discard block |
||
22 | 22 | if ('.' == mb_substr($file, 0, 1)) { |
23 | 23 | continue; |
24 | 24 | } |
25 | - $fullpath = $baseDir . '/' . $file; |
|
25 | + $fullpath = $baseDir.'/'.$file; |
|
26 | 26 | if (!is_dir($fullpath)) { |
27 | 27 | continue; |
28 | 28 | } |
29 | - if (is_dir($fullpath . '/libs/altsys')) { |
|
29 | + if (is_dir($fullpath.'/libs/altsys')) { |
|
30 | 30 | $xoops_trust_path = $fullpath; |
31 | 31 | break 2; |
32 | 32 | } |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | } |
36 | 36 | // fall back |
37 | 37 | if (empty($xoops_trust_path)) { |
38 | - $xoops_trust_path = \dirname(XOOPS_ROOT_PATH) . '/xoops_trust_path'; |
|
38 | + $xoops_trust_path = \dirname(XOOPS_ROOT_PATH).'/xoops_trust_path'; |
|
39 | 39 | } |
40 | 40 | // create the hint |
41 | 41 | if (!defined('XOOPS_TRUST_PATH')) { |
42 | - $hint = "Insert the red line.<br>define('XOOPS_ROOT_PATH', '" . htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES | ENT_HTML5) . "');<br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '" . htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5) . "');</ins>"; |
|
42 | + $hint = "Insert the red line.<br>define('XOOPS_ROOT_PATH', '".htmlspecialchars(XOOPS_ROOT_PATH, ENT_QUOTES | ENT_HTML5)."');<br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5)."');</ins>"; |
|
43 | 43 | } else { |
44 | - $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '" . htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5) . "');</ins>"; |
|
44 | + $hint = "<del>define('XOOPS_TRUST_PATH', '');</del><br><ins style='color:red;'>define('XOOPS_TRUST_PATH', '".htmlspecialchars($xoops_trust_path, ENT_QUOTES | ENT_HTML5)."');</ins>"; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <input type="submit" value="next"> |
61 | 61 | </form> |
62 | 62 | <?php if ($hint) { |
63 | - echo 'Edit mainfile.php like this: <blockquote style="border: black solid 1px;">' . $hint . '</blockquote>'; |
|
63 | + echo 'Edit mainfile.php like this: <blockquote style="border: black solid 1px;">'.$hint.'</blockquote>'; |
|
64 | 64 | } ?> |
65 | 65 | </body> |
66 | 66 | </html> |