@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | if (is_array($groupid)) { |
183 | 183 | if (count($groupid) > 1) { |
184 | - $in=array(); |
|
184 | + $in = array(); |
|
185 | 185 | foreach ($groupid as $gid) { |
186 | 186 | $in[] = $qb->createNamedParameter($gid, \PDO::PARAM_INT); |
187 | 187 | } |
@@ -194,9 +194,9 @@ discard block |
||
194 | 194 | if (isset($side)) { |
195 | 195 | // get both sides in sidebox? (some themes need this) |
196 | 196 | if ($side == XOOPS_SIDEBLOCK_BOTH) { |
197 | - $qb->andWhere($eb->in('b.side', array(0,1))); |
|
197 | + $qb->andWhere($eb->in('b.side', array(0, 1))); |
|
198 | 198 | } elseif ($side == XOOPS_CENTERBLOCK_ALL) { |
199 | - $qb->andWhere($eb->in('b.side', array(3,4,5,7,8,9))); |
|
199 | + $qb->andWhere($eb->in('b.side', array(3, 4, 5, 7, 8, 9))); |
|
200 | 200 | } else { |
201 | 201 | $qb->andWhere($eb->eq('b.side', $qb->createNamedParameter($side, \PDO::PARAM_INT))); |
202 | 202 | } |
@@ -247,9 +247,9 @@ discard block |
||
247 | 247 | if (isset($side)) { |
248 | 248 | // get both sides in sidebox? (some themes need this) |
249 | 249 | if ($side == XOOPS_SIDEBLOCK_BOTH) { |
250 | - $qb->andWhere($eb->in('side', array(0,1))); |
|
250 | + $qb->andWhere($eb->in('side', array(0, 1))); |
|
251 | 251 | } elseif ($side == XOOPS_CENTERBLOCK_ALL) { |
252 | - $qb->andWhere($eb->in('side', array(3,4,5,7,8,9))); |
|
252 | + $qb->andWhere($eb->in('side', array(3, 4, 5, 7, 8, 9))); |
|
253 | 253 | } else { |
254 | 254 | $qb->andWhere($eb->eq('side', $qb->createNamedParameter($side, \PDO::PARAM_INT))); |
255 | 255 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $qb = $this->db2->createXoopsQueryBuilder(); |
347 | 347 | $eb = $qb->expr(); |
348 | 348 | |
349 | - $blockids=null; |
|
349 | + $blockids = null; |
|
350 | 350 | if (isset($groupid)) { |
351 | 351 | $qb ->select('DISTINCT gperm_itemid') |
352 | 352 | ->fromPrefix('system_permission', null) |
@@ -376,17 +376,17 @@ discard block |
||
376 | 376 | $qb ->fromPrefix('system_blockmodule', 'm') |
377 | 377 | ->andWhere($eb->eq('m.block_id', 'b.bid')); |
378 | 378 | if (!empty($module_id)) { |
379 | - $in=array(); |
|
380 | - $in[]=0; |
|
381 | - $in[]=(int)($module_id); |
|
379 | + $in = array(); |
|
380 | + $in[] = 0; |
|
381 | + $in[] = (int)($module_id); |
|
382 | 382 | if ($toponlyblock) { |
383 | - $in[]=(int)(-1); |
|
383 | + $in[] = (int)(-1); |
|
384 | 384 | } |
385 | 385 | } else { |
386 | 386 | if ($toponlyblock) { |
387 | - $in=array(0, -1); |
|
387 | + $in = array(0, -1); |
|
388 | 388 | } else { |
389 | - $in=0; |
|
389 | + $in = 0; |
|
390 | 390 | } |
391 | 391 | } |
392 | 392 | if (is_array($in)) { |
@@ -462,17 +462,17 @@ discard block |
||
462 | 462 | $qb ->fromPrefix('system_blockmodule', 'm') |
463 | 463 | ->andWhere($eb->eq('m.block_id', 'b.bid')); |
464 | 464 | if (!empty($module_id)) { |
465 | - $in=array(); |
|
466 | - $in[]=0; |
|
467 | - $in[]=(int)($module_id); |
|
465 | + $in = array(); |
|
466 | + $in[] = 0; |
|
467 | + $in[] = (int)($module_id); |
|
468 | 468 | if ($toponlyblock) { |
469 | - $in[]=(int)(-1); |
|
469 | + $in[] = (int)(-1); |
|
470 | 470 | } |
471 | 471 | } else { |
472 | 472 | if ($toponlyblock) { |
473 | - $in=array(0, -1); |
|
473 | + $in = array(0, -1); |
|
474 | 474 | } else { |
475 | - $in=0; |
|
475 | + $in = 0; |
|
476 | 476 | } |
477 | 477 | } |
478 | 478 | if (is_array($in)) { |
@@ -545,10 +545,10 @@ discard block |
||
545 | 545 | { |
546 | 546 | $ret = ''; |
547 | 547 | if ($position == 0) { |
548 | - $ret = $contentdb . $content; |
|
548 | + $ret = $contentdb.$content; |
|
549 | 549 | } else { |
550 | 550 | if ($position == 1) { |
551 | - $ret = $content . $contentdb; |
|
551 | + $ret = $content.$contentdb; |
|
552 | 552 | } |
553 | 553 | } |
554 | 554 | return $ret; |
@@ -20,20 +20,20 @@ discard block |
||
20 | 20 | * |
21 | 21 | * These will eventually be removed. See Xoops\Core\Kernel\Dtype for more. |
22 | 22 | */ |
23 | -define('XOBJ_DTYPE_TXTBOX', Dtype::TYPE_TEXT_BOX); |
|
23 | +define('XOBJ_DTYPE_TXTBOX', Dtype::TYPE_TEXT_BOX); |
|
24 | 24 | define('XOBJ_DTYPE_TXTAREA', Dtype::TYPE_TEXT_AREA); |
25 | -define('XOBJ_DTYPE_INT', Dtype::TYPE_INTEGER); |
|
26 | -define('XOBJ_DTYPE_URL', Dtype::TYPE_URL); |
|
27 | -define('XOBJ_DTYPE_EMAIL', Dtype::TYPE_EMAIL); |
|
28 | -define('XOBJ_DTYPE_ARRAY', Dtype::TYPE_ARRAY); |
|
29 | -define('XOBJ_DTYPE_OTHER', Dtype::TYPE_OTHER); |
|
30 | -define('XOBJ_DTYPE_SOURCE', Dtype::TYPE_SOURCE); |
|
31 | -define('XOBJ_DTYPE_STIME', Dtype::TYPE_SHORT_TIME); |
|
32 | -define('XOBJ_DTYPE_MTIME', Dtype::TYPE_MEDIUM_TIME); |
|
33 | -define('XOBJ_DTYPE_LTIME', Dtype::TYPE_LONG_TIME); |
|
34 | -define('XOBJ_DTYPE_FLOAT', Dtype::TYPE_FLOAT); |
|
25 | +define('XOBJ_DTYPE_INT', Dtype::TYPE_INTEGER); |
|
26 | +define('XOBJ_DTYPE_URL', Dtype::TYPE_URL); |
|
27 | +define('XOBJ_DTYPE_EMAIL', Dtype::TYPE_EMAIL); |
|
28 | +define('XOBJ_DTYPE_ARRAY', Dtype::TYPE_ARRAY); |
|
29 | +define('XOBJ_DTYPE_OTHER', Dtype::TYPE_OTHER); |
|
30 | +define('XOBJ_DTYPE_SOURCE', Dtype::TYPE_SOURCE); |
|
31 | +define('XOBJ_DTYPE_STIME', Dtype::TYPE_SHORT_TIME); |
|
32 | +define('XOBJ_DTYPE_MTIME', Dtype::TYPE_MEDIUM_TIME); |
|
33 | +define('XOBJ_DTYPE_LTIME', Dtype::TYPE_LONG_TIME); |
|
34 | +define('XOBJ_DTYPE_FLOAT', Dtype::TYPE_FLOAT); |
|
35 | 35 | define('XOBJ_DTYPE_DECIMAL', Dtype::TYPE_DECIMAL); |
36 | -define('XOBJ_DTYPE_ENUM', Dtype::TYPE_ENUM); |
|
36 | +define('XOBJ_DTYPE_ENUM', Dtype::TYPE_ENUM); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Base class for all objects in the Xoops kernel (and beyond) |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | $ret = '<h4>Errors</h4>'; |
440 | 440 | if (!empty($this->errors)) { |
441 | 441 | foreach ($this->errors as $error) { |
442 | - $ret .= $error . '<br />'; |
|
442 | + $ret .= $error.'<br />'; |
|
443 | 443 | } |
444 | 444 | } else { |
445 | 445 | $ret .= 'None<br />'; |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * format constants used for getVar() |
32 | 32 | */ |
33 | - const FORMAT_SHOW = 'show'; // shorthand 's' |
|
34 | - const FORMAT_EDIT = 'edit'; // shorthand 'e' |
|
35 | - const FORMAT_PREVIEW = 'preview'; // shorthand 'p' |
|
33 | + const FORMAT_SHOW = 'show'; // shorthand 's' |
|
34 | + const FORMAT_EDIT = 'edit'; // shorthand 'e' |
|
35 | + const FORMAT_PREVIEW = 'preview'; // shorthand 'p' |
|
36 | 36 | const FORMAT_FORM_PREVIEW = 'formpreview'; // shorthand 'f' |
37 | - const FORMAT_NONE = 'none'; // shorthand 'n' |
|
37 | + const FORMAT_NONE = 'none'; // shorthand 'n' |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Xoops object datatype |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $dtype = null; |
106 | 106 | if (!isset($dtypes[$name])) { |
107 | - $className = 'Xoops\Core\Kernel\Dtype\\' . $name; |
|
107 | + $className = 'Xoops\Core\Kernel\Dtype\\'.$name; |
|
108 | 108 | $dtype = new $className(); |
109 | 109 | if (!$dtype instanceof DtypeAbstract) { |
110 | 110 | trigger_error("Dtype '{$name}' not found", E_USER_WARNING); |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | if (!$render = $element->render()) { |
90 | 90 | continue; |
91 | 91 | } |
92 | - $ret .= ' ' . $this->conditions[$i] . ' (' . $render . ')'; |
|
92 | + $ret .= ' '.$this->conditions[$i].' ('.$render.')'; |
|
93 | 93 | } |
94 | 94 | $ret = "({$ret})"; |
95 | 95 | } |
96 | - $ret = ($ret==='()') ? '(1)' : $ret; |
|
96 | + $ret = ($ret === '()') ? '(1)' : $ret; |
|
97 | 97 | return $ret; |
98 | 98 | } |
99 | 99 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | public function renderWhere() |
106 | 106 | { |
107 | 107 | $ret = $this->render(); |
108 | - $ret = ($ret != '') ? 'WHERE ' . $ret : $ret; |
|
108 | + $ret = ($ret != '') ? 'WHERE '.$ret : $ret; |
|
109 | 109 | return $ret; |
110 | 110 | } |
111 | 111 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } else { |
126 | 126 | $cond = strtoupper($this->conditions[$i]); |
127 | 127 | $op = ($cond === "OR") ? "|" : "&"; |
128 | - $ret = "({$op}{$ret}" . $element->renderLdap() . ")"; |
|
128 | + $ret = "({$op}{$ret}".$element->renderLdap().")"; |
|
129 | 129 | } |
130 | 130 | } |
131 | 131 | return $ret; |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function renderQb(QueryBuilder $qb = null, $whereMode = '') |
144 | 144 | { |
145 | - if ($qb==null) { |
|
145 | + if ($qb == null) { |
|
146 | 146 | $qb = \Xoops::getInstance()->db()->createXoopsQueryBuilder(); |
147 | 147 | $whereMode = ''; // first entry in new instance must be where |
148 | 148 | } |
@@ -154,13 +154,13 @@ discard block |
||
154 | 154 | if ($i == 0) { |
155 | 155 | $expr = $expr_part; |
156 | 156 | } else { |
157 | - $expr .= ' ' . strtoupper($this->conditions[$i]) . ' ' . $expr_part; |
|
157 | + $expr .= ' '.strtoupper($this->conditions[$i]).' '.$expr_part; |
|
158 | 158 | } |
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | 162 | if (!empty($expr)) { |
163 | - $expr = '(' . $expr . ')'; // group all conditions in this compo |
|
163 | + $expr = '('.$expr.')'; // group all conditions in this compo |
|
164 | 164 | |
165 | 165 | switch (strtolower($whereMode)) { |
166 | 166 | case 'and': |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | } |
176 | 176 | } |
177 | 177 | |
178 | - if ($this->limit!=0 || $this->start!=0) { |
|
178 | + if ($this->limit != 0 || $this->start != 0) { |
|
179 | 179 | $qb->setFirstResult($this->start) |
180 | 180 | ->setMaxResults($this->limit); |
181 | 181 | } |
@@ -211,13 +211,13 @@ discard block |
||
211 | 211 | if ($i == 0) { |
212 | 212 | $expr = $expr_part; |
213 | 213 | } else { |
214 | - $expr .= ' ' . strtoupper($this->conditions[$i]) . ' ' . $expr_part; |
|
214 | + $expr .= ' '.strtoupper($this->conditions[$i]).' '.$expr_part; |
|
215 | 215 | } |
216 | 216 | } |
217 | 217 | } |
218 | 218 | |
219 | 219 | if (!empty($expr)) { |
220 | - $expr = '(' . $expr . ')'; // group all conditions in this compo |
|
220 | + $expr = '('.$expr.')'; // group all conditions in this compo |
|
221 | 221 | } |
222 | 222 | return $expr; |
223 | 223 | } |
@@ -58,10 +58,10 @@ |
||
58 | 58 | { |
59 | 59 | if (!isset(self::$handlers[$name])) { |
60 | 60 | $handler = null; |
61 | - $className = '\Xoops\Core\Kernel\Model\\' . ucfirst($name); |
|
61 | + $className = '\Xoops\Core\Kernel\Model\\'.ucfirst($name); |
|
62 | 62 | @$handler = new $className(); |
63 | 63 | if (!is_object($handler)) { |
64 | - trigger_error('Handler ' . $className . ' not found in file ' . __FILE__, E_USER_WARNING); |
|
64 | + trigger_error('Handler '.$className.' not found in file '.__FILE__, E_USER_WARNING); |
|
65 | 65 | return null; |
66 | 66 | } |
67 | 67 | self::$handlers[$name] = $handler; |
@@ -225,8 +225,8 @@ |
||
225 | 225 | // replace namespace separators with directory separators |
226 | 226 | // in the relative class name, append with .php |
227 | 227 | $file = $base_dir |
228 | - . str_replace('\\', '/', $relative_class) |
|
229 | - . '.php'; |
|
228 | + . str_replace('\\', '/', $relative_class) |
|
229 | + . '.php'; |
|
230 | 230 | |
231 | 231 | // if the mapped file exists, require it |
232 | 232 | if ($this->requireFile($file)) { |
@@ -147,11 +147,11 @@ |
||
147 | 147 | public function addNamespace($prefix, $base_dir, $prepend = false) |
148 | 148 | { |
149 | 149 | // normalize namespace prefix |
150 | - $prefix = trim($prefix, '\\') . '\\'; |
|
150 | + $prefix = trim($prefix, '\\').'\\'; |
|
151 | 151 | |
152 | 152 | // normalize the base directory with a trailing separator |
153 | - $base_dir = rtrim($base_dir, '/') . DIRECTORY_SEPARATOR; |
|
154 | - $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/'; |
|
153 | + $base_dir = rtrim($base_dir, '/').DIRECTORY_SEPARATOR; |
|
154 | + $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR).'/'; |
|
155 | 155 | |
156 | 156 | // initialize the namespace prefix array |
157 | 157 | if (isset($this->prefixes[$prefix]) === false) { |
@@ -179,11 +179,11 @@ |
||
179 | 179 | $this->namespaceSeparator, |
180 | 180 | DIRECTORY_SEPARATOR, |
181 | 181 | $namespace |
182 | - ) . DIRECTORY_SEPARATOR; |
|
182 | + ).DIRECTORY_SEPARATOR; |
|
183 | 183 | } |
184 | - $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->fileExtension; |
|
184 | + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className).$this->fileExtension; |
|
185 | 185 | |
186 | - $absolute = ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') . $fileName; |
|
186 | + $absolute = ($this->includePath !== null ? $this->includePath.DIRECTORY_SEPARATOR : '').$fileName; |
|
187 | 187 | if (file_exists($absolute)) { |
188 | 188 | require $absolute; |
189 | 189 | } |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $modules_list = \Xoops::getInstance()->getActiveModules(); |
102 | 102 | if (empty($modules_list)) { |
103 | 103 | // this should only happen if an exception was thrown in setActiveModules() |
104 | - $modules_list = array ('system'); |
|
104 | + $modules_list = array('system'); |
|
105 | 105 | } |
106 | - $this->preloadList =array(); |
|
106 | + $this->preloadList = array(); |
|
107 | 107 | $i = 0; |
108 | 108 | foreach ($modules_list as $module) { |
109 | - if (is_dir($dir = \XoopsBaseConfig::get('root-path') . "/modules/{$module}/preloads/")) { |
|
109 | + if (is_dir($dir = \XoopsBaseConfig::get('root-path')."/modules/{$module}/preloads/")) { |
|
110 | 110 | $file_list = Lists\File::getList($dir); |
111 | 111 | foreach ($file_list as $file) { |
112 | 112 | if (preg_match('/(\.php)$/i', $file)) { |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | { |
151 | 151 | $xoops = \Xoops::getInstance(); |
152 | 152 | foreach ($this->preloadList as $preload) { |
153 | - $path = $xoops->path('modules/' . $preload['module'] . '/preloads/' . $preload['file']. '.php'); |
|
153 | + $path = $xoops->path('modules/'.$preload['module'].'/preloads/'.$preload['file'].'.php'); |
|
154 | 154 | include_once $path; |
155 | 155 | $class_name = ucfirst($preload['module']) |
156 | - . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file']) ) |
|
156 | + . ($preload['file'] === 'preload' ? '' : ucfirst($preload['file'])) |
|
157 | 157 | . 'Preload'; |
158 | 158 | if (!class_exists($class_name)) { |
159 | 159 | continue; |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | public function addListener($eventName, $callback) |
216 | 216 | { |
217 | 217 | $eventName = $this->toInternalEventName($eventName); |
218 | - $this->eventListeners[$eventName][]=$callback; |
|
218 | + $this->eventListeners[$eventName][] = $callback; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
@@ -77,7 +77,7 @@ |
||
77 | 77 | } |
78 | 78 | $xoops->setConfig('theme_set', $options['folderName']); |
79 | 79 | } |
80 | - $options['path'] = \XoopsBaseConfig::get('themes-path') . '/' . $options['folderName']; |
|
80 | + $options['path'] = \XoopsBaseConfig::get('themes-path').'/'.$options['folderName']; |
|
81 | 81 | $inst = new XoopsTheme(); |
82 | 82 | foreach ($options as $k => $v) { |
83 | 83 | $inst->$k = $v; |