@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
|
| 3 | +include_once(MODX_BASE_PATH.'assets/lib/APIHelpers.class.php'); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * Class DLTemplate |
@@ -166,16 +166,16 @@ discard block |
||
| 166 | 166 | $tmp) && isset($tmp[2], $tmp[3])) ? $tmp[2] : false; |
| 167 | 167 | $subTmp = (isset($tmp[3])) ? trim($tmp[3]) : null; |
| 168 | 168 | if ($this->twigEnabled) { |
| 169 | - $mode = '@' . substr($mode, 3); |
|
| 169 | + $mode = '@'.substr($mode, 3); |
|
| 170 | 170 | } |
| 171 | 171 | switch ($mode) { |
| 172 | 172 | case '@FILE': |
| 173 | 173 | if ($subTmp != '') { |
| 174 | - $real = realpath(MODX_BASE_PATH . $this->templatePath); |
|
| 175 | - $path = realpath(MODX_BASE_PATH . $this->templatePath . preg_replace(array( |
|
| 174 | + $real = realpath(MODX_BASE_PATH.$this->templatePath); |
|
| 175 | + $path = realpath(MODX_BASE_PATH.$this->templatePath.preg_replace(array( |
|
| 176 | 176 | '/\.*[\/|\\\]/i', |
| 177 | 177 | '/[\/|\\\]+/i' |
| 178 | - ), array('/', '/'), $subTmp) . '.' . $this->templateExtension); |
|
| 178 | + ), array('/', '/'), $subTmp).'.'.$this->templateExtension); |
|
| 179 | 179 | $fname = explode(".", $path); |
| 180 | 180 | if ($real == substr($path, 0, |
| 181 | 181 | strlen($real)) && end($fname) == $this->templateExtension && file_exists($path) |
@@ -197,11 +197,11 @@ discard block |
||
| 197 | 197 | case '@DOCUMENT': |
| 198 | 198 | case '@DOC': |
| 199 | 199 | switch (true) { |
| 200 | - case ((int)$subTmp > 0): |
|
| 201 | - $tpl = $this->modx->getPageInfo((int)$subTmp, 0, "content"); |
|
| 200 | + case ((int) $subTmp > 0): |
|
| 201 | + $tpl = $this->modx->getPageInfo((int) $subTmp, 0, "content"); |
|
| 202 | 202 | $tpl = isset($tpl['content']) ? $tpl['content'] : ''; |
| 203 | 203 | break; |
| 204 | - case ((int)$subTmp == 0): |
|
| 204 | + case ((int) $subTmp == 0): |
|
| 205 | 205 | $tpl = $this->modx->documentObject['content']; |
| 206 | 206 | break; |
| 207 | 207 | } |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | public function renderDoc($id, $events = false, $tpl = null) |
| 265 | 265 | { |
| 266 | - $id = (int)$id; |
|
| 266 | + $id = (int) $id; |
|
| 267 | 267 | if ($id <= 0) { |
| 268 | 268 | return ''; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | 271 | $m = clone $this->modx; //Чтобы была возможность вызывать события |
| 272 | 272 | $m->documentIdentifier = $id; |
| 273 | - $m->documentObject = $m->getDocumentObject('id', (int)$id, $events ? 'prepareResponse' : null); |
|
| 273 | + $m->documentObject = $m->getDocumentObject('id', (int) $id, $events ? 'prepareResponse' : null); |
|
| 274 | 274 | if ($m->documentObject['type'] == "reference") { |
| 275 | 275 | if (is_numeric($m->documentObject['content']) && $m->documentObject['content'] > 0) { |
| 276 | 276 | $m->documentObject['content'] = $this->renderDoc($m->documentObject['content'], $events); |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | public function getTemplate($id) |
| 306 | 306 | { |
| 307 | 307 | $tpl = null; |
| 308 | - $id = (int)$id; |
|
| 308 | + $id = (int) $id; |
|
| 309 | 309 | if ($id > 0) { |
| 310 | 310 | $tpl = $this->modx->db->getValue("SELECT `content` FROM {$this->modx->getFullTableName("site_templates")} WHERE `id` = {$id}"); |
| 311 | 311 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | */ |
| 365 | 365 | public function setPHxPlaceholders($value = '', $key = '', $path = '') |
| 366 | 366 | { |
| 367 | - $keypath = !empty($path) ? $path . "." . $key : $key; |
|
| 367 | + $keypath = !empty($path) ? $path.".".$key : $key; |
|
| 368 | 368 | $this->phx->curPass = 0; |
| 369 | 369 | if (is_array($value)) { |
| 370 | 370 | foreach ($value as $subkey => $subval) { |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | public function createPHx($debug = 0, $maxpass = 50) |
| 425 | 425 | { |
| 426 | 426 | if (!class_exists('DLphx')) { |
| 427 | - include_once(__DIR__ . '/DLphx.class.php'); |
|
| 427 | + include_once(__DIR__.'/DLphx.class.php'); |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | return new DLphx($this->modx, $debug, $maxpass); |