@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function forAll(Closure $p) |
66 | 66 | { |
67 | 67 | foreach ($this->data as $key => $element) { |
68 | - if (!$p($key, $element)) { |
|
68 | + if ( ! $p($key, $element)) { |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function remove($key) |
233 | 233 | { |
234 | - if (!isset($this->data[$key]) && !array_key_exists($key, $this->data)) { |
|
234 | + if ( ! isset($this->data[$key]) && ! array_key_exists($key, $this->data)) { |
|
235 | 235 | return null; |
236 | 236 | } |
237 | 237 | $removed = $this->data[$key]; |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function offsetSet($offset, $value) |
282 | 282 | { |
283 | - if (!isset($offset)) { |
|
283 | + if ( ! isset($offset)) { |
|
284 | 284 | return $this->add($value); |
285 | 285 | } |
286 | 286 | $this->set($offset, $value); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | */ |
382 | 382 | public function max($key) |
383 | 383 | { |
384 | - return $this->reduce(function ($result, $item) use ($key) { |
|
384 | + return $this->reduce(function($result, $item) use ($key) { |
|
385 | 385 | return (is_null($result) || $item[$key] > $result) ? $item[$key] : $result; |
386 | 386 | }); |
387 | 387 | } |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public function min($key) |
396 | 396 | { |
397 | - return $this->reduce(function ($result, $item) use ($key) { |
|
397 | + return $this->reduce(function($result, $item) use ($key) { |
|
398 | 398 | return (is_null($result) || $item[$key] < $result) ? $item[$key] : $result; |
399 | 399 | }); |
400 | 400 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('What are you doing? Get out of here!'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('What are you doing? Get out of here!'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | $_lang = array( |
5 | 7 | 'error' => array( |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $userClass = APIHelpers::getkey($params, 'userClass', 'modUsers'); |
8 | 8 | $DLUsers = \DLUsers\Actions::getInstance($modx, $lang, $userClass); |
9 | 9 | $out = ''; |
10 | -if ( ! empty($action) && method_exists($DLUsers, $action)) { |
|
10 | +if ( ! empty($action) && method_exists($DLUsers, $action)) { |
|
11 | 11 | $out = call_user_func_array(array($DLUsers, $action), array($params)); |
12 | 12 | } |
13 | 13 |
@@ -11,13 +11,15 @@ |
||
11 | 11 | * &orderBy=`BINARY pagetitle ASC` |
12 | 12 | * ]] |
13 | 13 | */ |
14 | -if ( ! defined('MODX_BASE_PATH')) die('HACK???'); |
|
14 | +if ( ! defined('MODX_BASE_PATH')) { |
|
15 | + die('HACK???'); |
|
16 | +} |
|
15 | 17 | |
16 | 18 | include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
17 | 19 | include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLFixedPrepare.class.php'); |
18 | 20 | |
19 | 21 | $p = &$modx->event->params; |
20 | -if ( ! is_array($p)) { |
|
22 | +if ( ! is_array($p)) { |
|
21 | 23 | $p = array(); |
22 | 24 | } |
23 | 25 |
@@ -1,10 +1,12 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('HACK???'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('HACK???'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | require_once(MODX_BASE_PATH . "assets/snippets/DocLister/lib/DLTemplate.class.php"); |
5 | 7 | |
6 | 8 | $tpl = ''; |
7 | -if (isset($modx->Event->params['tpl'])) { |
|
9 | +if (isset($modx->Event->params['tpl'])) { |
|
8 | 10 | $tpl = $modx->Event->params['tpl']; |
9 | 11 | unset($modx->Event->params['tpl']); |
10 | 12 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('HACK???'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('HACK???'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | $ID = $modx->documentObject['id']; |
5 | 7 | $params = is_array($modx->Event->params) ? $modx->Event->params : array(); |
@@ -13,27 +15,27 @@ discard block |
||
13 | 15 | $children = jsonHelper::jsonDecode($json, array('assoc' => true)); |
14 | 16 | $children = is_array($children) ? $children : array(); |
15 | 17 | $self = $prev = $next = null; |
16 | -foreach ($children as $key => $data) { |
|
17 | - if ( ! empty($self)) { |
|
18 | +foreach ($children as $key => $data) { |
|
19 | + if ( ! empty($self)) { |
|
18 | 20 | $next = $key; |
19 | 21 | break; |
20 | 22 | } |
21 | - if ($key == $ID) { |
|
23 | + if ($key == $ID) { |
|
22 | 24 | $self = $key; |
23 | - if (empty($prev)) { |
|
25 | + if (empty($prev)) { |
|
24 | 26 | $prev = end($children); |
25 | 27 | $prev = $prev['id']; |
26 | 28 | } |
27 | - } else { |
|
29 | + } else { |
|
28 | 30 | $prev = $key; |
29 | 31 | } |
30 | 32 | } |
31 | -if (empty($next)) { |
|
33 | +if (empty($next)) { |
|
32 | 34 | reset($children); |
33 | 35 | $next = current($children); |
34 | 36 | $next = $next['id']; |
35 | 37 | } |
36 | -if ($next == $prev) { |
|
38 | +if ($next == $prev) { |
|
37 | 39 | $next = ''; |
38 | 40 | } |
39 | 41 |
@@ -1,11 +1,13 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('HACK???'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('HACK???'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
5 | 7 | include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLFixedPrepare.class.php'); |
6 | 8 | |
7 | 9 | $p = &$modx->event->params; |
8 | -if ( ! is_array($p)) { |
|
10 | +if ( ! is_array($p)) { |
|
9 | 11 | $p = array(); |
10 | 12 | } |
11 | 13 |
@@ -1,10 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('HACK???'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('HACK???'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | include_once(MODX_BASE_PATH . 'assets/lib/APIHelpers.class.php'); |
5 | 7 | |
6 | 8 | $p = &$modx->event->params; |
7 | -if ( ! is_array($p)) { |
|
9 | +if ( ! is_array($p)) { |
|
8 | 10 | $p = array(); |
9 | 11 | } |
10 | 12 | |
@@ -27,18 +29,18 @@ discard block |
||
27 | 29 | $out = array(); |
28 | 30 | |
29 | 31 | $nopTitle = APIhelpers::getkey($p, 'addNopTitle'); |
30 | -if ($nopTitle) { |
|
32 | +if ($nopTitle) { |
|
31 | 33 | $nopValue = APIhelpers::getkey($p, 'addNopValue'); |
32 | 34 | $out[] = $nopTitle . '==' . $nopValue; |
33 | 35 | } |
34 | 36 | |
35 | -foreach ($json as $el) { |
|
37 | +foreach ($json as $el) { |
|
36 | 38 | $out[] = APIhelpers::getkey($el, $titleField) . '==' . APIhelpers::getkey($el, $valueField); |
37 | 39 | } |
38 | -if (APIhelpers::getkey($p, 'debug')) { |
|
40 | +if (APIhelpers::getkey($p, 'debug')) { |
|
39 | 41 | $key = APIhelpers::getkey($p, 'sysKey', 'dl') . '.debug'; |
40 | 42 | $debugStack = $modx->getPlaceholder($key); |
41 | - if ( ! empty($debugStack)) { |
|
43 | + if ( ! empty($debugStack)) { |
|
42 | 44 | $modx->logEvent(0, 1, $debugStack, 'DocLister [DLValueList]'); |
43 | 45 | } |
44 | 46 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if ( ! defined('MODX_BASE_PATH')) die('What are you doing? Get out of here!'); |
|
2 | +if ( ! defined('MODX_BASE_PATH')) { |
|
3 | + die('What are you doing? Get out of here!'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | setlocale(LC_ALL, 'ru_RU.UTF-8'); |
5 | 7 |