Completed
Push — develop ( dba6d0...45e39e )
by Agel_Nash
12:14
created
index.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 if(is_file($base_path . 'assets/cache/siteManager.php'))
51 51
     include_once($base_path . 'assets/cache/siteManager.php');
52 52
 if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53
-	define('MGR_DIR', 'manager');
53
+    define('MGR_DIR', 'manager');
54 54
 if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55 55
     include_once($base_path . 'assets/cache/siteHostnames.php');
56 56
 if(!defined('MODX_SITE_HOSTNAMES'))
57
-	define('MODX_SITE_HOSTNAMES', '');
57
+    define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
60 60
 $mstart = memory_get_usage();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80 80
 if ( ! defined('IN_MANAGER_MODE')) {
81
-	define('IN_MANAGER_MODE', false);
81
+    define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
84 84
     define('MODX_API_MODE', false);
Please login to merge, or discard this patch.
manager/actions/mutate_module_resources.dynamic.php 1 patch
Indentation   +85 added lines, -85 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->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28 28
 if($username = $modx->getDatabase()->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->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
62
-				$modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89
-		$guid = $modx->getDatabase()->getValue($ds);
90
-		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
-			}
95
-			if($cs) {
96
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
-			}
98
-			// reset cache
99
-			$modx->clearCache('full');
100
-		}
101
-		$modx->getDatabase()->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->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
+            foreach($opids as $opid) {
62
+                $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89
+        $guid = $modx->getDatabase()->getValue($ds);
90
+        // reset moduleguid for deleted resources
91
+        if(($cp = count($plids)) || ($cs = count($snids))) {
92
+            if($cp) {
93
+                $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
94
+            }
95
+            if($cs) {
96
+                $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
97
+            }
98
+            // reset cache
99
+            $modx->clearCache('full');
100
+        }
101
+        $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
102
+        break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->getDatabase()->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->getDatabase()->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name,
206
+                        $ds = $modx->getDatabase()->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,17 +218,17 @@  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
-						$grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
222
-						$grd->noRecordMsg = $_lang["no_records_found"];
223
-						$grd->cssClass = "grid";
224
-						$grd->columnHeaderClass = "gridHeader";
225
-						$grd->itemClass = "gridItem";
226
-						$grd->altItemClass = "gridAltItem";
227
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
-						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
229
-						$grd->fields = "name,type";
230
-						echo $grd->render();
231
-						?>
221
+                        $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
222
+                        $grd->noRecordMsg = $_lang["no_records_found"];
223
+                        $grd->cssClass = "grid";
224
+                        $grd->columnHeaderClass = "gridHeader";
225
+                        $grd->itemClass = "gridItem";
226
+                        $grd->altItemClass = "gridAltItem";
227
+                        $grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
+                        $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
229
+                        $grd->fields = "name,type";
230
+                        echo $grd->render();
231
+                        ?>
232 232
 					</td>
233 233
 					<td valign="top" style="width: 150px;">
234 234
 						<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.
manager/actions/mutate_module.dynamic.php 1 patch
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->getManagerApi()->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    case 107:
7
+        if(!$modx->hasPermission('new_module')) {
8
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+        }
10
+        break;
11
+    case 108:
12
+        if(!$modx->hasPermission('edit_module')) {
13
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+        }
15
+        break;
16
+    default:
17
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 // check to see the module editor isn't locked
34 34
 if($lockedEl = $modx->elementIsLocked(6, $id)) {
35
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
35
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
38 38
 
@@ -40,22 +40,22 @@  discard block
 block discarded – undo
40 40
 $modx->lockElement(6, $id);
41 41
 
42 42
 if(isset($_GET['id'])) {
43
-	$rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44
-	$content = $modx->getDatabase()->getRow($rs);
45
-	if(!$content) {
46
-		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47
-	}
48
-	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49
-	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52
-	}
43
+    $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44
+    $content = $modx->getDatabase()->getRow($rs);
45
+    if(!$content) {
46
+        $modx->webAlertAndQuit("Module not found for id '{$id}'.");
47
+    }
48
+    $content['properties'] = str_replace("&", "&amp;", $content['properties']);
49
+    $_SESSION['itemname'] = $content['name'];
50
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
52
+    }
53 53
 } else {
54
-	$_SESSION['itemname'] = $_lang["new_module"];
55
-	$content['wrap'] = '1';
54
+    $_SESSION['itemname'] = $_lang["new_module"];
55
+    $content['wrap'] = '1';
56 56
 }
