@@ -72,9 +72,9 @@ |
||
72 | 72 | $rows = $this->db2->updatePrefix( |
73 | 73 | 'system_online', |
74 | 74 | array( |
75 | - 'online_uname' => $uname, |
|
76 | - 'online_updated' => $time, |
|
77 | - 'online_module' => $module, |
|
75 | + 'online_uname' => $uname, |
|
76 | + 'online_updated' => $time, |
|
77 | + 'online_module' => $module, |
|
78 | 78 | ), |
79 | 79 | $criteria |
80 | 80 | ); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | if ($rows === false) { |
97 | 97 | return false; |
98 | 98 | } |
99 | - return ($rows>0); |
|
99 | + return ($rows > 0); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | return false; |
415 | 415 | } |
416 | 416 | $funcFile = $xoops->path( |
417 | - 'modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file') |
|
417 | + 'modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file') |
|
418 | 418 | ); |
419 | 419 | if (\XoopsLoad::fileExists($funcFile)) { |
420 | 420 | $xoops->loadLanguage('blocks', $this->getVar('dirname')); |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | } |
469 | 469 | if (!\XoopsLoad::fileExists( |
470 | 470 | $func_file = $xoops->path( |
471 | - 'modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file') |
|
471 | + 'modules/'.$this->getVar('dirname').'/blocks/'.$this->getVar('func_file') |
|
472 | 472 | ) |
473 | 473 | )) { |
474 | 474 | return false; |
@@ -346,14 +346,14 @@ discard block |
||
346 | 346 | $hash = $user[0]->pass(); |
347 | 347 | $type = substr($user[0]->pass(), 0, 1); |
348 | 348 | // see if we have a crypt like signature, old md5 hash is just hex digits |
349 | - if ($type==='$') { |
|
349 | + if ($type === '$') { |
|
350 | 350 | if (!password_verify($pwd, $hash)) { |
351 | 351 | return false; |
352 | 352 | } |
353 | 353 | // check if hash uses the best algorithm (i.e. after a PHP upgrade) |
354 | 354 | $rehash = password_needs_rehash($hash, PASSWORD_DEFAULT); |
355 | 355 | } else { |
356 | - if ($hash!=md5($pwd)) { |
|
356 | + if ($hash != md5($pwd)) { |
|
357 | 357 | return false; |
358 | 358 | } |
359 | 359 | $rehash = true; // automatically update old style |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | $qb = $this->userHandler->db2->createXoopsQueryBuilder(); |
461 | 461 | $eb = $qb->expr(); |
462 | 462 | |
463 | - $qb ->select('DISTINCT ' . ($asobject ? 'u.*' : 'u.uid')) |
|
463 | + $qb ->select('DISTINCT '.($asobject ? 'u.*' : 'u.uid')) |
|
464 | 464 | ->fromPrefix('system_user', 'u') |
465 | 465 | ->leftJoinPrefix('u', 'system_usergroup', 'm', 'm.uid = u.uid'); |
466 | 466 |
@@ -44,9 +44,9 @@ |
||
44 | 44 | */ |
45 | 45 | public $adminmenu; |
46 | 46 | /** |
47 | - * |
|
48 | - * @var array |
|
49 | - */ |
|
47 | + * |
|
48 | + * @var array |
|
49 | + */ |
|
50 | 50 | private $internalMessages = array(); |
51 | 51 | |
52 | 52 | protected $xoops_url; |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | $this->setVar('version', (int)(100 * ($this->modinfo['version'] + 0.001))); |
106 | 106 | $this->setVar('dirname', $this->modinfo['dirname']); |
107 | 107 | |
108 | - $this->setVar('hasmain', (bool) $modInfoArray->get('hasMain', false)); |
|
109 | - $this->setVar('hasadmin', (bool) $modInfoArray->get('hasAdmin', false)); |
|
110 | - $this->setVar('hassearch', (bool) $modInfoArray->get('hasSearch', false)); |
|
111 | - $this->setVar('hasconfig', ($modInfoArray->has('config') && is_array($modInfoArray->get('config'))) || (bool) $modInfoArray->get('hascomments', false)); |
|
112 | - $this->setVar('hascomments', (bool) $modInfoArray->get('hasComments', false)); |
|
113 | - $this->setVar('hasnotification', (bool) $modInfoArray->get('hasNotification', false)); |
|
108 | + $this->setVar('hasmain', (bool)$modInfoArray->get('hasMain', false)); |
|
109 | + $this->setVar('hasadmin', (bool)$modInfoArray->get('hasAdmin', false)); |
|
110 | + $this->setVar('hassearch', (bool)$modInfoArray->get('hasSearch', false)); |
|
111 | + $this->setVar('hasconfig', ($modInfoArray->has('config') && is_array($modInfoArray->get('config'))) || (bool)$modInfoArray->get('hascomments', false)); |
|
112 | + $this->setVar('hascomments', (bool)$modInfoArray->get('hasComments', false)); |
|
113 | + $this->setVar('hasnotification', (bool)$modInfoArray->get('hasNotification', false)); |
|
114 | 114 | $this->setVar('namespace', $modInfoArray->get('namespace')); |
115 | 115 | $this->setVar('category', $modInfoArray->get('category')); |
116 | 116 | } |
@@ -185,8 +185,8 @@ discard block |
||
185 | 185 | public function mainLink() |
186 | 186 | { |
187 | 187 | if ($this->getVar('hasmain') == 1) { |
188 | - $ret = '<a href="' . $this->xoops_url . '/modules/' . $this->getVar('dirname') . '/">' |
|
189 | - . $this->getVar('name') . '</a>'; |
|
188 | + $ret = '<a href="'.$this->xoops_url.'/modules/'.$this->getVar('dirname').'/">' |
|
189 | + . $this->getVar('name').'</a>'; |
|
190 | 190 | return $ret; |
191 | 191 | } |
192 | 192 | return false; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | if ($this->getInfo('sub') && is_array($this->getInfo('sub'))) { |
204 | 204 | foreach ($this->getInfo('sub') as $submenu) { |
205 | 205 | $ret[] = array( |
206 | - 'name' => $submenu['name'] , |
|
206 | + 'name' => $submenu['name'], |
|
207 | 207 | 'url' => $submenu['url']); |
208 | 208 | } |
209 | 209 | } |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function loadAdminMenu() |
219 | 219 | { |
220 | - $file = $this->xoops_root_path . '/modules/' . $this->getInfo('dirname') . '/' . $this->getInfo('adminmenu'); |
|
220 | + $file = $this->xoops_root_path.'/modules/'.$this->getInfo('dirname').'/'.$this->getInfo('adminmenu'); |
|
221 | 221 | if ($this->getInfo('adminmenu') && $this->getInfo('adminmenu') != '' && \XoopsLoad::fileExists($file)) { |
222 | 222 | $adminmenu = array(); |
223 | 223 | include $file; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $xoops->loadLanguage('modinfo', $dirname); |
265 | 265 | $xoops->loadLocale($dirname); |
266 | 266 | |
267 | - if (!\XoopsLoad::fileExists($file = $xoops->path('modules/' . $dirname . '/xoops_version.php'))) { |
|
267 | + if (!\XoopsLoad::fileExists($file = $xoops->path('modules/'.$dirname.'/xoops_version.php'))) { |
|
268 | 268 | if (false != $verbose) { |
269 | 269 | echo "Module File for $dirname Not Found!"; |
270 | 270 | } |
@@ -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) { |