@@ -156,7 +156,7 @@ |
||
156 | 156 | |
157 | 157 | /** |
158 | 158 | * Список активных документов |
159 | - * @param $id |
|
159 | + * @param integer $id |
|
160 | 160 | * @param int $maxDepth |
161 | 161 | */ |
162 | 162 | public function setActiveBranch($id, $maxDepth = 10) |
@@ -67,9 +67,9 @@ discard block |
||
67 | 67 | foreach ($this->levels as $level => $docs) { |
68 | 68 | $ids = array_merge($ids, array_keys($docs)); |
69 | 69 | } |
70 | - if (!empty($ids)) { |
|
70 | + if ( ! empty($ids)) { |
|
71 | 71 | $tv = $this->extTV->getTVList($ids, $tvlist); |
72 | - if (!is_array($tv)) { |
|
72 | + if ( ! is_array($tv)) { |
|
73 | 73 | $tv = array(); |
74 | 74 | } |
75 | 75 | $this->docTvs = $tv; |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | if ($this->getCFGDef('showParent', 0) && in_array(0, $this->IDs)) { |
112 | 112 | $this->config->setConfig(array('showParent' => 0)); |
113 | 113 | } |
114 | - $joinMenus = $this->getCFGDef('joinMenus', 0) && !$this->getCFGDef('showParent', 0); |
|
114 | + $joinMenus = $this->getCFGDef('joinMenus', 0) && ! $this->getCFGDef('showParent', 0); |
|
115 | 115 | while ($currentLevel <= $maxDepth) { |
116 | 116 | $orderBy = $this->getCFGDef('orderBy'); |
117 | 117 | if ($this->getCFGDef('showParent', 0) && $currentLevel == 1) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } else { |
139 | 139 | foreach ($docs as $id => &$item) { |
140 | 140 | $parent = $item['parent']; |
141 | - if (!isset($this->display[$parent])) { |
|
141 | + if ( ! isset($this->display[$parent])) { |
|
142 | 142 | $this->display[$parent] = 1; |
143 | 143 | } |
144 | 144 | $item['iteration'] = $this->display[$parent]++; |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $at = array_flip($a); |
214 | 214 | $d = array(); |
215 | 215 | foreach ($b as $i) { |
216 | - if (!isset($at[$i])) { |
|
216 | + if ( ! isset($at[$i])) { |
|
217 | 217 | $d[] = $i; |
218 | 218 | } |
219 | 219 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $data = $out; |
265 | 265 | } |
266 | 266 | }; |
267 | - if (!isset($data['maxLevel'])) { |
|
267 | + if ( ! isset($data['maxLevel'])) { |
|
268 | 268 | $data['maxLevel'] = 1; |
269 | 269 | $docs[$currentLevel - 1][$data['parent']]['maxLevel'] = 0; |
270 | 270 | } |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | if (isset($data['wrap'])) { |
283 | - if(is_array($data['wrap'])) { |
|
283 | + if (is_array($data['wrap'])) { |
|
284 | 284 | $data['wrap'] = $this->parseRow($data['wrap']); |
285 | 285 | } |
286 | 286 | $data['wrap'] = $this->parseOuter($data); |
287 | 287 | } |
288 | 288 | $hideSubMenus = $this->getCFGDef('hideSubMenus', 0); |
289 | - $hideSubMenus = !$hideSubMenus || ($hideSubMenus && in_array((int)$data['parent'], |
|
289 | + $hideSubMenus = ! $hideSubMenus || ($hideSubMenus && in_array((int)$data['parent'], |
|
290 | 290 | $this->activeBranch)); |
291 | 291 | if ($hideSubMenus) { |
292 | 292 | $docs[$currentLevel - 1][$data['parent']]['wrap'][] = $data; |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | } |
298 | 298 | unset($data); |
299 | 299 | $out = ''; |
300 | - $joinMenus = $this->getCFGDef('joinMenus', 0) && !$this->getCFGDef('showParent', 0); |
|
300 | + $joinMenus = $this->getCFGDef('joinMenus', 0) && ! $this->getCFGDef('showParent', 0); |
|
301 | 301 | foreach ($docs[0] as $id => $data) { |
302 | 302 | if (isset($data['wrap'])) { |
303 | 303 | if ($joinMenus) { |
@@ -333,14 +333,14 @@ discard block |
||
333 | 333 | if ($id == $this->getHereId()) { |
334 | 334 | $data['here'] = 1; |
335 | 335 | } |
336 | - if (!isset($data['here']) && in_array($id, $this->activeBranch)) { |
|
336 | + if ( ! isset($data['here']) && in_array($id, $this->activeBranch)) { |
|
337 | 337 | $data['active'] = 1; |
338 | 338 | } |
339 | 339 | if ($this->getCFGDef('hideSubMenus') && isset($data['isfolder']) && $data['isfolder']) { |
340 | 340 | $data['state'] = in_array($data['id'], $this->activeBranch) ? 'open' : 'closed'; |
341 | 341 | } |
342 | 342 | |
343 | - if (!isset($data['_display'])) { |
|
343 | + if ( ! isset($data['_display'])) { |
|
344 | 344 | $data['_display'] = $this->display[$data['parent']] - 1; |
345 | 345 | } |
346 | 346 | if ($data['iteration'] == 1) { |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | } |
352 | 352 | |
353 | 353 | $titleField = $this->getCFGDef('titleField', 'title'); |
354 | - $data[$titleField] = isset($data['menutitle']) && !empty($data['menutitle']) ? $data['menutitle'] : $data['pagetitle']; |
|
354 | + $data[$titleField] = isset($data['menutitle']) && ! empty($data['menutitle']) ? $data['menutitle'] : $data['pagetitle']; |
|
355 | 355 | $data['level'] = $this->currentLevel; |
356 | 356 | $data['url'] = $this->makeUrl($data); |
357 | 357 | if ($this->getCFGDef('countChildren', 0)) { |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | */ |
438 | 438 | public function getHereId() |
439 | 439 | { |
440 | - if (!$hereId = (int)$this->getCFGDef('hereId')) { |
|
440 | + if ( ! $hereId = (int)$this->getCFGDef('hereId')) { |
|
441 | 441 | $hereId = isset($this->modx->documentIdentifier) ? (int)$this->modx->documentIdentifier : 0; |
442 | 442 | } |
443 | 443 | |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | if (isset($data['type']) && $data['type'] == 'reference') { |
491 | 491 | $classes['webLinkClass'] = $this->getCFGDef('webLinkClass'); |
492 | 492 | } |
493 | - if (!empty($data['wrap'])) { |
|
493 | + if ( ! empty($data['wrap'])) { |
|
494 | 494 | $classes['parentClass'] = $this->getCFGDef('parentClass'); |
495 | 495 | } |
496 | 496 | $classNames = implode(' ', array_filter(array_values($classes))); |
@@ -508,10 +508,10 @@ discard block |
||
508 | 508 | protected function getRowTemplate($data = array()) |
509 | 509 | { |
510 | 510 | $tpl = $this->getCFGDef('rowTpl', '@CODE:<li[+classes+]><a href="[+url+]">[+title+]</a></li>'); |
511 | - if (!empty($data['wrap'])) { |
|
511 | + if ( ! empty($data['wrap'])) { |
|
512 | 512 | $tpl = $this->getCFGDef('parentRowTpl', |
513 | 513 | '@CODE:<li[+classes+]><a href="[+url+]">[+title+]</a>[+wrap+]</li>'); |
514 | - if ((isset($data['template']) && !$data['template']) || (isset($data['link_attributes']) && strpos($data['link_attributes'], |
|
514 | + if ((isset($data['template']) && ! $data['template']) || (isset($data['link_attributes']) && strpos($data['link_attributes'], |
|
515 | 515 | 'category') !== false) |
516 | 516 | ) { |
517 | 517 | $tpl = $this->getCFGDef('categoryFolderTpl', $tpl); |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | } |
577 | 577 | |
578 | 578 | $hideSubMenus = $this->getCFGDef('hideSubMenus', 0); |
579 | - $hideSubMenus = !$hideSubMenus || ($hideSubMenus && in_array((int)$data['parent'], |
|
579 | + $hideSubMenus = ! $hideSubMenus || ($hideSubMenus && in_array((int)$data['parent'], |
|
580 | 580 | $this->activeBranch)); |
581 | 581 | if ($hideSubMenus) { |
582 | 582 | $docs[$currentLevel - 1][$data['parent']]['children'][] = $data; |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } |
588 | 588 | unset($data); |
589 | 589 | $out = array(); |
590 | - $joinMenus = $this->getCFGDef('joinMenus', 0) && !$this->getCFGDef('showParent', 0); |
|
590 | + $joinMenus = $this->getCFGDef('joinMenus', 0) && ! $this->getCFGDef('showParent', 0); |
|
591 | 591 | foreach ($docs[0] as $id => $data) { |
592 | 592 | if (isset($data['children'])) { |
593 | 593 | if ($joinMenus) { |