57 57
 if($modx->getManagerApi()->hasFormValues()) {
58
-	$modx->getManagerApi()->loadFormValues();
58
+    $modx->getManagerApi()->loadFormValues();
59 59
 }
60 60
 
61 61
 // Add lock-element JS-Script
@@ -426,18 +426,18 @@  discard block
 block discarded – undo
426 426
 
427 427
 <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109">
428 428
 	<?php
429
-	// invoke OnModFormPrerender event
430
-	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
432
-		echo implode('', $evtOut);
433
-	}
434
-
435
-	// Prepare internal params & info-tab via parseDocBlock
436
-	$modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : '';
437
-	$docBlock = $modx->parseDocBlockFromString($modulecode);
438
-	$docBlockList = $modx->convertDocBlockIntoList($docBlock);
439
-	$internal = array();
440
-	?>
429
+    // invoke OnModFormPrerender event
430
+    $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
+    if(is_array($evtOut)) {
432
+        echo implode('', $evtOut);
433
+    }
434
+
435
+    // Prepare internal params & info-tab via parseDocBlock
436
+    $modulecode = isset($content['modulecode']) ? $modx->getDatabase()->escape($content['modulecode']) : '';
437
+    $docBlock = $modx->parseDocBlockFromString($modulecode);
438
+    $docBlockList = $modx->convertDocBlockIntoList($docBlock);
439
+    $internal = array();
440
+    ?>
441 441
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
442 442
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
443 443
 
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
495
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496
-								}
497
-								?>
493
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
+                                foreach(getCategories() as $n => $v) {
495
+                                    echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496
+                                }
497
+                                ?>
498 498
 							</select>
499 499
 						</div>
500 500
 					</div>
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 							<i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a>
602 602
 					</div>
603 603
 					<?php
604
-					$ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
604
+                    $ds = $modx->getDatabase()->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
605 605
 					CASE smd.type
606 606
 						WHEN 10 THEN 'Chunk'
607 607
 						WHEN 20 THEN 'Document'
@@ -617,16 +617,16 @@  discard block
 block discarded – undo
617 617
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
618 618
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
619 619
 
620
-					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
621
-					$grd->noRecordMsg = $_lang['no_records_found'];
622
-					$grd->cssClass = 'grid';
623
-					$grd->columnHeaderClass = 'gridHeader';
624
-					$grd->itemClass = 'gridItem';
625
-					$grd->altItemClass = 'gridAltItem';
626
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
627
-					$grd->fields = "name,type";
628
-					echo $grd->render();
629
-					?>
620
+                    $grd = new \EvolutionCMS\Support\DataGrid('', $ds, 0); // set page size to 0 t show all items
621
+                    $grd->noRecordMsg = $_lang['no_records_found'];
622
+                    $grd->cssClass = 'grid';
623
+                    $grd->columnHeaderClass = 'gridHeader';
624
+                    $grd->itemClass = 'gridItem';
625
+                    $grd->altItemClass = 'gridAltItem';
626
+                    $grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
627
+                    $grd->fields = "name,type";
628
+                    echo $grd->render();
629
+                    ?>
630 630
 				</div>
631 631
 			</div>
632 632
 		<?php endif; ?>
@@ -638,12 +638,12 @@  discard block
 block discarded – undo
638 638
 			<div class="container container-body">
639 639
 				<?php if($use_udperms == 1) : ?>
