Completed
Push — develop ( dd48c1...053968 )
by Maxim
06:38 queued 01:16
created
manager/actions/help/04Changelog.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@
 block discarded – undo
7 7
 <div class="sectionHeader">Changelog</div>
8 8
 <div class="sectionBody">
9 9
 <?php
10
-	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
10
+    $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
+    if(is_readable($changeLog))
12
+        echo str_replace("\n",'<br>',file_get_contents($changeLog));
13 13
 ?>
14 14
 </div>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 ?>
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
 <div class="sectionHeader">Changelog</div>
8 8
 <div class="sectionBody">
9 9
 <?php
10
-	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
10
+	$changeLog = MODX_BASE_PATH.'assets/docs/changelog.txt';
11
+	if (is_readable($changeLog))
12
+		echo str_replace("\n", '<br>', file_get_contents($changeLog));
13 13
 ?>
14 14
 </div>
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@
 block discarded – undo
8 8
 <div class="sectionBody">
9 9
 <?php
10 10
 	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
11
-	if(is_readable($changeLog))
12
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
-?>
11
+	if(is_readable($changeLog)) {
12
+			echo str_replace("\n",'<br>',file_get_contents($changeLog));
13
+	}
14
+	?>
14 15
 </div>
Please login to merge, or discard this patch.
manager/actions/resources/tab2_templatevars.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- Template variables -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab3_chunks.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- chunks -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab6_categoryview.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 } ?>
5 5
 
