Completed
Pull Request — master (#253)
by
unknown
02:29
created
assets/snippets/DocLister/snippet.DLcrumbs.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -5,24 +5,24 @@  discard block
 block discarded – undo
5 5
  * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html
6 6
  * @author Agel_Nash <[email protected]>
7 7
  */
8
-if (!defined('MODX_BASE_PATH')) {
8
+if ( ! defined('MODX_BASE_PATH')) {
9 9
     die('HACK???');
10 10
 }
11 11
 $_out = '';
12 12
 
13
-if ( isset( $modx->event->params['config'] ) ) {
13
+if (isset($modx->event->params['config'])) {
14 14
     require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php';
15 15
 
16
-    $helper = new \Helpers\Config( $modx->event->params );
17
-    $helper->setPath( '/assets/snippets/DocLister/' );
18
-    $helper->loadConfig( $modx->event->params['config'] );
16
+    $helper = new \Helpers\Config($modx->event->params);
17
+    $helper->setPath('/assets/snippets/DocLister/');
18
+    $helper->loadConfig($modx->event->params['config']);
19 19
     
20 20
     $modx->event->params = $helper->getConfig();
21
-    extract( $modx->event->params );
21
+    extract($modx->event->params);
22 22
 }
23 23
 
24 24
 $_parents = array();
25
-$hideMain = (!isset($hideMain) || (int)$hideMain == 0);
25
+$hideMain = ( ! isset($hideMain) || (int)$hideMain == 0);
26 26
 if ($hideMain) {
27 27
     $_parents[] = $modx->config['site_start'];
28 28
 }
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 $tmp = $modx->getParentIds($id);
31 31
 $_parents = array_merge($_parents, array_reverse(array_values($tmp)));
32 32
 foreach ($_parents as $i => $num) {
33
-    if ($num == $modx->config['site_start'] && !$hideMain) {
33
+    if ($num == $modx->config['site_start'] && ! $hideMain) {
34 34
         unset($_parents[$i]);
35 35
     }
36 36
 }
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 if (isset($showCurrent) && (int)$showCurrent > 0) {
39 39
     $_parents[] = $id;
40 40
 }
41
-if (!empty($_parents) && count($_parents) >= (empty($minDocs) ? 0 : (int)$minDocs)) {
41
+if ( ! empty($_parents) && count($_parents) >= (empty($minDocs) ? 0 : (int)$minDocs)) {
42 42
     $_options = array_merge(
43 43
         array(
44 44
             'config' => 'crumbs:core'
45 45
         ),
46
-        !empty($modx->event->params) ? $modx->event->params : array(),
46
+        ! empty($modx->event->params) ? $modx->event->params : array(),
47 47
         array(
48 48
             'idType'    => 'documents',
49 49
             'sortType'  => 'doclist',
Please login to merge, or discard this patch.
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -5,12 +5,12 @@  discard block
 block discarded – undo
5 5
  * @license GNU General Public License (GPL), http://www.gnu.org/copyleft/gpl.html
6 6
  * @author Agel_Nash <[email protected]>
7 7
  */
8
-if (!defined('MODX_BASE_PATH')) {
8
+if (!defined('MODX_BASE_PATH')) {
9 9
     die('HACK???');
10 10
 }
11 11
 $_out = '';
12 12
 
13
-if ( isset( $modx->event->params['config'] ) ) {
13
+if ( isset( $modx->event->params['config'] ) ) {
14 14
     require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php';
15 15
 
16 16
     $helper = new \Helpers\Config( $modx->event->params );
@@ -23,22 +23,22 @@  discard block
 block discarded – undo
23 23
 
24 24
 $_parents = array();
25 25
 $hideMain = (!isset($hideMain) || (int)$hideMain == 0);
26
-if ($hideMain) {
26
+if ($hideMain) {
27 27
     $_parents[] = $modx->config['site_start'];
28 28
 }
29 29
 $id = isset($id) ? $id : $modx->documentObject['id'];
30 30
 $tmp = $modx->getParentIds($id);
31 31
 $_parents = array_merge($_parents, array_reverse(array_values($tmp)));
32
-foreach ($_parents as $i => $num) {
33
-    if ($num == $modx->config['site_start'] && !$hideMain) {
32
+foreach ($_parents as $i => $num) {
33
+    if ($num == $modx->config['site_start'] && !$hideMain) {
34 34
         unset($_parents[$i]);
35 35
     }
36 36
 }
37 37
 
38
-if (isset($showCurrent) && (int)$showCurrent > 0) {
38
+if (isset($showCurrent) && (int)$showCurrent > 0) {
39 39
     $_parents[] = $id;
40 40
 }
41
-if (!empty($_parents) && count($_parents) >= (empty($minDocs) ? 0 : (int)$minDocs)) {
41
+if (!empty($_parents) && count($_parents) >= (empty($minDocs) ? 0 : (int)$minDocs)) {
42 42
     $_options = array_merge(
43 43
         array(
44 44
             'config' => 'crumbs:core'
Please login to merge, or discard this patch.
assets/snippets/DocLister/snippet.DLBuildMenu.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
     $p = array();
12 12
 }
13 13
 
14
-if ( isset( $p['config'] ) ) {
14
+if (isset($p['config'])) {
15 15
     require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php';
16 16
 
17
-    $helper = new \Helpers\Config( $p );
18
-    $helper->setPath( '/assets/snippets/DocLister/' );
19
-    $helper->loadConfig( $p['config'] );
17
+    $helper = new \Helpers\Config($p);
18
+    $helper->setPath('/assets/snippets/DocLister/');
19
+    $helper->loadConfig($p['config']);
20 20
     
21 21
     $p = $helper->getConfig();
22 22
 }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
 
79 79
 $p['tvList'] = $currentTvList = \APIhelpers::getkey($p, 'tvList');
80
-$currentTvList  = \APIhelpers::getkey($p, 'tvList' . $currentDepth, $currentTvList);
80
+$currentTvList = \APIhelpers::getkey($p, 'tvList' . $currentDepth, $currentTvList);
81 81
 /**
82 82
  * Получение prepare сниппетов из параметров BeforePrepare и AfterPrepare
83 83
  * для совмещения с обязательным вызовом DLFixedPrepare::buildMenu метода
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('MODX_BASE_PATH')) {
2
+if ( ! defined('MODX_BASE_PATH')) {
3 3
     die('HACK???');
4 4
 }
5 5
 
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
7 7
 include_once(MODX_BASE_PATH . 'assets/snippets/DocLister/lib/DLFixedPrepare.class.php');
8 8
 
9 9
 $p = &$modx->event->params;
10
-if ( ! is_array($p)) {
10
+if ( ! is_array($p)) {
11 11
     $p = array();
12 12
 }
13 13
 
14
-if ( isset( $p['config'] ) ) {
14
+if ( isset( $p['config'] ) ) {
15 15
     require_once MODX_BASE_PATH . 'assets/lib/Helpers/Config.php';
16 16
 
17 17
     $helper = new \Helpers\Config( $p );
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  * TplSubOwner  Шаблон обертка для вложенных уровней
42 42
  */
43 43
 $currentOwnerTpl = \APIhelpers::getkey($p, 'TplOwner' . $currentDepth);
44
-if (empty($currentOwnerTpl)) {
44
+if (empty($currentOwnerTpl)) {
45 45
     $currentOwnerTpl = \APIhelpers::getkey($p, (($currentDepth == 1) ? 'TplMainOwner' : 'TplSubOwner'));
46 46
 }
47 47
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
  */
62 62
 $currentTpl = \APIhelpers::getkey($p, 'TplDepth' . $currentDepth, $currentTpl);
63 63
 $currentNoChildrenTpl = \APIhelpers::getkey($p, 'TplNoChildrenDepth' . $currentDepth);
64
-if (empty($currentNoChildrenTpl)) {
64
+if (empty($currentNoChildrenTpl)) {
65 65
     $currentNoChildrenTpl = \APIhelpers::getkey($p, 'noChildrenRowTPL', $currentTpl);
66 66
 }
67 67
 
Please login to merge, or discard this patch.