640 640
 					<?php
641
-					// fetch user access permissions for the module
642
-					$rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
643
-					$groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
641
+                    // fetch user access permissions for the module
642
+                    $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
643
+                    $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
644 644
 
645
-					if($modx->hasPermission('access_permissions')) {
646
-						?>
645
+                    if($modx->hasPermission('access_permissions')) {
646
+                        ?>
647 647
 						<!-- User Group Access Permissions -->
648 648
 						<script type="text/javascript">
649 649
 							function makePublic(b) {
@@ -667,28 +667,28 @@  discard block
 block discarded – undo
667 667
 						</script>
668 668
 						<p><?= $_lang['module_group_access_msg'] ?></p>
669 669
 						<?php
670
-					}
671
-					$chk = '';
672
-					$rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
673
-					while($row = $modx->getDatabase()->getRow($rs)) {
674
-						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
675
-						$checked = in_array($row['id'], $groupsarray);
676
-						if($modx->hasPermission('access_permissions')) {
677
-							if($checked) {
678
-								$notPublic = true;
679
-							}
680
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
681
-						} else {
682
-							if($checked) {
683
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
684
-							}
685
-						}
686
-					}
687
-					if($modx->hasPermission('access_permissions')) {
688
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
689
-					}
690
-					echo $chks;
691
-					?>
670
+                    }
671
+                    $chk = '';
672
+                    $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
673
+                    while($row = $modx->getDatabase()->getRow($rs)) {
674
+                        $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
675
+                        $checked = in_array($row['id'], $groupsarray);
676
+                        if($modx->hasPermission('access_permissions')) {
677
+                            if($checked) {
678
+                                $notPublic = true;
679
+                            }
680
+                            $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
681
+                        } else {
682
+                            if($checked) {
683
+                                $chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
684
+                            }
685
+                        }
686
+                    }
687
+                    if($modx->hasPermission('access_permissions')) {
688
+                        $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
689
+                    }
690
+                    echo $chks;
691
+                    ?>
692 692
 				<?php endif; ?>
693 693
 			</div>
694 694
 		</div>
@@ -704,11 +704,11 @@  discard block
 block discarded – undo
704 704
 
705 705
 		<input type="submit" name="save" style="display:none;">
706 706
 		<?php
707
-		// invoke OnModFormRender event
708
-		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
709
-		if(is_array($evtOut)) {
710
-			echo implode('', $evtOut);
711
-		}
712
-		?>
707
+        // invoke OnModFormRender event
708
+        $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
709
+        if(is_array($evtOut)) {
710
+            echo implode('', $evtOut);
711
+        }
712
+        ?>
713 713
 </form>
714 714
 <script type="text/javascript">setTimeout('showParameters();', 10);</script>
Please login to merge, or discard this patch.
manager/actions/eventlog.dynamic.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  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
 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 table Names (alphabetical)
@@ -16,14 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 // get and save search string
18 18
 if($_REQUEST['op'] == 'reset') {
19
-	$sqlQuery = $query = '';
20
-	$_PAGE['vs']['search'] = '';
19
+    $sqlQuery = $query = '';
20
+    $_PAGE['vs']['search'] = '';
21 21
 } else {
22
-	$sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
-	if(!is_numeric($sqlQuery)) {
24
-		$sqlQuery = $modx->getDatabase()->escape($query);
25
-	}
26
-	$_PAGE['vs']['search'] = $query;
22
+    $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
23
+    if(!is_numeric($sqlQuery)) {
24
+        $sqlQuery = $modx->getDatabase()->escape($query);
25
+    }
26
+    $_PAGE['vs']['search'] = $query;
27 27
 }
28 28
 
29 29
 // get & save listmode
@@ -124,32 +124,32 @@  discard block
 block discarded – undo
124 124
 			<div class="row">
125 125
 				<div class="table-responsive">
126 126
 					<?php
127
-					$ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
127
+                    $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el 
128 128
 			LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0
129 129
 			LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC");
130
-					$grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
131
-					$grd->pagerClass = '';
132
-					$grd->pageClass = 'page-item';
133
-					$grd->selPageClass = 'page-item active';
134
-					$grd->noRecordMsg = $_lang['no_records_found'];
135
-					$grd->cssClass = "table data nowrap";
136
-					$grd->columnHeaderClass = "tableHeader";
137
-					$grd->itemClass = "tableItem";
138
-					$grd->altItemClass = "tableAltItem";
139
-					$grd->fields = "type,source,createdon,eventid,username";
140
-					$grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
141
-					$grd->colWidths = "1%,,1%,1%,1%";
142
-					$grd->colAligns = "center,,,center,center";
143
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
144
-					if($listmode == '1') {
145
-						$grd->pageSize = 0;
146
-					}
147
-					if($_REQUEST['op'] == 'reset') {
148
-						$grd->pageNumber = 1;
149
-					}
150
-					// render grid
151
-					echo $grd->render();
152
-					?>
130
+                    $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
131
+                    $grd->pagerClass = '';
132
+                    $grd->pageClass = 'page-item';
133
+                    $grd->selPageClass = 'page-item active';
134
+                    $grd->noRecordMsg = $_lang['no_records_found'];
135
+                    $grd->cssClass = "table data nowrap";
136
+                    $grd->columnHeaderClass = "tableHeader";
137
+                    $grd->itemClass = "tableItem";
138
+                    $grd->altItemClass = "tableAltItem";
139
+                    $grd->fields = "type,source,createdon,eventid,username";
140
+                    $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid'];
141
+                    $grd->colWidths = "1%,,1%,1%,1%";
142
+                    $grd->colAligns = "center,,,center,center";
143
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p';
144
+                    if($listmode == '1') {
145
+                        $grd->pageSize = 0;
146
+                    }
147
+                    if($_REQUEST['op'] == 'reset') {
148
+                        $grd->pageNumber = 1;
149
+                    }
150
+                    // render grid
151
+                    echo $grd->render();
152
+                    ?>
153 153
 				</div>
154 154
 			</div>
155 155
 		</div>
Please login to merge, or discard this patch.
manager/frames/tree.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
 // invoke OnManagerTreeInit event
7 7
 $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
8 8
 if(is_array($evtOut)) {
9
-	echo implode("\n", $evtOut);
9
+    echo implode("\n", $evtOut);
10 10
 }
11 11
 ?>
12 12
 
@@ -52,23 +52,23 @@  discard block
 block discarded – undo
52 52
 
53 53
 	<div id="treeHolder">
54 54
 		<?php
55
-		// invoke OnManagerTreePrerender event
56
-		$evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST));
57
-		if(is_array($evtOut)) {
58
-			echo implode("\n", $evtOut);
59
-		}
60
-		?>
55
+        // invoke OnManagerTreePrerender event
56
+        $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST));
57
+        if(is_array($evtOut)) {
58
+            echo implode("\n", $evtOut);
59
+        }
60
+        ?>
61 61
 		<div id="node0" class="rootNode"><a class="node" onclick="modx.tree.treeAction(event, 0)" data-id="0" data-title-esc="<?php $site_name = $modx->getPhpCompat()->entities($site_name);
