Completed
Pull Request — develop (#716)
by Serg
08:10 queued 01:53
created
manager/actions/mutate_module_resources.dynamic.php 2 patches
Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
6 6
 if(!$modx->hasPermission('edit_module')) {
7
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10 10
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -26,91 +26,91 @@  discard block
 block discarded – undo
26 26
 // check to see the  editor isn't locked
27 27
 $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28 28
 if($username = $modx->db->getValue($rs)) {
29
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
29
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34 34
 switch($_REQUEST['op']) {
35
-	case 'add':
36
-		// convert ids to numbers
37
-		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38
-
39
-		if(count($opids) > 0) {
40
-			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41
-			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
43
-				$type = 10;
44
-			}
45
-			if($rt == 'doc') {
46
-				$type = 20;
47
-			}
48
-			if($rt == 'plug') {
49
-				$type = 30;
50
-			}
51
-			if($rt == 'snip') {
52
-				$type = 40;
53
-			}
54
-			if($rt == 'tpl') {
55
-				$type = 50;
56
-			}
57
-			if($rt == 'tv') {
58
-				$type = 60;
59
-			}
60
-			$modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
62
-				$modx->db->insert(array(
63
-					'module' => $id,
64
-					'resource' => $opid,
65
-					'type' => $type,
66
-				), $tbl_site_module_depobj);
67
-			}
68
-		}
69
-		break;
70
-	case 'del':
71
-		// convert ids to numbers
72
-		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73
-
74
-		// get resources that needs to be removed
75
-		$ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
76
-		// loop through resources and look for plugins and snippets
77
-		$plids = array();
78
-		$snid = array();
79
-		while($row = $modx->db->getRow($ds)) {
80
-			if($row['type'] == '30') {
81
-				$plids[$i] = $row['resource'];
82
-			}
83
-			if($row['type'] == '40') {
84
-				$snids[$i] = $row['resource'];
85
-			}
86
-		}
87
-		// get guid
88
-		$ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'");
89
-		$guid = $modx->db->getValue($ds);
90
-		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
-			}
95
-			if($cs) {
96
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
-			}
98
-			// reset cache
99
-			$modx->clearCache('full');
100
-		}
101
-		$modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
102
-		break;
35
+    case 'add':
36
+        // convert ids to numbers
37
+        $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38
+
39
+        if(count($opids) > 0) {
40
+            // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41
+            $rt = strtolower($_REQUEST["rt"]);
42
+            if($rt == 'chunk') {
43
+                $type = 10;
44
+            }
45
+            if($rt == 'doc') {
46
+                $type = 20;
47
+            }
48
+            if($rt == 'plug') {
49
+                $type = 30;
50
+            }
51
+            if($rt == 'snip') {
52
+                $type = 40;
53
+            }
54
+            if($rt == 'tpl') {
55
+                $type = 50;
56
+            }
57
+            if($rt == 'tv') {
58
+                $type = 60;
59
+            }
60
+            $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
+            foreach($opids as $opid) {
62
+                $modx->db->insert(array(
63
+                    'module' => $id,
64
+                    'resource' => $opid,
65
+                    'type' => $type,
66
+                ), $tbl_site_module_depobj);
67
+            }
68
+        }
69
+        break;
70
+    case 'del':
71
+        // convert ids to numbers
72
+        $opids = array_filter(array_map('intval', $_REQUEST['depid']));
73
+
74
+        // get resources that needs to be removed
75
+        $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
76
+        // loop through resources and look for plugins and snippets
77
+        $plids = array();
78
+        $snid = array();
79
+        while($row = $modx->db->getRow($ds)) {
80
+            if($row['type'] == '30') {
81
+                $plids[$i] = $row['resource'];
82
+            }
83
+            if($row['type'] == '40') {
84
+                $snids[$i] = $row['resource'];
85
+            }
86
+        }
87
+        // get guid
88
+        $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'");
89
+        $guid = $modx->db->getValue($ds);
90
+        // reset moduleguid for deleted resources
91
+        if(($cp = count($plids)) || ($cs = count($snids))) {
92
+            if($cp) {
93
+                $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
+            }
95
+            if($cs) {
96
+                $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
+            }
98
+            // reset cache
99
+            $modx->clearCache('full');
100
+        }
101
+        $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
102
+        break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->db->getRow($rs);
108 108
 if(!$content) {
109
-	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
109
+    $modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112 112
 if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
113
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
116 116
 ?>
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 				<tr>
204 204
 					<td valign="top" align="left">
205 205
 						<?php
206
-						$ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name,
206
+                        $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name,
207 207
 				CASE smd.type
208 208
 					WHEN 10 THEN 'Chunk'
209 209
 					WHEN 20 THEN 'Document'
@@ -218,18 +218,18 @@  discard block
 block discarded – undo
218 218
 					LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40'
219 219
 					LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50'
220 220
 					LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name");
221
-						include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
222
-						$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
223
-						$grd->noRecordMsg = $_lang["no_records_found"];
224
-						$grd->cssClass = "grid";
225
-						$grd->columnHeaderClass = "gridHeader";
226
-						$grd->itemClass = "gridItem";
227
-						$grd->altItemClass = "gridAltItem";
228
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
229
-						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
230
-						$grd->fields = "name,type";
231
-						echo $grd->render();
232
-						?>
221
+                        include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
222
+                        $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
223
+                        $grd->noRecordMsg = $_lang["no_records_found"];
224
+                        $grd->cssClass = "grid";
225
+                        $grd->columnHeaderClass = "gridHeader";
226
+                        $grd->itemClass = "gridItem";
227
+                        $grd->altItemClass = "gridAltItem";
228
+                        $grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
229
+                        $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
230
+                        $grd->fields = "name,type";
231
+                        echo $grd->render();
232
+                        ?>
233 233
 					</td>
234 234
 					<td valign="top" style="width: 150px;">
235 235
 						<a class="btn btn-block btn-danger text-left" style="margin-bottom:10px;" href="javascript:;" onclick="removeDependencies();return false;"><i class="<?php echo $_style["actions_delete"] ?>"></i> <?php echo $_lang['remove']; ?></a>
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
-if(!$modx->hasPermission('edit_module')) {
6
+if (!$modx->hasPermission('edit_module')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
10
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // Get table names (alphabetical)
13 13
 $tbl_active_users = $modx->getFullTableName('active_users');
@@ -24,41 +24,41 @@  discard block
 block discarded – undo
24 24
 $modx->manager->initPageViewState();
25 25
 
26 26
 // check to see the  editor isn't locked
27
-$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28
-if($username = $modx->db->getValue($rs)) {
27
+$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'");
28
+if ($username = $modx->db->getValue($rs)) {
29 29
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34
-switch($_REQUEST['op']) {
34
+switch ($_REQUEST['op']) {
35 35
 	case 'add':
36 36
 		// convert ids to numbers
37 37
 		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38 38
 
39
-		if(count($opids) > 0) {
39
+		if (count($opids) > 0) {
40 40
 			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41 41
 			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
42
+			if ($rt == 'chunk') {
43 43
 				$type = 10;
44 44
 			}
45
-			if($rt == 'doc') {
45
+			if ($rt == 'doc') {
46 46
 				$type = 20;
47 47
 			}
48
-			if($rt == 'plug') {
48
+			if ($rt == 'plug') {
49 49
 				$type = 30;
50 50
 			}
51
-			if($rt == 'snip') {
51
+			if ($rt == 'snip') {
52 52
 				$type = 40;
53 53
 			}
54
-			if($rt == 'tpl') {
54
+			if ($rt == 'tpl') {
55 55
 				$type = 50;
56 56
 			}
57
-			if($rt == 'tv') {
57
+			if ($rt == 'tv') {
58 58
 				$type = 60;
59 59
 			}
60
-			$modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
60
+			$modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'");
61
+			foreach ($opids as $opid) {
62 62
 				$modx->db->insert(array(
63 63
 					'module' => $id,
64 64
 					'resource' => $opid,
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73 73
 
74 74
 		// get resources that needs to be removed
75
-		$ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
75
+		$ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")");
76 76
 		// loop through resources and look for plugins and snippets
77 77
 		$plids = array();
78 78
 		$snid = array();
79
-		while($row = $modx->db->getRow($ds)) {
80
-			if($row['type'] == '30') {
79
+		while ($row = $modx->db->getRow($ds)) {
80
+			if ($row['type'] == '30') {
81 81
 				$plids[$i] = $row['resource'];
82 82
 			}
83
-			if($row['type'] == '40') {
83
+			if ($row['type'] == '40') {
84 84
 				$snids[$i] = $row['resource'];
85 85
 			}
86 86
 		}
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
 		$ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'");
89 89
 		$guid = $modx->db->getValue($ds);
90 90
 		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
91
+		if (($cp = count($plids)) || ($cs = count($snids))) {
92
+			if ($cp) {
93
+				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'");
94 94
 			}
95
-			if($cs) {
96
-				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
95
+			if ($cs) {
96
+				$modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'");
97 97
 			}
98 98
 			// reset cache
99 99
 			$modx->clearCache('full');
100 100
 		}
101
-		$modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
101
+		$modx->db->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")");
102 102
 		break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->db->getRow($rs);
108
-if(!$content) {
108
+if (!$content) {
109 109
 	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112
-if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
112
+if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113 113
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
 	<input type="hidden" name="id" value="<?php echo $content['id']; ?>" />
189 189
 
190 190
 	<h1>
191
-		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?>
191
+		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?>
192 192
 	</h1>
193 193
 
194 194
 	<?php echo $_style['actionbuttons']['dynamic']['close'] ?>
195 195
 
196 196
 	<div class="section">
197
-		<div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div>
197
+		<div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div>
198 198
 		<div class="sectionBody">
199 199
 			<p><?php echo $_lang['module_resource_msg']; ?></p>
200 200
 			<br />
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 					LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40'
219 219
 					LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50'
220 220
 					LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name");
221
-						include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
221
+						include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
222 222
 						$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
223 223
 						$grd->noRecordMsg = $_lang["no_records_found"];
224 224
 						$grd->cssClass = "grid";
225 225
 						$grd->columnHeaderClass = "gridHeader";
226 226
 						$grd->itemClass = "gridItem";
227 227
 						$grd->altItemClass = "gridAltItem";
228
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
+						$grd->columns = $_lang["element_name"]." ,".$_lang["type"];
229 229
 						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
230 230
 						$grd->fields = "name,type";
231 231
 						echo $grd->render();
Please login to merge, or discard this patch.
manager/actions/mutate_plugin.dynamic.php 2 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch ($modx->manager->action) {
7
-    case 102:
8
-        if (!$modx->hasPermission('edit_plugin')) {
9
-            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-        }
11
-        break;
12
-    case 101:
13
-        if (!$modx->hasPermission('new_plugin')) {
7
+        case 102:
8
+            if (!$modx->hasPermission('edit_plugin')) {
9
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+            }
11
+            break;
12
+        case 101:
13
+            if (!$modx->hasPermission('new_plugin')) {
14
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+            }
16
+            break;
17
+        default:
14 18
             $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-        }
16
-        break;
17
-    default:
18
-        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 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
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 $tbl_site_plugins = $modx->getFullTableName('site_plugins');
24 24
 $tbl_site_plugin_events = $modx->getFullTableName('site_plugin_events');
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     $content['properties'] = str_replace("&", "&amp;", $content['properties']);
47 47
 } else {
48 48
     $_SESSION['itemname'] = $_lang["new_plugin"];
49
-    $content['category'] = (int)$_REQUEST['catid'];
49
+    $content['category'] = (int) $_REQUEST['catid'];
50 50
 }
51 51
 
52 52
 if ($modx->manager->hasFormValues()) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 // Add lock-element JS-Script
57 57
 $lockElementId = $id;
58 58
 $lockElementType = 5;
59
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
59
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
60 60
 
61 61
 
62 62
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
     <input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
474 474
 
475 475
     <h1>
476
-        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i>
476
+        <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i>
477 477
     </h1>
478 478
 
479 479
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                             <div class="form-control-name clearfix">
500 500
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
501 501
                                 <?php if ($modx->hasPermission('save_role')): ?>
502
-                                <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip>
502
+                                <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip>
503 503
                                     <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
504 504
                                     <i class="fa fa-lock"></i>
505 505
                                 </label>
@@ -523,9 +523,9 @@  discard block
 block discarded – undo
523 523
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
524 524
                                 <option>&nbsp;</option>
525 525
                                 <?php
526
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
526
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
527 527
                                 foreach (getCategories() as $n => $v) {
528
-                                    echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>";
528
+                                    echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>";
529 529
                                 }
530 530
                                 ?>
531 531
                             </select>
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                 <?php if ($modx->hasPermission('save_role')): ?>
542 542
                 <div class="form-group">
543 543
                     <div class="form-row">
544
-                        <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['plugin_disabled'] . "</span>" : $_lang['plugin_disabled']) ?></label>
544
+                        <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['plugin_disabled']."</span>" : $_lang['plugin_disabled']) ?></label>
545 545
                     </div>
546 546
                     <div class="form-row">
547 547
                         <label>
@@ -588,11 +588,11 @@  discard block
 block discarded – undo
588 588
                             <select name="moduleguid" class="form-control" onchange="documentDirty=true;">
589 589
                                 <option>&nbsp;</option>
590 590
                                 <?php
591
-                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm 
592
-								INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30
593
-								INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
591
+                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm 
592
+								INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30
593
+								INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
594 594
                                 while ($row = $modx->db->getRow($ds)) {
595
-                                    echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>";
595
+                                    echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>";
596 596
                                 }
597 597
                                 ?>
598 598
                             </select>
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                                 echoEventRows($evtnames);
655 655
                             }
656 656
                             echo '<hr class="clear">';
657
-                            echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>';
657
+                            echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>';
658 658
                         }
659 659
                         // display group name
660 660
                         if ($grp != $row['groupname']) {
@@ -663,9 +663,9 @@  discard block
 block discarded – undo
663 663
                                 echoEventRows($evtnames);
664 664
                             }
665 665
                             echo '<hr class="clear">';
666
-                            echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>';
666
+                            echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>';
667 667
                         }
668
-                        $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n";
668
+                        $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n";
669 669
                         if (count($evtnames) == 2) {
670 670
                             echoEventRows($evtnames);
671 671
                         }
Please login to merge, or discard this patch.
manager/actions/mutate_snippet.dynamic.php 2 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch ($modx->manager->action) {
7
-    case 22:
8
-        if (!$modx->hasPermission('edit_snippet')) {
9
-            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-        }
11
-        break;
12
-    case 23:
13
-        if (!$modx->hasPermission('new_snippet')) {
7
+        case 22:
8
+            if (!$modx->hasPermission('edit_snippet')) {
9
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+            }
11
+            break;
12
+        case 23:
13
+            if (!$modx->hasPermission('new_snippet')) {
14
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+            }
16
+            break;
17
+        default:
14 18
             $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-        }
16
-        break;
17
-    default:
18
-        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // Get table Names (alphabetical)
24 24
 $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $rs = $modx->db->select('*', $tbl_site_snippets, "id='{$id}'");
40 40
     $content = $modx->db->getRow($rs);
41 41
     if (!$content) {
42
-        header("Location: " . MODX_SITE_URL . "index.php?id=" . $site_start);
42
+        header("Location: ".MODX_SITE_URL."index.php?id=".$site_start);
43 43
     }
44 44
     $_SESSION['itemname'] = $content['name'];
45 45
     if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $content['name'] = $_REQUEST['itemname'];
51 51
 } else {
52 52
     $_SESSION['itemname'] = $_lang["new_snippet"];
53
-    $content['category'] = (int)$_REQUEST['catid'];
53
+    $content['category'] = (int) $_REQUEST['catid'];
54 54
 }
55 55
 
56 56
 if ($modx->manager->hasFormValues()) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 // Add lock-element JS-Script
63 63
 $lockElementId = $id;
64 64
 $lockElementType = 4;
65
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
65
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
66 66
 ?>
67 67
 <script type="text/javascript">
68 68
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     <input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
432 432
 
433 433
     <h1 class="pagetitle">
434
-        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
434
+        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
435 435
     </h1>
436 436
 
437 437
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                             <div class="form-control-name clearfix">
458 458
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
459 459
                                 <?php if ($modx->hasPermission('save_role')): ?>
460
-                                    <label class="custom-control" title="<?= $_lang['lock_snippet'] . "\n" . $_lang['lock_snippet_msg'] ?>" tooltip>
460
+                                    <label class="custom-control" title="<?= $_lang['lock_snippet']."\n".$_lang['lock_snippet_msg'] ?>" tooltip>
461 461
                                         <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
462 462
                                         <i class="fa fa-lock"></i>
463 463
                                     </label>
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
482 482
                                 <option>&nbsp;</option>
483 483
                                 <?php
484
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
484
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
485 485
                                 foreach (getCategories() as $n => $v) {
486
-                                    echo '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . '</option>';
486
+                                    echo '<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category']).'</option>';
487 487
                                 }
488 488
                                 ?>
489 489
                             </select>
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
                     <div class="form-group">
501 501
                         <?php if ($_SESSION['mgrRole'] == 1): ?>
502 502
                             <div class="form-row">
503
-                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label>
503
+                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label>
504 504
                             </div>
505 505
                         <?php endif; ?>
506 506
                         <div class="form-row">
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 <span><?= $_lang['snippet_code'] ?></span>
518 518
             </div>
519 519
             <div class="section-editor clearfix">
520
-                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php" . "\n" . trim($modx->htmlspecialchars($content['snippet'])) . "\n") ?></textarea>
520
+                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php"."\n".trim($modx->htmlspecialchars($content['snippet']))."\n") ?></textarea>
521 521
             </div>
522 522
             <!-- PHP text editor end -->
523 523
         </div>
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 								INNER JOIN {$tbl_site_module_depobj} AS smd ON smd.module=sm.id AND smd.type=40 
553 553
 								INNER JOIN {$tbl_site_snippets} AS ss ON ss.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams=1", 'sm.name');
554 554
                                 while ($row = $modx->db->getRow($ds)) {
555
-                                    echo "<option value='" . $row['guid'] . "'" . ($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row['name']) . "</option>";
555
+                                    echo "<option value='".$row['guid']."'".($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row['name'])."</option>";
556 556
                                 }
557 557
                                 ?>
558 558
                             </select>
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_moduser.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-$userid = (int)$value;
2
+$userid = (int) $value;
3 3
 if (!isset($modx->filter->cache['ui'][$userid])) {
4 4
     if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid));
5 5
     else             $user = $modx->getUserInfo($userid);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 $userid = (int)$value;
3 3
 if (!isset($modx->filter->cache['ui'][$userid])) {
4
-    if ($userid < 0) $user = $modx->getWebUserInfo(abs($userid));
5
-    else             $user = $modx->getUserInfo($userid);
4
+    if ($userid < 0) {
5
+        $user = $modx->getWebUserInfo(abs($userid));
6
+    } else {
7
+        $user = $modx->getUserInfo($userid);
8
+    }
6 9
     $modx->filter->cache['ui'][$userid] = $user;
7 10
 } else {
8 11
     $user = $modx->filter->cache['ui'][$userid];
Please login to merge, or discard this patch.
manager/includes/extenders/modifiers/mdf_summary.inc.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@
 block discarded – undo
1 1
 <?php
2
-if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt);
3
-elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';}
4
-else {$limit=124;$delim='';}
2
+if (strpos($opt, ',')) list($limit, $delim) = explode(',', $opt);
3
+elseif (preg_match('/^[1-9][0-9]*$/', $opt)) {$limit = $opt; $delim = ''; }
4
+else {$limit = 124; $delim = ''; }
5 5
 
6
-if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.';
7
-$limit = (int)$limit;
6
+if ($delim === '') $delim = $modx->config['manager_language'] === 'japanese-utf8' ? '。' : '.';
7
+$limit = (int) $limit;
8 8
 
9 9
 $content = $modx->filter->parseDocumentSource($value);
10 10
 
11 11
 $content = strip_tags($content);
12 12
 
13
-$content = str_replace(array("\r\n","\r","\n","\t",'&nbsp;'),' ',$content);
14
-if(preg_match('/\s+/',$content))
15
-    $content = preg_replace('/\s+/',' ',$content);
13
+$content = str_replace(array("\r\n", "\r", "\n", "\t", '&nbsp;'), ' ', $content);
14
+if (preg_match('/\s+/', $content))
15
+    $content = preg_replace('/\s+/', ' ', $content);
16 16
 $content = trim($content);
17 17
 
18 18
 $pos = $modx->filter->strpos($content, $delim);
19 19
 
20
-if($pos!==false && $pos<$limit) {
20
+if ($pos !== false && $pos < $limit) {
21 21
     $_ = explode($delim, $content);
22 22
     $text = '';
23
-    foreach($_ as $v) {
24
-        if($limit <= $modx->filter->strlen($text.$v.$delim)) break;
23
+    foreach ($_ as $v) {
24
+        if ($limit <= $modx->filter->strlen($text.$v.$delim)) break;
25 25
         $text .= $v.$delim;
26 26
     }
27
-    if($text) $content = $text;
27
+    if ($text) $content = $text;
28 28
 }
29 29
 
30
-if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) {
30
+if ($limit < $modx->filter->strlen($content) && strpos($content, ' ') !== false) {
31 31
     $_ = explode(' ', $content);
32 32
     $text = '';
33
-    foreach($_ as $v) {
34
-        if($limit <= $modx->filter->strlen($text.$v.' ')) break;
35
-        $text .= $v . ' ';
33
+    foreach ($_ as $v) {
34
+        if ($limit <= $modx->filter->strlen($text.$v.' ')) break;
35
+        $text .= $v.' ';
36 36
     }
37
-    if($text!=='') $content = $text;
37
+    if ($text !== '') $content = $text;
38 38
 }
39 39
 
40
-if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit);
41
-if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim;
40
+if ($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit);
41
+if ($modx->filter->substr($content, -1) == $delim) $content = rtrim($content, $delim).$delim;
42 42
 
43 43
 return $content;
Please login to merge, or discard this patch.
Braces   +28 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,9 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(strpos($opt,',')) list($limit,$delim) = explode(',', $opt);
3
-elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';}
4
-else {$limit=124;$delim='';}
2
+if(strpos($opt,',')) {
3
+    list($limit,$delim) = explode(',', $opt);
4
+} elseif(preg_match('/^[1-9][0-9]*$/',$opt)) {$limit=$opt;$delim='';} else {$limit=124;$delim='';}
5 5
 
6
-if($delim==='') $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.';
6
+if($delim==='') {
7
+    $delim = $modx->config['manager_language']==='japanese-utf8' ? '。' : '.';
8
+}
7 9
 $limit = (int)$limit;
8 10
 
9 11
 $content = $modx->filter->parseDocumentSource($value);
@@ -11,8 +13,9 @@  discard block
 block discarded – undo
11 13
 $content = strip_tags($content);
12 14
 
13 15
 $content = str_replace(array("\r\n","\r","\n","\t",'&nbsp;'),' ',$content);
14
-if(preg_match('/\s+/',$content))
16
+if(preg_match('/\s+/',$content)) {
15 17
     $content = preg_replace('/\s+/',' ',$content);
18
+}
16 19
 $content = trim($content);
17 20
 
18 21
 $pos = $modx->filter->strpos($content, $delim);
@@ -21,23 +24,35 @@  discard block
 block discarded – undo
21 24
     $_ = explode($delim, $content);
22 25
     $text = '';
23 26
     foreach($_ as $v) {
24
-        if($limit <= $modx->filter->strlen($text.$v.$delim)) break;
27
+        if($limit <= $modx->filter->strlen($text.$v.$delim)) {
28
+            break;
29
+        }
25 30
         $text .= $v.$delim;
26 31
     }
27
-    if($text) $content = $text;
28
-}
32
+    if($text) {
33
+        $content = $text;
34
+    }
35
+    }
29 36
 
30 37
 if($limit<$modx->filter->strlen($content) && strpos($content,' ')!==false) {
31 38
     $_ = explode(' ', $content);
32 39
     $text = '';
33 40
     foreach($_ as $v) {
34
-        if($limit <= $modx->filter->strlen($text.$v.' ')) break;
41
+        if($limit <= $modx->filter->strlen($text.$v.' ')) {
42
+            break;
43
+        }
35 44
         $text .= $v . ' ';
36 45
     }
37
-    if($text!=='') $content = $text;
38
-}
46
+    if($text!=='') {
47
+        $content = $text;
48
+    }
49
+    }
39 50
 
40
-if($limit < $modx->filter->strlen($content)) $content = $modx->filter->substr($content, 0, $limit);
41
-if($modx->filter->substr($content,-1)==$delim) $content = rtrim($content,$delim) . $delim;
51
+if($limit < $modx->filter->strlen($content)) {
52
+    $content = $modx->filter->substr($content, 0, $limit);
53
+}
54
+if($modx->filter->substr($content,-1)==$delim) {
55
+    $content = rtrim($content,$delim) . $delim;
56
+}
42 57
 
43 58
 return $content;
Please login to merge, or discard this patch.
manager/includes/extenders/dbapi.mysql.class.inc.php 3 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $pre = null,
31 31
         $charset = '',
32 32
         $connection_method = 'SET CHARACTER SET'
33
-    ) {
33
+    ){
34 34
         $this->config['host'] = $host ? $host : $GLOBALS['database_server'];
35 35
         $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase'];
36 36
         $this->config['user'] = $uid ? $uid : $GLOBALS['database_user'];
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                         $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']);
121 121
 
122 122
                         $modx->sendmail(array(
123
-                                'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'],
123
+                                'subject' => 'Missing to create the database connection! from '.$modx->config['site_name'],
124 124
                                 'body'    => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}",
125 125
                                 'type'    => 'text'
126 126
                             )
@@ -137,15 +137,15 @@  discard block
 block discarded – undo
137 137
         } else {
138 138
             $dbase = trim($dbase, '`'); // remove the `` chars
139 139
             if (!@ mysql_select_db($dbase, $this->conn)) {
140
-                $modx->messageQuit("Failed to select the database '" . $dbase . "'!");
140
+                $modx->messageQuit("Failed to select the database '".$dbase."'!");
141 141
                 exit;
142 142
             }
143 143
             @mysql_query("{$connection_method} {$charset}", $this->conn);
144 144
             $tend = $modx->getMicroTime();
145 145
             $totaltime = $tend - $tstart;
146 146
             if ($modx->dumpSQL) {
147
-                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s",
148
-                        $totaltime) . "</fieldset><br />";
147
+                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s",
148
+                        $totaltime)."</fieldset><br />";
149 149
             }
150 150
             if (function_exists('mysql_set_charset')) {
151 151
                 mysql_set_charset($this->config['charset']);
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                 case 1091:
226 226
                     break;
227 227
                 default:
228
-                    $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql);
228
+                    $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql);
229 229
             }
230 230
         } else {
231 231
             $tend = $modx->getMicroTime();
@@ -239,24 +239,24 @@  discard block
 block discarded – undo
239 239
                     $debug_path[] = $line['function'];
240 240
                 }
241 241
                 $debug_path = implode(' > ', array_reverse($debug_path));
242
-                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms",
243
-                        $totaltime * 1000) . "</legend>";
244
-                $modx->queryCode .= $sql . '<br><br>';
242
+                $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms",
243
+                        $totaltime * 1000)."</legend>";
244
+                $modx->queryCode .= $sql.'<br><br>';
245 245
                 if ($modx->event->name) {
246
-                    $modx->queryCode .= 'Current Event  => ' . $modx->event->name . '<br>';
246
+                    $modx->queryCode .= 'Current Event  => '.$modx->event->name.'<br>';
247 247
                 }
248 248
                 if ($modx->event->activePlugin) {
249
-                    $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>';
249
+                    $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>';
250 250
                 }
251 251
                 if ($modx->currentSnippet) {
252
-                    $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>';
252
+                    $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>';
253 253
                 }
254 254
                 if (stripos($sql, 'select') === 0) {
255
-                    $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>';
255
+                    $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>';
256 256
                 } else {
257
-                    $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>';
257
+                    $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>';
258 258
                 }
259
-                $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>';
259
+                $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>';
260 260
                 $modx->queryCode .= "</fieldset><br />";
261 261
             }
262 262
             $modx->executedQueries = $modx->executedQueries + 1;
@@ -350,9 +350,9 @@  discard block
 block discarded – undo
350 350
                     if (is_null($value) || strtolower($value) === 'null') {
351 351
                         $flds = 'NULL';
352 352
                     } else {
353
-                        $flds = "'" . $value . "'";
353
+                        $flds = "'".$value."'";
354 354
                     }
355
-                    $fields[$key] = "`{$key}` = " . $flds;
355
+                    $fields[$key] = "`{$key}` = ".$flds;
356 356
                 }
357 357
                 $fields = implode(",", $fields);
358 358
             }
@@ -380,13 +380,13 @@  discard block
 block discarded – undo
380 380
                 $this->query("INSERT INTO {$intotable} {$fields}");
381 381
             } else {
382 382
                 if (empty($fromtable)) {
383
-                    $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '",
384
-                            array_values($fields)) . "')";
383
+                    $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '",
384
+                            array_values($fields))."')";
385 385
                     $rt = $this->query("INSERT INTO {$intotable} {$fields}");
