Completed
Pull Request — develop (#518)
by Agel_Nash
05:24
created
manager/actions/resources/mgrResources.class.php 3 patches
Indentation   +101 added lines, -101 removed lines patch added patch discarded remove patch
@@ -2,123 +2,123 @@
 block discarded – undo
2 2
 if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4 4
 class mgrResources {
5
-	var $types = array();
6
-	var $items = array();
7
-	var $categories = array();
8
-	var $itemsPerCategory = array();
5
+    var $types = array();
6
+    var $items = array();
7
+    var $categories = array();
8
+    var $itemsPerCategory = array();
9 9
 	
10
-	function __construct() {
11
-		$this->setTypes();
12
-		$this->queryItemsFromDB();
13
-		$this->prepareCategoryArrays();
14
-	}
10
+    function __construct() {
11
+        $this->setTypes();
12
+        $this->queryItemsFromDB();
13
+        $this->prepareCategoryArrays();
14
+    }
15 15
 
16
-	function setTypes() {
17
-		global $_lang;
18
-		$this->types['site_templates']    = array(
19
-			'title'=>$_lang["manage_templates"],
20
-			'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
21
-			'permissions'=>array('new_template','edit_template'),
22
-			'name'=>'templatename'
23
-		);
24
-		$this->types['site_tmplvars']     = array(
25
-			'title'=>$_lang["tmplvars"],
26
-			'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
27
-			'permissions'=>array('new_template','edit_template'),
28
-		);
29
-		$this->types['site_htmlsnippets'] = array(
30
-			'title'=>$_lang["manage_htmlsnippets"],
31
-			'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
32
-			'permissions'=>array('new_chunk','edit_chunk'),
33
-		);
34
-		$this->types['site_snippets']     = array(
35
-			'title'=>$_lang["manage_snippets"],
36
-			'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
37
-			'permissions'=>array('new_snippet','edit_snippet'),
38
-		);
39
-		$this->types['site_plugins']      = array(
40
-			'title'=>$_lang["manage_plugins"],
41
-			'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
42
-			'permissions'=>array('new_plugin','edit_plugin'),
43
-		);
44
-		$this->types['site_modules']      = array(
45
-			'title'=>$_lang["manage_modules"],
46
-			'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
47
-			'permissions'=>array('new_module','edit_module'),
48
-		);
49
-	}
16
+    function setTypes() {
17
+        global $_lang;
18
+        $this->types['site_templates']    = array(
19
+            'title'=>$_lang["manage_templates"],
20
+            'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
21
+            'permissions'=>array('new_template','edit_template'),
22
+            'name'=>'templatename'
23
+        );
24
+        $this->types['site_tmplvars']     = array(
25
+            'title'=>$_lang["tmplvars"],
26
+            'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
27
+            'permissions'=>array('new_template','edit_template'),
28
+        );
29
+        $this->types['site_htmlsnippets'] = array(
30
+            'title'=>$_lang["manage_htmlsnippets"],
31
+            'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
32
+            'permissions'=>array('new_chunk','edit_chunk'),
33
+        );
34
+        $this->types['site_snippets']     = array(
35
+            'title'=>$_lang["manage_snippets"],
36
+            'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
37
+            'permissions'=>array('new_snippet','edit_snippet'),
38
+        );
39
+        $this->types['site_plugins']      = array(
40
+            'title'=>$_lang["manage_plugins"],
41
+            'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
42
+            'permissions'=>array('new_plugin','edit_plugin'),
43
+        );
44
+        $this->types['site_modules']      = array(
45
+            'title'=>$_lang["manage_modules"],
46
+            'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
47
+            'permissions'=>array('new_module','edit_module'),
48
+        );
49
+    }
50 50
 	
51
-	function queryItemsFromDB() {
52
-		foreach($this->types as $resourceTable=>$type) {
53
-			if($this->hasAnyPermissions($type['permissions'])) {
54
-				$nameField = isset($type['name']) ? $type['name'] : 'name';
55
-				$this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
56
-		   }
57
-		 }
58
-	}
51
+    function queryItemsFromDB() {
52
+        foreach($this->types as $resourceTable=>$type) {
53
+            if($this->hasAnyPermissions($type['permissions'])) {
54
+                $nameField = isset($type['name']) ? $type['name'] : 'name';
55
+                $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
56
+            }
57
+            }
58
+    }
59 59
 
60
-	function hasAnyPermissions($permissions) {
61
-		global $modx;
60
+    function hasAnyPermissions($permissions) {
61
+        global $modx;
62 62
 		
63
-		foreach($permissions as $p) 
64
-			if($modx->hasPermission($p)) return true;
63
+        foreach($permissions as $p) 
64
+            if($modx->hasPermission($p)) return true;
65 65
 		
66
-		return false;
67
-	}
66
+        return false;
67
+    }
68 68
 
69
-	function queryResources($resourceTable, $nameField = 'name') {
70
-		global $modx, $_lang;
69
+    function queryResources($resourceTable, $nameField = 'name') {
70
+        global $modx, $_lang;
71 71
 
72
-		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
72
+        $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
73 73
 
74
-		$tvsql  = '';
75
-		$tvjoin = '';
76
-		if ($resourceTable == 'site_tmplvars') {
77
-			$tvsql    = 'site_tmplvars.caption, ';
78
-			$tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
79
-			$sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
80
-		}
81
-		else $sttfield = '';
74
+        $tvsql  = '';
75
+        $tvjoin = '';
76
+        if ($resourceTable == 'site_tmplvars') {
77
+            $tvsql    = 'site_tmplvars.caption, ';
78
+            $tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
79
+            $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
80
+        }
81
+        else $sttfield = '';
82 82
 
83
-		$selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
83
+        $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
84 84
 
85
-		$rs = $modx->db->select(
86
-			"{$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",
87
-			$modx->getFullTableName($resourceTable) . " AS {$resourceTable}
85
+        $rs = $modx->db->select(
86
+            "{$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",
87
+            $modx->getFullTableName($resourceTable) . " AS {$resourceTable}
88 88
 	            LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
89
-			"",
90
-			"category,name"
91
-		);
92
-		$limit = $modx->db->getRecordCount($rs);
89
+            "",
90
+            "category,name"
91
+        );
92
+        $limit = $modx->db->getRecordCount($rs);
93 93
 		
94
-		if($limit < 1) return false;
94
+        if($limit < 1) return false;
95 95
 		
96
-		$result = array();
97
-		while ($row = $modx->db->getRow($rs)) {
98
-			$result[] = $row;
99
-		}
100
-		return $result;
101
-	}
96
+        $result = array();
97
+        while ($row = $modx->db->getRow($rs)) {
98
+            $result[] = $row;
99
+        }
100
+        return $result;
101
+    }
102 102
 
103
-	function prepareCategoryArrays() {
104
-		foreach($this->items as $type=>$items) {
105
-			foreach((array)$items as $item) {
106
-				$catid = $item['catid'] ? $item['catid'] : 0;
107
-				$this->categories[$catid] = $item['category'];
103
+    function prepareCategoryArrays() {
104
+        foreach($this->items as $type=>$items) {
105
+            foreach((array)$items as $item) {
106
+                $catid = $item['catid'] ? $item['catid'] : 0;
107
+                $this->categories[$catid] = $item['category'];
108 108
 				
109
-				$item['type'] = $type;
110
-				$this->itemsPerCategory[$catid][] = $item;
111
-			}
112
-		}
109
+                $item['type'] = $type;
110
+                $this->itemsPerCategory[$catid][] = $item;
111
+            }
112
+        }
113 113
 		
114
-		// Sort categories by name
115
-		natcasesort($this->categories);
114
+        // Sort categories by name
115
+        natcasesort($this->categories);
116 116
 		
117
-		// Now sort by name
118
-		foreach($this->itemsPerCategory as $catid=>$items) {
119
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
120
-				return strcasecmp($a['name'], $b['name']);
121
-			});
122
-		}
123
-	}
117
+        // Now sort by name
118
+        foreach($this->itemsPerCategory as $catid=>$items) {
119
+            usort($this->itemsPerCategory[$catid], function ($a, $b) {
120
+                return strcasecmp($a['name'], $b['name']);
121
+            });
122
+        }
123
+    }
124 124
 }
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,75 +1,75 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4
-class mgrResources {
4
+class mgrResources{
5 5
 	var $types = array();
6 6
 	var $items = array();
7 7
 	var $categories = array();
8 8
 	var $itemsPerCategory = array();
9 9
 	
10
-	function __construct() {
10
+	function __construct(){
11 11
 		$this->setTypes();
12 12
 		$this->queryItemsFromDB();
13 13
 		$this->prepareCategoryArrays();
14 14
 	}
15 15
 
16
-	function setTypes() {
16
+	function setTypes(){
17 17
 		global $_lang;
18
-		$this->types['site_templates']    = array(
18
+		$this->types['site_templates'] = array(
19 19
 			'title'=>$_lang["manage_templates"],
20
-			'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
21
-			'permissions'=>array('new_template','edit_template'),
20
+			'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')),
21
+			'permissions'=>array('new_template', 'edit_template'),
22 22
 			'name'=>'templatename'
23 23
 		);
24
-		$this->types['site_tmplvars']     = array(
24
+		$this->types['site_tmplvars'] = array(
25 25
 			'title'=>$_lang["tmplvars"],
26
-			'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
27
-			'permissions'=>array('new_template','edit_template'),
26
+			'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')),
27
+			'permissions'=>array('new_template', 'edit_template'),
28 28
 		);
29 29
 		$this->types['site_htmlsnippets'] = array(
30 30
 			'title'=>$_lang["manage_htmlsnippets"],
31
-			'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
32
-			'permissions'=>array('new_chunk','edit_chunk'),
31
+			'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')),
32
+			'permissions'=>array('new_chunk', 'edit_chunk'),
33 33
 		);
34
-		$this->types['site_snippets']     = array(
34
+		$this->types['site_snippets'] = array(
35 35
 			'title'=>$_lang["manage_snippets"],
36
-			'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
37
-			'permissions'=>array('new_snippet','edit_snippet'),
36
+			'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')),
37
+			'permissions'=>array('new_snippet', 'edit_snippet'),
38 38
 		);