62
-			echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a>
62
+            echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a>
63 63
 			<div id="treeloader"><i class="fa fa-cog fa-spin fa-3x fa-fw"></i></div>
64 64
 		</div>
65 65
 		<div id="treeRoot"></div>
66 66
 		<?php
67
-		// invoke OnManagerTreeRender event
68
-		$evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST));
69
-		if(is_array($evtOut)) {
70
-			echo implode("\n", $evtOut);
71
-		}
72
-		?>
67
+        // invoke OnManagerTreeRender event
68
+        $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST));
69
+        if(is_array($evtOut)) {
70
+            echo implode("\n", $evtOut);
71
+        }
72
+        ?>
73 73
 	</div>
74 74
 </div>
Please login to merge, or discard this patch.
manager/processors/duplicate_htmlsnippet.processor.php 1 patch
Indentation   +9 added lines, -9 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('new_chunk')) {
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
 // count duplicates
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate htmlsnippet
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'snippet'=>'',
26
-		'category'=>'',
27
-		), $modx->getDatabase()->getFullTableName('site_htmlsnippets'), // Insert into
28
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'snippet'=>'',
26
+        'category'=>'',
27
+        ), $modx->getDatabase()->getFullTableName('site_htmlsnippets'), // Insert into
28
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, category", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$id}'"); // Copy from
29 29
 