386 386
                 } else {
387 387
                     if (version_compare($this->getVersion(), "4.0.14") >= 0) {
388 388
                         $fromtable = $this->replaceFullTableName($fromtable);
389
-                        $fields = "(" . implode(",", array_keys($fields)) . ")";
389
+                        $fields = "(".implode(",", array_keys($fields)).")";
390 390
                         $where = trim($where);
391 391
                         $limit = trim($limit);
392 392
                         if ($where !== '' && stripos($where, 'WHERE') !== 0) {
@@ -399,8 +399,8 @@  discard block
 block discarded – undo
399 399
                     } else {
400 400
                         $ds = $this->select($fromfields, $fromtable, $where, '', $limit);
401 401
                         while ($row = $this->getRow($ds)) {
402
-                            $fields = "(" . implode(",", array_keys($fields)) . ") VALUES('" . implode("', '",
403
-                                    $row) . "')";
402
+                            $fields = "(".implode(",", array_keys($fields)).") VALUES('".implode("', '",
403
+                                    $row)."')";
404 404
                             $rt = $this->query("INSERT INTO {$intotable} {$fields}");
405 405
                         }
406 406
                     }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
     public function getInsertId($conn = null)
486 486
     {
487 487
         if (!is_resource($conn)) {
488
-            $conn =& $this->conn;
488
+            $conn = & $this->conn;
489 489
         }
490 490
 
491 491
         return mysql_insert_id($conn);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
     public function getAffectedRows($conn = null)
499 499
     {
500 500
         if (!is_resource($conn)) {
501
-            $conn =& $this->conn;
501
+            $conn = & $this->conn;
502 502
         }
503 503
 
504 504
         return mysql_affected_rows($conn);
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
     public function getLastError($conn = null)
512 512
     {
513 513
         if (!is_resource($conn)) {
514
-            $conn =& $this->conn;
514
+            $conn = & $this->conn;
515 515
         }
516 516
 
517 517
         return mysql_error($conn);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -280,13 +280,13 @@  discard block
 block discarded – undo
280 280
             $orderby = trim($orderby);
281 281
             $limit = trim($limit);
282 282
             if ($where !== '' && stripos($where, 'WHERE') !== 0) {
283
-                $where = "WHERE {$where}";
283
+                $where = "where {$where}";
284 284
             }
285 285
             if ($orderby !== '' && stripos($orderby, 'ORDER BY') !== 0) {
286 286
                 $orderby = "ORDER BY {$orderby}";
287 287
             }
288 288
             if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) {
289
-                $limit = "LIMIT {$limit}";
289
+                $limit = "limit {$limit}";
290 290
             }
291 291
 
292 292
             return $this->query("DELETE FROM {$from} {$where} {$orderby} {$limit}");
@@ -322,16 +322,16 @@  discard block
 block discarded – undo
322 322
         $orderby = trim($orderby);
323 323
         $limit = trim($limit);
324 324
         if ($where !== '' && stripos($where, 'WHERE') !== 0) {
325
-            $where = "WHERE {$where}";
325
+            $where = "where {$where}";
326 326
         }
327 327
         if ($orderby !== '' && stripos($orderby, 'ORDER') !== 0) {
328 328
             $orderby = "ORDER BY {$orderby}";
329 329
         }
330 330
         if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) {
331
-            $limit = "LIMIT {$limit}";
331
+            $limit = "limit {$limit}";
332 332
         }
333 333
 
334
-        return $this->query("SELECT {$fields} FROM {$from} {$where} {$orderby} {$limit}");
334
+        return $this->query("select {$fields} FROM {$from} {$where} {$orderby} {$limit}");
335 335
     }
336 336
 
337 337
     /**
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
             }
359 359
             $where = trim($where);
360 360
             if ($where !== '' && stripos($where, 'WHERE') !== 0) {
361
-                $where = "WHERE {$where}";
361
+                $where = "where {$where}";
362 362
             }
363 363
 
364
-            return $this->query("UPDATE {$table} SET {$fields} {$where}");
364
+            return $this->query("update {$table} SET {$fields} {$where}");
365 365
         }
366 366
     }
367 367
 
@@ -390,10 +390,10 @@  discard block
 block discarded – undo
390 390
                         $where = trim($where);
391 391
                         $limit = trim($limit);
392 392
                         if ($where !== '' && stripos($where, 'WHERE') !== 0) {
393
-                            $where = "WHERE {$where}";
393
+                            $where = "where {$where}";
394 394
                         }
395 395
                         if ($limit !== '' && stripos($limit, 'LIMIT') !== 0) {
396
-                            $limit = "LIMIT {$limit}";
396
+                            $limit = "limit {$limit}";
397 397
                         }
398 398
                         $rt = $this->query("INSERT INTO {$intotable} {$fields} SELECT {$fromfields} FROM {$fromtable} {$where} {$limit}");
399 399
                     } else {
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 
733 733
     public function truncate($table_name)
734 734
     {
735
-        $rs = $this->query("TRUNCATE {$table_name}");
735
+        $rs = $this->query("truncate {$table_name}");
736 736
 
737 737
         return $rs;
738 738
     }
Please login to merge, or discard this patch.
Doc Comments   +12 added lines patch added patch discarded remove patch
@@ -268,6 +268,7 @@  discard block
 block discarded – undo
268 268
     /**
269 269
      * @name:  delete
270 270
      *
271
+     * @param string $from
271 272
      */
272 273
     public function delete($from, $where = '', $orderby = '', $limit = '')
273 274
     {
@@ -414,6 +415,9 @@  discard block
 block discarded – undo
414 415
         }
415 416
     }
416 417
 
418
+    /**
419
+     * @param string $table
420
+     */
417 421
     public function save($fields, $table, $where = '')
418 422
     {
419 423
 
@@ -444,6 +448,7 @@  discard block
 block discarded – undo
444 448
     /**
445 449
      * @name:  freeResult
446 450
      *
451
+     * @param mysqli_result $rs
447 452
      */
448 453
     public function freeResult($rs)
449 454
     {
@@ -554,6 +559,7 @@  discard block
 block discarded – undo
554 559
      * @name:  getColumn
555 560
      * @desc:  returns an array of the values found on colun $name
556 561
      * @param: $dsq - dataset or query string
562
+     * @param string $name
557 563
      */
558 564
     public function getColumn($name, $dsq)
559 565
     {
@@ -720,6 +726,9 @@  discard block
 block discarded – undo
720 726
         return $result;
721 727
     }
722 728
 
729
+    /**
730
+     * @param string $table_name
731
+     */
723 732
     public function optimize($table_name)
724 733
     {
725 734
         $rs = $this->query("OPTIMIZE TABLE {$table_name}");
@@ -730,6 +739,9 @@  discard block
 block discarded – undo
730 739
         return $rs;
731 740
     }
732 741
 
742
+    /**
743
+     * @param string $table_name
744
+     */
733 745
     public function truncate($table_name)
734 746
     {
735 747
         $rs = $this->query("TRUNCATE {$table_name}");
Please login to merge, or discard this patch.
manager/includes/active_user_locks.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  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
-$lockElementId = (int)$lockElementId;
6
+$lockElementId = (int) $lockElementId;
7 7
 
8 8
 if ($lockElementId > 0) {
9 9
     ?>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         var stay = document.getElementById('stay');
19 19
         // Trigger unlock
20 20
         if ((stay && stay.value !== '2') || !form_save) {
21
-          var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random();
21
+          var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random();
22 22
           if (navigator.sendBeacon) {
23 23
             navigator.sendBeacon(url)
24 24
           } else {
Please login to merge, or discard this patch.
manager/processors/delete_plugin.processor.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  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
 if(!$modx->hasPermission('delete_plugin')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforePluginFormDelete event
19 19
 $modx->invokeEvent("OnBeforePluginFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the plugin.
25 25
 $modx->db->delete($modx->getFullTableName('site_plugins'), "id='{$id}'");
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 
30 30
 // invoke OnPluginFormDelete event
31 31
 $modx->invokeEvent("OnPluginFormDelete",
32
-	array(
33
-		"id"	=> $id
34
-	));
32
+    array(
33
+        "id"	=> $id
34
+    ));
35 35
 
36 36
 // empty cache
37 37
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
-if(!$modx->hasPermission('delete_plugin')) {
5
+if (!$modx->hasPermission('delete_plugin')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -37,5 +37,5 @@  discard block
 block discarded – undo
37 37
 $modx->clearCache('full');
38 38
 
39 39
 // finished emptying cache - redirect
40
-$header="Location: index.php?a=76&r=2";
40
+$header = "Location: index.php?a=76&r=2";
41 41
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_htmlsnippet.processor.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  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
 if(!$modx->hasPermission('delete_snippet')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeChunkFormDelete event
19 19
 $modx->invokeEvent("OnBeforeChunkFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the chunk.
25 25
 $modx->db->delete($modx->getFullTableName('site_htmlsnippets'), "id='{$id}'");
26 26
 
27 27
 // invoke OnChunkFormDelete event
28 28
 $modx->invokeEvent("OnChunkFormDelete",
29
-	array(
30
-		"id"	=> $id
31
-	));
29
+    array(
30
+        "id"	=> $id
31
+    ));
32 32
 
33 33
 // empty cache
34 34
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  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
-if(!$modx->hasPermission('delete_snippet')) {
5
+if (!$modx->hasPermission('delete_snippet')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -34,5 +34,5 @@  discard block
 block discarded – undo
34 34
 $modx->clearCache('full');
35 35
 
36 36
 // finished emptying cache - redirect
37
-$header="Location: index.php?a=76&r=2";
37
+$header = "Location: index.php?a=76&r=2";
38 38
 header($header);
Please login to merge, or discard this patch.