Please login to merge, or discard this patch.
manager/actions/resources/tab4_snippets.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- snippets -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/mgrResources.class.php 3 patches
Indentation   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -4,123 +4,123 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 class mgrResources {
7
-	var $types = array();
8
-	var $items = array();
9
-	var $categories = array();
10
-	var $itemsPerCategory = array();
11
-
12
-	function __construct() {
13
-		$this->setTypes();
14
-		$this->queryItemsFromDB();
15
-		$this->prepareCategoryArrays();
16
-	}
17
-
18
-	function setTypes() {
19
-		global $_lang;
20
-		$this->types['site_templates']    = array(
21
-			'title'=>$_lang["manage_templates"],
22
-			'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
23
-			'permissions'=>array('new_template','edit_template'),
24
-			'name'=>'templatename'
25
-		);
26
-		$this->types['site_tmplvars']     = array(
27
-			'title'=>$_lang["tmplvars"],
28
-			'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
29
-			'permissions'=>array('new_template','edit_template'),
30
-		);
31
-		$this->types['site_htmlsnippets'] = array(
32
-			'title'=>$_lang["manage_htmlsnippets"],
33
-			'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
34
-			'permissions'=>array('new_chunk','edit_chunk'),
35
-		);
36
-		$this->types['site_snippets']     = array(
37
-			'title'=>$_lang["manage_snippets"],
38
-			'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
39
-			'permissions'=>array('new_snippet','edit_snippet'),
40
-		);
41
-		$this->types['site_plugins']      = array(
42
-			'title'=>$_lang["manage_plugins"],
43
-			'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
44
-			'permissions'=>array('new_plugin','edit_plugin'),
45
-		);
46
-		$this->types['site_modules']      = array(
47
-			'title'=>$_lang["manage_modules"],
48
-			'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
49
-			'permissions'=>array('new_module','edit_module'),
50
-		);
51
-	}
52
-
53
-	function queryItemsFromDB() {
54
-		foreach($this->types as $resourceTable=>$type) {
55
-			if($this->hasAnyPermissions($type['permissions'])) {
56
-				$nameField = isset($type['name']) ? $type['name'] : 'name';
57
-				$this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
58
-		   }
59
-		 }
60
-	}
61
-
62
-	function hasAnyPermissions($permissions) {
63
-		global $modx;
64
-
65
-		foreach($permissions as $p)
66
-			if($modx->hasPermission($p)) return true;
67
-
68
-		return false;
69
-	}
70
-
71
-	function queryResources($resourceTable, $nameField = 'name') {
72
-		global $modx, $_lang;
73
-
74
-		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
75
-
76
-		$tvsql  = '';
77
-		$tvjoin = '';
78
-		if ($resourceTable == 'site_tmplvars') {
79
-			$tvsql    = 'site_tmplvars.caption, ';
80
-			$tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
81
-			$sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
82
-		}
83
-		else $sttfield = '';
84
-
85
-		$selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
86
-
87
-		$rs = $modx->db->select(
88
-			"{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
89
-			$modx->getFullTableName($resourceTable) . " AS {$resourceTable}
7
+    var $types = array();
8
+    var $items = array();
9
+    var $categories = array();
10
+    var $itemsPerCategory = array();
11
+
12
+    function __construct() {
13
+        $this->setTypes();
14
+        $this->queryItemsFromDB();
15
+        $this->prepareCategoryArrays();
16
+    }
17
+
18
+    function setTypes() {
19
+        global $_lang;
20
+        $this->types['site_templates']    = array(
21
+            'title'=>$_lang["manage_templates"],
22
+            'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
23
+            'permissions'=>array('new_template','edit_template'),
24
+            'name'=>'templatename'
25
+        );
26
+        $this->types['site_tmplvars']     = array(
27
+            'title'=>$_lang["tmplvars"],
28
+            'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
29
+            'permissions'=>array('new_template','edit_template'),
30
+        );
31
+        $this->types['site_htmlsnippets'] = array(
32
+            'title'=>$_lang["manage_htmlsnippets"],
33
+            'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
34
+            'permissions'=>array('new_chunk','edit_chunk'),
35
+        );
36
+        $this->types['site_snippets']     = array(
37
+            'title'=>$_lang["manage_snippets"],
38
+            'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
39
+            'permissions'=>array('new_snippet','edit_snippet'),
40
+        );
41
+        $this->types['site_plugins']      = array(
42
+            'title'=>$_lang["manage_plugins"],
43
+            'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
44
+            'permissions'=>array('new_plugin','edit_plugin'),
45
+        );
46
+        $this->types['site_modules']      = array(
47
+            'title'=>$_lang["manage_modules"],
48
+            'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
49
+            'permissions'=>array('new_module','edit_module'),
50
+        );
51
+    }
52
+
53
+    function queryItemsFromDB() {
54
+        foreach($this->types as $resourceTable=>$type) {
55
+            if($this->hasAnyPermissions($type['permissions'])) {
56
+                $nameField = isset($type['name']) ? $type['name'] : 'name';
57
+                $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
58
+            }
59
+            }
60
+    }
61
+
62
+    function hasAnyPermissions($permissions) {
63
+        global $modx;
64
+
65
+        foreach($permissions as $p)
66
+            if($modx->hasPermission($p)) return true;
67
+
68
+        return false;
69
+    }
70
+
71
+    function queryResources($resourceTable, $nameField = 'name') {
72
+        global $modx, $_lang;
73
+
74
+        $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
75
+
76
+        $tvsql  = '';
77
+        $tvjoin = '';
78
+        if ($resourceTable == 'site_tmplvars') {
79
+            $tvsql    = 'site_tmplvars.caption, ';
80
+            $tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
81
+            $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
82
+        }
83
+        else $sttfield = '';
84
+
85
+        $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
86
+
87
+        $rs = $modx->db->select(
88
+            "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
89
+            $modx->getFullTableName($resourceTable) . " AS {$resourceTable}
90 90
 	            LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
91
-			"",
92
-			"category,name"
93
-		);
94
-		$limit = $modx->db->getRecordCount($rs);
95
-
96
-		if($limit < 1) return false;
97
-
98
-		$result = array();
99
-		while ($row = $modx->db->getRow($rs)) {
100
-			$result[] = $row;
101
-		}
102
-		return $result;
103
-	}
104
-
105
-	function prepareCategoryArrays() {
106
-		foreach($this->items as $type=>$items) {
107
-			foreach((array)$items as $item) {
108
-				$catid = $item['catid'] ? $item['catid'] : 0;
109
-				$this->categories[$catid] = $item['category'];
110
-
111
-				$item['type'] = $type;
112
-				$this->itemsPerCategory[$catid][] = $item;
113
-			}
114
-		}
115
-
116
-		// Sort categories by name
117
-		natcasesort($this->categories);
118
-
119
-		// Now sort by name
120
-		foreach($this->itemsPerCategory as $catid=>$items) {
121
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
122
-				return strcasecmp($a['name'], $b['name']);
123
-			});
124
-		}
125
-	}
91
+            "",
92
+            "category,name"
93
+        );
94
+        $limit = $modx->db->getRecordCount($rs);
95
+
96
+        if($limit < 1) return false;
97
+
98
+        $result = array();
99
+        while ($row = $modx->db->getRow($rs)) {
100
+            $result[] = $row;
101
+        }
102
+        return $result;
103
+    }
104
+
105
+    function prepareCategoryArrays() {
106
+        foreach($this->items as $type=>$items) {
107
+            foreach((array)$items as $item) {
108
+                $catid = $item['catid'] ? $item['catid'] : 0;
109
+                $this->categories[$catid] = $item['category'];
110
+
111
+                $item['type'] = $type;
112
+                $this->itemsPerCategory[$catid][] = $item;
113
+            }
114
+        }
115
+
116
+        // Sort categories by name
117
+        natcasesort($this->categories);
118
+
119
+        // Now sort by name
120
+        foreach($this->itemsPerCategory as $catid=>$items) {
121
+            usort($this->itemsPerCategory[$catid], function ($a, $b) {
122
+                return strcasecmp($a['name'], $b['name']);
123
+            });
124
+        }
125
+    }
126 126
 }
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,77 +1,77 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-class mgrResources {
6
+class mgrResources{
7 7
 	var $types = array();
8 8
 	var $items = array();
9 9
 	var $categories = array();
10 10
 	var $itemsPerCategory = array();
11 11
 
12
-	function __construct() {
12
+	function __construct(){
13 13
 		$this->setTypes();
14 14
 		$this->queryItemsFromDB();
15 15
 		$this->prepareCategoryArrays();
16 16
 	}
17 17
 
18
-	function setTypes() {
18
+	function setTypes(){
19 19
 		global $_lang;
20
-		$this->types['site_templates']    = array(
20
+		$this->types['site_templates'] = array(
21 21
 			'title'=>$_lang["manage_templates"],
22
-			'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
23
-			'permissions'=>array('new_template','edit_template'),
22
+			'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')),
23
+			'permissions'=>array('new_template', 'edit_template'),
24 24
 			'name'=>'templatename'
25 25
 		);
26
-		$this->types['site_tmplvars']     = array(
26
+		$this->types['site_tmplvars'] = array(
27 27
 			'title'=>$_lang["tmplvars"],
28
-			'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
29
-			'permissions'=>array('new_template','edit_template'),
28
+			'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')),
29
+			'permissions'=>array('new_template', 'edit_template'),
30 30
 		);
31 31
 		$this->types['site_htmlsnippets'] = array(
32 32
 			'title'=>$_lang["manage_htmlsnippets"],
33
-			'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
34
-			'permissions'=>array('new_chunk','edit_chunk'),
33
+			'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')),
34
+			'permissions'=>array('new_chunk', 'edit_chunk'),
35 35
 		);
36
-		$this->types['site_snippets']     = array(
36
+		$this->types['site_snippets'] = array(
37 37
 			'title'=>$_lang["manage_snippets"],
38
-			'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
39
-			'permissions'=>array('new_snippet','edit_snippet'),
38
+			'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')),
39
+			'permissions'=>array('new_snippet', 'edit_snippet'),
40 40
 		);