30 30
 // Set the item name for logger
31 31
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 1 patch
Indentation   +30 added lines, -30 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('new_module')) {
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
 // count duplicates
14 14
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"));
@@ -18,40 +18,40 @@  discard block
 block discarded – undo
18 18
 
19 19
 // duplicate module
20 20
 $newid = $modx->getDatabase()->insert(
21
-	array(
22
-		'name'=>'',
23
-		'description'=>'',
24
-		'disabled'=>'',
25
-		'category'=>'',
26
-		'wrap'=>'',
27
-		'icon'=>'',
28
-		'enable_resource'=>'',
29
-		'resourcefile'=>'',
30
-		'createdon'=>'',
31
-		'editedon'=>'',
32
-		'guid'=>'',
33
-		'enable_sharedparams'=>'',
34
-		'properties'=>'',
35
-		'modulecode'=>'',
36
-		), $modx->getDatabase()->getFullTableName('site_modules'), // Insert into
37
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
21
+    array(
22
+        'name'=>'',
23
+        'description'=>'',
24
+        'disabled'=>'',
25
+        'category'=>'',
26
+        'wrap'=>'',
27
+        'icon'=>'',
28
+        'enable_resource'=>'',
29
+        'resourcefile'=>'',
30
+        'createdon'=>'',
31
+        'editedon'=>'',
32
+        'guid'=>'',
33
+        'enable_sharedparams'=>'',
34
+        'properties'=>'',
35
+        'modulecode'=>'',
36
+        ), $modx->getDatabase()->getFullTableName('site_modules'), // Insert into
37
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, category, wrap, icon, enable_resource, resourcefile, createdon, editedon, '".createGUID()."' AS guid, enable_sharedparams, properties, modulecode", $modx->getDatabase()->getFullTableName('site_modules'), "id='{$id}'"); // Copy from
38 38
 
39 39
 // duplicate module dependencies
40 40
 $modx->getDatabase()->insert(
41
-	array(
42
-		'module'=>'',
43
-		'resource'=>'',
44
-		'type'=>'',
45
-		), $modx->getDatabase()->getFullTableName('site_module_depobj'), // Insert into
46
-	"'{$newid}', resource, type", $modx->getDatabase()->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
41
+    array(
42
+        'module'=>'',
43
+        'resource'=>'',
44
+        'type'=>'',
45
+        ), $modx->getDatabase()->getFullTableName('site_module_depobj'), // Insert into
46
+    "'{$newid}', resource, type", $modx->getDatabase()->getFullTableName('site_module_depobj'), "module='{$id}'"); // Copy from
47 47
 
48 48
 // duplicate module user group access
49 49
 $modx->getDatabase()->insert(
50
-	array(
51
-		'module'=>'',
52
-		'usergroup'=>'',
53
-		), $modx->getDatabase()->getFullTableName('site_module_access'), // Insert into
54
-	"'{$newid}', usergroup", $modx->getDatabase()->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
50
+    array(
51
+        'module'=>'',
52
+        'usergroup'=>'',
53
+        ), $modx->getDatabase()->getFullTableName('site_module_access'), // Insert into
54
+    "'{$newid}', usergroup", $modx->getDatabase()->getFullTableName('site_module_access'), "module='{$id}'"); // Copy from
55 55
 
56 56
 // Set the item name for logger
57 57
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_modules'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/duplicate_template.processor.php 1 patch
Indentation   +15 added lines, -15 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('new_template')) {
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
 // count duplicates
@@ -19,22 +19,22 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate template
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'templatename'=>'',
24
-		'description'=>'',
25
-		'content'=>'',
26
-		'category'=>'',
27
-		), $modx->getDatabase()->getFullTableName('site_templates'), // Insert into
28
-	"CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'templatename'=>'',
24
+        'description'=>'',
25
+        'content'=>'',
26
+        'category'=>'',
27
+        ), $modx->getDatabase()->getFullTableName('site_templates'), // Insert into
28
+    "CONCAT(templatename, ' {$_lang['duplicated_el_suffix']}{$count}') AS templatename, description, content, category", $modx->getDatabase()->getFullTableName('site_templates'), "id='{$id}'"); // Copy from
29 29
 
