@@ -8,13 +8,13 @@ discard block |
||
| 8 | 8 | * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html |
| 9 | 9 | * @author Agel_Nash <[email protected]> |
| 10 | 10 | */ |
| 11 | -include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
|
| 12 | -include_once(MODX_BASE_PATH . 'assets/lib/Helpers/FS.php'); |
|
| 13 | -require_once(dirname(dirname(__FILE__)) . "/lib/jsonHelper.class.php"); |
|
| 14 | -require_once(dirname(dirname(__FILE__)) . "/lib/sqlHelper.class.php"); |
|
| 15 | -require_once(dirname(dirname(__FILE__)) . "/lib/DLTemplate.class.php"); |
|
| 16 | -require_once(dirname(dirname(__FILE__)) . "/lib/DLCollection.class.php"); |
|
| 17 | -require_once(dirname(dirname(__FILE__)) . "/lib/xnop.class.php"); |
|
| 11 | +include_once(MODX_BASE_PATH.'assets/lib/APIHelpers.class.php'); |
|
| 12 | +include_once(MODX_BASE_PATH.'assets/lib/Helpers/FS.php'); |
|
| 13 | +require_once(dirname(dirname(__FILE__))."/lib/jsonHelper.class.php"); |
|
| 14 | +require_once(dirname(dirname(__FILE__))."/lib/sqlHelper.class.php"); |
|
| 15 | +require_once(dirname(dirname(__FILE__))."/lib/DLTemplate.class.php"); |
|
| 16 | +require_once(dirname(dirname(__FILE__))."/lib/DLCollection.class.php"); |
|
| 17 | +require_once(dirname(dirname(__FILE__))."/lib/xnop.class.php"); |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Class DocLister |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | case ')': |
| 275 | 275 | $open--; |
| 276 | 276 | if ($open == 0) { |
| 277 | - $res[] = $cur . ')'; |
|
| 277 | + $res[] = $cur.')'; |
|
| 278 | 278 | $cur = ''; |
| 279 | 279 | } else { |
| 280 | 280 | $cur .= $e; |
@@ -348,8 +348,8 @@ discard block |
||
| 348 | 348 | ini_set('display_errors', 1); |
| 349 | 349 | } |
| 350 | 350 | $dir = dirname(dirname(__FILE__)); |
| 351 | - if (file_exists($dir . "/lib/DLdebug.class.php")) { |
|
| 352 | - include_once($dir . "/lib/DLdebug.class.php"); |
|
| 351 | + if (file_exists($dir."/lib/DLdebug.class.php")) { |
|
| 352 | + include_once($dir."/lib/DLdebug.class.php"); |
|
| 353 | 353 | if (class_exists("DLdebug", false)) { |
| 354 | 354 | $this->debug = new DLdebug($this); |
| 355 | 355 | } |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | } |
| 388 | 388 | $table = $this->_table[$name]; |
| 389 | 389 | if (!empty($alias) && is_scalar($alias)) { |
| 390 | - $table .= " as `" . $alias . "`"; |
|
| 390 | + $table .= " as `".$alias."`"; |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | return $table; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | */ |
| 428 | 428 | public function loadConfig($name) |
| 429 | 429 | { |
| 430 | - $this->debug->debug('Load json config: ' . $this->debug->dumpData($name), 'loadconfig', 2); |
|
| 430 | + $this->debug->debug('Load json config: '.$this->debug->dumpData($name), 'loadconfig', 2); |
|
| 431 | 431 | if (!is_scalar($name)) { |
| 432 | 432 | $name = ''; |
| 433 | 433 | } |
@@ -442,10 +442,10 @@ discard block |
||
| 442 | 442 | switch ($cfgName[1]) { |
| 443 | 443 | case 'custom': |
| 444 | 444 | case 'core': |
| 445 | - $configFile = dirname(dirname(__FILE__)) . "/config/{$cfgName[1]}/{$cfgName[0]}.json"; |
|
| 445 | + $configFile = dirname(dirname(__FILE__))."/config/{$cfgName[1]}/{$cfgName[0]}.json"; |
|
| 446 | 446 | break; |
| 447 | 447 | default: |
| 448 | - $configFile = $this->FS->relativePath($cfgName[1] . '/' . $cfgName[0] . ".json"); |
|
| 448 | + $configFile = $this->FS->relativePath($cfgName[1].'/'.$cfgName[0].".json"); |
|
| 449 | 449 | break; |
| 450 | 450 | } |
| 451 | 451 | |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | */ |
| 472 | 472 | public function jsonDecode($json, $config = array(), $nop = false) |
| 473 | 473 | { |
| 474 | - $this->debug->debug('Decode JSON: ' . $this->debug->dumpData($json) . "\r\nwith config: " . $this->debug->dumpData($config), |
|
| 474 | + $this->debug->debug('Decode JSON: '.$this->debug->dumpData($json)."\r\nwith config: ".$this->debug->dumpData($config), |
|
| 475 | 475 | 'jsonDecode', 2); |
| 476 | 476 | $config = jsonHelper::jsonDecode($json, $config, $nop); |
| 477 | 477 | $this->isErrorJSON($json); |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | { |
| 491 | 491 | $error = jsonHelper::json_last_error_msg(); |
| 492 | 492 | if (!in_array($error, array('error_none', 'other'))) { |
| 493 | - $this->debug->error($this->getMsg('json.' . $error) . ": " . $this->debug->dumpData($json, 'code'), 'JSON'); |
|
| 493 | + $this->debug->error($this->getMsg('json.'.$error).": ".$this->debug->dumpData($json, 'code'), 'JSON'); |
|
| 494 | 494 | $error = true; |
| 495 | 495 | } |
| 496 | 496 | |
@@ -574,12 +574,12 @@ discard block |
||
| 574 | 574 | * @param int $id уникальный идентификатор страницы |
| 575 | 575 | * @return string URL страницы |
| 576 | 576 | */ |
| 577 | - public function getUrl($id = 0){ |
|
| 577 | + public function getUrl($id = 0) { |
|
| 578 | 578 | $id = ((int)$id > 0) ? (int)$id : $this->getCurrentMODXPageID(); |
| 579 | 579 | |
| 580 | 580 | $link = $this->checkExtender('request') ? $this->extender['request']->getLink() : $this->getRequest(); |
| 581 | 581 | if ($id == $this->modx->config['site_start']) { |
| 582 | - $url = $this->modx->config['site_url'] . ($link != '' ? "?{$link}" : ""); |
|
| 582 | + $url = $this->modx->config['site_url'].($link != '' ? "?{$link}" : ""); |
|
| 583 | 583 | } else { |
| 584 | 584 | $url = $this->modx->makeUrl($id, '', $link, $this->getCFGDef('urlScheme', '')); |
| 585 | 585 | } |
@@ -656,13 +656,13 @@ discard block |
||
| 656 | 656 | public function ErrorLogger($message, $code, $file, $line, $trace) |
| 657 | 657 | { |
| 658 | 658 | if (abs($this->getCFGDef('debug', '0')) == '1') { |
| 659 | - $out = "CODE #" . $code . "<br />"; |
|
| 660 | - $out .= "on file: " . $file . ":" . $line . "<br />"; |
|
| 659 | + $out = "CODE #".$code."<br />"; |
|
| 660 | + $out .= "on file: ".$file.":".$line."<br />"; |
|
| 661 | 661 | $out .= "<pre>"; |
| 662 | 662 | $out .= print_r($trace, 1); |
| 663 | 663 | $out .= "</pre>"; |
| 664 | 664 | |
| 665 | - $message = $out . $message; |
|
| 665 | + $message = $out.$message; |
|
| 666 | 666 | } |
| 667 | 667 | die($message); |
| 668 | 668 | } |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | $ext = explode(",", $ext); |
| 691 | 691 | foreach ($ext as $item) { |
| 692 | 692 | if ($item != '' && !$this->_loadExtender($item)) { |
| 693 | - throw new Exception('Error load ' . APIHelpers::e($item) . ' extender'); |
|
| 693 | + throw new Exception('Error load '.APIHelpers::e($item).' extender'); |
|
| 694 | 694 | } |
| 695 | 695 | } |
| 696 | 696 | } |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | $out = DLTemplate::getInstance($this->getMODX())->toPlaceholders($data, $set, $key, $id); |
| 774 | 774 | |
| 775 | 775 | $this->debug->debugEnd( |
| 776 | - "toPlaceholders", array($key . " placeholder" => $data), array('html') |
|
| 776 | + "toPlaceholders", array($key." placeholder" => $data), array('html') |
|
| 777 | 777 | ); |
| 778 | 778 | |
| 779 | 779 | return $out; |
@@ -801,7 +801,7 @@ discard block |
||
| 801 | 801 | } |
| 802 | 802 | } |
| 803 | 803 | $q = $quote ? "'" : ""; |
| 804 | - $out = $q . implode($q . "," . $q, $out) . $q; |
|
| 804 | + $out = $q.implode($q.",".$q, $out).$q; |
|
| 805 | 805 | |
| 806 | 806 | return $out; |
| 807 | 807 | } |
@@ -822,8 +822,8 @@ discard block |
||
| 822 | 822 | if (empty($lang)) { |
| 823 | 823 | $lang = $this->getCFGDef('lang', $this->modx->config['manager_language']); |
| 824 | 824 | } |
| 825 | - if (file_exists(dirname(dirname(__FILE__)) . "/lang/" . $lang . ".php")) { |
|
| 826 | - $tmp = include(dirname(__FILE__) . "/lang/" . $lang . ".php"); |
|
| 825 | + if (file_exists(dirname(dirname(__FILE__))."/lang/".$lang.".php")) { |
|
| 826 | + $tmp = include(dirname(__FILE__)."/lang/".$lang.".php"); |
|
| 827 | 827 | $this->_customLang = is_array($tmp) ? $tmp : array(); |
| 828 | 828 | } |
| 829 | 829 | |
@@ -844,14 +844,14 @@ discard block |
||
| 844 | 844 | $lang = $this->getCFGDef('lang', $this->modx->config['manager_language']); |
| 845 | 845 | } |
| 846 | 846 | |
| 847 | - $this->debug->debug('Load language ' . $this->debug->dumpData($name) . "." . $this->debug->dumpData($lang), |
|
| 847 | + $this->debug->debug('Load language '.$this->debug->dumpData($name).".".$this->debug->dumpData($lang), |
|
| 848 | 848 | 'loadlang', 2); |
| 849 | 849 | if (is_scalar($name)) { |
| 850 | 850 | $name = array($name); |
| 851 | 851 | } |
| 852 | 852 | foreach ($name as $n) { |
| 853 | - if (file_exists(dirname(__FILE__) . "/lang/" . $lang . "/" . $n . ".inc.php")) { |
|
| 854 | - $tmp = include(dirname(__FILE__) . "/lang/" . $lang . "/" . $n . ".inc.php"); |
|
| 853 | + if (file_exists(dirname(__FILE__)."/lang/".$lang."/".$n.".inc.php")) { |
|
| 854 | + $tmp = include(dirname(__FILE__)."/lang/".$lang."/".$n.".inc.php"); |
|
| 855 | 855 | if (is_array($tmp)) { |
| 856 | 856 | /** |
| 857 | 857 | * Переименовыываем элементы массива из array('test'=>'data') в array('name.test'=>'data') |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | - $data[$this->getCFGDef("sysKey", "dl") . ".wrap"] = $this->renderWrap($out); |
|
| 937 | + $data[$this->getCFGDef("sysKey", "dl").".wrap"] = $this->renderWrap($out); |
|
| 938 | 938 | $out = $this->parseChunk($this->getCFGDef('tpl', ''), $data); |
| 939 | 939 | |
| 940 | 940 | return $out; |
@@ -1000,7 +1000,7 @@ discard block |
||
| 1000 | 1000 | ); |
| 1001 | 1001 | $out = DLTemplate::getInstance($this->getMODX())->parseChunk($name, $data, $parseDocumentSource); |
| 1002 | 1002 | if (empty($out)) { |
| 1003 | - $this->debug->debug("Empty chunk: " . $this->debug->dumpData($name), '', 2); |
|
| 1003 | + $this->debug->debug("Empty chunk: ".$this->debug->dumpData($name), '', 2); |
|
| 1004 | 1004 | } |
| 1005 | 1005 | $this->debug->debugEnd("parseChunk"); |
| 1006 | 1006 | |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | if ((($this->getCFGDef("noneWrapOuter", "1") && $docs == 0) || $docs > 0) && !empty($this->ownerTPL)) { |
| 1037 | 1037 | $this->debug->debug("", "renderWrapTPL", 2); |
| 1038 | 1038 | $parse = true; |
| 1039 | - $plh = array($this->getCFGDef("sysKey", "dl") . ".wrap" => $data); |
|
| 1039 | + $plh = array($this->getCFGDef("sysKey", "dl").".wrap" => $data); |
|
| 1040 | 1040 | /** |
| 1041 | 1041 | * @var $extPrepare prepare_DL_Extender |
| 1042 | 1042 | */ |
@@ -1086,13 +1086,13 @@ discard block |
||
| 1086 | 1086 | |
| 1087 | 1087 | $iterationName = ($i % 2 == 0) ? 'Odd' : 'Even'; |
| 1088 | 1088 | $tmp = strtolower($iterationName); |
| 1089 | - $class[] = $this->getCFGDef($tmp . 'Class', $tmp); |
|
| 1089 | + $class[] = $this->getCFGDef($tmp.'Class', $tmp); |
|
| 1090 | 1090 | |
| 1091 | - $this->renderTPL = $this->getCFGDef('tplId' . $i, $this->renderTPL); |
|
| 1092 | - $this->renderTPL = $this->getCFGDef('tpl' . $iterationName, $this->renderTPL); |
|
| 1091 | + $this->renderTPL = $this->getCFGDef('tplId'.$i, $this->renderTPL); |
|
| 1092 | + $this->renderTPL = $this->getCFGDef('tpl'.$iterationName, $this->renderTPL); |
|
| 1093 | 1093 | |
| 1094 | 1094 | $data[$this->getCFGDef("sysKey", |
| 1095 | - "dl") . '.full_iteration'] = ($this->extPaginate) ? ($i + $this->getCFGDef('display', |
|
| 1095 | + "dl").'.full_iteration'] = ($this->extPaginate) ? ($i + $this->getCFGDef('display', |
|
| 1096 | 1096 | 0) * ($this->extPaginate->currentPage() - 1)) : $i; |
| 1097 | 1097 | |
| 1098 | 1098 | if ($i == 1) { |
@@ -1106,14 +1106,14 @@ discard block |
||
| 1106 | 1106 | if ($this->modx->documentIdentifier == $data['id']) { |
| 1107 | 1107 | $this->renderTPL = $this->getCFGDef('tplCurrent', $this->renderTPL); |
| 1108 | 1108 | $data[$this->getCFGDef("sysKey", |
| 1109 | - "dl") . '.active'] = 1; //[+active+] - 1 if $modx->documentIdentifer equal ID this element |
|
| 1109 | + "dl").'.active'] = 1; //[+active+] - 1 if $modx->documentIdentifer equal ID this element |
|
| 1110 | 1110 | $class[] = $this->getCFGDef('currentClass', 'current'); |
| 1111 | 1111 | } else { |
| 1112 | - $data[$this->getCFGDef("sysKey", "dl") . '.active'] = 0; |
|
| 1112 | + $data[$this->getCFGDef("sysKey", "dl").'.active'] = 0; |
|
| 1113 | 1113 | } |
| 1114 | 1114 | |
| 1115 | 1115 | $class = implode(" ", $class); |
| 1116 | - $data[$this->getCFGDef("sysKey", "dl") . '.class'] = $class; |
|
| 1116 | + $data[$this->getCFGDef("sysKey", "dl").'.class'] = $class; |
|
| 1117 | 1117 | |
| 1118 | 1118 | /** |
| 1119 | 1119 | * @var $extE e_DL_Extender |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | */ |
| 1219 | 1219 | public function checkExtender($name) |
| 1220 | 1220 | { |
| 1221 | - return (isset($this->extender[$name]) && $this->extender[$name] instanceof $name . "_DL_Extender"); |
|
| 1221 | + return (isset($this->extender[$name]) && $this->extender[$name] instanceof $name."_DL_Extender"); |
|
| 1222 | 1222 | } |
| 1223 | 1223 | |
| 1224 | 1224 | /** |
@@ -1259,17 +1259,17 @@ discard block |
||
| 1259 | 1259 | */ |
| 1260 | 1260 | protected function _loadExtender($name) |
| 1261 | 1261 | { |
| 1262 | - $this->debug->debug('Load Extender ' . $this->debug->dumpData($name), 'LoadExtender', 2); |
|
| 1262 | + $this->debug->debug('Load Extender '.$this->debug->dumpData($name), 'LoadExtender', 2); |
|
| 1263 | 1263 | $flag = false; |
| 1264 | 1264 | |
| 1265 | - $classname = ($name != '') ? $name . "_DL_Extender" : ""; |
|
| 1265 | + $classname = ($name != '') ? $name."_DL_Extender" : ""; |
|
| 1266 | 1266 | if ($classname != '' && isset($this->extender[$name]) && $this->extender[$name] instanceof $classname) { |
| 1267 | 1267 | $flag = true; |
| 1268 | 1268 | |
| 1269 | 1269 | } else { |
| 1270 | 1270 | if (!class_exists($classname, false) && $classname != '') { |
| 1271 | - if (file_exists(dirname(__FILE__) . "/extender/" . $name . ".extender.inc")) { |
|
| 1272 | - include_once(dirname(__FILE__) . "/extender/" . $name . ".extender.inc"); |
|
| 1271 | + if (file_exists(dirname(__FILE__)."/extender/".$name.".extender.inc")) { |
|
| 1272 | + include_once(dirname(__FILE__)."/extender/".$name.".extender.inc"); |
|
| 1273 | 1273 | } |
| 1274 | 1274 | } |
| 1275 | 1275 | if (class_exists($classname, false) && $classname != '') { |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | } |
| 1279 | 1279 | } |
| 1280 | 1280 | if (!$flag) { |
| 1281 | - $this->debug->debug("Error load Extender " . $this->debug->dumpData($name)); |
|
| 1281 | + $this->debug->debug("Error load Extender ".$this->debug->dumpData($name)); |
|
| 1282 | 1282 | } |
| 1283 | 1283 | $this->debug->debugEnd('LoadExtender'); |
| 1284 | 1284 | |
@@ -1297,7 +1297,7 @@ discard block |
||
| 1297 | 1297 | */ |
| 1298 | 1298 | public function setIDs($IDs) |
| 1299 | 1299 | { |
| 1300 | - $this->debug->debug('set ID list ' . $this->debug->dumpData($IDs), 'setIDs', 2); |
|
| 1300 | + $this->debug->debug('set ID list '.$this->debug->dumpData($IDs), 'setIDs', 2); |
|
| 1301 | 1301 | $IDs = $this->cleanIDs($IDs); |
| 1302 | 1302 | $type = $this->getCFGDef('idType', 'parents'); |
| 1303 | 1303 | $depth = $this->getCFGDef('depth', ''); |
@@ -1332,7 +1332,7 @@ discard block |
||
| 1332 | 1332 | */ |
| 1333 | 1333 | public function cleanIDs($IDs, $sep = ',') |
| 1334 | 1334 | { |
| 1335 | - $this->debug->debug('clean IDs ' . $this->debug->dumpData($IDs) . ' with separator ' . $this->debug->dumpData($sep), |
|
| 1335 | + $this->debug->debug('clean IDs '.$this->debug->dumpData($IDs).' with separator '.$this->debug->dumpData($sep), |
|
| 1336 | 1336 | 'cleanIDs', 2); |
| 1337 | 1337 | $out = array(); |
| 1338 | 1338 | if (!is_array($IDs)) { |
@@ -1415,7 +1415,7 @@ discard block |
||
| 1415 | 1415 | { |
| 1416 | 1416 | $out = ''; |
| 1417 | 1417 | if ($group != '') { |
| 1418 | - $out = 'GROUP BY ' . $group; |
|
| 1418 | + $out = 'GROUP BY '.$group; |
|
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | return $out; |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | $idList = $this->sanitarIn($this->IDs, ',', false); |
| 1446 | 1446 | $out = array('orderBy' => "FIND_IN_SET({$this->getCFGDef('sortBy', $this->getPK())}, '{$idList}')"); |
| 1447 | 1447 | $this->setConfig($out); //reload config; |
| 1448 | - $sort = "ORDER BY " . $out['orderBy']; |
|
| 1448 | + $sort = "ORDER BY ".$out['orderBy']; |
|
| 1449 | 1449 | break; |
| 1450 | 1450 | default: |
| 1451 | 1451 | $out = array('orderBy' => '', 'order' => '', 'sortBy' => ''); |
@@ -1465,13 +1465,13 @@ discard block |
||
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | 1467 | $out['sortBy'] = (($tmp = $this->getCFGDef('sortBy', '')) != '') ? $tmp : $sortName; |
| 1468 | - $out['orderBy'] = $out['sortBy'] . " " . $out['order']; |
|
| 1468 | + $out['orderBy'] = $out['sortBy']." ".$out['order']; |
|
| 1469 | 1469 | } |
| 1470 | 1470 | $this->setConfig($out); //reload config; |
| 1471 | - $sort = "ORDER BY " . $out['orderBy']; |
|
| 1471 | + $sort = "ORDER BY ".$out['orderBy']; |
|
| 1472 | 1472 | break; |
| 1473 | 1473 | } |
| 1474 | - $this->debug->debugEnd("sortORDER", 'Get sort order for SQL: ' . $this->debug->dumpData($sort)); |
|
| 1474 | + $this->debug->debugEnd("sortORDER", 'Get sort order for SQL: '.$this->debug->dumpData($sort)); |
|
| 1475 | 1475 | |
| 1476 | 1476 | return $sort; |
| 1477 | 1477 | } |
@@ -1499,17 +1499,17 @@ discard block |
||
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | if ($limit != 0) { |
| 1502 | - $ret = "LIMIT " . (int)$offset . "," . (int)$limit; |
|
| 1502 | + $ret = "LIMIT ".(int)$offset.",".(int)$limit; |
|
| 1503 | 1503 | } else { |
| 1504 | 1504 | if ($offset != 0) { |
| 1505 | 1505 | /** |
| 1506 | 1506 | * To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter |
| 1507 | 1507 | * @see http://dev.mysql.com/doc/refman/5.0/en/select.html |
| 1508 | 1508 | */ |
| 1509 | - $ret = "LIMIT " . (int)$offset . ",18446744073709551615"; |
|
| 1509 | + $ret = "LIMIT ".(int)$offset.",18446744073709551615"; |
|
| 1510 | 1510 | } |
| 1511 | 1511 | } |
| 1512 | - $this->debug->debugEnd("limitSQL", "Get limit for SQL: " . $this->debug->dumpData($ret)); |
|
| 1512 | + $this->debug->debugEnd("limitSQL", "Get limit for SQL: ".$this->debug->dumpData($ret)); |
|
| 1513 | 1513 | |
| 1514 | 1514 | return $ret; |
| 1515 | 1515 | } |
@@ -1552,20 +1552,20 @@ discard block |
||
| 1552 | 1552 | $children = array(); // children of each ID |
| 1553 | 1553 | $ids = array(); |
| 1554 | 1554 | foreach ($data as $i => $r) { |
| 1555 | - $row =& $data[$i]; |
|
| 1555 | + $row = & $data[$i]; |
|
| 1556 | 1556 | $id = $row[$idName]; |
| 1557 | 1557 | $pid = $row[$pidName]; |
| 1558 | - $children[$pid][$id] =& $row; |
|
| 1558 | + $children[$pid][$id] = & $row; |
|
| 1559 | 1559 | if (!isset($children[$id])) { |
| 1560 | 1560 | $children[$id] = array(); |
| 1561 | 1561 | } |
| 1562 | - $row['#childNodes'] =& $children[$id]; |
|
| 1562 | + $row['#childNodes'] = & $children[$id]; |
|
| 1563 | 1563 | $ids[$row[$idName]] = true; |
| 1564 | 1564 | } |
| 1565 | 1565 | // Root elements are elements with non-found PIDs. |
| 1566 | 1566 | $this->_tree = array(); |
| 1567 | 1567 | foreach ($data as $i => $r) { |
| 1568 | - $row =& $data[$i]; |
|
| 1568 | + $row = & $data[$i]; |
|
| 1569 | 1569 | if (!isset($ids[$row[$pidName]])) { |
| 1570 | 1570 | $this->_tree[$row[$idName]] = $row; |
| 1571 | 1571 | } |
@@ -1604,7 +1604,7 @@ discard block |
||
| 1604 | 1604 | */ |
| 1605 | 1605 | protected function getFilters($filter_string) |
| 1606 | 1606 | { |
| 1607 | - $this->debug->debug("getFilters: " . $this->debug->dumpData($filter_string), 'getFilter', 1); |
|
| 1607 | + $this->debug->debug("getFilters: ".$this->debug->dumpData($filter_string), 'getFilter', 1); |
|
| 1608 | 1608 | // the filter parameter tells us, which filters can be used in this query |
| 1609 | 1609 | $filter_string = trim($filter_string, ' ;'); |
| 1610 | 1610 | if (!$filter_string) { |
@@ -1631,14 +1631,14 @@ discard block |
||
| 1631 | 1631 | } |
| 1632 | 1632 | } |
| 1633 | 1633 | $output['join'] = !empty($joins) ? implode(' ', $joins) : ''; |
| 1634 | - $output['where'] = !empty($wheres) ? '(' . implode($sql, $wheres) . ')' : ''; |
|
| 1634 | + $output['where'] = !empty($wheres) ? '('.implode($sql, $wheres).')' : ''; |
|
| 1635 | 1635 | } |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | 1638 | if (!$logic_op_found) { |
| 1639 | 1639 | $filter = $this->loadFilter($filter_string); |
| 1640 | 1640 | if (!$filter) { |
| 1641 | - $this->debug->warning('Error while loading DocLister filter "' . $this->debug->dumpData($filter_string) . '": check syntax!'); |
|
| 1641 | + $this->debug->warning('Error while loading DocLister filter "'.$this->debug->dumpData($filter_string).'": check syntax!'); |
|
| 1642 | 1642 | $output = false; |
| 1643 | 1643 | } else { |
| 1644 | 1644 | $output['join'] = $filter->get_join(); |
@@ -1678,19 +1678,19 @@ discard block |
||
| 1678 | 1678 | $type = trim($type); |
| 1679 | 1679 | switch (strtoupper($type)) { |
| 1680 | 1680 | case 'DECIMAL': |
| 1681 | - $field = 'CAST(' . $field . ' as DECIMAL(10,2))'; |
|
| 1681 | + $field = 'CAST('.$field.' as DECIMAL(10,2))'; |
|
| 1682 | 1682 | break; |
| 1683 | 1683 | case 'UNSIGNED': |
| 1684 | - $field = 'CAST(' . $field . ' as UNSIGNED)'; |
|
| 1684 | + $field = 'CAST('.$field.' as UNSIGNED)'; |
|
| 1685 | 1685 | break; |
| 1686 | 1686 | case 'BINARY': |
| 1687 | - $field = 'CAST(' . $field . ' as BINARY)'; |
|
| 1687 | + $field = 'CAST('.$field.' as BINARY)'; |
|
| 1688 | 1688 | break; |
| 1689 | 1689 | case 'DATETIME': |
| 1690 | - $field = 'CAST(' . $field . ' as DATETIME)'; |
|
| 1690 | + $field = 'CAST('.$field.' as DATETIME)'; |
|
| 1691 | 1691 | break; |
| 1692 | 1692 | case 'SIGNED': |
| 1693 | - $field = 'CAST(' . $field . ' as SIGNED)'; |
|
| 1693 | + $field = 'CAST('.$field.' as SIGNED)'; |
|
| 1694 | 1694 | break; |
| 1695 | 1695 | } |
| 1696 | 1696 | |
@@ -1704,17 +1704,17 @@ discard block |
||
| 1704 | 1704 | */ |
| 1705 | 1705 | protected function loadFilter($filter) |
| 1706 | 1706 | { |
| 1707 | - $this->debug->debug('Load filter ' . $this->debug->dumpData($filter), 'loadFilter', 2); |
|
| 1707 | + $this->debug->debug('Load filter '.$this->debug->dumpData($filter), 'loadFilter', 2); |
|
| 1708 | 1708 | $out = false; |
| 1709 | 1709 | $fltr_params = explode(':', $filter, 2); |
| 1710 | 1710 | $fltr = APIHelpers::getkey($fltr_params, 0, null); |
| 1711 | 1711 | // check if the filter is implemented |
| 1712 | - if (!is_null($fltr) && file_exists(dirname(__FILE__) . '/filter/' . $fltr . '.filter.php')) { |
|
| 1713 | - require_once dirname(__FILE__) . '/filter/' . $fltr . '.filter.php'; |
|
| 1712 | + if (!is_null($fltr) && file_exists(dirname(__FILE__).'/filter/'.$fltr.'.filter.php')) { |
|
| 1713 | + require_once dirname(__FILE__).'/filter/'.$fltr.'.filter.php'; |
|
| 1714 | 1714 | /** |
| 1715 | 1715 | * @var tv_DL_filter|content_DL_filter $fltr_class |
| 1716 | 1716 | */ |
| 1717 | - $fltr_class = $fltr . '_DL_filter'; |
|
| 1717 | + $fltr_class = $fltr.'_DL_filter'; |
|
| 1718 | 1718 | $this->totalFilters++; |
| 1719 | 1719 | $fltr_obj = new $fltr_class(); |
| 1720 | 1720 | if ($fltr_obj->init($this, $filter)) { |
@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | public function getRequest() |
| 1775 | 1775 | { |
| 1776 | 1776 | $URL = null; |
| 1777 | - parse_str(parse_url(MODX_SITE_URL . $_SERVER['REQUEST_URI'], PHP_URL_QUERY), $URL); |
|
| 1777 | + parse_str(parse_url(MODX_SITE_URL.$_SERVER['REQUEST_URI'], PHP_URL_QUERY), $URL); |
|
| 1778 | 1778 | |
| 1779 | 1779 | return http_build_query(array_merge($URL, array(DocLister::AliasRequest => null))); |
| 1780 | 1780 | } |
@@ -78,18 +78,18 @@ discard block |
||
| 78 | 78 | $item = $extUser->setUserData($item); //[+user.id.createdby+], [+user.fullname.publishedby+], [+dl.user.publishedby+].... |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $item[$this->getCFGDef("sysKey", "dl") . '.summary'] = $extSummary ? $this->getSummary($item, |
|
| 81 | + $item[$this->getCFGDef("sysKey", "dl").'.summary'] = $extSummary ? $this->getSummary($item, |
|
| 82 | 82 | $extSummary) : ''; |
| 83 | 83 | |
| 84 | 84 | $item = array_merge($item, |
| 85 | 85 | $sysPlh); //inside the chunks available all placeholders set via $modx->toPlaceholders with prefix id, and with prefix sysKey |
| 86 | 86 | $item[$this->getCFGDef("sysKey", |
| 87 | - "dl") . '.iteration'] = $i; //[+iteration+] - Number element. Starting from zero |
|
| 87 | + "dl").'.iteration'] = $i; //[+iteration+] - Number element. Starting from zero |
|
| 88 | 88 | |
| 89 | 89 | $date = $this->getCFGDef('dateSource', 'pub_date'); |
| 90 | 90 | $date = isset($item[$date]) ? $item[$date] + $this->modx->config['server_offset_time'] : ''; |
| 91 | 91 | if ($date != '' && $this->getCFGDef('dateFormat', '%d.%b.%y %H:%M') != '') { |
| 92 | - $item[$this->getCFGDef("sysKey", "dl") . '.date'] = strftime($this->getCFGDef('dateFormat', |
|
| 92 | + $item[$this->getCFGDef("sysKey", "dl").'.date'] = strftime($this->getCFGDef('dateFormat', |
|
| 93 | 93 | '%d.%b.%y %H:%M'), $date); |
| 94 | 94 | } |
| 95 | 95 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $tmp = $this->parseChunk($this->renderTPL, $item); |
| 114 | 114 | if ($this->getCFGDef('contentPlaceholder', 0) !== 0) { |
| 115 | 115 | $this->toPlaceholders($tmp, 1, |
| 116 | - "item[" . $i . "]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 116 | + "item[".$i."]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 117 | 117 | } |
| 118 | 118 | $out .= $tmp; |
| 119 | 119 | $i++; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if (!empty($where)) { |
| 206 | - $where = "WHERE " . implode(" AND ", $where); |
|
| 206 | + $where = "WHERE ".implode(" AND ", $where); |
|
| 207 | 207 | } |
| 208 | 208 | $limit = $this->LimitSQL($this->getCFGDef('queryLimit', 0)); |
| 209 | 209 | $fields = $this->getCFGDef('selectFields', '*'); |
@@ -237,13 +237,13 @@ discard block |
||
| 237 | 237 | |
| 238 | 238 | $tmpWhere = null; |
| 239 | 239 | if ($sanitarInIDs != "''") { |
| 240 | - $tmpWhere = "(`{$this->getParentField()}` IN (" . $sanitarInIDs . ")"; |
|
| 240 | + $tmpWhere = "(`{$this->getParentField()}` IN (".$sanitarInIDs.")"; |
|
| 241 | 241 | switch ($this->getCFGDef('showParent', '0')) { |
| 242 | 242 | case -1: |
| 243 | 243 | $tmpWhere .= ")"; |
| 244 | 244 | break; |
| 245 | 245 | case 0: |
| 246 | - $tmpWhere .= " AND `{$this->getPK()}` NOT IN(" . $sanitarInIDs . "))"; |
|
| 246 | + $tmpWhere .= " AND `{$this->getPK()}` NOT IN(".$sanitarInIDs."))"; |
|
| 247 | 247 | break; |
| 248 | 248 | case 1: |
| 249 | 249 | default: |
@@ -254,25 +254,25 @@ discard block |
||
| 254 | 254 | if (($addDocs = $this->getCFGDef('documents', '')) != '') { |
| 255 | 255 | $addDocs = $this->sanitarIn($this->cleanIDs($addDocs)); |
| 256 | 256 | if (empty($tmpWhere)) { |
| 257 | - $tmpWhere = $this->getPK() . " IN({$addDocs})"; |
|
| 257 | + $tmpWhere = $this->getPK()." IN({$addDocs})"; |
|
| 258 | 258 | } else { |
| 259 | - $tmpWhere = "((" . $tmpWhere . ") OR {$this->getPK()} IN({$addDocs}))"; |
|
| 259 | + $tmpWhere = "((".$tmpWhere.") OR {$this->getPK()} IN({$addDocs}))"; |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | if (!empty($tmpWhere)) { |
| 263 | 263 | $where[] = $tmpWhere; |
| 264 | 264 | } |
| 265 | 265 | if (!empty($where)) { |
| 266 | - $where = "WHERE " . implode(" AND ", $where); |
|
| 266 | + $where = "WHERE ".implode(" AND ", $where); |
|
| 267 | 267 | } else { |
| 268 | 268 | $where = ''; |
| 269 | 269 | } |
| 270 | 270 | $fields = $this->getCFGDef('selectFields', '*'); |
| 271 | 271 | $group = $this->getGroupSQL($this->getCFGDef('groupBy', "`{$this->getPK()}`")); |
| 272 | 272 | if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { |
| 273 | - $sql = $this->dbQuery("SELECT {$fields} FROM " . $this->table . " " . $where . " " . |
|
| 274 | - $group . " " . |
|
| 275 | - $this->SortOrderSQL($this->getPK()) . " " . |
|
| 273 | + $sql = $this->dbQuery("SELECT {$fields} FROM ".$this->table." ".$where." ". |
|
| 274 | + $group." ". |
|
| 275 | + $this->SortOrderSQL($this->getPK())." ". |
|
| 276 | 276 | $this->LimitSQL($this->getCFGDef('queryLimit', 0)) |
| 277 | 277 | ); |
| 278 | 278 | $rows = $this->modx->db->makeArray($sql); |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | if (($addDocs = $this->getCFGDef('documents', '')) != '') { |
| 319 | 319 | $addDocs = $this->sanitarIn($this->cleanIDs($addDocs)); |
| 320 | - $where[] = "((" . $tmpWhere . ") OR `{$this->getPK()}` IN({$addDocs}))"; |
|
| 320 | + $where[] = "((".$tmpWhere.") OR `{$this->getPK()}` IN({$addDocs}))"; |
|
| 321 | 321 | } else { |
| 322 | 322 | $where[] = $tmpWhere; |
| 323 | 323 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | if (!empty($where)) { |
| 332 | - $where = "WHERE " . implode(" AND ", $where); |
|
| 332 | + $where = "WHERE ".implode(" AND ", $where); |
|
| 333 | 333 | } else { |
| 334 | 334 | $where = ''; |
| 335 | 335 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $tmp = $this->getCFGDef('addWhereFolder', ''); |
| 355 | 355 | $where = "`{$this->getParentField()}` IN ({$sanitarInIDs})"; |
| 356 | 356 | if (!empty($tmp)) { |
| 357 | - $where .= " AND " . $tmp; |
|
| 357 | + $where .= " AND ".$tmp; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | $rs = $this->dbQuery("SELECT `{$this->getPK()}` FROM {$this->table} WHERE {$where}"); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | if ($this->getCFGDef('contentPlaceholder', 0) !== 0) { |
| 179 | 179 | $this->toPlaceholders($tmp, 1, |
| 180 | - "item[" . $i . "]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 180 | + "item[".$i."]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 181 | 181 | } |
| 182 | 182 | $out .= $tmp; |
| 183 | 183 | $i++; |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { |
| 275 | 275 | $where = $this->getCFGDef('addWhereList', ''); |
| 276 | 276 | $where = sqlHelper::trimLogicalOp($where); |
| 277 | - $where = ($where ? $where . ' AND ' : '') . $this->_filters['where']; |
|
| 277 | + $where = ($where ? $where.' AND ' : '').$this->_filters['where']; |
|
| 278 | 278 | if ($where != '' && $this->_filters['where'] != '') { |
| 279 | 279 | $where .= " AND "; |
| 280 | 280 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | case 'parents': |
| 294 | 294 | switch ($this->getCFGDef('showParent', '0')) { |
| 295 | 295 | case '-1': |
| 296 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")"; |
|
| 296 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.")"; |
|
| 297 | 297 | break; |
| 298 | 298 | case 0: |
| 299 | 299 | $tmpWhere = "c.parent IN ({$sanitarInIDs}) AND c.id NOT IN({$sanitarInIDs})"; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | } |
| 306 | 306 | if (($addDocs = $this->getCFGDef('documents', '')) != '') { |
| 307 | 307 | $addDocs = $this->sanitarIn($this->cleanIDs($addDocs)); |
| 308 | - $whereArr[] = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))"; |
|
| 308 | + $whereArr[] = "((".$tmpWhere.") OR c.id IN({$addDocs}))"; |
|
| 309 | 309 | } else { |
| 310 | 310 | $whereArr[] = $tmpWhere; |
| 311 | 311 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | break; |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | - $from = $tbl_site_content . " " . $this->_filters['join']; |
|
| 319 | + $from = $tbl_site_content." ".$this->_filters['join']; |
|
| 320 | 320 | $where = sqlHelper::trimLogicalOp($where); |
| 321 | 321 | |
| 322 | 322 | if (trim($where) != 'WHERE') { |
@@ -351,12 +351,12 @@ discard block |
||
| 351 | 351 | $where = $this->getCFGDef('addWhereList', ''); |
| 352 | 352 | $where = sqlHelper::trimLogicalOp($where); |
| 353 | 353 | |
| 354 | - $where = ($where ? $where . ' AND ' : '') . $this->_filters['where']; |
|
| 354 | + $where = ($where ? $where.' AND ' : '').$this->_filters['where']; |
|
| 355 | 355 | $where = sqlHelper::trimLogicalOp($where); |
| 356 | 356 | |
| 357 | 357 | $tbl_site_content = $this->getTable('site_content', 'c'); |
| 358 | 358 | if ($sanitarInIDs != "''") { |
| 359 | - $where .= ($where ? " AND " : "") . "c.id IN ({$sanitarInIDs}) AND"; |
|
| 359 | + $where .= ($where ? " AND " : "")."c.id IN ({$sanitarInIDs}) AND"; |
|
| 360 | 360 | } |
| 361 | 361 | $where = sqlHelper::trimLogicalOp($where); |
| 362 | 362 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | $fields = $this->getCFGDef('selectFields', 'c.*'); |
| 380 | 380 | $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id')); |
| 381 | 381 | $sort = $this->SortOrderSQL("if(c.pub_date=0,c.createdon,c.pub_date)"); |
| 382 | - list($tbl_site_content, $sort) = $this->injectSortByTV($tbl_site_content . ' ' . $this->_filters['join'], |
|
| 382 | + list($tbl_site_content, $sort) = $this->injectSortByTV($tbl_site_content.' '.$this->_filters['join'], |
|
| 383 | 383 | $sort); |
| 384 | 384 | |
| 385 | 385 | $limit = $this->LimitSQL($this->getCFGDef('queryLimit', 0)); |
@@ -464,21 +464,21 @@ discard block |
||
| 464 | 464 | $tbl_site_content = $this->getTable('site_content', 'c'); |
| 465 | 465 | |
| 466 | 466 | $sort = $this->SortOrderSQL("if(c.pub_date=0,c.createdon,c.pub_date)"); |
| 467 | - list($from, $sort) = $this->injectSortByTV($tbl_site_content . ' ' . $this->_filters['join'], $sort); |
|
| 467 | + list($from, $sort) = $this->injectSortByTV($tbl_site_content.' '.$this->_filters['join'], $sort); |
|
| 468 | 468 | $sanitarInIDs = $this->sanitarIn($this->IDs); |
| 469 | 469 | |
| 470 | 470 | $tmpWhere = null; |
| 471 | 471 | if ($sanitarInIDs != "''") { |
| 472 | 472 | switch ($this->getCFGDef('showParent', '0')) { |
| 473 | 473 | case '-1': |
| 474 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")"; |
|
| 474 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.")"; |
|
| 475 | 475 | break; |
| 476 | 476 | case 0: |
| 477 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ") AND c.id NOT IN(" . $sanitarInIDs . ")"; |
|
| 477 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.") AND c.id NOT IN(".$sanitarInIDs.")"; |
|
| 478 | 478 | break; |
| 479 | 479 | case 1: |
| 480 | 480 | default: |
| 481 | - $tmpWhere = "(c.parent IN (" . $sanitarInIDs . ") OR c.id IN({$sanitarInIDs}))"; |
|
| 481 | + $tmpWhere = "(c.parent IN (".$sanitarInIDs.") OR c.id IN({$sanitarInIDs}))"; |
|
| 482 | 482 | break; |
| 483 | 483 | } |
| 484 | 484 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | if (empty($tmpWhere)) { |
| 488 | 488 | $tmpWhere = "c.id IN({$addDocs})"; |
| 489 | 489 | } else { |
| 490 | - $tmpWhere = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))"; |
|
| 490 | + $tmpWhere = "((".$tmpWhere.") OR c.id IN({$addDocs}))"; |
|
| 491 | 491 | } |
| 492 | 492 | } |
| 493 | 493 | if (!empty($tmpWhere)) { |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | $where[] = "c.deleted=0 AND c.published=1"; |
| 498 | 498 | } |
| 499 | 499 | if (!empty($where)) { |
| 500 | - $where = "WHERE " . implode(" AND ", $where); |
|
| 500 | + $where = "WHERE ".implode(" AND ", $where); |
|
| 501 | 501 | } else { |
| 502 | 502 | $where = ''; |
| 503 | 503 | } |
@@ -505,9 +505,9 @@ discard block |
||
| 505 | 505 | $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id')); |
| 506 | 506 | |
| 507 | 507 | if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { |
| 508 | - $sql = $this->dbQuery("SELECT {$fields} FROM " . $from . " " . $where . " " . |
|
| 509 | - $group . " " . |
|
| 510 | - $sort . " " . |
|
| 508 | + $sql = $this->dbQuery("SELECT {$fields} FROM ".$from." ".$where." ". |
|
| 509 | + $group." ". |
|
| 510 | + $sort." ". |
|
| 511 | 511 | $this->LimitSQL($this->getCFGDef('queryLimit', 0)) |
| 512 | 512 | ); |
| 513 | 513 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | $type = trim($type); |
| 532 | 532 | switch (strtoupper($type)) { |
| 533 | 533 | case 'TVDATETIME': |
| 534 | - $field = "STR_TO_DATE(" . $field . ",'%d-%m-%Y %H:%i:%s')"; |
|
| 534 | + $field = "STR_TO_DATE(".$field.",'%d-%m-%Y %H:%i:%s')"; |
|
| 535 | 535 | break; |
| 536 | 536 | default: |
| 537 | 537 | $field = parent::changeSortType($field, $type); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html |
| 12 | 12 | * @author Agel_Nash <[email protected]>, kabachello <[email protected]> |
| 13 | 13 | */ |
| 14 | -include_once(dirname(__FILE__) . "/site_content.php"); |
|
| 14 | +include_once(dirname(__FILE__)."/site_content.php"); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Class shopkeeperDocLister |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if ($this->getCFGDef('contentPlaceholder', 0) !== 0) { |
| 126 | 126 | $this->toPlaceholders($tmp, 1, |
| 127 | - "item[" . $i . "]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 127 | + "item[".$i."]"); // [+item[x]+] – individual placeholder for each iteration documents on this page |
|
| 128 | 128 | } |
| 129 | 129 | $out .= $tmp; |
| 130 | 130 | $i++; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { |
| 154 | 154 | $where = $this->getCFGDef('addWhereList', ''); |
| 155 | 155 | $where = sqlHelper::trimLogicalOp($where); |
| 156 | - $where = ($where ? $where . ' AND ' : '') . $this->_filters['where']; |
|
| 156 | + $where = ($where ? $where.' AND ' : '').$this->_filters['where']; |
|
| 157 | 157 | if ($where != '' && $this->_filters['where'] != '') { |
| 158 | 158 | $where .= " AND "; |
| 159 | 159 | } |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | case 'parents': |
| 173 | 173 | switch ($this->getCFGDef('showParent', '0')) { |
| 174 | 174 | case '-1': |
| 175 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")"; |
|
| 175 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.")"; |
|
| 176 | 176 | break; |
| 177 | 177 | case 0: |
| 178 | 178 | $tmpWhere = "c.parent IN ({$sanitarInIDs}) AND c.id NOT IN({$sanitarInIDs})"; |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | if (($addDocs = $this->getCFGDef('documents', '')) != '') { |
| 186 | 186 | $addDocs = $this->sanitarIn($this->cleanIDs($addDocs)); |
| 187 | - $whereArr[] = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))"; |
|
| 187 | + $whereArr[] = "((".$tmpWhere.") OR c.id IN({$addDocs}))"; |
|
| 188 | 188 | } else { |
| 189 | 189 | $whereArr[] = $tmpWhere; |
| 190 | 190 | } |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | break; |
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | - $from = $tbl_site_content . " " . $this->_filters['join']; |
|
| 197 | + $from = $tbl_site_content." ".$this->_filters['join']; |
|
| 198 | 198 | $where = sqlHelper::trimLogicalOp($where); |
| 199 | 199 | |
| 200 | 200 | if (trim($where) != 'WHERE') { |
@@ -229,12 +229,12 @@ discard block |
||
| 229 | 229 | $where = $this->getCFGDef('addWhereList', ''); |
| 230 | 230 | $where = sqlHelper::trimLogicalOp($where); |
| 231 | 231 | |
| 232 | - $where = ($where ? $where . ' AND ' : '') . $this->_filters['where']; |
|
| 232 | + $where = ($where ? $where.' AND ' : '').$this->_filters['where']; |
|
| 233 | 233 | $where = sqlHelper::trimLogicalOp($where); |
| 234 | 234 | |
| 235 | 235 | $tbl_site_content = $this->getTable('catalog', 'c'); |
| 236 | 236 | if ($sanitarInIDs != "''") { |
| 237 | - $where .= ($where ? " AND " : "") . "c.id IN ({$sanitarInIDs}) AND"; |
|
| 237 | + $where .= ($where ? " AND " : "")."c.id IN ({$sanitarInIDs}) AND"; |
|
| 238 | 238 | } |
| 239 | 239 | $where = sqlHelper::trimLogicalOp($where); |
| 240 | 240 | |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $fields = $this->getCFGDef('selectFields', 'c.*'); |
| 258 | 258 | $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id')); |
| 259 | 259 | $sort = $this->SortOrderSQL("c.createdon"); |
| 260 | - list($tbl_site_content, $sort) = $this->injectSortByTV($tbl_site_content . ' ' . $this->_filters['join'], |
|
| 260 | + list($tbl_site_content, $sort) = $this->injectSortByTV($tbl_site_content.' '.$this->_filters['join'], |
|
| 261 | 261 | $sort); |
| 262 | 262 | |
| 263 | 263 | $limit = $this->LimitSQL($this->getCFGDef('queryLimit', 0)); |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | $where = "WHERE {$where} c.parent IN ({$sanitarInIDs}) AND c.deleted=0 AND c.published=1"; |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | - $rs = $this->dbQuery("SELECT id FROM {$tbl_site_content} {$where} AND c.id IN(SELECT DISTINCT s.parent FROM " . $this->getTable('catalog', |
|
| 298 | - 's') . ")"); |
|
| 297 | + $rs = $this->dbQuery("SELECT id FROM {$tbl_site_content} {$where} AND c.id IN(SELECT DISTINCT s.parent FROM ".$this->getTable('catalog', |
|
| 298 | + 's').")"); |
|
| 299 | 299 | |
| 300 | 300 | $rows = $this->modx->db->makeArray($rs); |
| 301 | 301 | $out = array(); |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $tbl_site_content = $this->getTable('catalog', 'c'); |
| 329 | 329 | |
| 330 | 330 | $sort = $this->SortOrderSQL("c.createdon"); |
| 331 | - list($from, $sort) = $this->injectSortByTV($tbl_site_content . ' ' . $this->_filters['join'], $sort); |
|
| 331 | + list($from, $sort) = $this->injectSortByTV($tbl_site_content.' '.$this->_filters['join'], $sort); |
|
| 332 | 332 | $sanitarInIDs = $this->sanitarIn($this->IDs); |
| 333 | 333 | |
| 334 | 334 | $tmpWhere = null; |
@@ -336,14 +336,14 @@ discard block |
||
| 336 | 336 | if ($sanitarInIDs != "''") { |
| 337 | 337 | switch ($this->getCFGDef('showParent', '0')) { |
| 338 | 338 | case '-1': |
| 339 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ")"; |
|
| 339 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.")"; |
|
| 340 | 340 | break; |
| 341 | 341 | case 0: |
| 342 | - $tmpWhere = "c.parent IN (" . $sanitarInIDs . ") AND c.id NOT IN(" . $sanitarInIDs . ")"; |
|
| 342 | + $tmpWhere = "c.parent IN (".$sanitarInIDs.") AND c.id NOT IN(".$sanitarInIDs.")"; |
|
| 343 | 343 | break; |
| 344 | 344 | case 1: |
| 345 | 345 | default: |
| 346 | - $tmpWhere = "(c.parent IN (" . $sanitarInIDs . ") OR c.id IN({$sanitarInIDs}))"; |
|
| 346 | + $tmpWhere = "(c.parent IN (".$sanitarInIDs.") OR c.id IN({$sanitarInIDs}))"; |
|
| 347 | 347 | break; |
| 348 | 348 | } |
| 349 | 349 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | if (empty($tmpWhere)) { |
| 353 | 353 | $tmpWhere = "c.id IN({$addDocs})"; |
| 354 | 354 | } else { |
| 355 | - $tmpWhere = "((" . $tmpWhere . ") OR c.id IN({$addDocs}))"; |
|
| 355 | + $tmpWhere = "((".$tmpWhere.") OR c.id IN({$addDocs}))"; |
|
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | if (!empty($tmpWhere)) { |
@@ -362,16 +362,16 @@ discard block |
||
| 362 | 362 | $where[] = "c.published=1"; |
| 363 | 363 | } |
| 364 | 364 | if (!empty($where)) { |
| 365 | - $where = "WHERE " . implode(" AND ", $where); |
|
| 365 | + $where = "WHERE ".implode(" AND ", $where); |
|
| 366 | 366 | } else { |
| 367 | 367 | $where = ''; |
| 368 | 368 | } |
| 369 | 369 | $fields = $this->getCFGDef('selectFields', 'c.*'); |
| 370 | 370 | $group = $this->getGroupSQL($this->getCFGDef('groupBy', 'c.id')); |
| 371 | 371 | if ($sanitarInIDs != "''" || $this->getCFGDef('ignoreEmpty', '0')) { |
| 372 | - $sql = $this->dbQuery("SELECT {$fields} FROM " . $from . " " . $where . " " . |
|
| 373 | - $group . " " . |
|
| 374 | - $sort . " " . |
|
| 372 | + $sql = $this->dbQuery("SELECT {$fields} FROM ".$from." ".$where." ". |
|
| 373 | + $group." ". |
|
| 374 | + $sort." ". |
|
| 375 | 375 | $this->LimitSQL($this->getCFGDef('queryLimit', 0)) |
| 376 | 376 | ); |
| 377 | 377 | |