@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function init() |
46 | 46 | { |
47 | - $this->prefix = 'module/' . $this->module->getVar('dirname'); |
|
47 | + $this->prefix = 'module/'.$this->module->getVar('dirname'); |
|
48 | 48 | $this->cache = \Xoops::getInstance()->cache(); |
49 | 49 | } |
50 | 50 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | protected function prefix($name) |
59 | 59 | { |
60 | - return $this->prefix . '/'. $name; |
|
60 | + return $this->prefix.'/'.$name; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -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 | /** |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | public static function getString($name, $default = '', $hash = 'default', $mask = 0) |
235 | 235 | { |
236 | 236 | // Cast to string, in case static::MASK_ALLOW_RAW was specified for mask |
237 | - return (string) static::getVar($name, $default, $hash, 'string', $mask); |
|
237 | + return (string)static::getVar($name, $default, $hash, 'string', $mask); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | */ |
263 | 263 | public static function getText($name, $default = '', $hash = 'default') |
264 | 264 | { |
265 | - return (string) static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
265 | + return (string)static::getVar($name, $default, $hash, 'string', static::MASK_ALLOW_RAW); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | /** |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | */ |
277 | 277 | public static function getUrl($name, $default = '', $hash = 'default') |
278 | 278 | { |
279 | - return (string) static::getVar($name, $default, $hash, 'weburl'); |
|
279 | + return (string)static::getVar($name, $default, $hash, 'weburl'); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | */ |
291 | 291 | public static function getPath($name, $default = '', $hash = 'default') |
292 | 292 | { |
293 | - return (string) static::getVar($name, $default, $hash, 'path'); |
|
293 | + return (string)static::getVar($name, $default, $hash, 'path'); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /** |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | */ |
305 | 305 | public static function getEmail($name, $default = '', $hash = 'default') |
306 | 306 | { |
307 | - $ret = (string) static::getVar($name, $default, $hash, 'email'); |
|
307 | + $ret = (string)static::getVar($name, $default, $hash, 'email'); |
|
308 | 308 | return empty($ret) ? $default : $ret; |
309 | 309 | } |
310 | 310 | |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | */ |
320 | 320 | public static function getIP($name, $default = '', $hash = 'default') |
321 | 321 | { |
322 | - $ret = (string) static::getVar($name, $default, $hash, 'ip'); |
|
322 | + $ret = (string)static::getVar($name, $default, $hash, 'ip'); |
|
323 | 323 | return empty($ret) ? $default : $ret; |
324 | 324 | } |
325 | 325 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public static function useEventDumper($value = true) |
128 | 128 | { |
129 | - self::$eventDumper = (bool) $value; |
|
129 | + self::$eventDumper = (bool)$value; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if ($events->hasListeners($eventName)) { |
175 | 175 | $events->triggerEvent($eventName, $name); |
176 | 176 | } else { |
177 | - echo $name . ' - ' . (int)(microtime(true) - self::$times[$name]) . " \n"; |
|
177 | + echo $name.' - '.(int)(microtime(true) - self::$times[$name])." \n"; |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | ini_set('xdebug.collect_params', $collect_params); |
256 | 256 | ini_set('xdebug.collect_return', $collect_return); |
257 | 257 | if ($tracefile == '') { |
258 | - $tracefile = \XoopsBaseConfig::get('var-path') . '/logs/php_trace'; |
|
258 | + $tracefile = \XoopsBaseConfig::get('var-path').'/logs/php_trace'; |
|
259 | 259 | } |
260 | 260 | xdebug_start_trace($tracefile); |
261 | 261 | } |
@@ -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; |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | |
142 | 142 | $this->paths['www'] = array($root, $url); |
143 | 143 | $this->paths['var'] = array($var, null); |
144 | - $this->paths['lib'] = array($lib, $url . '/browse.php'); |
|
145 | - $this->paths['XOOPS'] = array($lib, $url . '/browse.php'); |
|
144 | + $this->paths['lib'] = array($lib, $url.'/browse.php'); |
|
145 | + $this->paths['XOOPS'] = array($lib, $url.'/browse.php'); |
|
146 | 146 | $this->paths['assets'] = array(\XoopsBaseConfig::get('asset-path'), \XoopsBaseConfig::get('asset-url')); |
147 | - $this->paths['images'] = array($root . '/images', $url . '/images'); |
|
148 | - $this->paths['language'] = array($root . '/language', $url . '/language'); |
|
149 | - $this->paths['locale'] = array($root . '/locale', $url . '/locale'); |
|
147 | + $this->paths['images'] = array($root.'/images', $url.'/images'); |
|
148 | + $this->paths['language'] = array($root.'/language', $url.'/language'); |
|
149 | + $this->paths['locale'] = array($root.'/locale', $url.'/locale'); |
|
150 | 150 | $this->paths['media'] = array(\XoopsBaseConfig::get('media-path'), \XoopsBaseConfig::get('media-url')); |
151 | - $this->paths['modules'] = array($root . '/modules', $url . '/modules'); |
|
151 | + $this->paths['modules'] = array($root.'/modules', $url.'/modules'); |
|
152 | 152 | $this->paths['themes'] = array(\XoopsBaseConfig::get('themes-path'), \XoopsBaseConfig::get('themes-url')); |
153 | 153 | $this->paths['uploads'] = array(\XoopsBaseConfig::get('uploads-path'), \XoopsBaseConfig::get('uploads-url')); |
154 | 154 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | public function path($url, $virtual = false) |
372 | 372 | { |
373 | 373 | $url = $this->normalizePath($url); |
374 | - $rootPath = $this->normalizePath(\XoopsBaseConfig::get('root-path') . '/'); |
|
374 | + $rootPath = $this->normalizePath(\XoopsBaseConfig::get('root-path').'/'); |
|
375 | 375 | if (0 === strpos($url, $rootPath)) { |
376 | 376 | $url = substr($url, strlen($rootPath)); |
377 | 377 | } |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | list($root, $path) = array('www', $url); |
384 | 384 | } |
385 | 385 | if (!$virtual) { // Returns a physical path |
386 | - $path = $this->paths[$root][0] . '/' . $path; |
|
386 | + $path = $this->paths[$root][0].'/'.$path; |
|
387 | 387 | //$path = str_replace('/', DIRECTORY_SEPARATOR, $path); |
388 | 388 | return $path; |
389 | 389 | } |
390 | - return !isset($this->paths[$root][1]) ? '' : ($this->paths[$root][1] . '/' . $path); |
|
390 | + return !isset($this->paths[$root][1]) ? '' : ($this->paths[$root][1].'/'.$path); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | /** |
@@ -435,9 +435,9 @@ discard block |
||
435 | 435 | } |
436 | 436 | if (!empty($params)) { |
437 | 437 | foreach ($params as $k => $v) { |
438 | - $params[$k] = $k . '=' . rawurlencode($v); |
|
438 | + $params[$k] = $k.'='.rawurlencode($v); |
|
439 | 439 | } |
440 | - $url .= '?' . implode('&', $params); |
|
440 | + $url .= '?'.implode('&', $params); |
|
441 | 441 | } |
442 | 442 | return $url; |
443 | 443 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME']; |
519 | 519 | } |
520 | 520 | if (isset($_SERVER['QUERY_STRING'])) { |
521 | - $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; |
|
521 | + $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING']; |
|
522 | 522 | } |
523 | 523 | } |
524 | 524 | } |
@@ -558,18 +558,18 @@ discard block |
||
558 | 558 | if ($matched) { |
559 | 559 | $names = array('tpl_name', 'type', 'module', 'file'); |
560 | 560 | $ret = array(); |
561 | - for ($i=0; $i<4; ++$i) { |
|
561 | + for ($i = 0; $i < 4; ++$i) { |
|
562 | 562 | $ret[$names[$i]] = $parts[$i]; |
563 | 563 | } |
564 | 564 | } else { |
565 | 565 | // this should be eliminated |
566 | - $this->events()->triggerEvent('debug.log', "Sloppy template: " . $tpl_name); |
|
566 | + $this->events()->triggerEvent('debug.log', "Sloppy template: ".$tpl_name); |
|
567 | 567 | $ret = array(); |
568 | 568 | $ret['type'] = $this->isAdminSide ? 'admin' : 'module'; |
569 | 569 | $info = explode(':', $tpl_name); |
570 | 570 | if (count($info) == 2) { |
571 | 571 | $ret['type'] = $info[0]; |
572 | - $tpl_name = str_replace($ret['type'] . ':', '', $tpl_name); |
|
572 | + $tpl_name = str_replace($ret['type'].':', '', $tpl_name); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | if ($ret['type'] === 'db') { |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | $ret['module'] = $this->module->getVar('dirname', 'n'); |
589 | 589 | } |
590 | 590 | } |
591 | - $ret['tpl_name'] = $ret['type'] . ':' . $ret['module'] . '/' . $ret['file']; |
|
591 | + $ret['tpl_name'] = $ret['type'].':'.$ret['module'].'/'.$ret['file']; |
|
592 | 592 | } |
593 | 593 | |
594 | 594 | return $ret; |
@@ -633,8 +633,8 @@ discard block |
||
633 | 633 | $smarty = $repeat = null; |
634 | 634 | $this->theme()->headContent( |
635 | 635 | null, |
636 | - "<base href='" . \XoopsBaseConfig::get('url') . '/modules/' |
|
637 | - . $this->getConfig('startpage') . "/' />", |
|
636 | + "<base href='".\XoopsBaseConfig::get('url').'/modules/' |
|
637 | + . $this->getConfig('startpage')."/' />", |
|
638 | 638 | $smarty, |
639 | 639 | $repeat |
640 | 640 | ); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $this->events()->triggerEvent('core.footer.start'); |
682 | 682 | |
683 | 683 | if (!headers_sent()) { |
684 | - header('Content-Type:text/html; charset=' . XoopsLocale::getCharset()); |
|
684 | + header('Content-Type:text/html; charset='.XoopsLocale::getCharset()); |
|
685 | 685 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
686 | 686 | header('Cache-Control: private, no-cache'); |
687 | 687 | header('Pragma: no-cache'); |
@@ -1009,10 +1009,10 @@ discard block |
||
1009 | 1009 | } |
1010 | 1010 | } |
1011 | 1011 | if (XoopsLoad::fileExists( |
1012 | - $hnd_file = \XoopsBaseConfig::get('root-path') . "/modules/{$module_dir}/class/form/{$name}.php" |
|
1012 | + $hnd_file = \XoopsBaseConfig::get('root-path')."/modules/{$module_dir}/class/form/{$name}.php" |
|
1013 | 1013 | )) { |
1014 | 1014 | include_once $hnd_file; |
1015 | - $class = ucfirst(strtolower($module_dir)) . ucfirst($name) . 'Form'; |
|
1015 | + $class = ucfirst(strtolower($module_dir)).ucfirst($name).'Form'; |
|
1016 | 1016 | if (class_exists($class)) { |
1017 | 1017 | $instance = new $class($obj); |
1018 | 1018 | if ($instance instanceof \Xoops\Form\Form) { |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | if ((empty($domain) || 'global' === $domain)) { |
1059 | 1059 | $path = ''; |
1060 | 1060 | } else { |
1061 | - $path = (is_array($domain)) ? array_shift($domain) . '/' : "modules/{$domain}/"; |
|
1061 | + $path = (is_array($domain)) ? array_shift($domain).'/' : "modules/{$domain}/"; |
|
1062 | 1062 | } |
1063 | 1063 | $path .= 'language'; |
1064 | 1064 | |
@@ -1200,9 +1200,9 @@ discard block |
||
1200 | 1200 | $xoopsConfigMetaFooter = $this->getConfigs(); |
1201 | 1201 | |
1202 | 1202 | if (!headers_sent()) { |
1203 | - header('Content-Type:text/html; charset=' . XoopsLocale::getCharset()); |
|
1203 | + header('Content-Type:text/html; charset='.XoopsLocale::getCharset()); |
|
1204 | 1204 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
1205 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
1205 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
1206 | 1206 | header( |
1207 | 1207 | 'Cache-Control: no-store, no-cache, max-age=1, s-maxage=1, must-revalidate, post-check=0, pre-check=0' |
1208 | 1208 | ); |
@@ -1211,28 +1211,28 @@ discard block |
||
1211 | 1211 | |
1212 | 1212 | echo "<!DOCTYPE html>\n"; |
1213 | 1213 | $xoops_url = \XoopsBaseConfig::get('url'); |
1214 | - echo '<html lang="' . XoopsLocale::getLangCode() . '"> |
|
1214 | + echo '<html lang="'.XoopsLocale::getLangCode().'"> |
|
1215 | 1215 | <head> |
1216 | 1216 | <meta charset="utf-8"> |
1217 | 1217 | <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
1218 | 1218 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
1219 | - <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']) . '" /> |
|
1220 | - <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']) . '" /> |
|
1221 | - <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_description']) . '" /> |
|
1222 | - <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']) . '" /> |
|
1223 | - <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']) . '" /> |
|
1219 | + <meta name="robots" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_robots']).'" /> |
|
1220 | + <meta name="keywords" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_keywords']).'" /> |
|
1221 | + <meta name="description" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_description']).'" /> |
|
1222 | + <meta name="rating" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_rating']).'" /> |
|
1223 | + <meta name="author" content="' . htmlspecialchars($xoopsConfigMetaFooter['meta_author']).'" /> |
|
1224 | 1224 | <meta name="generator" content="XOOPS" /> |
1225 | - <title>' . htmlspecialchars($this->getConfig('sitename')) . '</title>' |
|
1225 | + <title>' . htmlspecialchars($this->getConfig('sitename')).'</title>' |
|
1226 | 1226 | . $this->theme->renderBaseAssets(); |
1227 | 1227 | |
1228 | 1228 | $locale = $this->getConfig('locale'); |
1229 | - if (XoopsLoad::fileExists($this->path('locale/' . $locale . '/style.css'))) { |
|
1230 | - echo '<link rel="stylesheet" type="text/css" media="all" href="' . $xoops_url |
|
1231 | - . '/locale/' . $locale . '/style.css" />'; |
|
1229 | + if (XoopsLoad::fileExists($this->path('locale/'.$locale.'/style.css'))) { |
|
1230 | + echo '<link rel="stylesheet" type="text/css" media="all" href="'.$xoops_url |
|
1231 | + . '/locale/'.$locale.'/style.css" />'; |
|
1232 | 1232 | } |
1233 | 1233 | $themecss = $this->getCss($this->getConfig('theme_set')); |
1234 | 1234 | if ($themecss) { |
1235 | - echo '<link rel="stylesheet" type="text/css" media="all" href="' . $themecss . '" />'; |
|
1235 | + echo '<link rel="stylesheet" type="text/css" media="all" href="'.$themecss.'" />'; |
|
1236 | 1236 | } |
1237 | 1237 | if ($closehead) { |
1238 | 1238 | echo '</head><body>'; |
@@ -1332,13 +1332,13 @@ discard block |
||
1332 | 1332 | foreach ($hiddens as $name => $value) { |
1333 | 1333 | if (is_array($value)) { |
1334 | 1334 | foreach ($value as $caption => $newvalue) { |
1335 | - $str_hiddens .= '<input type="radio" name="' . $name . '" value="' |
|
1336 | - . htmlspecialchars($newvalue) . '" > ' . $caption . NWLINE; |
|
1335 | + $str_hiddens .= '<input type="radio" name="'.$name.'" value="' |
|
1336 | + . htmlspecialchars($newvalue).'" > '.$caption.NWLINE; |
|
1337 | 1337 | } |
1338 | - $str_hiddens .= '<br />' . NWLINE; |
|
1338 | + $str_hiddens .= '<br />'.NWLINE; |
|
1339 | 1339 | } else { |
1340 | - $str_hiddens .= '<input type="hidden" name="' . $name . '" value="' |
|
1341 | - . htmlspecialchars($value) . '" />' . NWLINE; |
|
1340 | + $str_hiddens .= '<input type="hidden" name="'.$name.'" value="' |
|
1341 | + . htmlspecialchars($value).'" />'.NWLINE; |
|
1342 | 1342 | } |
1343 | 1343 | } |
1344 | 1344 | if ($addtoken != false) { |
@@ -1450,7 +1450,7 @@ discard block |
||
1450 | 1450 | $url = trim($url); |
1451 | 1451 | if ($url != '') { |
1452 | 1452 | if (!preg_match('/^(https?|ftps?|ed2k)\:\/\//i', $url)) { |
1453 | - $url = 'http://' . $url; |
|
1453 | + $url = 'http://'.$url; |
|
1454 | 1454 | } |
1455 | 1455 | } |
1456 | 1456 | return $url; |
@@ -1519,7 +1519,7 @@ discard block |
||
1519 | 1519 | ))); |
1520 | 1520 | $this->setTpl($this->theme()->template); |
1521 | 1521 | $this->tpl()->assign(array( |
1522 | - 'xoops_theme' => $theme, 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url') . '/' . $theme . '/', |
|
1522 | + 'xoops_theme' => $theme, 'xoops_imageurl' => \XoopsBaseConfig::get('themes-url').'/'.$theme.'/', |
|
1523 | 1523 | 'xoops_themecss' => $this->getCss($theme), |
1524 | 1524 | 'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES), |
1525 | 1525 | 'xoops_sitename' => htmlspecialchars($this->getConfig('sitename'), ENT_QUOTES), |
@@ -1531,8 +1531,8 @@ discard block |
||
1531 | 1531 | |
1532 | 1532 | $this->tpl()->assign('time', (int)($time)); |
1533 | 1533 | if (!empty($_SERVER['REQUEST_URI']) && $addredirect && strstr($url, 'user.php')) { |
1534 | - $joiner = (false===strpos($url, '?')) ? '?' : '&'; |
|
1535 | - $url .= $joiner . 'xoops_redirect=' . urlencode($_SERVER['REQUEST_URI']); |
|
1534 | + $joiner = (false === strpos($url, '?')) ? '?' : '&'; |
|
1535 | + $url .= $joiner.'xoops_redirect='.urlencode($_SERVER['REQUEST_URI']); |
|
1536 | 1536 | } |
1537 | 1537 | $url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES)); |
1538 | 1538 | $this->tpl()->assign('url', $url); |
@@ -1596,25 +1596,25 @@ discard block |
||
1596 | 1596 | } |
1597 | 1597 | $xoops_theme_path = \XoopsBaseConfig::get('themes-path'); |
1598 | 1598 | $xoops_theme_url = \XoopsBaseConfig::get('themes-url'); |
1599 | - if (is_dir($xoops_theme_path . '/' . $theme)) { |
|
1600 | - if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/' . $str_css)) { |
|
1601 | - return $xoops_theme_url . '/' . $theme . '/' . $str_css; |
|
1602 | - } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/style.css')) { |
|
1603 | - return $xoops_theme_url . '/' . $theme . '/style.css'; |
|
1599 | + if (is_dir($xoops_theme_path.'/'.$theme)) { |
|
1600 | + if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/'.$str_css)) { |
|
1601 | + return $xoops_theme_url.'/'.$theme.'/'.$str_css; |
|
1602 | + } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/style.css')) { |
|
1603 | + return $xoops_theme_url.'/'.$theme.'/style.css'; |
|
1604 | 1604 | } |
1605 | 1605 | } |
1606 | - if (is_dir($xoops_theme_path . '/' . $theme . '/css')) { |
|
1607 | - if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/css/' . $str_css)) { |
|
1608 | - return $xoops_theme_url . '/' . $theme . '/css/' . $str_css; |
|
1609 | - } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/css/style.css')) { |
|
1610 | - return $xoops_theme_url . '/' . $theme . '/css/style.css'; |
|
1606 | + if (is_dir($xoops_theme_path.'/'.$theme.'/css')) { |
|
1607 | + if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/css/'.$str_css)) { |
|
1608 | + return $xoops_theme_url.'/'.$theme.'/css/'.$str_css; |
|
1609 | + } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/css/style.css')) { |
|
1610 | + return $xoops_theme_url.'/'.$theme.'/css/style.css'; |
|
1611 | 1611 | } |
1612 | 1612 | } |
1613 | - if (is_dir($xoops_theme_path . '/' . $theme . '/assets/css')) { |
|
1614 | - if (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/assets/css/' . $str_css)) { |
|
1615 | - return $xoops_theme_url . '/' . $theme . '/assets/css/' . $str_css; |
|
1616 | - } elseif (XoopsLoad::fileExists($xoops_theme_path . '/' . $theme . '/assets/css/style.css')) { |
|
1617 | - return $xoops_theme_url . '/' . $theme . '/assets/css/style.css'; |
|
1613 | + if (is_dir($xoops_theme_path.'/'.$theme.'/assets/css')) { |
|
1614 | + if (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/assets/css/'.$str_css)) { |
|
1615 | + return $xoops_theme_url.'/'.$theme.'/assets/css/'.$str_css; |
|
1616 | + } elseif (XoopsLoad::fileExists($xoops_theme_path.'/'.$theme.'/assets/css/style.css')) { |
|
1617 | + return $xoops_theme_url.'/'.$theme.'/assets/css/style.css'; |
|
1618 | 1618 | } |
1619 | 1619 | } |
1620 | 1620 | return ''; |
@@ -1728,7 +1728,7 @@ discard block |
||
1728 | 1728 | if (empty($dirname)) { |
1729 | 1729 | $dirname = $this->isModule() ? $this->module->getVar('dirname') : 'system'; |
1730 | 1730 | } |
1731 | - $this->moduleConfigs[$dirname][$key] =& $value; |
|
1731 | + $this->moduleConfigs[$dirname][$key] = & $value; |
|
1732 | 1732 | } |
1733 | 1733 | } |
1734 | 1734 | |
@@ -1812,18 +1812,18 @@ discard block |
||
1812 | 1812 | if (is_object($module)) { |
1813 | 1813 | $configs = $this->getHandlerConfig()->getConfigsByModule($module->getVar('mid')); |
1814 | 1814 | $this->cache()->write($key, $configs); |
1815 | - $this->moduleConfigs[$dirname] =& $configs; |
|
1815 | + $this->moduleConfigs[$dirname] = & $configs; |
|
1816 | 1816 | } |
1817 | 1817 | } else { |
1818 | - $this->moduleConfigs[$dirname] =& $configs; |
|
1818 | + $this->moduleConfigs[$dirname] = & $configs; |
|
1819 | 1819 | } |
1820 | 1820 | |
1821 | 1821 | if ($this->isModule()) { |
1822 | 1822 | //for legacy |
1823 | - $this->moduleConfig =& $this->moduleConfigs[$this->module->getVar('dirname')]; |
|
1823 | + $this->moduleConfig = & $this->moduleConfigs[$this->module->getVar('dirname')]; |
|
1824 | 1824 | } |
1825 | 1825 | if ($dirname === 'system') { |
1826 | - $this->config =& $this->moduleConfigs['system']; |
|
1826 | + $this->config = & $this->moduleConfigs['system']; |
|
1827 | 1827 | } |
1828 | 1828 | return $this->moduleConfigs[$dirname]; |
1829 | 1829 | } |
@@ -1850,10 +1850,10 @@ discard block |
||
1850 | 1850 | } |
1851 | 1851 | if ($appendWithKey) { |
1852 | 1852 | foreach ($values as $key2 => $value) { |
1853 | - $this->moduleConfigs[$dirname][$key][$key2] =& $value; |
|
1853 | + $this->moduleConfigs[$dirname][$key][$key2] = & $value; |
|
1854 | 1854 | } |
1855 | 1855 | } else { |
1856 | - $this->moduleConfigs[$dirname][$key][] =& $values; |
|
1856 | + $this->moduleConfigs[$dirname][$key][] = & $values; |
|
1857 | 1857 | } |
1858 | 1858 | } |
1859 | 1859 | |
@@ -1883,7 +1883,7 @@ discard block |
||
1883 | 1883 | */ |
1884 | 1884 | public function getBaseDomain($url, $includeSubdomain = false) |
1885 | 1885 | { |
1886 | - $url=mb_strtolower($url, 'UTF-8'); |
|
1886 | + $url = mb_strtolower($url, 'UTF-8'); |
|
1887 | 1887 | |
1888 | 1888 | $host = parse_url($url, PHP_URL_HOST); |
1889 | 1889 | if (empty($host)) { |
@@ -1894,13 +1894,13 @@ discard block |
||
1894 | 1894 | } |
1895 | 1895 | |
1896 | 1896 | // check for exceptions, localhost and ip address (v4 & v6) |
1897 | - if ($host==='localhost') { |
|
1897 | + if ($host === 'localhost') { |
|
1898 | 1898 | return $host; |
1899 | 1899 | } |
1900 | 1900 | // Check for IPV6 URL (see http://www.ietf.org/rfc/rfc2732.txt) |
1901 | 1901 | // strip brackets before validating |
1902 | - if (substr($host, 0, 1)==='[' && substr($host, -1)===']') { |
|
1903 | - $host = substr($host, 1, (strlen($host)-2)); |
|
1902 | + if (substr($host, 0, 1) === '[' && substr($host, -1) === ']') { |
|
1903 | + $host = substr($host, 1, (strlen($host) - 2)); |
|
1904 | 1904 | } |
1905 | 1905 | if (filter_var($host, FILTER_VALIDATE_IP)) { |
1906 | 1906 | return $host; |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | $module = $tplfile->getVar('tpl_module', 'n'); |
1931 | 1931 | $type = $tplfile->getVar('tpl_type', 'n'); |
1932 | 1932 | $tpl = new XoopsTpl(); |
1933 | - return $tpl->touch($type . ':' . $module . '/' . $file); |
|
1933 | + return $tpl->touch($type.':'.$module.'/'.$file); |
|
1934 | 1934 | } |
1935 | 1935 | return false; |
1936 | 1936 | } |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | $fullPath = $xoops->path("{$path}/locale/{$locale}/locale.php"); |
222 | 222 | $fullPath2 = $xoops->path("{$path}/locale/{$locale}/{$locale}.php"); |
223 | 223 | if (\XoopsLoad::fileExists($fullPath)) { |
224 | - \XoopsLoad::addMap(array($domain . 'locale' => $fullPath)); |
|
224 | + \XoopsLoad::addMap(array($domain.'locale' => $fullPath)); |
|
225 | 225 | if (\XoopsLoad::fileExists($fullPath2)) { |
226 | - \XoopsLoad::addMap(array(strtolower($domain . "locale{$locale}") => $fullPath2)); |
|
226 | + \XoopsLoad::addMap(array(strtolower($domain."locale{$locale}") => $fullPath2)); |
|
227 | 227 | } |
228 | 228 | return true; |
229 | 229 | } |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | $fullPath = $xoops->path($theme->resourcePath("locale/{$locale}/locale.php")); |
247 | 247 | $fullPath2 = $xoops->path($theme->resourcePath("locale/{$locale}/{$locale}.php")); |
248 | 248 | if (\XoopsLoad::fileExists($fullPath)) { |
249 | - \XoopsLoad::addMap(array(strtolower($theme->folderName . 'ThemeLocale') => $fullPath)); |
|
249 | + \XoopsLoad::addMap(array(strtolower($theme->folderName.'ThemeLocale') => $fullPath)); |
|
250 | 250 | if (\XoopsLoad::fileExists($fullPath2)) { |
251 | - \XoopsLoad::addMap(array(strtolower($theme->folderName . "ThemeLocale{$locale}") => $fullPath2)); |
|
251 | + \XoopsLoad::addMap(array(strtolower($theme->folderName."ThemeLocale{$locale}") => $fullPath2)); |
|
252 | 252 | } |
253 | 253 | return true; |
254 | 254 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | |
347 | 347 | $p = []; |
348 | 348 | foreach ($params as $name => $value) { |
349 | - $p['{' . $name . '}'] = $value; |
|
349 | + $p['{'.$name.'}'] = $value; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | return strtr($message, $p); |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | */ |
373 | 373 | protected static function getClassFromDirname($dirname) |
374 | 374 | { |
375 | - return ucfirst($dirname) . 'Locale'; |
|
375 | + return ucfirst($dirname).'Locale'; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | if (!$dirname) { |
386 | 386 | $dirname = \Xoops::getInstance()->theme()->folderName; |
387 | 387 | } |
388 | - return ucfirst($dirname) . 'ThemeLocale'; |
|
388 | + return ucfirst($dirname).'ThemeLocale'; |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
@@ -461,8 +461,8 @@ discard block |
||
461 | 461 | $keys = Data::explodeLocale($locale); |
462 | 462 | $key = strtolower($keys['language']); |
463 | 463 | $key .= (empty($keys['script']) || false === $withScript) ? |
464 | - '' : $separator . ucfirst(strtolower($keys['script'])); |
|
465 | - $key .= empty($keys['territory']) ? '' : $separator . strtoupper($keys['territory']); |
|
464 | + '' : $separator.ucfirst(strtolower($keys['script'])); |
|
465 | + $key .= empty($keys['territory']) ? '' : $separator.strtoupper($keys['territory']); |
|
466 | 466 | } catch (InvalidLocale $e) { |
467 | 467 | $key = ''; |
468 | 468 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $name = $this->xoops->getConfig('session_name'); |
84 | 84 | $name = (empty($name)) ? 'xoops_session' : $name; |
85 | 85 | $expire = (int)($this->xoops->getConfig('session_expire')); |
86 | - $expire = ($expire>0) ? $expire : 300; |
|
86 | + $expire = ($expire > 0) ? $expire : 300; |
|
87 | 87 | |
88 | 88 | $path = \XoopsBaseConfig::get('cookie-path'); |
89 | 89 | $domain = \XoopsBaseConfig::get('cookie-domain'); |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | // if we don't have the expires key, use a future value for test |
201 | - if ($this->get('SESSION_MANAGER_EXPIRES', time()+10) < time()) { |
|
201 | + if ($this->get('SESSION_MANAGER_EXPIRES', time() + 10) < time()) { |
|
202 | 202 | return false; |
203 | 203 | } |
204 | 204 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | $this->now = time(); |
97 | 97 | $cookieData = $this->readUserCookie(); |
98 | 98 | if (false === $cookieData) { |
99 | - return false; // no or invalid cookie |
|
99 | + return false; // no or invalid cookie |
|
100 | 100 | } |
101 | 101 | list($userId, $series, $token) = $cookieData; |
102 | 102 | $this->readUserTokens($userId); |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | if ($cookieData !== $notFound) { |
381 | 381 | $temp = explode('-', $cookieData); |
382 | 382 | if (count($temp) == 3) { |
383 | - $temp[0] = (integer) $temp[0]; |
|
383 | + $temp[0] = (integer)$temp[0]; |
|
384 | 384 | return $temp; |
385 | 385 | } |
386 | 386 | $this->clearUserCookie(); // clean up garbage cookie |