Completed
Pull Request — develop (#725)
by Agel_Nash
08:07
created
manager/actions/mutate_module_resources.dynamic.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('edit_module')) {
6
+if (!$modx->hasPermission('edit_module')) {
7 7
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 }
9 9
 
10
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
10
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // Get table names (alphabetical)
13 13
 $tbl_active_users = $modx->getFullTableName('active_users');
@@ -24,41 +24,41 @@  discard block
 block discarded – undo
24 24
 $modx->getManagerApi()->initPageViewState();
25 25
 
26 26
 // check to see the  editor isn't locked
27
-$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'");
28
-if($username = $modx->getDatabase()->getValue($rs)) {
27
+$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'");
28
+if ($username = $modx->getDatabase()->getValue($rs)) {
29 29
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module'));
30 30
 }
31 31
 // end check for lock
32 32
 
33 33
 // take action
34
-switch($_REQUEST['op']) {
34
+switch ($_REQUEST['op']) {
35 35
 	case 'add':
36 36
 		// convert ids to numbers
37 37
 		$opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids'])));
38 38
 
39
-		if(count($opids) > 0) {
39
+		if (count($opids) > 0) {
40 40
 			// 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs
41 41
 			$rt = strtolower($_REQUEST["rt"]);
42
-			if($rt == 'chunk') {
42
+			if ($rt == 'chunk') {
43 43
 				$type = 10;
44 44
 			}
45
-			if($rt == 'doc') {
45
+			if ($rt == 'doc') {
46 46
 				$type = 20;
47 47
 			}
48
-			if($rt == 'plug') {
48
+			if ($rt == 'plug') {
49 49
 				$type = 30;
50 50
 			}
51
-			if($rt == 'snip') {
51
+			if ($rt == 'snip') {
52 52
 				$type = 40;
53 53
 			}
54
-			if($rt == 'tpl') {
54
+			if ($rt == 'tpl') {
55 55
 				$type = 50;
56 56
 			}
57
-			if($rt == 'tv') {
57
+			if ($rt == 'tv') {
58 58
 				$type = 60;
59 59
 			}
60
-			$modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'");
61
-			foreach($opids as $opid) {
60
+			$modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'");
61
+			foreach ($opids as $opid) {
62 62
 				$modx->getDatabase()->insert(array(
63 63
 					'module' => $id,
64 64
 					'resource' => $opid,
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
 		$opids = array_filter(array_map('intval', $_REQUEST['depid']));
73 73
 
74 74
 		// get resources that needs to be removed
75
-		$ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")");
75
+		$ds = $modx->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")");
76 76
 		// loop through resources and look for plugins and snippets
77 77
 		$plids = array();
78 78
 		$snid = array();
79
-		while($row = $modx->getDatabase()->getRow($ds)) {
80
-			if($row['type'] == '30') {
79
+		while ($row = $modx->getDatabase()->getRow($ds)) {
80
+			if ($row['type'] == '30') {
81 81
 				$plids[$i] = $row['resource'];
82 82
 			}
83
-			if($row['type'] == '40') {
83
+			if ($row['type'] == '40') {
84 84
 				$snids[$i] = $row['resource'];
85 85
 			}
86 86
 		}
@@ -88,28 +88,28 @@  discard block
 block discarded – undo
88 88
 		$ds = $modx->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'");
89 89
 		$guid = $modx->getDatabase()->getValue($ds);
90 90
 		// reset moduleguid for deleted resources
91
-		if(($cp = count($plids)) || ($cs = count($snids))) {
92
-			if($cp) {
93
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'");
91
+		if (($cp = count($plids)) || ($cs = count($snids))) {
92
+			if ($cp) {
93
+				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'");
94 94
 			}
95
-			if($cs) {
96
-				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'");
95
+			if ($cs) {
96
+				$modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'");
97 97
 			}
98 98
 			// reset cache
99 99
 			$modx->clearCache('full');
100 100
 		}
101
-		$modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")");
101
+		$modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")");
102 102
 		break;
103 103
 }
104 104
 
105 105
 // load record
106 106
 $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'");
107 107
 $content = $modx->getDatabase()->getRow($rs);
108
-if(!$content) {
108
+if (!$content) {
109 109
 	$modx->webAlertAndQuit("Module not found for id '{$id}'.");
110 110
 }
111 111
 $_SESSION['itemname'] = $content['name'];
112
-if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
112
+if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
113 113
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
114 114
 }
115 115
 
@@ -188,13 +188,13 @@  discard block
 block discarded – undo
188 188
 	<input type="hidden" name="id" value="<?php echo $content['id']; ?>" />
189 189
 
190 190
 	<h1>
191
-		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?>
191
+		<i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?>
192 192
 	</h1>
193 193
 
194 194
 	<?php echo $_style['actionbuttons']['dynamic']['close'] ?>
195 195
 
196 196
 	<div class="section">
197
-		<div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div>
197
+		<div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div>
198 198
 		<div class="sectionBody">
199 199
 			<p><?php echo $_lang['module_resource_msg']; ?></p>
200 200
 			<br />
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 					LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40'
219 219
 					LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50'
220 220
 					LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name");
221
-						include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
221
+						include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
222 222
 						$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
223 223
 						$grd->noRecordMsg = $_lang["no_records_found"];
224 224
 						$grd->cssClass = "grid";
225 225
 						$grd->columnHeaderClass = "gridHeader";
226 226
 						$grd->itemClass = "gridItem";
227 227
 						$grd->altItemClass = "gridAltItem";
228
-						$grd->columns = $_lang["element_name"] . " ," . $_lang["type"];
228
+						$grd->columns = $_lang["element_name"]." ,".$_lang["type"];
229 229
 						$grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]";
230 230
 						$grd->fields = "name,type";
231 231
 						echo $grd->render();
Please login to merge, or discard this patch.
manager/actions/web_user_management.static.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! 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('edit_web_user')) {
5
+if (!$modx->hasPermission('edit_web_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->getManagerApi()->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 			<div class="row">
121 121
 				<div class="table-responsive">
122 122
 					<?php
123
-					$ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users") . " wu 
124
-			INNER JOIN " . $modx->getFullTableName("web_user_attributes") . " wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
123
+					$ds = $modx->getDatabase()->select("wu.id, wu.username, wua.fullname, wua.email, wua.lastlogin, wua.logincount, IF(wua.blocked,'{$_lang['yes']}','-') as 'blocked'", $modx->getFullTableName("web_users")." wu 
124
+			INNER JOIN " . $modx->getFullTableName("web_user_attributes")." wua ON wua.internalKey=wu.id", ($sqlQuery ? "(wu.username LIKE '{$sqlQuery}%') OR (wua.fullname LIKE '%{$sqlQuery}%') OR (wua.email LIKE '%{$sqlQuery}%')" : ""), 'username');
125
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
126 126
 					$grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items
127 127
 					$grd->noRecordMsg = $_lang["no_records_found"];
128 128
 					$grd->cssClass = "table data";
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
 					$grd->itemClass = "tableItem";
131 131
 					$grd->altItemClass = "tableAltItem";
132 132
 					$grd->fields = "id,username,fullname,email,lastlogin,logincount,blocked";
133
-					$grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["user_full_name"] . " ," . $_lang["email"] . " ," . $_lang["user_prevlogin"] . " ," . $_lang["user_logincount"] . " ," . $_lang["user_block"];
133
+					$grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["user_full_name"]." ,".$_lang["email"]." ,".$_lang["user_prevlogin"]." ,".$_lang["user_logincount"]." ,".$_lang["user_block"];
134 134
 					$grd->colWidths = "1%,,,,1%,1%,1%";
135 135
 					$grd->colAligns = "center,,,,right' nowrap='nowrap,right,center";
136
-					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='" . $_style["icons_user"] . "'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='" . $_lang["click_to_edit_title"] . "'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: " . $modx->toDateFormat('[+thislogin+]', 'formatOnly') .
136
+					$grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='".$_style["icons_user"]."'></i></a>||template:<a href='index.php?a=88&id=[+id+]' title='".$_lang["click_to_edit_title"]."'>[+value+]</a>||template:[+fullname+]||template:[+email+]||date: ".$modx->toDateFormat('[+thislogin+]', 'formatOnly').
137 137
 					" %H:%M";
138
-					if($listmode == '1') {
138
+					if ($listmode == '1') {
139 139
 						$grd->pageSize = 0;
140 140
 					}
141
-					if($_REQUEST['op'] == 'reset') {
141
+					if ($_REQUEST['op'] == 'reset') {
142 142
 						$grd->pageNumber = 1;
143 143
 					}
144 144
 					// render grid
Please login to merge, or discard this patch.
manager/actions/mutate_web_user.dynamic.php 1 patch
Spacing   +32 added lines, -32 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 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
8
+		if (!$modx->hasPermission('edit_web_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
13
+		if (!$modx->hasPermission('new_web_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,34 +18,34 @@  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
 
24 24
 // check to see the snippet editor isn't locked
25
-$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
26
-if($username = $modx->getDatabase()->getValue($rs)) {
25
+$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
26
+if ($username = $modx->getDatabase()->getValue($rs)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
28 28
 }
29 29
 // end check for lock
30 30
 
31
-if($modx->getManagerApi()->action == '88') {
31
+if ($modx->getManagerApi()->action == '88') {
32 32
 	// get user attributes
33 33
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34 34
 	$userdata = $modx->getDatabase()->getRow($rs);
35
-	if(!$userdata) {
35
+	if (!$userdata) {
36 36
 		$modx->webAlertAndQuit("No user returned!");
37 37
 	}
38 38
 
39 39
 	// get user settings
40 40
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
43 43
 	extract($usersettings, EXTR_OVERWRITE);
44 44
 
45 45
 	// get user name
46 46
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47 47
 	$usernamedata = $modx->getDatabase()->getRow($rs);
48
-	if(!$usernamedata) {
48
+	if (!$usernamedata) {
49 49
 		$modx->webAlertAndQuit("No user returned while getting username!");
50 50
 	}
51 51
 	$_SESSION['itemname'] = $usernamedata['username'];
@@ -57,14 +57,14 @@  discard block
 block discarded – undo
57 57
 }
58 58
 
59 59
 // avoid doubling htmlspecialchars (already encoded in DB)
60
-foreach($userdata as $key => $val) {
60
+foreach ($userdata as $key => $val) {
61 61
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
62 62
 };
63 63
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
64 64
 
65 65
 // restore saved form
66 66
 $formRestored = false;
67
-if($modx->getManagerApi()->hasFormValues()) {
67
+if ($modx->getManagerApi()->hasFormValues()) {
68 68
 	$modx->getManagerApi()->loadFormValues();
69 69
 	// restore post values
70 70
 	$userdata = array_merge($userdata, $_POST);
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
 
79 79
 // include the country list language file
80 80
 $_country_lang = array();
81
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
82
-	include_once "lang/country/" . $manager_language . "_country.inc.php";
81
+if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
82
+	include_once "lang/country/".$manager_language."_country.inc.php";
83 83
 } else {
84 84
 	include_once "lang/country/english_country.inc.php";
85 85
 }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	<?php
192 192
 	// invoke OnWUsrFormPrerender event
193 193
 	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
-	if(is_array($evtOut)) {
194
+	if (is_array($evtOut)) {
195 195
 		echo implode("", $evtOut);
196 196
 	}
197 197
 	?>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 	<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" ?>" />
201 201
 
202 202
 	<h1>
203
-        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['web_user_title']) ?>
203
+        <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['web_user_title']) ?>
204 204
     </h1>
205 205
 
206 206
 	<?php echo $_style['actionbuttons']['dynamic']['user'] ?>
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
 				<table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser">
219 219
 					<tr>
220 220
 						<td colspan="3"><span id="blocked" class="warning">
221
-							<?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
221
+							<?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?>
222 222
 								<b><?php echo $_lang['user_is_blocked']; ?></b>
223 223
 							<?php } ?>
224 224
 							</span>
225 225
 							<br /></td>
226 226
 					</tr>
227
-					<?php if(!empty($userdata['id'])) { ?>
227
+					<?php if (!empty($userdata['id'])) { ?>
228 228
 						<tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> ">
229 229
 							<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>
230 230
 								<input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" />
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 						<td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td>
238 238
 					</tr>
239 239
 					<tr>
240
-						<th><?php echo $modx->getManagerApi()->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th>
240
+						<th><?php echo $modx->getManagerApi()->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th>
241 241
 						<td>&nbsp;</td>
242 242
 						<td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "87" ? " checked disabled" : ""; ?>>
243 243
 							<input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" />
@@ -324,8 +324,8 @@  discard block
 block discarded – undo
324 324
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
325 325
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
326 326
 								<?php
327
-								foreach($_country_lang as $key => $country) {
328
-									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
327
+								foreach ($_country_lang as $key => $country) {
328
+									echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>";
329 329
 								}
330 330
 								?>
331 331
 							</select></td>
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 						<td>&nbsp;</td>
352 352
 						<td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td>
353 353
 					</tr>
354
-					<?php if($modx->getManagerApi()->action == '88') { ?>
354
+					<?php if ($modx->getManagerApi()->action == '88') { ?>
355 355
 						<tr>
356 356
 							<th><?php echo $_lang['user_logincount']; ?>:</th>
357 357
 							<td>&nbsp;</td>
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 					function BrowseServer() {
473 473
 						var w = screen.width * 0.7;
474 474
 						var h = screen.height * 0.7;
475
-						OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
475
+						OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
476 476
 					}
477 477
 
478 478
 					function SetUrl(url, width, height, alt) {
@@ -491,22 +491,22 @@  discard block
 block discarded – undo
491 491
 						<td class='comment'><?php echo $_lang["user_photo_message"] ?></td>
492 492
 					</tr>
493 493
 					<tr>
494
-						<td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "") . $_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "") . $userdata['photo'] : $_style["tx"]; ?>" /></td>
494
+						<td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "").$_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "").$userdata['photo'] : $_style["tx"]; ?>" /></td>
495 495
 					</tr>
496 496
 				</table>
497 497
 			</div>
498 498
 			<?php
499
-			if($use_udperms == 1) {
499
+			if ($use_udperms == 1) {
500 500
 
501 501
 			$groupsarray = array();
502 502
 
503
-			if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited
503
+			if ($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited
504 504
 				$rs = $modx->getDatabase()->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505 505
 				$groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs);
506 506
 			}
507 507
 			// retain selected user groups between post
508
-			if(is_array($_POST['user_groups'])) {
509
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
508
+			if (is_array($_POST['user_groups'])) {
509
+				foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
510 510
 			}
511 511
 			?>
512 512
 			<div class="tab-page" id="tabPermissions">
@@ -515,8 +515,8 @@  discard block
 block discarded – undo
515 515
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
516 516
 				<?php
517 517
 				$rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
-				while($row = $modx->getDatabase()->getRow($rs)) {
519
-					echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
518
+				while ($row = $modx->getDatabase()->getRow($rs)) {
519
+					echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />';
520 520
 				}
521 521
 				}
522 522
 				?>
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527 527
 				"id" => $user
528 528
 			));
529
-			if(is_array($evtOut)) {
529
+			if (is_array($evtOut)) {
530 530
 				echo implode("", $evtOut);
531 531
 			}
532 532
 			?>
Please login to merge, or discard this patch.
manager/actions/user_management.static.php 1 patch
Spacing   +17 added lines, -17 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('edit_user')) {
5
+if (!$modx->hasPermission('edit_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 $modx->getManagerApi()->initPageViewState();
11 11
 
12 12
 // get and save search string
13
-if($_REQUEST['op'] == 'reset') {
13
+if ($_REQUEST['op'] == 'reset') {
14 14
 	$query = '';
15 15
 	$_PAGE['vs']['search'] = '';
16 16
 } else {
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 
27 27
 // context menu
28
-include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php";
28
+include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php";
29 29
 $cm = new ContextMenu("cntxm", 150);
30 30
 $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0));
31 31
 $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0));
@@ -121,16 +121,16 @@  discard block
 block discarded – undo
121 121
 				<div class="table-responsive">
122 122
 					<?php
123 123
 					$where = "";
124
-					if(!$modx->hasPermission('save_role')) {
125
-						$where .= (empty($where) ? "" : " AND ") . "mua.role != 1";
124
+					if (!$modx->hasPermission('save_role')) {
125
+						$where .= (empty($where) ? "" : " AND ")."mua.role != 1";
126 126
 					}
127
-					if(!empty($sqlQuery)) {
128
-						$where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
127
+					if (!empty($sqlQuery)) {
128
+						$where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))";
129 129
 					}
130
-					$ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users') . " AS mu 
131
-			INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id 
132
-			LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
130
+					$ds = $modx->getDatabase()->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin, mua.logincount", $modx->getFullTableName('manager_users')." AS mu 
131
+			INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id 
132
+			LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC');
133
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
134 134
 					$grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items
135 135
 					$grd->noRecordMsg = $_lang["no_records_found"];
136 136
 					$grd->cssClass = "table data";
@@ -151,19 +151,19 @@  discard block
 block discarded – undo
151 151
 					$grd->colWidths = "1%,,,,,1%,1%,1%";
152 152
 					$grd->colAligns = "center,,,,,right' nowrap='nowrap,right,center";
153 153
 					$grd->colTypes = implode('||', array(
154
-						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>',
155
-						'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>',
154
+						'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>',
155
+						'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>',
156 156
 						'template:[+fullname+]',
157 157
 						'template:[+role+]',
158 158
 						'template:[+email+]',
159
-						'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M',
159
+						'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M',
160 160
 						'template:[+logincount+]',
161 161
 						'template:[+blocked+]'
162 162
 					));
163
-					if($listmode == '1') {
163
+					if ($listmode == '1') {
164 164
 						$grd->pageSize = 0;
165 165
 					}
166
-					if($_REQUEST['op'] == 'reset') {
166
+					if ($_REQUEST['op'] == 'reset') {
167 167
 						$grd->pageNumber = 1;
168 168
 					}
169 169
 					// render grid
Please login to merge, or discard this patch.
manager/actions/document_data.static.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6
-if(isset($_REQUEST['id'])) {
6
+if (isset($_REQUEST['id'])) {
7 7
 	$id = (int) $_REQUEST['id'];
8 8
 } else {
9 9
 	$id = 0;
10 10
 }
11 11
 
12
-if(isset($_GET['opened'])) {
12
+if (isset($_GET['opened'])) {
13 13
 	$_SESSION['openedArray'] = $_GET['opened'];
14 14
 }
15 15
 
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 $tbl_site_templates = $modx->getFullTableName('site_templates');
23 23
 
24 24
 // Get access permissions
25
-if($_SESSION['mgrDocgroups']) {
25
+if ($_SESSION['mgrDocgroups']) {
26 26
 	$docgrp = implode(",", $_SESSION['mgrDocgroups']);
27 27
 }
28
-$access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
28
+$access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
29 29
 
30 30
 //
31
-if($_SESSION['tree_show_only_folders']) {
32
-	$parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0;
33
-	$isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1");
34
-	if(!$isfolder && $parent != 0) {
31
+if ($_SESSION['tree_show_only_folders']) {
32
+	$parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0;
33
+	$isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM ".$tbl_site_content." WHERE id=$id LIMIT 1");
34
+	if (!$isfolder && $parent != 0) {
35 35
 		$id = $_REQUEST['id'] = $parent;
36 36
 	}
37 37
 }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 $rs = $modx->getDatabase()->select('DISTINCT sc.*', "{$tbl_site_content} AS sc
41 41
 		LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})");
42 42
 $content = $modx->getDatabase()->getRow($rs);
43
-if(!$content) {
43
+if (!$content) {
44 44
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
45 45
 }
46 46
 
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
 );
83 83
 $filter_sort = '';
84 84
 $filter_dir = '';
85
-if($numRecords > 0) {
86
-	$filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //********  resource_opt_is_published - //
87
-		'<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********//
85
+if ($numRecords > 0) {
86
+	$filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&dir='.$dir.'&sort=\'+this.options[this.selectedIndex].value">'.'<option value="createdon"'.(($sort == 'createdon') ? ' selected' : '').'>'.$_lang['createdon'].'</option>'.'<option value="pub_date"'.(($sort == 'pub_date') ? ' selected' : '').'>'.$_lang["page_data_publishdate"].'</option>'.'<option value="pagetitle"'.(($sort == 'pagetitle') ? ' selected' : '').'>'.$_lang['pagetitle'].'</option>'.'<option value="menuindex"'.(($sort == 'menuindex') ? ' selected' : '').'>'.$_lang['resource_opt_menu_index'].'</option>'.//********  resource_opt_is_published - //
87
+		'<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********//
88 88
 		'</select>';
89
-	$filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>';
89
+	$filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&sort='.$sort.'&dir=\'+this.options[this.selectedIndex].value">'.'<option value="DESC"'.(($dir == 'DESC') ? ' selected' : '').'>'.$_lang['sort_desc'].'</option>'.'<option value="ASC"'.(($dir == 'ASC') ? ' selected' : '').'>'.$_lang['sort_asc'].'</option>'.'</select>';
90 90
 	$resource = $modx->getDatabase()->makeArray($rs);
91 91
 
92 92
 	// CSS style for table
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
 	);
131 131
 	$modx->getMakeTable()->setColumnWidths($tbWidth);
132 132
 
133
-	$sd = isset($_REQUEST['dir']) ? '&amp;dir=' . $_REQUEST['dir'] : '&amp;dir=DESC';
134
-	$sb = isset($_REQUEST['sort']) ? '&amp;sort=' . $_REQUEST['sort'] : '&amp;sort=createdon';
135
-	$pg = isset($_REQUEST['page']) ? '&amp;page=' . (int) $_REQUEST['page'] : '';
136
-	$add_path = $sd . $sb . $pg;
133
+	$sd = isset($_REQUEST['dir']) ? '&amp;dir='.$_REQUEST['dir'] : '&amp;dir=DESC';
134
+	$sb = isset($_REQUEST['sort']) ? '&amp;sort='.$_REQUEST['sort'] : '&amp;sort=createdon';
135
+	$pg = isset($_REQUEST['page']) ? '&amp;page='.(int) $_REQUEST['page'] : '';
136
+	$add_path = $sd.$sb.$pg;
137 137
 
138 138
 	$icons = array(
139 139
 		'text/html' => $_style['tree_page_html'],
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 	);
152 152
 
153 153
 	$listDocs = array();
154
-	foreach($resource as $k => $children) {
154
+	foreach ($resource as $k => $children) {
155 155
 
156
-		switch($children['id']) {
156
+		switch ($children['id']) {
157 157
 			case $modx->config['site_start']            :
158 158
 				$icon = $_style['tree_page_home'];
159 159
 				break;
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 				$icon = $_style['tree_page_info'];
168 168
 				break;
169 169
 			default:
170
-				if($children['isfolder']) {
170
+				if ($children['isfolder']) {
171 171
 					$icon = $_style['tree_folder_new'];
172 172
 				} else {
173
-					if(isset($icons[$children['contentType']])) {
173
+					if (isset($icons[$children['contentType']])) {
174 174
 						$icon = $icons[$children['contentType']];
175 175
 					} else {
176 176
 						$icon = $_style['tree_page'];
@@ -185,32 +185,32 @@  discard block
 block discarded – undo
185 185
 		$class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish'));
186 186
 		//$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary');
187 187
 		//$class .= ($children['isfolder'] ? ' font-weight-bold' : '');
188
-		if($modx->hasPermission('edit_document')) {
189
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>';
188
+		if ($modx->hasPermission('edit_document')) {
189
+			$title = '<span class="doc-item'.$private.'">'.$icon.'<a href="index.php?a=27&amp;id='.$children['id'].$add_path.'">'.'<span class="'.$class.'">'.$children['pagetitle'].'</span></a></span>';
190 190
 		} else {
191
-			$title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>';
191
+			$title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.$children['pagetitle'].'</span></span>';
192 192
 		}
193 193
 
194
-		$icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>';
194
+		$icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&amp;id='.$children['id'].$add_path.'" title="'.$_lang["publish_resource"].'"><i class="'.$_style["icons_publish_document"].'"></i></a>' : '<a href="index.php?a=62&amp;id='.$children['id'].$add_path.'" title="'.$_lang["unpublish_resource"].'"><i class="'.$_style["icons_unpublish_resource"].'" ></i></a>';
195 195
 
196
-		$icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>';
196
+		$icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\''.$_lang["confirm_delete_resource"].'\')" href="index.php?a=6&amp;id='.$children['id'].$add_path.'" title="'.$_lang['delete_resource'].'"><i class="'.$_style["icons_delete_resource"].'"></i></a>' : '<a onclick="return confirm(\''.$_lang["confirm_undelete"].'\')" href="index.php?a=63&amp;id='.$children['id'].$add_path.'" title="'.$_lang['undelete_resource'].'"><i class="'.$_style["icons_undelete_resource"].'"></i></a>';
197 197
 
198 198
 		$listDocs[] = array(
199
-			'docid' => '<div class="text-right">' . $children['id'] . '</div>',
199
+			'docid' => '<div class="text-right">'.$children['id'].'</div>',
200 200
 			'title' => $title,
201
-			'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>',
202
-			'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>',
203
-			'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>',
204
-			'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&amp;id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i 
205
-				class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>'
201
+			'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>',
202
+			'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>',
203
+			'status' => '<div class="text-nowrap">'.($children['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>').'</div>',
204
+			'edit' => '<div class="actions text-center text-nowrap">'.($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&amp;id='.$children['id'].$add_path.'" title="'.$_lang['edit'].'"><i class="'.$_style["icons_edit_resource"].'"></i></a><a href="index.php?a=51&amp;id='.$children['id'].$add_path.'" title="'.$_lang['move'].'"><i 
205
+				class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>'
206 206
 		);
207 207
 	}
208 208
 
209
-	$modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort);
210
-	$children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id=' . $content['id']);
209
+	$modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort);
210
+	$children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&amp;id='.$content['id']);
211 211
 } else {
212 212
 	// No Child documents
213
-	$children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>';
213
+	$children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>';
214 214
 }
215 215
 ?>
216 216
 	<script type="text/javascript">
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 			},
237 237
 			cancel: function() {
238 238
 				documentDirty = false;
239
-				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>';
239
+				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>';
240 240
 			},
241 241
 			move: function() {
242 242
 				document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51";
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 				}
248 248
 			},
249 249
 			view: function() {
250
-				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin');
250
+				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin');
251 251
 			}
252 252
 		};
253 253
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	<script type="text/javascript" src="media/script/tablesort.js"></script>
256 256
 
257 257
 	<h1>
258
-		<i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . ' <small>(' . $_REQUEST['id'] . ')</small>' ?>
258
+		<i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').' <small>('.$_REQUEST['id'].')</small>' ?>
259 259
 	</h1>
260 260
 
261 261
 <?= $_style['actionbuttons']['static']['document'] ?>
@@ -282,16 +282,16 @@  discard block
 block discarded – undo
282 282
 					<tr>
283 283
 						<td width="200" valign="top"><?= $_lang['long_title'] ?>:</td>
284 284
 						<td>
285
-							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></small>
285
+							<small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>".$_lang['not_set']."</i>)" ?></small>
286 286
 						</td>
287 287
 					</tr>
288 288
 					<tr>
289 289
 						<td valign="top"><?= $_lang['resource_description'] ?>:</td>
290
-						<td><?= $content['description'] != '' ? $content['description'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
290
+						<td><?= $content['description'] != '' ? $content['description'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
291 291
 					</tr>
292 292
 					<tr>
293 293
 						<td valign="top"><?= $_lang['resource_summary'] ?>:</td>
294
-						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
294
+						<td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
295 295
 					</tr>
296 296
 					<tr>
297 297
 						<td valign="top"><?= $_lang['type'] ?>:</td>
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 					</tr>
300 300
 					<tr>
301 301
 						<td valign="top"><?= $_lang['resource_alias'] ?>:</td>
302
-						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td>
302
+						<td><?= $content['alias'] != '' ? $content['alias'] : "(<i>".$_lang['not_set']."</i>)" ?></td>
303 303
 					</tr>
304 304
 					<tr>
305 305
 						<td colspan="2">&nbsp;</td>
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 						<td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= $createdbyname ?></b>)
313 313
 						</td>
314 314
 					</tr>
315
-					<?php if($editedbyname != '') { ?>
315
+					<?php if ($editedbyname != '') { ?>
316 316
 						<tr>
317 317
 							<td><?= $_lang['page_data_edited'] ?>:</td>
318 318
 							<td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= $editedbyname ?></b>)
@@ -327,15 +327,15 @@  discard block
 block discarded – undo
327 327
 					</tr>
328 328
 					<tr>
329 329
 						<td><?= $_lang['page_data_status'] ?>:</td>
330
-						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td>
330
+						<td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td>
331 331
 					</tr>
332 332
 					<tr>
333 333
 						<td><?= $_lang['page_data_publishdate'] ?>:</td>
334
-						<td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
334
+						<td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td>
335 335
 					</tr>
336 336
 					<tr>
337 337
 						<td><?= $_lang['page_data_unpublishdate'] ?>:</td>
338
-						<td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
338
+						<td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td>
339 339
 					</tr>
340 340
 					<tr>
341 341
 						<td><?= $_lang['page_data_cacheable'] ?>:</td>
@@ -355,11 +355,11 @@  discard block
 block discarded – undo
355 355
 					</tr>
356 356
 					<tr>
357 357
 						<td><?= $_lang['page_data_web_access'] ?>:</td>
358
-						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
358
+						<td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
359 359
 					</tr>
360 360
 					<tr>
361 361
 						<td><?= $_lang['page_data_mgr_access'] ?>:</td>
362
-						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td>
362
+						<td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td>
363 363
 					</tr>
364 364
 					<tr>
365 365
 						<td colspan="2">&nbsp;</td>
@@ -389,13 +389,13 @@  discard block
 block discarded – undo
389 389
 			<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script>
390 390
 			<div class="container container-body">
391 391
 				<div class="form-group clearfix">
392
-					<?php if($numRecords > 0) : ?>
392
+					<?php if ($numRecords > 0) : ?>
393 393
 						<div class="float-xs-left">
394
-							<span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
394
+							<span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span>
395 395
 						</div>
396 396
 					<?php endif; ?>
397 397
 					<div class="float-xs-right">
398
-						<?= $filter_sort . ' ' . $filter_dir ?>
398
+						<?= $filter_sort.' '.$filter_dir ?>
399 399
 					</div>
400 400
 
401 401
 				</div>
@@ -405,23 +405,23 @@  discard block
 block discarded – undo
405 405
 			</div>
406 406
 		</div><!-- end tab-page -->
407 407
 
408
-		<?php if($modx->config['cache_type'] != 2) { ?>
408
+		<?php if ($modx->config['cache_type'] != 2) { ?>
409 409
 			<!-- Page Source -->
410 410
 			<div class="tab-page" id="tabSource">
411 411
 				<h2 class="tab"><?= $_lang['page_data_source'] ?></h2>
412 412
 				<script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script>
413 413
 				<?php
414 414
 				$buffer = "";
415
-				$filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php";
415
+				$filename = $modx->config['base_path']."assets/cache/docid_".$id.".pageCache.php";
416 416
 				$handle = @fopen($filename, "r");
417
-				if(!$handle) {
418
-					$buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>';
417
+				if (!$handle) {
418
+					$buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>';
419 419
 				} else {
420
-					while(!feof($handle)) {
420
+					while (!feof($handle)) {
421 421
 						$buffer .= fgets($handle, 4096);
422 422
 					}
423 423
 					fclose($handle);
424
-					$buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n";
424
+					$buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->getPhpCompat()->htmlspecialchars($buffer)."</textarea></div>\n";
425 425
 				}
426 426
 				echo $buffer;
427 427
 				?>
@@ -431,12 +431,12 @@  discard block
 block discarded – undo
431 431
 	</div><!-- end documentPane -->
432 432
 
433 433
 <?php
434
-if(isset($_GET['tab']) && is_numeric($_GET['tab'])) {
435
-	echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
434
+if (isset($_GET['tab']) && is_numeric($_GET['tab'])) {
435
+	echo '<script type="text/javascript"> docSettings.setSelectedIndex( '.$_GET['tab'].' );</script>';
436 436
 }
437 437
 ?>
438 438
 
439
-<?php if($show_preview == 1) { ?>
439
+<?php if ($show_preview == 1) { ?>
440 440
 	<div class="sectionHeader"><?= $_lang['preview'] ?></div>
441 441
 	<div class="sectionBody" id="lyr2">
442 442
 		<iframe src="<?= MODX_SITE_URL ?>index.php?id=<?= $id ?>&z=manprev" frameborder="0" border="0" id="previewIframe"></iframe>
Please login to merge, or discard this patch.
manager/actions/messages.static.php 1 patch
Spacing   +15 added lines, -15 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('messages')) {
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         <div class="container container-body" id="lyr3">
17 17
             <b><?= $_lang['messages_read_message'] ?></b>
18 18
             <?php
19
-            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'");
19
+            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='".(int) $_REQUEST['id']."'");
20 20
             $message = $modx->getDatabase()->getRow($rs);
21 21
             if (!$message) {
22 22
                 echo "Wrong number of messages returned!";
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         <p><b><?= $_lang['messages_inbox'] ?></b></p>
88 88
         <?php
89 89
         // Get  number of rows
90
-        $rs = $modx->getDatabase()->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "");
90
+        $rs = $modx->getDatabase()->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."");
91 91
         $num_rows = $modx->getDatabase()->getValue($rs);
92 92
 
93 93
         // ==============================================================
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
101 101
             $int_cur_position = 0;
102 102
         } else {
103
-            $int_cur_position = (int)$_REQUEST['int_cur_position'];
103
+            $int_cur_position = (int) $_REQUEST['int_cur_position'];
104 104
         }
105 105
 
106 106
         // Number of result to display on the page, will be in the LIMIT of the sql query also
@@ -116,21 +116,21 @@  discard block
 block discarded – undo
116 116
         $array_row_paging = $p->getPagingRowArray();
117 117
 
118 118
         // Display the result as you like...
119
-        $pager .= $_lang['showing'] . " " . $array_paging['lower'];
120
-        $pager .= " " . $_lang['to'] . " " . $array_paging['upper'];
121
-        $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")";
122
-        $pager .= "<br />" . $array_paging['previous_link'] . "&lt;&lt;" . (isset($array_paging['previous_link']) ? "</a> " : " ");
119
+        $pager .= $_lang['showing']." ".$array_paging['lower'];
120
+        $pager .= " ".$_lang['to']." ".$array_paging['upper'];
121
+        $pager .= " (".$array_paging['total']." ".$_lang['total'].")";
122
+        $pager .= "<br />".$array_paging['previous_link']."&lt;&lt;".(isset($array_paging['previous_link']) ? "</a> " : " ");
123 123
         for ($i = 0; $i < sizeof($array_row_paging); $i++) {
124
-            $pager .= $array_row_paging[$i] . "&nbsp;";
124
+            $pager .= $array_row_paging[$i]."&nbsp;";
125 125
         }
126
-        $pager .= $array_paging['next_link'] . "&gt;&gt;" . (isset($array_paging['next_link']) ? "</a>" : "");
126
+        $pager .= $array_paging['next_link']."&gt;&gt;".(isset($array_paging['next_link']) ? "</a>" : "");
127 127
 
128 128
         // The above exemple print somethings like:
129 129
         // 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 >>>
130 130
         // Of course you can now play with array_row_paging in order to print
131 131
         // only the results you would like...
132 132
 
133
-        $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}");
133
+        $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}");
134 134
         $limit = $modx->getDatabase()->getRecordCount($rs);
135 135
         if ($limit < 1) {
136 136
             echo $_lang['messages_no_messages'];
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         <p><b><?= $_lang['messages_compose'] ?></b></p>
189 189
         <?php
190 190
         if (($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) {
191
-            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'");
191
+            $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'");
192 192
             $message = $modx->getDatabase()->getRow($rs);
193 193
             if (!$message) {
194 194
                 echo "Wrong number of messages returned!";
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                     }
208 208
                     $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: ";
209 209
                     $subjecttext .= $message['subject'];
210
-                    $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message'];
210
+                    $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate'] + $server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message'];
211 211
                     if ($_REQUEST['m'] == 'rp') {
212 212
                         $recipientindex = $message['sender'];
213 213
                     }
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
 
295 295
 <?php
296 296
 // count messages again, as any action on the messages page may have altered the message count
297
-$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0");
297
+$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0");
298 298
 $_SESSION['nrnewmessages'] = $modx->getDatabase()->getValue($rs);
299
-$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "");
299
+$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."");
300 300
 $_SESSION['nrtotalmessages'] = $modx->getDatabase()->getValue($rs);
301 301
 $messagesallowed = $modx->hasPermission('messages');
302 302
 ?>
Please login to merge, or discard this patch.
manager/actions/mutate_templates.dynamic.php 1 patch
Spacing   +44 added lines, -44 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 16:
8
-		if(!$modx->hasPermission('edit_template')) {
8
+		if (!$modx->hasPermission('edit_template')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 19:
13
-		if(!$modx->hasPermission('new_template')) {
13
+		if (!$modx->hasPermission('new_template')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 $tbl_site_templates = $modx->getFullTableName('site_templates');
24 24
 
25 25
 // check to see the snippet editor isn't locked
26
-if($lockedEl = $modx->elementIsLocked(1, $id)) {
26
+if ($lockedEl = $modx->elementIsLocked(1, $id)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template']));
28 28
 }
29 29
 // end check for lock
@@ -32,23 +32,23 @@  discard block
 block discarded – undo
32 32
 $modx->lockElement(1, $id);
33 33
 
34 34
 $content = array();
35
-if(!empty($id)) {
35
+if (!empty($id)) {
36 36
 	$rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'");
37 37
 	$content = $modx->getDatabase()->getRow($rs);
38
-	if(!$content) {
38
+	if (!$content) {
39 39
 		$modx->webAlertAndQuit("No database record has been found for this template.");
40 40
 	}
41 41
 
42 42
 	$_SESSION['itemname'] = $content['templatename'];
43
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
43
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
44 44
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
45 45
 	}
46 46
 } else {
47 47
 	$_SESSION['itemname'] = $_lang["new_template"];
48
-	$content['category'] = (int)$_REQUEST['catid'];
48
+	$content['category'] = (int) $_REQUEST['catid'];
49 49
 }
50 50
 
51
-if($modx->getManagerApi()->hasFormValues()) {
51
+if ($modx->getManagerApi()->hasFormValues()) {
52 52
 	$modx->getManagerApi()->loadFormValues();
53 53
 }
54 54
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 // Add lock-element JS-Script
59 59
 $lockElementId = $id;
60 60
 $lockElementType = 1;
61
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
61
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
62 62
 ?>
63 63
 <script type="text/javascript">
64 64
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 	<?php
101 101
 	// invoke OnTempFormPrerender event
102 102
 	$evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id));
103
-	if(is_array($evtOut)) {
103
+	if (is_array($evtOut)) {
104 104
 		echo implode("", $evtOut);
105 105
 	}
106 106
 	?>
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	<input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
110 110
 
111 111
 	<h1>
112
-		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
112
+		<i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i>
113 113
 	</h1>
114 114
 
115 115
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -132,15 +132,15 @@  discard block
 block discarded – undo
132 132
 					<div class="row form-row">
133 133
 						<label class="col-md-3 col-lg-2">
134 134
 							<?= $_lang['template_name'] ?>
135
-							<?php if($id == $modx->config['default_template']) {
136
-								echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>';
135
+							<?php if ($id == $modx->config['default_template']) {
136
+								echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>';
137 137
 							} ?>
138 138
 						</label>
139 139
 						<div class="col-md-9 col-lg-10">
140 140
 							<div class="form-control-name clearfix">
141 141
 								<input name="templatename" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;">
142
-								<?php if($modx->hasPermission('save_role')): ?>
143
-									<label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip>
142
+								<?php if ($modx->hasPermission('save_role')): ?>
143
+									<label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip>
144 144
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
145 145
 										<i class="fa fa-lock"></i>
146 146
 									</label>
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
163 163
 								<option>&nbsp;</option>
164 164
 								<?php
165
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
166
-								foreach(getCategories() as $n => $v) {
167
-									echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>";
165
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
166
+								foreach (getCategories() as $n => $v) {
167
+									echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>";
168 168
 								}
169 169
 								?>
170 170
 							</select>
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 						</div>
178 178
 					</div>
179 179
 				</div>
180
-				<?php if($modx->hasPermission('save_role')): ?>
180
+				<?php if ($modx->hasPermission('save_role')): ?>
181 181
 					<div class="form-group">
182 182
 						<label>
183 183
 							<input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label>
@@ -198,30 +198,30 @@  discard block
 block discarded – undo
198 198
 
199 199
 			<?php
200 200
 			$selectedTvs = array();
201
-			if(!isset($_POST['assignedTv'])) {
201
+			if (!isset($_POST['assignedTv'])) {
202 202
 				$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv
203 203
                 LEFT JOIN %s tr ON tv.id=tr.tmplvarid
204 204
                 LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC"     // workaround for correct sort of none-existing ranks
205 205
 				);
206
-				while($row = $modx->getDatabase()->getRow($rs)) {
206
+				while ($row = $modx->getDatabase()->getRow($rs)) {
207 207
 					$selectedTvs[$row['tvid']] = $row;
208 208
 				}
209
-				$selectedTvs = array_reverse($selectedTvs, true);       // reverse ORDERBY DESC
209
+				$selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC
210 210
 			}
211 211
 
212 212
 			$unselectedTvs = array();
213 213
 			$rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv
214 214
 	    LEFT JOIN %s tr ON tv.id=tr.tmplvarid
215 215
 	    LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption");
216
-			while($row = $modx->getDatabase()->getRow($rs)) {
216
+			while ($row = $modx->getDatabase()->getRow($rs)) {
217 217
 				$unselectedTvs[$row['tvid']] = $row;
218 218
 			}
219 219
 
220 220
 			// Catch checkboxes if form not validated
221
-			if(isset($_POST['assignedTv'])) {
221
+			if (isset($_POST['assignedTv'])) {
222 222
 				$selectedTvs = array();
223
-				foreach($_POST['assignedTv'] as $tvid) {
224
-					if(isset($unselectedTvs[$tvid])) {
223
+				foreach ($_POST['assignedTv'] as $tvid) {
224
+					if (isset($unselectedTvs[$tvid])) {
225 225
 						$selectedTvs[$tvid] = $unselectedTvs[$tvid];
226 226
 					}
227 227
 				};
@@ -238,20 +238,20 @@  discard block
 block discarded – undo
238 238
 
239 239
 			<div class="container container-body">
240 240
 				<?php
241
-				if($total > 0) {
242
-					echo '<p>' . $_lang['template_tv_msg'] . '</p>';
241
+				if ($total > 0) {
242
+					echo '<p>'.$_lang['template_tv_msg'].'</p>';
243 243
 				}
244
-				if($modx->hasPermission('save_template') && $total > 1 && $id) {
244
+				if ($modx->hasPermission('save_template') && $total > 1 && $id) {
245 245
 					echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&amp;id=%s">%s</a></div>', $id, $_lang['template_tv_edit']);
246 246
 				}
247 247
 
248 248
 				// Selected TVs
249 249
 				$tvList = '';
250
-				if($total > 0) {
250
+				if ($total > 0) {
251 251
 					$tvList .= '<ul>';
252
-					foreach($selectedTvs as $row) {
253
-						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
254
-						$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
252
+					foreach ($selectedTvs as $row) {
253
+						$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>('.$row['tvdescription'].')</small>' : '';
254
+						$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : "";
255 255
 						$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
256 256
 					}
257 257
 					$tvList .= '</ul>';
@@ -262,22 +262,22 @@  discard block
 block discarded – undo
262 262
 				echo $tvList;
263 263
 
264 264
 				// Unselected TVs
265
-				$tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>';
265
+				$tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>';
266 266
 				$preCat = '';
267 267
 				$insideUl = 0;
268
-				while($row = array_shift($unselectedTvs)) {
269
-					if(isset($selectedTvs[$row['tvid']])) {
268
+				while ($row = array_shift($unselectedTvs)) {
269
+					if (isset($selectedTvs[$row['tvid']])) {
270 270
 						continue;
271 271
 					} // Skip selected
272 272
 					$row['category'] = stripslashes($row['category']); //pixelchutes
273
-					if($preCat !== $row['category']) {
273
+					if ($preCat !== $row['category']) {
274 274
 						$tvList .= $insideUl ? '</ul>' : '';
275
-						$tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>';
275
+						$tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>';
276 276
 						$insideUl = 1;
277 277
 					}
278 278
 
279
-					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>(' . $row['tvdescription'] . ')</small>' : '';
280
-					$locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : "";
279
+					$desc = !empty($row['tvdescription']) ? '&nbsp;&nbsp;<small>('.$row['tvdescription'].')</small>' : '';
280
+					$locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : "";
281 281
 					$tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']);
282 282
 					$tvList .= '</li>';
283 283
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 		<?php
295 295
 		// invoke OnTempFormRender event
296 296
 		$evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id));
297
-		if(is_array($evtOut)) {
297
+		if (is_array($evtOut)) {
298 298
 			echo implode("", $evtOut);
299 299
 		}
300 300
 		?>
Please login to merge, or discard this patch.
manager/actions/mutate_snippet.dynamic.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         $modx->webAlertAndQuit($_lang["error_no_privileges"]);
19 19
 }
20 20
 
21
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
21
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
22 22
 
23 23
 // Get table Names (alphabetical)
24 24
 $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj');
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $rs = $modx->getDatabase()->select('*', $tbl_site_snippets, "id='{$id}'");
40 40
     $content = $modx->getDatabase()->getRow($rs);
41 41
     if (!$content) {
42
-        header("Location: " . MODX_SITE_URL . "index.php?id=" . $site_start);
42
+        header("Location: ".MODX_SITE_URL."index.php?id=".$site_start);
43 43
     }
44 44
     $_SESSION['itemname'] = $content['name'];
45 45
     if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     $content['name'] = $_REQUEST['itemname'];
51 51
 } else {
52 52
     $_SESSION['itemname'] = $_lang["new_snippet"];
53
-    $content['category'] = (int)$_REQUEST['catid'];
53
+    $content['category'] = (int) $_REQUEST['catid'];
54 54
 }
55 55
 
56 56
 if ($modx->getManagerApi()->hasFormValues()) {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 // Add lock-element JS-Script
63 63
 $lockElementId = $id;
64 64
 $lockElementType = 4;
65
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
65
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
66 66
 ?>
67 67
 <script type="text/javascript">
68 68
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
     <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>">
432 432
 
433 433
     <h1 class="pagetitle">
434
-        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
434
+        <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i>
435 435
     </h1>
436 436
 
437 437
     <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                             <div class="form-control-name clearfix">
458 458
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
459 459
                                 <?php if ($modx->hasPermission('save_role')): ?>
460
-                                    <label class="custom-control" title="<?= $_lang['lock_snippet'] . "\n" . $_lang['lock_snippet_msg'] ?>" tooltip>
460
+                                    <label class="custom-control" title="<?= $_lang['lock_snippet']."\n".$_lang['lock_snippet_msg'] ?>" tooltip>
461 461
                                         <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
462 462
                                         <i class="fa fa-lock"></i>
463 463
                                     </label>
@@ -481,9 +481,9 @@  discard block
 block discarded – undo
481 481
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
482 482
                                 <option>&nbsp;</option>
483 483
                                 <?php
484
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
484
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
485 485
                                 foreach (getCategories() as $n => $v) {
486
-                                    echo '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . '</option>';
486
+                                    echo '<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category']).'</option>';
487 487
                                 }
488 488
                                 ?>
489 489
                             </select>
@@ -500,7 +500,7 @@  discard block
 block discarded – undo
500 500
                     <div class="form-group">
501 501
                         <?php if ($_SESSION['mgrRole'] == 1): ?>
502 502
                             <div class="form-row">
503
-                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label>
503
+                                <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label>
504 504
                             </div>
505 505
                         <?php endif; ?>
506 506
                         <div class="form-row">
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 <span><?= $_lang['snippet_code'] ?></span>
518 518
             </div>
519 519
             <div class="section-editor clearfix">
520
-                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->getPhpCompat()->htmlspecialchars($content['post'])) : "<?php" . "\n" . trim($modx->getPhpCompat()->htmlspecialchars($content['snippet'])) . "\n") ?></textarea>
520
+                <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->getPhpCompat()->htmlspecialchars($content['post'])) : "<?php"."\n".trim($modx->getPhpCompat()->htmlspecialchars($content['snippet']))."\n") ?></textarea>
521 521
             </div>
522 522
             <!-- PHP text editor end -->
523 523
         </div>
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 								INNER JOIN {$tbl_site_module_depobj} AS smd ON smd.module=sm.id AND smd.type=40 
553 553
 								INNER JOIN {$tbl_site_snippets} AS ss ON ss.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams=1", 'sm.name');
554 554
                                 while ($row = $modx->getDatabase()->getRow($ds)) {
555
-                                    echo "<option value='" . $row['guid'] . "'" . ($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($row['name']) . "</option>";
555
+                                    echo "<option value='".$row['guid']."'".($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($row['name'])."</option>";
556 556
                                 }
557 557
                                 ?>
558 558
                             </select>
Please login to merge, or discard this patch.
manager/actions/mutate_tv_rank.dynamic.php 1 patch
Spacing   +4 added lines, -4 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_template')) {
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 $updateMsg = '';
16 16
 
17 17
 if (isset($_POST['listSubmitted'])) {
18
-    $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>';
18
+    $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>';
19 19
     foreach ($_POST as $listName => $listValue) {
20 20
         if ($listName == 'listSubmitted' || $listName == 'reset') {
21 21
             continue;
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
     $sortableList = '<div class="clearfix"><ul id="sortlist" class="sortableList">';
41 41
     while ($row = $modx->getDatabase()->getRow($rs)) {
42 42
         $caption = $row['caption'] != '' ? $row['caption'] : $row['name'];
43
-        $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>';
43
+        $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>';
44 44
     }
45 45
     $sortableList .= '</ul></div>';
46 46
 } else {
47
-    $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>';
47
+    $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>';
48 48
 }
49 49
 ?>
50 50
 
Please login to merge, or discard this patch.