Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/actions/mutate_plugin_priority.dynamic.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_plugin')) {
@@ -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->getDatabase()->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->getDatabase()->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/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( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 <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->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
-			$limit = $modx->getDatabase()->getRecordCount($rs);
22
-			if($limit < 1) {
23
-				?>
20
+            $rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21
+            $limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
40
-							?>
39
+                        while($row = $modx->getDatabase()->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->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
-			$limit = $modx->getDatabase()->getRecordCount($rs);
61
-			if($limit < 1) {
62
-				?>
59
+            $rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60
+            $limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
79
-							?>
78
+                        while($row = $modx->getDatabase()->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->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
-			$limit = $modx->getDatabase()->getRecordCount($rs);
100
-			if($limit < 1) {
101
-				?>
98
+            $rs = $modx->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
99
+            $limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
119
-							?>
118
+                        while($row = $modx->getDatabase()->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( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('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->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
20
+			$rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC');
21 21
 			$limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
39
+						while ($row = $modx->getDatabase()->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->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
59
+			$rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC');
60 60
 			$limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
78
+						while ($row = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->getRow($rs)) {
118
+						while ($row = $modx->getDatabase()->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( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('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->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
21 21
 			$limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
39
+						while($row = $modx->getDatabase()->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->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
60 60
 			$limit = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
78
+						while($row = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->getRow($rs)) {
118
+						while($row = $modx->getDatabase()->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/welcome.static.php 3 patches
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
3
+    die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8 8
 if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9
-	// seems to be a new install - send the user to the configuration page
10
-	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
9
+    // seems to be a new install - send the user to the configuration page
10
+    exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
12 12
 
13 13
 // set placeholders
@@ -17,93 +17,93 @@  discard block
 block discarded – undo
17 17
 
18 18
 // setup message info
19 19
 if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
-	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
-	$_SESSION['nrnewmessages'] = $nrnewmessages;
23
-
24
-	$msg = array();
25
-	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
-	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
-	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
-	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
-	$ph['MessageInfo'] = implode("\n", $msg);
20
+    include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
+    $_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
+    $_SESSION['nrnewmessages'] = $nrnewmessages;
23
+
24
+    $msg = array();
25
+    $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
27
+    $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
+    $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
29
+    $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
+    $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
+    $ph['MessageInfo'] = implode("\n", $msg);
32 32
 }
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36 36
 if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37
-	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
-	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
37
+    $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
+    $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40 40
 if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41
-	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
-	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
41
+    $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
+    $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44 44
 if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45
-	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
-	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
45
+    $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
+    $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48 48
 if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
49
-	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
-	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
49
+    $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
+    $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52 52
 if($modx->hasPermission('bk_manager')) {
53
-	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
-	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
53
+    $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
+    $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56 56
 if($modx->hasPermission('help')) {
57
-	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
-	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
57
+    $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
+    $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61 61
 if($modx->hasPermission('new_document')) {
62
-	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
-	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
-	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
-	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
62
+    $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
+    $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
+    $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
+    $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67 67
 if($modx->hasPermission('assets_images')) {
68
-	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
-	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
68
+    $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
+    $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71 71
 if($modx->hasPermission('assets_files')) {
72
-	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
-	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
72
+    $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
+    $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75 75
 if($modx->hasPermission('change_password')) {
76
-	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
-	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
76
+    $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
+    $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
79 79
 $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]';
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83 83
 if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
86
-		$ph['config_check_results'] = $config_check_results;
87
-		$ph['config_display'] = 'block';
88
-	} else {
89
-		$ph['config_display'] = 'none';
90
-	}
84
+    include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
+    if($config_check_results != $_lang['configcheck_ok']) {
86
+        $ph['config_check_results'] = $config_check_results;
87
+        $ph['config_display'] = 'block';
88
+    } else {
89
+        $ph['config_display'] = 'none';
90
+    }
91 91
 } else {
92
-	$ph['config_display'] = 'none';
92
+    $ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96 96
 if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
98
-		case 'logout_reminder':
99
-			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
-			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
-			break;
102
-	}
103
-	$ph['show_logout_reminder'] = 'block';
104
-	unset($_SESSION['show_logout_reminder']);
97
+    switch($_SESSION['show_logout_reminder']['type']) {
98
+        case 'logout_reminder':
99
+            $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
+            $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
+            break;
102
+    }
103
+    $ph['show_logout_reminder'] = 'block';
104
+    unset($_SESSION['show_logout_reminder']);
105 105
 } else {
106
-	$ph['show_logout_reminder'] = 'none';
106
+    $ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
109 109
 // Check multiple sessions
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
152 152
 
153 153
 $ph['UserInfo'] = $modx->parseText($tpl, array(
154
-	'username' => $modx->getLoginUserName(),
155
-	'role' => $_SESSION['mgrPermissions']['name'],
156
-	'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
-	'logincount' => $_SESSION['mgrLogincount'] + 1,
158
-	'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
154
+    'username' => $modx->getLoginUserName(),
155
+    'role' => $_SESSION['mgrPermissions']['name'],
156
+    'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
+    'logincount' => $_SESSION['mgrLogincount'] + 1,
158
+    'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
159 159
 ));
160 160
 
161 161
 $from = array();
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166 166
 if($modx->getDatabase()->getRecordCount($rs) < 1) {
167
-	$html = '<p>[%no_active_users_found%]</p>';
167
+    $html = '<p>[%no_active_users_found%]</p>';
168 168
 } else {
169
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
-	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
-	$ph['now'] = strftime('%H:%M:%S', $now);
172
-	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
-	$html = '
169
+    include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
+    $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
+    $ph['now'] = strftime('%H:%M:%S', $now);
172
+    $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
+    $html = '
174 174
 	<div class="card-body">
175 175
 		[%onlineusers_message%] 
176 176
 		<b>[+now+]</b>):
@@ -188,33 +188,33 @@  discard block
 block discarded – undo
188 188
 	</thead>
189 189
 	<tbody>';
190 190
 
191
-	$userList = array();
192
-	$userCount = array();
193
-	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->getDatabase()->getRow($rs)) {
195
-		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
-
197
-		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
-		$webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
-		$ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
-		$currentaction = getAction($activeusers['action'], $activeusers['id']);
201
-		$userList[] = array(
202
-			$idle,
203
-			'',
204
-			$activeusers['username'],
205
-			$webicon,
206
-			abs($activeusers['internalKey']),
207
-			$ip,
208
-			strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
-			$currentaction
210
-		);
211
-	}
212
-	foreach($userList as $params) {
213
-		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215
-	}
216
-
217
-	$html .= '
191
+    $userList = array();
192
+    $userCount = array();
193
+    // Create userlist with session-count first before output
194
+    while($activeusers = $modx->getDatabase()->getRow($rs)) {
195
+        $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
+
197
+        $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
+        $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
+        $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
+        $currentaction = getAction($activeusers['action'], $activeusers['id']);
201
+        $userList[] = array(
202
+            $idle,
203
+            '',
204
+            $activeusers['username'],
205
+            $webicon,
206
+            abs($activeusers['internalKey']),
207
+            $ip,
208
+            strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
+            $currentaction
210
+        );
211
+    }
212
+    foreach($userList as $params) {
213
+        $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
+        $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215
+    }
216
+
217
+    $html .= '
218 218
 	</tbody>
219 219
 	</table>
220 220
 </div>
@@ -255,17 +255,17 @@  discard block
 block discarded – undo
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257 257
 if(is_array($evtOut)) {
258
-	$output = implode('', $evtOut);
259
-	$ph['OnManagerWelcomePrerender'] = $output;
258
+    $output = implode('', $evtOut);
259
+    $ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
261 261
 
262 262
 $widgets['welcome'] = array(
263
-	'menuindex' => '10',
264
-	'id' => 'welcome',
265
-	'cols' => 'col-lg-6',
266
-	'icon' => 'fa-home',
267
-	'title' => '[%welcome_title%]',
268
-	'body' => '
263
+    'menuindex' => '10',
264
+    'id' => 'welcome',
265
+    'cols' => 'col-lg-6',
266
+    'icon' => 'fa-home',
267
+    'title' => '[%welcome_title%]',
268
+    'body' => '
269 269
 				<div class="wm_buttons card-body"> 
270 270
 					<!--@IF:[[#hasPermission?key=new_document]]--> 
271 271
 					<span class="wm_button">
@@ -339,25 +339,25 @@  discard block
 block discarded – undo
339 339
 					</table>
340 340
 				</div>
341 341
 		',
342
-	'hide'=>'0'
342
+    'hide'=>'0'
343 343
 );
344 344
 $widgets['onlineinfo'] = array(
345
-	'menuindex' => '20',
346
-	'id' => 'onlineinfo',
347
-	'cols' => 'col-lg-6',
348
-	'icon' => 'fa-user',
349
-	'title' => '[%onlineusers_title%]',
350
-	'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
-	'hide'=>'0'
345
+    'menuindex' => '20',
346
+    'id' => 'onlineinfo',
347
+    'cols' => 'col-lg-6',
348
+    'icon' => 'fa-user',
349
+    'title' => '[%onlineusers_title%]',
350
+    'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
+    'hide'=>'0'
352 352
 );
353 353
 $widgets['recentinfo'] = array(
354
-	'menuindex' => '30',
355
-	'id' => 'modxrecent_widget',
356
-	'cols' => 'col-sm-12',
357
-	'icon' => 'fa-pencil-square-o',
358
-	'title' => '[%activity_title%]',
359
-	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
-	'hide'=>'0'
354
+    'menuindex' => '30',
355
+    'id' => 'modxrecent_widget',
356
+    'cols' => 'col-sm-12',
357
+    'icon' => 'fa-pencil-square-o',
358
+    'title' => '[%activity_title%]',
359
+    'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
+    'hide'=>'0'
361 361
 );
362 362
 if ($modx->config['rss_url_news']) {
363 363
     $widgets['news'] = array(
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387 387
 if(is_array($sitewidgets)) {
388
-	$newwidgets = array();
388
+    $newwidgets = array();
389 389
     foreach($sitewidgets as $widget){
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
@@ -393,21 +393,21 @@  discard block
 block discarded – undo
393 393
 }
394 394
 
395 395
 usort($widgets, function ($a, $b) {
396
-	return $a['menuindex'] - $b['menuindex'];
396
+    return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401 401
 foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
403
-		$output .= $modx->parseText($tpl, $widget);
404
-	}
402
+    if ($widget['hide'] != '1'){
403
+        $output .= $modx->parseText($tpl, $widget);
404
+    }
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409 409
 if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
410
+    $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
411 411
 }
412 412
 
413 413
 $target = $modx->config['manager_welcome_tpl'];
@@ -415,27 +415,27 @@  discard block
 block discarded – undo
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417 417
 if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
419
-		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
421
-		$content = file_get_contents(trim(substr($target, 6)));
422
-	} else {
423
-		$content = '';
424
-	}
418
+    if(substr($target, 0, 6) === '@CHUNK') {
419
+        $content = $modx->getChunk(trim(substr($target, 7)));
420
+    } elseif(substr($target, 0, 5) === '@FILE') {
421
+        $content = file_get_contents(trim(substr($target, 6)));
422
+    } else {
423
+        $content = '';
424
+    }
425 425
 } else {
426
-	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
428
-		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
-		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
-	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
-	} else {
437
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
-	}
426
+    $chunk = $modx->getChunk($target);
427
+    if($chunk !== false && !empty($chunk)) {
428
+        $content = $chunk;
429
+    } elseif(is_file(MODX_BASE_PATH . $target)) {
430
+        $content = file_get_contents(MODX_BASE_PATH . $target);
431
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
+    {
435
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
+    } else {
437
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
+    }
439 439
 }
440 440
 
441 441
 // merge placeholders
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 $content = $modx->mergeSettingsContent($content);
444 444
 $content = $modx->parseText($content, $ph);
445 445
 if(strpos($content, '[+') !== false) {
446
-	$modx->toPlaceholders($ph);
447
-	$content = $modx->mergePlaceholderContent($content);
446
+    $modx->toPlaceholders($ph);
447
+    $content = $modx->mergePlaceholderContent($content);
448 448
 }
449 449
 $content = $modx->parseDocumentSource($content);
450 450
 $content = $modx->parseText($content, $_lang, '[%', '%]');
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 453
 
454 454
 if($js = $modx->getRegisteredClientScripts()) {
455
-	$content .= $js;
455
+    $content .= $js;
456 456
 }
457 457
 
458 458
 echo $content;
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
19
+if ($modx->hasPermission('messages')) {
20
+	include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
23 23
 
24 24
 	$msg = array();
25 25
 	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
26
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : '';
27 27
 	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
28
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0';
29 29
 	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30 30
 	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31 31
 	$ph['MessageInfo'] = implode("\n", $msg);
@@ -33,56 +33,56 @@  discard block
 block discarded – undo
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
+if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37 37
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
-	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
38
+	$ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75);
39 39
 }
40
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
+if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41 41
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
-	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
42
+	$ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99);
43 43
 }
44
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45 45
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
-	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
46
+	$ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106);
47 47
 }
48
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48
+if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
49 49
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
-	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
50
+	$ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76);
51 51
 }
52
-if($modx->hasPermission('bk_manager')) {
52
+if ($modx->hasPermission('bk_manager')) {
53 53
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
-	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
54
+	$ph['BackupIcon'] = sprintf($iconTpl, $icon, 93);
55 55
 }
56
-if($modx->hasPermission('help')) {
56
+if ($modx->hasPermission('help')) {
57 57
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
-	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
58
+	$ph['HelpIcon'] = sprintf($iconTpl, $icon, 9);
59 59
 }
60 60
 
61
-if($modx->hasPermission('new_document')) {
61
+if ($modx->hasPermission('new_document')) {
62 62
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
-	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
63
+	$ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4);
64 64
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
-	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
65
+	$ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72);
66 66
 }
67
-if($modx->hasPermission('assets_images')) {
67
+if ($modx->hasPermission('assets_images')) {
68 68
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
-	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
69
+	$ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72);
70 70
 }
71
-if($modx->hasPermission('assets_files')) {
71
+if ($modx->hasPermission('assets_files')) {
72 72
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
-	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
73
+	$ph['FilesIcon'] = sprintf($iconTpl, $icon, 72);
74 74
 }
75
-if($modx->hasPermission('change_password')) {
75
+if ($modx->hasPermission('change_password')) {
76 76
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
-	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
77
+	$ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28);
78 78
 }
79 79
 $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]';
80
-$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
80
+$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8);
81 81
 
82 82
 // do some config checks
83
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
83
+if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
+	include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php');
85
+	if ($config_check_results != $_lang['configcheck_ok']) {
86 86
 		$ph['config_check_results'] = $config_check_results;
87 87
 		$ph['config_display'] = 'block';
88 88
 	} else {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96
-if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
96
+if (isset($_SESSION['show_logout_reminder'])) {
97
+	switch ($_SESSION['show_logout_reminder']['type']) {
98 98
 		case 'logout_reminder':
99 99
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100 100
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	</tr>
149 149
 </table>';
150 150
 
151
-$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
151
+$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>';
152 152
 
153 153
 $ph['UserInfo'] = $modx->parseText($tpl, array(
154 154
 	'username' => $modx->getLoginUserName(),
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
164 164
 $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166
-if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
+if ($modx->getDatabase()->getRecordCount($rs) < 1) {
167 167
 	$html = '<p>[%no_active_users_found%]</p>';
168 168
 } else {
169
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
169
+	include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
170 170
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171 171
 	$ph['now'] = strftime('%H:%M:%S', $now);
172 172
 	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	$userList = array();
192 192
 	$userCount = array();
193 193
 	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->getDatabase()->getRow($rs)) {
194
+	while ($activeusers = $modx->getDatabase()->getRow($rs)) {
195 195
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196 196
 
197 197
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
 			$currentaction
210 210
 		);
211 211
 	}
212
-	foreach($userList as $params) {
212
+	foreach ($userList as $params) {
213 213
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
214
+		$html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215 215
 	}
216 216
 
217 217
 	$html .= '
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 $ph['OnlineInfo'] = $html;
224 224
 
225 225
 // include rss feeds for important forum topics
226
-include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php');
226
+include_once(MODX_MANAGER_PATH.'includes/rss.inc.php');
227 227
 $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content'];
228 228
 $ph['modx_news_content'] = $feedData['modx_news_content'];
229 229
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257
-if(is_array($evtOut)) {
257
+if (is_array($evtOut)) {
258 258
 	$output = implode('', $evtOut);
259 259
 	$ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
@@ -384,57 +384,57 @@  discard block
 block discarded – undo
384 384
 
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387
-if(is_array($sitewidgets)) {
387
+if (is_array($sitewidgets)) {
388 388
 	$newwidgets = array();
389
-    foreach($sitewidgets as $widget){
389
+    foreach ($sitewidgets as $widget) {
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
392 392
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
393 393
 }
394 394
 
395
-usort($widgets, function ($a, $b) {
395
+usort($widgets, function($a, $b){
396 396
 	return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401
-foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
401
+foreach ($widgets as $widget) {
402
+	if ($widget['hide'] != '1') {
403 403
 		$output .= $modx->parseText($tpl, $widget);
404 404
 	}
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
409
+if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
+	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl';
411 411
 }
412 412
 
413 413
 $target = $modx->config['manager_welcome_tpl'];
414 414
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417
-if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
417
+if (substr($target, 0, 1) === '@') {
418
+	if (substr($target, 0, 6) === '@CHUNK') {
419 419
 		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
420
+	} elseif (substr($target, 0, 5) === '@FILE') {
421 421
 		$content = file_get_contents(trim(substr($target, 6)));
422 422
 	} else {
423 423
 		$content = '';
424 424
 	}
425 425
 } else {
426 426
 	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
427
+	if ($chunk !== false && !empty($chunk)) {
428 428
 		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
-		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
429
+	} elseif (is_file(MODX_BASE_PATH.$target)) {
430
+		$content = file_get_contents(MODX_BASE_PATH.$target);
431
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
432
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl');
433
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible
434 434
 	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
435
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html');
436 436
 	} else {
437
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
437
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl');
438 438
 	}
439 439
 }
440 440
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 $content = $modx->mergeConditionalTagsContent($content);
443 443
 $content = $modx->mergeSettingsContent($content);
444 444
 $content = $modx->parseText($content, $ph);
445
-if(strpos($content, '[+') !== false) {
445
+if (strpos($content, '[+') !== false) {
446 446
 	$modx->toPlaceholders($ph);
447 447
 	$content = $modx->mergePlaceholderContent($content);
448 448
 }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 $content = $modx->parseText($content, $_style, '[&', '&]');
452 452
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 453
 
454
-if($js = $modx->getRegisteredClientScripts()) {
454
+if ($js = $modx->getRegisteredClientScripts()) {
455 455
 	$content .= $js;
456 456
 }
457 457
 
Please login to merge, or discard this patch.
Braces   +48 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
19
+if($modx->hasPermission('messages')) {
20 20
 	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
@@ -33,46 +33,46 @@  discard block
 block discarded – undo
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
+if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37 37
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38 38
 	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
+if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41 41
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42 42
 	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45 45
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46 46
 	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48
+if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
49 49
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50 50
 	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52
-if($modx->hasPermission('bk_manager')) {
52
+if($modx->hasPermission('bk_manager')) {
53 53
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54 54
 	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56
-if($modx->hasPermission('help')) {
56
+if($modx->hasPermission('help')) {
57 57
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58 58
 	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61
-if($modx->hasPermission('new_document')) {
61
+if($modx->hasPermission('new_document')) {
62 62
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63 63
 	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64 64
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65 65
 	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67
-if($modx->hasPermission('assets_images')) {
67
+if($modx->hasPermission('assets_images')) {
68 68
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69 69
 	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71
-if($modx->hasPermission('assets_files')) {
71
+if($modx->hasPermission('assets_files')) {
72 72
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73 73
 	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75
-if($modx->hasPermission('change_password')) {
75
+if($modx->hasPermission('change_password')) {
76 76
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77 77
 	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
@@ -80,21 +80,21 @@  discard block
 block discarded – undo
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
+if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84 84
 	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
85
+	if($config_check_results != $_lang['configcheck_ok']) {
86 86
 		$ph['config_check_results'] = $config_check_results;
87 87
 		$ph['config_display'] = 'block';
88
-	} else {
88
+	} else {
89 89
 		$ph['config_display'] = 'none';
90 90
 	}
91
-} else {
91
+} else {
92 92
 	$ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96
-if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
96
+if(isset($_SESSION['show_logout_reminder'])) {
97
+	switch($_SESSION['show_logout_reminder']['type']) {
98 98
 		case 'logout_reminder':
99 99
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100 100
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	}
103 103
 	$ph['show_logout_reminder'] = 'block';
104 104
 	unset($_SESSION['show_logout_reminder']);
105
-} else {
105
+} else {
106 106
 	$ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
164 164
 $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166
-if($modx->getDatabase()->getRecordCount($rs) < 1) {
166
+if($modx->getDatabase()->getRecordCount($rs) < 1) {
167 167
 	$html = '<p>[%no_active_users_found%]</p>';
168
-} else {
168
+} else {
169 169
 	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170 170
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171 171
 	$ph['now'] = strftime('%H:%M:%S', $now);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	$userList = array();
192 192
 	$userCount = array();
193 193
 	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->getDatabase()->getRow($rs)) {
194
+	while($activeusers = $modx->getDatabase()->getRow($rs)) {
195 195
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196 196
 
197 197
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			$currentaction
210 210
 		);
211 211
 	}
212
-	foreach($userList as $params) {
212
+	foreach($userList as $params) {
213 213
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214 214
 		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
215 215
 	}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257
-if(is_array($evtOut)) {
257
+if(is_array($evtOut)) {
258 258
 	$output = implode('', $evtOut);
259 259
 	$ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360 360
 	'hide'=>'0'
361 361
 );
362
-if ($modx->config['rss_url_news']) {
362
+if ($modx->config['rss_url_news']) {
363 363
     $widgets['news'] = array(
364 364
         'menuindex' => '40',
365 365
         'id' => 'news',
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         'hide'=>'0'
371 371
     );
372 372
 }
373
-if ($modx->config['rss_url_security']) {
373
+if ($modx->config['rss_url_security']) {
374 374
     $widgets['security'] = array(
375 375
         'menuindex' => '50',
376 376
         'id' => 'security',
@@ -384,29 +384,29 @@  discard block
 block discarded – undo
384 384
 
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387
-if(is_array($sitewidgets)) {
387
+if(is_array($sitewidgets)) {
388 388
 	$newwidgets = array();
389
-    foreach($sitewidgets as $widget){
389
+    foreach($sitewidgets as $widget) {
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
392 392
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
393 393
 }
394 394
 
395
-usort($widgets, function ($a, $b) {
395
+usort($widgets, function ($a, $b){
396 396
 	return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401
-foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
401
+foreach($widgets as $widget) {
402
+	if ($widget['hide'] != '1') {
403 403
 		$output .= $modx->parseText($tpl, $widget);
404 404
 	}
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
+if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410 410
 	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
411 411
 }
412 412
 
@@ -414,26 +414,28 @@  discard block
 block discarded – undo
414 414
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417
-if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
417
+if(substr($target, 0, 1) === '@') {
418
+	if(substr($target, 0, 6) === '@CHUNK') {
419 419
 		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
420
+	} elseif(substr($target, 0, 5) === '@FILE') {
421 421
 		$content = file_get_contents(trim(substr($target, 6)));
422
-	} else {
422
+	} else {
423 423
 		$content = '';
424 424
 	}
425
-} else {
425
+} else {
426 426
 	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
427
+	if($chunk !== false && !empty($chunk)) {
428 428
 		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
429
+	} elseif(is_file(MODX_BASE_PATH . $target)) {
430 430
 		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
431
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432 432
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
433
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) {
434
+	    // ClipperCMS compatible
434 435
 	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
-	} else {
436
+		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
437
+	}
438
+	} else {
437 439
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438 440
 	}
439 441
 }
@@ -442,7 +444,7 @@  discard block
 block discarded – undo
442 444
 $content = $modx->mergeConditionalTagsContent($content);
443 445
 $content = $modx->mergeSettingsContent($content);
444 446
 $content = $modx->parseText($content, $ph);
445
-if(strpos($content, '[+') !== false) {
447
+if(strpos($content, '[+') !== false) {
446 448
 	$modx->toPlaceholders($ph);
447 449
 	$content = $modx->mergePlaceholderContent($content);
448 450
 }
@@ -451,7 +453,7 @@  discard block
 block discarded – undo
451 453
 $content = $modx->parseText($content, $_style, '[&', '&]');
452 454
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 455
 
454
-if($js = $modx->getRegisteredClientScripts()) {
456
+if($js = $modx->getRegisteredClientScripts()) {
455 457
 	$content .= $js;
456 458
 }
457 459
 
Please login to merge, or discard this patch.
manager/actions/search.static.php 3 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -113,31 +113,31 @@
 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->getDatabase()->query($articul_query);
120
-		$articul_id_array = $modx->getDatabase()->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->getDatabase()->query($articul_query);
120
+        $articul_id_array = $modx->getDatabase()->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
         }
Please login to merge, or discard this patch.
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     exit();
4 4
 }
5 5
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
@@ -41,9 +41,9 @@  discard block
 block discarded – undo
41 41
                         <?php
42 42
                         $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_templates'));
43 43
                         $option[] = '<option value="">No selected</option>';
44
-                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : '';
44
+                        $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_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->getDatabase()->getRow($rs)) {
48 48
                             $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']);
49 49
                             $selected = $row['id'] == $templateid ? ' selected="selected"' : '';
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset);
87 87
     $searchlongtitle = $modx->getDatabase()->escape(trim($_REQUEST['searchfields']));
88 88
     $search_alias = $modx->getDatabase()->escape(trim($_REQUEST['searchfields']));
89
-    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : '';
89
+    $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : '';
90 90
     $searchcontent = $modx->getDatabase()->escape($_REQUEST['content']);
91 91
 
92 92
     $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type';
@@ -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->getDatabase()->query($articul_query);
120 120
 		$articul_id_array = $modx->getDatabase()->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
             $sqladd .= ")";
162 162
         }
163 163
     } else if ($idFromAlias) {
@@ -181,8 +181,8 @@  discard block
 block discarded – undo
181 181
         $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
182 182
         $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0;
183 183
         $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : '';
184
-        $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess';
185
-        $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
184
+        $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess';
185
+        $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
186 186
     }
187 187
 
188 188
     if ($sqladd) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     $where = $sqladd;
193 193
 
194 194
     if ($where) {
195
-        $rs = $modx->getDatabase()->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
195
+        $rs = $modx->getDatabase()->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
196 196
         $limit = $modx->getDatabase()->getRecordCount($rs);
197 197
     } else {
198 198
         $limit = 0;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                 if ($limit < 1) {
212 212
                     echo $_lang['search_empty'];
213 213
                 } else {
214
-                    printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit);
214
+                    printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit);
215 215
                     ?>
216 216
                     <script type="text/javascript" src="media/script/tablesort.js"></script>
217 217
                     <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1">
@@ -271,14 +271,14 @@  discard block
 block discarded – undo
271 271
                                 if (function_exists('mb_strlen') && function_exists('mb_substr')) {
272 272
                                     ?>
273 273
                                     <td<?= $tdClass ?>>
274
-                                        <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
+                                        <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>
275 275
                                     </td>
276
-                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td>
276
+                                    <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td>
277 277
                                     <?php
278 278
                                 } else {
279 279
                                     ?>
280
-                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td>
281
-                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td>
280
+                                    <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td>
281
+                                    <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td>
282 282
                                     <?php
283 283
                                 }
284 284
                                 ?>
@@ -298,115 +298,115 @@  discard block
 block discarded – undo
298 298
                 if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
299 299
                     $docscounts = $modx->getDatabase()->getRecordCount($rs);
300 300
                     if ($docscounts > 0) {
301
-                        $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>';
301
+                        $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>';
302 302
                         while ($row = $modx->getDatabase()->getRow($rs)) {
303
-                            $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
+                            $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>';
304 304
                         }
305 305
                     }
306 306
                 }
307 307
 
308 308
                 //templates
309 309
                 if ($modx->hasPermission('edit_template')) {
310
-                    $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' 
311
-					OR `templatename` like '%" . $searchfields . "%' 
312
-					OR `description` like '%" . $searchfields . "%' 
313
-					OR `content` like '%" . $searchfields . "%'");
310
+                    $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' 
311
+					OR `templatename` like '%" . $searchfields."%' 
312
+					OR `description` like '%" . $searchfields."%' 
313
+					OR `content` like '%" . $searchfields."%'");
314 314
                     $templatecounts = $modx->getDatabase()->getRecordCount($rs);
315 315
                     if ($templatecounts > 0) {
316
-                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>';
316
+                        $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>';
317 317
                         while ($row = $modx->getDatabase()->getRow($rs)) {
318
-                            $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
+                            $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>';
319 319
                         }
320 320
                     }
321 321
                 }
322 322
 
323 323
                 //tvs
324 324
                 if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
325
-                    $rs = $modx->getDatabase()->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' 
326
-					OR `name` like '%" . $searchfields . "%' 
327
-					OR `description` like '%" . $searchfields . "%' 
328
-					OR `type` like '%" . $searchfields . "%' 
329
-					OR `elements` like '%" . $searchfields . "%' 
330
-					OR `display` like '%" . $searchfields . "%' 
331
-					OR `display_params` like '%" . $searchfields . "%' 
332
-					OR `default_text` like '%" . $searchfields . "%'");
325
+                    $rs = $modx->getDatabase()->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' 
326
+					OR `name` like '%" . $searchfields."%' 
327
+					OR `description` like '%" . $searchfields."%' 
328
+					OR `type` like '%" . $searchfields."%' 
329
+					OR `elements` like '%" . $searchfields."%' 
330
+					OR `display` like '%" . $searchfields."%' 
331
+					OR `display_params` like '%" . $searchfields."%' 
332
+					OR `default_text` like '%" . $searchfields."%'");
333 333
                     $tvscounts = $modx->getDatabase()->getRecordCount($rs);
334 334
                     if ($tvscounts > 0) {
335
-                        $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>';
335
+                        $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>';
336 336
                         while ($row = $modx->getDatabase()->getRow($rs)) {
337
-                            $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
+                            $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>';
338 338
                         }
339 339
                     }
340 340
                 }
341 341
 
342 342
                 //Chunks
343 343
                 if ($modx->hasPermission('edit_chunk')) {
344
-                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' 
345
-					OR `name` like '%" . $searchfields . "%' 
346
-					OR `description` like '%" . $searchfields . "%'     
347
-					OR `snippet` like '%" . $searchfields . "%'");
344
+                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' 
345
+					OR `name` like '%" . $searchfields."%' 
346
+					OR `description` like '%" . $searchfields."%'     
347
+					OR `snippet` like '%" . $searchfields."%'");
348 348
                     $chunkscounts = $modx->getDatabase()->getRecordCount($rs);
349 349
                     if ($chunkscounts > 0) {
350
-                        $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>';
350
+                        $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>';
351 351
                         while ($row = $modx->getDatabase()->getRow($rs)) {
352
-                            $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
+                            $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>';
353 353
                         }
354 354
                     }
355 355
                 }
356 356
 
357 357
                 //Snippets
358 358
                 if ($modx->hasPermission('edit_snippet')) {
359
-                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' 
360
-					OR `name` like '%" . $searchfields . "%' 
361
-					OR `description` like '%" . $searchfields . "%' 
362
-					OR `snippet` like '%" . $searchfields . "%'  
363
-					OR `properties` like '%" . $searchfields . "%'      
364
-					OR `moduleguid` like '%" . $searchfields . "%'");
359
+                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' 
360
+					OR `name` like '%" . $searchfields."%' 
361
+					OR `description` like '%" . $searchfields."%' 
362
+					OR `snippet` like '%" . $searchfields."%'  
363
+					OR `properties` like '%" . $searchfields."%'      
364
+					OR `moduleguid` like '%" . $searchfields."%'");
365 365
                     $snippetscounts = $modx->getDatabase()->getRecordCount($rs);
366 366
                     if ($snippetscounts > 0) {
367
-                        $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>';
367
+                        $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>';
368 368
                         while ($row = $modx->getDatabase()->getRow($rs)) {
369
-                            $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
+                            $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>';
370 370
                         }
371 371
                     }
372 372
                 }
373 373
 
374 374
                 //plugins
375 375
                 if ($modx->hasPermission('edit_plugin')) {
376
-                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' 
377
-					OR `name` like '%" . $searchfields . "%' 
378
-					OR `description` like '%" . $searchfields . "%' 
379
-					OR `plugincode` like '%" . $searchfields . "%'  
380
-					OR `properties` like '%" . $searchfields . "%'      
381
-					OR `moduleguid` like '%" . $searchfields . "%'");
376
+                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' 
377
+					OR `name` like '%" . $searchfields."%' 
378
+					OR `description` like '%" . $searchfields."%' 
379
+					OR `plugincode` like '%" . $searchfields."%'  
380
+					OR `properties` like '%" . $searchfields."%'      
381
+					OR `moduleguid` like '%" . $searchfields."%'");
382 382
                     $pluginscounts = $modx->getDatabase()->getRecordCount($rs);
383 383
                     if ($pluginscounts > 0) {
384
-                        $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>';
384
+                        $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>';
385 385
                         while ($row = $modx->getDatabase()->getRow($rs)) {
386
-                            $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
+                            $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>';
387 387
                         }
388 388
                     }
389 389
                 }
390 390
 
391 391
                 //modules
392 392
                 if ($modx->hasPermission('edit_module')) {
393
-                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' 
394
-                    OR `name` like '%" . $searchfields . "%' 
395
-                    OR `description` like '%" . $searchfields . "%' 
396
-                    OR `modulecode` like '%" . $searchfields . "%'  
397
-                    OR `properties` like '%" . $searchfields . "%'  
398
-                    OR `guid` like '%" . $searchfields . "%'      
399
-                    OR `resourcefile` like '%" . $searchfields . "%'");
393
+                    $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' 
394
+                    OR `name` like '%" . $searchfields."%' 
395
+                    OR `description` like '%" . $searchfields."%' 
396
+                    OR `modulecode` like '%" . $searchfields."%'  
397
+                    OR `properties` like '%" . $searchfields."%'  
398
+                    OR `guid` like '%" . $searchfields."%'      
399
+                    OR `resourcefile` like '%" . $searchfields."%'");
400 400
                     $modulescounts = $modx->getDatabase()->getRecordCount($rs);
401 401
                     if ($modulescounts > 0) {
402
-                        $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>';
402
+                        $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>';
403 403
                         while ($row = $modx->getDatabase()->getRow($rs)) {
404
-                            $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
+                            $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>';
405 405
                         }
406 406
                     }
407 407
                 }
408 408
 
409
-                echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1';
409
+                echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1';
410 410
             }
411 411
 
412 412
             ?>
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->getDatabase()->query($articul_query);
120 120
 		$articul_id_array = $modx->getDatabase()->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_user.dynamic.php 4 patches
Indentation   +155 added lines, -155 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 switch($modx->getManagerApi()->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    case 12:
8
+        if(!$modx->hasPermission('edit_user')) {
9
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+        }
11
+        break;
12
+    case 11:
13
+        if(!$modx->hasPermission('new_user')) {
14
+            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+        }
16
+        break;
17
+    default:
18
+        $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
@@ -23,79 +23,79 @@  discard block
 block discarded – undo
23 23
 // check to see the snippet editor isn't locked
24 24
 $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25 25
 if($username = $modx->getDatabase()->getValue($rs)) {
26
-	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
26
+    $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30 30
 if($modx->getManagerApi()->action == '12') {
31
-	// get user attribute
32
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
-	$userdata = $modx->getDatabase()->getRow($rs);
34
-	if(!$userdata) {
35
-		$modx->webAlertAndQuit("No user returned!");
36
-	}
31
+    // get user attribute
32
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33
+    $userdata = $modx->getDatabase()->getRow($rs);
34
+    if(!$userdata) {
35
+        $modx->webAlertAndQuit("No user returned!");
36
+    }
37 37
 
38 38
     if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
39 39
         $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!');
40 40
     }
41 41
 
42 42
 
43
-	// get user settings
44
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
-	$usersettings = array();
46
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
-	// manually extract so that user display settings are not overwritten
48
-	foreach($usersettings as $k => $v) {
49
-		if($k != 'manager_language' && $k != 'manager_theme') {
50
-			${$k} = $v;
51
-		}
52
-	}
43
+    // get user settings
44
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45
+    $usersettings = array();
46
+    while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47
+    // manually extract so that user display settings are not overwritten
48
+    foreach($usersettings as $k => $v) {
49
+        if($k != 'manager_language' && $k != 'manager_theme') {
50
+            ${$k} = $v;
51
+        }
52
+    }
53 53
 
54
-	// get user name
55
-	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
-	$usernamedata = $modx->getDatabase()->getRow($rs);
57
-	if(!$usernamedata) {
58
-		$modx->webAlertAndQuit("No user returned while getting username!");
59
-	}
60
-	$_SESSION['itemname'] = $usernamedata['username'];
54
+    // get user name
55
+    $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56
+    $usernamedata = $modx->getDatabase()->getRow($rs);
57
+    if(!$usernamedata) {
58
+        $modx->webAlertAndQuit("No user returned while getting username!");
59
+    }
60
+    $_SESSION['itemname'] = $usernamedata['username'];
61 61
 } else {
62
-	$userdata = array();
63
-	$usersettings = array();
64
-	$usernamedata = array();
65
-	$_SESSION['itemname'] = $_lang["new_user"];
62
+    $userdata = array();
63
+    $usersettings = array();
64
+    $usernamedata = array();
65
+    $_SESSION['itemname'] = $_lang["new_user"];
66 66
 }
67 67
 
68 68
 // avoid doubling htmlspecialchars (already encoded in DB)
69 69
 foreach($userdata as $key => $val) {
70
-	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
70
+    $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
71 71
 };
72 72
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
73 73
 
74 74
 // restore saved form
75 75
 $formRestored = false;
76 76
 if($modx->getManagerApi()->hasFormValues()) {
77
-	$modx->getManagerApi()->loadFormValues();
78
-	// restore post values
79
-	$userdata = array_merge($userdata, $_POST);
80
-	$userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
-	$usernamedata['username'] = $userdata['newusername'];
82
-	$usernamedata['oldusername'] = $_POST['oldusername'];
83
-	$usersettings = array_merge($usersettings, $userdata);
84
-	$usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
-	extract($usersettings, EXTR_OVERWRITE);
77
+    $modx->getManagerApi()->loadFormValues();
78
+    // restore post values
79
+    $userdata = array_merge($userdata, $_POST);
80
+    $userdata['dob'] = $modx->toTimeStamp($userdata['dob']);
81
+    $usernamedata['username'] = $userdata['newusername'];
82
+    $usernamedata['oldusername'] = $_POST['oldusername'];
83
+    $usersettings = array_merge($usersettings, $userdata);
84
+    $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : "";
85
+    extract($usersettings, EXTR_OVERWRITE);
86 86
 }
87 87
 
88 88
 // include the country list language file
89 89
 $_country_lang = array();
90 90
 include_once "lang/country/english_country.inc.php";
91 91
 if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
92
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
92
+    include_once "lang/country/" . $manager_language . "_country.inc.php";
93 93
 }
94 94
 asort($_country_lang);
95 95
 
96 96
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
97 97
 if($which_browser == 'default') {
98
-	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
98
+    $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
99 99
 }
100 100
 ?>
101 101
 <script type="text/javascript">
@@ -205,14 +205,14 @@  discard block
 block discarded – undo
205 205
 <form action="index.php?a=32" method="post" name="userform">
206 206
 	<?php
207 207
 
208
-	// invoke OnUserFormPrerender event
209
-	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
-		"id" => $user
211
-	));
212
-	if(is_array($evtOut)) {
213
-		echo implode("", $evtOut);
214
-	}
215
-	?>
208
+    // invoke OnUserFormPrerender event
209
+    $evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210
+        "id" => $user
211
+    ));
212
+    if(is_array($evtOut)) {
213
+        echo implode("", $evtOut);
214
+    }
215
+    ?>
216 216
 	<input type="hidden" name="mode" value="<?php echo $modx->getManagerApi()->action; ?>">
217 217
 	<input type="hidden" name="id" value="<?php echo $user ?>">
218 218
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
@@ -305,21 +305,21 @@  discard block
 block discarded – undo
305 305
 						<td>&nbsp;</td>
306 306
 						<td><?php
307 307
 
308
-							$rs = $modx->getDatabase()->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
-							?>
308
+                            $rs = $modx->getDatabase()->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1');
309
+                            ?>
310 310
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
311 311
 								<?php
312
-								while($row = $modx->getDatabase()->getRow($rs)) {
313
-									if($modx->getManagerApi()->action == '11') {
314
-										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
-									} else {
316
-										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
-									}
318
-									?>
312
+                                while($row = $modx->getDatabase()->getRow($rs)) {
313
+                                    if($modx->getManagerApi()->action == '11') {
314
+                                        $selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315
+                                    } else {
316
+                                        $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
317
+                                    }
318
+                                    ?>
319 319
 									<option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option>
320 320
 									<?php
321
-								}
322
-								?>
321
+                                }
322
+                                ?>
323 323
 							</select></td>
324 324
 					</tr>
325 325
 					<tr>
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
365 365
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
366 366
 								<?php
367
-								foreach($_country_lang as $key => $country) {
368
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
-								}
370
-								?>
367
+                                foreach($_country_lang as $key => $country) {
368
+                                    echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
369
+                                }
370
+                                ?>
371 371
 							</select></td>
372 372
 					</tr>
373 373
 					<tr>
@@ -443,21 +443,21 @@  discard block
 block discarded – undo
443 443
 						<td><select name="manager_language" class="inputBox" onChange="documentDirty=true">
444 444
 								<option value=""></option>
445 445
 								<?php
446
-								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
-								$dir = dir("includes/lang");
448
-								while($file = $dir->read()) {
449
-									if(strpos($file, ".inc.php") > 0) {
450
-										$endpos = strpos($file, ".");
451
-										$languagename = substr($file, 0, $endpos);
452
-										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
-										?>
446
+                                $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447
+                                $dir = dir("includes/lang");
448
+                                while($file = $dir->read()) {
449
+                                    if(strpos($file, ".inc.php") > 0) {
450
+                                        $endpos = strpos($file, ".");
451
+                                        $languagename = substr($file, 0, $endpos);
452
+                                        $selectedtext = $languagename == $activelang ? "selected='selected'" : "";
453
+                                        ?>
454 454
 										<option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option>
455 455
 										<?php
456 456
 
457
-									}
458
-								}
459
-								$dir->close();
460
-								?>
457
+                                    }
458
+                                }
459
+                                $dir->close();
460
+                                ?>
461 461
 							</select></td>
462 462
 					</tr>
463 463
 					<tr>
@@ -532,22 +532,22 @@  discard block
 block discarded – undo
532 532
 						<td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());">
533 533
 								<option value=""></option>
534 534
 								<?php
535
-								$dir = dir("media/style/");
536
-								while($file = $dir->read()) {
537
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
-										$themename = $file;
539
-										if($themename === 'common') {
540
-											continue;
541
-										}
542
-										$attr = 'value="' . $themename . '" ';
543
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
-											$attr .= 'selected="selected" ';
545
-										}
546
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
-									}
548
-								}
549
-								$dir->close();
550
-								?>
535
+                                $dir = dir("media/style/");
536
+                                while($file = $dir->read()) {
537
+                                    if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538
+                                        $themename = $file;
539
+                                        if($themename === 'common') {
540
+                                            continue;
541
+                                        }
542
+                                        $attr = 'value="' . $themename . '" ';
543
+                                        if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544
+                                            $attr .= 'selected="selected" ';
545
+                                        }
546
+                                        echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
547
+                                    }
548
+                                }
549
+                                $dir->close();
550
+                                ?>
551 551
 							</select>
552 552
 							<input type="hidden" name="theme_refresher" value=""></td>
553 553
 					</tr>
@@ -583,15 +583,15 @@  discard block
 block discarded – undo
583 583
 						<th><?php echo $_lang["which_browser_title"] ?></th>
584 584
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
585 585
 								<?php
586
-								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
-									$dir = str_replace('\\', '/', $dir);
590
-									$browser_name = substr($dir, strrpos($dir, '/') + 1);
591
-									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
-								}
594
-								?>
586
+                                $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
+                                echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
+                                foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589
+                                    $dir = str_replace('\\', '/', $dir);
590
+                                    $browser_name = substr($dir, strrpos($dir, '/') + 1);
591
+                                    $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
+                                    echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
593
+                                }
594
+                                ?>
595 595
 							</select></td>
596 596
 					</tr>
597 597
 					<tr>
@@ -668,17 +668,17 @@  discard block
 block discarded – undo
668 668
 								<option value=""></option>
669 669
 								<?php
670 670
 
671
-								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
-								// invoke OnRichTextEditorRegister event
673
-								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
-								if(is_array($evtOut)) {
676
-									for($i = 0; $i < count($evtOut); $i++) {
677
-										$editor = $evtOut[$i];
678
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
-									}
680
-								}
681
-								?>
671
+                                $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672
+                                // invoke OnRichTextEditorRegister event
673
+                                $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
+                                echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
+                                if(is_array($evtOut)) {
676
+                                    for($i = 0; $i < count($evtOut); $i++) {
677
+                                        $editor = $evtOut[$i];
678
+                                        echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
679
+                                    }
680
+                                }
681
+                                ?>
682 682
 							</select></td>
683 683
 					</tr>
684 684
 					<tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>">
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
 					</tr>
712 712
 				</table>
713 713
 				<?php
714
-				// invoke OnInterfaceSettingsRender event
715
-				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
-				if(is_array($evtOut)) {
717
-					echo implode("", $evtOut);
718
-				}
719
-				?>
714
+                // invoke OnInterfaceSettingsRender event
715
+                $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
+                if(is_array($evtOut)) {
717
+                    echo implode("", $evtOut);
718
+                }
719
+                ?>
720 720
 			</div>
721 721
 
722 722
 			<!-- Photo -->
@@ -765,39 +765,39 @@  discard block
 block discarded – undo
765 765
 			</div>
766 766
 			<?php if($use_udperms == 1) {
767 767
 
768
-			$groupsarray = array();
769
-
770
-			if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
771
-				$rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
-				$groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773
-			}
774
-			// retain selected doc groups between post
775
-			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
-			}
778
-			?>
768
+            $groupsarray = array();
769
+
770
+            if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
771
+                $rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772
+                $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773
+            }
774
+            // retain selected doc groups between post
775
+            if(is_array($_POST['user_groups'])) {
776
+                foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777
+            }
778
+            ?>
779 779
 			<div class="tab-page" id="tabAccess">
780 780
 				<h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2>
781 781
 				<script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script>
782 782
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
783 783
 				<?php
784
-				$rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
-				while($row = $modx->getDatabase()->getRow($rs)) {
786
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
-				}
788
-				}
789
-				?>
784
+                $rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
+                while($row = $modx->getDatabase()->getRow($rs)) {
786
+                    echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
787
+                }
788
+                }
789
+                ?>
790 790
 			</div>
791 791
 		</div>
792 792
 	</div>
793 793
 	<input type="submit" name="save" style="display:none">
794 794
 	<?php
795
-	// invoke OnUserFormRender event
796
-	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
-		"id" => $user
798
-	));
799
-	if(is_array($evtOut)) {
800
-		echo implode("", $evtOut);
801
-	}
802
-	?>
795
+    // invoke OnUserFormRender event
796
+    $evtOut = $modx->invokeEvent("OnUserFormRender", array(
797
+        "id" => $user
798
+    ));
799
+    if(is_array($evtOut)) {
800
+        echo implode("", $evtOut);
801
+    }
802
+    ?>
803 803
 </form>
Please login to merge, or discard this patch.
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,18 +4,18 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 switch($modx->getManagerApi()->action) {
7
-	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
9
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-		}
11
-		break;
12
-	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
14
-			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
-		}
16
-		break;
17
-	default:
18
-		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	    case 12:
8
+		    if(!$modx->hasPermission('edit_user')) {
9
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+		    }
11
+		    break;
12
+	    case 11:
13
+		    if(!$modx->hasPermission('new_user')) {
14
+			    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
15
+		    }
16
+		    break;
17
+	    default:
18
+		    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21 21
 $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch($modx->getManagerApi()->action) {
6
+switch ($modx->getManagerApi()->action) {
7 7
 	case 12:
8
-		if(!$modx->hasPermission('edit_user')) {
8
+		if (!$modx->hasPermission('edit_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 11:
13
-		if(!$modx->hasPermission('new_user')) {
13
+		if (!$modx->hasPermission('new_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,24 +18,24 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // check to see the snippet editor isn't locked
24
-$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
25
-if($username = $modx->getDatabase()->getValue($rs)) {
24
+$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
25
+if ($username = $modx->getDatabase()->getValue($rs)) {
26 26
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user"));
27 27
 }
28 28
 // end check for lock
29 29
 
30
-if($modx->getManagerApi()->action == '12') {
30
+if ($modx->getManagerApi()->action == '12') {
31 31
 	// get user attribute
32 32
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
33 33
 	$userdata = $modx->getDatabase()->getRow($rs);
34
-	if(!$userdata) {
34
+	if (!$userdata) {
35 35
 		$modx->webAlertAndQuit("No user returned!");
36 36
 	}
37 37
 
38
-    if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
38
+    if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) {
39 39
         $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!');
40 40
     }
41 41
 
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 	// get user settings
44 44
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45 45
 	$usersettings = array();
46
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
46
+	while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
47 47
 	// manually extract so that user display settings are not overwritten
48
-	foreach($usersettings as $k => $v) {
49
-		if($k != 'manager_language' && $k != 'manager_theme') {
48
+	foreach ($usersettings as $k => $v) {
49
+		if ($k != 'manager_language' && $k != 'manager_theme') {
50 50
 			${$k} = $v;
51 51
 		}
52 52
 	}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	// get user name
55 55
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
56 56
 	$usernamedata = $modx->getDatabase()->getRow($rs);
57
-	if(!$usernamedata) {
57
+	if (!$usernamedata) {
58 58
 		$modx->webAlertAndQuit("No user returned while getting username!");
59 59
 	}
60 60
 	$_SESSION['itemname'] = $usernamedata['username'];
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
 }
67 67
 
68 68
 // avoid doubling htmlspecialchars (already encoded in DB)
69
-foreach($userdata as $key => $val) {
69
+foreach ($userdata as $key => $val) {
70 70
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
71 71
 };
72 72
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
73 73
 
74 74
 // restore saved form
75 75
 $formRestored = false;
76
-if($modx->getManagerApi()->hasFormValues()) {
76
+if ($modx->getManagerApi()->hasFormValues()) {
77 77
 	$modx->getManagerApi()->loadFormValues();
78 78
 	// restore post values
79 79
 	$userdata = array_merge($userdata, $_POST);
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 // include the country list language file
89 89
 $_country_lang = array();
90 90
 include_once "lang/country/english_country.inc.php";
91
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
92
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
91
+if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
92
+	include_once "lang/country/".$manager_language."_country.inc.php";
93 93
 }
94 94
 asort($_country_lang);
95 95
 
96 96
 $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block';
97
-if($which_browser == 'default') {
97
+if ($which_browser == 'default') {
98 98
 	$which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser'];
99 99
 }
100 100
 ?>
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			document.userform.save.click();
187 187
 		},
188 188
 		delete: function() {
189
-			<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
189
+			<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
190 190
 			alert("<?php echo $_lang['alert_delete_self']; ?>");
191 191
 			<?php } else { ?>
192 192
 			if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) {
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	$evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
210 210
 		"id" => $user
211 211
 	));
212
-	if(is_array($evtOut)) {
212
+	if (is_array($evtOut)) {
213 213
 		echo implode("", $evtOut);
214 214
 	}
215 215
 	?>
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	<input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" />
219 219
 
220 220
 	<h1>
221
-        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?>
221
+        <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?>
222 222
     </h1>
223 223
 
224 224
 	<?php echo $_style['actionbuttons']['dynamic']['user'] ?>
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
 				<table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser">
237 237
 					<tr>
238 238
 						<td colspan="3"><span id="blocked" class="warning">
239
-							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
239
+							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
240 240
 								<?php echo $_lang['user_is_blocked']; ?>
241 241
 							<?php } ?>
242 242
 							</span>
243 243
 							<br /></td>
244 244
 					</tr>
245
-					<?php if(!empty($userdata['id'])) { ?>
245
+					<?php if (!empty($userdata['id'])) { ?>
246 246
 						<tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> ">
247 247
 							<td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i>&nbsp;<b><?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span>
248 248
 								<input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" />
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 						<td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td>
256 256
 					</tr>
257 257
 					<tr>
258
-						<th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th>
258
+						<th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th>
259 259
 						<td>&nbsp;</td>
260 260
 						<td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "11" ? " checked disabled" : ""; ?>>
261 261
 							<input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" />
@@ -309,8 +309,8 @@  discard block
 block discarded – undo
309 309
 							?>
310 310
 							<select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px">
311 311
 								<?php
312
-								while($row = $modx->getDatabase()->getRow($rs)) {
313
-									if($modx->getManagerApi()->action == '11') {
312
+								while ($row = $modx->getDatabase()->getRow($rs)) {
313
+									if ($modx->getManagerApi()->action == '11') {
314 314
 										$selectedtext = $row['id'] == '1' ? ' selected="selected"' : '';
315 315
 									} else {
316 316
 										$selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : '';
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
365 365
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
366 366
 								<?php
367
-								foreach($_country_lang as $key => $country) {
368
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
367
+								foreach ($_country_lang as $key => $country) {
368
+									echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>";
369 369
 								}
370 370
 								?>
371 371
 							</select></td>
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 						<td>&nbsp;</td>
392 392
 						<td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars($userdata['comment']); ?></textarea></td>
393 393
 					</tr>
394
-					<?php if($modx->getManagerApi()->action == '12') { ?>
394
+					<?php if ($modx->getManagerApi()->action == '12') { ?>
395 395
 						<tr>
396 396
 							<th><?php echo $_lang['user_logincount']; ?>:</th>
397 397
 							<td>&nbsp;</td>
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 						</tr>
429 429
 					<?php } ?>
430 430
 				</table>
431
-				<?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
431
+				<?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
432 432
 					<p><?php echo $_lang['user_edit_self_msg']; ?></p>
433 433
 				<?php } ?>
434 434
 			</div>
@@ -445,8 +445,8 @@  discard block
 block discarded – undo
445 445
 								<?php
446 446
 								$activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : '';
447 447
 								$dir = dir("includes/lang");
448
-								while($file = $dir->read()) {
449
-									if(strpos($file, ".inc.php") > 0) {
448
+								while ($file = $dir->read()) {
449
+									if (strpos($file, ".inc.php") > 0) {
450 450
 										$endpos = strpos($file, ".");
451 451
 										$languagename = substr($file, 0, $endpos);
452 452
 										$selectedtext = $languagename == $activelang ? "selected='selected'" : "";
@@ -533,17 +533,17 @@  discard block
 block discarded – undo
533 533
 								<option value=""></option>
534 534
 								<?php
535 535
 								$dir = dir("media/style/");
536
-								while($file = $dir->read()) {
537
-									if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
536
+								while ($file = $dir->read()) {
537
+									if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
538 538
 										$themename = $file;
539
-										if($themename === 'common') {
539
+										if ($themename === 'common') {
540 540
 											continue;
541 541
 										}
542
-										$attr = 'value="' . $themename . '" ';
543
-										if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
542
+										$attr = 'value="'.$themename.'" ';
543
+										if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
544 544
 											$attr .= 'selected="selected" ';
545 545
 										}
546
-										echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
546
+										echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n";
547 547
 									}
548 548
 								}
549 549
 								$dir->close();
@@ -584,12 +584,12 @@  discard block
 block discarded – undo
584 584
 						<td><select name="which_browser" class="inputBox" onChange="documentDirty=true;">
585 585
 								<?php
586 586
 								$selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : '';
587
-								echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n";
588
-								foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
587
+								echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n";
588
+								foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
589 589
 									$dir = str_replace('\\', '/', $dir);
590 590
 									$browser_name = substr($dir, strrpos($dir, '/') + 1);
591 591
 									$selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : '';
592
-									echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
592
+									echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
593 593
 								}
594 594
 								?>
595 595
 							</select></td>
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
 					</tr>
617 617
 					<tr>
618 618
 						<td>&nbsp;</td>
619
-						<td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td>
619
+						<td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td>
620 620
 					</tr>
621 621
 					<tr>
622 622
 						<th><?php echo $_lang["uploadable_media_title"] ?></th>
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 					</tr>
629 629
 					<tr>
630 630
 						<td>&nbsp;</td>
631
-						<td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td>
631
+						<td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td>
632 632
 					</tr>
633 633
 					<tr>
634 634
 						<th><?php echo $_lang["uploadable_flash_title"] ?></th>
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 					</tr>
641 641
 					<tr>
642 642
 						<td>&nbsp;</td>
643
-						<td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td>
643
+						<td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td>
644 644
 					</tr>
645 645
 					<tr>
646 646
 						<th><?php echo $_lang["uploadable_files_title"] ?></th>
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
 					</tr>
653 653
 					<tr>
654 654
 						<td>&nbsp;</td>
655
-						<td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td>
655
+						<td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td>
656 656
 					</tr>
657 657
 					<tr class='row2'>
658 658
 						<th><?php echo $_lang["upload_maxsize_title"] ?></th>
@@ -671,11 +671,11 @@  discard block
 block discarded – undo
671 671
 								$edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : '';
672 672
 								// invoke OnRichTextEditorRegister event
673 673
 								$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
674
-								echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n";
675
-								if(is_array($evtOut)) {
676
-									for($i = 0; $i < count($evtOut); $i++) {
674
+								echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n";
675
+								if (is_array($evtOut)) {
676
+									for ($i = 0; $i < count($evtOut); $i++) {
677 677
 										$editor = $evtOut[$i];
678
-										echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
678
+										echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n";
679 679
 									}
680 680
 								}
681 681
 								?>
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 				<?php
714 714
 				// invoke OnInterfaceSettingsRender event
715 715
 				$evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
716
-				if(is_array($evtOut)) {
716
+				if (is_array($evtOut)) {
717 717
 					echo implode("", $evtOut);
718 718
 				}
719 719
 				?>
@@ -740,7 +740,7 @@  discard block
 block discarded – undo
740 740
 					function BrowseServer() {
741 741
 						var w = screen.width * 0.7;
742 742
 						var h = screen.height * 0.7;
743
-						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
743
+						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
744 744
 					}
745 745
 
746 746
 					function SetUrl(url, width, height, alt) {
@@ -763,17 +763,17 @@  discard block
 block discarded – undo
763 763
 					</tr>
764 764
 				</table>
765 765
 			</div>
766
-			<?php if($use_udperms == 1) {
766
+			<?php if ($use_udperms == 1) {
767 767
 
768 768
 			$groupsarray = array();
769 769
 
770
-			if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
770
+			if ($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
771 771
 				$rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772 772
 				$groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773 773
 			}
774 774
 			// retain selected doc groups between post
775
-			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
775
+			if (is_array($_POST['user_groups'])) {
776
+				foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
777 777
 			}
778 778
 			?>
779 779
 			<div class="tab-page" id="tabAccess">
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
783 783
 				<?php
784 784
 				$rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
785
-				while($row = $modx->getDatabase()->getRow($rs)) {
786
-					echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />";
785
+				while ($row = $modx->getDatabase()->getRow($rs)) {
786
+					echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />";
787 787
 				}
788 788
 				}
789 789
 				?>
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 	$evtOut = $modx->invokeEvent("OnUserFormRender", array(
797 797
 		"id" => $user
798 798
 	));
799
-	if(is_array($evtOut)) {
799
+	if (is_array($evtOut)) {
800 800
 		echo implode("", $evtOut);
801 801
 	}
802 802
 	?>
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@  discard block
 block discarded – undo
43 43
 	// get user settings
44 44
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
45 45
 	$usersettings = array();
46
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
46
+	while($row = $modx->getDatabase()->getRow($rs)) {
47
+	    $usersettings[$row['setting_name']] = $row['setting_value'];
48
+	}
47 49
 	// manually extract so that user display settings are not overwritten
48 50
 	foreach($usersettings as $k => $v) {
49 51
 		if($k != 'manager_language' && $k != 'manager_theme') {
@@ -767,13 +769,16 @@  discard block
 block discarded – undo
767 769
 
768 770
 			$groupsarray = array();
769 771
 
770
-			if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited
772
+			if($modx->getManagerApi()->action == '12') {
773
+// only do this bit if the user is being edited
771 774
 				$rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
772 775
 				$groupsarray = $modx->getDatabase()->getColumn('user_group', $rs);
773 776
 			}
774 777
 			// retain selected doc groups between post
775 778
 			if(is_array($_POST['user_groups'])) {
776
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
779
+				foreach($_POST['user_groups'] as $n => $v) {
780
+				    $groupsarray[] = $v;
781
+				}
777 782
 			}
778 783
 			?>
779 784
 			<div class="tab-page" id="tabAccess">
Please login to merge, or discard this patch.
manager/actions/mutate_template_tv_rank.dynamic.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10 10
 $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0;
11 11
 
12 12
 $tbl_site_templates = $modx->getFullTableName('site_templates');
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 $templatename = '';
20 20
 
21 21
 if (isset($_POST['listSubmitted'])) {
22
-    $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>';
22
+    $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>';
23 23
     foreach ($_POST as $listName => $listValue) {
24 24
         if ($listName == 'listSubmitted' || $listName == 'reset') {
25 25
             continue;
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
     while ($row = $modx->getDatabase()->getRow($rs)) {
48 48
         $templatename = $row['templatename'];
49 49
         $caption = $row['caption'] != '' ? $row['caption'] : $row['name'];
50
-        $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>';
50
+        $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>';
51 51
     }
52 52
     $sortableList .= '</ul></div>';
53 53
 } else {
54
-    $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>';
54
+    $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>';
55 55
 }
56 56
 ?>
57 57
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 </script>
129 129
 
130 130
 <h1>
131
-    <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?>
131
+    <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?>
132 132
 </h1>
133 133
 
134 134
 <?= $_style['actionbuttons']['dynamic']['save'] ?>
Please login to merge, or discard this patch.
manager/actions/logging.static.php 2 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('logs')) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                             $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username');
29 29
                             foreach ($logs_user as $row) {
30 30
                                 $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : '';
31
-                                echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n";
31
+                                echo "\t\t".'<option value="'.$row['internalKey'].'"'.$selectedtext.'>'.$row['username']."</option>\n";
32 32
                             }
33 33
                             ?>
34 34
                         </select>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                                     continue;
50 50
                                 }
51 51
                                 $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : '';
52
-                                echo "\t\t" . '<option value="' . $row['action'] . '"' . $selectedtext . '>' . $row['action'] . ' - ' . $action . "</option>\n";
52
+                                echo "\t\t".'<option value="'.$row['action'].'"'.$selectedtext.'>'.$row['action'].' - '.$action."</option>\n";
53 53
                             }
54 54
                             ?>
55 55
                         </select>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                             $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid');
66 66
                             foreach ($logs_items as $row) {
67 67
                                 $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : '';
68
-                                echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n";
68
+                                echo "\t\t".'<option value="'.$row['itemid'].'"'.$selectedtext.'>'.$row['itemid']."</option>\n";
69 69
                             }
70 70
                             ?>
71 71
                         </select>
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                             $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname');
82 82
                             foreach ($logs_names as $row) {
83 83
                                 $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : '';
84
-                                echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n";
84
+                                echo "\t\t".'<option value="'.$row['itemname'].'"'.$selectedtext.'>'.$row['itemname']."</option>\n";
85 85
                             }
86 86
                             ?>
87 87
                         </select>
@@ -139,26 +139,26 @@  discard block
 block discarded – undo
139 139
     // get the selections the user made.
140 140
     $sqladd = array();
141 141
     if ($_REQUEST['searchuser'] != 0) {
142
-        $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'";
142
+        $sqladd[] = "internalKey='".(int) $_REQUEST['searchuser']."'";
143 143
     }
144 144
     if ($_REQUEST['action'] != 0) {
145
-        $sqladd[] = "action=" . (int)$_REQUEST['action'];
145
+        $sqladd[] = "action=".(int) $_REQUEST['action'];
146 146
     }
147 147
     if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
148
-        $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'";
148
+        $sqladd[] = "itemid='".$_REQUEST['itemid']."'";
149 149
     }
150 150
     if ($_REQUEST['itemname'] != '0') {
151
-        $sqladd[] = "itemname='" . $modx->getDatabase()->escape($_REQUEST['itemname']) . "'";
151
+        $sqladd[] = "itemname='".$modx->getDatabase()->escape($_REQUEST['itemname'])."'";
152 152
     }
153 153
     if ($_REQUEST['message'] != "") {
154
-        $sqladd[] = "message LIKE '%" . $modx->getDatabase()->escape($_REQUEST['message']) . "%'";
154
+        $sqladd[] = "message LIKE '%".$modx->getDatabase()->escape($_REQUEST['message'])."%'";
155 155
     }
156 156
     // date stuff
157 157
     if ($_REQUEST['datefrom'] != "") {
158
-        $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']);
158
+        $sqladd[] = "timestamp>".$modx->toTimeStamp($_REQUEST['datefrom']);
159 159
     }
160 160
     if ($_REQUEST['dateto'] != "") {
161
-        $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']);
161
+        $sqladd[] = "timestamp<".$modx->toTimeStamp($_REQUEST['dateto']);
162 162
     }
163 163
 
164 164
     // If current position is not set, set it to zero
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     // Number of result to display on the page, will be in the LIMIT of the sql query also
172 172
     $int_num_result = is_numeric($_REQUEST['nrresults']) ? $_REQUEST['nrresults'] : $number_of_logs;
173 173
 
174
-    $extargv = "&a=13&searchuser=" . $_REQUEST['searchuser'] . "&action=" . $_REQUEST['action'] . "&itemid=" . $_REQUEST['itemid'] . "&itemname=" . $_REQUEST['itemname'] . "&message=" . $_REQUEST['message'] . "&dateto=" . $_REQUEST['dateto'] . "&datefrom=" . $_REQUEST['datefrom'] . "&nrresults=" . $int_num_result . "&log_submit=" . $_REQUEST['log_submit']; // extra argv here (could be anything depending on your page)
174
+    $extargv = "&a=13&searchuser=".$_REQUEST['searchuser']."&action=".$_REQUEST['action']."&itemid=".$_REQUEST['itemid']."&itemname=".$_REQUEST['itemname']."&message=".$_REQUEST['message']."&dateto=".$_REQUEST['dateto']."&datefrom=".$_REQUEST['datefrom']."&nrresults=".$int_num_result."&log_submit=".$_REQUEST['log_submit']; // extra argv here (could be anything depending on your page)
175 175
 
176 176
     // build the sql
177 177
     $limit = $num_rows = $modx->getDatabase()->getValue($modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : '')));
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
     $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
180 180
 
181 181
 if ($limit < 1) {
182
-    echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>';
182
+    echo '<p>'.$_lang["mgrlog_emptysrch"].'</p>';
183 183
 } else {
184
-    echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>';
184
+    echo '<p>'.$_lang["mgrlog_sortinst"].'</p>';
185 185
 
186 186
     // New instance of the Paging class, you can modify the color and the width of the html table
187 187
     $p = new EvolutionCMS\Support\Paginate($num_rows, $int_cur_position, $int_num_result, $extargv);
@@ -192,11 +192,11 @@  discard block
 block discarded – undo
192 192
     $current_row = $int_cur_position / $int_num_result;
193 193
 
194 194
     // Display the result as you like...
195
-    print "<p>" . $_lang["paging_showing"] . " " . $array_paging['lower'];
196
-    print " " . $_lang["paging_to"] . " " . $array_paging['upper'];
197
-    print " (" . $array_paging['total'] . " " . $_lang["paging_total"] . ")<br />";
198
-    $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " ");
199
-    $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " ");
195
+    print "<p>".$_lang["paging_showing"]." ".$array_paging['lower'];
196
+    print " ".$_lang["paging_to"]." ".$array_paging['upper'];
197
+    print " (".$array_paging['total']." ".$_lang["paging_total"].")<br />";
198
+    $paging = $array_paging['first_link'].$_lang["paging_first"].(isset($array_paging['first_link']) ? "</a> " : " ");
199
+    $paging .= $array_paging['previous_link'].$_lang["paging_prev"].(isset($array_paging['previous_link']) ? "</a> " : " ");
200 200
     $pagesfound = sizeof($array_row_paging);
201 201
     if ($pagesfound > 6) {
202 202
         $paging .= $array_row_paging[$current_row - 2]; // ."&nbsp;";
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
         $paging .= $array_row_paging[$current_row + 2]; // ."&nbsp;";
207 207
     } else {
208 208
         for ($i = 0; $i < $pagesfound; $i++) {
209
-            $paging .= $array_row_paging[$i] . "&nbsp;";
209
+            $paging .= $array_row_paging[$i]."&nbsp;";
210 210
         }
211 211
     }
212
-    $paging .= $array_paging['next_link'] . $_lang["paging_next"] . (isset($array_paging['next_link']) ? "</a> " : " ") . " ";
213
-    $paging .= $array_paging['last_link'] . $_lang["paging_last"] . (isset($array_paging['last_link']) ? "</a> " : " ") . " ";
212
+    $paging .= $array_paging['next_link'].$_lang["paging_next"].(isset($array_paging['next_link']) ? "</a> " : " ")." ";
213
+    $paging .= $array_paging['last_link'].$_lang["paging_last"].(isset($array_paging['last_link']) ? "</a> " : " ")." ";
214 214
     // The above exemple print somethings like:
215 215
     // Results 1 to 20 of 597  <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>>
216 216
     // Of course you can now play with array_row_paging in order to print
@@ -246,16 +246,16 @@  discard block
 block discarded – undo
246 246
                     if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
247 247
                         $item = '<div style="text-align:center;">-</div>';
248 248
                     } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
249
-                        $item = '<a href="index.php?a=3&amp;id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>';
249
+                        $item = '<a href="index.php?a=3&amp;id='.$logentry['itemid'].'">'.$logentry['itemname'].'</a>';
250 250
                     } else {
251 251
                         $item = $logentry['itemname'];
252 252
                     }
253 253
                     //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true'
254
-                    $user_drill = 'index.php?a=13&searchuser=' . $logentry['internalKey'] . '&itemname=0&log_submit=true';
254
+                    $user_drill = 'index.php?a=13&searchuser='.$logentry['internalKey'].'&itemname=0&log_submit=true';
255 255
                     ?>
256 256
                     <tr>
257
-                        <td><?= '<a href="' . $user_drill . '">' . $logentry['username'] . '</a>' ?></td>
258
-                        <td class="text-nowrap"><?= '[' . $logentry['action'] . '] ' . $logentry['message'] ?></td>
257
+                        <td><?= '<a href="'.$user_drill.'">'.$logentry['username'].'</a>' ?></td>
258
+                        <td class="text-nowrap"><?= '['.$logentry['action'].'] '.$logentry['message'] ?></td>
259 259
                         <td class="text-xs-right"><?= $logentry['itemid'] ?></td>
260 260
                         <td><?= $item ?></td>
261 261
                         <td class="text-nowrap"><?= $modx->toDateFormat($logentry['timestamp'] + $server_offset_time) ?></td>
Please login to merge, or discard this patch.
Braces   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if (!$modx->hasPermission('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                             <?php
27 27
                             // get all users currently in the log
28 28
                             $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username');
29
-                            foreach ($logs_user as $row) {
29
+                            foreach ($logs_user as $row) {
30 30
                                 $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : '';
31 31
                                 echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n";
32 32
                             }
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
                             // get all available actions in the log
44 44
                             include_once "actionlist.inc.php";
45 45
                             $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action');
46
-                            foreach ($logs_actions as $row) {
46
+                            foreach ($logs_actions as $row) {
47 47
                                 $action = getAction($row['action']);
48
-                                if ($action == 'Idle') {
48
+                                if ($action == 'Idle') {
49 49
                                     continue;
50 50
                                 }
51 51
                                 $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : '';
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                             <?php
64 64
                             // get all itemid currently in logging
65 65
                             $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid');
66
-                            foreach ($logs_items as $row) {
66
+                            foreach ($logs_items as $row) {
67 67
                                 $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : '';
68 68
                                 echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n";
69 69
                             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                             <?php
80 80
                             // get all itemname currently in logging
81 81
                             $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname');
82
-                            foreach ($logs_names as $row) {
82
+                            foreach ($logs_names as $row) {
83 83
                                 $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : '';
84 84
                                 echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n";
85 85
                             }
@@ -135,36 +135,36 @@  discard block
 block discarded – undo
135 135
     <div class="container container-body">
136 136
 
137 137
 <?php
138
-if (isset($_REQUEST['log_submit'])) {
138
+if (isset($_REQUEST['log_submit'])) {
139 139
     // get the selections the user made.
140 140
     $sqladd = array();
141
-    if ($_REQUEST['searchuser'] != 0) {
141
+    if ($_REQUEST['searchuser'] != 0) {
142 142
         $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'";
143 143
     }
144
-    if ($_REQUEST['action'] != 0) {
144
+    if ($_REQUEST['action'] != 0) {
145 145
         $sqladd[] = "action=" . (int)$_REQUEST['action'];
146 146
     }
147
-    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
147
+    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
148 148
         $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'";
149 149
     }
150
-    if ($_REQUEST['itemname'] != '0') {
150
+    if ($_REQUEST['itemname'] != '0') {
151 151
         $sqladd[] = "itemname='" . $modx->getDatabase()->escape($_REQUEST['itemname']) . "'";
152 152
     }
153
-    if ($_REQUEST['message'] != "") {
153
+    if ($_REQUEST['message'] != "") {
154 154
         $sqladd[] = "message LIKE '%" . $modx->getDatabase()->escape($_REQUEST['message']) . "%'";
155 155
     }
156 156
     // date stuff
157
-    if ($_REQUEST['datefrom'] != "") {
157
+    if ($_REQUEST['datefrom'] != "") {
158 158
         $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']);
159 159
     }
160
-    if ($_REQUEST['dateto'] != "") {
160
+    if ($_REQUEST['dateto'] != "") {
161 161
         $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']);
162 162
     }
163 163
 
164 164
     // If current position is not set, set it to zero
165
-    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
165
+    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
166 166
         $int_cur_position = 0;
167
-    } else {
167
+    } else {
168 168
         $int_cur_position = $_REQUEST['int_cur_position'];
169 169
     }
170 170
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
     $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
180 180
 
181
-if ($limit < 1) {
181
+if ($limit < 1) {
182 182
     echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>';
183
-} else {
183
+} else {
184 184
     echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>';
185 185
 
186 186
     // New instance of the Paging class, you can modify the color and the width of the html table
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
     $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " ");
199 199
     $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " ");
200 200
     $pagesfound = sizeof($array_row_paging);
201
-    if ($pagesfound > 6) {
201
+    if ($pagesfound > 6) {
202 202
         $paging .= $array_row_paging[$current_row - 2]; // ."&nbsp;";
203 203
         $paging .= $array_row_paging[$current_row - 1]; // ."&nbsp;";
204 204
         $paging .= $array_row_paging[$current_row]; // ."&nbsp;";
205 205
         $paging .= $array_row_paging[$current_row + 1]; // ."&nbsp;";
206 206
         $paging .= $array_row_paging[$current_row + 2]; // ."&nbsp;";
207
-    } else {
208
-        for ($i = 0; $i < $pagesfound; $i++) {
207
+    } else {
208
+        for ($i = 0; $i < $pagesfound; $i++) {
209 209
             $paging .= $array_row_paging[$i] . "&nbsp;";
210 210
         }
211 211
     }
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
                 // grab the entire log file...
243 243
                 $logentries = array();
244 244
                 $i = 0;
245
-                while ($logentry = $modx->getDatabase()->getRow($rs)) {
246
-                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
245
+                while ($logentry = $modx->getDatabase()->getRow($rs)) {
246
+                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
247 247
                         $item = '<div style="text-align:center;">-</div>';
248
-                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
248
+                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
249 249
                         $item = '<a href="index.php?a=3&amp;id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>';
250
-                    } else {
250
+                    } else {
251 251
                         $item = $logentry['itemname'];
252 252
                     }
253 253
                     //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true'
@@ -284,6 +284,6 @@  discard block
 block discarded – undo
284 284
     // @see index.php @ 915
285 285
     global $action;
286 286
     $action = 1;
287
-} else {
287
+} else {
288 288
     echo $_lang["mgrlog_noquery"];
289 289
 }
Please login to merge, or discard this patch.
manager/actions/mutate_role.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 ((int)$modx->getManagerApi()->action) {
7
-    case 35:
8
-        if (!$modx->hasPermission('edit_role')) {
9
-            $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
-        }
11
-        break;
12
-    case 38:
13
-        if (!$modx->hasPermission('new_role')) {
7
+        case 35:
8
+            if (!$modx->hasPermission('edit_role')) {
9
+                $modx->webAlertAndQuit($_lang["error_no_privileges"]);
10
+            }
11
+            break;
12
+        case 38:
13
+            if (!$modx->hasPermission('new_role')) {
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
 $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-switch ((int)$modx->getManagerApi()->action) {
6
+switch ((int) $modx->getManagerApi()->action) {
7 7
     case 35:
8 8
         if (!$modx->hasPermission('edit_role')) {
9 9
             $modx->webAlertAndQuit($_lang["error_no_privileges"]);
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 $tbl_user_roles = $modx->getFullTableName('user_roles');
24 24
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 // Add lock-element JS-Script
47 47
 $lockElementId = $role;
48 48
 $lockElementType = 8;
49
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
49
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
50 50
 ?>
51 51
 <script type="text/javascript">
52 52
     function changestate(element) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     <input type="hidden" name="id" value="<?= $_GET['id'] ?>">
83 83
 
84 84
     <h1>
85
-        <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?>
85
+        <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?>
86 86
     </h1>
87 87
 
88 88
     <?= $_style['actionbuttons']['dynamic']['savedelete'] ?>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab1_site_settings.inc.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-  $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default'];
2
+    $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default'];
3 3
 ?>
4 4
 <style>
5 5
 table.sysSettings > tbody td, table.sysSettings > tbody th {border-bottom:1px dotted #ccc;padding:10px;}
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
         <?php
136 136
             // Check if PHX is enabled
137 137
             $count = $modx->getDatabase()->getRecordCount(
138
-              $modx->getDatabase()->select('id', '[+prefix+]site_plugins',
139
-              "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1")
138
+                $modx->getDatabase()->select('id', '[+prefix+]site_plugins',
139
+                "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1")
140 140
             );
141 141
             if($count) {
142 142
                 $disabledFilters = 1;
@@ -259,14 +259,14 @@  discard block
 block discarded – undo
259 259
       <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th>
260 260
       <td> <select name="server_offset_time" size="1" class="inputBox">
261 261
           <?php
262
-      for($i=-24; $i<25; $i++) {
263
-          $seconds = $i*60*60;
264
-          $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
265
-      ?>
262
+        for($i=-24; $i<25; $i++) {
263
+            $seconds = $i*60*60;
264
+            $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
265
+        ?>
266 266
           <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option>
267 267
           <?php
268
-      }
269
-      ?>
268
+        }
269
+        ?>
270 270
         </select>
271 271
         <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div>
272 272
         </td>
Please login to merge, or discard this patch.
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
   <tr>
14 14
     <th><?php echo $_lang['sitestatus_title'] ?><br><small>[(site_status)]</small></th>
15 15
     <td>
16
-        <?php echo wrap_label($_lang['online'],  form_radio('site_status', 1));?><br />
17
-        <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0));?>
16
+        <?php echo wrap_label($_lang['online'], form_radio('site_status', 1)); ?><br />
17
+        <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0)); ?>
18 18
     </td>
19 19
   </tr>
20 20
   <tr>
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
       <br />
59 59
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
60 60
       <select name="reload_site_unavailable" id="reload_site_unavailable_select" onchange="confirmLangChange(this, 'siteunavailable_message_default', 'site_unavailable_message_textarea');">
61
-<?php echo get_lang_options('siteunavailable_message_default');?>
61
+<?php echo get_lang_options('siteunavailable_message_default'); ?>
62 62
       </select>
63 63
     </th>
64 64
     <td> <textarea name="site_unavailable_message" id="site_unavailable_message_textarea" style="width:100%; height: 120px;"><?php echo $site_unavailable_message_view; ?></textarea>
65
-        <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']);?>" />
66
-  <div class="comment"><?php echo $_lang['siteunavailable_message'];?></div>
65
+        <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']); ?>" />
66
+  <div class="comment"><?php echo $_lang['siteunavailable_message']; ?></div>
67 67
     </td>
68 68
   </tr>
69 69
   <tr>
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
             'c.category, t.templatename ASC'
79 79
             );
80 80
     ?>
81
-      <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template;?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px">
81
+      <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template; ?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px">
82 82
         <?php
83 83
 
84 84
         $currentCategory = '';
85 85
                         while ($row = $modx->getDatabase()->getRow($rs)) {
86 86
             $thisCategory = $row['category'];
87
-            if($thisCategory == null) {
87
+            if ($thisCategory == null) {
88 88
                 $thisCategory = $_lang['no_category'];
89 89
             }
90
-            if($thisCategory != $currentCategory) {
91
-                if($closeOptGroup) {
90
+            if ($thisCategory != $currentCategory) {
91
+                if ($closeOptGroup) {
92 92
                     echo "\t\t\t\t\t</optgroup>\n";
93 93
                 }
94 94
                 echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
107 107
             $currentCategory = $thisCategory;
108 108
         }
109
-        if($thisCategory != '') {
109
+        if ($thisCategory != '') {
110 110
             echo "\t\t\t\t\t</optgroup>\n";
111 111
         }
112 112
 ?>
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
           <br />
115 115
         <div id="template_reset_options_wrapper" style="display:none;">
116 116
             <label><input type="radio" name="reset_template" value="1" /> <?php echo $_lang['template_reset_all']; ?></label><br />
117
-            <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'],$oldTmpName); ?></label>
117
+            <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'], $oldTmpName); ?></label>
118 118
         </div>
119 119
         <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" />
120 120
   <div class="comment"><?php echo $_lang['defaulttemplate_message'] ?></div>
121 121
     </td>
122 122
   </tr>
123 123
   <tr>
124
-        <th><?php echo $_lang['defaulttemplate_logic_title'];?><br><small>[(auto_template_logic)]</small></th>
124
+        <th><?php echo $_lang['defaulttemplate_logic_title']; ?><br><small>[(auto_template_logic)]</small></th>
125 125
         <td>
126
-            <p><?php echo $_lang['defaulttemplate_logic_general_message'];?></p>
127
-            <label><input type="radio" name="auto_template_logic" value="system"<?php if($auto_template_logic == 'system') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br />
128
-            <label><input type="radio" name="auto_template_logic" value="parent"<?php if($auto_template_logic == 'parent') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br />
129
-            <label><input type="radio" name="auto_template_logic" value="sibling"<?php if($auto_template_logic == 'sibling') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br />
126
+            <p><?php echo $_lang['defaulttemplate_logic_general_message']; ?></p>
127
+            <label><input type="radio" name="auto_template_logic" value="system"<?php if ($auto_template_logic == 'system') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br />
128
+            <label><input type="radio" name="auto_template_logic" value="parent"<?php if ($auto_template_logic == 'parent') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br />
129
+            <label><input type="radio" name="auto_template_logic" value="sibling"<?php if ($auto_template_logic == 'sibling') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br />
130 130
         </td>
131 131
     </tr>
132 132
     <tr>
@@ -138,22 +138,22 @@  discard block
 block discarded – undo
138 138
               $modx->getDatabase()->select('id', '[+prefix+]site_plugins',
139 139
               "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1")
140 140
             );
141
-            if($count) {
141
+            if ($count) {
142 142
                 $disabledFilters = 1;
143 143
                 echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>';
144 144
             }
145 145
             else $disabledFilters = false;
146 146
         ?>
147
-        <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br />
148
-        <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?>
147
+        <?php echo wrap_label($_lang['yes'], form_radio('enable_filter', 1, '', $disabledFilters)); ?><br />
148
+        <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters)); ?>
149 149
         <div class="comment"><?php echo $_lang['enable_filter_message']; ?></div>
150 150
       </td>
151 151
     </tr>
152 152
     <tr>
153 153
       <th><?php echo $_lang['enable_at_syntax_title'] ?><br><small>[(enable_at_syntax)]</small></th>
154 154
       <td >
155
-        <?php echo wrap_label($_lang['yes'],form_radio('enable_at_syntax', 1));?><br />
156
-        <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0));?>
155
+        <?php echo wrap_label($_lang['yes'], form_radio('enable_at_syntax', 1)); ?><br />
156
+        <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0)); ?>
157 157
         <div class="comment">
158 158
             <?php echo $_lang['enable_at_syntax_message']; ?>
159 159
             <ul>
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
   <tr>
168 168
     <th><?php echo $_lang['defaultpublish_title'] ?><br><small>[(publish_default)]</small></th>
169 169
     <td>
170
-        <?php echo wrap_label($_lang['yes'],form_radio('publish_default', 1));?><br />
171
-        <?php echo wrap_label($_lang['no'],form_radio('publish_default', 0));?>
170
+        <?php echo wrap_label($_lang['yes'], form_radio('publish_default', 1)); ?><br />
171
+        <?php echo wrap_label($_lang['no'], form_radio('publish_default', 0)); ?>
172 172
         <div class="comment"><?php echo $_lang['defaultpublish_message'] ?></div>
173 173
     </td>
174 174
   </tr>
@@ -176,24 +176,24 @@  discard block
 block discarded – undo
176 176
   <tr>
177 177
     <th><?php echo $_lang['defaultcache_title'] ?><br><small>[(cache_default)]</small></th>
178 178
     <td>
179
-        <?php echo wrap_label($_lang['yes'],form_radio('cache_default', 1));?><br />
180
-        <?php echo wrap_label($_lang['no'],form_radio('cache_default', 0));?>
179
+        <?php echo wrap_label($_lang['yes'], form_radio('cache_default', 1)); ?><br />
180
+        <?php echo wrap_label($_lang['no'], form_radio('cache_default', 0)); ?>
181 181
         <div class="comment"><?php echo $_lang['defaultcache_message'] ?></div>
182 182
     </td>
183 183
   </tr>
184 184
   <tr>
185 185
     <th><?php echo $_lang['defaultsearch_title'] ?><br><small>[(search_default)]</small></th>
186 186
     <td>
187
-        <?php echo wrap_label($_lang['yes'],form_radio('search_default', 1));?><br />
188
-        <?php echo wrap_label($_lang['no'],form_radio('search_default', 0));?>
187
+        <?php echo wrap_label($_lang['yes'], form_radio('search_default', 1)); ?><br />
188
+        <?php echo wrap_label($_lang['no'], form_radio('search_default', 0)); ?>
189 189
         <div class="comment"><?php echo $_lang['defaultsearch_message'] ?></div>
190 190
     </td>
191 191
   </tr>
192 192
   <tr>
193 193
     <th><?php echo $_lang['defaultmenuindex_title'] ?><br><small>[(auto_menuindex)]</small></th>
194 194
     <td>
195
-        <?php echo wrap_label($_lang['yes'],form_radio('auto_menuindex', 1));?><br />
196
-        <?php echo wrap_label($_lang['no'],form_radio('auto_menuindex', 0));?>
195
+        <?php echo wrap_label($_lang['yes'], form_radio('auto_menuindex', 1)); ?><br />
196
+        <?php echo wrap_label($_lang['no'], form_radio('auto_menuindex', 0)); ?>
197 197
         <div class="comment"><?php echo $_lang['defaultmenuindex_message'] ?></div>
198 198
     </td>
199 199
   </tr>
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
204 204
     <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5">
205 205
     <?php
206
-        $ct = explode(",",$custom_contenttype);
207
-        for($i=0;$i<count($ct);$i++) {
206
+        $ct = explode(",", $custom_contenttype);
207
+        for ($i = 0; $i < count($ct); $i++) {
208 208
             echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>";
209 209
         }
210 210
     ?>
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 <th><?php echo $_lang['docid_incrmnt_method_title'] ?><br><small>[(docid_incrmnt_method)]</small></th>
219 219
 <td>
220 220
 <label><input type="radio" name="docid_incrmnt_method" value="0"
221
-    <?php echo ($docid_incrmnt_method=='0') ? 'checked="checked"' : "" ; ?> />
221
+    <?php echo ($docid_incrmnt_method == '0') ? 'checked="checked"' : ""; ?> />
222 222
     <?php echo $_lang['docid_incrmnt_method_0']?></label><br />
223 223
 
224 224
 <label><input type="radio" name="docid_incrmnt_method" value="1"
225
-    <?php echo ($docid_incrmnt_method=='1') ? 'checked="checked"' : "" ; ?> />
225
+    <?php echo ($docid_incrmnt_method == '1') ? 'checked="checked"' : ""; ?> />
226 226
     <?php echo $_lang['docid_incrmnt_method_1']?></label><br />
227 227
 <label><input type="radio" name="docid_incrmnt_method" value="2"
228
-    <?php echo ($docid_incrmnt_method=='2') ? 'checked="checked"' : "" ; ?> />
228
+    <?php echo ($docid_incrmnt_method == '2') ? 'checked="checked"' : ""; ?> />
229 229
     <?php echo $_lang['docid_incrmnt_method_2']?></label><br />
230 230
 </td>
231 231
 </tr>
@@ -233,24 +233,24 @@  discard block
 block discarded – undo
233 233
 <tr>
234 234
 <th><?php echo $_lang['enable_cache_title'] ?><br><small>[(enable_cache)]</small></th>
235 235
 <td>
236
-    <?php echo wrap_label($_lang['enabled'],form_radio('enable_cache', 1));?><br />
237
-    <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0));?><br />
238
-    <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2));?>
236
+    <?php echo wrap_label($_lang['enabled'], form_radio('enable_cache', 1)); ?><br />
237
+    <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0)); ?><br />
238
+    <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2)); ?>
239 239
 </td>
240 240
 </tr>
241 241
 
242 242
 <tr>
243 243
 <th><?php echo $_lang['cache_type_title'] ?><br><small>[(cache_type)]</small></th>
244 244
 <td>
245
-<?php echo wrap_label($_lang['cache_type_1'],form_radio('cache_type', 1));?><br />
246
-<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2));?>
245
+<?php echo wrap_label($_lang['cache_type_1'], form_radio('cache_type', 1)); ?><br />
246
+<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2)); ?>
247 247
 </td>
248 248
 </tr>
249 249
   <tr>
250 250
 <th><?php echo $_lang['minifyphp_incache_title'] ?><br><small>[(minifyphp_incache)]</small></th>
251 251
     <td>
252
-<?php echo wrap_label($_lang['enabled'],form_radio('minifyphp_incache', 1));?><br />
253
-<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0));?>
252
+<?php echo wrap_label($_lang['enabled'], form_radio('minifyphp_incache', 1)); ?><br />
253
+<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0)); ?>
254 254
 <div class="comment"><?php echo $_lang['minifyphp_incache_message'] ?></div>
255 255
     </td>
256 256
   </tr>
@@ -259,23 +259,23 @@  discard block
 block discarded – undo
259 259
       <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th>
260 260
       <td> <select name="server_offset_time" size="1" class="inputBox">
261 261
           <?php
262
-      for($i=-24; $i<25; $i++) {
263
-          $seconds = $i*60*60;
264
-          $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
262
+      for ($i = -24; $i < 25; $i++) {
263
+          $seconds = $i * 60 * 60;
264
+          $selectedtext = $seconds == $server_offset_time ? "selected='selected'" : "";
265 265
       ?>
266 266
           <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option>
267 267
           <?php
268 268
       }
269 269
       ?>
270 270
         </select>
271
-        <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div>
271
+        <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time() + $server_offset_time)); ?></div>
272 272
         </td>
273 273
     </tr>
274 274
     <tr>
275 275
       <th><?php echo $_lang['server_protocol_title'] ?><br><small>[(server_protocol)]</small></th>
276 276
       <td>
277
-        <?php echo wrap_label($_lang['server_protocol_http'],form_radio('server_protocol', 'http'));?><br />
278
-        <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https'));?>
277
+        <?php echo wrap_label($_lang['server_protocol_http'], form_radio('server_protocol', 'http')); ?><br />
278
+        <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https')); ?>
279 279
         <div class="comment"><?php echo $_lang['server_protocol_message'] ?></div>
280 280
       </td>
281 281
     </tr>
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
     <tr>
289 289
      <th><?php echo $_lang['track_visitors_title'] ?><br><small>[(track_visitors)]</small></th>
290 290
      <td>
291
-         <?php echo wrap_label($_lang['yes'],form_radio('track_visitors', 1));?><br />
292
-         <?php echo wrap_label($_lang['no'],form_radio('track_visitors', 0));?>
291
+         <?php echo wrap_label($_lang['yes'], form_radio('track_visitors', 1)); ?><br />
292
+         <?php echo wrap_label($_lang['no'], form_radio('track_visitors', 0)); ?>
293 293
          <div class="comment"><?php echo $_lang['track_visitors_message'] ?></div>
294 294
      </td>
295 295
    </tr>
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         <?php
302 302
             // invoke OnSiteSettingsRender event
303 303
             $evtOut = $modx->invokeEvent('OnSiteSettingsRender');
304
-            if(is_array($evtOut)) echo implode("",$evtOut);
304
+            if (is_array($evtOut)) echo implode("", $evtOut);
305 305
         ?>
306 306
     </td>
307 307
   </tr>
Please login to merge, or discard this patch.
Braces   +16 added lines, -13 removed lines patch added patch discarded remove patch
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
         <?php
83 83
 
84 84
         $currentCategory = '';
85
-                        while ($row = $modx->getDatabase()->getRow($rs)) {
85
+                        while ($row = $modx->getDatabase()->getRow($rs)) {
86 86
             $thisCategory = $row['category'];
87
-            if($thisCategory == null) {
87
+            if($thisCategory == null) {
88 88
                 $thisCategory = $_lang['no_category'];
89 89
             }
90
-            if($thisCategory != $currentCategory) {
91
-                if($closeOptGroup) {
90
+            if($thisCategory != $currentCategory) {
91
+                if($closeOptGroup) {
92 92
                     echo "\t\t\t\t\t</optgroup>\n";
93 93
                 }
94 94
                 echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
95 95
                 $closeOptGroup = true;
96
-            } else {
96
+            } else {
97 97
                 $closeOptGroup = false;
98 98
             }
99 99
 
100 100
             $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : '';
101
-            if ($selectedtext) {
101
+            if ($selectedtext) {
102 102
                 $oldTmpId = $row['id'];
103 103
                 $oldTmpName = $row['templatename'];
104 104
             }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
107 107
             $currentCategory = $thisCategory;
108 108
         }
109
-        if($thisCategory != '') {
109
+        if($thisCategory != '') {
110 110
             echo "\t\t\t\t\t</optgroup>\n";
111 111
         }
112 112
 ?>
@@ -138,11 +138,12 @@  discard block
 block discarded – undo
138 138
               $modx->getDatabase()->select('id', '[+prefix+]site_plugins',
139 139
               "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1")
140 140
             );
141
-            if($count) {
141
+            if($count) {
142 142
                 $disabledFilters = 1;
143 143
                 echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>';
144
-            }
145
-            else $disabledFilters = false;
144
+            } else {
145
+                $disabledFilters = false;
146
+            }
146 147
         ?>
147 148
         <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br />
148 149
         <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?>
@@ -204,7 +205,7 @@  discard block
 block discarded – undo
204 205
     <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5">
205 206
     <?php
206 207
         $ct = explode(",",$custom_contenttype);
207
-        for($i=0;$i<count($ct);$i++) {
208
+        for($i=0;$i<count($ct);$i++) {
208 209
             echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>";
209 210
         }
210 211
     ?>
@@ -259,7 +260,7 @@  discard block
 block discarded – undo
259 260
       <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th>
260 261
       <td> <select name="server_offset_time" size="1" class="inputBox">
261 262
           <?php
262
-      for($i=-24; $i<25; $i++) {
263
+      for($i=-24; $i<25; $i++) {
263 264
           $seconds = $i*60*60;
264 265
           $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
265 266
       ?>
@@ -301,7 +302,9 @@  discard block
 block discarded – undo
301 302
         <?php
302 303
             // invoke OnSiteSettingsRender event
303 304
             $evtOut = $modx->invokeEvent('OnSiteSettingsRender');
304
-            if(is_array($evtOut)) echo implode("",$evtOut);
305
+            if(is_array($evtOut)) {
306
+                echo implode("",$evtOut);
307
+            }
305 308
         ?>
306 309
     </td>
307 310
   </tr>
Please login to merge, or discard this patch.