30 30
 // duplicate TV values
31 31
 $modx->getDatabase()->insert(
32
-	array(
33
-		'tmplvarid'=>'',
34
-		'templateid'=>'',
35
-		'rank'=>'',
36
-		), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
37
-	"tmplvarid, '{$newid}', rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
32
+    array(
33
+        'tmplvarid'=>'',
34
+        'templateid'=>'',
35
+        'rank'=>'',
36
+        ), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
37
+    "tmplvarid, '{$newid}', rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "templateid='{$id}'"); // Copy from
38 38
 
39 39
 // Set the item name for logger
40 40
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('templatename', $modx->getDatabase()->getFullTableName('site_templates'), "id='{$newid}'"));
Please login to merge, or discard this patch.
manager/processors/delete_tmplvars.processor.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  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
 if(!$modx->hasPermission('delete_template')) {
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
 $forced = isset($_GET['force']) ? $_GET['force'] : 0;
15 15
 
16 16
 // check for relations
17 17
 if(!$forced) {
18
-	$drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content') . " AS sc
18
+    $drs = $modx->getDatabase()->select('sc.id, sc.pagetitle,sc.description', $modx->getDatabase()->getFullTableName('site_content') . " AS sc
19 19
 			INNER JOIN " . $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20
-	$count = $modx->getDatabase()->getRecordCount($drs);
21
-	if($count > 0) {
22
-		include_once "header.inc.php";
23
-		?>
20
+    $count = $modx->getDatabase()->getRecordCount($drs);
21
+    if($count > 0) {
22
+        include_once "header.inc.php";
23
+        ?>
24 24
 		<script>
25 25
 			var actions = {
26 26
 				delete: function() {
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
 				<p><?= $_lang['tmplvar_inuse'] ?></p>
43 43
 				<ul>
44 44
 					<?php
45
-					while($row = $modx->getDatabase()->getRow($drs)) {
46
-						echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
-					}
48
-					?>
45
+                    while($row = $modx->getDatabase()->getRow($drs)) {
46
+                        echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
+                    }
48
+                    ?>
49 49
 				</ul>
50 50
 			</div>
51 51
 		</div>
52 52
 		<?php
53
-		include_once "footer.inc.php";
54
-		exit;
55
-	}
53
+        include_once "footer.inc.php";
54
+        exit;
55
+    }
56 56
 }
57 57
 
58 58
 // Set the item name for logger
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 // invoke OnBeforeTVFormDelete event
63 63
 $modx->invokeEvent("OnBeforeTVFormDelete", array(
64
-	"id" => $id
64
+    "id" => $id
65 65
 ));
66 66
 
67 67
 // delete variable
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // invoke OnTVFormDelete event
80 80
 $modx->invokeEvent("OnTVFormDelete", array(
81
-	"id" => $id
81
+    "id" => $id
82 82
 ));
83 83
 
84 84
 // empty cache
Please login to merge, or discard this patch.