@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | function __call($method_name, $arguments) |
| 227 | 227 | { |
| 228 | - include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); |
|
| 228 | + include_once(MODX_MANAGER_PATH.'includes/extenders/deprecated.functions.inc.php'); |
|
| 229 | 229 | if (method_exists($this->old, $method_name)) { |
| 230 | 230 | $error_type = 1; |
| 231 | 231 | } else { |
@@ -243,12 +243,12 @@ discard block |
||
| 243 | 243 | $info = debug_backtrace(); |
| 244 | 244 | $m[] = $msg; |
| 245 | 245 | if (!empty($this->currentSnippet)) { |
| 246 | - $m[] = 'Snippet - ' . $this->currentSnippet; |
|
| 246 | + $m[] = 'Snippet - '.$this->currentSnippet; |
|
| 247 | 247 | } elseif (!empty($this->event->activePlugin)) { |
| 248 | - $m[] = 'Plugin - ' . $this->event->activePlugin; |
|
| 248 | + $m[] = 'Plugin - '.$this->event->activePlugin; |
|
| 249 | 249 | } |
| 250 | 250 | $m[] = $this->decoded_request_uri; |
| 251 | - $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')'; |
|
| 251 | + $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')'; |
|
| 252 | 252 | $msg = implode('<br />', $m); |
| 253 | 253 | $this->logEvent(0, $error_type, $msg, $title); |
| 254 | 254 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | $flag = false; |
| 267 | 267 | if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) { |
| 268 | - $flag = (bool)$this->{$connector}->conn; |
|
| 268 | + $flag = (bool) $this->{$connector}->conn; |
|
| 269 | 269 | } |
| 270 | 270 | return $flag; |
| 271 | 271 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | if (!$out && $flag) { |
| 294 | 294 | $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname))); |
| 295 | - $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php"; |
|
| 295 | + $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php"; |
|
| 296 | 296 | $out = is_file($filename) ? include $filename : false; |
| 297 | 297 | } |
| 298 | 298 | if ($out && !in_array($extname, $this->extensions)) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | public function getMicroTime() |
| 310 | 310 | { |
| 311 | 311 | list ($usec, $sec) = explode(' ', microtime()); |
| 312 | - return ((float)$usec + (float)$sec); |
|
| 312 | + return ((float) $usec + (float) $sec); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | // append the redirect count string to the url |
| 334 | 334 | $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; |
| 335 | 335 | if ($currentNumberOfRedirects > 3) { |
| 336 | - $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>'); |
|
| 336 | + $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>'); |
|
| 337 | 337 | } else { |
| 338 | 338 | $currentNumberOfRedirects += 1; |
| 339 | 339 | if (strpos($url, "?") > 0) { |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | if ($type == 'REDIRECT_REFRESH') { |
| 347 | - $header = 'Refresh: 0;URL=' . $url; |
|
| 347 | + $header = 'Refresh: 0;URL='.$url; |
|
| 348 | 348 | } elseif ($type == 'REDIRECT_META') { |
| 349 | - $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />'; |
|
| 349 | + $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />'; |
|
| 350 | 350 | echo $header; |
| 351 | 351 | exit; |
| 352 | 352 | } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { |
@@ -354,10 +354,10 @@ discard block |
||
| 354 | 354 | global $base_url, $site_url; |
| 355 | 355 | if (substr($url, 0, strlen($base_url)) == $base_url) { |
| 356 | 356 | // append $site_url to make it work with Location: |
| 357 | - $url = $site_url . substr($url, strlen($base_url)); |
|
| 357 | + $url = $site_url.substr($url, strlen($base_url)); |
|
| 358 | 358 | } |
| 359 | 359 | if (strpos($url, "\n") === false) { |
| 360 | - $header = 'Location: ' . $url; |
|
| 360 | + $header = 'Location: '.$url; |
|
| 361 | 361 | } else { |
| 362 | 362 | $this->messageQuit('No newline allowed in redirect url.'); |
| 363 | 363 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | header($responseCode); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if(!empty($header)) { |
|
| 369 | + if (!empty($header)) { |
|
| 370 | 370 | header($header); |
| 371 | 371 | } |
| 372 | 372 | |
@@ -471,8 +471,8 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | private function recoverySiteCache() |
| 473 | 473 | { |
| 474 | - $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder(); |
|
| 475 | - $site_cache_path = $site_cache_dir . 'siteCache.idx.php'; |
|
| 474 | + $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder(); |
|
| 475 | + $site_cache_path = $site_cache_dir.'siteCache.idx.php'; |
|
| 476 | 476 | |
| 477 | 477 | if (is_file($site_cache_path)) { |
| 478 | 478 | include($site_cache_path); |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | return; |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | - include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php'); |
|
| 484 | + include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); |
|
| 485 | 485 | $cache = new synccache(); |
| 486 | 486 | $cache->setCachepath($site_cache_dir); |
| 487 | 487 | $cache->setReport(false); |
@@ -533,8 +533,8 @@ discard block |
||
| 533 | 533 | $this->invokeEvent("OnBeforeManagerPageInit"); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { |
|
| 537 | - $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; |
|
| 536 | + if (isset ($_SESSION[$usrType.'UsrConfigSet'])) { |
|
| 537 | + $usrSettings = &$_SESSION[$usrType.'UsrConfigSet']; |
|
| 538 | 538 | } else { |
| 539 | 539 | if ($usrType == 'web') { |
| 540 | 540 | $from = $tbl_web_user_settings; |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $usrSettings[$row['setting_name']] = $row['setting_value']; |
| 555 | 555 | } |
| 556 | 556 | if (isset ($usrType)) { |
| 557 | - $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; |
|
| 557 | + $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings; |
|
| 558 | 558 | } // store user settings in session |
| 559 | 559 | } |
| 560 | 560 | } |
@@ -699,10 +699,10 @@ discard block |
||
| 699 | 699 | $suf = $this->config['friendly_url_suffix']; |
| 700 | 700 | $pre = preg_quote($pre, '/'); |
| 701 | 701 | $suf = preg_quote($suf, '/'); |
| 702 | - if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) { |
|
| 702 | + if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) { |
|
| 703 | 703 | $q = $_[1]; |
| 704 | 704 | } |
| 705 | - if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) { |
|
| 705 | + if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) { |
|
| 706 | 706 | $q = $_[1]; |
| 707 | 707 | } |
| 708 | 708 | |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */ |
| 725 | 725 | /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */ |
| 726 | 726 | if ($this->config['use_alias_path'] == 1) { |
| 727 | - if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { |
|
| 727 | + if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir.'/'.$q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { |
|
| 728 | 728 | $this->documentMethod = 'id'; |
| 729 | 729 | return $q; |
| 730 | 730 | } else { /* not a valid id in terms of virtualDir, treat as alias */ |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | public function getHashFile($key) |
| 760 | 760 | { |
| 761 | - return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php"; |
|
| 761 | + return $this->getCacheFolder()."docid_".$key.".pageCache.php"; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | /** |
@@ -769,9 +769,9 @@ discard block |
||
| 769 | 769 | $hash = $id; |
| 770 | 770 | $tmp = null; |
| 771 | 771 | $params = array(); |
| 772 | - if(!empty($this->systemCacheKey)){ |
|
| 772 | + if (!empty($this->systemCacheKey)) { |
|
| 773 | 773 | $hash = $this->systemCacheKey; |
| 774 | - }else { |
|
| 774 | + } else { |
|
| 775 | 775 | if (!empty($_GET)) { |
| 776 | 776 | // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. |
| 777 | 777 | $params = $_GET; |
@@ -779,8 +779,8 @@ discard block |
||
| 779 | 779 | $hash .= '_'.md5(http_build_query($params)); |
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); |
|
| 783 | - if (is_array($evtOut) && count($evtOut) > 0){ |
|
| 782 | + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); |
|
| 783 | + if (is_array($evtOut) && count($evtOut) > 0) { |
|
| 784 | 784 | $tmp = array_pop($evtOut); |
| 785 | 785 | } |
| 786 | 786 | return empty($tmp) ? $hash : $tmp; |
@@ -922,12 +922,12 @@ discard block |
||
| 922 | 922 | if ($js = $this->getRegisteredClientStartupScripts()) { |
| 923 | 923 | // change to just before closing </head> |
| 924 | 924 | // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent); |
| 925 | - $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput); |
|
| 925 | + $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput); |
|
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | // Insert jscripts & html block into template - template must have a </body> tag |
| 929 | 929 | if ($js = $this->getRegisteredClientScripts()) { |
| 930 | - $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput); |
|
| 930 | + $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput); |
|
| 931 | 931 | } |
| 932 | 932 | // End fix by sirlancelot |
| 933 | 933 | |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | // send out content-type and content-disposition headers |
| 939 | 939 | if (IN_PARSER_MODE == "true") { |
| 940 | 940 | $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; |
| 941 | - header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); |
|
| 941 | + header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']); |
|
| 942 | 942 | // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) |
| 943 | 943 | // header('HTTP/1.0 404 Not Found'); |
| 944 | 944 | if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | $name = preg_replace('|-+|', '-', $name); |
| 957 | 957 | $name = trim($name, '-'); |
| 958 | 958 | } |
| 959 | - $header = 'Content-Disposition: attachment; filename=' . $name; |
|
| 959 | + $header = 'Content-Disposition: attachment; filename='.$name; |
|
| 960 | 960 | header($header); |
| 961 | 961 | } |
| 962 | 962 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | |
| 965 | 965 | $stats = $this->getTimerStats($this->tstart); |
| 966 | 966 | |
| 967 | - $out =& $this->documentOutput; |
|
| 967 | + $out = & $this->documentOutput; |
|
| 968 | 968 | $out = str_replace("[^q^]", $stats['queries'], $out); |
| 969 | 969 | $out = str_replace("[^qt^]", $stats['queryTime'], $out); |
| 970 | 970 | $out = str_replace("[^p^]", $stats['phpTime'], $out); |
@@ -1003,17 +1003,17 @@ discard block |
||
| 1003 | 1003 | $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet |
| 1004 | 1004 | $tt += $t; |
| 1005 | 1005 | } |
| 1006 | - echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />"; |
|
| 1006 | + echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />"; |
|
| 1007 | 1007 | echo $this->snippetsCode; |
| 1008 | 1008 | } |
| 1009 | 1009 | if ($this->dumpPlugins) { |
| 1010 | 1010 | $ps = ""; |
| 1011 | 1011 | $tt = 0; |
| 1012 | 1012 | foreach ($this->pluginsTime as $s => $t) { |
| 1013 | - $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>"; |
|
| 1013 | + $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>"; |
|
| 1014 | 1014 | $tt += $t; |
| 1015 | 1015 | } |
| 1016 | - echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />"; |
|
| 1016 | + echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />"; |
|
| 1017 | 1017 | echo $this->pluginsCode; |
| 1018 | 1018 | } |
| 1019 | 1019 | |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | $srcTags = explode(',', $tags); |
| 1040 | 1040 | $repTags = array(); |
| 1041 | 1041 | foreach ($srcTags as $tag) { |
| 1042 | - $repTags[] = '\\' . $tag[0] . '\\' . $tag[1]; |
|
| 1042 | + $repTags[] = '\\'.$tag[0].'\\'.$tag[1]; |
|
| 1043 | 1043 | } |
| 1044 | 1044 | return array($srcTags, $repTags); |
| 1045 | 1045 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); |
| 1062 | 1062 | $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; |
| 1063 | 1063 | $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; |
| 1064 | - $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; |
|
| 1064 | + $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb"; |
|
| 1065 | 1065 | |
| 1066 | 1066 | return $stats; |
| 1067 | 1067 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | { |
| 1095 | 1095 | $cacheRefreshTime = 0; |
| 1096 | 1096 | $recent_update = 0; |
| 1097 | - @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php'); |
|
| 1097 | + @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php'); |
|
| 1098 | 1098 | $this->recentUpdate = $recent_update; |
| 1099 | 1099 | |
| 1100 | 1100 | $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time']; |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | // now, check for documents that need publishing |
| 1106 | 1106 | $field = array('published' => 1, 'publishedon' => $timeNow); |
| 1107 | 1107 | $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; |
| 1108 | - $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
|
| 1108 | + $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); |
|
| 1109 | 1109 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1110 | 1110 | if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc |
| 1111 | 1111 | while ($row_pub = $this->db->getRow($result_pub)) { |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | // now, check for documents that need un-publishing |
| 1119 | 1119 | $field = array('published' => 0, 'publishedon' => 0); |
| 1120 | 1120 | $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; |
| 1121 | - $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
|
| 1121 | + $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); |
|
| 1122 | 1122 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1123 | 1123 | if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc |
| 1124 | 1124 | while ($row_unpub = $this->db->getRow($result_unpub)) { |
@@ -1164,8 +1164,8 @@ discard block |
||
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | $docObjSerial = serialize($this->documentObject); |
| 1167 | - $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent; |
|
| 1168 | - $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey); |
|
| 1167 | + $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent; |
|
| 1168 | + $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey); |
|
| 1169 | 1169 | file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent"); |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
@@ -1207,16 +1207,16 @@ discard block |
||
| 1207 | 1207 | return array(); |
| 1208 | 1208 | } |
| 1209 | 1209 | $spacer = md5('<<<EVO>>>'); |
| 1210 | - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); |
|
| 1211 | - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); |
|
| 1212 | - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); |
|
| 1213 | - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); |
|
| 1210 | + if ($left === '{{' && strpos($content, ';}}') !== false) $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); |
|
| 1211 | + if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); |
|
| 1212 | + if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); |
|
| 1213 | + if ($left === '[[' && strpos($content, ']]]') !== false) $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); |
|
| 1214 | 1214 | |
| 1215 | 1215 | $pos['<![CDATA['] = strpos($content, '<![CDATA['); |
| 1216 | 1216 | $pos[']]>'] = strpos($content, ']]>'); |
| 1217 | 1217 | |
| 1218 | 1218 | if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) { |
| 1219 | - $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3); |
|
| 1219 | + $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3); |
|
| 1220 | 1220 | } |
| 1221 | 1221 | |
| 1222 | 1222 | $lp = explode($left, $content); |
@@ -1280,8 +1280,8 @@ discard block |
||
| 1280 | 1280 | } |
| 1281 | 1281 | } |
| 1282 | 1282 | } |
| 1283 | - foreach($tags as $i=>$tag) { |
|
| 1284 | - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1283 | + foreach ($tags as $i=>$tag) { |
|
| 1284 | + if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1285 | 1285 | } |
| 1286 | 1286 | return $tags; |
| 1287 | 1287 | } |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | foreach ($matches[1] as $i => $key) { |
| 1324 | - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1324 | + if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1325 | 1325 | if (substr($key, 0, 1) == '#') { |
| 1326 | 1326 | $key = substr($key, 1); |
| 1327 | 1327 | } // remove # for QuickEdit format |
@@ -1341,8 +1341,8 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | if (is_array($value)) { |
| 1344 | - include_once(MODX_MANAGER_PATH . 'includes/tmplvars.format.inc.php'); |
|
| 1345 | - include_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); |
|
| 1344 | + include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php'); |
|
| 1345 | + include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); |
|
| 1346 | 1346 | $value = getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]); |
| 1347 | 1347 | } |
| 1348 | 1348 | |
@@ -1353,8 +1353,8 @@ discard block |
||
| 1353 | 1353 | |
| 1354 | 1354 | if (strpos($content, $s) !== false) { |
| 1355 | 1355 | $content = str_replace($s, $value, $content); |
| 1356 | - } elseif($this->debug) { |
|
| 1357 | - $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1356 | + } elseif ($this->debug) { |
|
| 1357 | + $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1358 | 1358 | } |
| 1359 | 1359 | } |
| 1360 | 1360 | |
@@ -1521,8 +1521,8 @@ discard block |
||
| 1521 | 1521 | $s = &$matches[0][$i]; |
| 1522 | 1522 | if (strpos($content, $s) !== false) { |
| 1523 | 1523 | $content = str_replace($s, $value, $content); |
| 1524 | - } elseif($this->debug) { |
|
| 1525 | - $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1524 | + } elseif ($this->debug) { |
|
| 1525 | + $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1526 | 1526 | } |
| 1527 | 1527 | } |
| 1528 | 1528 | return $content; |
@@ -1575,7 +1575,7 @@ discard block |
||
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags |
| 1578 | - $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers |
|
| 1578 | + $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers |
|
| 1579 | 1579 | if ($this->config['enable_at_syntax']) { |
| 1580 | 1580 | $value = $this->mergeConditionalTagsContent($value); |
| 1581 | 1581 | } |
@@ -1590,8 +1590,8 @@ discard block |
||
| 1590 | 1590 | $s = &$matches[0][$i]; |
| 1591 | 1591 | if (strpos($content, $s) !== false) { |
| 1592 | 1592 | $content = str_replace($s, $value, $content); |
| 1593 | - } elseif($this->debug) { |
|
| 1594 | - $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1593 | + } elseif ($this->debug) { |
|
| 1594 | + $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | return $content; |
@@ -1649,8 +1649,8 @@ discard block |
||
| 1649 | 1649 | $s = &$matches[0][$i]; |
| 1650 | 1650 | if (strpos($content, $s) !== false) { |
| 1651 | 1651 | $content = str_replace($s, $value, $content); |
| 1652 | - } elseif($this->debug) { |
|
| 1653 | - $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1652 | + } elseif ($this->debug) { |
|
| 1653 | + $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1654 | 1654 | } |
| 1655 | 1655 | } |
| 1656 | 1656 | return $content; |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | return $content; |
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | - $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#'; |
|
| 1677 | + $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#'; |
|
| 1678 | 1678 | $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content); |
| 1679 | 1679 | |
| 1680 | 1680 | $pieces = explode('<@IF:', $content); |
@@ -1685,7 +1685,7 @@ discard block |
||
| 1685 | 1685 | } |
| 1686 | 1686 | list($cmd, $text) = explode('>', $split, 2); |
| 1687 | 1687 | $cmd = str_replace("'", "\'", $cmd); |
| 1688 | - $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>"; |
|
| 1688 | + $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>"; |
|
| 1689 | 1689 | $content .= $text; |
| 1690 | 1690 | } |
| 1691 | 1691 | $pieces = explode('<@ELSEIF:', $content); |
@@ -1696,13 +1696,13 @@ discard block |
||
| 1696 | 1696 | } |
| 1697 | 1697 | list($cmd, $text) = explode('>', $split, 2); |
| 1698 | 1698 | $cmd = str_replace("'", "\'", $cmd); |
| 1699 | - $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>"; |
|
| 1699 | + $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>"; |
|
| 1700 | 1700 | $content .= $text; |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content); |
| 1704 | 1704 | ob_start(); |
| 1705 | - $content = eval('?>' . $content); |
|
| 1705 | + $content = eval('?>'.$content); |
|
| 1706 | 1706 | $content = ob_get_clean(); |
| 1707 | 1707 | $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content); |
| 1708 | 1708 | |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | $matches = $this->getTagsFromContent($content, $left, $right); |
| 1828 | 1828 | if (!empty($matches)) { |
| 1829 | 1829 | foreach ($matches[0] as $i => $v) { |
| 1830 | - $addBreakMatches[$i] = $v . "\n"; |
|
| 1830 | + $addBreakMatches[$i] = $v."\n"; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | $content = str_replace($addBreakMatches, '', $content); |
| 1833 | 1833 | if (strpos($content, $left) !== false) { |
@@ -1860,8 +1860,8 @@ discard block |
||
| 1860 | 1860 | $s = &$matches[0][$i]; |
| 1861 | 1861 | if (strpos($content, $s) !== false) { |
| 1862 | 1862 | $content = str_replace($s, $v, $content); |
| 1863 | - } elseif($this->debug) { |
|
| 1864 | - $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1863 | + } elseif ($this->debug) { |
|
| 1864 | + $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1865 | 1865 | } |
| 1866 | 1866 | } |
| 1867 | 1867 | return $content; |
@@ -1925,7 +1925,7 @@ discard block |
||
| 1925 | 1925 | $msg = ($msg === false) ? 'ob_get_contents() error' : $msg; |
| 1926 | 1926 | $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg); |
| 1927 | 1927 | if ($this->isBackend()) { |
| 1928 | - $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>'); |
|
| 1928 | + $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>'); |
|
| 1929 | 1929 | } |
| 1930 | 1930 | } |
| 1931 | 1931 | } else { |
@@ -1971,7 +1971,7 @@ discard block |
||
| 1971 | 1971 | $echo = ($echo === false) ? 'ob_get_contents() error' : $echo; |
| 1972 | 1972 | $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo); |
| 1973 | 1973 | if ($this->isBackend()) { |
| 1974 | - $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>'); |
|
| 1974 | + $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>'); |
|
| 1975 | 1975 | } |
| 1976 | 1976 | } |
| 1977 | 1977 | } |
@@ -1979,7 +1979,7 @@ discard block |
||
| 1979 | 1979 | if (is_array($return) || is_object($return)) { |
| 1980 | 1980 | return $return; |
| 1981 | 1981 | } else { |
| 1982 | - return $echo . $return; |
|
| 1982 | + return $echo.$return; |
|
| 1983 | 1983 | } |
| 1984 | 1984 | } |
| 1985 | 1985 | |
@@ -2017,8 +2017,8 @@ discard block |
||
| 2017 | 2017 | } |
| 2018 | 2018 | if (strpos($content, $s) !== false) { |
| 2019 | 2019 | $content = str_replace($s, $value, $content); |
| 2020 | - } elseif($this->debug) { |
|
| 2021 | - $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 2020 | + } elseif ($this->debug) { |
|
| 2021 | + $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 2022 | 2022 | } |
| 2023 | 2023 | continue; |
| 2024 | 2024 | } |
@@ -2029,8 +2029,8 @@ discard block |
||
| 2029 | 2029 | |
| 2030 | 2030 | if (strpos($content, $s) !== false) { |
| 2031 | 2031 | $content = str_replace($s, $value, $content); |
| 2032 | - } elseif($this->debug) { |
|
| 2033 | - $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 2032 | + } elseif ($this->debug) { |
|
| 2033 | + $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 2034 | 2034 | } |
| 2035 | 2035 | } |
| 2036 | 2036 | |
@@ -2121,7 +2121,7 @@ discard block |
||
| 2121 | 2121 | $eventtime = sprintf('%2.2f ms', $eventtime * 1000); |
| 2122 | 2122 | $code = str_replace("\t", ' ', $this->htmlspecialchars($value)); |
| 2123 | 2123 | $piece = str_replace("\t", ' ', $this->htmlspecialchars($piece)); |
| 2124 | - $print_r_params = str_replace("\t", ' ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true))); |
|
| 2124 | + $print_r_params = str_replace("\t", ' ', $this->htmlspecialchars('$modx->event->params = '.print_r($params, true))); |
|
| 2125 | 2125 | $this->snippetsCode .= sprintf('<fieldset style="margin:1em;"><legend><b>%s</b>(%s)</legend><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">[[%s]]</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre></fieldset>', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code); |
| 2126 | 2126 | $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime); |
| 2127 | 2127 | } |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | $rs = $this->db->select('name,snippet,properties', '[+prefix+]site_snippets', $where); |
| 2367 | 2367 | $count = $this->db->getRecordCount($rs); |
| 2368 | 2368 | if (1 < $count) { |
| 2369 | - exit('Error $modx->_getSnippetObject()' . $snip_name); |
|
| 2369 | + exit('Error $modx->_getSnippetObject()'.$snip_name); |
|
| 2370 | 2370 | } |
| 2371 | 2371 | if ($count) { |
| 2372 | 2372 | $row = $this->db->getRow($rs); |
@@ -2392,7 +2392,7 @@ discard block |
||
| 2392 | 2392 | public function toAlias($text) |
| 2393 | 2393 | { |
| 2394 | 2394 | $suff = $this->config['friendly_url_suffix']; |
| 2395 | - return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); |
|
| 2395 | + return str_replace(array('.xml'.$suff, '.rss'.$suff, '.js'.$suff, '.css'.$suff, '.txt'.$suff, '.json'.$suff, '.pdf'.$suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); |
|
| 2396 | 2396 | } |
| 2397 | 2397 | |
| 2398 | 2398 | /** |
@@ -2424,7 +2424,7 @@ discard block |
||
| 2424 | 2424 | $suff = '/'; |
| 2425 | 2425 | } |
| 2426 | 2426 | |
| 2427 | - $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff; |
|
| 2427 | + $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff; |
|
| 2428 | 2428 | } |
| 2429 | 2429 | |
| 2430 | 2430 | $evtOut = $this->invokeEvent('OnMakeDocUrl', array( |
@@ -2461,7 +2461,7 @@ discard block |
||
| 2461 | 2461 | preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match); |
| 2462 | 2462 | $ids = implode(',', array_unique($match['1'])); |
| 2463 | 2463 | if ($ids) { |
| 2464 | - $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'"); |
|
| 2464 | + $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'"); |
|
| 2465 | 2465 | while ($row = $this->db->getRow($res)) { |
| 2466 | 2466 | if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) { |
| 2467 | 2467 | $parent = $row['parent']; |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | $parent = $this->aliasListing[$parent]['parent']; |
| 2473 | 2473 | } |
| 2474 | 2474 | |
| 2475 | - $aliases[$row['id']] = $path . '/' . $row['alias']; |
|
| 2475 | + $aliases[$row['id']] = $path.'/'.$row['alias']; |
|
| 2476 | 2476 | } else { |
| 2477 | 2477 | $aliases[$row['id']] = $row['alias']; |
| 2478 | 2478 | } |
@@ -2484,7 +2484,7 @@ discard block |
||
| 2484 | 2484 | $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0); |
| 2485 | 2485 | $pref = $this->config['friendly_url_prefix']; |
| 2486 | 2486 | $suff = $this->config['friendly_url_suffix']; |
| 2487 | - $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { |
|
| 2487 | + $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { |
|
| 2488 | 2488 | global $modx; |
| 2489 | 2489 | $thealias = $aliases[$m[1]]; |
| 2490 | 2490 | $thefolder = $isfolder[$m[1]]; |
@@ -2500,7 +2500,7 @@ discard block |
||
| 2500 | 2500 | |
| 2501 | 2501 | } else { |
| 2502 | 2502 | $in = '!\[\~([0-9]+)\~\]!is'; |
| 2503 | - $out = "index.php?id=" . '\1'; |
|
| 2503 | + $out = "index.php?id=".'\1'; |
|
| 2504 | 2504 | $documentSource = preg_replace($in, $out, $documentSource); |
| 2505 | 2505 | } |
| 2506 | 2506 | |
@@ -2521,7 +2521,7 @@ discard block |
||
| 2521 | 2521 | $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; |
| 2522 | 2522 | $len_base_url = strlen($this->config['base_url']); |
| 2523 | 2523 | |
| 2524 | - $url_path = $q;//LANG |
|
| 2524 | + $url_path = $q; //LANG |
|
| 2525 | 2525 | |
| 2526 | 2526 | if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) { |
| 2527 | 2527 | $url_path = substr($url_path, $len_base_url); |
@@ -2533,7 +2533,7 @@ discard block |
||
| 2533 | 2533 | $strictURL = substr($strictURL, $len_base_url); |
| 2534 | 2534 | } |
| 2535 | 2535 | $http_host = $_SERVER['HTTP_HOST']; |
| 2536 | - $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG |
|
| 2536 | + $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG |
|
| 2537 | 2537 | |
| 2538 | 2538 | $site_url = $this->config['site_url']; |
| 2539 | 2539 | $url_query_string = explode('?', $_SERVER['REQUEST_URI']); |
@@ -2551,7 +2551,7 @@ discard block |
||
| 2551 | 2551 | } |
| 2552 | 2552 | if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) { |
| 2553 | 2553 | if (empty($_POST)) { |
| 2554 | - if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) { |
|
| 2554 | + if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) { |
|
| 2555 | 2555 | $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently'); |
| 2556 | 2556 | exit(0); |
| 2557 | 2557 | } |
@@ -2610,7 +2610,7 @@ discard block |
||
| 2610 | 2610 | $docgrp = implode(",", $docgrp); |
| 2611 | 2611 | } |
| 2612 | 2612 | // get document |
| 2613 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 2613 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 2614 | 2614 | $rs = $this->db->select('sc.*', "{$tblsc} sc |
| 2615 | 2615 | LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1); |
| 2616 | 2616 | if ($this->db->getRecordCount($rs) < 1) { |
@@ -2646,9 +2646,9 @@ discard block |
||
| 2646 | 2646 | } |
| 2647 | 2647 | if ($documentObject['template']) { |
| 2648 | 2648 | // load TVs and merge with document - Orig by Apodigm - Docvars |
| 2649 | - $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv |
|
| 2650 | - INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 2651 | - LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'"); |
|
| 2649 | + $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars")." tv |
|
| 2650 | + INNER JOIN " . $this->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 2651 | + LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'"); |
|
| 2652 | 2652 | $tmplvars = array(); |
| 2653 | 2653 | while ($row = $this->db->getRow($rs)) { |
| 2654 | 2654 | $tmplvars[$row['name']] = array( |
@@ -2694,7 +2694,7 @@ discard block |
||
| 2694 | 2694 | $st = md5($source); |
| 2695 | 2695 | } |
| 2696 | 2696 | if ($this->dumpSnippets == 1) { |
| 2697 | - $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS " . ($i + 1) . "</b></legend><p>The following snippets (if any) were parsed during this pass.</p>"; |
|
| 2697 | + $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS ".($i + 1)."</b></legend><p>The following snippets (if any) were parsed during this pass.</p>"; |
|
| 2698 | 2698 | } |
| 2699 | 2699 | |
| 2700 | 2700 | // invoke OnParseDocument event |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | */ |
| 2737 | 2737 | public function executeParser() |
| 2738 | 2738 | { |
| 2739 | - if(MODX_CLI) { |
|
| 2739 | + if (MODX_CLI) { |
|
| 2740 | 2740 | throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); |
| 2741 | 2741 | } |
| 2742 | 2742 | |
@@ -2782,7 +2782,7 @@ discard block |
||
| 2782 | 2782 | |
| 2783 | 2783 | // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path |
| 2784 | 2784 | if ($this->config['use_alias_path'] == 1) { |
| 2785 | - $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier; |
|
| 2785 | + $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier; |
|
| 2786 | 2786 | if (isset($this->documentListing[$alias])) { |
| 2787 | 2787 | $this->documentIdentifier = $this->documentListing[$alias]; |
| 2788 | 2788 | } else { |
@@ -2843,7 +2843,7 @@ discard block |
||
| 2843 | 2843 | } else { |
| 2844 | 2844 | $docAlias = $this->db->escape($this->documentIdentifier); |
| 2845 | 2845 | $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'"); |
| 2846 | - $this->documentIdentifier = (int)$this->db->getValue($rs); |
|
| 2846 | + $this->documentIdentifier = (int) $this->db->getValue($rs); |
|
| 2847 | 2847 | } |
| 2848 | 2848 | } |
| 2849 | 2849 | $this->documentMethod = 'id'; |
@@ -2900,7 +2900,7 @@ discard block |
||
| 2900 | 2900 | $_REQUEST[$n] = $_GET[$n] = $v; |
| 2901 | 2901 | } |
| 2902 | 2902 | } |
| 2903 | - $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path']; |
|
| 2903 | + $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path']; |
|
| 2904 | 2904 | $this->q = $qp['path']; |
| 2905 | 2905 | return $qp['path']; |
| 2906 | 2906 | } |
@@ -2994,7 +2994,7 @@ discard block |
||
| 2994 | 2994 | $this->sendErrorPage(); |
| 2995 | 2995 | } else { |
| 2996 | 2996 | // Inculde the necessary files to check document permissions |
| 2997 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
| 2997 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
| 2998 | 2998 | $udperms = new udperms(); |
| 2999 | 2999 | $udperms->user = $this->getLoginUserID(); |
| 3000 | 3000 | $udperms->document = $this->documentIdentifier; |
@@ -3048,7 +3048,7 @@ discard block |
||
| 3048 | 3048 | while ($id && $height--) { |
| 3049 | 3049 | $thisid = $id; |
| 3050 | 3050 | if ($this->config['aliaslistingfolder'] == 1) { |
| 3051 | - $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM " . $this->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1"); |
|
| 3051 | + $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM ".$this->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1"); |
|
| 3052 | 3052 | if (!$id || $id == '0') { |
| 3053 | 3053 | break; |
| 3054 | 3054 | } |
@@ -3099,15 +3099,15 @@ discard block |
||
| 3099 | 3099 | |
| 3100 | 3100 | if ($this->config['aliaslistingfolder'] == 1) { |
| 3101 | 3101 | |
| 3102 | - $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); |
|
| 3102 | + $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'"); |
|
| 3103 | 3103 | $idx = array(); |
| 3104 | 3104 | while ($row = $this->db->getRow($res)) { |
| 3105 | 3105 | $pAlias = ''; |
| 3106 | 3106 | if (isset($this->aliasListing[$row['parent']])) { |
| 3107 | - $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : ''; |
|
| 3108 | - $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : ''; |
|
| 3107 | + $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : ''; |
|
| 3108 | + $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : ''; |
|
| 3109 | 3109 | }; |
| 3110 | - $children[$pAlias . $row['alias']] = $row['id']; |
|
| 3110 | + $children[$pAlias.$row['alias']] = $row['id']; |
|
| 3111 | 3111 | if ($row['isfolder'] == 1) { |
| 3112 | 3112 | $idx[] = $row['id']; |
| 3113 | 3113 | } |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | $depth--; |
| 3140 | 3140 | |
| 3141 | 3141 | foreach ($documentMap_cache[$id] as $childId) { |
| 3142 | - $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias']; |
|
| 3142 | + $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias']; |
|
| 3143 | 3143 | if (!strlen($pkey)) { |
| 3144 | 3144 | $pkey = "{$childId}"; |
| 3145 | 3145 | } |
@@ -3176,7 +3176,7 @@ discard block |
||
| 3176 | 3176 | $fnc = 'history.back(-1);'; |
| 3177 | 3177 | break; |
| 3178 | 3178 | default: |
| 3179 | - $fnc = "window.location.href='" . addslashes($url) . "';"; |
|
| 3179 | + $fnc = "window.location.href='".addslashes($url)."';"; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | |
| 3182 | 3182 | echo "<html><head> |
@@ -3208,9 +3208,9 @@ discard block |
||
| 3208 | 3208 | $state = 0; |
| 3209 | 3209 | $pms = $_SESSION['mgrPermissions']; |
| 3210 | 3210 | if ($pms) { |
| 3211 | - $state = ((bool)$pms[$pm] === true); |
|
| 3211 | + $state = ((bool) $pms[$pm] === true); |
|
| 3212 | 3212 | } |
| 3213 | - return (int)$state; |
|
| 3213 | + return (int) $state; |
|
| 3214 | 3214 | } |
| 3215 | 3215 | |
| 3216 | 3216 | /** |
@@ -3223,8 +3223,8 @@ discard block |
||
| 3223 | 3223 | */ |
| 3224 | 3224 | public function elementIsLocked($type, $id, $includeThisUser = false) |
| 3225 | 3225 | { |
| 3226 | - $id = (int)$id; |
|
| 3227 | - $type = (int)$type; |
|
| 3226 | + $id = (int) $id; |
|
| 3227 | + $type = (int) $type; |
|
| 3228 | 3228 | if (!$type || !$id) { |
| 3229 | 3229 | return null; |
| 3230 | 3230 | } |
@@ -3274,7 +3274,7 @@ discard block |
||
| 3274 | 3274 | return $lockedElements; |
| 3275 | 3275 | } |
| 3276 | 3276 | |
| 3277 | - $type = (int)$type; |
|
| 3277 | + $type = (int) $type; |
|
| 3278 | 3278 | if (isset($lockedElements[$type])) { |
| 3279 | 3279 | return $lockedElements[$type]; |
| 3280 | 3280 | } else { |
@@ -3291,7 +3291,7 @@ discard block |
||
| 3291 | 3291 | $this->lockedElements = array(); |
| 3292 | 3292 | $this->cleanupExpiredLocks(); |
| 3293 | 3293 | |
| 3294 | - $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul |
|
| 3294 | + $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks')." ul |
|
| 3295 | 3295 | LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id"); |
| 3296 | 3296 | while ($row = $this->db->getRow($rs)) { |
| 3297 | 3297 | $this->lockedElements[$row['elementType']][$row['elementId']] = array( |
@@ -3314,7 +3314,7 @@ discard block |
||
| 3314 | 3314 | public function cleanupExpiredLocks() |
| 3315 | 3315 | { |
| 3316 | 3316 | // Clean-up active_user_sessions first |
| 3317 | - $timeout = (int)$this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum |
|
| 3317 | + $timeout = (int) $this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum |
|
| 3318 | 3318 | $validSessionTimeLimit = $this->time - $timeout; |
| 3319 | 3319 | $this->db->delete($this->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}"); |
| 3320 | 3320 | |
@@ -3327,7 +3327,7 @@ discard block |
||
| 3327 | 3327 | foreach ($rs as $row) { |
| 3328 | 3328 | $userSids[] = $row['sid']; |
| 3329 | 3329 | } |
| 3330 | - $userSids = "'" . implode("','", $userSids) . "'"; |
|
| 3330 | + $userSids = "'".implode("','", $userSids)."'"; |
|
| 3331 | 3331 | $this->db->delete($this->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})"); |
| 3332 | 3332 | } else { |
| 3333 | 3333 | $this->db->delete($this->getFullTableName('active_user_locks')); |
@@ -3411,8 +3411,8 @@ discard block |
||
| 3411 | 3411 | public function lockElement($type, $id) |
| 3412 | 3412 | { |
| 3413 | 3413 | $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0; |
| 3414 | - $type = (int)$type; |
|
| 3415 | - $id = (int)$id; |
|
| 3414 | + $type = (int) $type; |
|
| 3415 | + $id = (int) $id; |
|
| 3416 | 3416 | if (!$type || !$id || !$userId) { |
| 3417 | 3417 | return false; |
| 3418 | 3418 | } |
@@ -3433,8 +3433,8 @@ discard block |
||
| 3433 | 3433 | public function unlockElement($type, $id, $includeAllUsers = false) |
| 3434 | 3434 | { |
| 3435 | 3435 | $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0; |
| 3436 | - $type = (int)$type; |
|
| 3437 | - $id = (int)$id; |
|
| 3436 | + $type = (int) $type; |
|
| 3437 | + $id = (int) $id; |
|
| 3438 | 3438 | if (!$type || !$id) { |
| 3439 | 3439 | return false; |
| 3440 | 3440 | } |
@@ -3501,8 +3501,8 @@ discard block |
||
| 3501 | 3501 | } |
| 3502 | 3502 | |
| 3503 | 3503 | $usertype = $this->isFrontend() ? 1 : 0; |
| 3504 | - $evtid = (int)$evtid; |
|
| 3505 | - $type = (int)$type; |
|
| 3504 | + $evtid = (int) $evtid; |
|
| 3505 | + $type = (int) $type; |
|
| 3506 | 3506 | |
| 3507 | 3507 | // Types: 1 = information, 2 = warning, 3 = error |
| 3508 | 3508 | if ($type < 1) { |
@@ -3524,8 +3524,8 @@ discard block |
||
| 3524 | 3524 | if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') { |
| 3525 | 3525 | if ($this->config['send_errormail'] <= $type) { |
| 3526 | 3526 | $this->sendmail(array( |
| 3527 | - 'subject' => 'MODX System Error on ' . $this->config['site_name'], |
|
| 3528 | - 'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.', |
|
| 3527 | + 'subject' => 'MODX System Error on '.$this->config['site_name'], |
|
| 3528 | + 'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.', |
|
| 3529 | 3529 | 'type' => 'text' |
| 3530 | 3530 | )); |
| 3531 | 3531 | } |
@@ -3573,7 +3573,7 @@ discard block |
||
| 3573 | 3573 | $p['fromname'] = $userinfo['username']; |
| 3574 | 3574 | } |
| 3575 | 3575 | if ($msg === '' && !isset($p['body'])) { |
| 3576 | - $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER']; |
|
| 3576 | + $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER']; |
|
| 3577 | 3577 | } elseif (is_string($msg) && 0 < strlen($msg)) { |
| 3578 | 3578 | $p['body'] = $msg; |
| 3579 | 3579 | } |
@@ -3613,8 +3613,8 @@ discard block |
||
| 3613 | 3613 | $files = array(); |
| 3614 | 3614 | } |
| 3615 | 3615 | foreach ($files as $f) { |
| 3616 | - if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) { |
|
| 3617 | - $this->mail->AddAttachment(MODX_BASE_PATH . $f); |
|
| 3616 | + if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) { |
|
| 3617 | + $this->mail->AddAttachment(MODX_BASE_PATH.$f); |
|
| 3618 | 3618 | } |
| 3619 | 3619 | } |
| 3620 | 3620 | $rs = $this->mail->send(); |
@@ -3659,7 +3659,7 @@ discard block |
||
| 3659 | 3659 | */ |
| 3660 | 3660 | public function isFrontend() |
| 3661 | 3661 | { |
| 3662 | - return ! $this->isBackend(); |
|
| 3662 | + return !$this->isBackend(); |
|
| 3663 | 3663 | } |
| 3664 | 3664 | |
| 3665 | 3665 | /** |
@@ -3684,14 +3684,14 @@ discard block |
||
| 3684 | 3684 | $tblsc = $this->getFullTableName("site_content"); |
| 3685 | 3685 | $tbldg = $this->getFullTableName("document_groups"); |
| 3686 | 3686 | // modify field names to use sc. table reference |
| 3687 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3688 | - $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3687 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3688 | + $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3689 | 3689 | // get document groups for current user |
| 3690 | 3690 | if ($docgrp = $this->getUserDocGroups()) { |
| 3691 | 3691 | $docgrp = implode(",", $docgrp); |
| 3692 | 3692 | } |
| 3693 | 3693 | // build query |
| 3694 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3694 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3695 | 3695 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3696 | 3696 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3697 | 3697 | $resourceArray = $this->db->makeArray($result); |
@@ -3721,14 +3721,14 @@ discard block |
||
| 3721 | 3721 | $tbldg = $this->getFullTableName("document_groups"); |
| 3722 | 3722 | |
| 3723 | 3723 | // modify field names to use sc. table reference |
| 3724 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3725 | - $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3724 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3725 | + $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3726 | 3726 | // get document groups for current user |
| 3727 | 3727 | if ($docgrp = $this->getUserDocGroups()) { |
| 3728 | 3728 | $docgrp = implode(",", $docgrp); |
| 3729 | 3729 | } |
| 3730 | 3730 | // build query |
| 3731 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3731 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3732 | 3732 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3733 | 3733 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3734 | 3734 | $resourceArray = $this->db->makeArray($result); |
@@ -3763,16 +3763,16 @@ discard block |
||
| 3763 | 3763 | return $this->tmpCache[__FUNCTION__][$cacheKey]; |
| 3764 | 3764 | } |
| 3765 | 3765 | |
| 3766 | - $published = ($published !== 'all') ? 'AND sc.published = ' . $published : ''; |
|
| 3767 | - $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : ''; |
|
| 3766 | + $published = ($published !== 'all') ? 'AND sc.published = '.$published : ''; |
|
| 3767 | + $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : ''; |
|
| 3768 | 3768 | |
| 3769 | 3769 | if ($where != '') { |
| 3770 | - $where = 'AND ' . $where; |
|
| 3770 | + $where = 'AND '.$where; |
|
| 3771 | 3771 | } |
| 3772 | 3772 | |
| 3773 | 3773 | // modify field names to use sc. table reference |
| 3774 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3775 | - $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3774 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3775 | + $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3776 | 3776 | |
| 3777 | 3777 | // get document groups for current user |
| 3778 | 3778 | if ($docgrp = $this->getUserDocGroups()) { |
@@ -3780,7 +3780,7 @@ discard block |
||
| 3780 | 3780 | } |
| 3781 | 3781 | |
| 3782 | 3782 | // build query |
| 3783 | - $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')'); |
|
| 3783 | + $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')'); |
|
| 3784 | 3784 | |
| 3785 | 3785 | $tblsc = $this->getFullTableName('site_content'); |
| 3786 | 3786 | $tbldg = $this->getFullTableName('document_groups'); |
@@ -3832,10 +3832,10 @@ discard block |
||
| 3832 | 3832 | return false; |
| 3833 | 3833 | } else { |
| 3834 | 3834 | // modify field names to use sc. table reference |
| 3835 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3836 | - $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3835 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3836 | + $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3837 | 3837 | if ($where != '') { |
| 3838 | - $where = 'AND ' . $where; |
|
| 3838 | + $where = 'AND '.$where; |
|
| 3839 | 3839 | } |
| 3840 | 3840 | |
| 3841 | 3841 | $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : ''; |
@@ -3846,13 +3846,13 @@ discard block |
||
| 3846 | 3846 | $docgrp = implode(',', $docgrp); |
| 3847 | 3847 | } |
| 3848 | 3848 | |
| 3849 | - $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')'); |
|
| 3849 | + $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')'); |
|
| 3850 | 3850 | |
| 3851 | 3851 | $tblsc = $this->getFullTableName('site_content'); |
| 3852 | 3852 | $tbldg = $this->getFullTableName('document_groups'); |
| 3853 | 3853 | |
| 3854 | 3854 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3855 | - LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
|
| 3855 | + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (".implode(',', $ids).") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
|
| 3856 | 3856 | |
| 3857 | 3857 | $resourceArray = $this->db->makeArray($result); |
| 3858 | 3858 | |
@@ -3957,12 +3957,12 @@ discard block |
||
| 3957 | 3957 | $tbldg = $this->getFullTableName("document_groups"); |
| 3958 | 3958 | $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : ""; |
| 3959 | 3959 | // modify field names to use sc. table reference |
| 3960 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3960 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3961 | 3961 | // get document groups for current user |
| 3962 | 3962 | if ($docgrp = $this->getUserDocGroups()) { |
| 3963 | 3963 | $docgrp = implode(",", $docgrp); |
| 3964 | 3964 | } |
| 3965 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3965 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3966 | 3966 | $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1); |
| 3967 | 3967 | $pageInfo = $this->db->getRow($result); |
| 3968 | 3968 | |
@@ -4009,7 +4009,7 @@ discard block |
||
| 4009 | 4009 | { |
| 4010 | 4010 | if ($this->currentSnippet) { |
| 4011 | 4011 | $tbl = $this->getFullTableName("site_snippets"); |
| 4012 | - $rs = $this->db->select('id', $tbl, "name='" . $this->db->escape($this->currentSnippet) . "'", '', 1); |
|
| 4012 | + $rs = $this->db->select('id', $tbl, "name='".$this->db->escape($this->currentSnippet)."'", '', 1); |
|
| 4013 | 4013 | if ($snippetId = $this->db->getValue($rs)) { |
| 4014 | 4014 | return $snippetId; |
| 4015 | 4015 | } |
@@ -4036,23 +4036,23 @@ discard block |
||
| 4036 | 4036 | */ |
| 4037 | 4037 | public function clearCache($type = '', $report = false) |
| 4038 | 4038 | { |
| 4039 | - $cache_dir = MODX_BASE_PATH . $this->getCacheFolder(); |
|
| 4039 | + $cache_dir = MODX_BASE_PATH.$this->getCacheFolder(); |
|
| 4040 | 4040 | if (is_array($type)) { |
| 4041 | 4041 | foreach ($type as $_) { |
| 4042 | 4042 | $this->clearCache($_, $report); |
| 4043 | 4043 | } |
| 4044 | 4044 | } elseif ($type == 'full') { |
| 4045 | - include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php'); |
|
| 4045 | + include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); |
|
| 4046 | 4046 | $sync = new synccache(); |
| 4047 | 4047 | $sync->setCachepath($cache_dir); |
| 4048 | 4048 | $sync->setReport($report); |
| 4049 | 4049 | $sync->emptyCache(); |
| 4050 | 4050 | } elseif (preg_match('@^[1-9][0-9]*$@', $type)) { |
| 4051 | 4051 | $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type; |
| 4052 | - $file_name = "docid_" . $key . "_*.pageCache.php"; |
|
| 4053 | - $cache_path = $cache_dir . $file_name; |
|
| 4052 | + $file_name = "docid_".$key."_*.pageCache.php"; |
|
| 4053 | + $cache_path = $cache_dir.$file_name; |
|
| 4054 | 4054 | $files = glob($cache_path); |
| 4055 | - $files[] = $cache_dir . "docid_" . $key . ".pageCache.php"; |
|
| 4055 | + $files[] = $cache_dir."docid_".$key.".pageCache.php"; |
|
| 4056 | 4056 | foreach ($files as $file) { |
| 4057 | 4057 | if (!is_file($file)) { |
| 4058 | 4058 | continue; |
@@ -4060,7 +4060,7 @@ discard block |
||
| 4060 | 4060 | unlink($file); |
| 4061 | 4061 | } |
| 4062 | 4062 | } else { |
| 4063 | - $files = glob($cache_dir . '*'); |
|
| 4063 | + $files = glob($cache_dir.'*'); |
|
| 4064 | 4064 | foreach ($files as $file) { |
| 4065 | 4065 | $name = basename($file); |
| 4066 | 4066 | if (strpos($name, '.pageCache.php') === false) { |
@@ -4129,7 +4129,7 @@ discard block |
||
| 4129 | 4129 | $f_url_suffix = '/'; |
| 4130 | 4130 | } |
| 4131 | 4131 | |
| 4132 | - $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; |
|
| 4132 | + $alPath = !empty ($al['path']) ? $al['path'].'/' : ''; |
|
| 4133 | 4133 | |
| 4134 | 4134 | if ($al && $al['alias']) { |
| 4135 | 4135 | $alias = $al['alias']; |
@@ -4137,7 +4137,7 @@ discard block |
||
| 4137 | 4137 | |
| 4138 | 4138 | } |
| 4139 | 4139 | |
| 4140 | - $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; |
|
| 4140 | + $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix; |
|
| 4141 | 4141 | $url = "{$alias}{$args}"; |
| 4142 | 4142 | } else { |
| 4143 | 4143 | $url = "index.php?id={$id}{$args}"; |
@@ -4156,7 +4156,7 @@ discard block |
||
| 4156 | 4156 | } |
| 4157 | 4157 | |
| 4158 | 4158 | //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080) |
| 4159 | - $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host; |
|
| 4159 | + $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host; |
|
| 4160 | 4160 | } |
| 4161 | 4161 | |
| 4162 | 4162 | //fix strictUrl by Bumkaka |
@@ -4165,9 +4165,9 @@ discard block |
||
| 4165 | 4165 | } |
| 4166 | 4166 | |
| 4167 | 4167 | if ($this->config['xhtml_urls']) { |
| 4168 | - $url = preg_replace("/&(?!amp;)/", "&", $host . $virtualDir . $url); |
|
| 4168 | + $url = preg_replace("/&(?!amp;)/", "&", $host.$virtualDir.$url); |
|
| 4169 | 4169 | } else { |
| 4170 | - $url = $host . $virtualDir . $url; |
|
| 4170 | + $url = $host.$virtualDir.$url; |
|
| 4171 | 4171 | } |
| 4172 | 4172 | |
| 4173 | 4173 | $evtOut = $this->invokeEvent('OnMakeDocUrl', array( |
@@ -4191,21 +4191,21 @@ discard block |
||
| 4191 | 4191 | if (isset($this->aliasListing[$id])) { |
| 4192 | 4192 | $out = $this->aliasListing[$id]; |
| 4193 | 4193 | } else { |
| 4194 | - $q = $this->db->query("SELECT id,alias,isfolder,parent FROM " . $this->getFullTableName("site_content") . " WHERE id=" . (int)$id); |
|
| 4194 | + $q = $this->db->query("SELECT id,alias,isfolder,parent FROM ".$this->getFullTableName("site_content")." WHERE id=".(int) $id); |
|
| 4195 | 4195 | if ($this->db->getRecordCount($q) == '1') { |
| 4196 | 4196 | $q = $this->db->getRow($q); |
| 4197 | 4197 | $this->aliasListing[$id] = array( |
| 4198 | - 'id' => (int)$q['id'], |
|
| 4198 | + 'id' => (int) $q['id'], |
|
| 4199 | 4199 | 'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'], |
| 4200 | - 'parent' => (int)$q['parent'], |
|
| 4201 | - 'isfolder' => (int)$q['isfolder'], |
|
| 4200 | + 'parent' => (int) $q['parent'], |
|
| 4201 | + 'isfolder' => (int) $q['isfolder'], |
|
| 4202 | 4202 | ); |
| 4203 | 4203 | if ($this->aliasListing[$id]['parent'] > 0) { |
| 4204 | 4204 | //fix alias_path_usage |
| 4205 | 4205 | if ($this->config['use_alias_path'] == '1') { |
| 4206 | 4206 | //&& $tmp['path'] != '' - fix error slash with epty path |
| 4207 | 4207 | $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']); |
| 4208 | - $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : ''); |
|
| 4208 | + $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : ''); |
|
| 4209 | 4209 | } else { |
| 4210 | 4210 | $this->aliasListing[$id]['path'] = ''; |
| 4211 | 4211 | } |
@@ -4246,7 +4246,7 @@ discard block |
||
| 4246 | 4246 | $out = array(); |
| 4247 | 4247 | if (empty($this->version) || !is_array($this->version)) { |
| 4248 | 4248 | //include for compatibility modx version < 1.0.10 |
| 4249 | - include MODX_MANAGER_PATH . "includes/version.inc.php"; |
|
| 4249 | + include MODX_MANAGER_PATH."includes/version.inc.php"; |
|
| 4250 | 4250 | $this->version = array(); |
| 4251 | 4251 | $this->version['version'] = isset($modx_version) ? $modx_version : ''; |
| 4252 | 4252 | $this->version['branch'] = isset($modx_branch) ? $modx_branch : ''; |
@@ -4268,18 +4268,18 @@ discard block |
||
| 4268 | 4268 | { |
| 4269 | 4269 | if (isset ($this->snippetCache[$snippetName])) { |
| 4270 | 4270 | $snippet = $this->snippetCache[$snippetName]; |
| 4271 | - $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; |
|
| 4271 | + $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : ''; |
|
| 4272 | 4272 | } else { // not in cache so let's check the db |
| 4273 | - $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "' AND ss.disabled=0;"; |
|
| 4273 | + $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->db->escape($snippetName)."' AND ss.disabled=0;"; |
|
| 4274 | 4274 | $result = $this->db->query($sql); |
| 4275 | 4275 | if ($this->db->getRecordCount($result) == 1) { |
| 4276 | 4276 | $row = $this->db->getRow($result); |
| 4277 | 4277 | $snippet = $this->snippetCache[$snippetName] = $row['snippet']; |
| 4278 | 4278 | $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties'])); |
| 4279 | - $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties); |
|
| 4279 | + $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties); |
|
| 4280 | 4280 | } else { |
| 4281 | 4281 | $snippet = $this->snippetCache[$snippetName] = "return false;"; |
| 4282 | - $properties = $this->snippetCache[$snippetName . "Props"] = ''; |
|
| 4282 | + $properties = $this->snippetCache[$snippetName."Props"] = ''; |
|
| 4283 | 4283 | } |
| 4284 | 4284 | } |
| 4285 | 4285 | // load default params/properties |
@@ -4379,8 +4379,8 @@ discard block |
||
| 4379 | 4379 | } |
| 4380 | 4380 | if (strpos($tpl, $s) !== false) { |
| 4381 | 4381 | $tpl = str_replace($s, $value, $tpl); |
| 4382 | - } elseif($this->debug) { |
|
| 4383 | - $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 4382 | + } elseif ($this->debug) { |
|
| 4383 | + $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 4384 | 4384 | } |
| 4385 | 4385 | } |
| 4386 | 4386 | |
@@ -4429,7 +4429,7 @@ discard block |
||
| 4429 | 4429 | case 'CODE': |
| 4430 | 4430 | break; |
| 4431 | 4431 | case 'FILE': |
| 4432 | - $template = file_get_contents(MODX_BASE_PATH . $template); |
|
| 4432 | + $template = file_get_contents(MODX_BASE_PATH.$template); |
|
| 4433 | 4433 | break; |
| 4434 | 4434 | case 'CHUNK': |
| 4435 | 4435 | $template = $this->getChunk($template); |
@@ -4462,7 +4462,7 @@ discard block |
||
| 4462 | 4462 | if ($mode !== 'formatOnly' && empty($timestamp)) { |
| 4463 | 4463 | return '-'; |
| 4464 | 4464 | } |
| 4465 | - $timestamp = (int)$timestamp; |
|
| 4465 | + $timestamp = (int) $timestamp; |
|
| 4466 | 4466 | |
| 4467 | 4467 | switch ($this->config['datetime_format']) { |
| 4468 | 4468 | case 'YYYY/mm/dd': |
@@ -4482,7 +4482,7 @@ discard block |
||
| 4482 | 4482 | } |
| 4483 | 4483 | |
| 4484 | 4484 | if (empty($mode)) { |
| 4485 | - $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp); |
|
| 4485 | + $strTime = strftime($dateFormat." %H:%M:%S", $timestamp); |
|
| 4486 | 4486 | } elseif ($mode == 'dateOnly') { |
| 4487 | 4487 | $strTime = strftime($dateFormat, $timestamp); |
| 4488 | 4488 | } elseif ($mode == 'formatOnly') { |
@@ -4536,7 +4536,7 @@ discard block |
||
| 4536 | 4536 | $S = 0; |
| 4537 | 4537 | } |
| 4538 | 4538 | $timeStamp = mktime($H, $M, $S, $m, $d, $Y); |
| 4539 | - $timeStamp = (int)$timeStamp; |
|
| 4539 | + $timeStamp = (int) $timeStamp; |
|
| 4540 | 4540 | return $timeStamp; |
| 4541 | 4541 | } |
| 4542 | 4542 | |
@@ -4578,7 +4578,7 @@ discard block |
||
| 4578 | 4578 | if ($v === 'value') { |
| 4579 | 4579 | unset($_[$i]); |
| 4580 | 4580 | } else { |
| 4581 | - $_[$i] = 'tv.' . $v; |
|
| 4581 | + $_[$i] = 'tv.'.$v; |
|
| 4582 | 4582 | } |
| 4583 | 4583 | } |
| 4584 | 4584 | $fields = implode(',', $_); |
@@ -4587,12 +4587,12 @@ discard block |
||
| 4587 | 4587 | } |
| 4588 | 4588 | |
| 4589 | 4589 | if ($tvsort != '') { |
| 4590 | - $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort)))); |
|
| 4590 | + $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort)))); |
|
| 4591 | 4591 | } |
| 4592 | 4592 | if ($tvidnames == "*") { |
| 4593 | 4593 | $query = "tv.id<>0"; |
| 4594 | 4594 | } else { |
| 4595 | - $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')"; |
|
| 4595 | + $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')"; |
|
| 4596 | 4596 | } |
| 4597 | 4597 | |
| 4598 | 4598 | $this->getUserDocGroups(); |
@@ -4736,7 +4736,7 @@ discard block |
||
| 4736 | 4736 | return $this->tmpCache[__FUNCTION__][$cacheKey]; |
| 4737 | 4737 | } |
| 4738 | 4738 | |
| 4739 | - if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { |
|
| 4739 | + if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { |
|
| 4740 | 4740 | return false; |
| 4741 | 4741 | } else { |
| 4742 | 4742 | |
@@ -4754,23 +4754,23 @@ discard block |
||
| 4754 | 4754 | } |
| 4755 | 4755 | |
| 4756 | 4756 | // get user defined template variables |
| 4757 | - $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 4758 | - $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 4757 | + $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 4758 | + $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 4759 | 4759 | |
| 4760 | 4760 | if ($idnames == '*') { |
| 4761 | 4761 | $query = 'tv.id<>0'; |
| 4762 | 4762 | } else { |
| 4763 | - $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')"; |
|
| 4763 | + $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')"; |
|
| 4764 | 4764 | } |
| 4765 | 4765 | |
| 4766 | - $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv |
|
| 4767 | - INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 4768 | - LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); |
|
| 4766 | + $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars')." tv |
|
| 4767 | + INNER JOIN " . $this->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 4768 | + LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); |
|
| 4769 | 4769 | |
| 4770 | 4770 | $result = $this->db->makeArray($rs); |
| 4771 | 4771 | |
| 4772 | 4772 | // get default/built-in template variables |
| 4773 | - if(is_array($docRow)){ |
|
| 4773 | + if (is_array($docRow)) { |
|
| 4774 | 4774 | ksort($docRow); |
| 4775 | 4775 | |
| 4776 | 4776 | foreach ($docRow as $key => $value) { |
@@ -4808,22 +4808,22 @@ discard block |
||
| 4808 | 4808 | */ |
| 4809 | 4809 | public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') |
| 4810 | 4810 | { |
| 4811 | - if (is_array($idnames) && empty($idnames) ) { |
|
| 4811 | + if (is_array($idnames) && empty($idnames)) { |
|
| 4812 | 4812 | return false; |
| 4813 | 4813 | } else { |
| 4814 | 4814 | $output = array(); |
| 4815 | 4815 | $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames); |
| 4816 | 4816 | |
| 4817 | - $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier; |
|
| 4817 | + $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier; |
|
| 4818 | 4818 | // remove sort for speed |
| 4819 | 4819 | $result = $this->getTemplateVars($vars, '*', $docid, $published, '', ''); |
| 4820 | 4820 | |
| 4821 | 4821 | if ($result == false) { |
| 4822 | 4822 | return false; |
| 4823 | 4823 | } else { |
| 4824 | - $baspath = MODX_MANAGER_PATH . 'includes'; |
|
| 4825 | - include_once $baspath . '/tmplvars.format.inc.php'; |
|
| 4826 | - include_once $baspath . '/tmplvars.commands.inc.php'; |
|
| 4824 | + $baspath = MODX_MANAGER_PATH.'includes'; |
|
| 4825 | + include_once $baspath.'/tmplvars.format.inc.php'; |
|
| 4826 | + include_once $baspath.'/tmplvars.commands.inc.php'; |
|
| 4827 | 4827 | |
| 4828 | 4828 | for ($i = 0; $i < count($result); $i++) { |
| 4829 | 4829 | $row = $result[$i]; |
@@ -4848,7 +4848,7 @@ discard block |
||
| 4848 | 4848 | */ |
| 4849 | 4849 | public function getFullTableName($tbl) |
| 4850 | 4850 | { |
| 4851 | - return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`"; |
|
| 4851 | + return $this->db->config['dbase'].".`".$this->db->config['table_prefix'].$tbl."`"; |
|
| 4852 | 4852 | } |
| 4853 | 4853 | |
| 4854 | 4854 | /** |
@@ -4927,7 +4927,7 @@ discard block |
||
| 4927 | 4927 | public function getCachePath() |
| 4928 | 4928 | { |
| 4929 | 4929 | global $base_url; |
| 4930 | - $pth = $base_url . $this->getCacheFolder(); |
|
| 4930 | + $pth = $base_url.$this->getCacheFolder(); |
|
| 4931 | 4931 | return $pth; |
| 4932 | 4932 | } |
| 4933 | 4933 | |
@@ -4979,8 +4979,8 @@ discard block |
||
| 4979 | 4979 | $out = false; |
| 4980 | 4980 | |
| 4981 | 4981 | if (!empty($context)) { |
| 4982 | - if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) { |
|
| 4983 | - $out = $_SESSION[$context . 'InternalKey']; |
|
| 4982 | + if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) { |
|
| 4983 | + $out = $_SESSION[$context.'InternalKey']; |
|
| 4984 | 4984 | } |
| 4985 | 4985 | } else { |
| 4986 | 4986 | switch (true) { |
@@ -5008,8 +5008,8 @@ discard block |
||
| 5008 | 5008 | $out = false; |
| 5009 | 5009 | |
| 5010 | 5010 | if (!empty($context)) { |
| 5011 | - if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) { |
|
| 5012 | - $out = $_SESSION[$context . 'Shortname']; |
|
| 5011 | + if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) { |
|
| 5012 | + $out = $_SESSION[$context.'Shortname']; |
|
| 5013 | 5013 | } |
| 5014 | 5014 | } else { |
| 5015 | 5015 | switch (true) { |
@@ -5080,8 +5080,8 @@ discard block |
||
| 5080 | 5080 | */ |
| 5081 | 5081 | public function getWebUserInfo($uid) |
| 5082 | 5082 | { |
| 5083 | - $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu |
|
| 5084 | - INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'"); |
|
| 5083 | + $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users")." wu |
|
| 5084 | + INNER JOIN " . $this->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'"); |
|
| 5085 | 5085 | if ($row = $this->db->getRow($rs)) { |
| 5086 | 5086 | if (!isset($row['usertype']) or !$row["usertype"]) { |
| 5087 | 5087 | $row["usertype"] = "web"; |
@@ -5117,7 +5117,7 @@ discard block |
||
| 5117 | 5117 | } else if (is_array($dg)) { |
| 5118 | 5118 | // resolve ids to names |
| 5119 | 5119 | $dgn = array(); |
| 5120 | - $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); |
|
| 5120 | + $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")"); |
|
| 5121 | 5121 | while ($row = $this->db->getRow($ds)) { |
| 5122 | 5122 | $dgn[] = $row['name']; |
| 5123 | 5123 | } |
@@ -5145,7 +5145,7 @@ discard block |
||
| 5145 | 5145 | $rt = false; |
| 5146 | 5146 | if ($_SESSION["webValidated"] == 1) { |
| 5147 | 5147 | $tbl = $this->getFullTableName("web_users"); |
| 5148 | - $ds = $this->db->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'"); |
|
| 5148 | + $ds = $this->db->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'"); |
|
| 5149 | 5149 | if ($row = $this->db->getRow($ds)) { |
| 5150 | 5150 | if ($row["password"] == md5($oldPwd)) { |
| 5151 | 5151 | if (strlen($newPwd) < 6) { |
@@ -5155,7 +5155,7 @@ discard block |
||
| 5155 | 5155 | } else { |
| 5156 | 5156 | $this->db->update(array( |
| 5157 | 5157 | 'password' => $this->db->escape($newPwd), |
| 5158 | - ), $tbl, "id='" . $this->getLoginUserID() . "'"); |
|
| 5158 | + ), $tbl, "id='".$this->getLoginUserID()."'"); |
|
| 5159 | 5159 | // invoke OnWebChangePassword event |
| 5160 | 5160 | $this->invokeEvent("OnWebChangePassword", array( |
| 5161 | 5161 | "userid" => $row["id"], |
@@ -5186,8 +5186,8 @@ discard block |
||
| 5186 | 5186 | // check cache |
| 5187 | 5187 | $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; |
| 5188 | 5188 | if (!is_array($grpNames)) { |
| 5189 | - $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn |
|
| 5190 | - INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); |
|
| 5189 | + $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names")." wgn |
|
| 5190 | + INNER JOIN " . $this->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'"); |
|
| 5191 | 5191 | $grpNames = $this->db->getColumn("name", $rs); |
| 5192 | 5192 | // save to cache |
| 5193 | 5193 | $_SESSION['webUserGroupNames'] = $grpNames; |
@@ -5220,7 +5220,7 @@ discard block |
||
| 5220 | 5220 | if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) { |
| 5221 | 5221 | $this->sjscripts[$nextpos] = $src; |
| 5222 | 5222 | } else { |
| 5223 | - $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>'; |
|
| 5223 | + $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>'; |
|
| 5224 | 5224 | } |
| 5225 | 5225 | } |
| 5226 | 5226 | |
@@ -5299,7 +5299,7 @@ discard block |
||
| 5299 | 5299 | } |
| 5300 | 5300 | |
| 5301 | 5301 | if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) { |
| 5302 | - $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>'; |
|
| 5302 | + $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>'; |
|
| 5303 | 5303 | } |
| 5304 | 5304 | if ($startup) { |
| 5305 | 5305 | $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1; |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | $eventtime = $this->getMicroTime() - $eventtime; |
| 5447 | 5447 | $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000); |
| 5448 | 5448 | foreach ($parameter as $k => $v) { |
| 5449 | - $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>'; |
|
| 5449 | + $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>'; |
|
| 5450 | 5450 | } |
| 5451 | 5451 | $this->pluginsCode .= '</fieldset><br />'; |
| 5452 | 5452 | $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime; |
@@ -5474,13 +5474,13 @@ discard block |
||
| 5474 | 5474 | $plugin = array(); |
| 5475 | 5475 | if (isset ($this->pluginCache[$pluginName])) { |
| 5476 | 5476 | $pluginCode = $this->pluginCache[$pluginName]; |
| 5477 | - $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; |
|
| 5477 | + $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : ''; |
|
| 5478 | 5478 | } else { |
| 5479 | 5479 | $pluginName = $this->db->escape($pluginName); |
| 5480 | 5480 | $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0"); |
| 5481 | 5481 | if ($row = $this->db->getRow($result)) { |
| 5482 | 5482 | $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode']; |
| 5483 | - $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties']; |
|
| 5483 | + $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties']; |
|
| 5484 | 5484 | } else { |
| 5485 | 5485 | $pluginCode = $this->pluginCache[$pluginName] = "return false;"; |
| 5486 | 5486 | $pluginProperties = ''; |
@@ -5583,7 +5583,7 @@ discard block |
||
| 5583 | 5583 | public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false) |
| 5584 | 5584 | { |
| 5585 | 5585 | $params = array(); |
| 5586 | - $fullpath = $element_dir . '/' . $filename; |
|
| 5586 | + $fullpath = $element_dir.'/'.$filename; |
|
| 5587 | 5587 | if (is_readable($fullpath)) { |
| 5588 | 5588 | $tpl = @fopen($fullpath, "r"); |
| 5589 | 5589 | if ($tpl) { |
@@ -5750,8 +5750,8 @@ discard block |
||
| 5750 | 5750 | $ph = array('site_url' => MODX_SITE_URL); |
| 5751 | 5751 | $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/"; |
| 5752 | 5752 | $regexEmail = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i'; |
| 5753 | - $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : ''; |
|
| 5754 | - $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : ''; |
|
| 5753 | + $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : ''; |
|
| 5754 | + $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : ''; |
|
| 5755 | 5755 | foreach ($parsed as $key => $val) { |
| 5756 | 5756 | if (is_array($val)) { |
| 5757 | 5757 | foreach ($val as $key2 => $val2) { |
@@ -5760,7 +5760,7 @@ discard block |
||
| 5760 | 5760 | $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2); |
| 5761 | 5761 | } |
| 5762 | 5762 | if (preg_match($regexEmail, $val2, $url)) { |
| 5763 | - $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2); |
|
| 5763 | + $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2); |
|
| 5764 | 5764 | } |
| 5765 | 5765 | $parsed[$key][$key2] = $val2; |
| 5766 | 5766 | } |
@@ -5770,7 +5770,7 @@ discard block |
||
| 5770 | 5770 | $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val); |
| 5771 | 5771 | } |
| 5772 | 5772 | if (preg_match($regexEmail, $val, $url)) { |
| 5773 | - $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val); |
|
| 5773 | + $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val); |
|
| 5774 | 5774 | } |
| 5775 | 5775 | $parsed[$key] = $val; |
| 5776 | 5776 | } |
@@ -5784,32 +5784,32 @@ discard block |
||
| 5784 | 5784 | ); |
| 5785 | 5785 | |
| 5786 | 5786 | $nl = "\n"; |
| 5787 | - $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : ''; |
|
| 5788 | - $list .= '<p>' . $nl; |
|
| 5789 | - $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : ''; |
|
| 5790 | - $list .= isset($parsed['description']) ? $parsed['description'] . $nl : ''; |
|
| 5791 | - $list .= '</p><br/>' . $nl; |
|
| 5792 | - $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : ''; |
|
| 5793 | - $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : ''; |
|
| 5794 | - $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : ''; |
|
| 5795 | - $list .= '<br/>' . $nl; |
|
| 5787 | + $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : ''; |
|
| 5788 | + $list .= '<p>'.$nl; |
|
| 5789 | + $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : ''; |
|
| 5790 | + $list .= isset($parsed['description']) ? $parsed['description'].$nl : ''; |
|
| 5791 | + $list .= '</p><br/>'.$nl; |
|
| 5792 | + $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : ''; |
|
| 5793 | + $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : ''; |
|
| 5794 | + $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : ''; |
|
| 5795 | + $list .= '<br/>'.$nl; |
|
| 5796 | 5796 | $first = true; |
| 5797 | 5797 | foreach ($arrayParams as $param => $label) { |
| 5798 | 5798 | if (isset($parsed[$param])) { |
| 5799 | 5799 | if ($first) { |
| 5800 | - $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl; |
|
| 5801 | - $list .= '<ul class="docBlockList">' . $nl; |
|
| 5800 | + $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl; |
|
| 5801 | + $list .= '<ul class="docBlockList">'.$nl; |
|
| 5802 | 5802 | $first = false; |
| 5803 | 5803 | } |
| 5804 | - $list .= ' <li><strong>' . $label . '</strong>' . $nl; |
|
| 5805 | - $list .= ' <ul>' . $nl; |
|
| 5804 | + $list .= ' <li><strong>'.$label.'</strong>'.$nl; |
|
| 5805 | + $list .= ' <ul>'.$nl; |
|
| 5806 | 5806 | foreach ($parsed[$param] as $val) { |
| 5807 | - $list .= ' <li>' . $val . '</li>' . $nl; |
|
| 5807 | + $list .= ' <li>'.$val.'</li>'.$nl; |
|
| 5808 | 5808 | } |
| 5809 | - $list .= ' </ul></li>' . $nl; |
|
| 5809 | + $list .= ' </ul></li>'.$nl; |
|
| 5810 | 5810 | } |
| 5811 | 5811 | } |
| 5812 | - $list .= !$first ? '</ul>' . $nl : ''; |
|
| 5812 | + $list .= !$first ? '</ul>'.$nl : ''; |
|
| 5813 | 5813 | |
| 5814 | 5814 | return $list; |
| 5815 | 5815 | } |
@@ -5885,7 +5885,7 @@ discard block |
||
| 5885 | 5885 | */ |
| 5886 | 5886 | public function addSnippet($name, $phpCode) |
| 5887 | 5887 | { |
| 5888 | - $this->snippetCache['#' . $name] = $phpCode; |
|
| 5888 | + $this->snippetCache['#'.$name] = $phpCode; |
|
| 5889 | 5889 | } |
| 5890 | 5890 | |
| 5891 | 5891 | /** |
@@ -5894,7 +5894,7 @@ discard block |
||
| 5894 | 5894 | */ |
| 5895 | 5895 | public function addChunk($name, $text) |
| 5896 | 5896 | { |
| 5897 | - $this->chunkCache['#' . $name] = $text; |
|
| 5897 | + $this->chunkCache['#'.$name] = $text; |
|
| 5898 | 5898 | } |
| 5899 | 5899 | |
| 5900 | 5900 | /** |
@@ -5930,7 +5930,7 @@ discard block |
||
| 5930 | 5930 | } |
| 5931 | 5931 | |
| 5932 | 5932 | if (!$isSafe) { |
| 5933 | - $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true); |
|
| 5933 | + $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true); |
|
| 5934 | 5934 | $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50))); |
| 5935 | 5935 | $this->messageQuit($title, '', true, '', '', 'Parser', $msg); |
| 5936 | 5936 | return; |
@@ -5944,7 +5944,7 @@ discard block |
||
| 5944 | 5944 | return 'array()'; |
| 5945 | 5945 | } |
| 5946 | 5946 | |
| 5947 | - $output = $echo . $return; |
|
| 5947 | + $output = $echo.$return; |
|
| 5948 | 5948 | modx_sanitize_gpc($output); |
| 5949 | 5949 | return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous |
| 5950 | 5950 | } |
@@ -5962,8 +5962,8 @@ discard block |
||
| 5962 | 5962 | |
| 5963 | 5963 | $safe = explode(',', $safe_functions); |
| 5964 | 5964 | |
| 5965 | - $phpcode = rtrim($phpcode, ';') . ';'; |
|
| 5966 | - $tokens = token_get_all('<?php ' . $phpcode); |
|
| 5965 | + $phpcode = rtrim($phpcode, ';').';'; |
|
| 5966 | + $tokens = token_get_all('<?php '.$phpcode); |
|
| 5967 | 5967 | foreach ($tokens as $i => $token) { |
| 5968 | 5968 | if (!is_array($token)) { |
| 5969 | 5969 | continue; |
@@ -5999,7 +5999,7 @@ discard block |
||
| 5999 | 5999 | public function atBindFileContent($str = '') |
| 6000 | 6000 | { |
| 6001 | 6001 | |
| 6002 | - $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); |
|
| 6002 | + $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', ''); |
|
| 6003 | 6003 | |
| 6004 | 6004 | if (stripos($str, '@FILE') !== 0) { |
| 6005 | 6005 | return $str; |
@@ -6022,7 +6022,7 @@ discard block |
||
| 6022 | 6022 | $errorMsg = sprintf("Could not retrieve string '%s'.", $str); |
| 6023 | 6023 | |
| 6024 | 6024 | foreach ($search_path as $path) { |
| 6025 | - $file_path = MODX_BASE_PATH . $path . $str; |
|
| 6025 | + $file_path = MODX_BASE_PATH.$path.$str; |
|
| 6026 | 6026 | if (strpos($file_path, MODX_MANAGER_PATH) === 0) { |
| 6027 | 6027 | return $errorMsg; |
| 6028 | 6028 | } elseif (is_file($file_path)) { |
@@ -6036,7 +6036,7 @@ discard block |
||
| 6036 | 6036 | return $errorMsg; |
| 6037 | 6037 | } |
| 6038 | 6038 | |
| 6039 | - $content = (string)file_get_contents($file_path); |
|
| 6039 | + $content = (string) file_get_contents($file_path); |
|
| 6040 | 6040 | if ($content === false) { |
| 6041 | 6041 | return $errorMsg; |
| 6042 | 6042 | } |
@@ -6149,22 +6149,22 @@ discard block |
||
| 6149 | 6149 | |
| 6150 | 6150 | $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; |
| 6151 | 6151 | $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; |
| 6152 | - $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; |
|
| 6152 | + $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI']; |
|
| 6153 | 6153 | $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); |
| 6154 | 6154 | $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); |
| 6155 | 6155 | $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']); |
| 6156 | 6156 | if ($is_error) { |
| 6157 | 6157 | $str = '<h2 style="color:red">« Evo Parse Error »</h2>'; |
| 6158 | 6158 | if ($msg != 'PHP Parse Error') { |
| 6159 | - $str .= '<h3 style="color:red">' . $msg . '</h3>'; |
|
| 6159 | + $str .= '<h3 style="color:red">'.$msg.'</h3>'; |
|
| 6160 | 6160 | } |
| 6161 | 6161 | } else { |
| 6162 | 6162 | $str = '<h2 style="color:#003399">« Evo Debug/ stop message »</h2>'; |
| 6163 | - $str .= '<h3 style="color:#003399">' . $msg . '</h3>'; |
|
| 6163 | + $str .= '<h3 style="color:#003399">'.$msg.'</h3>'; |
|
| 6164 | 6164 | } |
| 6165 | 6165 | |
| 6166 | 6166 | if (!empty ($query)) { |
| 6167 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL > <span id="sqlHolder">' . $query . '</span></div>'; |
|
| 6167 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL > <span id="sqlHolder">'.$query.'</span></div>'; |
|
| 6168 | 6168 | } |
| 6169 | 6169 | |
| 6170 | 6170 | $errortype = array( |
@@ -6187,13 +6187,13 @@ discard block |
||
| 6187 | 6187 | |
| 6188 | 6188 | if (!empty($nr) || !empty($file)) { |
| 6189 | 6189 | if ($text != '') { |
| 6190 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>'; |
|
| 6190 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>'; |
|
| 6191 | 6191 | } |
| 6192 | 6192 | if ($output != '') { |
| 6193 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>'; |
|
| 6193 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>'; |
|
| 6194 | 6194 | } |
| 6195 | 6195 | if ($nr !== '') { |
| 6196 | - $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]"); |
|
| 6196 | + $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]"); |
|
| 6197 | 6197 | } |
| 6198 | 6198 | if ($file) { |
| 6199 | 6199 | $table[] = array('File', $file); |
@@ -6213,7 +6213,7 @@ discard block |
||
| 6213 | 6213 | } |
| 6214 | 6214 | |
| 6215 | 6215 | if (!empty($this->event->activePlugin)) { |
| 6216 | - $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')'); |
|
| 6216 | + $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')'); |
|
| 6217 | 6217 | } |
| 6218 | 6218 | |
| 6219 | 6219 | $str .= $MakeTable->create($table, array('Error information', '')); |
@@ -6223,17 +6223,17 @@ discard block |
||
| 6223 | 6223 | $table[] = array('REQUEST_URI', $request_uri); |
| 6224 | 6224 | |
| 6225 | 6225 | if ($this->manager->action) { |
| 6226 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 6226 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
| 6227 | 6227 | global $action_list; |
| 6228 | 6228 | $actionName = (isset($action_list[$this->manager->action])) ? " - {$action_list[$this->manager->action]}" : ''; |
| 6229 | 6229 | |
| 6230 | - $table[] = array('Manager action', $this->manager->action . $actionName); |
|
| 6230 | + $table[] = array('Manager action', $this->manager->action.$actionName); |
|
| 6231 | 6231 | } |
| 6232 | 6232 | |
| 6233 | 6233 | if (preg_match('@^[0-9]+@', $this->documentIdentifier)) { |
| 6234 | 6234 | $resource = $this->getDocumentObject('id', $this->documentIdentifier); |
| 6235 | 6235 | $url = $this->makeUrl($this->documentIdentifier, '', '', 'full'); |
| 6236 | - $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>'); |
|
| 6236 | + $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>'); |
|
| 6237 | 6237 | } |
| 6238 | 6238 | $table[] = array('Referer', $referer); |
| 6239 | 6239 | $table[] = array('User Agent', $ua); |
@@ -6254,7 +6254,7 @@ discard block |
||
| 6254 | 6254 | |
| 6255 | 6255 | $mem = memory_get_peak_usage(true); |
| 6256 | 6256 | $total_mem = $mem - $this->mstart; |
| 6257 | - $total_mem = ($total_mem / 1024 / 1024) . ' mb'; |
|
| 6257 | + $total_mem = ($total_mem / 1024 / 1024).' mb'; |
|
| 6258 | 6258 | |
| 6259 | 6259 | $queryTime = $this->queryTime; |
| 6260 | 6260 | $phpTime = $totalTime - $queryTime; |
@@ -6275,18 +6275,18 @@ discard block |
||
| 6275 | 6275 | $str .= $this->get_backtrace(debug_backtrace()); |
| 6276 | 6276 | // Log error |
| 6277 | 6277 | if (!empty($this->currentSnippet)) { |
| 6278 | - $source = 'Snippet - ' . $this->currentSnippet; |
|
| 6278 | + $source = 'Snippet - '.$this->currentSnippet; |
|
| 6279 | 6279 | } elseif (!empty($this->event->activePlugin)) { |
| 6280 | - $source = 'Plugin - ' . $this->event->activePlugin; |
|
| 6280 | + $source = 'Plugin - '.$this->event->activePlugin; |
|
| 6281 | 6281 | } elseif ($source !== '') { |
| 6282 | - $source = 'Parser - ' . $source; |
|
| 6282 | + $source = 'Parser - '.$source; |
|
| 6283 | 6283 | } elseif ($query !== '') { |
| 6284 | 6284 | $source = 'SQL Query'; |
| 6285 | 6285 | } else { |
| 6286 | 6286 | $source = 'Parser'; |
| 6287 | 6287 | } |
| 6288 | 6288 | if ($msg) { |
| 6289 | - $source .= ' / ' . $msg; |
|
| 6289 | + $source .= ' / '.$msg; |
|
| 6290 | 6290 | } |
| 6291 | 6291 | if (isset($actionName) && !empty($actionName)) { |
| 6292 | 6292 | $source .= $actionName; |
@@ -6318,12 +6318,12 @@ discard block |
||
| 6318 | 6318 | |
| 6319 | 6319 | // Display error |
| 6320 | 6320 | if (isset($_SESSION['mgrValidated'])) { |
| 6321 | - echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager ' . $version . ' » ' . $release_date . '</title> |
|
| 6321 | + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager '.$version.' » '.$release_date.'</title> |
|
| 6322 | 6322 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6323 | - <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" /> |
|
| 6323 | + <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" /> |
|
| 6324 | 6324 | <style type="text/css">body { padding:10px; } td {font:inherit;}</style> |
| 6325 | 6325 | </head><body> |
| 6326 | - ' . $str . '</body></html>'; |
|
| 6326 | + ' . $str.'</body></html>'; |
|
| 6327 | 6327 | |
| 6328 | 6328 | } else { |
| 6329 | 6329 | echo 'Error'; |
@@ -6361,7 +6361,7 @@ discard block |
||
| 6361 | 6361 | switch ($val['type']) { |
| 6362 | 6362 | case '->': |
| 6363 | 6363 | case '::': |
| 6364 | - $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function']; |
|
| 6364 | + $functionName = $val['function'] = $val['class'].$val['type'].$val['function']; |
|
| 6365 | 6365 | break; |
| 6366 | 6366 | default: |
| 6367 | 6367 | $functionName = $val['function']; |
@@ -6371,7 +6371,7 @@ discard block |
||
| 6371 | 6371 | $args = array_pad(array(), $_, '$var'); |
| 6372 | 6372 | $args = implode(", ", $args); |
| 6373 | 6373 | $modx = &$this; |
| 6374 | - $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { |
|
| 6374 | + $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) { |
|
| 6375 | 6375 | $arg = $val['args'][$tmp - 1]; |
| 6376 | 6376 | switch (true) { |
| 6377 | 6377 | case is_null($arg): { |
@@ -6383,7 +6383,7 @@ discard block |
||
| 6383 | 6383 | break; |
| 6384 | 6384 | } |
| 6385 | 6385 | case is_scalar($arg): { |
| 6386 | - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); |
|
| 6386 | + $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->htmlspecialchars(str_replace("'", "\\'", $arg))."'"); |
|
| 6387 | 6387 | break; |
| 6388 | 6388 | } |
| 6389 | 6389 | case is_bool($arg): { |
@@ -6391,23 +6391,23 @@ discard block |
||
| 6391 | 6391 | break; |
| 6392 | 6392 | } |
| 6393 | 6393 | case is_array($arg): { |
| 6394 | - $out = 'array $var' . $tmp; |
|
| 6394 | + $out = 'array $var'.$tmp; |
|
| 6395 | 6395 | break; |
| 6396 | 6396 | } |
| 6397 | 6397 | case is_object($arg): { |
| 6398 | - $out = get_class($arg) . ' $var' . $tmp; |
|
| 6398 | + $out = get_class($arg).' $var'.$tmp; |
|
| 6399 | 6399 | break; |
| 6400 | 6400 | } |
| 6401 | 6401 | default: { |
| 6402 | - $out = '$var' . $tmp; |
|
| 6402 | + $out = '$var'.$tmp; |
|
| 6403 | 6403 | } |
| 6404 | 6404 | } |
| 6405 | 6405 | $tmp++; |
| 6406 | 6406 | return $out; |
| 6407 | 6407 | }, $args); |
| 6408 | 6408 | $line = array( |
| 6409 | - "<strong>" . $functionName . "</strong>(" . $args . ")", |
|
| 6410 | - $path . " on line " . $val['line'] |
|
| 6409 | + "<strong>".$functionName."</strong>(".$args.")", |
|
| 6410 | + $path." on line ".$val['line'] |
|
| 6411 | 6411 | ); |
| 6412 | 6412 | $table[] = array(implode("<br />", $line)); |
| 6413 | 6413 | } |
@@ -6448,7 +6448,7 @@ discard block |
||
| 6448 | 6448 | $alias = strip_tags($alias); // strip HTML |
| 6449 | 6449 | $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters |
| 6450 | 6450 | $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash |
| 6451 | - $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one |
|
| 6451 | + $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one |
|
| 6452 | 6452 | $alias = trim($alias, '-'); // trim excess |
| 6453 | 6453 | return $alias; |
| 6454 | 6454 | } |
@@ -6464,7 +6464,7 @@ discard block |
||
| 6464 | 6464 | $precisions = count($sizes) - 1; |
| 6465 | 6465 | foreach ($sizes as $unit => $bytes) { |
| 6466 | 6466 | if ($size >= $bytes) { |
| 6467 | - return number_format($size / $bytes, $precisions) . ' ' . $unit; |
|
| 6467 | + return number_format($size / $bytes, $precisions).' '.$unit; |
|
| 6468 | 6468 | } |
| 6469 | 6469 | $precisions--; |
| 6470 | 6470 | } |
@@ -6568,10 +6568,10 @@ discard block |
||
| 6568 | 6568 | |
| 6569 | 6569 | if (strpos($str, MODX_MANAGER_PATH) === 0) { |
| 6570 | 6570 | return false; |
| 6571 | - } elseif (is_file(MODX_BASE_PATH . $str)) { |
|
| 6572 | - $file_path = MODX_BASE_PATH . $str; |
|
| 6573 | - } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) { |
|
| 6574 | - $file_path = MODX_BASE_PATH . $tpl_dir . $str; |
|
| 6571 | + } elseif (is_file(MODX_BASE_PATH.$str)) { |
|
| 6572 | + $file_path = MODX_BASE_PATH.$str; |
|
| 6573 | + } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) { |
|
| 6574 | + $file_path = MODX_BASE_PATH.$tpl_dir.$str; |
|
| 6575 | 6575 | } else { |
| 6576 | 6576 | return false; |
| 6577 | 6577 | } |
@@ -6697,7 +6697,7 @@ discard block |
||
| 6697 | 6697 | $title = 'no title'; |
| 6698 | 6698 | } |
| 6699 | 6699 | if (is_array($msg)) { |
| 6700 | - $msg = '<pre>' . print_r($msg, true) . '</pre>'; |
|
| 6700 | + $msg = '<pre>'.print_r($msg, true).'</pre>'; |
|
| 6701 | 6701 | } elseif ($msg === '') { |
| 6702 | 6702 | $msg = $_SERVER['REQUEST_URI']; |
| 6703 | 6703 | } |
@@ -6742,7 +6742,7 @@ discard block |
||
| 6742 | 6742 | if (is_array($SystemAlertMsgQueque)) { |
| 6743 | 6743 | $title = ''; |
| 6744 | 6744 | if ($this->name && $this->activePlugin) { |
| 6745 | - $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>"; |
|
| 6745 | + $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>"; |
|
| 6746 | 6746 | } |
| 6747 | 6747 | $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>"; |
| 6748 | 6748 | } |