39
-		$this->types['site_plugins']      = array(
39
+		$this->types['site_plugins'] = array(
40 40
 			'title'=>$_lang["manage_plugins"],
41
-			'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
42
-			'permissions'=>array('new_plugin','edit_plugin'),
41
+			'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')),
42
+			'permissions'=>array('new_plugin', 'edit_plugin'),
43 43
 		);
44
-		$this->types['site_modules']      = array(
44
+		$this->types['site_modules'] = array(
45 45
 			'title'=>$_lang["manage_modules"],
46
-			'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
47
-			'permissions'=>array('new_module','edit_module'),
46
+			'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')),
47
+			'permissions'=>array('new_module', 'edit_module'),
48 48
 		);
49 49
 	}
50 50
 	
51
-	function queryItemsFromDB() {
52
-		foreach($this->types as $resourceTable=>$type) {
53
-			if($this->hasAnyPermissions($type['permissions'])) {
51
+	function queryItemsFromDB(){
52
+		foreach ($this->types as $resourceTable=>$type) {
53
+			if ($this->hasAnyPermissions($type['permissions'])) {
54 54
 				$nameField = isset($type['name']) ? $type['name'] : 'name';
55 55
 				$this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
56 56
 		   }
57 57
 		 }
58 58
 	}
59 59
 
60
-	function hasAnyPermissions($permissions) {
60
+	function hasAnyPermissions($permissions){
61 61
 		global $modx;
62 62
 		
63
-		foreach($permissions as $p) 
64
-			if($modx->hasPermission($p)) return true;
63
+		foreach ($permissions as $p) 
64
+			if ($modx->hasPermission($p)) return true;
65 65
 		
66 66
 		return false;
67 67
 	}
68 68
 
69
-	function queryResources($resourceTable, $nameField = 'name') {
69
+	function queryResources($resourceTable, $nameField = 'name'){
70 70
 		global $modx, $_lang;
71 71
 
72
-		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
72
+		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable.'.disabled, ' : '';
73 73
 
74 74
 		$tvsql  = '';
75 75
 		$tvjoin = '';
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
 
85 85
 		$rs = $modx->db->select(
86 86
 			"{$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",
87
-			$modx->getFullTableName($resourceTable) . " AS {$resourceTable}
88
-	            LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
87
+			$modx->getFullTableName($resourceTable)." AS {$resourceTable}
88
+	            LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
89 89
 			"",
90 90
 			"category,name"
91 91
 		);
92 92
 		$limit = $modx->db->getRecordCount($rs);
93 93
 		
94
-		if($limit < 1) return false;
94
+		if ($limit < 1) return false;
95 95
 		
96 96
 		$result = array();
97 97
 		while ($row = $modx->db->getRow($rs)) {
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 		return $result;
101 101
 	}
102 102
 
103
-	function prepareCategoryArrays() {
104
-		foreach($this->items as $type=>$items) {
105
-			foreach((array)$items as $item) {
103
+	function prepareCategoryArrays(){
104
+		foreach ($this->items as $type=>$items) {
105
+			foreach ((array) $items as $item) {
106 106
 				$catid = $item['catid'] ? $item['catid'] : 0;
107 107
 				$this->categories[$catid] = $item['category'];
108 108
 				
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 		natcasesort($this->categories);
116 116
 		
117 117
 		// Now sort by name
118
-		foreach($this->itemsPerCategory as $catid=>$items) {
119
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
118
+		foreach ($this->itemsPerCategory as $catid=>$items) {
119
+			usort($this->itemsPerCategory[$catid], function($a, $b){
120 120
 				return strcasecmp($a['name'], $b['name']);
121 121
 			});
122 122
 		}
Please login to merge, or discard this patch.
Braces   +26 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,19 +1,24 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(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.");
4
+}
3 5
 
4
-class mgrResources {
6
+class mgrResources
7
+{
5 8
 	var $types = array();
6 9
 	var $items = array();
7 10
 	var $categories = array();
8 11
 	var $itemsPerCategory = array();
9 12
 	
10
-	function __construct() {
13
+	function __construct()
14
+	{
11 15
 		$this->setTypes();
12 16
 		$this->queryItemsFromDB();
13 17
 		$this->prepareCategoryArrays();
14 18
 	}
15 19
 
16
-	function setTypes() {
20
+	function setTypes()
21
+	{
17 22
 		global $_lang;
18 23
 		$this->types['site_templates']    = array(
19 24
 			'title'=>$_lang["manage_templates"],
@@ -48,7 +53,8 @@  discard block
 block discarded – undo
48 53
 		);
49 54
 	}
50 55
 	
51
-	function queryItemsFromDB() {
56
+	function queryItemsFromDB()
57
+	{
52 58
 		foreach($this->types as $resourceTable=>$type) {
53 59
 			if($this->hasAnyPermissions($type['permissions'])) {
54 60
 				$nameField = isset($type['name']) ? $type['name'] : 'name';
@@ -57,16 +63,19 @@  discard block
 block discarded – undo
57 63
 		 }
58 64
 	}
59 65
 
60
-	function hasAnyPermissions($permissions) {
66
+	function hasAnyPermissions($permissions)
67
+	{
61 68
 		global $modx;
62 69
 		
63
-		foreach($permissions as $p) 
64
-			if($modx->hasPermission($p)) return true;
70
+		foreach($permissions as $p) {
71
+					if($modx->hasPermission($p)) return true;
72
+		}
65 73
 		
66 74
 		return false;
67 75
 	}
68 76
 
69
-	function queryResources($resourceTable, $nameField = 'name') {
77
+	function queryResources($resourceTable, $nameField = 'name')
78
+	{
70 79
 		global $modx, $_lang;
71 80
 
72 81
 		$pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : '';
@@ -77,8 +86,9 @@  discard block
 block discarded – undo
77 86
 			$tvsql    = 'site_tmplvars.caption, ';
78 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'));
79 88
 			$sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
89
+		} else {
90
+		    $sttfield = '';
80 91
 		}
81
-		else $sttfield = '';
82 92
 
83 93
 		$selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : "";
84 94
 
@@ -91,7 +101,9 @@  discard block
 block discarded – undo
91 101
 		);
92 102
 		$limit = $modx->db->getRecordCount($rs);
93 103
 		
94
-		if($limit < 1) return false;
104
+		if($limit < 1) {
105
+		    return false;
106
+		}
95 107
 		
96 108
 		$result = array();
97 109
 		while ($row = $modx->db->getRow($rs)) {
@@ -100,7 +112,8 @@  discard block
 block discarded – undo
100 112
 		return $result;
101 113
 	}
102 114
 
103
-	function prepareCategoryArrays() {
115
+	function prepareCategoryArrays()
116
+	{
104 117
 		foreach($this->items as $type=>$items) {
105 118
 			foreach((array)$items as $item) {
106 119
 				$catid = $item['catid'] ? $item['catid'] : 0;
@@ -116,7 +129,7 @@  discard block
 block discarded – undo
116 129
 		
117 130
 		// Now sort by name
118 131
 		foreach($this->itemsPerCategory as $catid=>$items) {
119
-			usort($this->itemsPerCategory[$catid], function ($a, $b) {
132
+			usort($this->itemsPerCategory[$catid], function ($a, $b){
120 133
 				return strcasecmp($a['name'], $b['name']);
121 134
 			});
122 135
 		}
Please login to merge, or discard this patch.
manager/actions/sysinfo.static.php 2 patches
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,14 +12,14 @@  discard block
 block discarded – undo
12 12
 $collation = $modx->db->getRow($res, 'num');
13 13
 
14 14
 $serverArr = array(
15
-    $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext,
15
+    $_lang['modx_version'] => $modx->getVersionData('version').' '.$newversiontext,
16 16
     $_lang['release_date'] => $modx->getVersionData('release_date'),
17 17
     'PHP Version' => phpversion(),
18
-    'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">' . $_lang['view'] . '</a>',
18
+    'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">'.$_lang['view'].'</a>',
19 19
     $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']),
20 20
     $_lang['servertime'] => strftime('%H:%M:%S', time()),
21 21
     $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time),
22
-    $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h',
22
+    $_lang['serveroffset'] => $server_offset_time / (60 * 60).' h',
23 23
     $_lang['database_name'] => trim($dbase, '`'),
24 24
     $_lang['database_server'] => $database_server,
25 25
     $_lang['database_version'] => $modx->db->getVersion(),
@@ -95,33 +95,33 @@  discard block
 block discarded – undo
95 95
                     </thead>
96 96
                     <tbody>
97 97
                     <?php
98
-                    $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';";
98
+                    $sql = "SHOW TABLE STATUS FROM $dbase LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%';";
99 99
                     $rs = $modx->db->query($sql);
100 100
                     $i = 0;
101 101
                     while ($log_status = $modx->db->getRow($rs)) {
102 102
                         ?>
103 103
                         <tr>
104 104
                             <td class="text-primary"><b><?= $log_status['Name'] ?></b></td>
105
-                            <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $log_status['Comment'] . '"></i>' : '') ?></td>
105
+                            <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$log_status['Comment'].'"></i>' : '') ?></td>
106 106
                             <td class="text-xs-right"><?= $log_status['Rows'] ?></td>
107 107
 
108 108
                             <?php
109 109
                             $truncateable = array(
110
-                                $modx->db->config['table_prefix'] . 'event_log',
111
-                                $modx->db->config['table_prefix'] . 'manager_log',
110
+                                $modx->db->config['table_prefix'].'event_log',
111
+                                $modx->db->config['table_prefix'].'manager_log',
112 112
                             );
113 113
                             if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
114 114
                                 echo "<td class=\"text-xs-right\">";
115
-                                echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>";
115
+                                echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=".$log_status['Name']."' title='".$_lang['truncate_table']."'>".$modx->nicesize($log_status['Data_length'] + $log_status['Data_free'])."</a>";
116 116
                                 echo "</td>";
117 117
                             } else {
118
-                                echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>";
118
+                                echo "<td class=\"text-xs-right\">".$modx->nicesize($log_status['Data_length'] + $log_status['Data_free'])."</td>";
119 119
                             }
120 120
 
121 121
                             if ($modx->hasPermission('settings')) {
122
-                                echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>";
122
+                                echo "<td class=\"text-xs-right\">".($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=".$log_status['Name']."' title='".$_lang['optimize_table']."' ><span>".$modx->nicesize($log_status['Data_free'])."</span></a>" : "-")."</td>";
123 123
                             } else {
124
-                                echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>";
124
+                                echo "<td class=\"text-xs-right\">".($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-")."</td>";
125 125
                             }
126 126
                             ?>
127 127
                             <td class="text-xs-right"><?= $modx->nicesize($log_status['Data_length'] - $log_status['Data_free']) ?></td>
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
                     <tr class="unstyled">
137 137
                         <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td>
138 138
                         <td colspan="3">&nbsp;</td>
139
-                        <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">" . $modx->nicesize($totaloverhead) . "</b><br />(" . number_format($totaloverhead) . " B)" : "-" ?></td>
139
+                        <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">".$modx->nicesize($totaloverhead)."</b><br />(".number_format($totaloverhead)." B)" : "-" ?></td>
140 140
                         <td colspan="2">&nbsp;</td>
141
-                        <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td>
141
+                        <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td>
142 142
                     </tr>
143 143
                     </tbody>
144 144
                 </table>
Please login to merge, or discard this patch.
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (IN_MANAGER_MODE != "true") {
2
+if (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
-if (!$modx->hasPermission('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 <table class="table data table-sm nowrap">
56 56
                     <tbody>
57 57
                     <?php
58
-                    foreach ($serverArr as $key => $value) {
58
+                    foreach ($serverArr as $key => $value) {
59 59
                         ?>
60 60
                         <tr>
61 61
                             <td width="1%"><?= $key ?></td>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';";
99 99
                     $rs = $modx->db->query($sql);
100 100
                     $i = 0;
101
-                    while ($log_status = $modx->db->getRow($rs)) {
101
+                    while ($log_status = $modx->db->getRow($rs)) {
102 102
                         ?>
103 103
                         <tr>
104 104
                             <td class="text-primary"><b><?= $log_status['Name'] ?></b></td>
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
                                 $modx->db->config['table_prefix'] . 'event_log',
111 111
                                 $modx->db->config['table_prefix'] . 'manager_log',
112 112
                             );
113
-                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
113
+                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
114 114
                                 echo "<td class=\"text-xs-right\">";
115 115
                                 echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>";
116 116
                                 echo "</td>";
117
-                            } else {
117
+                            } else {
118 118
                                 echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>";
119 119
                             }
120 120
 
121
-                            if ($modx->hasPermission('settings')) {
121
+                            if ($modx->hasPermission('settings')) {
122 122
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>";
123
-                            } else {
123
+                            } else {
124 124
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>";
125 125
                             }
126 126
                             ?>
Please login to merge, or discard this patch.
manager/actions/mutate_password.dynamic.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 if(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
 if(!$modx->hasPermission('change_password')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
-if(!$modx->hasPermission('change_password')) {
5
+if (!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if(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
-if(!$modx->hasPermission('change_password')) {
5
+if(!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
manager/actions/refresh_site.dynamic.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(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
 
6 6
 // (un)publishing of documents, version 2!
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 33
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 34
 		<?php
35
-		$modx->clearCache('full', true);
36
-		// invoke OnSiteRefresh event
37
-		$modx->invokeEvent("OnSiteRefresh");
38
-		?>
35
+        $modx->clearCache('full', true);
36
+        // invoke OnSiteRefresh event
37
+        $modx->invokeEvent("OnSiteRefresh");
38
+        ?>
39 39
 	</div>
40 40
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33
-		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
32
+		<?php if ($num_rows_pub)   printf('<p>'.$_lang["refresh_published"].'</p>', $num_rows_pub) ?>
33
+		<?php if ($num_rows_unpub) printf('<p>'.$_lang["refresh_unpublished"].'</p>', $num_rows_unpub) ?>
34 34
 		<?php
35 35
 		$modx->clearCache('full', true);
36 36
 		// invoke OnSiteRefresh event
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,10 +29,12 @@
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
32
+		<?php if($num_rows_pub) {
33
+    printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 34
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 35
 		<?php
35 36
 		$modx->clearCache('full', true);
37
+}
36 38
 		// invoke OnSiteRefresh event
37 39
 		$modx->invokeEvent("OnSiteRefresh");
38 40
 		?>
Please login to merge, or discard this patch.
manager/actions/export_site.static.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(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
 if(!$modx->hasPermission('export_static')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // figure out the base of the server, so we know where to get the documents in order to export them
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 
36 36
 		<div class="container container-body">
37 37
 			<?php
38
-			if(isset($_POST['export'])) {
39
-				$rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php');
40
-				echo $rs;
41
-			} else {
42
-				?>
38
+            if(isset($_POST['export'])) {
39
+                $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php');
40
+                echo $rs;
41
+            } else {
42
+                ?>
43 43
 				<form action="index.php" method="post" name="exportFrm">
44 44
 					<input type="hidden" name="export" value="export" />
45 45
 					<input type="hidden" name="a" value="83" />
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
 					</script>
82 82
 				</form>
83 83
 				<?php
84
-			}
85
-			?>
84
+            }
85
+            ?>
86 86
 		</div>
87 87
 	</div>
88 88
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
-if(!$modx->hasPermission('export_static')) {
5
+if (!$modx->hasPermission('export_static')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 
36 36
 		<div class="container container-body">
37 37
 			<?php
38
-			if(isset($_POST['export'])) {
39
-				$rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php');
38
+			if (isset($_POST['export'])) {
39
+				$rs = include_once(MODX_MANAGER_PATH.'processors/export_site.processor.php');
40 40
 				echo $rs;
41 41
 			} else {
42 42
 				?>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 					<a href="javascript:;" class="btn btn-primary" onclick="document.exportFrm.submit();jQuery(this).hide();"><i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang["export_site_start"] ?></a>
77 77
 					<script>
78 78
 						jQuery('#exportButton a').click(function() {
79
-							jQuery(this).parent().html('<?= $_style['ajax_loader'];?>');
79
+							jQuery(this).parent().html('<?= $_style['ajax_loader']; ?>');
80 80
 						});
81 81
 					</script>
82 82
 				</form>
Please login to merge, or discard this patch.
manager/actions/role_management.static.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(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
 if(!$modx->hasPermission('edit_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 ?>
@@ -18,14 +18,14 @@  discard block
 block discarded – undo
18 18
 		<div class="form-group"><?= $_lang['role_management_msg'] ?> <a class="btn btn-secondary btn-sm" href="index.php?a=38"><i class="<?= $_style["actions_new"] ?> hide4desktop"></i> <?= $_lang['new_role'] ?></a></div>
19 19
 		<div class="form-group">
20 20
 			<?php
21
-			$rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22
-			$limit = $modx->db->getRecordCount($rs);
23
-			if($limit < 1) {
24
-				?>
21
+            $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22
+            $limit = $modx->db->getRecordCount($rs);
23
+            if($limit < 1) {
24
+                ?>
25 25
 				<p><?= $_lang["no_records_found"] ?></p>
26 26
 				<?php
27
-			} else {
28
-				?>
27
+            } else {
28
+                ?>
29 29
 				<div class="row">
30 30
 					<div class="table-responsive">
31 31
 						<table class="table data">
@@ -37,24 +37,24 @@  discard block
 block discarded – undo
37 37
 							</thead>
38 38
 							<tbody>
39 39
 							<?php
40
-							while($row = $modx->db->getRow($rs)) {
41
-								if($row['id'] == 1) {
42
-									?>
40
+                            while($row = $modx->db->getRow($rs)) {
41
+                                if($row['id'] == 1) {
42
+                                    ?>
43 43
 									<tr class="text-muted disabled">
44 44
 										<td><b><?= $row['name'] ?></b></td>
45 45
 										<td><span><?= $_lang['administrator_role_message'] ?></span></td>
46 46
 									</tr>
47 47
 									<?php
48
-								} else {
49
-									?>
48
+                                } else {
49
+                                    ?>
50 50
 									<tr>
51 51
 										<td><a class="text-primary" href="index.php?id=<?= $row['id'] ?>&a=35"><?= $row['name'] ?></a></td>
52 52
 										<td><?= $row['description'] ?></td>
53 53
 									</tr>
54 54
 									<?php
55
-								}
56
-							}
57
-							?>
55
+                                }
56
+                            }
57
+                            ?>
58 58
 							</tbody>
59 59
 						</table>
60 60
 					</div>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
-if(!$modx->hasPermission('edit_user')) {
5
+if (!$modx->hasPermission('edit_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 			<?php
21 21
 			$rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name');
22 22
 			$limit = $modx->db->getRecordCount($rs);
23
-			if($limit < 1) {
23
+			if ($limit < 1) {
24 24
 				?>
25 25
 				<p><?= $_lang["no_records_found"] ?></p>
26 26
 				<?php
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 							</thead>
38 38
 							<tbody>
39 39
 							<?php
40
-							while($row = $modx->db->getRow($rs)) {
41
-								if($row['id'] == 1) {
40
+							while ($row = $modx->db->getRow($rs)) {
41
+								if ($row['id'] == 1) {
42 42
 									?>
43 43
 									<tr class="text-muted disabled">
44 44
 										<td><b><?= $row['name'] ?></b></td>
Please login to merge, or discard this patch.
manager/actions/eventlog_details.dynamic.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(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
 if(!$modx->hasPermission('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // get id
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 	<div class="tab-page">
42 42
 		<div class="container container-body">
43 43
 			<?php
44
-			$date = $modx->toDateFormat($content["createdon"]);
45
-			if($content["type"] == 1) {
46
-				$icon = $_style['actions_info'] . ' text-info';
47
-				$msgtype = $_lang["information"];
48
-			} else if($content["type"] == 2) {
49
-				$icon = $_style['actions_triangle'] . ' text-warning';
50
-				$msgtype = $_lang["warning"];
51
-			} else if($content["type"] == 3) {
52
-				$icon = $_style['actions_error'] . ' text-danger';
53
-				$msgtype = $_lang["error"];
54
-			}
55
-			?>
44
+            $date = $modx->toDateFormat($content["createdon"]);
45
+            if($content["type"] == 1) {
46
+                $icon = $_style['actions_info'] . ' text-info';
47
+                $msgtype = $_lang["information"];
48
+            } else if($content["type"] == 2) {
49
+                $icon = $_style['actions_triangle'] . ' text-warning';
50
+                $msgtype = $_lang["warning"];
51
+            } else if($content["type"] == 3) {
52
+                $icon = $_style['actions_error'] . ' text-danger';
53
+                $msgtype = $_lang["error"];
54
+            }
55
+            ?>
56 56
 			<p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p>
57 57
 			<p>
58 58
 				<i class="<?= $icon ?>"></i> <?= $msgtype ?>
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
-if(!$modx->hasPermission('view_eventlog')) {
5
+if (!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // get id
10 10
 $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
11 11
 
12
-$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el 
13
-		LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0
14
-		LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'");
12
+$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el 
13
+		LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0
14
+		LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'");
15 15
 $content = $modx->db->getRow($ds);
16 16
 
17 17
 ?>
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 		<div class="container container-body">
43 43
 			<?php
44 44
 			$date = $modx->toDateFormat($content["createdon"]);
45
-			if($content["type"] == 1) {
46
-				$icon = $_style['actions_info'] . ' text-info';
45
+			if ($content["type"] == 1) {
46
+				$icon = $_style['actions_info'].' text-info';
47 47
 				$msgtype = $_lang["information"];
48
-			} else if($content["type"] == 2) {
49
-				$icon = $_style['actions_triangle'] . ' text-warning';
48
+			} else if ($content["type"] == 2) {
49
+				$icon = $_style['actions_triangle'].' text-warning';
50 50
 				$msgtype = $_lang["warning"];
51
-			} else if($content["type"] == 3) {
52
-				$icon = $_style['actions_error'] . ' text-danger';
51
+			} else if ($content["type"] == 3) {
52
+				$icon = $_style['actions_error'].' text-danger';
53 53
 				$msgtype = $_lang["error"];
54 54
 			}
55 55
 			?>
56
-			<p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p>
56
+			<p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p>
57 57
 			<p>
58 58
 				<i class="<?= $icon ?>"></i> <?= $msgtype ?>
59 59
 			</p>
Please login to merge, or discard this patch.
manager/processors/purge_plugin.processor.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 if(!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit();
3 3
 
4 4
 if(!$modx->hasPermission('delete_plugin')) {	
5
-	$e->setError(3);
6
-	$e->dumpError();	
5
+    $e->setError(3);
6
+    $e->dumpError();	
7 7
 }
8 8
 
9 9
 $tbl_site_plugins = $modx->getFullTablename('site_plugins');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit();
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit();
3 3
 
4
-if(!$modx->hasPermission('delete_plugin')) {	
4
+if (!$modx->hasPermission('delete_plugin')) {	
5 5
 	$e->setError(3);
6 6
 	$e->dumpError();	
7 7
 }
@@ -12,18 +12,18 @@  discard block
 block discarded – undo
12 12
 // Get unique list of latest added plugins by highest sql-id
13 13
 $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;");
14 14
 $latestIds = array();
15
-while($row = $modx->db->getRow($rs)) {
15
+while ($row = $modx->db->getRow($rs)) {
16 16
     $latestIds[] = $row['id'];
17 17
 }
18 18
 
19 19
 // Get list of plugins with disabled and enabled versions
20 20
 $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)");
21 21
 
22
-while($row = $modx->db->getRow($rs)) {
22
+while ($row = $modx->db->getRow($rs)) {
23 23
 
24 24
     $id = $row['id'];
25 25
 
26
-    if(in_array($id,$latestIds)) continue;	// Keep latest version of disabled plugins 
26
+    if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins 
27 27
     
28 28
     // invoke OnBeforePluginFormDelete event
29 29
     $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id));
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit();
2
+if(!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') {
3
+    exit();
4
+}
3 5
 
4
-if(!$modx->hasPermission('delete_plugin')) {	
6
+if(!$modx->hasPermission('delete_plugin')) {
5 7
 	$e->setError(3);
6 8
 	$e->dumpError();	
7 9
 }
@@ -23,7 +25,10 @@  discard block
 block discarded – undo
23 25
 
24 26
     $id = $row['id'];
25 27
 
26
-    if(in_array($id,$latestIds)) continue;	// Keep latest version of disabled plugins 
28
+    if(in_array($id,$latestIds)) {
29
+        continue;
30
+    }
31
+    // Keep latest version of disabled plugins 
27 32
     
28 33
     // invoke OnBeforePluginFormDelete event
29 34
     $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id));
@@ -37,7 +42,7 @@  discard block
 block discarded – undo
37 42
         if (!$modx->db->delete($tbl_site_plugin_events, "pluginid={$id}")) {
38 43
             echo "Something went wrong while trying to delete the plugin events for plugin {$id}";
39 44
             exit;
40
-        } else {		
45
+        } else {
41 46
             // invoke OnPluginFormDelete event
42 47
             $modx->invokeEvent('OnPluginFormDelete', array('id'=>$id));
43 48
         }
Please login to merge, or discard this patch.
manager/processors/logout.processor.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 // invoke OnBeforeManagerLogout event
9 9
 $modx->invokeEvent("OnBeforeManagerLogout",
10
-						array(
11
-							"userid"		=> $internalKey,
12
-							"username"		=> $username
13
-						));
10
+                        array(
11
+                            "userid"		=> $internalKey,
12
+                            "username"		=> $username
13
+                        ));
14 14
 
15 15
 //// Unset all of the session variables.
16 16
 //$_SESSION = array();
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 
34 34
 // invoke OnManagerLogout event
35 35
 $modx->invokeEvent("OnManagerLogout",
36
-						array(
37
-							"userid"		=> $internalKey,
38
-							"username"		=> $username
39
-						));
36
+                        array(
37
+                            "userid"		=> $internalKey,
38
+                            "username"		=> $username
39
+                        ));
40 40
 
41 41
 // show login screen
42 42
 header('Location: ' . MODX_MANAGER_URL);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4 4
 $internalKey = $modx->getLoginUserID();
5 5
 $username = $_SESSION['mgrShortname'];
@@ -39,4 +39,4 @@  discard block
 block discarded – undo
39 39
 						));
40 40
 
41 41
 // show login screen
42
-header('Location: ' . MODX_MANAGER_URL);
42
+header('Location: '.MODX_MANAGER_URL);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(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.");
4
+}
3 5
 
4 6
 $internalKey = $modx->getLoginUserID();
5 7
 $username = $_SESSION['mgrShortname'];
Please login to merge, or discard this patch.