41
-		$this->types['site_plugins']      = array(
41
+		$this->types['site_plugins'] = array(
42 42
 			'title'=>$_lang["manage_plugins"],
43
-			'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
44
-			'permissions'=>array('new_plugin','edit_plugin'),
43
+			'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')),
44
+			'permissions'=>array('new_plugin', 'edit_plugin'),
45 45
 		);
46
-		$this->types['site_modules']      = array(
46
+		$this->types['site_modules'] = array(
47 47
 			'title'=>$_lang["manage_modules"],
48
-			'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
49
-			'permissions'=>array('new_module','edit_module'),
48
+			'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')),
49
+			'permissions'=>array('new_module', 'edit_module'),
50 50
 		);
51 51
 	}
52 52
 
53
-	function queryItemsFromDB() {
54
-		foreach($this->types as $resourceTable=>$type) {
55
-			if($this->hasAnyPermissions($type['permissions'])) {
53
+	function queryItemsFromDB(){
54
+		foreach ($this->types as $resourceTable=>$type) {
55
+			if ($this->hasAnyPermissions($type['permissions'])) {
56 56
 				$nameField = isset($type['name']) ? $type['name'] : 'name';
57 57
 				$this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
58 58
 		   }
59 59
 		 }
60 60
 	}
61 61
 
62
-	function hasAnyPermissions($permissions) {
62
+	function hasAnyPermissions($permissions){
63 63
 		global $modx;
64 64
 
65
-		foreach($permissions as $p)
66
-			if($modx->hasPermission($p)) return true;
65
+		foreach ($permissions as $p)
66
+			if ($modx->hasPermission($p)) return true;
67 67
 
68 68
 		return false;
69 69
 	}
70 70
 
71
-	function queryResources($resourceTable, $nameField = 'name') {
71
+	function queryResources($resourceTable, $nameField = 'name'){
72 72
 		global $modx, $_lang;
73 73
 
74
-		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
74
+		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable.'.disabled, ' : '';
75 75
 
76 76
 		$tvsql  = '';
77 77
 		$tvjoin = '';
@@ -86,14 +86,14 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$rs = $modx->db->select(
88 88
 			"{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
89
-			$modx->getFullTableName($resourceTable) . " AS {$resourceTable}
90
-	            LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
89
+			$modx->getFullTableName($resourceTable)." AS {$resourceTable}
90
+	            LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
91 91
 			"",
92 92
 			"category,name"
93 93
 		);
94 94
 		$limit = $modx->db->getRecordCount($rs);
95 95
 
96
-		if($limit < 1) return false;
96
+		if ($limit < 1) return false;
97 97
 
98 98
 		$result = array();
99 99
 		while ($row = $modx->db->getRow($rs)) {
@@ -102,9 +102,9 @@  discard block
 block discarded – undo
102 102
 		return $result;
103 103
 	}
104 104
 
105
-	function prepareCategoryArrays() {
106
-		foreach($this->items as $type=>$items) {
107
-			foreach((array)$items as $item) {
105
+	function prepareCategoryArrays(){
106
+		foreach ($this->items as $type=>$items) {
107
+			foreach ((array) $items as $item) {
108 108
 				$catid = $item['catid'] ? $item['catid'] : 0;
109 109
 				$this->categories[$catid] = $item['category'];
110 110
 
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 		natcasesort($this->categories);
118 118
 
119 119
 		// Now sort by name
120
-		foreach($this->itemsPerCategory as $catid=>$items) {
121
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
120
+		foreach ($this->itemsPerCategory as $catid=>$items) {
121
+			usort($this->itemsPerCategory[$catid], function($a, $b){
122 122
 				return strcasecmp($a['name'], $b['name']);
123 123
 			});
124 124
 		}
Please login to merge, or discard this patch.
Braces   +23 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,19 +3,22 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-class mgrResources {
6
+class mgrResources
7
+{
7 8
 	var $types = array();
8 9
 	var $items = array();
9 10
 	var $categories = array();
10 11
 	var $itemsPerCategory = array();
11 12
 
12
-	function __construct() {
13
+	function __construct()
14
+	{
13 15
 		$this->setTypes();
14 16
 		$this->queryItemsFromDB();
15 17
 		$this->prepareCategoryArrays();
16 18
 	}
17 19
 
18
-	function setTypes() {
20
+	function setTypes()
21
+	{
19 22
 		global $_lang;
20 23
 		$this->types['site_templates']    = array(
21 24
 			'title'=>$_lang["manage_templates"],
@@ -50,7 +53,8 @@  discard block
 block discarded – undo
50 53
 		);
51 54
 	}
52 55
 
53
-	function queryItemsFromDB() {
56
+	function queryItemsFromDB()
57
+	{
54 58
 		foreach($this->types as $resourceTable=>$type) {
55 59
 			if($this->hasAnyPermissions($type['permissions'])) {
56 60
 				$nameField = isset($type['name']) ? $type['name'] : 'name';
@@ -59,16 +63,19 @@  discard block
 block discarded – undo
59 63
 		 }
60 64
 	}
61 65
 
62
-	function hasAnyPermissions($permissions) {
66
+	function hasAnyPermissions($permissions)
67
+	{
63 68
 		global $modx;
64 69
 
65
-		foreach($permissions as $p)
66
-			if($modx->hasPermission($p)) return true;
70
+		foreach($permissions as $p) {
71
+					if($modx->hasPermission($p)) return true;
72
+		}
67 73
 
68 74
 		return false;
69 75
 	}
70 76
 
71
-	function queryResources($resourceTable, $nameField = 'name') {
77
+	function queryResources($resourceTable, $nameField = 'name')
78
+	{
72 79
 		global $modx, $_lang;
73 80
 
74 81
 		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
@@ -79,8 +86,9 @@  discard block
 block discarded – undo
79 86
 			$tvsql    = 'site_tmplvars.caption, ';
80 87
 			$tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
81 88
 			$sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
89
+		} else {
90
+		    $sttfield = '';
82 91
 		}
83
-		else $sttfield = '';
84 92
 
85 93
 		$selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
86 94
 
@@ -93,7 +101,9 @@  discard block
 block discarded – undo
93 101
 		);
94 102
 		$limit = $modx->db->getRecordCount($rs);
95 103
 
96
-		if($limit < 1) return false;
104
+		if($limit < 1) {
105
+		    return false;
106
+		}
97 107
 
98 108
 		$result = array();
99 109
 		while ($row = $modx->db->getRow($rs)) {
@@ -102,7 +112,8 @@  discard block
 block discarded – undo
102 112
 		return $result;
103 113
 	}
104 114
 
105
-	function prepareCategoryArrays() {
115
+	function prepareCategoryArrays()
116
+	{
106 117
 		foreach($this->items as $type=>$items) {
107 118
 			foreach((array)$items as $item) {
108 119
 				$catid = $item['catid'] ? $item['catid'] : 0;
@@ -118,7 +129,7 @@  discard block
 block discarded – undo
118 129
 
119 130
 		// Now sort by name
120 131
 		foreach($this->itemsPerCategory as $catid=>$items) {
121
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
132
+			usort($this->itemsPerCategory[$catid], function ($a, $b){
122 133
 				return strcasecmp($a['name'], $b['name']);
123 134
 			});
124 135
 		}
Please login to merge, or discard this patch.
manager/actions/resources/tab1_templates.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- Templates -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab5_plugins.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- plugins -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 4 patches
Braces   +22 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if(!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if(!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32
-function createGUID() {
32
+function createGUID()
33
+{
33 34
 	srand((double) microtime() * 1000000);
34 35
 	$r = rand();
35 36
 	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
@@ -38,7 +39,7 @@  discard block
 block discarded – undo
38 39
 }
39 40
 
40 41
 // check to see the module editor isn't locked
41
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
42
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
42 43
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 44
 }
44 45
 // end check for lock
@@ -46,22 +47,22 @@  discard block
 block discarded – undo
46 47
 // Lock snippet for other users to edit
47 48
 $modx->lockElement(6, $id);
48 49
 
49
-if(isset($_GET['id'])) {
50
+if(isset($_GET['id'])) {
50 51
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51 52
 	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
53
+	if(!$content) {
53 54
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54 55
 	}
55 56
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56 57
 	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58 59
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59 60
 	}
60
-} else {
61
+} else {
61 62
 	$_SESSION['itemname'] = $_lang["new_module"];
62 63
 	$content['wrap'] = '1';
63 64
 }
64
-if($modx->manager->hasFormValues()) {
65
+if($modx->manager->hasFormValues()) {
65 66
 	$modx->manager->loadFormValues();
66 67
 }
67 68
 
@@ -435,7 +436,7 @@  discard block
 block discarded – undo
435 436
 	<?php
436 437
 	// invoke OnModFormPrerender event
437 438
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
439
+	if(is_array($evtOut)) {
439 440
 		echo implode('', $evtOut);
440 441
 	}
441 442
 
@@ -498,7 +499,7 @@  discard block
 block discarded – undo
498 499
 								<option>&nbsp;</option>
499 500
 								<?php
500 501
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
+								foreach(getCategories() as $n => $v) {
502 503
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503 504
 								}
504 505
 								?>
@@ -650,7 +651,7 @@  discard block
 block discarded – undo
650 651
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651 652
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
652 653
 
653
-					if($modx->hasPermission('access_permissions')) {
654
+					if($modx->hasPermission('access_permissions')) {
654 655
 						?>
655 656
 						<!-- User Group Access Permissions -->
656 657
 						<script type="text/javascript">
@@ -678,21 +679,21 @@  discard block
 block discarded – undo
678 679
 					}
679 680
 					$chk = '';
680 681
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
682
+					while($row = $modx->db->getRow($rs)) {
682 683
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683 684
 						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
685
+						if($modx->hasPermission('access_permissions')) {
686
+							if($checked) {
686 687
 								$notPublic = true;
687 688
 							}
688 689
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
-						} else {
690
-							if($checked) {
690
+						} else {
691
+							if($checked) {
691 692
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692 693
 							}
693 694
 						}
694 695
 					}
695
-					if($modx->hasPermission('access_permissions')) {
696
+					if($modx->hasPermission('access_permissions')) {
696 697
 						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697 698
 					}
698 699
 					echo $chks;
@@ -714,7 +715,7 @@  discard block
 block discarded – undo
714 715
 		<?php
715 716
 		// invoke OnModFormRender event
716 717
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
718
+		if(is_array($evtOut)) {
718 719
 			echo implode('', $evtOut);
719 720
 		}
720 721
 		?>
Please login to merge, or discard this patch.
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->manager->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    case 107:
7
+        if(!$modx->hasPermission('new_module')) {
8
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+        }
10
+        break;
11
+    case 108:
12
+        if(!$modx->hasPermission('edit_module')) {
13
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+        }
15
+        break;
16
+    default:
17
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32 32
 function createGUID() {
33
-	srand((double) microtime() * 1000000);
34
-	$r = rand();
35
-	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
36
-	$m = md5($u);
37
-	return $m;
33
+    srand((double) microtime() * 1000000);
34
+    $r = rand();
35
+    $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
36
+    $m = md5($u);
37
+    return $m;
38 38
 }
39 39
 
40 40
 // check to see the module editor isn't locked
41 41
 if($lockedEl = $modx->elementIsLocked(6, $id)) {
42
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
42
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 43
 }
44 44
 // end check for lock
45 45
 
@@ -47,22 +47,22 @@  discard block
 block discarded – undo
47 47
 $modx->lockElement(6, $id);
48 48
 
49 49
 if(isset($_GET['id'])) {
50
-	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51
-	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
53
-		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54
-	}
55
-	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56
-	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59
-	}
50
+    $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51
+    $content = $modx->db->getRow($rs);
52
+    if(!$content) {
53
+        $modx->webAlertAndQuit("Module not found for id '{$id}'.");
54
+    }
55
+    $content['properties'] = str_replace("&", "&amp;", $content['properties']);
56
+    $_SESSION['itemname'] = $content['name'];
57
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
59
+    }
60 60
 } else {
61
-	$_SESSION['itemname'] = $_lang["new_module"];
62
-	$content['wrap'] = '1';
61
+    $_SESSION['itemname'] = $_lang["new_module"];
62
+    $content['wrap'] = '1';
63 63
 }
64 64
 if($modx->manager->hasFormValues()) {
65
-	$modx->manager->loadFormValues();
65
+    $modx->manager->loadFormValues();
66 66
 }
67 67
 
68 68
 // Add lock-element JS-Script
@@ -433,18 +433,18 @@  discard block
 block discarded – undo
433 433
 
434 434
 <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109">
435 435
 	<?php
436
-	// invoke OnModFormPrerender event
437
-	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
439
-		echo implode('', $evtOut);
440
-	}
441
-
442
-	// Prepare internal params & info-tab via parseDocBlock
443
-	$modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : '';
444
-	$docBlock = $modx->parseDocBlockFromString($modulecode);
445
-	$docBlockList = $modx->convertDocBlockIntoList($docBlock);
446
-	$internal = array();
447
-	?>
436
+    // invoke OnModFormPrerender event
437
+    $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
+    if(is_array($evtOut)) {
439
+        echo implode('', $evtOut);
440
+    }
441
+
442
+    // Prepare internal params & info-tab via parseDocBlock
443
+    $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : '';
444
+    $docBlock = $modx->parseDocBlockFromString($modulecode);
445
+    $docBlockList = $modx->convertDocBlockIntoList($docBlock);
446
+    $internal = array();
447
+    ?>
448 448
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
449 449
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
450 450
 
@@ -497,11 +497,11 @@  discard block
 block discarded – undo
497 497
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
498 498
 								<option>&nbsp;</option>
499 499
 								<?php
500
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503
-								}
504
-								?>
500
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
+                                foreach(getCategories() as $n => $v) {
502
+                                    echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503
+                                }
504
+                                ?>
505 505
 							</select>
506 506
 						</div>
507 507
 					</div>
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 							<i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a>
609 609
 					</div>
610 610
 					<?php
611
-					$ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
611
+                    $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
612 612
 					CASE smd.type
613 613
 						WHEN 10 THEN 'Chunk'
614 614
 						WHEN 20 THEN 'Document'
@@ -624,17 +624,17 @@  discard block
 block discarded – undo
624 624
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
625 625
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
626 626
 
627
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
628
-					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629
-					$grd->noRecordMsg = $_lang['no_records_found'];
630
-					$grd->cssClass = 'grid';
631
-					$grd->columnHeaderClass = 'gridHeader';
632
-					$grd->itemClass = 'gridItem';
633
-					$grd->altItemClass = 'gridAltItem';
634
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
635
-					$grd->fields = "name,type";
636
-					echo $grd->render();
637
-					?>
627
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
628
+                    $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629
+                    $grd->noRecordMsg = $_lang['no_records_found'];
630
+                    $grd->cssClass = 'grid';
631
+                    $grd->columnHeaderClass = 'gridHeader';
632
+                    $grd->itemClass = 'gridItem';
633
+                    $grd->altItemClass = 'gridAltItem';
634
+                    $grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
635
+                    $grd->fields = "name,type";
636
+                    echo $grd->render();
637
+                    ?>
638 638
 				</div>
639 639
 			</div>
640 640
 		<?php endif; ?>
@@ -646,12 +646,12 @@  discard block
 block discarded – undo
646 646
 			<div class="container container-body">
647 647
 				<?php if($use_udperms == 1) : ?>
648 648
 					<?php
649
-					// fetch user access permissions for the module
650
-					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651
-					$groupsarray = $modx->db->getColumn('usergroup', $rs);
649
+                    // fetch user access permissions for the module
650
+                    $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651
+                    $groupsarray = $modx->db->getColumn('usergroup', $rs);
652 652
 
653
-					if($modx->hasPermission('access_permissions')) {
654
-						?>
653
+                    if($modx->hasPermission('access_permissions')) {
654
+                        ?>
655 655
 						<!-- User Group Access Permissions -->
656 656
 						<script type="text/javascript">
657 657
 							function makePublic(b) {
@@ -675,28 +675,28 @@  discard block
 block discarded – undo
675 675
 						</script>
676 676
 						<p><?= $_lang['module_group_access_msg'] ?></p>
677 677
 						<?php
678
-					}
679
-					$chk = '';
680
-					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
682
-						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683
-						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
686
-								$notPublic = true;
687
-							}
688
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
-						} else {
690
-							if($checked) {
691
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692
-							}
693
-						}
694
-					}
695
-					if($modx->hasPermission('access_permissions')) {
696
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697
-					}
698
-					echo $chks;
699
-					?>
678
+                    }
679
+                    $chk = '';
680
+                    $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
+                    while($row = $modx->db->getRow($rs)) {
682
+                        $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683
+                        $checked = in_array($row['id'], $groupsarray);
684
+                        if($modx->hasPermission('access_permissions')) {
685
+                            if($checked) {
686
+                                $notPublic = true;
687
+                            }
688
+                            $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
+                        } else {
690
+                            if($checked) {
691
+                                $chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692
+                            }
693
+                        }
694
+                    }
695
+                    if($modx->hasPermission('access_permissions')) {
696
+                        $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697
+                    }
698
+                    echo $chks;
699
+                    ?>
700 700
 				<?php endif; ?>
701 701
 			</div>
702 702
 		</div>
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
 
713 713
 		<input type="submit" name="save" style="display:none;">
714 714
 		<?php
715
-		// invoke OnModFormRender event
716
-		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
718
-			echo implode('', $evtOut);
719
-		}
720
-		?>
715
+        // invoke OnModFormRender event
716
+        $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
+        if(is_array($evtOut)) {
718
+            echo implode('', $evtOut);
719
+        }
720
+        ?>
721 721
 </form>
722 722
 <script type="text/javascript">setTimeout('showParameters();', 10);</script>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@
 block discarded – undo
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->manager->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+	    case 107:
7
+		    if(!$modx->hasPermission('new_module')) {
8
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+		    }
10
+		    break;
11
+	    case 108:
12
+		    if(!$modx->hasPermission('edit_module')) {
13
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+		    }
15
+		    break;
16
+	    default:
17
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch ($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if (!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if (!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
16 16
 	default:
17 17
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
19
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
21 21
 $tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
22 22
 $tbl_site_content = $modx->getFullTableName('site_content');
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32
-function createGUID() {
32
+function createGUID(){
33 33
 	srand((double) microtime() * 1000000);
34 34
 	$r = rand();
35
-	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
35
+	$u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1);
36 36
 	$m = md5($u);
37 37
 	return $m;
38 38
 }
39 39
 
40 40
 // check to see the module editor isn't locked
41
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
41
+if ($lockedEl = $modx->elementIsLocked(6, $id)) {
42 42
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 43
 }
44 44
 // end check for lock
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 // Lock snippet for other users to edit
47 47
 $modx->lockElement(6, $id);
48 48
 
49
-if(isset($_GET['id'])) {
49
+if (isset($_GET['id'])) {
50 50
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51 51
 	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
52
+	if (!$content) {
53 53
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54 54
 	}
55 55
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56 56
 	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
57
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58 58
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59 59
 	}
60 60
 } else {
61 61
 	$_SESSION['itemname'] = $_lang["new_module"];
62 62
 	$content['wrap'] = '1';
63 63
 }
64
-if($modx->manager->hasFormValues()) {
64
+if ($modx->manager->hasFormValues()) {
65 65
 	$modx->manager->loadFormValues();
66 66
 }
67 67
 
68 68
 // Add lock-element JS-Script
69 69
 $lockElementId = $id;
70 70
 $lockElementType = 6;
71
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
71
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
72 72
 ?>
73 73
 <script type="text/javascript">
74 74
 	function loadDependencies() {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	function BrowseServer() {
416 416
 		var w = screen.width * 0.7;
417 417
 		var h = screen.height * 0.7;
418
-		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
418
+		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
419 419
 	}
420 420
 
421 421
 	function SetUrl(url, width, height, alt) {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	<?php
436 436
 	// invoke OnModFormPrerender event
437 437
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
438
+	if (is_array($evtOut)) {
439 439
 		echo implode('', $evtOut);
440 440
 	}
441 441
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
450 450
 
451 451
 	<h1>
452
-		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
452
+		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
453 453
 	</h1>
454 454
 
455 455
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 						<div class="col-md-9 col-lg-10">
475 475
 							<div class="form-control-name clearfix">
476 476
 								<input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
477
-								<?php if($modx->hasPermission('save_role')): ?>
478
-									<label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip>
477
+								<?php if ($modx->hasPermission('save_role')): ?>
478
+									<label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip>
479 479
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
480 480
 										<i class="fa fa-lock"></i>
481 481
 									</label>
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
498 498
 								<option>&nbsp;</option>
499 499
 								<?php
500
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
500
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
501
+								foreach (getCategories() as $n => $v) {
502
+									echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n";
503 503
 								}
504 504
 								?>
505 505
 							</select>
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 				<div class="form-group">
532 532
 					<div class="form-row">
533 533
 						<label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> />
534
-							<?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label>
534
+							<?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label>
535 535
 					</div>
536 536
 					<div class="form-row">
537 537
 						<label for="parse_docblock">
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 			</div>
597 597
 			<!-- HTML text editor end -->
598 598
 		</div>
599
-		<?php if($modx->manager->action == '108'): ?>
599
+		<?php if ($modx->manager->action == '108'): ?>
600 600
 			<!-- Dependencies -->
601 601
 			<div class="tab-page" id="tabDepend">
602 602
 				<h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2>
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
625 625
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
626 626
 
627
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
627
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
628 628
 					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629 629
 					$grd->noRecordMsg = $_lang['no_records_found'];
630 630
 					$grd->cssClass = 'grid';
631 631
 					$grd->columnHeaderClass = 'gridHeader';
632 632
 					$grd->itemClass = 'gridItem';
633 633
 					$grd->altItemClass = 'gridAltItem';
634
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
634
+					$grd->columns = $_lang['element_name']." ,".$_lang['type'];
635 635
 					$grd->fields = "name,type";
636 636
 					echo $grd->render();
637 637
 					?>
@@ -644,13 +644,13 @@  discard block
 block discarded – undo
644 644
 			<h2 class="tab"><?= $_lang['access_permissions'] ?></h2>
645 645
 			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
646 646
 			<div class="container container-body">
647
-				<?php if($use_udperms == 1) : ?>
647
+				<?php if ($use_udperms == 1) : ?>
648 648
 					<?php
649 649
 					// fetch user access permissions for the module
650 650
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651 651
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
652 652
 
653
-					if($modx->hasPermission('access_permissions')) {
653
+					if ($modx->hasPermission('access_permissions')) {
654 654
 						?>
655 655
 						<!-- User Group Access Permissions -->
656 656
 						<script type="text/javascript">
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
 					}
679 679
 					$chk = '';
680 680
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
681
+					while ($row = $modx->db->getRow($rs)) {
682 682
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683 683
 						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
684
+						if ($modx->hasPermission('access_permissions')) {
685
+							if ($checked) {
686 686
 								$notPublic = true;
687 687
 							}
688
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
688
+							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n";
689 689
 						} else {
690
-							if($checked) {
691
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
690
+							if ($checked) {
691
+								$chks = '<input type="hidden" name="usrgroups[]"  value="'.$row['id'].'" />'."\n".$chks;
692 692
 							}
693 693
 						}
694 694
 					}
695
-					if($modx->hasPermission('access_permissions')) {
696
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
695
+					if ($modx->hasPermission('access_permissions')) {
696
+						$chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks;
697 697
 					}
698 698
 					echo $chks;
699 699
 					?>
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		<?php
715 715
 		// invoke OnModFormRender event
716 716
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
717
+		if (is_array($evtOut)) {
718 718
 			echo implode('', $evtOut);
719 719
 		}
720 720
 		?>
Please login to merge, or discard this patch.