@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return $default; |
104 | 104 | } |
105 | 105 | |
106 | - $this->addLog("Getting config '{$name}' : " . $this->serializeForHelperLog($this->configs[$name])); |
|
106 | + $this->addLog("Getting config '{$name}' : ".$this->serializeForHelperLog($this->configs[$name])); |
|
107 | 107 | |
108 | 108 | return $this->configs[$name]; |
109 | 109 | } |
@@ -183,15 +183,15 @@ discard block |
||
183 | 183 | */ |
184 | 184 | protected function initHandler($name) |
185 | 185 | { |
186 | - $this->addLog('INIT ' . $name . ' HANDLER'); |
|
186 | + $this->addLog('INIT '.$name.' HANDLER'); |
|
187 | 187 | |
188 | 188 | if (!isset($this->handlers[$name])) { |
189 | - $hnd_file = XOOPS_ROOT_PATH . "/modules/{$this->dirname}/class/{$name}.php"; |
|
189 | + $hnd_file = XOOPS_ROOT_PATH."/modules/{$this->dirname}/class/{$name}.php"; |
|
190 | 190 | if (file_exists($hnd_file)) { |
191 | 191 | include_once $hnd_file; |
192 | 192 | } |
193 | 193 | $class = ucfirst(strtolower($this->dirname)) |
194 | - . ucfirst(strtolower($name)) . 'Handler'; |
|
194 | + . ucfirst(strtolower($name)).'Handler'; |
|
195 | 195 | if (class_exists($class)) { |
196 | 196 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
197 | 197 | $this->handlers[$name] = new $class($db); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | */ |
255 | 255 | public function url($url = '') |
256 | 256 | { |
257 | - return XOOPS_URL . '/modules/' . $this->dirname . '/' . $url; |
|
257 | + return XOOPS_URL.'/modules/'.$this->dirname.'/'.$url; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function path($path = '') |
268 | 268 | { |
269 | - return XOOPS_ROOT_PATH . '/modules/' . $this->dirname . '/' . $path; |
|
269 | + return XOOPS_ROOT_PATH.'/modules/'.$this->dirname.'/'.$path; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | **/ |
66 | 66 | public function checkPermission($gperm_name, $gperm_itemid, $trueifadmin = true) |
67 | 67 | { |
68 | - $gperm_itemid = (int) $gperm_itemid; |
|
68 | + $gperm_itemid = (int)$gperm_itemid; |
|
69 | 69 | $gperm_groupid = $this->getUserGroups(); |
70 | 70 | |
71 | 71 | return $this->permissionHandler->checkRight( |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $gperm_itemid, |
74 | 74 | $gperm_groupid, |
75 | 75 | $this->mid, |
76 | - (bool) $trueifadmin |
|
76 | + (bool)$trueifadmin |
|
77 | 77 | ); |
78 | 78 | } |
79 | 79 | |
@@ -97,14 +97,14 @@ discard block |
||
97 | 97 | $message = '', |
98 | 98 | $trueifadmin = true |
99 | 99 | ) { |
100 | - $gperm_itemid = (int) $gperm_itemid; |
|
100 | + $gperm_itemid = (int)$gperm_itemid; |
|
101 | 101 | $gperm_groupid = $this->getUserGroups(); |
102 | 102 | $permission = $this->permissionHandler->checkRight( |
103 | 103 | $gperm_name, |
104 | 104 | $gperm_itemid, |
105 | 105 | $gperm_groupid, |
106 | 106 | $this->mid, |
107 | - (bool) $trueifadmin |
|
107 | + (bool)$trueifadmin |
|
108 | 108 | ); |
109 | 109 | if (!$permission) { |
110 | 110 | $helper = Helper::getHelper($this->dirname); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | **/ |
123 | 123 | public function getGroupsForItem($gperm_name, $gperm_itemid) |
124 | 124 | { |
125 | - $gperm_itemid = (int) $gperm_itemid; |
|
125 | + $gperm_itemid = (int)$gperm_itemid; |
|
126 | 126 | return $this->permissionHandler->getGroupIds($gperm_name, $gperm_itemid, $this->mid); |
127 | 127 | } |
128 | 128 | |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | **/ |
138 | 138 | public function savePermissionForItem($gperm_name, $gperm_itemid, $groups) |
139 | 139 | { |
140 | - $gperm_itemid = (int) $gperm_itemid; |
|
140 | + $gperm_itemid = (int)$gperm_itemid; |
|
141 | 141 | foreach ($groups as $index => $group) { |
142 | - $groups[$index] = (int) $group; |
|
142 | + $groups[$index] = (int)$group; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | $result = true; |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public function deletePermissionForItem($gperm_name, $gperm_itemid) |
174 | 174 | { |
175 | - $gperm_itemid = (int) $gperm_itemid; |
|
175 | + $gperm_itemid = (int)$gperm_itemid; |
|
176 | 176 | if (!is_array($gperm_name)) { |
177 | - $gperm_name = (array) $gperm_name; |
|
177 | + $gperm_name = (array)$gperm_name; |
|
178 | 178 | } |
179 | 179 | $return = true; |
180 | 180 | foreach ($gperm_name as $pname) { |
@@ -208,12 +208,12 @@ discard block |
||
208 | 208 | $multiple = true |
209 | 209 | ) { |
210 | 210 | if (!class_exists('XoopsFormSelectGroup', true)) { |
211 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
211 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
212 | 212 | } |
213 | 213 | if (empty($name)) { |
214 | 214 | $name = $this->defaultFieldName($gperm_name, $gperm_itemid); |
215 | 215 | } |
216 | - $gperm_itemid = (int) $gperm_itemid; |
|
216 | + $gperm_itemid = (int)$gperm_itemid; |
|
217 | 217 | $value = $this->getGroupsForItem($gperm_name, $gperm_itemid); |
218 | 218 | $element = new \XoopsFormSelectGroup( |
219 | 219 | $caption, |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function defaultFieldName($gperm_name, $gperm_itemid) |
240 | 240 | { |
241 | - $gperm_itemid = (int) $gperm_itemid; |
|
242 | - $name = $this->module->getVar('dirname') . '_' . |
|
243 | - $gperm_name . '_' . $gperm_itemid; |
|
241 | + $gperm_itemid = (int)$gperm_itemid; |
|
242 | + $name = $this->module->getVar('dirname').'_'. |
|
243 | + $gperm_name.'_'.$gperm_itemid; |
|
244 | 244 | |
245 | 245 | return $name; |
246 | 246 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | public function setDebug($bool = true) |
92 | 92 | { |
93 | - $this->debug = (bool) $bool; |
|
93 | + $this->debug = (bool)$bool; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -127,6 +127,6 @@ discard block |
||
127 | 127 | if (!is_string($value)) { |
128 | 128 | $value = json_encode($value); |
129 | 129 | } |
130 | - return (string) $value; |
|
130 | + return (string)$value; |
|
131 | 131 | } |
132 | 132 | } |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public function addConfigError($value = '') |
278 | 278 | { |
279 | - $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/'; |
|
279 | + $path = XOOPS_URL.'/Frameworks/moduleclasses/icons/16/'; |
|
280 | 280 | $line = ""; |
281 | 281 | $line .= "<span style='color : red; font-weight : bold;'>"; |
282 | - $line .= "<img src='" . $path . "0.png' >"; |
|
282 | + $line .= "<img src='".$path."0.png' >"; |
|
283 | 283 | $line .= $value; |
284 | 284 | $line .= "</span>"; |
285 | 285 | $value = $line; |
@@ -297,10 +297,10 @@ discard block |
||
297 | 297 | */ |
298 | 298 | public function addConfigAccept($value = '') |
299 | 299 | { |
300 | - $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/'; |
|
300 | + $path = XOOPS_URL.'/Frameworks/moduleclasses/icons/16/'; |
|
301 | 301 | $line = ""; |
302 | 302 | $line .= "<span style='color : green;'>"; |
303 | - $line .= "<img src='" . $path . "1.png' >"; |
|
303 | + $line .= "<img src='".$path."1.png' >"; |
|
304 | 304 | $line .= $value; |
305 | 305 | $line .= "</span>"; |
306 | 306 | $value = $line; |
@@ -318,10 +318,10 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function addConfigWarning($value = '') |
320 | 320 | { |
321 | - $path = XOOPS_URL . '/Frameworks/moduleclasses/icons/16/'; |
|
321 | + $path = XOOPS_URL.'/Frameworks/moduleclasses/icons/16/'; |
|
322 | 322 | $line = ""; |
323 | 323 | $line .= "<span style='color : orange; font-weight : bold;'>"; |
324 | - $line .= "<img src='" . $path . "warning.png' >"; |
|
324 | + $line .= "<img src='".$path."warning.png' >"; |
|
325 | 325 | $line .= $value; |
326 | 326 | $line .= "</span>"; |
327 | 327 | $value = $line; |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | } else { |
404 | 404 | $path = '../../Frameworks/moduleclasses/icons/32/'; |
405 | 405 | |
406 | - return($path . $image); |
|
406 | + return($path.$image); |
|
407 | 407 | } |
408 | 408 | } |
409 | 409 | |
@@ -439,12 +439,12 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | if (static::isXng()) { |
442 | - $path = '/media/xoops/images/icons/' . $path; |
|
442 | + $path = '/media/xoops/images/icons/'.$path; |
|
443 | 443 | } else { |
444 | - $path = '/Frameworks/moduleclasses/icons/' . $path; |
|
444 | + $path = '/Frameworks/moduleclasses/icons/'.$path; |
|
445 | 445 | } |
446 | 446 | |
447 | - return(XOOPS_URL . $path . $name); |
|
447 | + return(XOOPS_URL.$path.$name); |
|
448 | 448 | } |
449 | 449 | |
450 | 450 | /** |
@@ -134,7 +134,7 @@ |
||
134 | 134 | { |
135 | 135 | try { |
136 | 136 | $yamlString = VendorYaml::dump($var, $inline, $indent); |
137 | - $ret = empty($yamlString) ? false : "<?php\n/*\n---\n" . $yamlString . "\n...\n*/\n"; |
|
137 | + $ret = empty($yamlString) ? false : "<?php\n/*\n---\n".$yamlString."\n...\n*/\n"; |
|
138 | 138 | } catch (\Exception $e) { |
139 | 139 | static::logError($e); |
140 | 140 | $ret = false; |
@@ -57,7 +57,7 @@ |
||
57 | 57 | */ |
58 | 58 | protected function fileName($name) |
59 | 59 | { |
60 | - return $this->storagePath . "/{$this->systemSecret}-key-{$name}.php"; |
|
60 | + return $this->storagePath."/{$this->systemSecret}-key-{$name}.php"; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function getSigning() |
36 | 36 | { |
37 | - return (string) $this->storage->fetch($this->name); |
|
37 | + return (string)$this->storage->fetch($this->name); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getVerifying() |
46 | 46 | { |
47 | - return (string) $this->storage->fetch($this->name); |
|
47 | + return (string)$this->storage->fetch($this->name); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $count = 0; |
48 | 48 | |
49 | 49 | foreach ($data as $row) { |
50 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
50 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
51 | 51 | $valueClause = ' VALUES ('; |
52 | 52 | $first = true; |
53 | 53 | foreach ($row as $column => $value) { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $valueClause .= $db->quote($value); |
63 | 63 | } |
64 | 64 | |
65 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
65 | + $sql = $insertInto.') '.$valueClause.')'; |
|
66 | 66 | |
67 | 67 | $result = $db->queryF($sql); |
68 | 68 | if (false !== $result) { |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
107 | 107 | |
108 | 108 | $prefixedTable = $db->prefix($table); |
109 | - $sql = 'TRUNCATE TABLE ' . $prefixedTable; |
|
109 | + $sql = 'TRUNCATE TABLE '.$prefixedTable; |
|
110 | 110 | $result = $db->queryF($sql); |
111 | 111 | if (false !== $result) { |
112 | 112 | $result = $db->getAffectedRows(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
129 | 129 | |
130 | 130 | $prefixedTable = $db->prefix($table); |
131 | - $sql = 'SELECT COUNT(*) as count FROM ' . $prefixedTable . ' '; |
|
131 | + $sql = 'SELECT COUNT(*) as count FROM '.$prefixedTable.' '; |
|
132 | 132 | if (isset($criteria) && is_subclass_of($criteria, '\CriteriaElement')) { |
133 | 133 | /* @var $criteria \CriteriaCompo */ |
134 | 134 | $sql .= $criteria->renderWhere(); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
156 | 156 | |
157 | 157 | $prefixedTable = $db->prefix($table); |
158 | - $sql = 'SELECT * FROM ' . $prefixedTable . ' '; |
|
158 | + $sql = 'SELECT * FROM '.$prefixedTable.' '; |
|
159 | 159 | if (isset($criteria) && is_subclass_of($criteria, '\CriteriaElement')) { |
160 | 160 | /* @var $criteria \CriteriaCompo */ |
161 | 161 | $sql .= $criteria->renderWhere(); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | if (isset($this->tables[$table])) { |
182 | 182 | if (isset($this->tables[$table]['create']) && $this->tables[$table]['create']) { |
183 | 183 | $this->tables[$table]['keys'][$name]['columns'] = $columnList; |
184 | - $this->tables[$table]['keys'][$name]['unique'] = (bool) $unique; |
|
184 | + $this->tables[$table]['keys'][$name]['unique'] = (bool)$unique; |
|
185 | 185 | } else { |
186 | 186 | $add = ($unique ? 'ADD UNIQUE INDEX' : 'ADD INDEX'); |
187 | 187 | $this->queue[] = "ALTER TABLE `{$this->tables[$table]['name']}` {$add} `{$name}` ({$columnList})"; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | return true; |
325 | 325 | } else { |
326 | - $this->queue[] = "ALTER TABLE `{$tableDef['name']}` " . |
|
326 | + $this->queue[] = "ALTER TABLE `{$tableDef['name']}` ". |
|
327 | 327 | "CHANGE COLUMN `{$column}` `{$newName}` {$attributes} "; |
328 | 328 | // loop thru and find the column |
329 | 329 | foreach ($tableDef['columns'] as &$col) { |
@@ -795,8 +795,8 @@ discard block |
||
795 | 795 | $sql = 'SELECT TABLE_NAME, ENGINE, CHARACTER_SET_NAME '; |
796 | 796 | $sql .= ' FROM `INFORMATION_SCHEMA`.`TABLES` t, '; |
797 | 797 | $sql .= ' `INFORMATION_SCHEMA`.`COLLATIONS` c '; |
798 | - $sql .= ' WHERE t.TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
799 | - $sql .= ' AND t.TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
798 | + $sql .= ' WHERE t.TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
799 | + $sql .= ' AND t.TABLE_NAME = \''.$this->name($table).'\' '; |
|
800 | 800 | $sql .= ' AND t.TABLE_COLLATION = c.COLLATION_NAME '; |
801 | 801 | |
802 | 802 | $result = $this->execSql($sql); |
@@ -808,21 +808,21 @@ discard block |
||
808 | 808 | return true; |
809 | 809 | } |
810 | 810 | $tableDef['name'] = $tableSchema['TABLE_NAME']; |
811 | - $tableDef['options'] = 'ENGINE=' . $tableSchema['ENGINE'] . ' ' |
|
812 | - . 'DEFAULT CHARSET=' . $tableSchema['CHARACTER_SET_NAME']; |
|
811 | + $tableDef['options'] = 'ENGINE='.$tableSchema['ENGINE'].' ' |
|
812 | + . 'DEFAULT CHARSET='.$tableSchema['CHARACTER_SET_NAME']; |
|
813 | 813 | |
814 | 814 | $sql = 'SELECT * '; |
815 | 815 | $sql .= ' FROM `INFORMATION_SCHEMA`.`COLUMNS` '; |
816 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
817 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
816 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
817 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
818 | 818 | $sql .= ' ORDER BY `ORDINAL_POSITION` '; |
819 | 819 | |
820 | 820 | $result = $this->execSql($sql); |
821 | 821 | |
822 | 822 | while ($column = $this->fetch($result)) { |
823 | - $attributes = ' ' . $column['COLUMN_TYPE'] . ' ' |
|
823 | + $attributes = ' '.$column['COLUMN_TYPE'].' ' |
|
824 | 824 | . (($column['IS_NULLABLE'] === 'NO') ? ' NOT NULL ' : '') |
825 | - . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '" . $column['COLUMN_DEFAULT'] . "' ") |
|
825 | + . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '".$column['COLUMN_DEFAULT']."' ") |
|
826 | 826 | . $column['EXTRA']; |
827 | 827 | |
828 | 828 | $columnDef = array( |
@@ -836,8 +836,8 @@ discard block |
||
836 | 836 | $sql = 'SELECT `INDEX_NAME`, `SEQ_IN_INDEX`, `NON_UNIQUE`, '; |
837 | 837 | $sql .= ' `COLUMN_NAME`, `SUB_PART` '; |
838 | 838 | $sql .= ' FROM `INFORMATION_SCHEMA`.`STATISTICS` '; |
839 | - $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' '; |
|
840 | - $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' '; |
|
839 | + $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' '; |
|
840 | + $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' '; |
|
841 | 841 | $sql .= ' ORDER BY `INDEX_NAME`, `SEQ_IN_INDEX` '; |
842 | 842 | |
843 | 843 | $result = $this->execSql($sql); |
@@ -854,13 +854,13 @@ discard block |
||
854 | 854 | $lastKey = $key['INDEX_NAME']; |
855 | 855 | $keyCols = $key['COLUMN_NAME']; |
856 | 856 | if (!empty($key['SUB_PART'])) { |
857 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
857 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
858 | 858 | } |
859 | 859 | $keyUnique = !$key['NON_UNIQUE']; |
860 | 860 | } else { |
861 | - $keyCols .= ', ' . $key['COLUMN_NAME']; |
|
861 | + $keyCols .= ', '.$key['COLUMN_NAME']; |
|
862 | 862 | if (!empty($key['SUB_PART'])) { |
863 | - $keyCols .= ' (' . $key['SUB_PART'] . ')'; |
|
863 | + $keyCols .= ' ('.$key['SUB_PART'].')'; |
|
864 | 864 | } |
865 | 865 | } |
866 | 866 | }; |