Completed
Pull Request — develop (#716)
by Agel_Nash
09:00
created
manager/processors/save_web_user.processor.php 1 patch
Spacing   +42 added lines, -42 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('save_web_user')) {
5
+if (!$modx->hasPermission('save_web_user')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 $tbl_web_groups = $modx->getFullTableName('web_groups');
12 12
 
13 13
 $input = $_POST;
14
-foreach($input as $k => $v) {
15
-	if($k !== 'comment') {
14
+foreach ($input as $k => $v) {
15
+	if ($k !== 'comment') {
16 16
 		$v = $modx->htmlspecialchars($v, ENT_NOQUOTES);
17 17
 	}
18 18
 	$input[$k] = $v;
19 19
 }
20 20
 
21
-$id = (int)$input['id'];
21
+$id = (int) $input['id'];
22 22
 $oldusername = $input['oldusername'];
23 23
 $newusername = !empty ($input['newusername']) ? trim($input['newusername']) : "New User";
24 24
 $esc_newusername = $modx->db->escape($newusername);
@@ -50,21 +50,21 @@  discard block
 block discarded – undo
50 50
 $user_groups = $input['user_groups'];
51 51
 
52 52
 // verify password
53
-if($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) {
53
+if ($passwordgenmethod == "spec" && $input['specifiedpassword'] != $input['confirmpassword']) {
54 54
 	webAlertAndQuit("Password typed is mismatched", 88);
55 55
 }
56 56
 
57 57
 // verify email
58
-if($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) {
58
+if ($email == '' || !preg_match("/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,24}$/i", $email)) {
59 59
 	webAlertAndQuit("E-mail address doesn't seem to be valid!", 88);
60 60
 }
61 61
 
62
-switch($input['mode']) {
62
+switch ($input['mode']) {
63 63
 	case '87' : // new user
64 64
 		// check if this user name already exist
65 65
 		$rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}'");
66 66
 		$limit = $modx->db->getValue($rs);
67
-		if($limit > 0) {
67
+		if ($limit > 0) {
68 68
 			webAlertAndQuit("User name is already in use!", 88);
69 69
 		}
70 70
 
@@ -72,21 +72,21 @@  discard block
 block discarded – undo
72 72
 		if ($modx->config['allow_multiple_emails'] != 1) {
73 73
 			$rs = $modx->db->select('count(id)', $tbl_web_user_attributes, "email='{$esc_email}' AND id!='{$id}'");
74 74
 			$limit = $modx->db->getValue($rs);
75
-			if($limit > 0) {
75
+			if ($limit > 0) {
76 76
 				webAlertAndQuit("Email is already in use!", 88);
77 77
 			}
78 78
 		}
79 79
 
80 80
 		// generate a new password for this user
81
-		if($specifiedpassword != "" && $passwordgenmethod == "spec") {
82
-			if(strlen($specifiedpassword) < 6) {
81
+		if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
82
+			if (strlen($specifiedpassword) < 6) {
83 83
 				webAlertAndQuit("Password is too short!", 88);
84 84
 			} else {
85 85
 				$newpassword = $specifiedpassword;
86 86
 			}
87
-		} elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
87
+		} elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
88 88
 			webAlertAndQuit("You didn't specify a password for this user!", 88);
89
-		} elseif($passwordgenmethod == 'g') {
89
+		} elseif ($passwordgenmethod == 'g') {
90 90
 			$newpassword = generate_password(8);
91 91
 		} else {
92 92
 			webAlertAndQuit("No password generation method specified!", 88);
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 		/*******************************************************************************/
117 117
 		// put the user in the user_groups he/ she should be in
118 118
 		// first, check that up_perms are switched on!
119
-		if($use_udperms == 1) {
120
-			if(!empty($user_groups)) {
121
-				for($i = 0; $i < count($user_groups); $i++) {
119
+		if ($use_udperms == 1) {
120
+			if (!empty($user_groups)) {
121
+				for ($i = 0; $i < count($user_groups); $i++) {
122 122
 					$f = array();
123
-					$f['webgroup'] = (int)$user_groups[$i];
123
+					$f['webgroup'] = (int) $user_groups[$i];
124 124
 					$f['webuser'] = $internalKey;
125 125
 					$modx->db->insert($f, $tbl_web_groups);
126 126
 				}
@@ -144,20 +144,20 @@  discard block
 block discarded – undo
144 144
             "id" => $internalKey
145 145
         ));
146 146
 
147
-		if($passwordnotifymethod == 'e') {
147
+		if ($passwordnotifymethod == 'e') {
148 148
             sendMailMessageForUser($email, $newusername, $newpassword, $fullname, $websignupemail_message, $site_url);
149
-			if($input['stay'] != '') {
149
+			if ($input['stay'] != '') {
150 150
 				$a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
151
-				$header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
151
+				$header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
152 152
 				header($header);
153 153
 			} else {
154 154
 				$header = "Location: index.php?a=99&r=2";
155 155
 				header($header);
156 156
 			}
157 157
 		} else {
158
-			if($input['stay'] != '') {
158
+			if ($input['stay'] != '') {
159 159
 				$a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
160
-				$stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
160
+				$stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
161 161
 			} else {
162 162
 				$stayUrl = "index.php?a=99&r=2";
163 163
 			}
@@ -190,29 +190,29 @@  discard block
 block discarded – undo
190 190
 		break;
191 191
 	case '88' : // edit user
192 192
 		// generate a new password for this user
193
-		if($genpassword == 1) {
194
-			if($specifiedpassword != "" && $passwordgenmethod == "spec") {
195
-				if(strlen($specifiedpassword) < 6) {
193
+		if ($genpassword == 1) {
194
+			if ($specifiedpassword != "" && $passwordgenmethod == "spec") {
195
+				if (strlen($specifiedpassword) < 6) {
196 196
 					webAlertAndQuit("Password is too short!", 88);
197 197
 				} else {
198 198
 					$newpassword = $specifiedpassword;
199 199
 				}
200
-			} elseif($specifiedpassword == "" && $passwordgenmethod == "spec") {
200
+			} elseif ($specifiedpassword == "" && $passwordgenmethod == "spec") {
201 201
 				webAlertAndQuit("You didn't specify a password for this user!", 88);
202
-			} elseif($passwordgenmethod == 'g') {
202
+			} elseif ($passwordgenmethod == 'g') {
203 203
 				$newpassword = generate_password(8);
204 204
 			} else {
205 205
 				webAlertAndQuit("No password generation method specified!", 88);
206 206
 			}
207 207
 		}
208
-		if($passwordnotifymethod == 'e') {
208
+		if ($passwordnotifymethod == 'e') {
209 209
             sendMailMessageForUser($email, $newusername, $newpassword, $fullname, $websignupemail_message, $site_url);
210 210
 		}
211 211
 
212 212
 		// check if the username already exist
213 213
 		$rs = $modx->db->select('count(id)', $tbl_web_users, "username='{$esc_newusername}' AND id!='{$id}'");
214 214
 		$limit = $modx->db->getValue($rs);
215
-		if($limit > 0) {
215
+		if ($limit > 0) {
216 216
 			webAlertAndQuit("User name is already in use!", 88);
217 217
 		}
218 218
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 		if ($modx->config['allow_multiple_emails'] != 1) {
221 221
 			$rs = $modx->db->select('count(internalKey)', $tbl_web_user_attributes, "email='{$esc_email}' AND internalKey!='{$id}'");
222 222
 			$limit = $modx->db->getValue($rs);
223
-			if($limit > 0) {
223
+			if ($limit > 0) {
224 224
 				webAlertAndQuit("Email is already in use!", 88);
225 225
 			}
226 226
 		}
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		// update user name and password
235 235
 		$field = array();
236 236
 		$field['username'] = $esc_newusername;
237
-		if($genpassword == 1) {
237
+		if ($genpassword == 1) {
238 238
 			$field['password'] = md5($newpassword);
239 239
 		}
240 240
 		$modx->db->update($field, $tbl_web_users, "id='{$id}'");
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 		/*******************************************************************************/
252 252
 		// put the user in the user_groups he/ she should be in
253 253
 		// first, check that up_perms are switched on!
254
-		if($use_udperms == 1) {
254
+		if ($use_udperms == 1) {
255 255
 			// as this is an existing user, delete his/ her entries in the groups before saving the new groups
256 256
 			$modx->db->delete($tbl_web_groups, "webuser='{$id}'");
257
-			if(!empty($user_groups)) {
258
-				for($i = 0; $i < count($user_groups); $i++) {
257
+			if (!empty($user_groups)) {
258
+				for ($i = 0; $i < count($user_groups); $i++) {
259 259
 					$field = array();
260
-					$field['webgroup'] = (int)$user_groups[$i];
260
+					$field['webgroup'] = (int) $user_groups[$i];
261 261
 					$field['webuser'] = $id;
262 262
 					$modx->db->insert($field, $tbl_web_groups);
263 263
 				}
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         ));
280 280
 
281 281
         // invoke OnWebChangePassword event
282
-        if($genpassword == 1) {
282
+        if ($genpassword == 1) {
283 283
             $modx->invokeEvent("OnWebChangePassword", array(
284 284
                 "userid" => $id,
285 285
                 "username" => $newusername,
@@ -293,10 +293,10 @@  discard block
 block discarded – undo
293 293
             "id" => $id
294 294
         ));
295 295
 
296
-		if($genpassword == 1 && $passwordnotifymethod == 's') {
297
-			if($input['stay'] != '') {
296
+		if ($genpassword == 1 && $passwordnotifymethod == 's') {
297
+			if ($input['stay'] != '') {
298 298
 				$a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
299
-				$stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
299
+				$stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
300 300
 			} else {
301 301
 				$stayUrl = "index.php?a=99&r=2";
302 302
 			}
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
 
325 325
 			include_once "footer.inc.php";
326 326
 		} else {
327
-			if($input['stay'] != '') {
327
+			if ($input['stay'] != '') {
328 328
 				$a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
329
-				$header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
329
+				$header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
330 330
 				header($header);
331 331
 			} else {
332 332
 				$header = "Location: index.php?a=99&r=2";
Please login to merge, or discard this patch.
manager/processors/delete_content.processor.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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('delete_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /*******ищем родителя чтобы к нему вернуться********/
15
-$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************ а заодно и путь возврата (сам путь внизу файла) **********/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /*****************************/
25 25
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                             "children"=>$children
46 46
                         ));
47 47
 
48
-if (count($children)>0) {
48
+if (count($children) > 0) {
49 49
     $modx->db->update(
50 50
         array(
51 51
             'deleted'   => 1,
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
         ), $modx->getFullTableName('site_content'), "id IN (".implode(", ", $children).")");
55 55
 }
56 56
 
57
-if ($site_start==$id) {
57
+if ($site_start == $id) {
58 58
     $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!");
59 59
 }
60 60
 
61
-if ($site_unavailable_page==$id) {
61
+if ($site_unavailable_page == $id) {
62 62
     $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!");
63 63
 }
64 64
 
65
-if ($error_page==$id) {
65
+if ($error_page == $id) {
66 66
     $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!");
67 67
 }
68 68
 
69
-if ($unauthorized_page==$id) {
69
+if ($unauthorized_page == $id) {
70 70
     $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!");
71 71
 }
72 72
 
@@ -92,5 +92,5 @@  discard block
 block discarded – undo
92 92
 $modx->clearCache('full');
93 93
 
94 94
 // finished emptying cache - redirect
95
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
95
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
96 96
 header($header);
Please login to merge, or discard this patch.
manager/actions/search.static.php 1 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->db->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->db->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->db->escape(trim($_REQUEST['searchfields']));
88 88
     $search_alias = $modx->db->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->db->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->db->query($articul_query);
120 120
 		$articul_id_array = $modx->db->makeArray($articul_result);
121
-		if(count($articul_id_array)>0){
121
+		if (count($articul_id_array) > 0) {
122 122
 			$articul_id = '';
123 123
 			$i = 1;
124
-			foreach( $articul_id_array as $articul ) {
125
-				$articul_id.=$articul['contentid'];
126
-				if($i !== count($articul_id_array)){
127
-					$articul_id.=',';
124
+			foreach ($articul_id_array as $articul) {
125
+				$articul_id .= $articul['contentid'];
126
+				if ($i !== count($articul_id_array)) {
127
+					$articul_id .= ',';
128 128
 				}
129 129
 				$i++;
130 130
 			}
131 131
 		$articul_id_query = " OR sc.id IN ({$articul_id})";
132
-		}else{
132
+		} else {
133 133
 			$articul_id_query = '';
134 134
 		}
135 135
 		/*end search by TV*/
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if (ctype_digit($searchfields)) {
138 138
             $sqladd .= "sc.id='{$searchfields}'";
139 139
             if (strlen($searchfields) > 3) {
140
-				$sqladd .= $articul_id_query;//search by TV
140
+				$sqladd .= $articul_id_query; //search by TV
141 141
                 $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'";
142 142
             }
143 143
         }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'";
158 158
             $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'";
159 159
             $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'";
160
-            $sqladd .= $articul_id_query;//search by TV
160
+            $sqladd .= $articul_id_query; //search by TV
161 161
             $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->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id');
195
+        $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id');
196 196
         $limit = $modx->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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->db->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.
manager/actions/mutate_content.dynamic.php 1 patch
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  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
 /********************/
7
-$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC';
8
-$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon';
9
-$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : '';
10
-$add_path = $sd . $sb . $pg;
7
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
8
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
9
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
10
+$add_path = $sd.$sb.$pg;
11 11
 /*******************/
12 12
 
13 13
 // check permissions
14
-switch($modx->manager->action) {
14
+switch ($modx->manager->action) {
15 15
 	case 27:
16
-		if(!$modx->hasPermission('edit_document')) {
16
+		if (!$modx->hasPermission('edit_document')) {
17 17
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 		}
19 19
 		break;
20 20
 	case 85:
21 21
 	case 72:
22 22
 	case 4:
23
-		if(!$modx->hasPermission('new_document')) {
23
+		if (!$modx->hasPermission('new_document')) {
24 24
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
25
-		} elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') {
25
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') {
26 26
 			// check user has permissions for parent
27 27
 			$udperms = new EvolutionCMS\Legacy\Permissions();
28 28
 			$udperms->user = $modx->getLoginUserID();
29 29
 			$udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid'];
30 30
 			$udperms->role = $_SESSION['mgrRole'];
31
-			if(!$udperms->checkPermissions()) {
31
+			if (!$udperms->checkPermissions()) {
32 32
 				$modx->webAlertAndQuit($_lang["access_permission_denied"]);
33 33
 			}
34 34
 		}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
38 38
 }
39 39
 
40
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
40
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
41 41
 
42 42
 // Get table names (alphabetical)
43 43
 $tbl_categories = $modx->getFullTableName('categories');
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 $tbl_site_tmplvar_templates = $modx->getFullTableName('site_tmplvar_templates');
53 53
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
54 54
 
55
-if($modx->manager->action == 27) {
55
+if ($modx->manager->action == 27) {
56 56
 	//editing an existing document
57 57
 	// check permissions on the document
58 58
 	$udperms = new EvolutionCMS\Legacy\Permissions();
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 	$udperms->document = $id;
61 61
 	$udperms->role = $_SESSION['mgrRole'];
62 62
 
63
-	if(!$udperms->checkPermissions()) {
63
+	if (!$udperms->checkPermissions()) {
64 64
 		$modx->webAlertAndQuit($_lang["access_permission_denied"]);
65 65
 	}
66 66
 }
67 67
 
68 68
 // check to see if resource isn't locked
69
-if($lockedEl = $modx->elementIsLocked(7, $id)) {
69
+if ($lockedEl = $modx->elementIsLocked(7, $id)) {
70 70
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource']));
71 71
 }
72 72
 // end check for lock
@@ -75,27 +75,27 @@  discard block
 block discarded – undo
75 75
 $modx->lockElement(7, $id);
76 76
 
77 77
 // get document groups for current user
78
-if($_SESSION['mgrDocgroups']) {
78
+if ($_SESSION['mgrDocgroups']) {
79 79
 	$docgrp = implode(',', $_SESSION['mgrDocgroups']);
80 80
 }
81 81
 
82
-if(!empty ($id)) {
82
+if (!empty ($id)) {
83 83
 	$access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']);
84
-	if($docgrp) {
84
+	if ($docgrp) {
85 85
 		$access .= " OR dg.document_group IN ({$docgrp})";
86 86
 	}
87 87
 	$rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})");
88 88
 	$content = array();
89 89
 	$content = $modx->db->getRow($rs);
90 90
 	$modx->documentObject = &$content;
91
-	if(!$content) {
91
+	if (!$content) {
92 92
 		$modx->webAlertAndQuit($_lang["access_permission_denied"]);
93 93
 	}
94 94
 	$_SESSION['itemname'] = $content['pagetitle'];
95 95
 } else {
96 96
 	$content = array();
97 97
 
98
-	if(isset($_REQUEST['newtemplate'])) {
98
+	if (isset($_REQUEST['newtemplate'])) {
99 99
 		$content['template'] = $_REQUEST['newtemplate'];
100 100
 	} else {
101 101
 		$content['template'] = getDefaultTemplate();
@@ -106,22 +106,22 @@  discard block
 block discarded – undo
106 106
 
107 107
 // restore saved form
108 108
 $formRestored = $modx->manager->loadFormValues();
109
-if(isset($_REQUEST['newtemplate'])) {
109
+if (isset($_REQUEST['newtemplate'])) {
110 110
 	$formRestored = true;
111 111
 }
112 112
 
113 113
 // retain form values if template was changed
114 114
 // edited to convert pub_date and unpub_date
115 115
 // sottwell 02-09-2006
116
-if($formRestored == true) {
116
+if ($formRestored == true) {
117 117
 	$content = array_merge($content, $_POST);
118 118
 	$content['content'] = $_POST['ta'];
119
-	if(empty ($content['pub_date'])) {
119
+	if (empty ($content['pub_date'])) {
120 120
 		unset ($content['pub_date']);
121 121
 	} else {
122 122
 		$content['pub_date'] = $modx->toTimeStamp($content['pub_date']);
123 123
 	}
124
-	if(empty ($content['unpub_date'])) {
124
+	if (empty ($content['unpub_date'])) {
125 125
 		unset ($content['unpub_date']);
126 126
 	} else {
127 127
 		$content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']);
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 }
130 130
 
131 131
 // increase menu index if this is a new document
132
-if(!isset ($_REQUEST['id'])) {
133
-	if(!isset ($modx->config['auto_menuindex'])) {
132
+if (!isset ($_REQUEST['id'])) {
133
+	if (!isset ($modx->config['auto_menuindex'])) {
134 134
 		$modx->config['auto_menuindex'] = 1;
135 135
 	}
136
-	if($modx->config['auto_menuindex']) {
137
-		$pid = (int)$_REQUEST['pid'];
136
+	if ($modx->config['auto_menuindex']) {
137
+		$pid = (int) $_REQUEST['pid'];
138 138
 		$rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'");
139 139
 		$content['menuindex'] = $modx->db->getValue($rs);
140 140
 	} else {
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 	}
143 143
 }
144 144
 
145
-if(isset ($_POST['which_editor'])) {
145
+if (isset ($_POST['which_editor'])) {
146 146
 	$modx->config['which_editor'] = $_POST['which_editor'];
147 147
 }
148 148
 
149 149
 // Add lock-element JS-Script
150 150
 $lockElementId = $id;
151 151
 $lockElementType = 7;
152
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
152
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
153 153
 ?>
154 154
 	<script type="text/javascript">
155 155
 		/* <![CDATA[ */
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			},
180 180
 			cancel: function() {
181 181
 				documentDirty = false;
182
-				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>';
182
+				document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>';
183 183
 			},
184 184
 			duplicate: function() {
185 185
 				if(confirm("<?= $_lang['confirm_resource_duplicate']?>") === true) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 				}
188 188
 			},
189 189
 			view: function() {
190
-				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin');
190
+				window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin');
191 191
 			}
192 192
 		};
193 193
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
 			'template' => $content['template']
550 550
 		));
551 551
 
552
-		if(is_array($evtOut)) {
552
+		if (is_array($evtOut)) {
553 553
 			echo implode('', $evtOut);
554 554
 		}
555 555
 
@@ -573,8 +573,8 @@  discard block
 block discarded – undo
573 573
 		<fieldset id="create_edit">
574 574
 
575 575
 			<h1>
576
-				<i class="fa fa-pencil-square-o"></i><?php if(isset($_REQUEST['id'])) {
577
-					echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>';
576
+				<i class="fa fa-pencil-square-o"></i><?php if (isset($_REQUEST['id'])) {
577
+					echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').'<small>('.$_REQUEST['id'].')</small>';
578 578
 				} else {
579 579
 				    if ($modx->manager->action == '4') {
580 580
                         echo $_lang['add_resource'];
@@ -590,36 +590,36 @@  discard block
 block discarded – undo
590 590
 
591 591
 			<?php
592 592
 			// breadcrumbs
593
-			if($modx->config['use_breadcrumbs']) {
593
+			if ($modx->config['use_breadcrumbs']) {
594 594
 				$temp = array();
595 595
 				$title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title'];
596 596
 
597
-				if(isset($_REQUEST['id']) && $content['parent'] != 0) {
597
+				if (isset($_REQUEST['id']) && $content['parent'] != 0) {
598 598
 					$bID = (int) $_REQUEST['id'];
599 599
 					$temp = $modx->getParentIds($bID);
600
-				} else if(isset($_REQUEST['pid'])) {
600
+				} else if (isset($_REQUEST['pid'])) {
601 601
 					$bID = (int) $_REQUEST['pid'];
602 602
 					$temp = $modx->getParentIds($bID);
603 603
 					array_unshift($temp, $bID);
604 604
 				}
605 605
 
606
-				if($temp) {
606
+				if ($temp) {
607 607
 					$parents = implode(',', $temp);
608 608
 
609
-					if(!empty($parents)) {
609
+					if (!empty($parents)) {
610 610
 						$where = "FIND_IN_SET(id,'{$parents}') DESC";
611 611
 						$rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where);
612
-						while($row = $modx->db->getRow($rs)) {
612
+						while ($row = $modx->db->getRow($rs)) {
613 613
 							$out .= '<li class="breadcrumbs__li">
614
-                                <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a>
614
+                                <a href="index.php?a=27&id=' . $row['id'].'" class="breadcrumbs__a">'.htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']).'</a>
615 615
                                 <span class="breadcrumbs__sep">&gt;</span>
616 616
                             </li>';
617 617
 						}
618 618
 					}
619 619
 				}
620 620
 
621
-				$out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>';
622
-				echo '<ul class="breadcrumbs">' . $out . '</ul>';
621
+				$out .= '<li class="breadcrumbs__li breadcrumbs__li_current">'.$title.'</li>';
622
+				echo '<ul class="breadcrumbs">'.$out.'</ul>';
623 623
 			}
624 624
 			?>
625 625
 
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 					$evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array(
637 637
 						'id' => $id
638 638
 					));
639
-					if(is_array($evtOut)) {
639
+					if (is_array($evtOut)) {
640 640
 						echo implode('', $evtOut);
641 641
 					} else {
642 642
 						?>
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 									</td>
693 693
 								</tr>
694 694
 
695
-								<?php if($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?>
695
+								<?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?>
696 696
 
697 697
 									<tr>
698 698
 										<td><span class="warning"><?= $_lang['weblink'] ?></span>
@@ -728,17 +728,17 @@  discard block
 block discarded – undo
728 728
 											$from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id";
729 729
 											$rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC');
730 730
 											$currentCategory = '';
731
-											while($row = $modx->db->getRow($rs)) {
732
-												if($row['selectable'] != 1 && $row['id'] != $content['template']) {
731
+											while ($row = $modx->db->getRow($rs)) {
732
+												if ($row['selectable'] != 1 && $row['id'] != $content['template']) {
733 733
 													continue;
734 734
 												};
735 735
 												// Skip if not selectable but show if selected!
736 736
 												$thisCategory = $row['category'];
737
-												if($thisCategory == null) {
737
+												if ($thisCategory == null) {
738 738
 													$thisCategory = $_lang["no_category"];
739 739
 												}
740
-												if($thisCategory != $currentCategory) {
741
-													if($closeOptGroup) {
740
+												if ($thisCategory != $currentCategory) {
741
+													if ($closeOptGroup) {
742 742
 														echo "\t\t\t\t\t</optgroup>\n";
743 743
 													}
744 744
 													echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
@@ -747,10 +747,10 @@  discard block
 block discarded – undo
747 747
 
748 748
 												$selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : '';
749 749
 
750
-												echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n";
750
+												echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
751 751
 												$currentCategory = $thisCategory;
752 752
 											}
753
-											if($thisCategory != '') {
753
+											if ($thisCategory != '') {
754 754
 												echo "\t\t\t\t\t</optgroup>\n";
755 755
 											}
756 756
 											?>
@@ -794,20 +794,20 @@  discard block
 block discarded – undo
794 794
 									<td valign="top">
795 795
 										<?php
796 796
 										$parentlookup = false;
797
-										if(isset ($_REQUEST['id'])) {
798
-											if($content['parent'] == 0) {
797
+										if (isset ($_REQUEST['id'])) {
798
+											if ($content['parent'] == 0) {
799 799
 												$parentname = $site_name;
800 800
 											} else {
801 801
 												$parentlookup = $content['parent'];
802 802
 											}
803
-										} elseif(isset ($_REQUEST['pid'])) {
804
-											if($_REQUEST['pid'] == 0) {
803
+										} elseif (isset ($_REQUEST['pid'])) {
804
+											if ($_REQUEST['pid'] == 0) {
805 805
 												$parentname = $site_name;
806 806
 											} else {
807 807
 												$parentlookup = $_REQUEST['pid'];
808 808
 											}
809
-										} elseif(isset($_POST['parent'])) {
810
-											if($_POST['parent'] == 0) {
809
+										} elseif (isset($_POST['parent'])) {
810
+											if ($_POST['parent'] == 0) {
811 811
 												$parentname = $site_name;
812 812
 											} else {
813 813
 												$parentlookup = $_POST['parent'];
@@ -816,10 +816,10 @@  discard block
 block discarded – undo
816 816
 											$parentname = $site_name;
817 817
 											$content['parent'] = 0;
818 818
 										}
819
-										if($parentlookup !== false && is_numeric($parentlookup)) {
819
+										if ($parentlookup !== false && is_numeric($parentlookup)) {
820 820
 											$rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'");
821 821
 											$parentname = $modx->db->getValue($rs);
822
-											if(!$parentname) {
822
+											if (!$parentname) {
823 823
 												$modx->webAlertAndQuit($_lang["error_no_parent"]);
824 824
 											}
825 825
 										}
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
 								}*/
862 862
 								?>
863 863
 
864
-								<?php if($content['type'] == 'document' || $modx->manager->action == '4') { ?>
864
+								<?php if ($content['type'] == 'document' || $modx->manager->action == '4') { ?>
865 865
 									<tr>
866 866
 										<td colspan="2">
867 867
 											<hr>
@@ -874,8 +874,8 @@  discard block
 block discarded – undo
874 874
 														<?php
875 875
 														// invoke OnRichTextEditorRegister event
876 876
 														$evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
877
-														if(is_array($evtOut)) {
878
-															for($i = 0; $i < count($evtOut); $i++) {
877
+														if (is_array($evtOut)) {
878
+															for ($i = 0; $i < count($evtOut); $i++) {
879 879
 																$editor = $evtOut[$i];
880 880
 																echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n";
881 881
 															}
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 											</div>
887 887
 											<div id="content_body">
888 888
 												<?php
889
-												if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) {
889
+												if (($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) {
890 890
 													$htmlContent = $content['content'];
891 891
 													?>
892 892
 													<div class="section-editor clearfix">
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 													$richtexteditorIds[$modx->config['which_editor']][] = 'ta';
900 900
 													$richtexteditorOptions[$modx->config['which_editor']]['ta'] = '';
901 901
 												} else {
902
-													echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n";
902
+													echo "\t".'<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>'."\n";
903 903
 												}
904 904
 												?>
905 905
 											</div>
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
 
916 916
                             if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) {
917 917
                                 $template = $default_template;
918
-                                $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs'];
918
+                                $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int) $modx->config['group_tvs'];
919 919
                                 if (isset ($_REQUEST['newtemplate'])) {
920 920
                                     $template = $_REQUEST['newtemplate'];
921 921
                                 } else {
@@ -943,10 +943,10 @@  discard block
 block discarded – undo
943 943
                                 );
944 944
                                 $sort = 'tvtpl.rank,tv.rank, tv.id';
945 945
                                 if ($group_tvs) {
946
-                                    $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank';
946
+                                    $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"'.$_lang['no_category'].'") AS category, IFNULL(cat.rank,0) AS category_rank';
947 947
                                     $from .= '
948
-                                    LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category';
949
-                                    $sort = 'cat.rank,cat.id,' . $sort;
948
+                                    LEFT JOIN ' . $tbl_categories.' AS cat ON cat.id=tv.category';
949
+                                    $sort = 'cat.rank,cat.id,'.$sort;
950 950
                                 }
951 951
                                 $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs);
952 952
                                 $rs = $modx->db->select($field, $from, $where, $sort);
@@ -964,8 +964,8 @@  discard block
 block discarded – undo
964 964
                                                 if ($group_tvs == 1 || $group_tvs == 3) {
965 965
                                                     if ($i === 0) {
966 966
                                                         $templateVariablesOutput .= '
967
-                            <div class="tab-section" id="tabTV_' . $row['category_id'] . '">
968
-                                <div class="tab-header">' . $row['category'] . '</div>
967
+                            <div class="tab-section" id="tabTV_' . $row['category_id'].'">
968
+                                <div class="tab-header">' . $row['category'].'</div>
969 969
                                 <div class="tab-body tmplvars">
970 970
                                     <table>' . "\n";
971 971
                                                     } else {
@@ -974,17 +974,17 @@  discard block
 block discarded – undo
974 974
                                 </div>
975 975
                             </div>
976 976
                             
977
-                            <div class="tab-section" id="tabTV_' . $row['category_id'] . '">
978
-                                <div class="tab-header">' . $row['category'] . '</div>
977
+                            <div class="tab-section" id="tabTV_' . $row['category_id'].'">
978
+                                <div class="tab-header">' . $row['category'].'</div>
979 979
                                 <div class="tab-body tmplvars">
980 980
                                     <table>';
981 981
                                                     }
982 982
                                                 } else if ($group_tvs == 2 || $group_tvs == 4) {
983 983
                                                     if ($i === 0) {
984 984
                                                         $templateVariablesOutput .= '
985
-                            <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars">
986
-                                <h2 class="tab">' . $row['category'] . '</h2>
987
-                                <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script>
985
+                            <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars">
986
+                                <h2 class="tab">' . $row['category'].'</h2>
987
+                                <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script>
988 988
                                 
989 989
                                 <div class="tab-body tmplvars">
990 990
                                     <table>';
@@ -994,9 +994,9 @@  discard block
 block discarded – undo
994 994
                                 </div>
995 995
                             </div>
996 996
                             
997
-                            <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars">
998
-                                <h2 class="tab">' . $row['category'] . '</h2>
999
-                                <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script>
997
+                            <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars">
998
+                                <h2 class="tab">' . $row['category'].'</h2>
999
+                                <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script>
1000 1000
                                 
1001 1001
                                 <div class="tab-body tmplvars">
1002 1002
                                     <table>';
@@ -1004,18 +1004,18 @@  discard block
 block discarded – undo
1004 1004
                                                 } else if ($group_tvs == 5) {
1005 1005
                                                     if ($i === 0) {
1006 1006
                                                         $templateVariablesOutput .= '
1007
-                                <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars">
1008
-                                    <h2 class="tab">' . $row['category'] . '</h2>
1009
-                                    <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script>
1007
+                                <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars">
1008
+                                    <h2 class="tab">' . $row['category'].'</h2>
1009
+                                    <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script>
1010 1010
                                     <table>';
1011 1011
                                                     } else {
1012 1012
                                                         $templateVariablesOutput .= '
1013 1013
                                     </table>
1014 1014
                                 </div>
1015 1015
                                 
1016
-                                <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars">
1017
-                                    <h2 class="tab">' . $row['category'] . '</h2>
1018
-                                    <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script>
1016
+                                <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars">
1017
+                                    <h2 class="tab">' . $row['category'].'</h2>
1018
+                                    <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script>
1019 1019
                                     
1020 1020
                                     <table>';
1021 1021
                                                     }
@@ -1035,8 +1035,8 @@  discard block
 block discarded – undo
1035 1035
                                                 $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor'];
1036 1036
                                             };
1037 1037
                                             // Add richtext editor to the list
1038
-                                            $richtexteditorIds[$editor][] = "tv" . $row['id'];
1039
-                                            $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions;
1038
+                                            $richtexteditorIds[$editor][] = "tv".$row['id'];
1039
+                                            $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions;
1040 1040
                                         }
1041 1041
 
1042 1042
                                         $templateVariablesTmp = '';
@@ -1053,24 +1053,24 @@  discard block
 block discarded – undo
1053 1053
                                         }
1054 1054
 
1055 1055
                                         // post back value
1056
-                                        if (array_key_exists('tv' . $row['id'], $_POST)) {
1057
-                                            if (is_array($_POST['tv' . $row['id']])) {
1058
-                                                $tvPBV = implode('||', $_POST['tv' . $row['id']]);
1056
+                                        if (array_key_exists('tv'.$row['id'], $_POST)) {
1057
+                                            if (is_array($_POST['tv'.$row['id']])) {
1058
+                                                $tvPBV = implode('||', $_POST['tv'.$row['id']]);
1059 1059
                                             } else {
1060
-                                                $tvPBV = $_POST['tv' . $row['id']];
1060
+                                                $tvPBV = $_POST['tv'.$row['id']];
1061 1061
                                             }
1062 1062
                                         } else {
1063 1063
                                             $tvPBV = $row['value'];
1064 1064
                                         }
1065 1065
 
1066
-                                        $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">' . $row['description'] . '</span>' : '';
1067
-                                        $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">(' . $_lang['tmplvars_inherited'] . ')</span>' : '';
1068
-                                        $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*' . $row['name'] . '*]</small>' : '';
1066
+                                        $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">'.$row['description'].'</span>' : '';
1067
+                                        $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">('.$_lang['tmplvars_inherited'].')</span>' : '';
1068
+                                        $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*'.$row['name'].'*]</small>' : '';
1069 1069
 
1070 1070
                                         $templateVariablesTmp .= '
1071 1071
                                         <tr>
1072
-                                            <td><span class="warning">' . $row['caption'] . $tvName . '</span>' . $tvDescription . $tvInherited . '</td>
1073
-                                            <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '') . '">' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '</div></td>
1072
+                                            <td><span class="warning">' . $row['caption'].$tvName.'</span>'.$tvDescription.$tvInherited.'</td>
1073
+                                            <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '').'">'.renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray).'</div></td>
1074 1074
                                         </tr>';
1075 1075
 
1076 1076
                                         if ($group_tvs && $row['category_id'] == 0) {
@@ -1084,38 +1084,38 @@  discard block
 block discarded – undo
1084 1084
                                     }
1085 1085
 
1086 1086
                                     if ($templateVariablesGeneral) {
1087
-                                        echo '<table id="tabTV_0" class="tmplvars"><tbody>' . $templateVariablesGeneral . '</tbody></table>';
1087
+                                        echo '<table id="tabTV_0" class="tmplvars"><tbody>'.$templateVariablesGeneral.'</tbody></table>';
1088 1088
                                     }
1089 1089
 
1090 1090
                                     $templateVariables .= '
1091 1091
                         <!-- Template Variables -->' . "\n";
1092 1092
                                     if (!$group_tvs) {
1093 1093
                                         $templateVariables .= '
1094
-                                    <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'] . '</div>
1094
+                                    <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'].'</div>
1095 1095
                                         <div class="sectionBody tmplvars">
1096 1096
                                             <table>';
1097 1097
                                     } else if ($group_tvs == 2) {
1098 1098
                                         $templateVariables .= '
1099 1099
                     <div class="tab-section">
1100
-                        <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'] . '</div>
1100
+                        <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'].'</div>
1101 1101
                         <div class="tab-pane" id="paneTemplateVariables">
1102 1102
                             <script type="text/javascript">
1103
-                                tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . ');
1103
+                                tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').');
1104 1104
                             </script>';
1105 1105
                                     } else if ($group_tvs == 3) {
1106 1106
                                         $templateVariables .= '
1107 1107
                         <div id="templateVariables" class="tab-page tmplvars">
1108
-                            <h2 class="tab">' . $_lang['settings_templvars'] . '</h2>
1108
+                            <h2 class="tab">' . $_lang['settings_templvars'].'</h2>
1109 1109
                             <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>';
1110 1110
                                     } else if ($group_tvs == 4) {
1111 1111
                                         $templateVariables .= '
1112 1112
                     <div id="templateVariables" class="tab-page tmplvars">
1113
-                        <h2 class="tab">' . $_lang['settings_templvars'] . '</h2>
1113
+                        <h2 class="tab">' . $_lang['settings_templvars'].'</h2>
1114 1114
                         <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>
1115 1115
                         
1116 1116
                         <div class="tab-pane" id="paneTemplateVariables">
1117 1117
                             <script type="text/javascript">
1118
-                                tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . ');
1118
+                                tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').');
1119 1119
                             </script>';
1120 1120
                                     }
1121 1121
                                     $templateVariables .= $templateVariablesOutput;
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 
1208 1208
 								<?php
1209 1209
 
1210
-								if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) {
1210
+								if ($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) {
1211 1211
 									?>
1212 1212
 									<tr>
1213 1213
 										<td>
@@ -1230,13 +1230,13 @@  discard block
 block discarded – undo
1230 1230
 										<td>
1231 1231
 											<select name="contentType" class="inputBox" onchange="documentDirty=true;">
1232 1232
 												<?php
1233
-												if(!$content['contentType']) {
1233
+												if (!$content['contentType']) {
1234 1234
 													$content['contentType'] = 'text/html';
1235 1235
 												}
1236 1236
 												$custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml");
1237 1237
 												$ct = explode(",", $custom_contenttype);
1238
-												for($i = 0; $i < count($ct); $i++) {
1239
-													echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n";
1238
+												for ($i = 0; $i < count($ct); $i++) {
1239
+													echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n";
1240 1240
 												}
1241 1241
 												?>
1242 1242
 											</select>
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
 									</tr>
1263 1263
 									<?php
1264 1264
 								} else {
1265
-									if($content['type'] != 'reference' && $modx->manager->action != '72') {
1265
+									if ($content['type'] != 'reference' && $modx->manager->action != '72') {
1266 1266
 										// non-admin managers creating or editing a document resource
1267 1267
 										?>
1268 1268
 										<input type="hidden" name="contentType" value="<?= (isset($content['contentType']) ? $content['contentType'] : "text/html") ?>" />
@@ -1362,15 +1362,15 @@  discard block
 block discarded – undo
1362 1362
 						<?php
1363 1363
 					/*******************************
1364 1364
 					 * Document Access Permissions */
1365
-					if($use_udperms == 1) {
1365
+					if ($use_udperms == 1) {
1366 1366
 						$groupsarray = array();
1367 1367
 						$sql = '';
1368 1368
 
1369 1369
 						$documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']));
1370
-						if($documentId > 0) {
1370
+						if ($documentId > 0) {
1371 1371
 							// Load up, the permissions from the parent (if new document) or existing document
1372 1372
 							$rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'");
1373
-							while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1373
+							while ($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id'];
1374 1374
 
1375 1375
 							// Load up the current permissions and names
1376 1376
 							$vs = array(
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 						}
1387 1387
 
1388 1388
 						// retain selected doc groups between post
1389
-						if(isset($_POST['docgroups'])) {
1389
+						if (isset($_POST['docgroups'])) {
1390 1390
 							$groupsarray = array_merge($groupsarray, $_POST['docgroups']);
1391 1391
 						}
1392 1392
 
@@ -1405,26 +1405,26 @@  discard block
 block discarded – undo
1405 1405
 						$permissions_no = 0; // count permissions the current mgr user doesn't have
1406 1406
 
1407 1407
 						// Loop through the permissions list
1408
-						while($row = $modx->db->getRow($rs)) {
1408
+						while ($row = $modx->db->getRow($rs)) {
1409 1409
 
1410 1410
 							// Create an inputValue pair (group ID and group link (if it exists))
1411
-							$inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new');
1412
-							$inputId = 'group-' . $row['id'];
1411
+							$inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new');
1412
+							$inputId = 'group-'.$row['id'];
1413 1413
 
1414 1414
 							$checked = in_array($inputValue, $groupsarray);
1415
-							if($checked) {
1415
+							if ($checked) {
1416 1416
 								$notPublic = true;
1417 1417
 							} // Mark as private access (either web or manager)
1418 1418
 
1419 1419
 							// Skip the access permission if the user doesn't have access...
1420
-							if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) {
1420
+							if ((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) {
1421 1421
 								continue;
1422 1422
 							}
1423 1423
 
1424 1424
 							// Setup attributes for this Input box
1425 1425
 							$inputAttributes['id'] = $inputId;
1426 1426
 							$inputAttributes['value'] = $inputValue;
1427
-							if($checked) {
1427
+							if ($checked) {
1428 1428
 								$inputAttributes['checked'] = 'checked';
1429 1429
 							} else {
1430 1430
 								unset($inputAttributes['checked']);
@@ -1432,10 +1432,10 @@  discard block
 block discarded – undo
1432 1432
 
1433 1433
 							// Create attribute string list
1434 1434
 							$inputString = array();
1435
-							foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"';
1435
+							foreach ($inputAttributes as $k => $v) $inputString[] = $k.'="'.$v.'"';
1436 1436
 
1437 1437
 							// Make the <input> HTML
1438
-							$inputHTML = '<input ' . implode(' ', $inputString) . ' />';
1438
+							$inputHTML = '<input '.implode(' ', $inputString).' />';
1439 1439
 
1440 1440
 							// does user have this permission?
1441 1441
 							$from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg";
@@ -1446,23 +1446,23 @@  discard block
 block discarded – undo
1446 1446
 							$where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs);
1447 1447
 							$rsp = $modx->db->select('COUNT(mg.id)', $from, $where);
1448 1448
 							$count = $modx->db->getValue($rsp);
1449
-							if($count > 0) {
1449
+							if ($count > 0) {
1450 1450
 								++$permissions_yes;
1451 1451
 							} else {
1452 1452
 								++$permissions_no;
1453 1453
 							}
1454
-							$permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>';
1454
+							$permissions[] = "\t\t".'<li>'.$inputHTML.'<label for="'.$inputId.'">'.$row['name'].'</label></li>';
1455 1455
 						}
1456 1456
 						// if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public
1457
-						if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) {
1457
+						if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) {
1458 1458
 							$permissions = array();
1459 1459
 						}
1460 1460
 
1461 1461
 						// See if the Access Permissions section is worth displaying...
1462
-						if(!empty($permissions)) {
1462
+						if (!empty($permissions)) {
1463 1463
 							// Add the "All Document Groups" item if we have rights in both contexts
1464
-							if($isManager && $isWeb) {
1465
-								array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>');
1464
+							if ($isManager && $isWeb) {
1465
+								array_unshift($permissions, "\t\t".'<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true);" /><label for="groupall" class="warning">'.$_lang['all_doc_groups'].'</label></li>');
1466 1466
 							}
1467 1467
 							// Output the permissions list...
1468 1468
 							?>
@@ -1495,12 +1495,12 @@  discard block
 block discarded – undo
1495 1495
 								</script>
1496 1496
 								<p><?= $_lang['access_permissions_docs_message'] ?></p>
1497 1497
 								<ul>
1498
-									<?= implode("\n", $permissions) . "\n" ?>
1498
+									<?= implode("\n", $permissions)."\n" ?>
1499 1499
 								</ul>
1500 1500
 							</div><!--div class="tab-page" id="tabAccess"-->
1501 1501
 							<?php
1502 1502
 						} // !empty($permissions)
1503
-						elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) {
1503
+						elseif ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) {
1504 1504
 							?>
1505 1505
 							<p><?= $_lang["access_permissions_docs_collision"] ?></p>
1506 1506
 							<?php
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 						'template' => $content['template']
1521 1521
 					));
1522 1522
 
1523
-					if(is_array($evtOut)) {
1523
+					if (is_array($evtOut)) {
1524 1524
 						echo implode('', $evtOut);
1525 1525
 					}
1526 1526
 					?>
@@ -1533,16 +1533,16 @@  discard block
 block discarded – undo
1533 1533
 		storeCurTemplate();
1534 1534
 	</script>
1535 1535
 <?php
1536
-if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) {
1537
-	if(is_array($richtexteditorIds)) {
1538
-		foreach($richtexteditorIds as $editor => $elements) {
1536
+if (($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) {
1537
+	if (is_array($richtexteditorIds)) {
1538
+		foreach ($richtexteditorIds as $editor => $elements) {
1539 1539
 			// invoke OnRichTextEditorInit event
1540 1540
 			$evtOut = $modx->invokeEvent('OnRichTextEditorInit', array(
1541 1541
 				'editor' => $editor,
1542 1542
 				'elements' => $elements,
1543 1543
 				'options' => $richtexteditorOptions[$editor]
1544 1544
 			));
1545
-			if(is_array($evtOut)) {
1545
+			if (is_array($evtOut)) {
1546 1546
 				echo implode('', $evtOut);
1547 1547
 			}
1548 1548
 		}
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  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
-switch($modx->manager->action) {
5
+switch ($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if (!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if (!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
16 16
 	default:
17 17
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
18 18
 }
19
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
19
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
20 20
 // Get table names (alphabetical)
21 21
 $tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
22 22
 $tbl_site_content = $modx->getFullTableName('site_content');
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 // check to see the module editor isn't locked
34
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
34
+if ($lockedEl = $modx->elementIsLocked(6, $id)) {
35 35
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
@@ -39,29 +39,29 @@  discard block
 block discarded – undo
39 39
 // Lock snippet for other users to edit
40 40
 $modx->lockElement(6, $id);
41 41
 
42
-if(isset($_GET['id'])) {
42
+if (isset($_GET['id'])) {
43 43
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
44 44
 	$content = $modx->db->getRow($rs);
45
-	if(!$content) {
45
+	if (!$content) {
46 46
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47 47
 	}
48 48
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49 49
 	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
50
+	if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51 51
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52 52
 	}
53 53
 } else {
54 54
 	$_SESSION['itemname'] = $_lang["new_module"];
55 55
 	$content['wrap'] = '1';
56 56
 }
57
-if($modx->manager->hasFormValues()) {
57
+if ($modx->manager->hasFormValues()) {
58 58
 	$modx->manager->loadFormValues();
59 59
 }
60 60
 
61 61
 // Add lock-element JS-Script
62 62
 $lockElementId = $id;
63 63
 $lockElementType = 6;
64
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
64
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
65 65
 ?>
66 66
 <script type="text/javascript">
67 67
 	function loadDependencies() {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 	function BrowseServer() {
409 409
 		var w = screen.width * 0.7;
410 410
 		var h = screen.height * 0.7;
411
-		OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
411
+		OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
412 412
 	}
413 413
 
414 414
 	function SetUrl(url, width, height, alt) {
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	<?php
429 429
 	// invoke OnModFormPrerender event
430 430
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
431
+	if (is_array($evtOut)) {
432 432
 		echo implode('', $evtOut);
433 433
 	}
434 434
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	<input type="hidden" name="mode" value="<?= $modx->manager->action ?>">
443 443
 
444 444
 	<h1>
445
-		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
445
+		<i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
446 446
 	</h1>
447 447
 
448 448
 	<?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -467,8 +467,8 @@  discard block
 block discarded – undo
467 467
 						<div class="col-md-9 col-lg-10">
468 468
 							<div class="form-control-name clearfix">
469 469
 								<input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
470
-								<?php if($modx->hasPermission('save_role')): ?>
471
-									<label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip>
470
+								<?php if ($modx->hasPermission('save_role')): ?>
471
+									<label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip>
472 472
 										<input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> />
473 473
 										<i class="fa fa-lock"></i>
474 474
 									</label>
@@ -490,9 +490,9 @@  discard block
 block discarded – undo
490 490
 							<select name="categoryid" class="form-control" onchange="documentDirty=true;">
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493
-								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
495
-									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
493
+								include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
494
+								foreach (getCategories() as $n => $v) {
495
+									echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n";
496 496
 								}
497 497
 								?>
498 498
 							</select>
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 				<div class="form-group">
525 525
 					<div class="form-row">
526 526
 						<label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> />
527
-							<?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label>
527
+							<?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label>
528 528
 					</div>
529 529
 					<div class="form-row">
530 530
 						<label for="parse_docblock">
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 			</div>
590 590
 			<!-- HTML text editor end -->
591 591
 		</div>
592
-		<?php if($modx->manager->action == '108'): ?>
592
+		<?php if ($modx->manager->action == '108'): ?>
593 593
 			<!-- Dependencies -->
594 594
 			<div class="tab-page" id="tabDepend">
595 595
 				<h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2>
@@ -617,14 +617,14 @@  discard block
 block discarded – undo
617 617
 						LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
618 618
 						LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
619 619
 
620
-					include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php";
620
+					include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php";
621 621
 					$grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
622 622
 					$grd->noRecordMsg = $_lang['no_records_found'];
623 623
 					$grd->cssClass = 'grid';
624 624
 					$grd->columnHeaderClass = 'gridHeader';
625 625
 					$grd->itemClass = 'gridItem';
626 626
 					$grd->altItemClass = 'gridAltItem';
627
-					$grd->columns = $_lang['element_name'] . " ," . $_lang['type'];
627
+					$grd->columns = $_lang['element_name']." ,".$_lang['type'];
628 628
 					$grd->fields = "name,type";
629 629
 					echo $grd->render();
630 630
 					?>
@@ -637,13 +637,13 @@  discard block
 block discarded – undo
637 637
 			<h2 class="tab"><?= $_lang['access_permissions'] ?></h2>
638 638
 			<script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
639 639
 			<div class="container container-body">
640
-				<?php if($use_udperms == 1) : ?>
640
+				<?php if ($use_udperms == 1) : ?>
641 641
 					<?php
642 642
 					// fetch user access permissions for the module
643 643
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644 644
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
646
+					if ($modx->hasPermission('access_permissions')) {
647 647
 						?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
@@ -671,22 +671,22 @@  discard block
 block discarded – undo
671 671
 					}
672 672
 					$chk = '';
673 673
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->db->getRow($rs)) {
674
+					while ($row = $modx->db->getRow($rs)) {
675 675
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676 676
 						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
677
+						if ($modx->hasPermission('access_permissions')) {
678
+							if ($checked) {
679 679
 								$notPublic = true;
680 680
 							}
681
-							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
681
+							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n";
682 682
 						} else {
683
-							if($checked) {
684
-								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
683
+							if ($checked) {
684
+								$chks = '<input type="hidden" name="usrgroups[]"  value="'.$row['id'].'" />'."\n".$chks;
685 685
 							}
686 686
 						}
687 687
 					}
688
-					if($modx->hasPermission('access_permissions')) {
689
-						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
688
+					if ($modx->hasPermission('access_permissions')) {
689
+						$chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks;
690 690
 					}
691 691
 					echo $chks;
692 692
 					?>
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		<?php
708 708
 		// invoke OnModFormRender event
709 709
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
710
+		if (is_array($evtOut)) {
711 711
 			echo implode('', $evtOut);
712 712
 		}
713 713
 		?>
Please login to merge, or discard this patch.
manager/actions/logging.static.php 1 patch
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->db->escape($_REQUEST['itemname']) . "'";
151
+        $sqladd[] = "itemname='".$modx->db->escape($_REQUEST['itemname'])."'";
152 152
     }
153 153
     if ($_REQUEST['message'] != "") {
154
-        $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'";
154
+        $sqladd[] = "message LIKE '%".$modx->db->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->db->getValue($modx->db->select('COUNT(*)', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : '')));
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
     $rs = $modx->db->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.
manager/actions/help/01About_EVO.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 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
-$logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">';
5
+$logo = '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">';
6 6
 $downloadLinks = array(
7
-	0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'),
8
-	1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
-	2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
-	3=>array('title'=>$_lang["extras"],'link'=>array(
7
+	0=>array('title'=>$_lang["information"], 'link'=>'https://evo.im/'),
8
+	1=>array('title'=>$_lang["download"], 'link'=>'https://github.com/evolution-cms/evolution/releases'),
9
+	2=>array('title'=>$_lang["previous_releases"], 'link'=>'https://modx.com/download/evolution/previous-releases.html'),
10
+	3=>array('title'=>$_lang["extras"], 'link'=>array(
11 11
 		'http://extras.evolution-cms.com/',
12 12
 		'https://github.com/extras-evolution'
13 13
 	)),
14 14
 );
15 15
 
16 16
 $translationLinks = array(
17
-	0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
-	1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'),
17
+	0=>array('title'=>'Evolution CMS', 'link'=>'https://www.transifex.com/evolutioncms/evolution/'),
18
+	1=>array('title'=>$_lang["extras"], 'link'=>'https://www.transifex.com/evolutioncms/extras/'),
19 19
 );
20 20
 
21 21
 
Please login to merge, or discard this patch.
manager/actions/import_site.static.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     <div class="container container-body">
45 45
         <?php
46 46
         if (!isset($_POST['import'])) {
47
-            echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>";
47
+            echo "<div class=\"element-edit-message\">".$_lang['import_site_message']."</div>";
48 48
             ?>
49 49
             <form action="index.php" method="post" name="importFrm">
50 50
                 <input type="hidden" name="import" value="import"/>
Please login to merge, or discard this patch.
manager/actions/bkmanager.static.php 1 patch
Spacing   +35 added lines, -35 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('bk_manager')) {
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 $dbase = trim($dbase, '`');
10 10
 
11 11
 if (!isset($modx->config['snapshot_path'])) {
12
-    if (is_dir(MODX_BASE_PATH . 'temp/backup/')) {
13
-        $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/';
12
+    if (is_dir(MODX_BASE_PATH.'temp/backup/')) {
13
+        $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/';
14 14
     } else {
15
-        $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/';
15
+        $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/';
16 16
     }
17 17
 }
18 18
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 if ($mode == 'restore1') {
24 24
     if (isset($_POST['textarea']) && !empty($_POST['textarea'])) {
25 25
         $source = trim($_POST['textarea']);
26
-        $_SESSION['textarea'] = $source . "\n";
26
+        $_SESSION['textarea'] = $source."\n";
27 27
     } else {
28 28
         $source = file_get_contents($_FILES['sqlfile']['tmp_name']);
29 29
     }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     header('Location: index.php?r=9&a=93');
32 32
     exit;
33 33
 } elseif ($mode == 'restore2') {
34
-    $path = $modx->config['snapshot_path'] . $_POST['filename'];
34
+    $path = $modx->config['snapshot_path'].$_POST['filename'];
35 35
     if (file_exists($path)) {
36 36
         $source = file_get_contents($path);
37 37
         import_sql($source);
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) {
78 78
         $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path'])));
79 79
     }
80
-    $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'";
80
+    $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'";
81 81
     $rs = $modx->db->query($sql);
82 82
     $tables = $modx->db->getColumn('Name', $rs);
83 83
     $today = date('Y-m-d_H-i-s');
@@ -109,18 +109,18 @@  discard block
 block discarded – undo
109 109
         $modx->webAlertAndQuit('Unable to Backup Database');
110 110
     }
111 111
 } else {
112
-    include_once MODX_MANAGER_PATH . "includes/header.inc.php";  // start normal header
112
+    include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header
113 113
 }
114 114
 
115 115
 if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') {
116 116
     switch ($_SESSION['result_msg']) {
117 117
         case 'import_ok':
118
-            $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>';
119
-            $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>';
118
+            $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>';
119
+            $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>';
120 120
             break;
121 121
         case 'snapshot_ok':
122 122
             $ph['result_msg_import'] = '';
123
-            $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>';
123
+            $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>';
124 124
             break;
125 125
     }
126 126
     $_SESSION['result_msg'] = '';
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 f.style.display = 'none';
180 180
             }
181 181
         }
182
-        <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?>
182
+        <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?>
183 183
 
184 184
     </script>
185 185
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                                 </thead>
224 224
                                 <tbody>
225 225
                                 <?php
226
-                                $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'";
226
+                                $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'";
227 227
                                 $rs = $modx->db->query($sql);
228 228
                                 $i = 0;
229 229
                                 while ($db_status = $modx->db->getRow($rs)) {
@@ -233,29 +233,29 @@  discard block
 block discarded – undo
233 233
                                         $table_string = '';
234 234
                                     }
235 235
 
236
-                                    echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n";
237
-                                    echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n";
238
-                                    echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n";
239
-                                    echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n";
236
+                                    echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n";
237
+                                    echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n";
238
+                                    echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n";
239
+                                    echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n";
240 240
 
241 241
                                     // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty
242 242
                                     $truncateable = array(
243
-                                        $modx->db->config['table_prefix'] . 'event_log',
244
-                                        $modx->db->config['table_prefix'] . 'manager_log',
243
+                                        $modx->db->config['table_prefix'].'event_log',
244
+                                        $modx->db->config['table_prefix'].'manager_log',
245 245
                                     );
246 246
                                     if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) {
247
-                                        echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n";
247
+                                        echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n";
248 248
                                     } else {
249
-                                        echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n";
249
+                                        echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n";
250 250
                                     }
251 251
 
252 252
                                     if ($modx->hasPermission('settings')) {
253
-                                        echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n";
253
+                                        echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n";
254 254
                                     } else {
255
-                                        echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n";
255
+                                        echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n";
256 256
                                     }
257 257
 
258
-                                    echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>";
258
+                                    echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>";
259 259
 
260 260
                                     $total = $total + $db_status['Index_length'] + $db_status['Data_length'];
261 261
                                     $totaloverhead = $totaloverhead + $db_status['Data_free'];
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
                                 <tr>
267 267
                                     <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td>
268 268
                                     <td colspan="4">&nbsp;</td>
269
-                                    <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td>
269
+                                    <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td>
270 270
                                     <td colspan="2">&nbsp;</td>
271
-                                    <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td>
271
+                                    <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td>
272 272
                                 </tr>
273 273
                                 </tfoot>
274 274
                             </table>
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
                             foreach ($last_result['0'] as $k => $v) {
320 320
                                 $title[] = $k;
321 321
                             }
322
-                            $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>';
322
+                            $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>';
323 323
                             $result .= '<tbody>';
324 324
                             foreach ($last_result as $row) {
325 325
                                 $result_value = array();
@@ -327,11 +327,11 @@  discard block
 block discarded – undo
327 327
                                     foreach ($row as $k => $v) {
328 328
                                         $result_value[] = $v;
329 329
                                     }
330
-                                    $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>';
330
+                                    $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>';
331 331
                                 }
332 332
                             }
333 333
                             $result .= '</tbody>';
334
-                            $result = '<table class="table data">' . $result . '</table>';
334
+                            $result = '<table class="table data">'.$result.'</table>';
335 335
                         }
336 336
                     }
337 337
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                                         while ($count < 11) {
434 434
                                             $line = fgets($file);
435 435
                                             foreach ($detailFields as $label) {
436
-                                                $fileLabel = '# ' . $label;
436
+                                                $fileLabel = '# '.$label;
437 437
                                                 if (strpos($line, $fileLabel) !== false) {
438 438
                                                     $details[$label] = htmlentities(trim(str_replace(array(
439 439
                                                         $fileLabel,
@@ -446,10 +446,10 @@  discard block
 block discarded – undo
446 446
                                         };
447 447
                                         fclose($file);
448 448
 
449
-                                        $tooltip = "Generation Time: " . $details["Generation Time"] . "\n";
450
-                                        $tooltip .= "Server version: " . $details["Server version"] . "\n";
451
-                                        $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n";
452
-                                        $tooltip .= "Host: " . $details["Host"] . "\n";
449
+                                        $tooltip = "Generation Time: ".$details["Generation Time"]."\n";
450
+                                        $tooltip .= "Server version: ".$details["Server version"]."\n";
451
+                                        $tooltip .= "PHP Version: ".$details["PHP Version"]."\n";
452
+                                        $tooltip .= "Host: ".$details["Host"]."\n";
453 453
                                         ?>
454 454
                                         <tr>
455 455
                                             <td><?= $filename ?></td>
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 <?php
482 482
 
483 483
 if (is_numeric($_GET['tab'])) {
484
-    echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
484
+    echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>';
485 485
 }
486 486
 
487 487
 include_once "footer.inc.php"; // send footer
Please login to merge, or discard this patch.