Completed
Pull Request — develop (#518)
by Agel_Nash
05:24
created
manager/actions/site_schedule.static.php 3 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(IN_MANAGER_MODE != "true") {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 <script type="text/javascript" src="media/script/tablesort.js"></script>
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
 		<div class="form-group" id="lyr1">
18 18
 			<b><?= $_lang["publish_events"] ?></b>
19 19
 			<?php
20
-			$rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
-			$limit = $modx->db->getRecordCount($rs);
22
-			if($limit < 1) {
23
-				?>
20
+            $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
+            $limit = $modx->db->getRecordCount($rs);
22
+            if($limit < 1) {
23
+                ?>
24 24
 				<p><?= $_lang["no_docs_pending_publishing"] ?></p>
25 25
 				<?php
26
-			} else {
27
-				?>
26
+            } else {
27
+                ?>
28 28
 				<div class="table-responsive">
29 29
 					<table class="grid sortabletable" id="table-1">
30 30
 						<thead>
@@ -36,34 +36,34 @@  discard block
 block discarded – undo
36 36
 						</thead>
37 37
 						<tbody>
38 38
 						<?php
39
-						while($row = $modx->db->getRow($rs)) {
40
-							?>
39
+                        while($row = $modx->db->getRow($rs)) {
40
+                            ?>
41 41
 							<tr>
42 42
 								<td class="text-right"><?= $row['id'] ?></td>
43 43
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
44 44
 								<td class="text-nowrap text-right"><?= $modx->toDateFormat($row['pub_date'] + $server_offset_time) ?></td>
45 45
 							</tr>
46 46
 							<?php
47
-						}
48
-						?>
47
+                        }
48
+                        ?>
49 49
 						</tbody>
50 50
 					</table>
51 51
 				</div>
52 52
 				<?php
53
-			}
54
-			?>
53
+            }
54
+            ?>
55 55
 		</div>
56 56
 		<div class="form-group" id="lyr2">
57 57
 			<b><?= $_lang["unpublish_events"] ?></b>
58 58
 			<?php
59
-			$rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
-			$limit = $modx->db->getRecordCount($rs);
61
-			if($limit < 1) {
62
-				?>
59
+            $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
+            $limit = $modx->db->getRecordCount($rs);
61
+            if($limit < 1) {
62
+                ?>
63 63
 				<p><?= $_lang["no_docs_pending_unpublishing"] ?></p>
64 64
 				<?php
65
-			} else {
66
-				?>
65
+            } else {
66
+                ?>
67 67
 				<div class="table-responsive">
68 68
 					<table class="grid sortabletable" id="table-2">
69 69
 						<thead>
@@ -75,34 +75,34 @@  discard block
 block discarded – undo
75 75
 						</thead>
76 76
 						<tbody>
77 77
 						<?php
78
-						while($row = $modx->db->getRow($rs)) {
79
-							?>
78
+                        while($row = $modx->db->getRow($rs)) {
79
+                            ?>
80 80
 							<tr>
81 81
 								<td class="text-right"><?= $row['id'] ?></td>
82 82
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
83 83
 								<td class="text-nowrap text-right"><?= $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td>
84 84
 							</tr>
85 85
 							<?php
86
-						}
87
-						?>
86
+                        }
87
+                        ?>
88 88
 						</tbody>
89 89
 					</table>
90 90
 				</div>
91 91
 				<?php
92
-			}
93
-			?>
92
+            }
93
+            ?>
94 94
 		</div>
95 95
 		<div class="form-group">
96 96
 			<b><?= $_lang["all_events"] ?></b>
97 97
 			<?php
98
-			$rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
-			$limit = $modx->db->getRecordCount($rs);
100
-			if($limit < 1) {
101
-				?>
98
+            $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
+            $limit = $modx->db->getRecordCount($rs);
100
+            if($limit < 1) {
101
+                ?>
102 102
 				<p><?= $_lang["no_docs_pending_pubunpub"] ?></p>
103 103
 				<?php
104
-			} else {
105
-				?>
104
+            } else {
105
+                ?>
106 106
 				<div class="table-responsive">
107 107
 					<table class="grid sortabletable" id="table-3">
108 108
 						<thead>
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 						</thead>
116 116
 						<tbody>
117 117
 						<?php
118
-						while($row = $modx->db->getRow($rs)) {
119
-							?>
118
+                        while($row = $modx->db->getRow($rs)) {
119
+                            ?>
120 120
 							<tr>
121 121
 								<td class="text-right"><?= $row['id'] ?></td>
122 122
 								<td><a href="index.php?a=3&id=<?= $row['id'] ?>"><?= $row['pagetitle'] ?></a></td>
@@ -124,14 +124,14 @@  discard block
 block discarded – undo
124 124
 								<td class="text-nowrap text-right"><?= $row['unpub_date'] == 0 ? "" : $modx->toDateFormat($row['unpub_date'] + $server_offset_time) ?></td>
125 125
 							</tr>
126 126
 							<?php
127
-						}
128
-						?>
127
+                        }
128
+                        ?>
129 129
 						</tbody>
130 130
 					</table>
131 131
 				</div>
132 132
 				<?php
133
-			}
134
-			?>
133
+            }
134
+            ?>
135 135
 		</div>
136 136
 	</div>
137 137
 </div>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('view_eventlog')) {
5
+if (!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
 		<div class="form-group" id="lyr1">
18 18
 			<b><?= $_lang["publish_events"] ?></b>
19 19
 			<?php
20
-			$rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
20
+			$rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC');
21 21
 			$limit = $modx->db->getRecordCount($rs);
22
-			if($limit < 1) {
22
+			if ($limit < 1) {
23 23
 				?>
24 24
 				<p><?= $_lang["no_docs_pending_publishing"] ?></p>
25 25
 				<?php
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 						</thead>
37 37
 						<tbody>
38 38
 						<?php
39
-						while($row = $modx->db->getRow($rs)) {
39
+						while ($row = $modx->db->getRow($rs)) {
40 40
 							?>
41 41
 							<tr>
42 42
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 		<div class="form-group" id="lyr2">
57 57
 			<b><?= $_lang["unpublish_events"] ?></b>
58 58
 			<?php
59
-			$rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
59
+			$rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC');
60 60
 			$limit = $modx->db->getRecordCount($rs);
61
-			if($limit < 1) {
61
+			if ($limit < 1) {
62 62
 				?>
63 63
 				<p><?= $_lang["no_docs_pending_unpublishing"] ?></p>
64 64
 				<?php
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 						</thead>
76 76
 						<tbody>
77 77
 						<?php
78
-						while($row = $modx->db->getRow($rs)) {
78
+						while ($row = $modx->db->getRow($rs)) {
79 79
 							?>
80 80
 							<tr>
81 81
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			<?php
98 98
 			$rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99 99
 			$limit = $modx->db->getRecordCount($rs);
100
-			if($limit < 1) {
100
+			if ($limit < 1) {
101 101
 				?>
102 102
 				<p><?= $_lang["no_docs_pending_pubunpub"] ?></p>
103 103
 				<?php
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 						</thead>
116 116
 						<tbody>
117 117
 						<?php
118
-						while($row = $modx->db->getRow($rs)) {
118
+						while ($row = $modx->db->getRow($rs)) {
119 119
 							?>
120 120
 							<tr>
121 121
 								<td class="text-right"><?= $row['id'] ?></td>
Please login to merge, or discard this patch.
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if(IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('view_eventlog')) {
5
+if(!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 			<?php
20 20
 			$rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21 21
 			$limit = $modx->db->getRecordCount($rs);
22
-			if($limit < 1) {
22
+			if($limit < 1) {
23 23
 				?>
24 24
 				<p><?= $_lang["no_docs_pending_publishing"] ?></p>
25 25
 				<?php
26
-			} else {
26
+			} else {
27 27
 				?>
28 28
 				<div class="table-responsive">
29 29
 					<table class="grid sortabletable" id="table-1">
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 						</thead>
37 37
 						<tbody>
38 38
 						<?php
39
-						while($row = $modx->db->getRow($rs)) {
39
+						while($row = $modx->db->getRow($rs)) {
40 40
 							?>
41 41
 							<tr>
42 42
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 			<?php
59 59
 			$rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60 60
 			$limit = $modx->db->getRecordCount($rs);
61
-			if($limit < 1) {
61
+			if($limit < 1) {
62 62
 				?>
63 63
 				<p><?= $_lang["no_docs_pending_unpublishing"] ?></p>
64 64
 				<?php
65
-			} else {
65
+			} else {
66 66
 				?>
67 67
 				<div class="table-responsive">
68 68
 					<table class="grid sortabletable" id="table-2">
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 						</thead>
76 76
 						<tbody>
77 77
 						<?php
78
-						while($row = $modx->db->getRow($rs)) {
78
+						while($row = $modx->db->getRow($rs)) {
79 79
 							?>
80 80
 							<tr>
81 81
 								<td class="text-right"><?= $row['id'] ?></td>
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 			<?php
98 98
 			$rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99 99
 			$limit = $modx->db->getRecordCount($rs);
100
-			if($limit < 1) {
100
+			if($limit < 1) {
101 101
 				?>
102 102
 				<p><?= $_lang["no_docs_pending_pubunpub"] ?></p>
103 103
 				<?php
104
-			} else {
104
+			} else {
105 105
 				?>
106 106
 				<div class="table-responsive">
107 107
 					<table class="grid sortabletable" id="table-3">
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 						</thead>
116 116
 						<tbody>
117 117
 						<?php
118
-						while($row = $modx->db->getRow($rs)) {
118
+						while($row = $modx->db->getRow($rs)) {
119 119
 							?>
120 120
 							<tr>
121 121
 								<td class="text-right"><?= $row['id'] ?></td>
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 4 patches
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(IN_MANAGER_MODE != "true") {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->manager->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    case 107:
7
+        if(!$modx->hasPermission('new_module')) {
8
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+        }
10
+        break;
11
+    case 108:
12
+        if(!$modx->hasPermission('edit_module')) {
13
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+        }
15
+        break;
16
+    default:
17
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
20 20
 // Get table names (alphabetical)
@@ -30,16 +30,16 @@  discard block
 block discarded – undo
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32 32
 function createGUID() {
33
-	srand((double) microtime() * 1000000);
34
-	$r = rand();
35
-	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
36
-	$m = md5($u);
37
-	return $m;
33
+    srand((double) microtime() * 1000000);
34
+    $r = rand();
35
+    $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
36
+    $m = md5($u);
37
+    return $m;
38 38
 }
39 39
 
40 40
 // check to see the module editor isn't locked
41 41
 if($lockedEl = $modx->elementIsLocked(6, $id)) {
42
-	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
42
+    $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 43
 }
44 44
 // end check for lock
45 45
 
@@ -47,22 +47,22 @@  discard block
 block discarded – undo
47 47
 $modx->lockElement(6, $id);
48 48
 
49 49
 if(isset($_GET['id'])) {
50
-	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51
-	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
53
-		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54
-	}
55
-	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56
-	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59
-	}
50
+    $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51
+    $content = $modx->db->getRow($rs);
52
+    if(!$content) {
53
+        $modx->webAlertAndQuit("Module not found for id '{$id}'.");
54
+    }
55
+    $content['properties'] = str_replace("&", "&amp;", $content['properties']);
56
+    $_SESSION['itemname'] = $content['name'];
57
+    if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
59
+    }
60 60
 } else {
61
-	$_SESSION['itemname'] = $_lang["new_module"];
62
-	$content['wrap'] = '1';
61
+    $_SESSION['itemname'] = $_lang["new_module"];
62
+    $content['wrap'] = '1';
63 63
 }
64 64
 if($modx->manager->hasFormValues()) {
65
-	$modx->manager->loadFormValues();
65
+    $modx->manager->loadFormValues();
66 66
 }
67 67
 
68 68
 // Add lock-element JS-Script
@@ -433,18 +433,18 @@  discard block
 block discarded – undo
433 433
 
434 434
 <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109">
435 435
 	<?php
436
-	// invoke OnModFormPrerender event
437
-	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
439
-		echo implode('', $evtOut);
440
-	}
441
-
442
-	// Prepare internal params & info-tab via parseDocBlock
443
-	$modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : '';
444
-	$docBlock = $modx->parseDocBlockFromString($modulecode);
445
-	$docBlockList = $modx->convertDocBlockIntoList($docBlock);
446
-	$internal = array();
447
-	?>
436
+    // invoke OnModFormPrerender event
437
+    $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
+    if(is_array($evtOut)) {
439
+        echo implode('', $evtOut);
440
+    }
441
+
442
+    // Prepare internal params & info-tab via parseDocBlock
443
+    $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : '';
444
+    $docBlock = $modx->parseDocBlockFromString($modulecode);
445
+    $docBlockList = $modx->convertDocBlockIntoList($docBlock);
446
+    $internal = array();
447
+    ?>
448 448
 	<input type="hidden" name="id" value="<?= $content['id'] ?>">
449 449
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
450 450
 
@@ -497,11 +497,11 @@  discard block
 block discarded – undo
497 497
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
498 498
 								<option>&nbsp;</option>
499 499
 								<?php
500
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503
-								}
504
-								?>
500
+                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
+                                foreach(getCategories() as $n => $v) {
502
+                                    echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503
+                                }
504
+                                ?>
505 505
 							</select>
506 506
 						</div>
507 507
 					</div>
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 							<i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a>
609 609
 					</div>
610 610
 					<?php
611
-					$ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
611
+                    $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name, 
612 612
 					CASE smd.type
613 613
 						WHEN 10 THEN 'Chunk'
614 614
 						WHEN 20 THEN 'Document'
@@ -624,17 +624,17 @@  discard block
 block discarded – undo
624 624
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
625 625
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
626 626
 
627
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
628
-					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629
-					$grd->noRecordMsg = $_lang['no_records_found'];
630
-					$grd->cssClass = 'grid';
631
-					$grd->columnHeaderClass = 'gridHeader';
632
-					$grd->itemClass = 'gridItem';
633
-					$grd->altItemClass = 'gridAltItem';
634
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
635
-					$grd->fields = "name,type";
636
-					echo $grd->render();
637
-					?>
627
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
628
+                    $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629
+                    $grd->noRecordMsg = $_lang['no_records_found'];
630
+                    $grd->cssClass = 'grid';
631
+                    $grd->columnHeaderClass = 'gridHeader';
632
+                    $grd->itemClass = 'gridItem';
633
+                    $grd->altItemClass = 'gridAltItem';
634
+                    $grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
635
+                    $grd->fields = "name,type";
636
+                    echo $grd->render();
637
+                    ?>
638 638
 				</div>
639 639
 			</div>
640 640
 		<?php endif; ?>
@@ -646,12 +646,12 @@  discard block
 block discarded – undo
646 646
 			<div class="container container-body">
647 647
 				<?php if($use_udperms == 1) : ?>
648 648
 					<?php
649
-					// fetch user access permissions for the module
650
-					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651
-					$groupsarray = $modx->db->getColumn('usergroup', $rs);
649
+                    // fetch user access permissions for the module
650
+                    $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651
+                    $groupsarray = $modx->db->getColumn('usergroup', $rs);
652 652
 
653
-					if($modx->hasPermission('access_permissions')) {
654
-						?>
653
+                    if($modx->hasPermission('access_permissions')) {
654
+                        ?>
655 655
 						<!-- User Group Access Permissions -->
656 656
 						<script type="text/javascript">
657 657
 							function makePublic(b) {
@@ -675,28 +675,28 @@  discard block
 block discarded – undo
675 675
 						</script>
676 676
 						<p><?= $_lang['module_group_access_msg'] ?></p>
677 677
 						<?php
678
-					}
679
-					$chk = '';
680
-					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
682
-						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683
-						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
686
-								$notPublic = true;
687
-							}
688
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
-						} else {
690
-							if($checked) {
691
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692
-							}
693
-						}
694
-					}
695
-					if($modx->hasPermission('access_permissions')) {
696
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697
-					}
698
-					echo $chks;
699
-					?>
678
+                    }
679
+                    $chk = '';
680
+                    $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
+                    while($row = $modx->db->getRow($rs)) {
682
+                        $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683
+                        $checked = in_array($row['id'], $groupsarray);
684
+                        if($modx->hasPermission('access_permissions')) {
685
+                            if($checked) {
686
+                                $notPublic = true;
687
+                            }
688
+                            $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
+                        } else {
690
+                            if($checked) {
691
+                                $chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692
+                            }
693
+                        }
694
+                    }
695
+                    if($modx->hasPermission('access_permissions')) {
696
+                        $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697
+                    }
698
+                    echo $chks;
699
+                    ?>
700 700
 				<?php endif; ?>
701 701
 			</div>
702 702
 		</div>
@@ -712,11 +712,11 @@  discard block
 block discarded – undo
712 712
 
713 713
 		<input type="submit" name="save" style="display:none;">
714 714
 		<?php
715
-		// invoke OnModFormRender event
716
-		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
718
-			echo implode('', $evtOut);
719
-		}
720
-		?>
715
+        // invoke OnModFormRender event
716
+        $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
+        if(is_array($evtOut)) {
718
+            echo implode('', $evtOut);
719
+        }
720
+        ?>
721 721
 </form>
722 722
 <script type="text/javascript">setTimeout('showParameters();', 10);</script>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,18 +3,18 @@
 block discarded – undo
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 switch($modx->manager->action) {
6
-	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
8
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
-		}
10
-		break;
11
-	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
13
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
-		}
15
-		break;
16
-	default:
17
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+	    case 107:
7
+		    if(!$modx->hasPermission('new_module')) {
8
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+		    }
10
+		    break;
11
+	    case 108:
12
+		    if(!$modx->hasPermission('edit_module')) {
13
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
14
+		    }
15
+		    break;
16
+	    default:
17
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19 19
 $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
20 20
 // Get table names (alphabetical)
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch ($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if (!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if (!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32
-function createGUID() {
32
+function createGUID(){
33 33
 	srand((double) microtime() * 1000000);
34 34
 	$r = rand();
35
-	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
35
+	$u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1);
36 36
 	$m = md5($u);
37 37
 	return $m;
38 38
 }
39 39
 
40 40
 // check to see the module editor isn't locked
41
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
41
+if ($lockedEl = $modx->elementIsLocked(6, $id)) {
42 42
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 43
 }
44 44
 // end check for lock
@@ -46,29 +46,29 @@  discard block
 block discarded – undo
46 46
 // Lock snippet for other users to edit
47 47
 $modx->lockElement(6, $id);
48 48
 
49
-if(isset($_GET['id'])) {
49
+if (isset($_GET['id'])) {
50 50
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51 51
 	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
52
+	if (!$content) {
53 53
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54 54
 	}
55 55
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56 56
 	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
57
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58 58
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59 59
 	}
60 60
 } else {
61 61
 	$_SESSION['itemname'] = $_lang["new_module"];
62 62
 	$content['wrap'] = '1';
63 63
 }
64
-if($modx->manager->hasFormValues()) {
64
+if ($modx->manager->hasFormValues()) {
65 65
 	$modx->manager->loadFormValues();
66 66
 }
67 67
 
68 68
 // Add lock-element JS-Script
69 69
 $lockElementId = $id;
70 70
 $lockElementType = 6;
71
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
71
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
72 72
 ?>
73 73
 <script type="text/javascript">
74 74
 	function loadDependencies() {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 	function BrowseServer() {
416 416
 		var w = screen.width * 0.7;
417 417
 		var h = screen.height * 0.7;
418
-		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
418
+		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
419 419
 	}
420 420
 
421 421
 	function SetUrl(url, width, height, alt) {
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 	<?php
436 436
 	// invoke OnModFormPrerender event
437 437
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
438
+	if (is_array($evtOut)) {
439 439
 		echo implode('', $evtOut);
440 440
 	}
441 441
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
450 450
 
451 451
 	<h1>
452
-		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
452
+		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
453 453
 	</h1>
454 454
 
455 455
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 						<div class="col-md-9 col-lg-10">
475 475
 							<div class="form-control-name clearfix">
476 476
 								<input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
477
-								<?php if($modx->hasPermission('save_role')): ?>
478
-									<label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip>
477
+								<?php if ($modx->hasPermission('save_role')): ?>
478
+									<label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip>
479 479
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
480 480
 										<i class="fa fa-lock"></i>
481 481
 									</label>
@@ -497,9 +497,9 @@  discard block
 block discarded – undo
497 497
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
498 498
 								<option>&nbsp;</option>
499 499
 								<?php
500
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
500
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
501
+								foreach (getCategories() as $n => $v) {
502
+									echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n";
503 503
 								}
504 504
 								?>
505 505
 							</select>
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 				<div class="form-group">
532 532
 					<div class="form-row">
533 533
 						<label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> />
534
-							<?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label>
534
+							<?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label>
535 535
 					</div>
536 536
 					<div class="form-row">
537 537
 						<label for="parse_docblock">
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 			</div>
597 597
 			<!-- HTML text editor end -->
598 598
 		</div>
599
-		<?php if($modx->manager->action == '108'): ?>
599
+		<?php if ($modx->manager->action == '108'): ?>
600 600
 			<!-- Dependencies -->
601 601
 			<div class="tab-page" id="tabDepend">
602 602
 				<h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2>
@@ -624,14 +624,14 @@  discard block
 block discarded – undo
624 624
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
625 625
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
626 626
 
627
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
627
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
628 628
 					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
629 629
 					$grd->noRecordMsg = $_lang['no_records_found'];
630 630
 					$grd->cssClass = 'grid';
631 631
 					$grd->columnHeaderClass = 'gridHeader';
632 632
 					$grd->itemClass = 'gridItem';
633 633
 					$grd->altItemClass = 'gridAltItem';
634
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
634
+					$grd->columns = $_lang['element_name']." ,".$_lang['type'];
635 635
 					$grd->fields = "name,type";
636 636
 					echo $grd->render();
637 637
 					?>
@@ -644,13 +644,13 @@  discard block
 block discarded – undo
644 644
 			<h2 class="tab"><?= $_lang['access_permissions'] ?></h2>
645 645
 			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
646 646
 			<div class="container container-body">
647
-				<?php if($use_udperms == 1) : ?>
647
+				<?php if ($use_udperms == 1) : ?>
648 648
 					<?php
649 649
 					// fetch user access permissions for the module
650 650
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651 651
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
652 652
 
653
-					if($modx->hasPermission('access_permissions')) {
653
+					if ($modx->hasPermission('access_permissions')) {
654 654
 						?>
655 655
 						<!-- User Group Access Permissions -->
656 656
 						<script type="text/javascript">
@@ -678,22 +678,22 @@  discard block
 block discarded – undo
678 678
 					}
679 679
 					$chk = '';
680 680
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
681
+					while ($row = $modx->db->getRow($rs)) {
682 682
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683 683
 						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
684
+						if ($modx->hasPermission('access_permissions')) {
685
+							if ($checked) {
686 686
 								$notPublic = true;
687 687
 							}
688
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
688
+							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n";
689 689
 						} else {
690
-							if($checked) {
691
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
690
+							if ($checked) {
691
+								$chks = '<input type="hidden" name="usrgroups[]"  value="'.$row['id'].'" />'."\n".$chks;
692 692
 							}
693 693
 						}
694 694
 					}
695
-					if($modx->hasPermission('access_permissions')) {
696
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
695
+					if ($modx->hasPermission('access_permissions')) {
696
+						$chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks;
697 697
 					}
698 698
 					echo $chks;
699 699
 					?>
@@ -714,7 +714,7 @@  discard block
 block discarded – undo
714 714
 		<?php
715 715
 		// invoke OnModFormRender event
716 716
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
717
+		if (is_array($evtOut)) {
718 718
 			echo implode('', $evtOut);
719 719
 		}
720 720
 		?>
Please login to merge, or discard this patch.
Braces   +22 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if(IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-switch($modx->manager->action) {
5
+switch($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if(!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if(!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 // create globally unique identifiers (guid)
32
-function createGUID() {
32
+function createGUID()
33
+{
33 34
 	srand((double) microtime() * 1000000);
34 35
 	$r = rand();
35 36
 	$u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1);
@@ -38,7 +39,7 @@  discard block
 block discarded – undo
38 39
 }
39 40
 
40 41
 // check to see the module editor isn't locked
41
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
42
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
42 43
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
43 44
 }
44 45
 // end check for lock
@@ -46,22 +47,22 @@  discard block
 block discarded – undo
46 47
 // Lock snippet for other users to edit
47 48
 $modx->lockElement(6, $id);
48 49
 
49
-if(isset($_GET['id'])) {
50
+if(isset($_GET['id'])) {
50 51
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
51 52
 	$content = $modx->db->getRow($rs);
52
-	if(!$content) {
53
+	if(!$content) {
53 54
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
54 55
 	}
55 56
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
56 57
 	$_SESSION['itemname'] = $content['name'];
57
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
58 59
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
59 60
 	}
60
-} else {
61
+} else {
61 62
 	$_SESSION['itemname'] = $_lang["new_module"];
62 63
 	$content['wrap'] = '1';
63 64
 }
64
-if($modx->manager->hasFormValues()) {
65
+if($modx->manager->hasFormValues()) {
65 66
 	$modx->manager->loadFormValues();
66 67
 }
67 68
 
@@ -435,7 +436,7 @@  discard block
 block discarded – undo
435 436
 	<?php
436 437
 	// invoke OnModFormPrerender event
437 438
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
438
-	if(is_array($evtOut)) {
439
+	if(is_array($evtOut)) {
439 440
 		echo implode('', $evtOut);
440 441
 	}
441 442
 
@@ -498,7 +499,7 @@  discard block
 block discarded – undo
498 499
 								<option>&nbsp;</option>
499 500
 								<?php
500 501
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
501
-								foreach(getCategories() as $n => $v) {
502
+								foreach(getCategories() as $n => $v) {
502 503
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
503 504
 								}
504 505
 								?>
@@ -650,7 +651,7 @@  discard block
 block discarded – undo
650 651
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
651 652
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
652 653
 
653
-					if($modx->hasPermission('access_permissions')) {
654
+					if($modx->hasPermission('access_permissions')) {
654 655
 						?>
655 656
 						<!-- User Group Access Permissions -->
656 657
 						<script type="text/javascript">
@@ -678,21 +679,21 @@  discard block
 block discarded – undo
678 679
 					}
679 680
 					$chk = '';
680 681
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
681
-					while($row = $modx->db->getRow($rs)) {
682
+					while($row = $modx->db->getRow($rs)) {
682 683
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
683 684
 						$checked = in_array($row['id'], $groupsarray);
684
-						if($modx->hasPermission('access_permissions')) {
685
-							if($checked) {
685
+						if($modx->hasPermission('access_permissions')) {
686
+							if($checked) {
686 687
 								$notPublic = true;
687 688
 							}
688 689
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
689
-						} else {
690
-							if($checked) {
690
+						} else {
691
+							if($checked) {
691 692
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
692 693
 							}
693 694
 						}
694 695
 					}
695
-					if($modx->hasPermission('access_permissions')) {
696
+					if($modx->hasPermission('access_permissions')) {
696 697
 						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
697 698
 					}
698 699
 					echo $chks;
@@ -714,7 +715,7 @@  discard block
 block discarded – undo
714 715
 		<?php
715 716
 		// invoke OnModFormRender event
716 717
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
717
-		if(is_array($evtOut)) {
718
+		if(is_array($evtOut)) {
718 719
 			echo implode('', $evtOut);
719 720
 		}
720 721
 		?>
Please login to merge, or discard this patch.
manager/actions/web_user_management.static.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(IN_MANAGER_MODE != "true") {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('edit_web_user')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // initialize page view state - the $_PAGE object
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 
12 12
 // get and save search string
13 13
 if($_REQUEST['op'] == 'reset') {
14
-	$query = '';
15
-	$_PAGE['vs']['search'] = '';
14
+    $query = '';
15
+    $_PAGE['vs']['search'] = '';
16 16
 } else {
17
-	$query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
-	$sqlQuery = $modx->db->escape($query);
19
-	$_PAGE['vs']['search'] = $query;
17
+    $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search'];
18
+    $sqlQuery = $modx->db->escape($query);
19
+    $_PAGE['vs']['search'] = $query;
20 20
 }
21 21
 
22 22
 // get & save listmode
@@ -120,29 +120,29 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
123
+                    $ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124 124
 			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
-					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
-					$grd->noRecordMsg = $_lang["no_records_found"];
128
-					$grd->cssClass = "table data";
129
-					$grd->columnHeaderClass = "tableHeader";
130
-					$grd->itemClass = "tableItem";
131
-					$grd->altItemClass = "tableAltItem";
132
-					$grd->fields = "id,username,fullname,email,gender,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"];
134
-					$grd->colWidths = "1%,,,,1%,1%";
135
-					$grd->colAligns = "center,,,,center,right' nowrap='nowrap";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>";
137
-					if($listmode == '1') {
138
-						$grd->pageSize = 0;
139
-					}
140
-					if($_REQUEST['op'] == 'reset') {
141
-						$grd->pageNumber = 1;
142
-					}
143
-					// render grid
144
-					echo $grd->render();
145
-					?>
125
+                    include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
126
+                    $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127
+                    $grd->noRecordMsg = $_lang["no_records_found"];
128
+                    $grd->cssClass = "table data";
129
+                    $grd->columnHeaderClass = "tableHeader";
130
+                    $grd->itemClass = "tableItem";
131
+                    $grd->altItemClass = "tableAltItem";
132
+                    $grd->fields = "id,username,fullname,email,gender,blocked";
133
+                    $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"];
134
+                    $grd->colWidths = "1%,,,,1%,1%";
135
+                    $grd->colAligns = "center,,,,center,right' nowrap='nowrap";
136
+                    $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>";
137
+                    if($listmode == '1') {
138
+                        $grd->pageSize = 0;
139
+                    }
140
+                    if($_REQUEST['op'] == 'reset') {
141
+                        $grd->pageNumber = 1;
142
+                    }
143
+                    // render grid
144
+                    echo $grd->render();
145
+                    ?>
146 146
 				</div>
147 147
 			</div>
148 148
 		</div>
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_web_user')) {
5
+if (!$modx->hasPermission('edit_web_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->manager->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124
-			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
123
+					$ds = $modx->db->select("wu.id, wu.username, wua.fullname, wua.email, ELT(wua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users")." wu 
124
+			INNER JOIN " . $modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
126 126
 					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127 127
 					$grd->noRecordMsg = $_lang["no_records_found"];
128 128
 					$grd->cssClass = "table data";
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 					$grd->itemClass = "tableItem";
131 131
 					$grd->altItemClass = "tableAltItem";
132 132
 					$grd->fields = "id,username,fullname,email,gender,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_gender"] . " ," . $_lang["user_block"];
133
+					$grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_gender"]." ,".$_lang["user_block"];
134 134
 					$grd->colWidths = "1%,,,,1%,1%";
135 135
 					$grd->colAligns = "center,,,,center,right' nowrap='nowrap";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>";
137
-					if($listmode == '1') {
136
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='".$_style["icons_user"]."'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>";
137
+					if ($listmode == '1') {
138 138
 						$grd->pageSize = 0;
139 139
 					}
140
-					if($_REQUEST['op'] == 'reset') {
140
+					if ($_REQUEST['op'] == 'reset') {
141 141
 						$grd->pageNumber = 1;
142 142
 					}
143 143
 					// render grid
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']) ? intval($_REQUEST['id']) : 0;
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -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
 function bold($cond = false)
62 62
 {
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
     <input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
479 479
 
480 480
     <h1>
481
-        <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>
481
+        <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>
482 482
     </h1>
483 483
 
484 484
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                             <div class="form-control-name clearfix">
505 505
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
506 506
                                 <?php if ($modx->hasPermission('save_role')): ?>
507
-                                <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip>
507
+                                <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip>
508 508
                                     <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
509 509
                                     <i class="fa fa-lock"></i>
510 510
                                 </label>
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
529 529
                                 <option>&nbsp;</option>
530 530
                                 <?php
531
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
531
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
532 532
                                 foreach (getCategories() as $n => $v) {
533
-                                    echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v["category"]) . "</option>";
533
+                                    echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v["category"])."</option>";
534 534
                                 }
535 535
                                 ?>
536 536
                             </select>
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
                 <?php if ($modx->hasPermission('save_role')): ?>
547 547
                 <div class="form-group">
548 548
                     <div class="form-row">
549
-                        <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>
549
+                        <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>
550 550
                     </div>
551 551
                     <div class="form-row">
552 552
                         <label>
@@ -593,11 +593,11 @@  discard block
 block discarded – undo
593 593
                             <select name="moduleguid" class="form-control" onchange="documentDirty=true;">
594 594
                                 <option>&nbsp;</option>
595 595
                                 <?php
596
-                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules") . " sm 
597
-								INNER JOIN " . $modx->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30
598
-								INNER JOIN " . $modx->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
596
+                                $ds = $modx->db->select('sm.id,sm.name,sm.guid', $modx->getFullTableName("site_modules")." sm 
597
+								INNER JOIN " . $modx->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30
598
+								INNER JOIN " . $modx->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name');
599 599
                                 while ($row = $modx->db->getRow($ds)) {
600
-                                    echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row["name"]) . "</option>";
600
+                                    echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row["name"])."</option>";
601 601
                                 }
602 602
                                 ?>
603 603
                             </select>
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
                                 echoEventRows($evtnames);
659 659
                             }
660 660
                             echo '<hr class="clear">';
661
-                            echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>';
661
+                            echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>';
662 662
                         }
663 663
                         // display group name
664 664
                         if ($grp != $row['groupname']) {
@@ -667,9 +667,9 @@  discard block
 block discarded – undo
667 667
                                 echoEventRows($evtnames);
668 668
                             }
669 669
                             echo '<hr class="clear">';
670
-                            echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>';
670
+                            echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>';
671 671
                         }
672
-                        $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";
672
+                        $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";
673 673
                         if (count($evtnames) == 2) {
674 674
                             echoEventRows($evtnames);
675 675
                         }
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 
682 682
                 function echoEventRows(&$evtnames)
683 683
                 {
684
-                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">' . implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames) . '</div></div>';
684
+                    echo '<div class="row form-row"><div class="col-sm-6 col-md-4 col-lg-3">'.implode('</div><div class="col-sm-6 col-md-4 col-lg-3">', $evtnames).'</div></div>';
685 685
                     $evtnames = array();
686 686
                 }
687 687
 
Please login to merge, or discard this patch.
manager/actions/search.static.php 3 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -113,31 +113,31 @@  discard block
 block discarded – undo
113 113
     // Handle Input "Search in main fields"
114 114
     if ($searchfields != '') {
115 115
 	
116
-		/*start search by TV. Added Rising13*/
117
-		$tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
-		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
-		$articul_result = $modx->db->query($articul_query);
120
-		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
122
-			$articul_id = '';
123
-			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
128
-				}
129
-				$i++;
130
-			}  
131
-		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
133
-			$articul_id_query = '';
134
-		}
135
-		/*end search by TV*/
116
+        /*start search by TV. Added Rising13*/
117
+        $tbl_site_tmplvar_contentvalues = $modx->getFullTableName('site_tmplvar_contentvalues');
118
+        $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119
+        $articul_result = $modx->db->query($articul_query);
120
+        $articul_id_array = $modx->db->makeArray($articul_result);
121
+        if(count($articul_id_array)>0){
122
+            $articul_id = '';
123
+            $i = 1;
124
+            foreach( $articul_id_array as $articul ) {
125
+                $articul_id.=$articul['contentid'];
126
+                if($i !== count($articul_id_array)){
127
+                    $articul_id.=',';
128
+                }
129
+                $i++;
130
+            }  
131
+        $articul_id_query = " OR sc.id IN ({$articul_id})";
132
+        }else{
133
+            $articul_id_query = '';
134
+        }
135
+        /*end search by TV*/
136 136
 		
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+                $sqladd .= $articul_id_query;//search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-			$sqladd .= $articul_id_query;//search by TV
160
+            $sqladd .= $articul_id_query;//search by TV
161 161
         }
162 162
     } else if ($idFromAlias) {
163 163
         $sqladd .= " sc.id='{$idFromAlias}'";
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                         $option[] = '<option value="">No selected</option>';
44 44
                         $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? intval($_REQUEST['templateid']) : '';
45 45
                         $selected = $templateid === 0 ? ' selected="selected"' : '';
46
-                        $option[] = '<option value="0"' . $selected . '>(blank)</option>';
46
+                        $option[] = '<option value="0"'.$selected.'>(blank)</option>';
47 47
                         while ($row = $modx->db->getRow($rs)) {
48 48
                             $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']);
49 49
                             $selected = $row['id'] == $templateid ? ' selected="selected"' : '';
@@ -100,12 +100,12 @@  discard block
 block discarded – undo
100 100
         $friendly_url_suffix = $modx->config['friendly_url_suffix'];
101 101
         $base_url = $modx->config['base_url'];
102 102
         $site_url = $modx->config['site_url'];
103
-        $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url);
103
+        $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url);
104 104
         if ($url[0] === '/') {
105
-            $url = preg_replace('@^' . $base_url . '@', '', $url);
105
+            $url = preg_replace('@^'.$base_url.'@', '', $url);
106 106
         }
107 107
         if (substr($url, 0, 4) === 'http') {
108
-            $url = preg_replace('@^' . $site_url . '@', '', $url);
108
+            $url = preg_replace('@^'.$site_url.'@', '', $url);
109 109
         }
110 110
         $idFromAlias = $modx->getIdFromAlias($url);
111 111
     }
@@ -118,18 +118,18 @@  discard block
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if (count($articul_id_array) > 0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
124
+			foreach ($articul_id_array as $articul) {
125
+				$articul_id .= $articul['contentid'];
126
+				if ($i !== count($articul_id_array)) {
127
+					$articul_id .= ',';
128 128
 				}
129 129
 				$i++;
130 130
 			}  
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+				$sqladd .= $articul_id_query; //search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-			$sqladd .= $articul_id_query;//search by TV
160
+			$sqladd .= $articul_id_query; //search by TV
161 161
         }
162 162
     } else if ($idFromAlias) {
163 163
         $sqladd .= " sc.id='{$idFromAlias}'";
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
         $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
181 181
         $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
182 182
         $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : '';
183
-        $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess';
184
-        $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
183
+        $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess';
184
+        $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
185 185
     }
186 186
 
187 187
     if ($sqladd) {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     $where = $sqladd;
192 192
 
193 193
     if ($where) {
194
-        $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
194
+        $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
195 195
         $limit = $modx->db->getRecordCount($rs);
196 196
     } else {
197 197
         $limit = 0;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                 if ($limit < 1) {
211 211
                     echo $_lang['search_empty'];
212 212
                 } else {
213
-                    printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit);
213
+                    printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit);
214 214
                     ?>
215 215
                     <script type="text/javascript" src="media/script/tablesort.js"></script>
216 216
                     <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1">
@@ -270,14 +270,14 @@  discard block
 block discarded – undo
270 270
                                 if (function_exists('mb_strlen') && function_exists('mb_substr')) {
271 271
                                     ?>
272 272
                                     <td<?= $tdClass ?>>
273
-                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a>
273
+                                        <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a>
274 274
                                     </td>
275
-                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td>
275
+                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td>
276 276
                                     <?php
277 277
                                 } else {
278 278
                                     ?>
279
-                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td>
280
-                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td>
279
+                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td>
280
+                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td>
281 281
                                     <?php
282 282
                                 }
283 283
                                 ?>
@@ -297,115 +297,115 @@  discard block
 block discarded – undo
297 297
                 if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
298 298
                     $docscounts = $modx->db->getRecordCount($rs);
299 299
                     if ($docscounts > 0) {
300
-                        $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>';
300
+                        $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>';
301 301
                         while ($row = $modx->db->getRow($rs)) {
302
-                            $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
302
+                            $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
303 303
                         }
304 304
                     }
305 305
                 }
306 306
 
307 307
                 //templates
308 308
                 if ($modx->hasPermission('edit_template')) {
309
-                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' 
310
-					OR `templatename` like '%" . $searchfields . "%' 
311
-					OR `description` like '%" . $searchfields . "%' 
312
-					OR `content` like '%" . $searchfields . "%'");
309
+                    $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' 
310
+					OR `templatename` like '%" . $searchfields."%' 
311
+					OR `description` like '%" . $searchfields."%' 
312
+					OR `content` like '%" . $searchfields."%'");
313 313
                     $templatecounts = $modx->db->getRecordCount($rs);
314 314
                     if ($templatecounts > 0) {
315
-                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>';
315
+                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>';
316 316
                         while ($row = $modx->db->getRow($rs)) {
317
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
317
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
318 318
                         }
319 319
                     }
320 320
                 }
321 321
 
322 322
                 //tvs
323 323
                 if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
324
-                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' 
325
-					OR `name` like '%" . $searchfields . "%' 
326
-					OR `description` like '%" . $searchfields . "%' 
327
-					OR `type` like '%" . $searchfields . "%' 
328
-					OR `elements` like '%" . $searchfields . "%' 
329
-					OR `display` like '%" . $searchfields . "%' 
330
-					OR `display_params` like '%" . $searchfields . "%' 
331
-					OR `default_text` like '%" . $searchfields . "%'");
324
+                    $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' 
325
+					OR `name` like '%" . $searchfields."%' 
326
+					OR `description` like '%" . $searchfields."%' 
327
+					OR `type` like '%" . $searchfields."%' 
328
+					OR `elements` like '%" . $searchfields."%' 
329
+					OR `display` like '%" . $searchfields."%' 
330
+					OR `display_params` like '%" . $searchfields."%' 
331
+					OR `default_text` like '%" . $searchfields."%'");
332 332
                     $tvscounts = $modx->db->getRecordCount($rs);
333 333
                     if ($tvscounts > 0) {
334
-                        $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>';
334
+                        $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>';
335 335
                         while ($row = $modx->db->getRow($rs)) {
336
-                            $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
336
+                            $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
337 337
                         }
338 338
                     }
339 339
                 }
340 340
 
341 341
                 //Chunks
342 342
                 if ($modx->hasPermission('edit_chunk')) {
343
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' 
344
-					OR `name` like '%" . $searchfields . "%' 
345
-					OR `description` like '%" . $searchfields . "%'     
346
-					OR `snippet` like '%" . $searchfields . "%'");
343
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' 
344
+					OR `name` like '%" . $searchfields."%' 
345
+					OR `description` like '%" . $searchfields."%'     
346
+					OR `snippet` like '%" . $searchfields."%'");
347 347
                     $chunkscounts = $modx->db->getRecordCount($rs);
348 348
                     if ($chunkscounts > 0) {
349
-                        $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>';
349
+                        $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>';
350 350
                         while ($row = $modx->db->getRow($rs)) {
351
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
351
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
352 352
                         }
353 353
                     }
354 354
                 }
355 355
 
356 356
                 //Snippets
357 357
                 if ($modx->hasPermission('edit_snippet')) {
358
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' 
359
-					OR `name` like '%" . $searchfields . "%' 
360
-					OR `description` like '%" . $searchfields . "%' 
361
-					OR `snippet` like '%" . $searchfields . "%'  
362
-					OR `properties` like '%" . $searchfields . "%'      
363
-					OR `moduleguid` like '%" . $searchfields . "%'");
358
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' 
359
+					OR `name` like '%" . $searchfields."%' 
360
+					OR `description` like '%" . $searchfields."%' 
361
+					OR `snippet` like '%" . $searchfields."%'  
362
+					OR `properties` like '%" . $searchfields."%'      
363
+					OR `moduleguid` like '%" . $searchfields."%'");
364 364
                     $snippetscounts = $modx->db->getRecordCount($rs);
365 365
                     if ($snippetscounts > 0) {
366
-                        $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>';
366
+                        $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>';
367 367
                         while ($row = $modx->db->getRow($rs)) {
368
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
368
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
369 369
                         }
370 370
                     }
371 371
                 }
372 372
 
373 373
                 //plugins
374 374
                 if ($modx->hasPermission('edit_plugin')) {
375
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' 
376
-					OR `name` like '%" . $searchfields . "%' 
377
-					OR `description` like '%" . $searchfields . "%' 
378
-					OR `plugincode` like '%" . $searchfields . "%'  
379
-					OR `properties` like '%" . $searchfields . "%'      
380
-					OR `moduleguid` like '%" . $searchfields . "%'");
375
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' 
376
+					OR `name` like '%" . $searchfields."%' 
377
+					OR `description` like '%" . $searchfields."%' 
378
+					OR `plugincode` like '%" . $searchfields."%'  
379
+					OR `properties` like '%" . $searchfields."%'      
380
+					OR `moduleguid` like '%" . $searchfields."%'");
381 381
                     $pluginscounts = $modx->db->getRecordCount($rs);
382 382
                     if ($pluginscounts > 0) {
383
-                        $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>';
383
+                        $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>';
384 384
                         while ($row = $modx->db->getRow($rs)) {
385
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
385
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
386 386
                         }
387 387
                     }
388 388
                 }
389 389
 
390 390
                 //modules
391 391
                 if ($modx->hasPermission('edit_module')) {
392
-                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' 
393
-                    OR `name` like '%" . $searchfields . "%' 
394
-                    OR `description` like '%" . $searchfields . "%' 
395
-                    OR `modulecode` like '%" . $searchfields . "%'  
396
-                    OR `properties` like '%" . $searchfields . "%'  
397
-                    OR `guid` like '%" . $searchfields . "%'      
398
-                    OR `resourcefile` like '%" . $searchfields . "%'");
392
+                    $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' 
393
+                    OR `name` like '%" . $searchfields."%' 
394
+                    OR `description` like '%" . $searchfields."%' 
395
+                    OR `modulecode` like '%" . $searchfields."%'  
396
+                    OR `properties` like '%" . $searchfields."%'  
397
+                    OR `guid` like '%" . $searchfields."%'      
398
+                    OR `resourcefile` like '%" . $searchfields."%'");
399 399
                     $modulescounts = $modx->db->getRecordCount($rs);
400 400
                     if ($modulescounts > 0) {
401
-                        $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>';
401
+                        $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>';
402 402
                         while ($row = $modx->db->getRow($rs)) {
403
-                            $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>';
403
+                            $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>';
404 404
                         }
405 405
                     }
406 406
                 }
407 407
 
408
-                echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1';
408
+                echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1';
409 409
             }
410 410
 
411 411
             ?>
@@ -416,13 +416,13 @@  discard block
 block discarded – undo
416 416
 
417 417
 function highlightingCoincidence($text, $search)
418 418
 {
419
-    $regexp = '!(' . str_replace(array(
419
+    $regexp = '!('.str_replace(array(
420 420
             '(',
421 421
             ')'
422 422
         ), array(
423 423
             '\(',
424 424
             '\)'
425
-        ), trim($search)) . ')!isu';
425
+        ), trim($search)).')!isu';
426 426
     return preg_replace($regexp, '<span class="text-danger">$1</span>', $text);
427 427
 }
428 428
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
         $class .= ' deleted';
440 440
     }
441 441
     if ($class) {
442
-        $class = ' class="' . trim($class) . '"';
442
+        $class = ' class="'.trim($class).'"';
443 443
     }
444 444
     return $class;
445 445
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -118,18 +118,18 @@
 block discarded – undo
118 118
 		$articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'";
119 119
 		$articul_result = $modx->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if(count($articul_id_array)>0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124 124
 			foreach( $articul_id_array as $articul ) {
125 125
 				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
126
+				if($i !== count($articul_id_array)) {
127 127
 					$articul_id.=',';
128 128
 				}
129 129
 				$i++;
130 130
 			}  
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
Please login to merge, or discard this patch.
manager/actions/mutate_plugin_priority.dynamic.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $updateMsg = '';
12 12
 
13 13
 if (isset($_POST['listSubmitted'])) {
14
-    $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>';
14
+    $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>';
15 15
     $tbl = $modx->getFullTableName('site_plugin_events');
16 16
 
17 17
     foreach ($_POST as $listName => $listValue) {
@@ -34,9 +34,9 @@  discard block
 block discarded – undo
34 34
     $modx->clearCache('full');
35 35
 }
36 36
 
37
-$rs = $modx->db->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames') . " sysevt
38
-		INNER JOIN " . $modx->getFullTableName('site_plugin_events') . " pe ON pe.evtid = sysevt.id
39
-		INNER JOIN " . $modx->getFullTableName('site_plugins') . " plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority');
37
+$rs = $modx->db->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames')." sysevt
38
+		INNER JOIN " . $modx->getFullTableName('site_plugin_events')." pe ON pe.evtid = sysevt.id
39
+		INNER JOIN " . $modx->getFullTableName('site_plugins')." plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority');
40 40
 
41 41
 $insideUl = 0;
42 42
 $preEvt = '';
@@ -47,17 +47,17 @@  discard block
 block discarded – undo
47 47
     if ($preEvt !== $plugins['evtid']) {
48 48
         $sortables[] = $plugins['evtid'];
49 49
         $sortableList .= $insideUl ? '</ul></div>' : '';
50
-        $sortableList .= '<div class="form-group clearfix"><strong>' . $plugins['evtname'] . '</strong><ul id="' . $plugins['evtid'] . '" class="sortableList">';
50
+        $sortableList .= '<div class="form-group clearfix"><strong>'.$plugins['evtname'].'</strong><ul id="'.$plugins['evtid'].'" class="sortableList">';
51 51
         $insideUl = 1;
52 52
     }
53
-    $sortableList .= '<li id="item_' . $plugins['pluginid'] . '"' . ($plugins['disabled'] ? ' class="disabledPlugin"' : '') . '><i class="fa fa-plug"></i> ' . $plugins['name'] . ($plugins['disabled'] ? ' (hide)' : '') . '</li>';
53
+    $sortableList .= '<li id="item_'.$plugins['pluginid'].'"'.($plugins['disabled'] ? ' class="disabledPlugin"' : '').'><i class="fa fa-plug"></i> '.$plugins['name'].($plugins['disabled'] ? ' (hide)' : '').'</li>';
54 54
     $preEvt = $plugins['evtid'];
55 55
 }
56 56
 if ($insideUl) {
57 57
     $sortableList .= '</ul></div>';
58 58
 }
59 59
 
60
-require_once(MODX_MANAGER_PATH . 'includes/header.inc.php');
60
+require_once(MODX_MANAGER_PATH.'includes/header.inc.php');
61 61
 ?>
62 62
 
63 63
 <script type="text/javascript">
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/Module_Categories_Manager.php 2 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Class for MODx Categories Manager
4 4
  */
5
-if( !is_object( $modx )
6
-    || $modx->isBackend() === false )
5
+if (!is_object($modx)
6
+    || $modx->isBackend() === false)
7 7
 {
8 8
     die('Please use the MODx Backend.');
9 9
 }
10 10
 
11
-require_once realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'Categories.php';
11
+require_once realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Categories.php';
12 12
 
13 13
 class Module_Categories_Manager extends Categories
14 14
 {
@@ -37,19 +37,19 @@  discard block
 block discarded – undo
37 37
      * @return  mixed           return the parameter value if exists, otherwise false
38 38
      * @param   string  $key    Paramter-key
39 39
      */
40
-    function get( $key )
40
+    function get($key)
41 41
     {
42 42
         global $modx;
43 43
         
44
-        if( isset( $this->params[$key] ) )
44
+        if (isset($this->params[$key]))
45 45
         {
46 46
             return $this->params[$key];
47 47
         }
48
-        elseif( isset( $modx->config[$key] ) )
48
+        elseif (isset($modx->config[$key]))
49 49
         {
50 50
             return $modx->config[$key];
51 51
         }
52
-        elseif( isset( $modx->event->params[$key] ) )
52
+        elseif (isset($modx->event->params[$key]))
53 53
         {
54 54
             return $modx->event->params[$key];
55 55
         }
@@ -57,15 +57,15 @@  discard block
 block discarded – undo
57 57
     }
58 58
 
59 59
     
60
-    function addMessage( $message, $namespace = 'default' )
60
+    function addMessage($message, $namespace = 'default')
61 61
     {
62 62
         $this->params['messages'][$namespace][] = $message;   
63 63
     }
64 64
 
65 65
 
66
-    function getMessages( $namespace = 'default' )
66
+    function getMessages($namespace = 'default')
67 67
     {
68
-        if( isset( $this->params['messages'][$namespace] ) )
68
+        if (isset($this->params['messages'][$namespace]))
69 69
         {
70 70
             return $this->params['messages'][$namespace];
71 71
         }
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
     }
74 74
 
75 75
 
76
-    function renderView( $view_name, $data = array() )
76
+    function renderView($view_name, $data = array())
77 77
     {
78 78
         global $_lang, $_style;
79 79
     
80
-        $filename = trim( $view_name ) . '.tpl.phtml';
81
-        $file     = self::get('views_dir') . $filename;
80
+        $filename = trim($view_name).'.tpl.phtml';
81
+        $file     = self::get('views_dir').$filename;
82 82
         $view     = & $this;
83 83
 
84
-        if( is_file( $file ) 
85
-            && is_readable( $file ) )
84
+        if (is_file($file) 
85
+            && is_readable($file))
86 86
         {
87 87
             include $file;
88 88
         }
@@ -96,21 +96,21 @@  discard block
 block discarded – undo
96 96
         }
97 97
     }
98 98
 
99
-    function updateElement( $element, $element_id, $category_id )
99
+    function updateElement($element, $element_id, $category_id)
100 100
     {
101 101
  
102 102
         $_update = array(
103
-            'id'       => (int)$element_id,
104
-            'category' => (int)$category_id
103
+            'id'       => (int) $element_id,
104
+            'category' => (int) $category_id
105 105
         );
106 106
 
107 107
         $this->db->update(
108 108
             $_update,
109 109
             $this->db_tbl[$element],
110
-            "`id` = '" . (int)$element_id . "'"
110
+            "`id` = '".(int) $element_id."'"
111 111
         );
112 112
 
113
-        if( $this->db->getAffectedRows() === 1 )
113
+        if ($this->db->getAffectedRows() === 1)
114 114
         {
115 115
             return true;
116 116
         }
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
     }
119 119
 
120 120
 
121
-    function txt( $txt )
121
+    function txt($txt)
122 122
     {
123 123
         global $_lang;
124
-        if(isset($_lang[$txt])) return $_lang[$txt];
124
+        if (isset($_lang[$txt])) return $_lang[$txt];
125 125
         return $txt;
126 126
     }
127 127
 }
128 128
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +11 added lines, -20 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@  discard block
 block discarded – undo
3 3
  * Class for MODx Categories Manager
4 4
  */
5 5
 if( !is_object( $modx )
6
-    || $modx->isBackend() === false )
7
-{
6
+    || $modx->isBackend() === false ) {
8 7
     die('Please use the MODx Backend.');
9 8
 }
10 9
 
@@ -41,16 +40,11 @@  discard block
 block discarded – undo
41 40
     {
42 41
         global $modx;
43 42
         
44
-        if( isset( $this->params[$key] ) )
45
-        {
43
+        if( isset( $this->params[$key] ) ) {
46 44
             return $this->params[$key];
47
-        }
48
-        elseif( isset( $modx->config[$key] ) )
49
-        {
45
+        } elseif( isset( $modx->config[$key] ) ) {
50 46
             return $modx->config[$key];
51
-        }
52
-        elseif( isset( $modx->event->params[$key] ) )
53
-        {
47
+        } elseif( isset( $modx->event->params[$key] ) ) {
54 48
             return $modx->event->params[$key];
55 49
         }
56 50
         return false;
@@ -65,8 +59,7 @@  discard block
 block discarded – undo
65 59
 
66 60
     function getMessages( $namespace = 'default' )
67 61
     {
68
-        if( isset( $this->params['messages'][$namespace] ) )
69
-        {
62
+        if( isset( $this->params['messages'][$namespace] ) ) {
70 63
             return $this->params['messages'][$namespace];
71 64
         }
72 65
         return false;
@@ -82,12 +75,9 @@  discard block
 block discarded – undo
82 75
         $view     = & $this;
83 76
 
84 77
         if( is_file( $file ) 
85
-            && is_readable( $file ) )
86
-        {
78
+            && is_readable( $file ) ) {
87 79
             include $file;
88
-        }
89
-        else
90
-        {
80
+        } else {
91 81
             echo sprintf(
92 82
                 'View "%s<strong>%s</strong>" not found.',
93 83
                 self::get('views_dir'), 
@@ -110,8 +100,7 @@  discard block
 block discarded – undo
110 100
             "`id` = '" . (int)$element_id . "'"
111 101
         );
112 102
 
113
-        if( $this->db->getAffectedRows() === 1 )
114
-        {
103
+        if( $this->db->getAffectedRows() === 1 ) {
115 104
             return true;
116 105
         }
117 106
         return false;
@@ -121,7 +110,9 @@  discard block
 block discarded – undo
121 110
     function txt( $txt )
122 111
     {
123 112
         global $_lang;
124
-        if(isset($_lang[$txt])) return $_lang[$txt];
113
+        if(isset($_lang[$txt])) {
114
+            return $_lang[$txt];
115
+        }
125 116
         return $txt;
126 117
     }
127 118
 }
128 119
\ No newline at end of file
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/Categories.php 2 patches
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 {
7 7
     var $db       = '';
8 8
     var $db_tbl   = array();    
9
-    var $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' );
9
+    var $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules');
10 10
 
11 11
     function __construct()
12 12
     {
@@ -15,9 +15,9 @@  discard block
 block discarded – undo
15 15
         $this->db                   = & $modx->db;
16 16
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
17 17
         
18
-        foreach( $this->elements as $element )
18
+        foreach ($this->elements as $element)
19 19
         {
20
-            $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element );
20
+            $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element);
21 21
         }
22 22
     }
23 23
 
@@ -37,44 +37,44 @@  discard block
 block discarded – undo
37 37
             )
38 38
         );
39 39
 
40
-        if( !empty( $categories ) )
40
+        if (!empty($categories))
41 41
         {
42 42
             return $categories;
43 43
         }
44 44
         return false;
45 45
     }
46 46
 
47
-    function getCategory( $search, $where = 'category' )
47
+    function getCategory($search, $where = 'category')
48 48
     {
49 49
         $category = $this->db->getRow(
50 50
             $this->db->select(
51 51
                 '*',
52 52
                 $this->db_tbl['categories'],
53
-                "`" . $where . "` = '" . $search . "'"
53
+                "`".$where."` = '".$search."'"
54 54
             )
55 55
         );
56 56
         return $category;
57 57
     }
58 58
 
59
-    function getCategoryValue( $value, $search, $where = 'category' )
59
+    function getCategoryValue($value, $search, $where = 'category')
60 60
     {
61 61
         $_value = $this->db->getValue(
62 62
             $this->db->select(
63
-                '`' . $value . '`',
63
+                '`'.$value.'`',
64 64
                 $this->db_tbl['categories'],
65
-                "`" . $where . "` = '" . $search . "'"
65
+                "`".$where."` = '".$search."'"
66 66
             )
67 67
         );
68 68
         return $_value;
69 69
     }
70 70
 
71
-    function getAssignedElements( $category_id, $element )
71
+    function getAssignedElements($category_id, $element)
72 72
     {
73
-        if( in_array( $element, $this->elements, true ) )
73
+        if (in_array($element, $this->elements, true))
74 74
         {
75 75
             
76 76
             $fields = '`name`,`description`';
77
-            if( $element === 'templates' )
77
+            if ($element === 'templates')
78 78
             {
79 79
                 $fields = '`templatename`,`description`';
80 80
             }
@@ -85,15 +85,15 @@  discard block
 block discarded – undo
85 85
                 $this->db->select( 
86 86
                     $fields,
87 87
                     $this->db_tbl[$element],
88
-                    "`category` = '" . $category_id . "'"
88
+                    "`category` = '".$category_id."'"
89 89
                 )
90 90
             );
91 91
             
92 92
             // correct the name of templates
93
-            if( $element === 'templates' )
93
+            if ($element === 'templates')
94 94
             {
95 95
                 $_elements_count = count($elements);
96
-                for( $i=0; $i < $_elements_count; $i++ )
96
+                for ($i = 0; $i < $_elements_count; $i++)
97 97
                 {
98 98
                     $elements[$i]['name'] = $elements[$i]['templatename'];
99 99
                 }
@@ -103,60 +103,60 @@  discard block
 block discarded – undo
103 103
         return false;
104 104
     }
105 105
 
106
-    function getAllAssignedElements( $category_id )
106
+    function getAllAssignedElements($category_id)
107 107
     {
108 108
         $elements = array();
109
-        foreach( $this->elements as $element )
109
+        foreach ($this->elements as $element)
110 110
         {
111
-            $elements[$element] = $this->getAssignedElements( $category_id, $element );
111
+            $elements[$element] = $this->getAssignedElements($category_id, $element);
112 112
         }
113 113
         return $elements;
114 114
     }
115 115
 
116
-    function deleteCategory( $category_id )
116
+    function deleteCategory($category_id)
117 117
     {
118 118
         $_update = array('category' => 0);
119
-        foreach( $this->elements as $element )
119
+        foreach ($this->elements as $element)
120 120
         {
121 121
             $this->db->update(
122 122
                 $_update,
123 123
                 $this->db_tbl[$element],
124
-                "`category` = '" . $category_id . "'"
124
+                "`category` = '".$category_id."'"
125 125
             );
126 126
         }
127 127
         
128 128
         $this->db->delete(
129 129
             $this->db_tbl['categories'],
130
-            "`id` = '" . $category_id . "'"
130
+            "`id` = '".$category_id."'"
131 131
         );
132 132
         
133
-        if( $this->db->getAffectedRows() === 1 )
133
+        if ($this->db->getAffectedRows() === 1)
134 134
         {
135 135
             return true;    
136 136
         }
137 137
         return false;
138 138
     }
139 139
 
140
-    function updateCategory( $category_id, $data = array() )
140
+    function updateCategory($category_id, $data = array())
141 141
     {
142
-        if( empty( $data )
143
-            || empty( $category_id ) )
142
+        if (empty($data)
143
+            || empty($category_id))
144 144
         {
145 145
             return false;
146 146
         }
147 147
         
148 148
         $_update = array(
149
-            'category' => $this->db->escape( $data['category'] ),
150
-            'rank'     => (int)$data['rank']
149
+            'category' => $this->db->escape($data['category']),
150
+            'rank'     => (int) $data['rank']
151 151
         );
152 152
 
153 153
         $this->db->update(
154 154
             $_update,
155 155
             $this->db_tbl['categories'],
156
-            "`id` = '" . (int)$category_id . "'"
156
+            "`id` = '".(int) $category_id."'"
157 157
         );
158 158
 
159
-        if( $this->db->getAffectedRows() === 1 )
159
+        if ($this->db->getAffectedRows() === 1)
160 160
         {
161 161
             return true;
162 162
         }
@@ -164,16 +164,16 @@  discard block
 block discarded – undo
164 164
         return false;
165 165
     }
166 166
 
167
-    function addCategory( $category_name, $category_rank )
167
+    function addCategory($category_name, $category_rank)
168 168
     {
169
-        if( $this->isCategoryExists( $category_name ) )
169
+        if ($this->isCategoryExists($category_name))
170 170
         {
171 171
             return false;
172 172
         }
173 173
 
174 174
         $_insert = array(
175
-            'category' => $this->db->escape( $category_name ),
176
-            'rank'     => (int)$category_rank
175
+            'category' => $this->db->escape($category_name),
176
+            'rank'     => (int) $category_rank
177 177
         );
178 178
         
179 179
         $this->db->insert(
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             $this->db_tbl['categories']
182 182
         );
183 183
         
184
-        if( $this->db->getAffectedRows() === 1 )
184
+        if ($this->db->getAffectedRows() === 1)
185 185
         {
186 186
             return $this->db->getInsertId();
187 187
         }
@@ -190,19 +190,19 @@  discard block
 block discarded – undo
190 190
         return false;
191 191
     }
192 192
 
193
-    function isCategoryExists( $category_name )
193
+    function isCategoryExists($category_name)
194 194
     {
195
-        $category = $this->db->escape( $category_name );
195
+        $category = $this->db->escape($category_name);
196 196
 
197 197
         $category_id = $this->db->getValue(
198 198
             $this->db->select(
199 199
                 '`id`',
200 200
                 $this->db_tbl['categories'],
201
-                "`category` = '" . $category . "'"
201
+                "`category` = '".$category."'"
202 202
             )
203 203
         );
204 204
         
205
-        if( $this->db->getAffectedRows() === 1 )
205
+        if ($this->db->getAffectedRows() === 1)
206 206
         {
207 207
             return $category_id;
208 208
         }
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
         $this->db                   = & $modx->db;
16 16
         $this->db_tbl['categories'] = $modx->getFullTableName('categories');
17 17
         
18
-        foreach( $this->elements as $element )
19
-        {
18
+        foreach( $this->elements as $element ) {
20 19
             $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element );
21 20
         }
22 21
     }
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
             )
38 37
         );
39 38
 
40
-        if( !empty( $categories ) )
41
-        {
39
+        if( !empty( $categories ) ) {
42 40
             return $categories;
43 41
         }
44 42
         return false;
@@ -70,12 +68,10 @@  discard block
 block discarded – undo
70 68
 
71 69
     function getAssignedElements( $category_id, $element )
72 70
     {
73
-        if( in_array( $element, $this->elements, true ) )
74
-        {
71
+        if( in_array( $element, $this->elements, true ) ) {
75 72
             
76 73
             $fields = '`name`,`description`';
77
-            if( $element === 'templates' )
78
-            {
74
+            if( $element === 'templates' ) {
79 75
                 $fields = '`templatename`,`description`';
80 76
             }
81 77
             
@@ -90,11 +86,9 @@  discard block
 block discarded – undo
90 86
             );
91 87
             
92 88
             // correct the name of templates
93
-            if( $element === 'templates' )
94
-            {
89
+            if( $element === 'templates' ) {
95 90
                 $_elements_count = count($elements);
96
-                for( $i=0; $i < $_elements_count; $i++ )
97
-                {
91
+                for( $i=0; $i < $_elements_count; $i++ ) {
98 92
                     $elements[$i]['name'] = $elements[$i]['templatename'];
99 93
                 }
100 94
             }
@@ -106,8 +100,7 @@  discard block
 block discarded – undo
106 100
     function getAllAssignedElements( $category_id )
107 101
     {
108 102
         $elements = array();
109
-        foreach( $this->elements as $element )
110
-        {
103
+        foreach( $this->elements as $element ) {
111 104
             $elements[$element] = $this->getAssignedElements( $category_id, $element );
112 105
         }
113 106
         return $elements;
@@ -116,8 +109,7 @@  discard block
 block discarded – undo
116 109
     function deleteCategory( $category_id )
117 110
     {
118 111
         $_update = array('category' => 0);
119
-        foreach( $this->elements as $element )
120
-        {
112
+        foreach( $this->elements as $element ) {
121 113
             $this->db->update(
122 114
                 $_update,
123 115
                 $this->db_tbl[$element],
@@ -130,8 +122,7 @@  discard block
 block discarded – undo
130 122
             "`id` = '" . $category_id . "'"
131 123
         );
132 124
         
133
-        if( $this->db->getAffectedRows() === 1 )
134
-        {
125
+        if( $this->db->getAffectedRows() === 1 ) {
135 126
             return true;    
136 127
         }
137 128
         return false;
@@ -140,8 +131,7 @@  discard block
 block discarded – undo
140 131
     function updateCategory( $category_id, $data = array() )
141 132
     {
142 133
         if( empty( $data )
143
-            || empty( $category_id ) )
144
-        {
134
+            || empty( $category_id ) ) {
145 135
             return false;
146 136
         }
147 137
         
@@ -156,8 +146,7 @@  discard block
 block discarded – undo
156 146
             "`id` = '" . (int)$category_id . "'"
157 147
         );
158 148
 
159
-        if( $this->db->getAffectedRows() === 1 )
160
-        {
149
+        if( $this->db->getAffectedRows() === 1 ) {
161 150
             return true;
162 151
         }
163 152
 
@@ -166,8 +155,7 @@  discard block
 block discarded – undo
166 155
 
167 156
     function addCategory( $category_name, $category_rank )
168 157
     {
169
-        if( $this->isCategoryExists( $category_name ) )
170
-        {
158
+        if( $this->isCategoryExists( $category_name ) ) {
171 159
             return false;
172 160
         }
173 161
 
@@ -181,8 +169,7 @@  discard block
 block discarded – undo
181 169
             $this->db_tbl['categories']
182 170
         );
183 171
         
184
-        if( $this->db->getAffectedRows() === 1 )
185
-        {
172
+        if( $this->db->getAffectedRows() === 1 ) {
186 173
             return $this->db->getInsertId();
187 174
         }
188 175
 
@@ -202,8 +189,7 @@  discard block
 block discarded – undo
202 189
             )
203 190
         );
204 191
         
205
-        if( $this->db->getAffectedRows() === 1 )
206
-        {
192
+        if( $this->db->getAffectedRows() === 1 ) {
207 193
             return $category_id;
208 194
         }
209 195
         return false;
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/request_trigger.inc.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
             
22 22
             if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23 23
             { 
24
-               $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
24
+                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
             
27 27
             foreach( $cm->getCategories() as $category )
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 
107 107
     if( empty( $category ) )
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
-       return;
109
+        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
+        return;
111 111
     }
112 112
 
113 113
     if( $cm->isCategoryExists( $category ) )
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); 
116
-       return;
115
+        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); 
116
+        return;
117 117
     }
118 118
     
119 119
     if( $cm->addCategory( $category, $rank ) !== 0 )
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
 
288 288
     if( empty( $cm->new_translations ) )
289 289
     {   
290
-       //$_REQUEST['webfxtab_manage-categories-pane'] = 0;
291
-       // unset( $_COOKIE['webfxtab_manage-categories-pane'] );
292
-       // setcookie('webfxtab_manage-categories-pane', 0);
290
+        //$_REQUEST['webfxtab_manage-categories-pane'] = 0;
291
+        // unset( $_COOKIE['webfxtab_manage-categories-pane'] );
292
+        // setcookie('webfxtab_manage-categories-pane', 0);
293 293
     }
294 294
 }
295 295
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Ajax Requests
4 4
  */
5
-if(IN_MANAGER_MODE != "true") {
5
+if (IN_MANAGER_MODE != "true") {
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
9
+if (isset($_REQUEST[$cm->get('request_key')]['ajax']))
10 10
 {
11 11
     $_data  = $_REQUEST[$cm->get('request_key')];
12 12
     $output = '';
13 13
     $task   = $_data['task'];
14
-    switch( $task )
14
+    switch ($task)
15 15
     {
16 16
         /**
17 17
          * get categories
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
         case 'categorize_load_elements':
20 20
             $elements = $_data['elements'];
21 21
             
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
22
+            if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements']))
23 23
             { 
24 24
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
             
27
-            foreach( $cm->getCategories() as $category )
27
+            foreach ($cm->getCategories() as $category)
28 28
             {
29
-                $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
29
+                $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']);
30 30
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 31
             }            
32 32
             break;
33 33
     }
34
-    exit( $output );
34
+    exit($output);
35 35
 }
36 36
 /**
37 37
  * Categorize elements
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 
42 42
  * 
43 43
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
44
+if (isset($_POST[$cm->get('request_key')]['categorize']['submit']))
45 45
 {  
46 46
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 47
     $_changes = 0;
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         'categorize'
55 55
     );
56 56
     
57
-    if( !isset( $_data['elements'] ) )
57
+    if (!isset($_data['elements']))
58 58
     {
59
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
59
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize');
60 60
         return;
61 61
     }
62 62
 
63
-    foreach( $_data['elements'] as $element_id => $data )
63
+    foreach ($_data['elements'] as $element_id => $data)
64 64
     {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
65
+        if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id']))
66 66
         {
67 67
             $cm->addMessage(
68 68
                 sprintf( 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         }
79 79
     }
80 80
     
81
-    if( $_changes === 0 )
81
+    if ($_changes === 0)
82 82
     {
83
-        $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
83
+        $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize');
84 84
         return;
85 85
     }
86 86
     else
@@ -98,29 +98,29 @@  discard block
 block discarded – undo
98 98
 /**
99 99
  * Add a new category
100 100
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
101
+if (isset($_POST[$cm->get('request_key')]['add']['submit']))
102 102
 {
103 103
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104
-    $category = trim( html_entity_decode($_data['name']) );
104
+    $category = trim(html_entity_decode($_data['name']));
105 105
     $rank     = (int) $_data['rank'];
106 106
 
107
-    if( empty( $category ) )
107
+    if (empty($category))
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
109
+       $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add');
110 110
        return;
111 111
     }
112 112
 
113
-    if( $cm->isCategoryExists( $category ) )
113
+    if ($cm->isCategoryExists($category))
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); 
115
+       $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); 
116 116
        return;
117 117
     }
118 118
     
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
119
+    if ($cm->addCategory($category, $rank) !== 0)
120 120
     {
121 121
         $cm->addMessage(
122 122
             sprintf( 
123
-                $cm->txt( 'cm_category_x_saved_at_position_y' ),
123
+                $cm->txt('cm_category_x_saved_at_position_y'),
124 124
                 $category,
125 125
                 $rank
126 126
             ),
@@ -129,26 +129,26 @@  discard block
 block discarded – undo
129 129
     }
130 130
     else
131 131
     {
132
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
132
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'add');
133 133
     }    
134 134
 }
135 135
 
136 136
 /**
137 137
  * Sort categories
138 138
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
139
+if (isset($_POST[$cm->get('request_key')]['sort']['submit']))
140 140
 {
141 141
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 142
     $_changes   = 0;
143 143
     
144
-    foreach( $categories as $category_id => $_data  ) 
144
+    foreach ($categories as $category_id => $_data) 
145 145
     {
146 146
         $data = array(
147
-            'category' => urldecode( $_data['category'] ),
147
+            'category' => urldecode($_data['category']),
148 148
             'rank'     => $_data['rank']
149 149
         );
150 150
         
151
-        if( $cm->updateCategory( $category_id, $data ) )
151
+        if ($cm->updateCategory($category_id, $data))
152 152
         {
153 153
             $cm->addMessage(
154 154
                 sprintf( 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
         
165
-    if( $_changes === 0 )
165
+    if ($_changes === 0)
166 166
     {
167
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
167
+        $cm->addMessage($cm->txt('cm_no_changes'), 'sort');
168 168
     }
169 169
     else
170 170
     {
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 /**
182 182
  * Edit categories
183 183
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
184
+if (isset($_POST[$cm->get('request_key')]['edit']['submit']))
185 185
 {
186 186
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 187
     $_changes   = 0;
188 188
 
189
-    foreach( $categories as $category_id => $_data  ) 
189
+    foreach ($categories as $category_id => $_data) 
190 190
     {
191
-        if( isset( $_data['delete'] ) )
191
+        if (isset($_data['delete']))
192 192
         {
193
-            if( $cm->deleteCategory( $category_id ) )
193
+            if ($cm->deleteCategory($category_id))
194 194
             {
195 195
                 $cm->addMessage(
196 196
                     sprintf(
197 197
                         $cm->txt('cm_category_x_deleted'),
198
-                        urldecode( $_data['origin'] )
198
+                        urldecode($_data['origin'])
199 199
                     ),
200 200
                     'edit'
201 201
                 );
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
         }
206 206
         
207 207
         $data = array(
208
-            'category' => trim( html_entity_decode( $_data['category'] ) ),
208
+            'category' => trim(html_entity_decode($_data['category'])),
209 209
             'rank'     => $_data['rank']
210 210
         );
211 211
         
212
-        if( $cm->updateCategory( $category_id, $data ) )
212
+        if ($cm->updateCategory($category_id, $data))
213 213
         {
214 214
             $cm->addMessage(
215 215
                 sprintf( 
216 216
                     $cm->txt('cm_category_x_renamed_to_y'),
217
-                    urldecode( $_data['origin'] ),
217
+                    urldecode($_data['origin']),
218 218
                     $data['category']
219 219
                 ),
220 220
                 'edit'
@@ -223,26 +223,26 @@  discard block
 block discarded – undo
223 223
         }
224 224
     }
225 225
 
226
-    if( $_changes === 0 )
226
+    if ($_changes === 0)
227 227
     {
228
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
228
+        $cm->addMessage($cm->txt('cm_no_changes'), 'edit');
229 229
     }
230 230
 }
231 231
 
232 232
 /**
233 233
  * Delete singel category by $_GET
234 234
  */
235
-if( isset( $_GET[$cm->get('request_key')]['delete'] ) 
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
235
+if (isset($_GET[$cm->get('request_key')]['delete']) 
236
+    && !empty($_GET[$cm->get('request_key')]['delete']))
237 237
 {
238
-    $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
238
+    $category_id = (int) $_GET[$cm->get('request_key')]['delete'];
239 239
     
240
-    if( $cm->deleteCategory( $category_id ) )
240
+    if ($cm->deleteCategory($category_id))
241 241
     {
242 242
         $cm->addMessage(
243 243
             sprintf(
244 244
                 $cm->txt('cm_category_x_deleted'), 
245
-                urldecode( $_GET[$cm->get('request_key')]['category'] )
245
+                urldecode($_GET[$cm->get('request_key')]['category'])
246 246
             ), 
247 247
             'edit'
248 248
         );
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 /**
252 252
  * Translate phrases
253 253
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
254
+if (isset($_POST[$cm->get('request_key')]['translate']['submit']))
255 255
 { 
256 256
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 257
 
258
-    foreach( $translations as $native_phrase => $translation )
258
+    foreach ($translations as $native_phrase => $translation)
259 259
     {
260
-        $native_phrase = urldecode( $native_phrase );
260
+        $native_phrase = urldecode($native_phrase);
261 261
 
262
-        if( empty( $translation ) )
262
+        if (empty($translation))
263 263
         {
264 264
             $translation = $native_phrase;
265 265
             
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
         }
274 274
 
275 275
         //$cm->c('Translator')->setType('phrase');
276
-        $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' );
276
+        $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase');
277 277
         
278 278
         $cm->addMessage(
279 279
             sprintf(
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         );
286 286
     }
287 287
 
288
-    if( empty( $cm->new_translations ) )
288
+    if (empty($cm->new_translations))
289 289
     {   
290 290
        //$_REQUEST['webfxtab_manage-categories-pane'] = 0;
291 291
        // unset( $_COOKIE['webfxtab_manage-categories-pane'] );
Please login to merge, or discard this patch.
Braces   +32 added lines, -67 removed lines patch added patch discarded remove patch
@@ -6,26 +6,22 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
10
-{
9
+if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) {
11 10
     $_data  = $_REQUEST[$cm->get('request_key')];
12 11
     $output = '';
13 12
     $task   = $_data['task'];
14
-    switch( $task )
15
-    {
13
+    switch( $task ) {
16 14
         /**
17 15
          * get categories
18 16
          */
19 17
         case 'categorize_load_elements':
20 18
             $elements = $_data['elements'];
21 19
             
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23
-            { 
20
+            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) {
24 21
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 22
             }
26 23
             
27
-            foreach( $cm->getCategories() as $category )
28
-            {
24
+            foreach( $cm->getCategories() as $category ) {
29 25
                 $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
30 26
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 27
             }            
@@ -41,8 +37,7 @@  discard block
 block discarded – undo
41 37
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 
42 38
  * 
43 39
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
45
-{  
40
+if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) {
46 41
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 42
     $_changes = 0;
48 43
 
@@ -54,16 +49,13 @@  discard block
 block discarded – undo
54 49
         'categorize'
55 50
     );
56 51
     
57
-    if( !isset( $_data['elements'] ) )
58
-    {
52
+    if( !isset( $_data['elements'] ) ) {
59 53
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
60 54
         return;
61 55
     }
62 56
 
63
-    foreach( $_data['elements'] as $element_id => $data )
64
-    {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
66
-        {
57
+    foreach( $_data['elements'] as $element_id => $data ) {
58
+        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) {
67 59
             $cm->addMessage(
68 60
                 sprintf( 
69 61
                     $cm->txt('cm_x_assigned_to_category_y'), 
@@ -78,13 +70,10 @@  discard block
 block discarded – undo
78 70
         }
79 71
     }
80 72
     
81
-    if( $_changes === 0 )
82
-    {
73
+    if( $_changes === 0 ) {
83 74
         $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
84 75
         return;
85
-    }
86
-    else
87
-    {
76
+    } else {
88 77
         $cm->addMessage(
89 78
             sprintf( 
90 79
                 $cm->txt('cm_x_changes_made'), 
@@ -98,26 +87,22 @@  discard block
 block discarded – undo
98 87
 /**
99 88
  * Add a new category
100 89
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
102
-{
90
+if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) {
103 91
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104 92
     $category = trim( html_entity_decode($_data['name']) );
105 93
     $rank     = (int) $_data['rank'];
106 94
 
107
-    if( empty( $category ) )
108
-    {
95
+    if( empty( $category ) ) {
109 96
        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110 97
        return;
111 98
     }
112 99
 
113
-    if( $cm->isCategoryExists( $category ) )
114
-    {
100
+    if( $cm->isCategoryExists( $category ) ) {
115 101
        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); 
116 102
        return;
117 103
     }
118 104
     
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
120
-    {
105
+    if( $cm->addCategory( $category, $rank ) !== 0 ) {
121 106
         $cm->addMessage(
122 107
             sprintf( 
123 108
                 $cm->txt( 'cm_category_x_saved_at_position_y' ),
@@ -126,9 +111,7 @@  discard block
 block discarded – undo
126 111
             ),
127 112
             'add'
128 113
         );
129
-    }
130
-    else
131
-    {
114
+    } else {
132 115
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
133 116
     }    
134 117
 }
@@ -136,20 +119,17 @@  discard block
 block discarded – undo
136 119
 /**
137 120
  * Sort categories
138 121
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
140
-{
122
+if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) {
141 123
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 124
     $_changes   = 0;
143 125
     
144
-    foreach( $categories as $category_id => $_data  ) 
145
-    {
126
+    foreach( $categories as $category_id => $_data  ) {
146 127
         $data = array(
147 128
             'category' => urldecode( $_data['category'] ),
148 129
             'rank'     => $_data['rank']
149 130
         );
150 131
         
151
-        if( $cm->updateCategory( $category_id, $data ) )
152
-        {
132
+        if( $cm->updateCategory( $category_id, $data ) ) {
153 133
             $cm->addMessage(
154 134
                 sprintf( 
155 135
                     $cm->txt('cm_category_x_moved_to_position_y'),
@@ -162,12 +142,9 @@  discard block
 block discarded – undo
162 142
         }
163 143
     }
164 144
         
165
-    if( $_changes === 0 )
166
-    {
145
+    if( $_changes === 0 ) {
167 146
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
168
-    }
169
-    else
170
-    {
147
+    } else {
171 148
         $cm->addMessage(
172 149
             sprintf( 
173 150
                 $cm->txt('cm_x_changes_made'), 
@@ -181,17 +158,13 @@  discard block
 block discarded – undo
181 158
 /**
182 159
  * Edit categories
183 160
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
185
-{
161
+if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) {
186 162
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 163
     $_changes   = 0;
188 164
 
189
-    foreach( $categories as $category_id => $_data  ) 
190
-    {
191
-        if( isset( $_data['delete'] ) )
192
-        {
193
-            if( $cm->deleteCategory( $category_id ) )
194
-            {
165
+    foreach( $categories as $category_id => $_data  ) {
166
+        if( isset( $_data['delete'] ) ) {
167
+            if( $cm->deleteCategory( $category_id ) ) {
195 168
                 $cm->addMessage(
196 169
                     sprintf(
197 170
                         $cm->txt('cm_category_x_deleted'),
@@ -209,8 +182,7 @@  discard block
 block discarded – undo
209 182
             'rank'     => $_data['rank']
210 183
         );
211 184
         
212
-        if( $cm->updateCategory( $category_id, $data ) )
213
-        {
185
+        if( $cm->updateCategory( $category_id, $data ) ) {
214 186
             $cm->addMessage(
215 187
                 sprintf( 
216 188
                     $cm->txt('cm_category_x_renamed_to_y'),
@@ -223,8 +195,7 @@  discard block
 block discarded – undo
223 195
         }
224 196
     }
225 197
 
226
-    if( $_changes === 0 )
227
-    {
198
+    if( $_changes === 0 ) {
228 199
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
229 200
     }
230 201
 }
@@ -233,12 +204,10 @@  discard block
 block discarded – undo
233 204
  * Delete singel category by $_GET
234 205
  */
235 206
 if( isset( $_GET[$cm->get('request_key')]['delete'] ) 
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
237
-{
207
+    && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) {
238 208
     $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
239 209
     
240
-    if( $cm->deleteCategory( $category_id ) )
241
-    {
210
+    if( $cm->deleteCategory( $category_id ) ) {
242 211
         $cm->addMessage(
243 212
             sprintf(
244 213
                 $cm->txt('cm_category_x_deleted'), 
@@ -251,16 +220,13 @@  discard block
 block discarded – undo
251 220
 /**
252 221
  * Translate phrases
253 222
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
255
-{ 
223
+if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) {
256 224
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 225
 
258
-    foreach( $translations as $native_phrase => $translation )
259
-    {
226
+    foreach( $translations as $native_phrase => $translation ) {
260 227
         $native_phrase = urldecode( $native_phrase );
261 228
 
262
-        if( empty( $translation ) )
263
-        {
229
+        if( empty( $translation ) ) {
264 230
             $translation = $native_phrase;
265 231
             
266 232
             $cm->addMessage(
@@ -285,8 +251,7 @@  discard block
 block discarded – undo
285 251
         );
286 252
     }
287 253
 
288
-    if( empty( $cm->new_translations ) )
289
-    {   
254
+    if( empty( $cm->new_translations ) ) {
290 255
        //$_REQUEST['webfxtab_manage-categories-pane'] = 0;
291 256
        // unset( $_COOKIE['webfxtab_manage-categories-pane'] );
292 257
        // setcookie('webfxtab_manage-categories-pane', 0);
Please login to merge, or discard this patch.