@@ -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 __DIR__ . '/altsys_functions.php'; |
|
3 | +require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
4 | +require_once __DIR__.'/altsys_functions.php'; |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * @param $tplset |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | // check the file is valid template |
18 | 18 | |
19 | - [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl_file) . "'")); |
|
19 | + [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl_file)."'")); |
|
20 | 20 | |
21 | 21 | if (!$count) { |
22 | 22 | return false; |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | // check the template exists in the tplset |
26 | 26 | |
27 | 27 | if ('default' != $tplset) { |
28 | - [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset) . "' AND tpl_file='" . addslashes($tpl_file) . "'")); |
|
28 | + [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset)."' AND tpl_file='".addslashes($tpl_file)."'")); |
|
29 | 29 | |
30 | 30 | if ($count <= 0) { |
31 | 31 | // copy from 'default' to the tplset |
32 | 32 | |
33 | - $result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND tpl_file='" . addslashes($tpl_file) . "'"); |
|
33 | + $result = $db->query('SELECT * FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='default' AND tpl_file='".addslashes($tpl_file)."'"); |
|
34 | 34 | |
35 | 35 | while (false !== ($row = $db->fetchArray($result))) { |
36 | 36 | $db->queryF('INSERT INTO ' |
@@ -51,19 +51,19 @@ discard block |
||
51 | 51 | |
52 | 52 | $tpl_id = $db->getInsertId(); |
53 | 53 | |
54 | - $db->queryF('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source=''"); |
|
54 | + $db->queryF('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source=''"); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | // UPDATE just tpl_lastmodified and tpl_source |
60 | 60 | |
61 | - $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset) . "' AND tpl_file='" . addslashes($tpl_file) . "'"); |
|
61 | + $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset)."' AND tpl_file='".addslashes($tpl_file)."'"); |
|
62 | 62 | |
63 | 63 | while ([$tpl_id] = $db->fetchRow($drs)) { |
64 | - $db->queryF('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "',tpl_lastimported=UNIX_TIMESTAMP() WHERE tpl_id='$tpl_id'"); |
|
64 | + $db->queryF('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified='".addslashes($lastmodified)."',tpl_lastimported=UNIX_TIMESTAMP() WHERE tpl_id='$tpl_id'"); |
|
65 | 65 | |
66 | - $db->queryF('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'"); |
|
66 | + $db->queryF('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'"); |
|
67 | 67 | |
68 | 68 | altsys_template_touch($tpl_id); |
69 | 69 | } |
@@ -112,22 +112,22 @@ discard block |
||
112 | 112 | while (false !== ($row = $db->fetchArray($result))) { |
113 | 113 | $tpl_source = array_pop($row); |
114 | 114 | |
115 | - $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "' AND ($whr_append) AND tpl_file='" . addslashes($row['tpl_file']) . "' AND tpl_refid='" . addslashes($row['tpl_refid']) . "'"); |
|
115 | + $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'"); |
|
116 | 116 | |
117 | 117 | if (!$db->getRowsNum($drs)) { |
118 | 118 | // INSERT mode |
119 | 119 | |
120 | - $sql = 'INSERT INTO ' . $db->prefix('tplfile') . ' (tpl_refid,tpl_module,tpl_tplset,tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type) VALUES ('; |
|
120 | + $sql = 'INSERT INTO '.$db->prefix('tplfile').' (tpl_refid,tpl_module,tpl_tplset,tpl_file,tpl_desc,tpl_lastmodified,tpl_lastimported,tpl_type) VALUES ('; |
|
121 | 121 | |
122 | 122 | foreach ($row as $colval) { |
123 | - $sql .= "'" . addslashes($colval) . "',"; |
|
123 | + $sql .= "'".addslashes($colval)."',"; |
|
124 | 124 | } |
125 | 125 | |
126 | - $db->query(mb_substr($sql, 0, -1) . ')'); |
|
126 | + $db->query(mb_substr($sql, 0, -1).')'); |
|
127 | 127 | |
128 | 128 | $tpl_id = $db->getInsertId(); |
129 | 129 | |
130 | - $db->query('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source='" . addslashes($tpl_source) . "'"); |
|
130 | + $db->query('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'"); |
|
131 | 131 | |
132 | 132 | altsys_template_touch($tpl_id); |
133 | 133 | } else { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | . addslashes($row['tpl_type']) |
149 | 149 | . "' WHERE tpl_id='$tpl_id'"); |
150 | 150 | |
151 | - $db->query('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'"); |
|
151 | + $db->query('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'"); |
|
152 | 152 | |
153 | 153 | altsys_template_touch($tpl_id); |
154 | 154 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // get tplsource |
168 | 168 | |
169 | - $result = $db->query('SELECT * FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='default' AND ($whr_append)"); |
|
169 | + $result = $db->query('SELECT * FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='default' AND ($whr_append)"); |
|
170 | 170 | |
171 | 171 | while (false !== ($row = $db->fetchArray($result))) { |
172 | 172 | $basefilepath = tplsadmin_get_basefilepath($row['tpl_module'], $row['tpl_type'], $row['tpl_file']); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | |
176 | 176 | $lastmodified = filemtime($basefilepath); |
177 | 177 | |
178 | - $drs = $db->query('SELECT tpl_id FROM ' . $db->prefix('tplfile') . " WHERE tpl_tplset='" . addslashes($tplset_to) . "' AND ($whr_append) AND tpl_file='" . addslashes($row['tpl_file']) . "' AND tpl_refid='" . addslashes($row['tpl_refid']) . "'"); |
|
178 | + $drs = $db->query('SELECT tpl_id FROM '.$db->prefix('tplfile')." WHERE tpl_tplset='".addslashes($tplset_to)."' AND ($whr_append) AND tpl_file='".addslashes($row['tpl_file'])."' AND tpl_refid='".addslashes($row['tpl_refid'])."'"); |
|
179 | 179 | |
180 | 180 | if (!$db->getRowsNum($drs)) { |
181 | 181 | // INSERT mode |
@@ -202,16 +202,16 @@ discard block |
||
202 | 202 | |
203 | 203 | $tpl_id = $db->getInsertId(); |
204 | 204 | |
205 | - $db->query('INSERT INTO ' . $db->prefix('tplsource') . " SET tpl_id='$tpl_id', tpl_source='" . addslashes($tpl_source) . "'"); |
|
205 | + $db->query('INSERT INTO '.$db->prefix('tplsource')." SET tpl_id='$tpl_id', tpl_source='".addslashes($tpl_source)."'"); |
|
206 | 206 | |
207 | 207 | altsys_template_touch($tpl_id); |
208 | 208 | } else { |
209 | 209 | while ([$tpl_id] = $db->fetchRow($drs)) { |
210 | 210 | // UPDATE mode |
211 | 211 | |
212 | - $db->query('UPDATE ' . $db->prefix('tplfile') . " SET tpl_lastmodified='" . addslashes($lastmodified) . "' WHERE tpl_id='$tpl_id'"); |
|
212 | + $db->query('UPDATE '.$db->prefix('tplfile')." SET tpl_lastmodified='".addslashes($lastmodified)."' WHERE tpl_id='$tpl_id'"); |
|
213 | 213 | |
214 | - $db->query('UPDATE ' . $db->prefix('tplsource') . " SET tpl_source='" . addslashes($tpl_source) . "' WHERE tpl_id='$tpl_id'"); |
|
214 | + $db->query('UPDATE '.$db->prefix('tplsource')." SET tpl_source='".addslashes($tpl_source)."' WHERE tpl_id='$tpl_id'"); |
|
215 | 215 | |
216 | 216 | altsys_template_touch($tpl_id); |
217 | 217 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | { |
230 | 230 | // module instance |
231 | 231 | |
232 | - $path = $basefilepath = XOOPS_ROOT_PATH . '/modules/' . $dirname . '/templates/' . ('block' == $type ? 'blocks/' : '') . $tpl_file; |
|
232 | + $path = $basefilepath = XOOPS_ROOT_PATH.'/modules/'.$dirname.'/templates/'.('block' == $type ? 'blocks/' : '').$tpl_file; |
|
233 | 233 | |
234 | 234 | if (is_callable('Legacy_Utils::getTrustDirnameByDirname')) { |
235 | 235 | $mytrustdirname = Legacy_Utils::getTrustDirnameByDirname($dirname); |
@@ -240,19 +240,19 @@ discard block |
||
240 | 240 | if (defined('ALTSYS_TPLSADMIN_BASEPATH')) { |
241 | 241 | // Special hook |
242 | 242 | |
243 | - $path = ALTSYS_TPLSADMIN_BASEPATH . '/' . mb_substr($tpl_file, mb_strlen($dirname) + 1); |
|
244 | - } elseif ($mytrustdirname || @require XOOPS_ROOT_PATH . '/modules/' . $dirname . '/mytrustdirname.php') { |
|
243 | + $path = ALTSYS_TPLSADMIN_BASEPATH.'/'.mb_substr($tpl_file, mb_strlen($dirname) + 1); |
|
244 | + } elseif ($mytrustdirname || @require XOOPS_ROOT_PATH.'/modules/'.$dirname.'/mytrustdirname.php') { |
|
245 | 245 | // D3 module base |
246 | 246 | |
247 | 247 | if (!empty($mytrustdirname)) { |
248 | 248 | $mid_path = 'altsys' == $mytrustdirname ? '/libs/' : '/modules/'; |
249 | 249 | |
250 | - $path = XOOPS_TRUST_PATH . $mid_path . $mytrustdirname . '/templates/' . ('block' == $type ? 'blocks/' : '') . mb_substr($tpl_file, mb_strlen($dirname) + 1); |
|
250 | + $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.('block' == $type ? 'blocks/' : '').mb_substr($tpl_file, mb_strlen($dirname) + 1); |
|
251 | 251 | |
252 | 252 | //new for xcck etc.other trust_module |
253 | 253 | |
254 | 254 | if (!file_exists($path)) { |
255 | - $path = XOOPS_TRUST_PATH . $mid_path . $mytrustdirname . '/templates/' . ('block' == $type ? 'blocks/' : '') . $tpl_file; |
|
255 | + $path = XOOPS_TRUST_PATH.$mid_path.$mytrustdirname.'/templates/'.('block' == $type ? 'blocks/' : '').$tpl_file; |
|
256 | 256 | |
257 | 257 | if (!file_exists($path)) { |
258 | 258 | $path = $basefilepath; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | function tplsadmin_die($msg, $target_dirname = '', $wait = 2): void |
273 | 273 | { |
274 | 274 | if ('post' === mb_strtolower($_SERVER['REQUEST_METHOD'])) { |
275 | - redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname=' . $target_dirname, $wait, $msg); |
|
275 | + redirect_header('?mode=admin&lib=altsys&page=mytplsadmin&dirname='.$target_dirname, $wait, $msg); |
|
276 | 276 | |
277 | 277 | exit; |
278 | 278 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct($params = []) |
38 | 38 | { |
39 | 39 | foreach ($params as $param => $value) { |
40 | - $v = '_' . $param; |
|
40 | + $v = '_'.$param; |
|
41 | 41 | |
42 | 42 | if (isset($this->$v)) { |
43 | 43 | $this->$v = $value; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $output .= $this->_block($x0, $xi - $x0, $y0, $yi - $y0, $block); |
135 | 135 | } |
136 | 136 | |
137 | - return $output . $this->_endDiff(); |
|
137 | + return $output.$this->_endDiff(); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
169 | - return $output . $this->_endBlock(); |
|
169 | + return $output.$this->_endBlock(); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | public function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
196 | 196 | { |
197 | 197 | if ($xlen > 1) { |
198 | - $xbeg .= ',' . ($xbeg + $xlen - 1); |
|
198 | + $xbeg .= ','.($xbeg + $xlen - 1); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | if ($ylen > 1) { |
202 | - $ybeg .= ',' . ($ybeg + $ylen - 1); |
|
202 | + $ybeg .= ','.($ybeg + $ylen - 1); |
|
203 | 203 | } |
204 | 204 | |
205 | - return $xbeg . ($xlen ? ($ylen ? 'c' : 'd') : 'a') . $ybeg; |
|
205 | + return $xbeg.($xlen ? ($ylen ? 'c' : 'd') : 'a').$ybeg; |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | /** |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function _startBlock($header) |
213 | 213 | { |
214 | - return $header . "\n"; |
|
214 | + return $header."\n"; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function _lines($lines, $prefix = ' ') |
231 | 231 | { |
232 | - return $prefix . implode("\n$prefix", $lines) . "\n"; |
|
232 | + return $prefix.implode("\n$prefix", $lines)."\n"; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
@@ -266,6 +266,6 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function _changed($orig, $final) |
268 | 268 | { |
269 | - return $this->_deleted($orig) . "---\n" . $this->_added($final); |
|
269 | + return $this->_deleted($orig)."---\n".$this->_added($final); |
|
270 | 270 | } |
271 | 271 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | }*/ // GIJ |
142 | 142 | |
143 | 143 | if (!extension_loaded('zlib')) { |
144 | - die("The extension 'zlib' couldn't be found.\n" . 'Please make sure your version of PHP was built ' . "with 'zlib' support.\n"); |
|
144 | + die("The extension 'zlib' couldn't be found.\n".'Please make sure your version of PHP was built '."with 'zlib' support.\n"); |
|
145 | 145 | |
146 | 146 | return false; |
147 | 147 | } |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | && ('' == $p_params['by_index']) |
526 | 526 | && ('' == $p_params['by_ereg']) |
527 | 527 | && ('' == $p_params['by_preg'])) { |
528 | - $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'At least one filtering rule must' . ' be set as parameter'); |
|
528 | + $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'At least one filtering rule must'.' be set as parameter'); |
|
529 | 529 | |
530 | 530 | return 0; |
531 | 531 | } |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | // ----- Open the zip file |
584 | 584 | |
585 | 585 | if (0 == ($this->_zip_fd = @fopen($this->_zipname, 'rb'))) { |
586 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \'' . $this->_zipname . '\' in binary read mode'); |
|
586 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->_zipname.'\' in binary read mode'); |
|
587 | 587 | |
588 | 588 | return 0; |
589 | 589 | } |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | // TBC : Should also check the archive format |
641 | 641 | |
642 | 642 | if (!is_file($p_archive)) { |
643 | - $this->_errorLog(ARCHIVE_ZIP_ERR_MISSING_FILE, "No file with filename '" . $p_archive . "'"); |
|
643 | + $this->_errorLog(ARCHIVE_ZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); |
|
644 | 644 | |
645 | 645 | $v_result = ARCHIVE_ZIP_ERR_MISSING_FILE; |
646 | 646 | } else { |
@@ -756,7 +756,7 @@ discard block |
||
756 | 756 | } |
757 | 757 | |
758 | 758 | if ($p_with_code) { |
759 | - return ($v_value . ' (' . $this->_error_code . ')'); |
|
759 | + return ($v_value.' ('.$this->_error_code.')'); |
|
760 | 760 | } |
761 | 761 | |
762 | 762 | return $v_value; |
@@ -778,10 +778,10 @@ discard block |
||
778 | 778 | public function errorInfo($p_full = false) |
779 | 779 | { |
780 | 780 | if ($p_full) { |
781 | - return ($this->errorName(true) . ' : ' . $this->_error_string); |
|
781 | + return ($this->errorName(true).' : '.$this->_error_string); |
|
782 | 782 | } |
783 | 783 | |
784 | - return ($this->_error_string . ' [code ' . $this->_error_code . ']'); |
|
784 | + return ($this->_error_string.' [code '.$this->_error_code.']'); |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | // }}} |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | if (!is_file($this->_zipname)) { |
846 | 846 | // ----- Error log |
847 | 847 | |
848 | - $this->_errorLog(ARCHIVE_ZIP_ERR_MISSING_FILE, "Missing archive file '" . $this->_zipname . "'"); |
|
848 | + $this->_errorLog(ARCHIVE_ZIP_ERR_MISSING_FILE, "Missing archive file '".$this->_zipname."'"); |
|
849 | 849 | |
850 | 850 | return false; |
851 | 851 | } |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | if (!is_readable($this->_zipname)) { |
856 | 856 | // ----- Error log |
857 | 857 | |
858 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '" . $this->_zipname . "'"); |
|
858 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->_zipname."'"); |
|
859 | 859 | |
860 | 860 | return false; |
861 | 861 | } |
@@ -998,14 +998,14 @@ discard block |
||
998 | 998 | |
999 | 999 | // ----- Creates a temporay file |
1000 | 1000 | |
1001 | - $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR . uniqid('archive_zip-') . '.tmp'; |
|
1001 | + $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR.uniqid('archive_zip-').'.tmp'; |
|
1002 | 1002 | |
1003 | 1003 | // ----- Open the temporary file in write mode |
1004 | 1004 | |
1005 | 1005 | if (0 == ($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb'))) { |
1006 | 1006 | $this->_closeFd(); |
1007 | 1007 | |
1008 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \'' . $v_zip_temp_name . '\' in binary write mode'); |
|
1008 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); |
|
1009 | 1009 | |
1010 | 1010 | return self::errorCode(); |
1011 | 1011 | } |
@@ -1181,7 +1181,7 @@ discard block |
||
1181 | 1181 | // ----- Look if already open |
1182 | 1182 | |
1183 | 1183 | if (0 != $this->_zip_fd) { |
1184 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Zip file \'' . $this->_zipname . '\' already open'); |
|
1184 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->_zipname.'\' already open'); |
|
1185 | 1185 | |
1186 | 1186 | return self::errorCode(); |
1187 | 1187 | } |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | // ----- Open the zip file |
1190 | 1190 | |
1191 | 1191 | if (0 == ($this->_zip_fd = @fopen($this->_zipname, $p_mode))) { |
1192 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \'' . $this->_zipname . '\' in ' . $p_mode . ' mode'); |
|
1192 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->_zipname.'\' in '.$p_mode.' mode'); |
|
1193 | 1193 | |
1194 | 1194 | return self::errorCode(); |
1195 | 1195 | } |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | // ----- Look for path |
1437 | 1437 | |
1438 | 1438 | if ('.' != $p_filename) { |
1439 | - $v_path = $p_filename . '/'; |
|
1439 | + $v_path = $p_filename.'/'; |
|
1440 | 1440 | } else { |
1441 | 1441 | $v_path = ''; |
1442 | 1442 | } |
@@ -1450,10 +1450,10 @@ discard block |
||
1450 | 1450 | while ($p_hitem = readdir($p_hdir)) { |
1451 | 1451 | // ----- Look for a file |
1452 | 1452 | |
1453 | - if (is_file($v_path . $p_hitem)) { |
|
1453 | + if (is_file($v_path.$p_hitem)) { |
|
1454 | 1454 | // ----- Add the file |
1455 | 1455 | |
1456 | - if (1 != ($v_result = $this->_addFile($v_path . $p_hitem, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_params))) { |
|
1456 | + if (1 != ($v_result = $this->_addFile($v_path.$p_hitem, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_params))) { |
|
1457 | 1457 | // ----- Return status |
1458 | 1458 | |
1459 | 1459 | return $v_result; |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | else { |
1468 | 1468 | // ----- Need an array as parameter |
1469 | 1469 | |
1470 | - $p_temp_list[0] = $v_path . $p_hitem; |
|
1470 | + $p_temp_list[0] = $v_path.$p_hitem; |
|
1471 | 1471 | |
1472 | 1472 | $v_result = $this->_addFileList($p_temp_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_params); |
1473 | 1473 | |
@@ -1543,7 +1543,7 @@ discard block |
||
1543 | 1543 | |
1544 | 1544 | if (('./' == mb_substr($p_filename, 0, 2)) || ('./' == mb_substr($p_remove_dir, 0, 2))) { |
1545 | 1545 | if (('./' == mb_substr($p_filename, 0, 2)) && ('./' != mb_substr($p_remove_dir, 0, 2))) { |
1546 | - $p_remove_dir = './' . $p_remove_dir; |
|
1546 | + $p_remove_dir = './'.$p_remove_dir; |
|
1547 | 1547 | } |
1548 | 1548 | |
1549 | 1549 | if (('./' != mb_substr($p_filename, 0, 2)) && ('./' == mb_substr($p_remove_dir, 0, 2))) { |
@@ -1568,9 +1568,9 @@ discard block |
||
1568 | 1568 | |
1569 | 1569 | if ('' != $p_add_dir) { |
1570 | 1570 | if ('/' == mb_substr($p_add_dir, -1)) { |
1571 | - $v_stored_filename = $p_add_dir . $v_stored_filename; |
|
1571 | + $v_stored_filename = $p_add_dir.$v_stored_filename; |
|
1572 | 1572 | } else { |
1573 | - $v_stored_filename = $p_add_dir . '/' . $v_stored_filename; |
|
1573 | + $v_stored_filename = $p_add_dir.'/'.$v_stored_filename; |
|
1574 | 1574 | } |
1575 | 1575 | } |
1576 | 1576 | |
@@ -1652,7 +1652,7 @@ discard block |
||
1652 | 1652 | |
1653 | 1653 | // header. |
1654 | 1654 | |
1655 | - eval('$v_result = ' . $p_params[ARCHIVE_ZIP_PARAM_PRE_ADD] . '(ARCHIVE_ZIP_PARAM_PRE_ADD, $v_local_header);'); |
|
1655 | + eval('$v_result = '.$p_params[ARCHIVE_ZIP_PARAM_PRE_ADD].'(ARCHIVE_ZIP_PARAM_PRE_ADD, $v_local_header);'); |
|
1656 | 1656 | |
1657 | 1657 | if (0 == $v_result) { |
1658 | 1658 | // ----- Change the file status |
@@ -1735,7 +1735,7 @@ discard block |
||
1735 | 1735 | |
1736 | 1736 | // ----- Write the compressed content |
1737 | 1737 | |
1738 | - $v_binary_data = pack('a' . $p_header['compressed_size'], $v_content_compressed); |
|
1738 | + $v_binary_data = pack('a'.$p_header['compressed_size'], $v_content_compressed); |
|
1739 | 1739 | |
1740 | 1740 | @fwrite($this->_zip_fd, $v_binary_data, $p_header['compressed_size']); |
1741 | 1741 | |
@@ -1753,7 +1753,7 @@ discard block |
||
1753 | 1753 | |
1754 | 1754 | $p_header['size'] = 0; |
1755 | 1755 | |
1756 | - $p_header['external'] = 0x41FF0010; // Value for a folder : to be checked |
|
1756 | + $p_header['external'] = 0x41FF0010; // Value for a folder : to be checked |
|
1757 | 1757 | |
1758 | 1758 | // ----- Call the header generation |
1759 | 1759 | |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | |
1780 | 1780 | // header. |
1781 | 1781 | |
1782 | - eval('$v_result = ' . $p_params[ARCHIVE_ZIP_PARAM_POST_ADD] . '(ARCHIVE_ZIP_PARAM_POST_ADD, $v_local_header);'); |
|
1782 | + eval('$v_result = '.$p_params[ARCHIVE_ZIP_PARAM_POST_ADD].'(ARCHIVE_ZIP_PARAM_POST_ADD, $v_local_header);'); |
|
1783 | 1783 | |
1784 | 1784 | if (0 == $v_result) { |
1785 | 1785 | // ----- Ignored |
@@ -2024,7 +2024,7 @@ discard block |
||
2024 | 2024 | if (0 == ($this->_zip_fd = @fopen($this->_zipname, 'rb'))) { |
2025 | 2025 | // ----- Error log |
2026 | 2026 | |
2027 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \'' . $this->_zipname . '\' in binary read mode'); |
|
2027 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->_zipname.'\' in binary read mode'); |
|
2028 | 2028 | |
2029 | 2029 | // ----- Return |
2030 | 2030 | |
@@ -2213,7 +2213,7 @@ discard block |
||
2213 | 2213 | || (('/' != mb_substr($p_path, 0, 1)) |
2214 | 2214 | && ('../' != mb_substr($p_path, 0, 3)) |
2215 | 2215 | && (':/' != mb_substr($p_path, 1, 2)))) { |
2216 | - $p_path = './' . $p_path; |
|
2216 | + $p_path = './'.$p_path; |
|
2217 | 2217 | } |
2218 | 2218 | |
2219 | 2219 | // ----- Reduce the path last (and duplicated) '/' |
@@ -2519,7 +2519,7 @@ discard block |
||
2519 | 2519 | // ----- Add the path |
2520 | 2520 | |
2521 | 2521 | if ('' != $p_path) { |
2522 | - $p_entry['filename'] = $p_path . '/' . $p_entry['filename']; |
|
2522 | + $p_entry['filename'] = $p_path.'/'.$p_entry['filename']; |
|
2523 | 2523 | } |
2524 | 2524 | |
2525 | 2525 | // ----- Look for pre-extract callback |
@@ -2538,7 +2538,7 @@ discard block |
||
2538 | 2538 | |
2539 | 2539 | // header. |
2540 | 2540 | |
2541 | - eval('$v_result = ' . $p_params[ARCHIVE_ZIP_PARAM_PRE_EXTRACT] . '(ARCHIVE_ZIP_PARAM_PRE_EXTRACT, $v_local_header);'); |
|
2541 | + eval('$v_result = '.$p_params[ARCHIVE_ZIP_PARAM_PRE_EXTRACT].'(ARCHIVE_ZIP_PARAM_PRE_EXTRACT, $v_local_header);'); |
|
2542 | 2542 | |
2543 | 2543 | if (0 == $v_result) { |
2544 | 2544 | // ----- Change the file status |
@@ -2644,7 +2644,7 @@ discard block |
||
2644 | 2644 | |
2645 | 2645 | $v_buffer = fread($this->_zip_fd, $v_read_size); |
2646 | 2646 | |
2647 | - $v_binary_data = pack('a' . $v_read_size, $v_buffer); |
|
2647 | + $v_binary_data = pack('a'.$v_read_size, $v_buffer); |
|
2648 | 2648 | |
2649 | 2649 | @fwrite($v_dest_file, $v_binary_data, $v_read_size); |
2650 | 2650 | |
@@ -2723,7 +2723,7 @@ discard block |
||
2723 | 2723 | |
2724 | 2724 | // header. |
2725 | 2725 | |
2726 | - eval('$v_result = ' . $p_params[ARCHIVE_ZIP_PARAM_POST_EXTRACT] . '(ARCHIVE_ZIP_PARAM_POST_EXTRACT, $v_local_header);'); |
|
2726 | + eval('$v_result = '.$p_params[ARCHIVE_ZIP_PARAM_POST_EXTRACT].'(ARCHIVE_ZIP_PARAM_POST_EXTRACT, $v_local_header);'); |
|
2727 | 2727 | } |
2728 | 2728 | |
2729 | 2729 | // ----- Return |
@@ -2861,7 +2861,7 @@ discard block |
||
2861 | 2861 | |
2862 | 2862 | // ----- Error log |
2863 | 2863 | |
2864 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid block size : ' . mb_strlen($v_binary_data)); |
|
2864 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid block size : '.mb_strlen($v_binary_data)); |
|
2865 | 2865 | |
2866 | 2866 | // ----- Return |
2867 | 2867 | |
@@ -3003,7 +3003,7 @@ discard block |
||
3003 | 3003 | |
3004 | 3004 | // ----- Error log |
3005 | 3005 | |
3006 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid block size : ' . mb_strlen($v_binary_data)); |
|
3006 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid block size : '.mb_strlen($v_binary_data)); |
|
3007 | 3007 | |
3008 | 3008 | // ----- Return |
3009 | 3009 | |
@@ -3117,7 +3117,7 @@ discard block |
||
3117 | 3117 | @fseek($this->_zip_fd, $v_size); |
3118 | 3118 | |
3119 | 3119 | if (@ftell($this->_zip_fd) != $v_size) { |
3120 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \'' . $this->_zipname . '\''); |
|
3120 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->_zipname.'\''); |
|
3121 | 3121 | |
3122 | 3122 | return self::errorCode(); |
3123 | 3123 | } |
@@ -3134,7 +3134,7 @@ discard block |
||
3134 | 3134 | @fseek($this->_zip_fd, $v_size - 22); |
3135 | 3135 | |
3136 | 3136 | if (($v_pos = @ftell($this->_zip_fd)) != ($v_size - 22)) { |
3137 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \'' . $this->_zipname . '\''); |
|
3137 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->_zipname.'\''); |
|
3138 | 3138 | |
3139 | 3139 | return self::errorCode(); |
3140 | 3140 | } |
@@ -3166,7 +3166,7 @@ discard block |
||
3166 | 3166 | @fseek($this->_zip_fd, $v_size - $v_maximum_size); |
3167 | 3167 | |
3168 | 3168 | if (@ftell($this->_zip_fd) != ($v_size - $v_maximum_size)) { |
3169 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \'' . $this->_zipname . '\''); |
|
3169 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->_zipname.'\''); |
|
3170 | 3170 | |
3171 | 3171 | return self::errorCode(); |
3172 | 3172 | } |
@@ -3213,7 +3213,7 @@ discard block |
||
3213 | 3213 | // ----- Look for invalid block size |
3214 | 3214 | |
3215 | 3215 | if (18 != mb_strlen($v_binary_data)) { |
3216 | - $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid End of Central Dir Record size : ' . mb_strlen($v_binary_data)); |
|
3216 | + $this->_errorLog(ARCHIVE_ZIP_ERR_BAD_FORMAT, 'Invalid End of Central Dir Record size : '.mb_strlen($v_binary_data)); |
|
3217 | 3217 | |
3218 | 3218 | return self::errorCode(); |
3219 | 3219 | } |
@@ -3369,7 +3369,7 @@ discard block |
||
3369 | 3369 | && (mb_substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, mb_strlen($p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) == $p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) { |
3370 | 3370 | $v_found = true; |
3371 | 3371 | } elseif ((0x00000010 == ($v_header_list[$v_nb_extracted]['external'] & 0x00000010)) /* Indicates a folder */ |
3372 | - && ($v_header_list[$v_nb_extracted]['stored_filename'] . '/' == $p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) { |
|
3372 | + && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_params[ARCHIVE_ZIP_PARAM_BY_NAME][$j])) { |
|
3373 | 3373 | $v_found = true; |
3374 | 3374 | } |
3375 | 3375 | } // ----- Look for a filename |
@@ -3435,7 +3435,7 @@ discard block |
||
3435 | 3435 | if ($v_nb_extracted > 0) { |
3436 | 3436 | // ----- Creates a temporay file |
3437 | 3437 | |
3438 | - $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR . uniqid('archive_zip-') . '.tmp'; |
|
3438 | + $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR.uniqid('archive_zip-').'.tmp'; |
|
3439 | 3439 | |
3440 | 3440 | // ----- Creates a temporary zip archive |
3441 | 3441 | |
@@ -3774,7 +3774,7 @@ discard block |
||
3774 | 3774 | |
3775 | 3775 | // ----- Creates a temporay file |
3776 | 3776 | |
3777 | - $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR . uniqid('archive_zip-') . '.tmp'; |
|
3777 | + $v_zip_temp_name = ARCHIVE_ZIP_TEMPORARY_DIR.uniqid('archive_zip-').'.tmp'; |
|
3778 | 3778 | |
3779 | 3779 | // ----- Open the temporary file in write mode |
3780 | 3780 | |
@@ -3783,7 +3783,7 @@ discard block |
||
3783 | 3783 | |
3784 | 3784 | $p_archive_to_add->_closeFd(); |
3785 | 3785 | |
3786 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \'' . $v_zip_temp_name . '\' in binary write mode'); |
|
3786 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); |
|
3787 | 3787 | |
3788 | 3788 | return self::errorCode(); |
3789 | 3789 | } |
@@ -3981,7 +3981,7 @@ discard block |
||
3981 | 3981 | if (0 == ($v_zip_temp_fd = @fopen($p_archive_filename, 'rb'))) { |
3982 | 3982 | $this->_closeFd(); |
3983 | 3983 | |
3984 | - $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \'' . $p_archive_filename . '\' in binary write mode'); |
|
3984 | + $this->_errorLog(ARCHIVE_ZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); |
|
3985 | 3985 | |
3986 | 3986 | return self::errorCode(); |
3987 | 3987 | } |
@@ -4042,7 +4042,7 @@ discard block |
||
4042 | 4042 | |
4043 | 4043 | for (reset($p_params); [$v_key, $v_value] = each($p_params);) { |
4044 | 4044 | if (!isset($p_default[$v_key])) { |
4045 | - $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'Unsupported parameter with key \'' . $v_key . '\''); |
|
4045 | + $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAMETER, 'Unsupported parameter with key \''.$v_key.'\''); |
|
4046 | 4046 | |
4047 | 4047 | return self::errorCode(); |
4048 | 4048 | } |
@@ -4070,7 +4070,7 @@ discard block |
||
4070 | 4070 | |
4071 | 4071 | if (isset($p_params[$v_key]) && ('' != $p_params[$v_key])) { |
4072 | 4072 | if (!function_exists($p_params[$v_key])) { |
4073 | - $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAM_VALUE, "Callback '" . $p_params[$v_key] . "()' is not an existing function for " . "parameter '" . $v_key . "'"); |
|
4073 | + $this->_errorLog(ARCHIVE_ZIP_ERR_INVALID_PARAM_VALUE, "Callback '".$p_params[$v_key]."()' is not an existing function for "."parameter '".$v_key."'"); |
|
4074 | 4074 | |
4075 | 4075 | return self::errorCode(); |
4076 | 4076 | } |
@@ -4179,7 +4179,7 @@ discard block |
||
4179 | 4179 | // ----- Ignore only the double '//' in path, |
4180 | 4180 | // but not the first and last '/' |
4181 | 4181 | } else { |
4182 | - $v_result = $v_list[$i] . ($i != (count($v_list) - 1) ? '/' . $v_result : ''); |
|
4182 | + $v_result = $v_list[$i].($i != (count($v_list) - 1) ? '/'.$v_result : ''); |
|
4183 | 4183 | } |
4184 | 4184 | } |
4185 | 4185 | } |
@@ -13,17 +13,17 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function myDeleteByModule($DB, $gperm_modid, $gperm_name = null, $gperm_itemid = null) |
15 | 15 | { |
16 | - $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', (int) $gperm_modid)); |
|
16 | + $criteria = new \CriteriaCompo(new \Criteria('gperm_modid', (int)$gperm_modid)); |
|
17 | 17 | |
18 | 18 | if (isset($gperm_name)) { |
19 | 19 | $criteria->add(new \Criteria('gperm_name', $gperm_name)); |
20 | 20 | |
21 | 21 | if (isset($gperm_itemid)) { |
22 | - $criteria->add(new \Criteria('gperm_itemid', (int) $gperm_itemid)); |
|
22 | + $criteria->add(new \Criteria('gperm_itemid', (int)$gperm_itemid)); |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | - $sql = 'DELETE FROM ' . $DB->prefix('group_permission') . ' ' . $criteria->renderWhere(); |
|
26 | + $sql = 'DELETE FROM '.$DB->prefix('group_permission').' '.$criteria->renderWhere(); |
|
27 | 27 | |
28 | 28 | if (!$result = $DB->query($sql)) { |
29 | 29 | return false; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (0 != $pid && !array_key_exists($pid, $item_ids)) { |
110 | 110 | // one of the parent items were not selected, so skip this item |
111 | 111 | |
112 | - $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>') . ' (' . _MD_A_MYBLOCKSADMIN_PERMADDNGP . ')'; |
|
112 | + $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_A_MYBLOCKSADMIN_PERMADDNGP.')'; |
|
113 | 113 | |
114 | 114 | continue 2; |
115 | 115 | } |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | $gperm->setVar('gperm_itemid', $item_id); |
128 | 128 | |
129 | 129 | if (!$grouppermHandler->insert($gperm)) { |
130 | - $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>'); |
|
130 | + $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>'); |
|
131 | 131 | } else { |
132 | - $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDOK, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>'); |
|
132 | + $msg[] = sprintf(_MD_A_MYBLOCKSADMIN_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>'); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | unset($gperm); |
@@ -451,20 +451,20 @@ |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | $tree .= '>' |
454 | - . $option['name'] |
|
455 | - . '<input type="hidden" name="' |
|
456 | - . $this->getName() |
|
457 | - . '[parents][' |
|
458 | - . $option['id'] |
|
459 | - . ']" value="' |
|
460 | - . implode(':', $parentIds) |
|
461 | - . '"><input type="hidden" name="' |
|
462 | - . $this->getName() |
|
463 | - . '[itemname][' |
|
464 | - . $option['id'] |
|
465 | - . ']" value="' |
|
466 | - . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
467 | - . "\"><br>\n"; |
|
454 | + . $option['name'] |
|
455 | + . '<input type="hidden" name="' |
|
456 | + . $this->getName() |
|
457 | + . '[parents][' |
|
458 | + . $option['id'] |
|
459 | + . ']" value="' |
|
460 | + . implode(':', $parentIds) |
|
461 | + . '"><input type="hidden" name="' |
|
462 | + . $this->getName() |
|
463 | + . '[itemname][' |
|
464 | + . $option['id'] |
|
465 | + . ']" value="' |
|
466 | + . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5) |
|
467 | + . "\"><br>\n"; |
|
468 | 468 | |
469 | 469 | if (isset($option['children'])) { |
470 | 470 | foreach ($option['children'] as $child) { |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | exit; |
19 | 19 | } |
20 | 20 | |
21 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
22 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
23 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
24 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
25 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
21 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
22 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
23 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
24 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
25 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
26 | 26 | |
27 | 27 | /** |
28 | 28 | * Renders a form for setting module specific group permissions |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | parent::__construct($title, 'groupperm_form', '', 'post'); |
81 | 81 | |
82 | - $this->_modid = (int) $modid; |
|
82 | + $this->_modid = (int)$modid; |
|
83 | 83 | |
84 | 84 | $this->_permName = $permname; |
85 | 85 | |
@@ -171,13 +171,13 @@ discard block |
||
171 | 171 | |
172 | 172 | $selected = $grouppermHandler->getItemIds($this->_permName, $i, $this->_modid); |
173 | 173 | |
174 | - $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
174 | + $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
175 | 175 | |
176 | 176 | $ele->setOptionTree($this->_itemTree); |
177 | 177 | |
178 | 178 | // GIJ start |
179 | 179 | |
180 | - $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\[' . $i . '\]/)){elements[i].checked=this.checked;}}};">'); |
|
180 | + $ele->setDescription('<input type="checkbox" onclick="with(document.groupperm_form){for(i=0;i<length;i++){if(elements[i].name.match(/^perms\[(module_admin|module_read|block_read)\]\[groups\]\['.$i.'\]/)){elements[i].checked=this.checked;}}};">'); |
|
181 | 181 | |
182 | 182 | // GIJ_end |
183 | 183 | |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | |
221 | 221 | $this->addElement($tray); |
222 | 222 | |
223 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>'; |
|
223 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>'; |
|
224 | 224 | |
225 | - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
225 | + $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
226 | 226 | |
227 | 227 | $elements = &$this->getElements(); |
228 | 228 | |
@@ -232,21 +232,21 @@ discard block |
||
232 | 232 | } elseif (!$elements[$i]->isHidden()) { |
233 | 233 | // group name |
234 | 234 | |
235 | - $ret .= "<tr valign='top' align='" . _GLOBAL_LEFT . "'><td class='head'>" . $elements[$i]->getCaption(); |
|
235 | + $ret .= "<tr valign='top' align='"._GLOBAL_LEFT."'><td class='head'>".$elements[$i]->getCaption(); |
|
236 | 236 | |
237 | 237 | // group description |
238 | 238 | |
239 | 239 | if ('' != $elements[$i]->getDescription()) { |
240 | - $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
240 | + $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
241 | 241 | } |
242 | 242 | |
243 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
243 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
244 | 244 | } else { |
245 | 245 | $ret .= $elements[$i]->render(); |
246 | 246 | } |
247 | 247 | } |
248 | 248 | |
249 | - $ret .= '</table>' . $xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin') . '</form>'; |
|
249 | + $ret .= '</table>'.$xoopsGTicket->getTicketHtml(__LINE__, 1800, 'myblocksadmin').'</form>'; |
|
250 | 250 | |
251 | 251 | return $ret; |
252 | 252 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | |
364 | 364 | $checked = $append['selected'] ? 'checked' : ''; |
365 | 365 | |
366 | - $name = 'perms[' . $append['permname'] . ']'; |
|
366 | + $name = 'perms['.$append['permname'].']'; |
|
367 | 367 | |
368 | 368 | $itemid = $append['itemid']; |
369 | 369 | |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | $this->_renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
397 | 397 | |
398 | - $ret .= $tree . '</td>'; |
|
398 | + $ret .= $tree.'</td>'; |
|
399 | 399 | |
400 | 400 | $cols++; |
401 | 401 | } |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | */ |
417 | 417 | private function _renderOptionTree(&$tree, $option, $prefix, $parentIds = []): void |
418 | 418 | { |
419 | - $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
419 | + $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="'; |
|
420 | 420 | |
421 | 421 | // If there are parent elements, add javascript that will |
422 | 422 | |
@@ -425,9 +425,9 @@ discard block |
||
425 | 425 | // sure permissions to parent items are added as well. |
426 | 426 | |
427 | 427 | foreach ($parentIds as $pid) { |
428 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
428 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
429 | 429 | |
430 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if(ele.checked !== true) {ele.checked = this.checked;}"; |
|
430 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if(ele.checked !== true) {ele.checked = this.checked;}"; |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // If there are child elements, add javascript that will |
@@ -439,9 +439,9 @@ discard block |
||
439 | 439 | // is no permission to this item. |
440 | 440 | |
441 | 441 | foreach ($option['allchild'] as $cid) { |
442 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
442 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
443 | 443 | |
444 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if(this.checked !== true) {ele.checked = false;}"; |
|
444 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if(this.checked !== true) {ele.checked = false;}"; |
|
445 | 445 | } |
446 | 446 | |
447 | 447 | $tree .= '" value="1"'; |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | foreach ($option['children'] as $child) { |
471 | 471 | $parentIds[] = $option['id']; |
472 | 472 | |
473 | - $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
473 | + $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
474 | 474 | } |
475 | 475 | } |
476 | 476 | } |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | -require_once XOOPS_ROOT_PATH . '/modules/legacyRender/kernel/Legacy_AdminRenderSystem.class.php'; |
|
4 | -require_once XOOPS_TRUST_PATH . '/libs/altsys/include/altsys_functions.php'; |
|
5 | -require_once XOOPS_TRUST_PATH . '/libs/altsys/include/admin_in_theme_functions.php'; |
|
3 | +require_once XOOPS_ROOT_PATH.'/modules/legacyRender/kernel/Legacy_AdminRenderSystem.class.php'; |
|
4 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/include/altsys_functions.php'; |
|
5 | +require_once XOOPS_TRUST_PATH.'/libs/altsys/include/admin_in_theme_functions.php'; |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * Class Legacy_AltsysAdminRenderSystem |
@@ -162,20 +162,20 @@ |
||
162 | 162 | // assignment |
163 | 163 | |
164 | 164 | $xoopsTpl->assign([ |
165 | - 'xoops_theme' => $xoopsConfig['theme_set'], |
|
166 | - 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', |
|
167 | - 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), |
|
168 | - 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES | ENT_HTML5), |
|
169 | - 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES | ENT_HTML5), |
|
170 | - 'xoops_showlblock' => 1, |
|
171 | - // 'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript" src="'.XOOPS_URL.'/include/layersmenu.js"></script><script type="text/javascript"><!--'."\n".$xoops_admin_menu_js , |
|
172 | - 'xoops_js' => '//--></script><script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script><script type="text/javascript"><!--' . "\n", |
|
173 | - 'xoops_runs_admin_side' => 1, |
|
174 | - 'xoops_breadcrumbs' => $xoops_breadcrumbs, |
|
175 | - 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES | ENT_HTML5), |
|
176 | - 'xoops_contents' => $xoops_admin_contents, //. '<div id="adminmenu_layers">' . $xoops_admin_menu_dv . '</div>' , |
|
177 | - 'xoops_module_header' => $xoops_module_header, |
|
178 | - ]); |
|
165 | + 'xoops_theme' => $xoopsConfig['theme_set'], |
|
166 | + 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', |
|
167 | + 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), |
|
168 | + 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES | ENT_HTML5), |
|
169 | + 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES | ENT_HTML5), |
|
170 | + 'xoops_showlblock' => 1, |
|
171 | + // 'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript" src="'.XOOPS_URL.'/include/layersmenu.js"></script><script type="text/javascript"><!--'."\n".$xoops_admin_menu_js , |
|
172 | + 'xoops_js' => '//--></script><script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script><script type="text/javascript"><!--' . "\n", |
|
173 | + 'xoops_runs_admin_side' => 1, |
|
174 | + 'xoops_breadcrumbs' => $xoops_breadcrumbs, |
|
175 | + 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES | ENT_HTML5), |
|
176 | + 'xoops_contents' => $xoops_admin_contents, //. '<div id="adminmenu_layers">' . $xoops_admin_menu_dv . '</div>' , |
|
177 | + 'xoops_module_header' => $xoops_module_header, |
|
178 | + ]); |
|
179 | 179 | |
180 | 180 | // rendering |
181 | 181 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | return $s; |
47 | 47 | } |
48 | 48 | |
49 | - [$tmp_s, $tmp_after] = explode("<td width='1%' background='" . XOOPS_URL . "/modules/system/images/bg_content.gif'>", $tmp_s); |
|
49 | + [$tmp_s, $tmp_after] = explode("<td width='1%' background='".XOOPS_URL."/modules/system/images/bg_content.gif'>", $tmp_s); |
|
50 | 50 | |
51 | 51 | if (empty($tmp_after)) { |
52 | 52 | define('ALTSYS_DONT_USE_ADMIN_IN_THEME', 1); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | return $s; |
55 | 55 | } |
56 | 56 | |
57 | - $xoops_admin_contents = $former_outputs . mb_substr(strrev(mb_strstr(strrev($tmp_s), strrev('</div>'))), 0, -6); |
|
57 | + $xoops_admin_contents = $former_outputs.mb_substr(strrev(mb_strstr(strrev($tmp_s), strrev('</div>'))), 0, -6); |
|
58 | 58 | |
59 | 59 | return ''; |
60 | 60 | } |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | |
89 | 89 | // language files |
90 | 90 | |
91 | - if (is_file(dirname(__DIR__) . '/language/' . $xoopsConfig['language'] . '/admin_in_theme.php')) { |
|
92 | - require_once dirname(__DIR__) . '/language/' . $xoopsConfig['language'] . '/admin_in_theme.php'; |
|
91 | + if (is_file(dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/admin_in_theme.php')) { |
|
92 | + require_once dirname(__DIR__).'/language/'.$xoopsConfig['language'].'/admin_in_theme.php'; |
|
93 | 93 | } else { |
94 | - require_once dirname(__DIR__) . '/language/english/admin_in_theme.php'; |
|
94 | + require_once dirname(__DIR__).'/language/english/admin_in_theme.php'; |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | // set the theme |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | |
105 | 105 | error_reporting($original_error_level & ~E_NOTICE); |
106 | 106 | |
107 | - if (is_file(XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/language/' . $xoopsConfig['language'] . '.php')) { |
|
108 | - require_once XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/language/' . $xoopsConfig['language'] . '.php'; |
|
109 | - } elseif (is_file(XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/language/english.php')) { |
|
110 | - require_once XOOPS_THEME_PATH . '/' . $xoopsConfig['theme_set'] . '/language/english.php'; |
|
107 | + if (is_file(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/'.$xoopsConfig['language'].'.php')) { |
|
108 | + require_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/'.$xoopsConfig['language'].'.php'; |
|
109 | + } elseif (is_file(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/english.php')) { |
|
110 | + require_once XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/english.php'; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | error_reporting($original_error_level); |
114 | 114 | |
115 | - require __DIR__ . '/admin_in_theme_header.inc.php'; |
|
115 | + require __DIR__.'/admin_in_theme_header.inc.php'; |
|
116 | 116 | |
117 | 117 | /* // include adminmenu |
118 | 118 | include XOOPS_CACHE_PATH.'/adminmenu.php' ; |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | $xoops_module_header = ''; |
153 | 153 | |
154 | 154 | if (ALTSYS_CORE_TYPE_XCL21 == altsys_get_core_type()) { |
155 | - $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/modules/legacyRender/admin/css.php?file=style.css">' . "\n"; |
|
155 | + $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=style.css">'."\n"; |
|
156 | 156 | |
157 | 157 | if (is_object(@$xoopsModule)) { |
158 | - $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="' . XOOPS_URL . '/modules/legacyRender/admin/css.php?file=module.css&dirname=' . $xoopsModule->getVar('dirname') . '">' . "\n"; |
|
158 | + $xoops_module_header .= '<link rel="stylesheet" type="text/css" media="all" href="'.XOOPS_URL.'/modules/legacyRender/admin/css.php?file=module.css&dirname='.$xoopsModule->getVar('dirname').'">'."\n"; |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | |
164 | 164 | $xoopsTpl->assign([ |
165 | 165 | 'xoops_theme' => $xoopsConfig['theme_set'], |
166 | - 'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/', |
|
166 | + 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', |
|
167 | 167 | 'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']), |
168 | 168 | 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES | ENT_HTML5), |
169 | 169 | 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES | ENT_HTML5), |
170 | 170 | 'xoops_showlblock' => 1, |
171 | 171 | // 'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript" src="'.XOOPS_URL.'/include/layersmenu.js"></script><script type="text/javascript"><!--'."\n".$xoops_admin_menu_js , |
172 | - 'xoops_js' => '//--></script><script type="text/javascript" src="' . XOOPS_URL . '/include/xoops.js"></script><script type="text/javascript"><!--' . "\n", |
|
172 | + 'xoops_js' => '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--'."\n", |
|
173 | 173 | 'xoops_runs_admin_side' => 1, |
174 | 174 | 'xoops_breadcrumbs' => $xoops_breadcrumbs, |
175 | 175 | 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES | ENT_HTML5), |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | // rendering |
181 | 181 | |
182 | - $xoopsTpl->display($xoopsConfig['theme_set'] . '/theme.html'); |
|
182 | + $xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html'); |
|
183 | 183 | |
184 | 184 | // for XOOPS 2.0.14/15/16 from xoops.org |
185 | 185 |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | public function _blockHeader($xbeg, $xlen, $ybeg, $ylen) |
30 | 30 | { |
31 | 31 | if (1 != $xlen) { |
32 | - $xbeg .= ',' . $xlen; |
|
32 | + $xbeg .= ','.$xlen; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if (1 != $ylen) { |
36 | - $ybeg .= ',' . $ylen; |
|
36 | + $ybeg .= ','.$ylen; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | return "@@ -$xbeg +$ybeg @@"; |
@@ -64,6 +64,6 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function _changed($orig, $final) |
66 | 66 | { |
67 | - return $this->_deleted($orig) . $this->_added($final); |
|
67 | + return $this->_deleted($orig).$this->_added($final); |
|
68 | 68 | } |
69 | 69 | } |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | // write back |
107 | 107 | |
108 | 108 | altsys_adminmenu_save_x20([ |
109 | - 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
110 | - 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
111 | - 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
112 | - 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
113 | - 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
114 | - 'altsys_adminmenu_ft_hacked' => (int) (@$altsys_adminmenu_ft_hacked), |
|
115 | - 'altsys_adminmenu_dv_updated' => true, |
|
116 | - ]); |
|
109 | + 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
110 | + 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
111 | + 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
112 | + 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
113 | + 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
114 | + 'altsys_adminmenu_ft_hacked' => (int) (@$altsys_adminmenu_ft_hacked), |
|
115 | + 'altsys_adminmenu_dv_updated' => true, |
|
116 | + ]); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | // write back |
224 | 224 | |
225 | 225 | altsys_adminmenu_save_x20([ |
226 | - 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
227 | - 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
228 | - 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
229 | - 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
230 | - 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
231 | - 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL, |
|
232 | - ]); |
|
226 | + 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
227 | + 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
228 | + 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
229 | + 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
230 | + 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
231 | + 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_2COL, |
|
232 | + ]); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | function altsys_adminmenu_hack_ft_noimg_x20(): void |
@@ -291,13 +291,13 @@ discard block |
||
291 | 291 | // write back |
292 | 292 | |
293 | 293 | altsys_adminmenu_save_x20([ |
294 | - 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
295 | - 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
296 | - 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
297 | - 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
298 | - 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
299 | - 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG, |
|
300 | - ]); |
|
294 | + 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
295 | + 'xoops_admin_menu_ml' => $xoops_admin_menu_ml, |
|
296 | + 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
|
297 | + 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
298 | + 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
299 | + 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_NOIMG, |
|
300 | + ]); |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | function altsys_adminmenu_hack_ft_xcsty_x20(): void |
@@ -426,13 +426,13 @@ discard block |
||
426 | 426 | // write back |
427 | 427 | |
428 | 428 | altsys_adminmenu_save_x20([ |
429 | - 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
430 | - 'xoops_admin_menu_ml' => [], |
|
431 | - 'xoops_admin_menu_sd' => [], |
|
432 | - 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
433 | - 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
434 | - 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY, |
|
435 | - ]); |
|
429 | + 'xoops_admin_menu_js' => $xoops_admin_menu_js, |
|
430 | + 'xoops_admin_menu_ml' => [], |
|
431 | + 'xoops_admin_menu_sd' => [], |
|
432 | + 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
|
433 | + 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
|
434 | + 'altsys_adminmenu_ft_hacked' => ALTSYS_ADMINMENU_HACK_XCSTY, |
|
435 | + ]); |
|
436 | 436 | } |
437 | 437 | |
438 | 438 | // |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | -require_once dirname(__DIR__) . '/class/altsysUtils.class.php'; |
|
2 | +require_once dirname(__DIR__).'/class/altsysUtils.class.php'; |
|
3 | 3 | |
4 | -define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH . '/adminmenu.php'); |
|
4 | +define('ALTSYS_ADMINMENU_FILE', XOOPS_CACHE_PATH.'/adminmenu.php'); |
|
5 | 5 | define('ALTSYS_ADMINMENU_HACK_NONE', 0); |
6 | 6 | define('ALTSYS_ADMINMENU_HACK_2COL', 1); |
7 | 7 | define('ALTSYS_ADMINMENU_HACK_NOIMG', 2); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | // read |
35 | 35 | |
36 | 36 | if (!is_file(ALTSYS_ADMINMENU_FILE)) { |
37 | - redirect_header(XOOPS_URL . '/admin.php', 1, 'Rebuild adminmenu'); |
|
37 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
38 | 38 | |
39 | 39 | exit; |
40 | 40 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $mid = $module->getVar('mid'); |
49 | 49 | |
50 | - $anchor = '<!-- ALTSYS ANCHOR ' . $dirname . ' -->'; |
|
50 | + $anchor = '<!-- ALTSYS ANCHOR '.$dirname.' -->'; |
|
51 | 51 | |
52 | 52 | // fetch popup_no |
53 | 53 | |
@@ -59,17 +59,17 @@ discard block |
||
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - $popup_no = (int) $regs[1]; |
|
62 | + $popup_no = (int)$regs[1]; |
|
63 | 63 | |
64 | 64 | // replace |
65 | 65 | |
66 | - $search = '<img src=\'' . XOOPS_URL . '/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\'' . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mid . '\''; |
|
66 | + $search = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\''.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$mid.'\''; |
|
67 | 67 | |
68 | - $replace = $anchor . '<img src=\'' . XOOPS_URL . '/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\'' . XOOPS_URL . '/modules/' . $dirname . '/admin/index.php?mode=admin&lib=altsys&page=mypreferences\''; |
|
68 | + $replace = $anchor.'<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mypreferences\''; |
|
69 | 69 | |
70 | 70 | // do replacement |
71 | 71 | |
72 | - $new_xoops_admin_menu_dv = preg_replace('#' . preg_quote($search) . '#', $replace, $xoops_admin_menu_dv); |
|
72 | + $new_xoops_admin_menu_dv = preg_replace('#'.preg_quote($search).'#', $replace, $xoops_admin_menu_dv); |
|
73 | 73 | |
74 | 74 | if ($xoops_admin_menu_dv == $new_xoops_admin_menu_dv) { |
75 | 75 | return; |
@@ -84,24 +84,24 @@ discard block |
||
84 | 84 | if ('altsys' != $dirname) { |
85 | 85 | $blocksadmin_title = defined('_MD_A_MYMENU_MYBLOCKSADMIN') ? _MD_A_MYMENU_MYBLOCKSADMIN : 'blocksadmin'; |
86 | 86 | |
87 | - $insert .= '<img src=\'' . XOOPS_URL . '/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\'' . XOOPS_URL . '/modules/' . $dirname . '/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin\'>' . $blocksadmin_title . '</a><br>' . "\n"; |
|
87 | + $insert .= '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=myblocksadmin\'>'.$blocksadmin_title.'</a><br>'."\n"; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | // insert tplsadmin |
91 | 91 | |
92 | 92 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
93 | 93 | |
94 | - [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM ' . $db->prefix('tplfile') . " WHERE tpl_module='$dirname'")); |
|
94 | + [$count] = $db->fetchRow($db->query('SELECT COUNT(*) FROM '.$db->prefix('tplfile')." WHERE tpl_module='$dirname'")); |
|
95 | 95 | |
96 | 96 | if ($count > 0) { |
97 | 97 | $tplsadmin_title = defined('_MD_A_MYMENU_MYTPLSADMIN') ? _MD_A_MYMENU_MYTPLSADMIN : 'tplsadmin'; |
98 | 98 | |
99 | - $insert = '<img src=\'' . XOOPS_URL . '/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\'' . XOOPS_URL . '/modules/' . $dirname . '/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin\'>' . $tplsadmin_title . '</a><br>' . "\n" . $insert; |
|
99 | + $insert = '<img src=\''.XOOPS_URL.'/images/pointer.gif\' width=\'8\' height=\'8\' alt=\'\'> <a href=\''.XOOPS_URL.'/modules/'.$dirname.'/admin/index.php?mode=admin&lib=altsys&page=mytplsadmin\'>'.$tplsadmin_title.'</a><br>'."\n".$insert; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | // do insertion |
103 | 103 | |
104 | - $xoops_admin_menu_dv = preg_replace('#' . preg_quote($anchor) . '#', $anchor . $insert, $xoops_admin_menu_dv); |
|
104 | + $xoops_admin_menu_dv = preg_replace('#'.preg_quote($anchor).'#', $anchor.$insert, $xoops_admin_menu_dv); |
|
105 | 105 | |
106 | 106 | // write back |
107 | 107 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | 'xoops_admin_menu_sd' => $xoops_admin_menu_sd, |
112 | 112 | 'xoops_admin_menu_ft' => $xoops_admin_menu_ft, |
113 | 113 | 'xoops_admin_menu_dv' => $xoops_admin_menu_dv, |
114 | - 'altsys_adminmenu_ft_hacked' => (int) (@$altsys_adminmenu_ft_hacked), |
|
114 | + 'altsys_adminmenu_ft_hacked' => (int)(@$altsys_adminmenu_ft_hacked), |
|
115 | 115 | 'altsys_adminmenu_dv_updated' => true, |
116 | 116 | ]); |
117 | 117 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | // read |
146 | 146 | |
147 | 147 | if (!is_file(ALTSYS_ADMINMENU_FILE)) { |
148 | - redirect_header(XOOPS_URL . '/admin.php', 1, 'Rebuild adminmenu'); |
|
148 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
149 | 149 | |
150 | 150 | exit; |
151 | 151 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | |
166 | 166 | // rebuild adminmenu |
167 | 167 | |
168 | - require_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
|
168 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
169 | 169 | |
170 | 170 | xoops_module_write_admin_menu(xoops_module_get_admin_menu()); |
171 | 171 | |
@@ -197,11 +197,11 @@ discard block |
||
197 | 197 | foreach ($mids as $mid) { |
198 | 198 | $module = $moduleHandler->get($mid); |
199 | 199 | |
200 | - $new_menu_ft = preg_replace('#' . preg_quote($search) . '#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]); |
|
200 | + $new_menu_ft = preg_replace('#'.preg_quote($search).'#', sprintf($replace_fmt, $module->getVar('name')), $xoops_admin_menu_ft[$mid]); |
|
201 | 201 | |
202 | 202 | if ($is_left) { |
203 | 203 | if ($mid == $last_mid) { |
204 | - $xoops_admin_menu_ft[$mid] = $new_menu_ft . '</td><td>'; |
|
204 | + $xoops_admin_menu_ft[$mid] = $new_menu_ft.'</td><td>'; |
|
205 | 205 | } else { |
206 | 206 | $left_body = $new_menu_ft; |
207 | 207 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',85);', $xoops_admin_menu_ml[$mid]); |
211 | 211 | } |
212 | 212 | } else { |
213 | - $xoops_admin_menu_ft[$mid] = $left_body . '</td><td>' . $new_menu_ft; |
|
213 | + $xoops_admin_menu_ft[$mid] = $left_body.'</td><td>'.$new_menu_ft; |
|
214 | 214 | |
215 | 215 | unset($xoops_admin_menu_ft[$left_key]); |
216 | 216 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | // read |
238 | 238 | |
239 | 239 | if (!is_file(ALTSYS_ADMINMENU_FILE)) { |
240 | - redirect_header(XOOPS_URL . '/admin.php', 1, 'Rebuild adminmenu'); |
|
240 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
241 | 241 | |
242 | 242 | exit; |
243 | 243 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | // rebuild adminmenu |
259 | 259 | |
260 | - require_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
|
260 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
261 | 261 | |
262 | 262 | xoops_module_write_admin_menu(xoops_module_get_admin_menu()); |
263 | 263 | |
@@ -281,9 +281,9 @@ discard block |
||
281 | 281 | foreach ($mids as $mid) { |
282 | 282 | $module = $moduleHandler->get($mid); |
283 | 283 | |
284 | - $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name') . '</a>', $xoops_admin_menu_ft[$mid]); |
|
284 | + $xoops_admin_menu_ft[$mid] = preg_replace('/\<img src\=.*$/', $module->getVar('name').'</a>', $xoops_admin_menu_ft[$mid]); |
|
285 | 285 | |
286 | - $xoops_admin_menu_ft[$mid] = '<div style="text-align:' . _GLOBAL_LEFT . ';background-color:#CCC;" title="' . $module->getVar('dirname') . '">' . $xoops_admin_menu_ft[$mid] . '</div>'; |
|
286 | + $xoops_admin_menu_ft[$mid] = '<div style="text-align:'._GLOBAL_LEFT.';background-color:#CCC;" title="'.$module->getVar('dirname').'">'.$xoops_admin_menu_ft[$mid].'</div>'; |
|
287 | 287 | |
288 | 288 | $xoops_admin_menu_ml[$mid] = str_replace(',105);', ',45);', $xoops_admin_menu_ml[$mid]); |
289 | 289 | } |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | // read |
306 | 306 | |
307 | 307 | if (!is_file(ALTSYS_ADMINMENU_FILE)) { |
308 | - redirect_header(XOOPS_URL . '/admin.php', 1, 'Rebuild adminmenu'); |
|
308 | + redirect_header(XOOPS_URL.'/admin.php', 1, 'Rebuild adminmenu'); |
|
309 | 309 | |
310 | 310 | exit; |
311 | 311 | } |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | // rebuild adminmenu |
327 | 327 | |
328 | - require_once XOOPS_ROOT_PATH . '/include/cp_functions.php'; |
|
328 | + require_once XOOPS_ROOT_PATH.'/include/cp_functions.php'; |
|
329 | 329 | |
330 | 330 | $fp = fopen(ALTSYS_ADMINMENU_FILE, 'wb'); |
331 | 331 | |
@@ -358,10 +358,10 @@ discard block |
||
358 | 358 | if (preg_match('/popUpL\d+/', $xoops_admin_menu_ft[$mid], $regs)) { |
359 | 359 | $popup = $regs[0]; |
360 | 360 | |
361 | - preg_match_all('#\<a href.*' . $popup . '\(\).*\</a>#U', $xoops_admin_menu_dv, $regs); |
|
361 | + preg_match_all('#\<a href.*'.$popup.'\(\).*\</a>#U', $xoops_admin_menu_dv, $regs); |
|
362 | 362 | |
363 | 363 | foreach ($regs[0] as $submenuitem) { |
364 | - $submenuitems[] = str_replace($popup . '();', '', $submenuitem); |
|
364 | + $submenuitems[] = str_replace($popup.'();', '', $submenuitem); |
|
365 | 365 | } |
366 | 366 | } else { |
367 | 367 | return; |
@@ -370,14 +370,14 @@ discard block |
||
370 | 370 | // module icon |
371 | 371 | |
372 | 372 | if (preg_match('#\<img .*/\>#U', $xoops_admin_menu_ft[$mid], $regs)) { |
373 | - $icon_img = str_replace("alt=''", 'alt="' . $module->getVar('name') . '"', $regs[0]); |
|
373 | + $icon_img = str_replace("alt=''", 'alt="'.$module->getVar('name').'"', $regs[0]); |
|
374 | 374 | } else { |
375 | 375 | $icon_img = ''; |
376 | 376 | } |
377 | 377 | |
378 | 378 | // version number |
379 | 379 | |
380 | - $icon_img .= '<span class="version" style="">' . sprintf('%.2f', $module->getVar('version') / 100.0) . '</span>'; |
|
380 | + $icon_img .= '<span class="version" style="">'.sprintf('%.2f', $module->getVar('version') / 100.0).'</span>'; |
|
381 | 381 | |
382 | 382 | $newline = preg_replace('/ onmouseover.*$/', '', $xoops_admin_menu_ft[$mid]); |
383 | 383 | |
@@ -403,10 +403,10 @@ discard block |
||
403 | 403 | . '" style="display:none;"><ul>'; |
404 | 404 | |
405 | 405 | foreach ($submenuitems as $submenuitem) { |
406 | - $newline .= '<li>' . $submenuitem . '</li>'; |
|
406 | + $newline .= '<li>'.$submenuitem.'</li>'; |
|
407 | 407 | } |
408 | 408 | |
409 | - $newline .= '</ul>' . $icon_img . '</div>'; |
|
409 | + $newline .= '</ul>'.$icon_img.'</div>'; |
|
410 | 410 | |
411 | 411 | $xoops_admin_menu_ft[$mid] = $newline; |
412 | 412 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | echo "<?php\n// modified by altsys\nif( ! defined('XOOPS_ROOT_PATH') ) exit ;\n"; |
452 | 452 | |
453 | 453 | foreach ($xoops_admin_vars as $key => $val) { |
454 | - echo '$' . $key . " = \n"; |
|
454 | + echo '$'.$key." = \n"; |
|
455 | 455 | |
456 | 456 | @var_export($val); |
457 | 457 |