Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/processors/login.processor.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
2
+if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3 3
 	header('HTTP/1.0 404 Not Found');
4 4
 	exit('error');
5 5
 }
6
-define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
6
+define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
8
-include_once(__DIR__ . '/../../index.php');
8
+include_once(__DIR__.'/../../index.php');
9 9
 $modx->getDatabase()->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 
13
-$core_path = MODX_MANAGER_PATH . 'includes/';
13
+$core_path = MODX_MANAGER_PATH.'includes/';
14 14
 // include_once the language file
15 15
 $_lang = array();
16 16
 include_once("{$core_path}lang/english.inc.php");
17 17
 
18
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
18
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
19 19
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
20 20
 }
21 21
 
22 22
 // Initialize System Alert Message Queque
23
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
23
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
24 24
 	$_SESSION['SystemAlertMsgQueque'] = array();
25 25
 }
26 26
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 $rs = $modx->getDatabase()->select($fields, $from, $where);
47 47
 $limit = $modx->getDatabase()->getRecordCount($rs);
48 48
 
49
-if($limit == 0 || $limit > 1) {
49
+if ($limit == 0 || $limit > 1) {
50 50
 	jsAlert($_lang['login_processor_unknown_user']);
51 51
 	return;
52 52
 }
@@ -68,32 +68,32 @@  discard block
 block discarded – undo
68 68
 
69 69
 // get the user settings from the database
70 70
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
71
-while($row = $modx->getDatabase()->getRow($rs)) {
71
+while ($row = $modx->getDatabase()->getRow($rs)) {
72 72
 	extract($row);
73 73
 	${$setting_name} = $setting_value;
74 74
 }
75 75
 
76 76
 // blocked due to number of login errors.
77
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
77
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
78 78
 	@session_destroy();
79 79
 	session_unset();
80
-	if($cip = getenv("HTTP_CLIENT_IP")) {
80
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
81 81
 		$ip = $cip;
82
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
82
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
83 83
 		$ip = $cip;
84
-	} elseif($cip = getenv("REMOTE_ADDR")) {
84
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
85 85
 		$ip = $cip;
86 86
 	} else {
87 87
 		$ip = "UNKNOWN";
88 88
 	}
89 89
 	$log = new EvolutionCMS\Legacy\LogHandler();
90
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
90
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
91 91
 	jsAlert($_lang['login_processor_many_failed_logins']);
92 92
 	return;
93 93
 }
94 94
 
95 95
 // blocked due to number of login errors, but get to try again
96
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
96
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
97 97
 	$fields = array();
98 98
 	$fields['failedlogincount'] = '0';
99 99
 	$fields['blockeduntil'] = time() - 1;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 }
102 102
 
103 103
 // this user has been blocked by an admin, so no way he's loggin in!
104
-if($blocked == '1') {
104
+if ($blocked == '1') {
105 105
 	@session_destroy();
106 106
 	session_unset();
107 107
 	jsAlert($_lang['login_processor_blocked1']);
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 }
110 110
 
111 111
 // blockuntil: this user has a block until date
112
-if($blockeduntildate > time()) {
112
+if ($blockeduntildate > time()) {
113 113
 	@session_destroy();
114 114
 	session_unset();
115 115
 	jsAlert($_lang['login_processor_blocked2']);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // blockafter: this user has a block after date
120
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
120
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
121 121
 	@session_destroy();
122 122
 	session_unset();
123 123
 	jsAlert($_lang['login_processor_blocked3']);
@@ -125,24 +125,24 @@  discard block
 block discarded – undo
125 125
 }
126 126
 
127 127
 // allowed ip
128
-if($allowed_ip) {
129
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
128
+if ($allowed_ip) {
129
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
130
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
131 131
 			jsAlert($_lang['login_processor_remotehost_ip']);
132 132
 			return;
133 133
 		}
134 134
 	}
135
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
135
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
136 136
 		jsAlert($_lang['login_processor_remote_ip']);
137 137
 		return;
138 138
 	}
139 139
 }
140 140
 
141 141
 // allowed days
142
-if($allowed_days) {
142
+if ($allowed_days) {
143 143
 	$date = getdate();
144 144
 	$day = $date['wday'] + 1;
145
-	if(!in_array($day,explode(',',$allowed_days))) {
145
+	if (!in_array($day, explode(',', $allowed_days))) {
146 146
 		jsAlert($_lang['login_processor_date']);
147 147
 		return;
148 148
 	}
@@ -159,33 +159,33 @@  discard block
 block discarded – undo
159 159
 
160 160
 // check if plugin authenticated the user
161 161
 $matchPassword = false;
162
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
162
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
163 163
 	// check user password - local authentication
164 164
 	$hashType = $modx->getManagerApi()->getHashType($dbasePassword);
165
-	if($hashType == 'phpass') {
165
+	if ($hashType == 'phpass') {
166 166
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
167
-	} elseif($hashType == 'md5') {
167
+	} elseif ($hashType == 'md5') {
168 168
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
169
-	} elseif($hashType == 'v1') {
169
+	} elseif ($hashType == 'v1') {
170 170
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
171 171
 	} else {
172 172
 		$matchPassword = false;
173 173
 	}
174
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
174
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
175 175
 	$matchPassword = true;
176 176
 }
177 177
 
178
-if(!$matchPassword) {
178
+if (!$matchPassword) {
179 179
 	jsAlert($_lang['login_processor_wrong_password']);
180 180
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
181 181
 	return;
182 182
 }
183 183
 
184
-if($modx->config['use_captcha'] == 1) {
185
-	if(!isset ($_SESSION['veriword'])) {
184
+if ($modx->config['use_captcha'] == 1) {
185
+	if (!isset ($_SESSION['veriword'])) {
186 186
 		jsAlert($_lang['login_processor_captcha_config']);
187 187
 		return;
188
-	} elseif($_SESSION['veriword'] != $captcha_code) {
188
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
189 189
 		jsAlert($_lang['login_processor_bad_code']);
190 190
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
191 191
 		return;
@@ -213,25 +213,25 @@  discard block
 block discarded – undo
213 213
 $_SESSION['mgrPermissions'] = $modx->getDatabase()->getRow($rs);
214 214
 
215 215
 // successful login so reset fail count and update key values
216
-$modx->getDatabase()->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
216
+$modx->getDatabase()->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
217 217
 
218 218
 // get user's document groups
219 219
 $i = 0;
220
-$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
221
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
220
+$rs = $modx->getDatabase()->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
221
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
222 222
 $_SESSION['mgrDocgroups'] = $modx->getDatabase()->getColumn('documentgroup', $rs);
223 223
 
224 224
 $_SESSION['mgrToken'] = md5($currentsessionid);
225 225
 
226
-if($rememberme == '1') {
227
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
226
+if ($rememberme == '1') {
227
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
228 228
 
229 229
 	// Set a cookie separate from the session cookie with the username in it.
230 230
 	// Are we using secure connection? If so, make sure the cookie is secure
231 231
 	global $https_port;
232 232
 
233 233
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
234
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
234
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
235 235
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
236 236
 	} else {
237 237
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 // Check if user already has an active session, if not check if user pressed logout end of last session
247 247
 $rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
248 248
 $activeSession = $modx->getDatabase()->getValue($rs);
249
-if(!$activeSession) {
249
+if (!$activeSession) {
250 250
 	$rs = $modx->getDatabase()->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
251
-	if($lastHit = $modx->getDatabase()->getValue($rs)) {
251
+	if ($lastHit = $modx->getDatabase()->getValue($rs)) {
252 252
 		$_SESSION['show_logout_reminder'] = array(
253 253
 			'type' => 'logout_reminder',
254 254
 			'lastHit' => $lastHit
@@ -269,17 +269,17 @@  discard block
 block discarded – undo
269 269
 
270 270
 // check if we should redirect user to a web page
271 271
 $rs = $modx->getDatabase()->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
272
-$id = (int)$modx->getDatabase()->getValue($rs);
273
-if($id > 0) {
274
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
275
-	if($_POST['ajax'] == 1) {
272
+$id = (int) $modx->getDatabase()->getValue($rs);
273
+if ($id > 0) {
274
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
275
+	if ($_POST['ajax'] == 1) {
276 276
 		echo $header;
277 277
 	} else {
278 278
 		header($header);
279 279
 	}
280 280
 } else {
281
-	$header = 'Location: ' . MODX_MANAGER_URL;
282
-	if($_POST['ajax'] == 1) {
281
+	$header = 'Location: '.MODX_MANAGER_URL;
282
+	if ($_POST['ajax'] == 1) {
283 283
 		echo $header;
284 284
 	} else {
285 285
 		header($header);
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
Spacing   +14 added lines, -14 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
-if(!$modx->hasPermission('delete_document')) {
5
+if (!$modx->hasPermission('delete_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************ webber ********/
15
-$content=$modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************** webber *************/
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
 
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 $udperms->document = $id;
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33
-if(!$udperms->checkPermissions()) {
33
+if (!$udperms->checkPermissions()) {
34 34
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->getDatabase()->select('deletedon', $modx->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->getDatabase()->getValue($rs);
40
-if(!$deltime) {
40
+if (!$deltime) {
41 41
 	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 getChildrenForUnDelete($id);
47 47
 
48
-if(count($children)>0) {
48
+if (count($children) > 0) {
49 49
 	$modx->getDatabase()->update(
50 50
 		array(
51 51
 			'deleted'   => 0,
@@ -74,5 +74,5 @@  discard block
 block discarded – undo
74 74
 $modx->clearCache('full');
75 75
 
76 76
 // finished emptying cache - redirect
77
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
77
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
78 78
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_tmplvars.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('edit_template')) {
5
+if (!$modx->hasPermission('edit_template')) {
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
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate TV
@@ -56,5 +56,5 @@  discard block
 block discarded – undo
56 56
 $_SESSION['itemname'] = $name;
57 57
 
58 58
 // finish duplicating - redirect to new variable
59
-$header="Location: index.php?r=2&a=301&id=$newid";
59
+$header = "Location: index.php?r=2&a=301&id=$newid";
60 60
 header($header);
Please login to merge, or discard this patch.
manager/index.php 1 patch
Spacing   +270 added lines, -270 removed lines patch added patch discarded remove patch
@@ -49,32 +49,32 @@  discard block
 block discarded – undo
49 49
  */
50 50
 
51 51
 // get start time
52
-$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
52
+$mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
53 53
 $mstart = memory_get_usage();
54
-$self      = str_replace('\\','/',__FILE__);
55
-$self_dir  = str_replace('/index.php','',$self);
56
-$mgr_dir   = substr($self_dir,strrpos($self_dir,'/')+1);
57
-$base_path = str_replace($mgr_dir . '/index.php','',$self);
58
-$site_mgr_path = $base_path . 'assets/cache/siteManager.php';
59
-if(is_file($site_mgr_path)) include_once($site_mgr_path);
60
-$site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php';
61
-if(is_file($site_hostnames_path)) include_once($site_hostnames_path);
62
-if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) {
54
+$self      = str_replace('\\', '/', __FILE__);
55
+$self_dir  = str_replace('/index.php', '', $self);
56
+$mgr_dir   = substr($self_dir, strrpos($self_dir, '/') + 1);
57
+$base_path = str_replace($mgr_dir.'/index.php', '', $self);
58
+$site_mgr_path = $base_path.'assets/cache/siteManager.php';
59
+if (is_file($site_mgr_path)) include_once($site_mgr_path);
60
+$site_hostnames_path = $base_path.'assets/cache/siteHostnames.php';
61
+if (is_file($site_hostnames_path)) include_once($site_hostnames_path);
62
+if (!defined('MGR_DIR') || MGR_DIR !== $mgr_dir) {
63 63
 	$src = "<?php\n";
64 64
 	$src .= "define('MGR_DIR', '{$mgr_dir}');\n";
65
-	$rs = file_put_contents($site_mgr_path,$src);
66
-	if(!$rs) {
65
+	$rs = file_put_contents($site_mgr_path, $src);
66
+	if (!$rs) {
67 67
 		echo 'siteManager.php write error';
68 68
 		exit;
69 69
 	}
70 70
 	sleep(1);
71
-	header('Location:' . $_SERVER['REQUEST_URI']);
71
+	header('Location:'.$_SERVER['REQUEST_URI']);
72 72
 	exit;
73 73
 }
74 74
 
75 75
 // we use this to make sure files are accessed through
76 76
 // the manager instead of seperately.
77
-if ( ! defined('IN_MANAGER_MODE')) {
77
+if (!defined('IN_MANAGER_MODE')) {
78 78
 	define('IN_MANAGER_MODE', true);
79 79
 }
80 80
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
 // send anti caching headers
85 85
 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
86
-header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
86
+header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
87 87
 header("Cache-Control: no-store, no-cache, must-revalidate");
88 88
 header("Cache-Control: post-check=0, pre-check=0", false);
89 89
 header("Pragma: no-cache");
@@ -95,29 +95,29 @@  discard block
 block discarded – undo
95 95
 include_once "includes/lang/english.inc.php";
96 96
 
97 97
 // check PHP version. EVO is compatible with php 5 (5.0.0+)
98
-$php_ver_comp =  version_compare(phpversion(), "5.0.0");
98
+$php_ver_comp = version_compare(phpversion(), "5.0.0");
99 99
 		// -1 if left is less, 0 if equal, +1 if left is higher
100
-if($php_ver_comp < 0) {
100
+if ($php_ver_comp < 0) {
101 101
 	echo sprintf($_lang['php_version_check'], phpversion());
102 102
 	exit;
103 103
 }
104 104
 
105 105
 // check if iconv is installed
106
-if(!function_exists('iconv')) {
106
+if (!function_exists('iconv')) {
107 107
 	echo $_lang['iconv_not_available'];
108 108
 	exit;
109 109
 }
110 110
 
111 111
 // set some runtime options
112
-$incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond
113
-set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
112
+$incPath = str_replace("\\", "/", dirname(__FILE__)."/includes/"); // Mod by Raymond
113
+set_include_path(get_include_path().PATH_SEPARATOR.$incPath);
114 114
 
115 115
 if (!defined('ENT_COMPAT')) define('ENT_COMPAT', 2);
116 116
 if (!defined('ENT_NOQUOTES')) define('ENT_NOQUOTES', 0);
117 117
 if (!defined('ENT_QUOTES')) define('ENT_QUOTES', 3);
118 118
 
119 119
 // set the document_root :|
120
-if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) {
120
+if (!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) {
121 121
 	$_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/";
122 122
 }
123 123
 
@@ -156,30 +156,30 @@  discard block
 block discarded – undo
156 156
 // Now that session is given get user settings and merge into $modx->config
157 157
 $usersettings = $modx->getUserSettings();
158 158
 
159
-$settings =& $modx->config;
159
+$settings = & $modx->config;
160 160
 extract($modx->config, EXTR_OVERWRITE);
161 161
 
162 162
 // now include_once different language file as english
163
-if(!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
163
+if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
164 164
 	$manager_language = "english"; // if not set, get the english language file.
165 165
 }
166 166
 
167 167
 // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer)
168 168
 
169
-if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
169
+if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) {
170 170
 	include_once "lang/".$manager_language.".inc.php";
171 171
 }
172 172
 
173 173
 // allow custom language overrides not altered by future EVO-updates
174
-if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) {
174
+if (file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) {
175 175
 	include_once "lang/override/".$manager_language.".inc.php";
176 176
 }
177 177
 
178 178
 $s = array('[+MGR_DIR+]');
179 179
 $r = array(MGR_DIR);
180
-foreach($_lang as $k=>$v)
180
+foreach ($_lang as $k=>$v)
181 181
 {
182
-	if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v);
182
+	if (strpos($v, '[+') !== false) $_lang[$k] = str_replace($s, $r, $v);
183 183
 }
184 184
 
185 185
 // send the charset header
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
 include_once "accesscontrol.inc.php";
194 194
 
195 195
 // double check the session
196
-if(!isset($_SESSION['mgrValidated'])){
196
+if (!isset($_SESSION['mgrValidated'])) {
197 197
 	echo "Not Logged In!";
198 198
 	exit;
199 199
 }
200 200
 
201 201
 // include_once the style variables file
202
-if(isset($manager_theme) && !isset($_style)) {
202
+if (isset($manager_theme) && !isset($_style)) {
203 203
 	$_style = array();
204 204
 	include_once "media/style/".$manager_theme."/style.php";
205 205
 }
206 206
 
207 207
 // check if user is allowed to access manager interface
208
-if(isset($allow_manager_access) && $allow_manager_access==0) {
208
+if (isset($allow_manager_access) && $allow_manager_access == 0) {
209 209
 	include_once "manager.lockout.inc.php";
210 210
 }
211 211
 
@@ -214,21 +214,21 @@  discard block
 block discarded – undo
214 214
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
215 215
 
216 216
 // first we check to see if this is a frameset request
217
-if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) {
217
+if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) {
218 218
 	// this looks to be a top-level frameset request, so let's serve up a frameset
219
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
219
+	if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
220 220
 		include_once "media/style/".$manager_theme."/frames/1.php";
221
-	}else{
221
+	} else {
222 222
 		include_once "frames/1.php";
223 223
 	}
224 224
 	exit;
225 225
 }
226 226
 
227 227
 // OK, let's retrieve the action directive from the request
228
-$option = array('min_range'=>1,'max_range'=>2000);
229
-if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']);
230
-elseif(isset($_GET['a']))  $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option);
231
-elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option);
228
+$option = array('min_range'=>1, 'max_range'=>2000);
229
+if (isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']);
230
+elseif (isset($_GET['a']))  $action = filter_input(INPUT_GET, 'a', FILTER_VALIDATE_INT, $option);
231
+elseif (isset($_POST['a'])) $action = filter_input(INPUT_POST, 'a', FILTER_VALIDATE_INT, $option);
232 232
 else                       $action = null;
233 233
 
234 234
 if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 $modx->getManagerApi()->action = $action;
240 240
 
241 241
 // attempt to foil some simple types of CSRF attacks
242
-if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) {
242
+if (isset($modx->config['validate_referer']) && (int) $modx->config['validate_referer']) {
243 243
 	if (isset($_SERVER['HTTP_REFERER'])) {
244 244
 		$referer = $_SERVER['HTTP_REFERER'];
245 245
 
@@ -259,11 +259,11 @@  discard block
 block discarded – undo
259 259
 $modx->invokeEvent("OnManagerPageInit", array("action" => $action));
260 260
 
261 261
 // return element filepath
262
-function includeFileProcessor ($filepath,$manager_theme) {
262
+function includeFileProcessor($filepath, $manager_theme){
263 263
 	$element = "";
264
-	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
264
+	if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
265 265
 		$element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath;
266
-	}else{
266
+	} else {
267 267
 		$element = $filepath;
268 268
 	}
269 269
 	return $element;
@@ -278,341 +278,341 @@  discard block
 block discarded – undo
278 278
 /********************************************************************/
279 279
 	case 1 :
280 280
 		// get the requested frame
281
-		$frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']);
282
-		if($frame>9) {
283
-			$enable_debug=false;    // this is to stop the debug thingy being attached to the framesets
281
+		$frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']);
282
+		if ($frame > 9) {
283
+			$enable_debug = false; // this is to stop the debug thingy being attached to the framesets
284 284
 		}
285
-		include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme));
285
+		include_once(includeFileProcessor("frames/".$frame.".php", $manager_theme));
286 286
 	break;
287 287
 /********************************************************************/
288 288
 /* show the homepage                                                */
289 289
 /********************************************************************/
290 290
 	case 2:
291 291
 		// get the home page
292
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
293
-		include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme));
294
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
292
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
293
+		include_once(includeFileProcessor("actions/welcome.static.php", $manager_theme));
294
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
295 295
 	break;
296 296
 /********************************************************************/
297 297
 /* document data                                                    */
298 298
 /********************************************************************/
299 299
 	case 3:
300 300
 		// get the page to show document's data
301
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
302
-		include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme));
303
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
301
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
302
+		include_once(includeFileProcessor("actions/document_data.static.php", $manager_theme));
303
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
304 304
 	break;
305 305
 /********************************************************************/
306 306
 /* content management                                               */
307 307
 /********************************************************************/
308 308
 	case 85:
309 309
 		// get the mutate page for adding a folder
310
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
311
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
312
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
310
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
311
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
312
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
313 313
 	break;
314 314
 	case 27:
315 315
 		// get the mutate page for changing content
316
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
317
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
318
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
316
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
317
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
318
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
319 319
 	break;
320 320
 	case 4:
321 321
 		// get the mutate page for adding content
322
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
323
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
324
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
322
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
323
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
324
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
325 325
 	break;
326 326
 	case 5:
327 327
 		// get the save processor
328
-		include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme));
328
+		include_once(includeFileProcessor("processors/save_content.processor.php", $manager_theme));
329 329
 	break;
330 330
 	case 6:
331 331
 		// get the delete processor
332
-		include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme));
332
+		include_once(includeFileProcessor("processors/delete_content.processor.php", $manager_theme));
333 333
 	break;
334 334
 	case 63:
335 335
 		// get the undelete processor
336
-		include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme));
336
+		include_once(includeFileProcessor("processors/undelete_content.processor.php", $manager_theme));
337 337
 	break;
338 338
 	case 51:
339 339
 		// get the move action
340
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
341
-		include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme));
342
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
340
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
341
+		include_once(includeFileProcessor("actions/move_document.dynamic.php", $manager_theme));
342
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
343 343
 	break;
344 344
 	case 52:
345 345
 		// get the move document processor
346
-		include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme));
346
+		include_once(includeFileProcessor("processors/move_document.processor.php", $manager_theme));
347 347
 	break;
348 348
 	case 61:
349 349
 		// get the processor for publishing content
350
-		include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme));
350
+		include_once(includeFileProcessor("processors/publish_content.processor.php", $manager_theme));
351 351
 	break;
352 352
 	case 62:
353 353
 		// get the processor for publishing content
354
-		include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme));
354
+		include_once(includeFileProcessor("processors/unpublish_content.processor.php", $manager_theme));
355 355
 	break;
356 356
 	case 56:
357 357
 		// get the sort menuindex action
358
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
359
-		include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme));
360
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
358
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
359
+		include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php", $manager_theme));
360
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
361 361
 		break;
362 362
 /********************************************************************/
363 363
 /* show the wait page - gives the tree time to refresh (hopefully)  */
364 364
 /********************************************************************/
365 365
 	case 7:
366 366
 		// get the wait page (so the tree can reload)
367
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
368
-		include_once(includeFileProcessor("actions/wait.static.php",$manager_theme));
369
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
367
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
368
+		include_once(includeFileProcessor("actions/wait.static.php", $manager_theme));
369
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
370 370
 	break;
371 371
 /********************************************************************/
372 372
 /* let the user log out                                             */
373 373
 /********************************************************************/
374 374
 	case 8:
375 375
 		// get the logout processor
376
-		include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme));
376
+		include_once(includeFileProcessor("processors/logout.processor.php", $manager_theme));
377 377
 	break;
378 378
 /********************************************************************/
379 379
 /* user management                                                  */
380 380
 /********************************************************************/
381 381
 	case 87:
382 382
 		// get the new web user page
383
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
384
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
385
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
383
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
384
+		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme));
385
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
386 386
 	break;
387 387
 	case 88:
388 388
 		// get the edit web user page
389
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
390
-		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme));
391
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
389
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
390
+		include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php", $manager_theme));
391
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
392 392
 	break;
393 393
 	case 89:
394 394
 		// get the save web user processor
395
-		include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme));
395
+		include_once(includeFileProcessor("processors/save_web_user.processor.php", $manager_theme));
396 396
 	break;
397 397
 	case 90:
398 398
 		// get the delete web user page
399
-		include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme));
399
+		include_once(includeFileProcessor("processors/delete_web_user.processor.php", $manager_theme));
400 400
 	break;
401 401
 	case 11:
402 402
 		// get the new user page
403
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
404
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
405
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
403
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
404
+		include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme));
405
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
406 406
 	break;
407 407
 	case 12:
408 408
 		// get the edit user page
409
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
410
-		include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme));
411
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
409
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
410
+		include_once(includeFileProcessor("actions/mutate_user.dynamic.php", $manager_theme));
411
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
412 412
 	break;
413 413
 	case 32:
414 414
 		// get the save user processor
415
-		include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme));
415
+		include_once(includeFileProcessor("processors/save_user.processor.php", $manager_theme));
416 416
 	break;
417 417
 	case 28:
418 418
 		// get the change password page
419
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
420
-		include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme));
421
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
419
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
420
+		include_once(includeFileProcessor("actions/mutate_password.dynamic.php", $manager_theme));
421
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
422 422
 	break;
423 423
 	case 34:
424 424
 		// get the save new password page
425
-		include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme));
425
+		include_once(includeFileProcessor("processors/save_password.processor.php", $manager_theme));
426 426
 	break;
427 427
 	case 33:
428 428
 		// get the delete user page
429
-		include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme));
429
+		include_once(includeFileProcessor("processors/delete_user.processor.php", $manager_theme));
430 430
 	break;
431 431
 /********************************************************************/
432 432
 /* role management                                                  */
433 433
 /********************************************************************/
434 434
 	case 38:
435 435
 		// get the new role page
436
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
437
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
438
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
436
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
437
+		include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme));
438
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
439 439
 	break;
440 440
 	case 35:
441 441
 		// get the edit role page
442
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
443
-		include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme));
444
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
442
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
443
+		include_once(includeFileProcessor("actions/mutate_role.dynamic.php", $manager_theme));
444
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
445 445
 	break;
446 446
 	case 36:
447 447
 		// get the save role page
448
-		include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme));
448
+		include_once(includeFileProcessor("processors/save_role.processor.php", $manager_theme));
449 449
 	break;
450 450
 	case 37:
451 451
 		// get the delete role page
452
-		include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme));
452
+		include_once(includeFileProcessor("processors/delete_role.processor.php", $manager_theme));
453 453
 	break;
454 454
 /********************************************************************/
455 455
 /* category management                                               */
456 456
 /********************************************************************/
457 457
 	case 120:
458 458
 		// get the edit category page
459
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
460
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
461
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
459
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
460
+		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme));
461
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
462 462
 	break;
463 463
 	case 121:
464 464
 		// for ajax-requests
465
-		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme));
465
+		include_once(includeFileProcessor("actions/mutate_categories.dynamic.php", $manager_theme));
466 466
 	break;
467 467
 /********************************************************************/
468 468
 /* template management                                              */
469 469
 /********************************************************************/
470 470
 	case 16:
471 471
 		// get the edit template action
472
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
473
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
474
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
472
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
473
+		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme));
474
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
475 475
 	break;
476 476
 	case 19:
477 477
 		// get the new template action
478
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
479
-		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme));
480
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
478
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
479
+		include_once(includeFileProcessor("actions/mutate_templates.dynamic.php", $manager_theme));
480
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
481 481
 	break;
482 482
 	case 20:
483 483
 		// get the save processor
484
-		include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme));
484
+		include_once(includeFileProcessor("processors/save_template.processor.php", $manager_theme));
485 485
 	break;
486 486
 	case 21:
487 487
 		// get the delete processor
488
-		include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme));
488
+		include_once(includeFileProcessor("processors/delete_template.processor.php", $manager_theme));
489 489
 	break;
490 490
 	case 96:
491 491
 		// get the duplicate template processor
492
-		include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme));
492
+		include_once(includeFileProcessor("processors/duplicate_template.processor.php", $manager_theme));
493 493
 	break;
494 494
 	case 117:
495 495
 		// change the tv rank for selected template
496
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
497
-		include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme));
498
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
496
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
497
+		include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php", $manager_theme));
498
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
499 499
 		break;
500 500
 /********************************************************************/
501 501
 /* snippet management                                               */
502 502
 /********************************************************************/
503 503
 	case 22:
504 504
 		// get the edit snippet action
505
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
506
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
507
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
505
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
506
+		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme));
507
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
508 508
 	break;
509 509
 	case 23:
510 510
 		// get the new snippet action
511
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
512
-		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme));
513
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
511
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
512
+		include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php", $manager_theme));
513
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
514 514
 	break;
515 515
 	case 24:
516 516
 		// get the save processor
517
-		include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme));
517
+		include_once(includeFileProcessor("processors/save_snippet.processor.php", $manager_theme));
518 518
 	break;
519 519
 	case 25:
520 520
 		// get the delete processor
521
-		include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme));
521
+		include_once(includeFileProcessor("processors/delete_snippet.processor.php", $manager_theme));
522 522
 	break;
523 523
 	case 98:
524 524
 		// get the duplicate processor
525
-		include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme));
525
+		include_once(includeFileProcessor("processors/duplicate_snippet.processor.php", $manager_theme));
526 526
 	break;
527 527
 /********************************************************************/
528 528
 /* htmlsnippet management                                               */
529 529
 /********************************************************************/
530 530
 	case 78:
531 531
 		// get the edit snippet action
532
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
533
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
534
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
532
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
533
+		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme));
534
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
535 535
 	break;
536 536
 	case 77:
537 537
 		// get the new snippet action
538
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
539
-		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme));
540
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
538
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
539
+		include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php", $manager_theme));
540
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
541 541
 	break;
542 542
 	case 79:
543 543
 		// get the save processor
544
-		include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme));
544
+		include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php", $manager_theme));
545 545
 	break;
546 546
 	case 80:
547 547
 		// get the delete processor
548
-		include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme));
548
+		include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php", $manager_theme));
549 549
 	break;
550 550
 	case 97:
551 551
 		// get the duplicate processor
552
-		include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme));
552
+		include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php", $manager_theme));
553 553
 	break;
554 554
 /********************************************************************/
555 555
 /* show the credits page                                            */
556 556
 /********************************************************************/
557 557
 	case 18:
558 558
 		// get the credits page
559
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
560
-		include_once(includeFileProcessor("actions/credits.static.php",$manager_theme));
561
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
559
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
560
+		include_once(includeFileProcessor("actions/credits.static.php", $manager_theme));
561
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
562 562
 	break;
563 563
 /********************************************************************/
564 564
 /* empty cache & synchronisation                                    */
565 565
 /********************************************************************/
566 566
 	case 26:
567 567
 		// get the cache emptying processor
568
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
569
-		include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme));
570
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
568
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
569
+		include_once(includeFileProcessor("actions/refresh_site.dynamic.php", $manager_theme));
570
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
571 571
 	break;
572 572
 /********************************************************************/
573 573
 /* Module management                                                */
574 574
 /********************************************************************/
575 575
 	case 106:
576 576
 		// get module management
577
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
578
-		include_once(includeFileProcessor("actions/modules.static.php",$manager_theme));
579
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
577
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
578
+		include_once(includeFileProcessor("actions/modules.static.php", $manager_theme));
579
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
580 580
 	break;
581 581
 	case 107:
582 582
 		// get the new module action
583
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
584
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
585
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
583
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
584
+		include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme));
585
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
586 586
 	break;
587 587
 	case 108:
588 588
 		// get the edit module action
589
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
590
-		include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme));
591
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
589
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
590
+		include_once(includeFileProcessor("actions/mutate_module.dynamic.php", $manager_theme));
591
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
592 592
 	break;
593 593
 	case 109:
594 594
 		// get the save processor
595
-		include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme));
595
+		include_once(includeFileProcessor("processors/save_module.processor.php", $manager_theme));
596 596
 	break;
597 597
 	case 110:
598 598
 		// get the delete processor
599
-		include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme));
599
+		include_once(includeFileProcessor("processors/delete_module.processor.php", $manager_theme));
600 600
 	break;
601 601
 	case 111:
602 602
 		// get the duplicate processor
603
-		include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme));
603
+		include_once(includeFileProcessor("processors/duplicate_module.processor.php", $manager_theme));
604 604
 	break;
605 605
 	case 112:
606 606
 		// execute/run the module
607 607
 		//include_once "header.inc.php";
608
-		include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme));
608
+		include_once(includeFileProcessor("processors/execute_module.processor.php", $manager_theme));
609 609
 		//include_once "footer.inc.php";
610 610
 		break;
611 611
 	case 113:
612 612
 		// get the module resources (dependencies) action
613
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
614
-		include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme));
615
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
613
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
614
+		include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php", $manager_theme));
615
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
616 616
 	break;
617 617
 /********************************************************************/
618 618
 /* plugin management                                                */
@@ -620,46 +620,46 @@  discard block
 block discarded – undo
620 620
 	case 100:
621 621
 		// change the plugin priority
622 622
 		//include_once "header.inc.php"; - in action file
623
-		include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme));
624
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
623
+		include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php", $manager_theme));
624
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
625 625
 	break;
626 626
 	case 101:
627 627
 		// get the new plugin action
628
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
629
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
630
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
628
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
629
+		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme));
630
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
631 631
 	break;
632 632
 	case 102:
633 633
 		// get the edit plugin action
634
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
635
-		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme));
636
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
634
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
635
+		include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php", $manager_theme));
636
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
637 637
 	break;
638 638
 	case 103:
639 639
 		// get the save processor
640
-		include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme));
640
+		include_once(includeFileProcessor("processors/save_plugin.processor.php", $manager_theme));
641 641
 	break;
642 642
 	case 104:
643 643
 		// get the delete processor
644
-		include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme));
644
+		include_once(includeFileProcessor("processors/delete_plugin.processor.php", $manager_theme));
645 645
 	break;
646 646
 	case 105:
647 647
 		// get the duplicate processor
648
-		include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme));
648
+		include_once(includeFileProcessor("processors/duplicate_plugin.processor.php", $manager_theme));
649 649
 	break;
650 650
 	case 119:
651 651
 		// get the purge processor
652
-		include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme));
652
+		include_once(includeFileProcessor("processors/purge_plugin.processor.php", $manager_theme));
653 653
 	break;
654 654
 /********************************************************************/
655 655
 /* view phpinfo                                                     */
656 656
 /********************************************************************/
657 657
 	case 200:
658 658
 		// show phpInfo
659
-		if($modx->hasPermission('logs')) {
660
-			include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
661
-			include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme));
662
-			include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
659
+		if ($modx->hasPermission('logs')) {
660
+			include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
661
+			include_once(includeFileProcessor("actions/phpinfo.static.php", $manager_theme));
662
+			include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
663 663
 		}
664 664
 	break;
665 665
 /********************************************************************/
@@ -667,320 +667,320 @@  discard block
 block discarded – undo
667 667
 /********************************************************************/
668 668
 	case 29:
669 669
 		// get the error page
670
-		include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme));
670
+		include_once(includeFileProcessor("actions/error_dialog.static.php", $manager_theme));
671 671
 	break;
672 672
 /********************************************************************/
673 673
 /* file manager                                                     */
674 674
 /********************************************************************/
675 675
 	case 31:
676 676
 		// get the page to manage files
677
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
678
-		include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme));
679
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
677
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
678
+		include_once(includeFileProcessor("actions/files.dynamic.php", $manager_theme));
679
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
680 680
 	break;
681 681
 /********************************************************************/
682 682
 /* access permissions                                               */
683 683
 /********************************************************************/
684 684
 	case 40:
685
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
686
-		include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme));
687
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
685
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
686
+		include_once(includeFileProcessor("actions/access_permissions.dynamic.php", $manager_theme));
687
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
688 688
 	break;
689 689
 	case 91:
690
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
691
-		include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme));
692
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
690
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
691
+		include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php", $manager_theme));
692
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
693 693
 	break;
694 694
 /********************************************************************/
695 695
 /* access groups processor                                          */
696 696
 /********************************************************************/
697 697
 	case 41:
698
-		include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme));
698
+		include_once(includeFileProcessor("processors/access_groups.processor.php", $manager_theme));
699 699
 	break;
700 700
 	case 92:
701
-		include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme));
701
+		include_once(includeFileProcessor("processors/web_access_groups.processor.php", $manager_theme));
702 702
 	break;
703 703
 /********************************************************************/
704 704
 /* settings editor                                                  */
705 705
 /********************************************************************/
706 706
 	case 17:
707 707
 		// get the settings editor
708
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
709
-		include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme));
710
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
708
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
709
+		include_once(includeFileProcessor("actions/mutate_settings.dynamic.php", $manager_theme));
710
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
711 711
 	break;
712 712
 	case 118:
713 713
 		// call settings ajax include
714 714
 		ob_clean();
715
-		include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme));
715
+		include_once(includeFileProcessor("includes/mutate_settings.ajax.php", $manager_theme));
716 716
 	break;
717 717
 /********************************************************************/
718 718
 /* save settings                                                    */
719 719
 /********************************************************************/
720 720
 	case 30:
721 721
 		// get the save settings processor
722
-		include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme));
722
+		include_once(includeFileProcessor("processors/save_settings.processor.php", $manager_theme));
723 723
 	break;
724 724
 /********************************************************************/
725 725
 /* system information                                               */
726 726
 /********************************************************************/
727 727
 	case 53:
728 728
 		// get the settings editor
729
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
730
-		include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme));
731
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
729
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
730
+		include_once(includeFileProcessor("actions/sysinfo.static.php", $manager_theme));
731
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
732 732
 	break;
733 733
 /********************************************************************/
734 734
 /* optimise table                                               */
735 735
 /********************************************************************/
736 736
 	case 54:
737 737
 		// get the table optimizer/truncate processor
738
-		include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme));
738
+		include_once(includeFileProcessor("processors/optimize_table.processor.php", $manager_theme));
739 739
 	break;
740 740
 /********************************************************************/
741 741
 /* view logging                                                     */
742 742
 /********************************************************************/
743 743
 	case 13:
744 744
 		// view logging
745
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
746
-		include_once(includeFileProcessor("actions/logging.static.php",$manager_theme));
747
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
745
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
746
+		include_once(includeFileProcessor("actions/logging.static.php", $manager_theme));
747
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
748 748
 	break;
749 749
 /********************************************************************/
750 750
 /* empty logs                                                       */
751 751
 /********************************************************************/
752 752
 	case 55:
753 753
 		// get the settings editor
754
-		include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme));
754
+		include_once(includeFileProcessor("processors/empty_table.processor.php", $manager_theme));
755 755
 	break;
756 756
 /********************************************************************/
757 757
 /* calls test page                                                      */
758 758
 /********************************************************************/
759 759
 	case 999:
760 760
 		// get the test page
761
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
762
-		include_once(includeFileProcessor("test_page.php",$manager_theme));
763
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
761
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
762
+		include_once(includeFileProcessor("test_page.php", $manager_theme));
763
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
764 764
 	break;
765 765
 /********************************************************************/
766 766
 /* Empty recycle bin                                                */
767 767
 /********************************************************************/
768 768
 	case 64:
769 769
 		// get the Recycle bin emptier
770
-		include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme));
770
+		include_once(includeFileProcessor("processors/remove_content.processor.php", $manager_theme));
771 771
 	break;
772 772
 /********************************************************************/
773 773
 /* Messages                                                     */
774 774
 /********************************************************************/
775 775
 	case 10:
776 776
 		// get the messages page
777
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
778
-		include_once(includeFileProcessor("actions/messages.static.php",$manager_theme));
779
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
777
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
778
+		include_once(includeFileProcessor("actions/messages.static.php", $manager_theme));
779
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
780 780
 	break;
781 781
 /********************************************************************/
782 782
 /* Delete a message                                                 */
783 783
 /********************************************************************/
784 784
 	case 65:
785 785
 		// get the message deleter
786
-		include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme));
786
+		include_once(includeFileProcessor("processors/delete_message.processor.php", $manager_theme));
787 787
 	break;
788 788
 /********************************************************************/
789 789
 /* Send a message                                                   */
790 790
 /********************************************************************/
791 791
 	case 66:
792 792
 		// get the message deleter
793
-		include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme));
793
+		include_once(includeFileProcessor("processors/send_message.processor.php", $manager_theme));
794 794
 	break;
795 795
 /********************************************************************/
796 796
 /* Remove locks                                                 */
797 797
 /********************************************************************/
798 798
 	case 67:
799 799
 		// get the lock remover
800
-		include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme));
800
+		include_once(includeFileProcessor("processors/remove_locks.processor.php", $manager_theme));
801 801
 	break;
802 802
 /********************************************************************/
803 803
 /* Site schedule                                                    */
804 804
 /********************************************************************/
805 805
 	case 70:
806 806
 		// get the schedule page
807
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
808
-		include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme));
809
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
807
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
808
+		include_once(includeFileProcessor("actions/site_schedule.static.php", $manager_theme));
809
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
810 810
 	break;
811 811
 /********************************************************************/
812 812
 /* Search                                                           */
813 813
 /********************************************************************/
814 814
 	case 71:
815 815
 		// get the search page
816
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
817
-		include_once(includeFileProcessor("actions/search.static.php",$manager_theme));
818
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
816
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
817
+		include_once(includeFileProcessor("actions/search.static.php", $manager_theme));
818
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
819 819
 	break;
820 820
 /********************************************************************/
821 821
 /* About                                                            */
822 822
 /********************************************************************/
823 823
 	case 59:
824 824
 		// get the about page
825
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
826
-		include_once(includeFileProcessor("actions/about.static.php",$manager_theme));
827
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
825
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
826
+		include_once(includeFileProcessor("actions/about.static.php", $manager_theme));
827
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
828 828
 	break;
829 829
 /********************************************************************/
830 830
 /* Add weblink                                                          */
831 831
 /********************************************************************/
832 832
 	case 72:
833 833
 		// get the weblink page
834
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
835
-		include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme));
836
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
834
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
835
+		include_once(includeFileProcessor("actions/mutate_content.dynamic.php", $manager_theme));
836
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
837 837
 	break;
838 838
 /********************************************************************/
839 839
 /* User management                                                  */
840 840
 /********************************************************************/
841 841
 	case 75:
842
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
843
-		include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme));
844
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
842
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
843
+		include_once(includeFileProcessor("actions/user_management.static.php", $manager_theme));
844
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
845 845
 	break;
846 846
 	case 99:
847
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
848
-		include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme));
849
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
847
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
848
+		include_once(includeFileProcessor("actions/web_user_management.static.php", $manager_theme));
849
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
850 850
 	break;
851 851
 	case 86:
852
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
853
-		include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme));
854
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
852
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
853
+		include_once(includeFileProcessor("actions/role_management.static.php", $manager_theme));
854
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
855 855
 	break;
856 856
 /********************************************************************/
857 857
 /* template/ snippet management                                                 */
858 858
 /********************************************************************/
859 859
 	case 76:
860
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
861
-		include_once(includeFileProcessor("actions/resources.static.php",$manager_theme));
862
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
860
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
861
+		include_once(includeFileProcessor("actions/resources.static.php", $manager_theme));
862
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
863 863
 	break;
864 864
 /********************************************************************/
865 865
 /* Export to file                                                   */
866 866
 /********************************************************************/
867 867
 	case 83:
868
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
869
-		include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme));
870
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
868
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
869
+		include_once(includeFileProcessor("actions/export_site.static.php", $manager_theme));
870
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
871 871
 	break;
872 872
 /********************************************************************/
873 873
 /* Resource Selector                                                    */
874 874
 /********************************************************************/
875 875
 	case 84:
876
-		include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme));
876
+		include_once(includeFileProcessor("actions/resource_selector.static.php", $manager_theme));
877 877
 	break;
878 878
 /********************************************************************/
879 879
 /* Backup Manager                                                   */
880 880
 /********************************************************************/
881 881
 	case 93:
882 882
 		# header and footer will be handled interally
883
-		include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme));
883
+		include_once(includeFileProcessor("actions/bkmanager.static.php", $manager_theme));
884 884
 	break;
885 885
 /********************************************************************/
886 886
 /* Duplicate Document                                                   */
887 887
 /********************************************************************/
888 888
 	case 94:
889 889
 		// get the duplicate processor
890
-		include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme));
890
+		include_once(includeFileProcessor("processors/duplicate_content.processor.php", $manager_theme));
891 891
 	break;
892 892
 /********************************************************************/
893 893
 /* Import Document from file                                        */
894 894
 /********************************************************************/
895 895
 	case 95:
896
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
897
-		include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme));
898
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
896
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
897
+		include_once(includeFileProcessor("actions/import_site.static.php", $manager_theme));
898
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
899 899
 	break;
900 900
 /********************************************************************/
901 901
 /* Help                                                             */
902 902
 /********************************************************************/
903 903
 	case 9:
904 904
 		// get the help page
905
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
906
-		include_once(includeFileProcessor("actions/help.static.php",$manager_theme));
907
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
905
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
906
+		include_once(includeFileProcessor("actions/help.static.php", $manager_theme));
907
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
908 908
 	break;
909 909
 /********************************************************************/
910 910
 /* Template Variables - Based on Apodigm's Docvars                  */
911 911
 /********************************************************************/
912 912
 	case 300:
913 913
 		// get the new document variable action
914
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
915
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
916
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
914
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
915
+		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme));
916
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
917 917
 	break;
918 918
 	case 301:
919 919
 		// get the edit document variable action
920
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
921
-		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme));
922
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
920
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
921
+		include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php", $manager_theme));
922
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
923 923
 	break;
924 924
 	case 302:
925 925
 		// get the save processor
926
-		include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme));
926
+		include_once(includeFileProcessor("processors/save_tmplvars.processor.php", $manager_theme));
927 927
 	break;
928 928
 	case 303:
929 929
 		// get the delete processor
930
-		include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme));
930
+		include_once(includeFileProcessor("processors/delete_tmplvars.processor.php", $manager_theme));
931 931
 	break;
932 932
 	case 304:
933 933
 		// get the duplicate processor
934
-		include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme));
934
+		include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php", $manager_theme));
935 935
 	break;
936 936
 	case 305:
937 937
 		// get the tv-rank action
938
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
939
-		include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme));
940
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
938
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
939
+		include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php", $manager_theme));
940
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
941 941
 	break;
942 942
 /********************************************************************/
943 943
 /* Event viewer: show event message log                             */
944 944
 /********************************************************************/
945 945
 	case 114:
946 946
 		// get event logs
947
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
948
-		include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme));
949
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
947
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
948
+		include_once(includeFileProcessor("actions/eventlog.dynamic.php", $manager_theme));
949
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
950 950
 	break;
951 951
 	case 115:
952 952
 		// get event log details viewer
953
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
954
-		include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme));
955
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
953
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
954
+		include_once(includeFileProcessor("actions/eventlog_details.dynamic.php", $manager_theme));
955
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
956 956
 	break;
957 957
 	case 116:
958 958
 		// get the event log delete processor
959
-		include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme));
959
+		include_once(includeFileProcessor("processors/delete_eventlog.processor.php", $manager_theme));
960 960
 	break;
961 961
 
962 962
 	case 501:
963 963
 		//delete category
964
-		include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme));
964
+		include_once(includeFileProcessor("processors/delete_category.processor.php", $manager_theme));
965 965
 	break;
966 966
 /********************************************************************/
967 967
 /* default action: show not implemented message                     */
968 968
 /********************************************************************/
969 969
 	default :
970 970
 		// say that what was requested doesn't do anything yet
971
-		include_once(includeFileProcessor("includes/header.inc.php",$manager_theme));
971
+		include_once(includeFileProcessor("includes/header.inc.php", $manager_theme));
972 972
 		echo "
973 973
 			<div class='sectionHeader'>".$_lang['functionnotimpl']."</div>
974 974
 			<div class='sectionBody'>
975 975
 				<p>".$_lang['functionnotimpl_message']."</p>
976 976
 			</div>
977 977
 		";
978
-		include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme));
978
+		include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme));
979 979
 }
980 980
 
981 981
 /********************************************************************/
982 982
 // log action, unless it's a frame request
983
-if($action!=1 && $action!=7 && $action!=2) {
983
+if ($action != 1 && $action != 7 && $action != 2) {
984 984
 	$log = new EvolutionCMS\Legacy\LogHandler;
985 985
 	$log->initAndWriteLog();
986 986
 }
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,16 +44,16 @@  discard block
 block discarded – undo
44 44
  * Initialize Document Parsing
45 45
  * -----------------------------
46 46
  */
47
-if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
47
+if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true);
48 48
 
49
-$base_path = str_replace('\\','/',dirname(__FILE__)) . '/';
50
-if(is_file($base_path . 'assets/cache/siteManager.php'))
51
-    include_once($base_path . 'assets/cache/siteManager.php');
52
-if(!defined('MGR_DIR') && is_dir("{$base_path}manager"))
49
+$base_path = str_replace('\\', '/', dirname(__FILE__)).'/';
50
+if (is_file($base_path.'assets/cache/siteManager.php'))
51
+    include_once($base_path.'assets/cache/siteManager.php');
52
+if (!defined('MGR_DIR') && is_dir("{$base_path}manager"))
53 53
 	define('MGR_DIR', 'manager');
54
-if(is_file($base_path . 'assets/cache/siteHostnames.php'))
55
-    include_once($base_path . 'assets/cache/siteHostnames.php');
56
-if(!defined('MODX_SITE_HOSTNAMES'))
54
+if (is_file($base_path.'assets/cache/siteHostnames.php'))
55
+    include_once($base_path.'assets/cache/siteHostnames.php');
56
+if (!defined('MODX_SITE_HOSTNAMES'))
57 57
 	define('MODX_SITE_HOSTNAMES', '');
58 58
 
59 59
 // get start time
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 // set some settings, and address some IE issues
66 66
 @ini_set('url_rewriter.tags', '');
67 67
 @ini_set('session.use_trans_sid', 0);
68
-@ini_set('session.use_only_cookies',1);
68
+@ini_set('session.use_only_cookies', 1);
69 69
 session_cache_limiter('');
70 70
 header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
71 71
 header('Cache-Control: private, must-revalidate');
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 
79 79
 define('IN_PARSER_MODE', true);
80
-if ( ! defined('IN_MANAGER_MODE')) {
80
+if (!defined('IN_MANAGER_MODE')) {
81 81
 	define('IN_MANAGER_MODE', false);
82 82
 }
83 83
 if (!defined('MODX_API_MODE')) {
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 }
86 86
 
87 87
 // get the required includes
88
-if(! isset($database_user) || $database_user==="") {
89
-    $rt = @include_once(__DIR__ . '/' . MGR_DIR . '/includes/config.inc.php');
88
+if (!isset($database_user) || $database_user === "") {
89
+    $rt = @include_once(__DIR__.'/'.MGR_DIR.'/includes/config.inc.php');
90 90
     $path = 'install/src/template/not_installed.tpl';
91 91
     // Be sure config.inc.php is there and that it contains some important values
92 92
     if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
 $modx->stopOnNotice = false;
123 123
 
124 124
 // Don't show PHP errors to the public
125
-if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
-    @ini_set("display_errors","0");
125
+if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
126
+    @ini_set("display_errors", "0");
127 127
 }
128 128
 
129
-if(MODX_CLI){
129
+if (MODX_CLI) {
130 130
     @set_time_limit(0);
131
-    @ini_set('max_execution_time',0);
131
+    @ini_set('max_execution_time', 0);
132 132
 }
133 133
 
134 134
 // execute the parser if index.php was not included
Please login to merge, or discard this patch.
manager/media/style/default/ajax.php 1 patch
Spacing   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@  discard block
 block discarded – undo
18 18
 $modx->sid = session_id();
19 19
 
20 20
 $_lang = array();
21
-include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
21
+include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php';
22 22
 if ($modx->config['manager_language'] != 'english') {
23
-    include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
23
+    include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php';
24 24
 }
25
-include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
25
+include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php';
26 26
 
27 27
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
28 28
 $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
             switch ($frame) {
41 41
                 case 'nodes':
42
-                    include_once MODX_MANAGER_PATH . '/frames/nodes.php';
42
+                    include_once MODX_MANAGER_PATH.'/frames/nodes.php';
43 43
 
44 44
                     break;
45 45
             }
@@ -57,21 +57,21 @@  discard block
 block discarded – undo
57 57
                 $sql = '';
58 58
                 $a = '';
59 59
                 $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : '';
60
-                $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
61
-                $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
60
+                $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
61
+                $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
62 62
 
63 63
                 switch ($elements) {
64 64
                     case 'element_templates':
65 65
                         $a = 16;
66
-                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
66
+                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
67 67
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.templatename AS name, t1.locked, 0 AS disabled
68
-                        FROM ' . $modx->getFullTableName('site_templates') . ' AS t1
69
-                        ' . $sqlLike . '
68
+                        FROM ' . $modx->getFullTableName('site_templates').' AS t1
69
+                        ' . $sqlLike.'
70 70
                         ORDER BY t1.templatename ASC
71 71
                         ' . $sqlLimit);
72 72
 
73 73
                         if ($modx->hasPermission('new_template')) {
74
-                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>';
74
+                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>';
75 75
                         }
76 76
 
77 77
                         break;
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
                     case 'element_tplvars':
80 80
                         $a = 301;
81 81
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled
82
-                        FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1
83
-                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid
84
-                        ' . $sqlLike . '
82
+                        FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1
83
+                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid
84
+                        ' . $sqlLike.'
85 85
                         GROUP BY t1.id
86 86
                         ORDER BY t1.name ASC
87 87
                         ' . $sqlLimit);
88 88
 
89 89
                         if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
90
-                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>';
90
+                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>';
91 91
                         }
92 92
 
93 93
                         break;
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
                     case 'element_htmlsnippets':
96 96
                         $a = 78;
97 97
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
98
-                        FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1
99
-                        ' . $sqlLike . '
98
+                        FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1
99
+                        ' . $sqlLike.'
100 100
                         ORDER BY t1.name ASC
101 101
                         ' . $sqlLimit);
102 102
 
103 103
                         if ($modx->hasPermission('new_chunk')) {
104
-                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>';
104
+                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>';
105 105
                         }
106 106
 
107 107
                         break;
@@ -109,13 +109,13 @@  discard block
 block discarded – undo
109 109
                     case 'element_snippets':
110 110
                         $a = 22;
111 111
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
112
-                        FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1
113
-                        ' . $sqlLike . '
112
+                        FROM ' . $modx->getFullTableName('site_snippets').' AS t1
113
+                        ' . $sqlLike.'
114 114
                         ORDER BY t1.name ASC
115 115
                         ' . $sqlLimit);
116 116
 
117 117
                         if ($modx->hasPermission('new_snippet')) {
118
-                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>';
118
+                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>';
119 119
                         }
120 120
 
121 121
                         break;
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
                     case 'element_plugins':
124 124
                         $a = 102;
125 125
                         $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled
126
-                        FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1
127
-                        ' . $sqlLike . '
126
+                        FROM ' . $modx->getFullTableName('site_plugins').' AS t1
127
+                        ' . $sqlLike.'
128 128
                         ORDER BY t1.name ASC
129 129
                         ' . $sqlLimit);
130 130
 
131 131
                         if ($modx->hasPermission('new_plugin')) {
132
-                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>';
132
+                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>';
133 133
                         }
134 134
 
135 135
                         break;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                             continue;
145 145
                         }
146 146
 
147
-                        $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n";
147
+                        $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n";
148 148
                     }
149 149
                 }
150 150
 
@@ -165,23 +165,23 @@  discard block
 block discarded – undo
165 165
             $output = '';
166 166
             $items = '';
167 167
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
168
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
169
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
168
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
169
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
170 170
 
171
-            if(!$modx->hasPermission('save_role')) {
171
+            if (!$modx->hasPermission('save_role')) {
172 172
                 $sqlLike .= $sqlLike ? ' AND ' : 'WHERE ';
173 173
                 $sqlLike .= 't2.role != 1';
174 174
             }
175 175
 
176 176
             $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked
177
-				FROM ' . $modx->getFullTableName('manager_users') . ' AS t1
178
-				LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey
179
-				' . $sqlLike . '
177
+				FROM ' . $modx->getFullTableName('manager_users').' AS t1
178
+				LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey
179
+				' . $sqlLike.'
180 180
 				ORDER BY t1.username ASC
181 181
 				' . $sqlLimit);
182 182
 
183 183
             if ($modx->hasPermission('new_user')) {
184
-                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
184
+                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>';
185 185
             }
186 186
 
187 187
             if ($count = $modx->getDatabase()->getRecordCount($sql)) {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
190 190
                 }
191 191
                 while ($row = $modx->getDatabase()->getRow($sql)) {
192
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
192
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
193 193
                 }
194 194
             }
195 195
 
@@ -209,18 +209,18 @@  discard block
 block discarded – undo
209 209
             $output = '';
210 210
             $items = '';
211 211
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
212
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
213
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
212
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : '';
213
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
214 214
 
215 215
             $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked
216
-				FROM ' . $modx->getFullTableName('web_users') . ' AS t1
217
-				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey
218
-				' . $sqlLike . '
216
+				FROM ' . $modx->getFullTableName('web_users').' AS t1
217
+				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey
218
+				' . $sqlLike.'
219 219
 				ORDER BY t1.username ASC
220 220
 				' . $sqlLimit);
221 221
 
222 222
             if ($modx->hasPermission('new_web_user')) {
223
-                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>';
223
+                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>';
224 224
             }
225 225
 
226 226
             if ($count = $modx->getDatabase()->getRecordCount($sql)) {
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
229 229
                 }
230 230
                 while ($row = $modx->getDatabase()->getRow($sql)) {
231
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
231
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
232 232
                 }
233 233
             }
234 234
 
@@ -254,35 +254,35 @@  discard block
 block discarded – undo
254 254
                     case 'SnippetNoCache': {
255 255
 
256 256
                         $sql = $modx->getDatabase()->query('SELECT *
257
-						FROM ' . $modx->getFullTableName('site_snippets') . '
258
-						WHERE name="' . $name . '"
257
+						FROM ' . $modx->getFullTableName('site_snippets').'
258
+						WHERE name="' . $name.'"
259 259
 						LIMIT 1');
260 260
 
261 261
                         if ($modx->getDatabase()->getRecordCount($sql)) {
262 262
                             $row = $modx->getDatabase()->getRow($sql);
263 263
                             $contextmenu = array(
264 264
                                 'header' => array(
265
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
265
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
266 266
                                 ),
267 267
                                 'item' => array(
268
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
269
-                                    'url' => "index.php?a=22&id=" . $row['id']
268
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
269
+                                    'url' => "index.php?a=22&id=".$row['id']
270 270
                                 )
271 271
                             );
272 272
                             if (!empty($row['description'])) {
273 273
                                 $contextmenu['seperator'] = '';
274 274
                                 $contextmenu['description'] = array(
275
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
275
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
276 276
                                 );
277 277
                             }
278 278
                         } else {
279 279
                             $contextmenu = array(
280 280
                                 'header' => array(
281
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $name
281
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$name
282 282
                                 ),
283 283
                                 'item' => array(
284
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
285
-                                    'url' => "index.php?a=23&itemname=" . $name
284
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
285
+                                    'url' => "index.php?a=23&itemname=".$name
286 286
                                 )
287 287
                             );
288 288
                         }
@@ -292,35 +292,35 @@  discard block
 block discarded – undo
292 292
                     case 'Chunk' : {
293 293
 
294 294
                         $sql = $modx->getDatabase()->query('SELECT *
295
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
296
-						WHERE name="' . $name . '"
295
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
296
+						WHERE name="' . $name.'"
297 297
 						LIMIT 1');
298 298
 
299 299
                         if ($modx->getDatabase()->getRecordCount($sql)) {
300 300
                             $row = $modx->getDatabase()->getRow($sql);
301 301
                             $contextmenu = array(
302 302
                                 'header' => array(
303
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name']
303
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name']
304 304
                                 ),
305 305
                                 'item' => array(
306
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
307
-                                    'url' => "index.php?a=78&id=" . $row['id']
306
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
307
+                                    'url' => "index.php?a=78&id=".$row['id']
308 308
                                 )
309 309
                             );
310 310
                             if (!empty($row['description'])) {
311 311
                                 $contextmenu['seperator'] = '';
312 312
                                 $contextmenu['description'] = array(
313
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
313
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
314 314
                                 );
315 315
                             }
316 316
                         } else {
317 317
                             $contextmenu = array(
318 318
                                 'header' => array(
319
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
319
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$name
320 320
                                 ),
321 321
                                 'item' => array(
322
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
323
-                                    'url' => "index.php?a=77&itemname=" . $name
322
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
323
+                                    'url' => "index.php?a=77&itemname=".$name
324 324
                                 )
325 325
                             );
326 326
                         }
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
                     }
330 330
                     case 'AttributeValue': {
331 331
                         $sql = $modx->getDatabase()->query('SELECT *
332
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
333
-						WHERE name="' . $name . '"
332
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
333
+						WHERE name="' . $name.'"
334 334
 						LIMIT 1');
335 335
 
336 336
                         if ($modx->getDatabase()->getRecordCount($sql)) {
@@ -340,52 +340,52 @@  discard block
 block discarded – undo
340 340
                                     'innerText' => $row['name']
341 341
                                 ),
342 342
                                 'item' => array(
343
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
344
-                                    'url' => "index.php?a=78&id=" . $row['id']
343
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
344
+                                    'url' => "index.php?a=78&id=".$row['id']
345 345
                                 )
346 346
                             );
347 347
                             if (!empty($row['description'])) {
348 348
                                 $contextmenu['seperator'] = '';
349 349
                                 $contextmenu['description'] = array(
350
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
350
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
351 351
                                 );
352 352
                             }
353 353
                         } else {
354 354
 
355 355
                             $sql = $modx->getDatabase()->query('SELECT *
356
-							FROM ' . $modx->getFullTableName('site_snippets') . '
357
-							WHERE name="' . $name . '"
356
+							FROM ' . $modx->getFullTableName('site_snippets').'
357
+							WHERE name="' . $name.'"
358 358
 							LIMIT 1');
359 359
 
360 360
                             if ($modx->getDatabase()->getRecordCount($sql)) {
361 361
                                 $row = $modx->getDatabase()->getRow($sql);
362 362
                                 $contextmenu = array(
363 363
                                     'header' => array(
364
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
364
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
365 365
                                     ),
366 366
                                     'item' => array(
367
-                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
368
-                                        'url' => "index.php?a=22&id=" . $row['id']
367
+                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
368
+                                        'url' => "index.php?a=22&id=".$row['id']
369 369
                                     )
370 370
                                 );
371 371
                                 if (!empty($row['description'])) {
372 372
                                     $contextmenu['seperator'] = '';
373 373
                                     $contextmenu['description'] = array(
374
-                                        'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
374
+                                        'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
375 375
                                     );
376 376
                                 }
377 377
                             } else {
378 378
                                 $contextmenu = array(
379 379
                                     'header' => array(
380
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $name
380
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$name
381 381
                                     ),
382 382
                                     'item' => array(
383
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
384
-                                        'url' => "index.php?a=77&itemname=" . $name
383
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
384
+                                        'url' => "index.php?a=77&itemname=".$name
385 385
                                     ),
386 386
                                     'item2' => array(
387
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
388
-                                        'url' => "index.php?a=23&itemname=" . $name
387
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
388
+                                        'url' => "index.php?a=23&itemname=".$name
389 389
                                     )
390 390
                                 );
391 391
                             }
@@ -441,35 +441,35 @@  discard block
 block discarded – undo
441 441
                         }
442 442
 
443 443
                         $sql = $modx->getDatabase()->query('SELECT *
444
-						FROM ' . $modx->getFullTableName('site_tmplvars') . '
445
-						WHERE name="' . $name . '"
444
+						FROM ' . $modx->getFullTableName('site_tmplvars').'
445
+						WHERE name="' . $name.'"
446 446
 						LIMIT 1');
447 447
 
448 448
                         if ($modx->getDatabase()->getRecordCount($sql)) {
449 449
                             $row = $modx->getDatabase()->getRow($sql);
450 450
                             $contextmenu = array(
451 451
                                 'header' => array(
452
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name']
452
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name']
453 453
                                 ),
454 454
                                 'item' => array(
455
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
456
-                                    'url' => "index.php?a=301&id=" . $row['id']
455
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
456
+                                    'url' => "index.php?a=301&id=".$row['id']
457 457
                                 )
458 458
                             );
459 459
                             if (!empty($row['description'])) {
460 460
                                 $contextmenu['seperator'] = '';
461 461
                                 $contextmenu['description'] = array(
462
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
462
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
463 463
                                 );
464 464
                             }
465 465
                         } else {
466 466
                             $contextmenu = array(
467 467
                                 'header' => array(
468
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
468
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name
469 469
                                 ),
470 470
                                 'item' => array(
471
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'],
472
-                                    'url' => "index.php?a=300&itemname=" . $name
471
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'],
472
+                                    'url' => "index.php?a=300&itemname=".$name
473 473
                                 )
474 474
                             );
475 475
                         }
@@ -488,15 +488,15 @@  discard block
 block discarded – undo
488 488
             $json = array();
489 489
 
490 490
             if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
491
-                $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
492
-                $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
491
+                $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
492
+                $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0;
493 493
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
494 494
 
495 495
                 // set parent
496 496
                 if ($id && $parent >= 0) {
497 497
 
498 498
                     // find older parent
499
-                    $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
499
+                    $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id='.$id));
500 500
 
501 501
                     $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [
502 502
                         'id_document' => $id,
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                     if (empty($json['errors'])) {
518 518
                         // check privileges user for move docs
519 519
                         if (!empty($modx->config['tree_show_protected']) && $role != 1) {
520
-                            $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
520
+                            $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')');
521 521
                             if ($modx->getDatabase()->getRecordCount($sql)) {
522 522
                                 $document_groups = array();
523 523
                                 while ($row = $modx->getDatabase()->getRow($sql)) {
@@ -542,22 +542,22 @@  discard block
 block discarded – undo
542 542
                             // set new parent
543 543
                             $modx->getDatabase()->update(array(
544 544
                                 'parent' => $parent
545
-                            ), $modx->getFullTableName('site_content'), 'id=' . $id);
545
+                            ), $modx->getFullTableName('site_content'), 'id='.$id);
546 546
                             // set parent isfolder = 1
547 547
                             $modx->getDatabase()->update(array(
548 548
                                 'isfolder' => 1
549
-                            ), $modx->getFullTableName('site_content'), 'id=' . $parent);
549
+                            ), $modx->getFullTableName('site_content'), 'id='.$parent);
550 550
 
551 551
                             if ($parent != $parentOld) {
552 552
                                 // check children docs and set parent isfolder
553
-                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
553
+                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) {
554 554
                                     $modx->getDatabase()->update(array(
555 555
                                         'isfolder' => 1
556
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
556
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
557 557
                                 } else {
558 558
                                     $modx->getDatabase()->update(array(
559 559
                                         'isfolder' => 0
560
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
560
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
561 561
                                 }
562 562
                             }
563 563
 
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
                             if (!empty($menuindex)) {
566 566
                                 $menuindex = explode(',', $menuindex);
567 567
                                 foreach ($menuindex as $key => $value) {
568
-                                    $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
568
+                                    $modx->getDatabase()->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value);
569 569
                                 }
570 570
                             } else {
571 571
                                 // TODO: max(*) menuindex
@@ -594,19 +594,19 @@  discard block
 block discarded – undo
594 594
         }
595 595
 
596 596
         case 'getLockedElements': {
597
-            $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0;
598
-            $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
597
+            $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0;
598
+            $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
599 599
 
600 600
             $output = !!$modx->elementIsLocked($type, $id, true);
601 601
 
602 602
             if (!$output) {
603 603
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
604
-                $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
604
+                $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : '';
605 605
                 $sql = '
606
-                    SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked
607
-                    FROM ' . $modx->getFullTableName('site_content') . ' AS sc 
608
-                    LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
609
-                    WHERE sc.id=' . $id . ' GROUP BY sc.id';
606
+                    SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked
607
+                    FROM ' . $modx->getFullTableName('site_content').' AS sc 
608
+                    LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id
609
+                    WHERE sc.id=' . $id.' GROUP BY sc.id';
610 610
                 $sql = $modx->getDatabase()->query($sql);
611 611
                 if ($modx->getDatabase()->getRecordCount($sql)) {
612 612
                     $row = $modx->getDatabase()->getRow($sql);
Please login to merge, or discard this patch.
manager/includes/src/Legacy/Modifiers.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         }
83 83
         $this->srcValue = $value;
84 84
         $modifiers = trim($modifiers);
85
-        $modifiers = ':' . trim($modifiers, ':');
85
+        $modifiers = ':'.trim($modifiers, ':');
86 86
         $modifiers = str_replace(array("\r\n", "\r"), "\n", $modifiers);
87 87
         $modifiers = $this->splitEachModifiers($modifiers);
88 88
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         if ($delim) {
131 131
             if ($mode == '(') {
132
-                return substr($modifiers, 1, strpos($modifiers, $delim . ')') - 1);
132
+                return substr($modifiers, 1, strpos($modifiers, $delim.')') - 1);
133 133
             }
134 134
 
135 135
             return substr($modifiers, 1, strpos($modifiers, $delim, 1) - 1);
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     {
156 156
         if ($delim) {
157 157
             if ($mode == '(') {
158
-                return $this->_fetchContent($modifiers, $delim . ')');
158
+                return $this->_fetchContent($modifiers, $delim.')');
159 159
             } else {
160 160
                 $modifiers = trim($modifiers);
161 161
                 $modifiers = substr($modifiers, 1);
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers,
218 218
                     $match)) { // :+3, :-3, :*3 ...
219 219
                 $modifiers = substr($modifiers, strlen($match[0]));
220
-                $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]);
220
+                $result[] = array('cmd' => 'math', 'opt' => '%s'.$c.$match[0]);
221 221
                 $cmd = '';
222 222
             } elseif ($c === '(' || $c === '=') {
223 223
                 $modifiers = $m1 = trim($modifiers);
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         }
333 333
 
334 334
         $_ = explode(',',
335
-            $this->condModifiers . ',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
335
+            $this->condModifiers.',_default,default,if,input,or,and,show,this,select,switch,then,else,id,ifempty,smart_desc,smart_description,summary');
336 336
         if (in_array($cmd, $_)) {
337 337
             return false;
338 338
         } else {
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             case 'eq':
366 366
             case 'is':
367 367
             case 'equals':
368
-                $this->condition[] = (int)($value == $opt);
368
+                $this->condition[] = (int) ($value == $opt);
369 369
                 break;
370 370
             case 'neq':
371 371
             case 'ne':
@@ -373,59 +373,59 @@  discard block
 block discarded – undo
373 373
             case 'isnot':
374 374
             case 'isnt':
375 375
             case 'not':
376
-                $this->condition[] = (int)($value != $opt);
376
+                $this->condition[] = (int) ($value != $opt);
377 377
                 break;
378 378
             case '%':
379
-                $this->condition[] = (int)($value % $opt == 0);
379
+                $this->condition[] = (int) ($value % $opt == 0);
380 380
                 break;
381 381
             case 'isempty':
382
-                $this->condition[] = (int)(empty($value));
382
+                $this->condition[] = (int) (empty($value));
383 383
                 break;
384 384
             case 'isntempty':
385 385
             case 'isnotempty':
386
-                $this->condition[] = (int)(!empty($value));
386
+                $this->condition[] = (int) (!empty($value));
387 387
                 break;
388 388
             case '>=':
389 389
             case 'gte':
390 390
             case 'eg':
391 391
             case 'isgte':
392
-                $this->condition[] = (int)($value >= $opt);
392
+                $this->condition[] = (int) ($value >= $opt);
393 393
                 break;
394 394
             case '<=':
395 395
             case 'lte':
396 396
             case 'el':
397 397
             case 'islte':
398
-                $this->condition[] = (int)($value <= $opt);
398
+                $this->condition[] = (int) ($value <= $opt);
399 399
                 break;
400 400
             case '>':
401 401
             case 'gt':
402 402
             case 'greaterthan':
403 403
             case 'isgreaterthan':
404 404
             case 'isgt':
405
-                $this->condition[] = (int)($value > $opt);
405
+                $this->condition[] = (int) ($value > $opt);
406 406
                 break;
407 407
             case '<':
408 408
             case 'lt':
409 409
             case 'lowerthan':
410 410
             case 'islowerthan':
411 411
             case 'islt':
412
-                $this->condition[] = (int)($value < $opt);
412
+                $this->condition[] = (int) ($value < $opt);
413 413
                 break;
414 414
             case 'find':
415
-                $this->condition[] = (int)(strpos($value, $opt) !== false);
415
+                $this->condition[] = (int) (strpos($value, $opt) !== false);
416 416
                 break;
417 417
             case 'inarray':
418 418
             case 'in_array':
419 419
             case 'in':
420 420
                 $opt = explode(',', $opt);
421
-                $this->condition[] = (int)(in_array($value, $opt) !== false);
421
+                $this->condition[] = (int) (in_array($value, $opt) !== false);
422 422
                 break;
423 423
             case 'wildcard_match':
424 424
             case 'wcard_match':
425 425
             case 'wildcard':
426 426
             case 'wcard':
427 427
             case 'fnmatch':
428
-                $this->condition[] = (int)(fnmatch($opt, $value) !== false);
428
+                $this->condition[] = (int) (fnmatch($opt, $value) !== false);
429 429
                 break;
430 430
             case 'is_file':
431 431
             case 'is_dir':
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                 if (strpos($path, $modx->config['base_path']) === false) {
444 444
                     $path = ltrim($path, '/');
445 445
                 }
446
-                $this->condition[] = (int)($cmd($path) !== false);
446
+                $this->condition[] = (int) ($cmd($path) !== false);
447 447
                 break;
448 448
             case 'is_image':
449 449
                 if (!$opt) {
@@ -456,13 +456,13 @@  discard block
 block discarded – undo
456 456
                     break;
457 457
                 }
458 458
                 $_ = getimagesize($path);
459
-                $this->condition[] = (int)($_[0]);
459
+                $this->condition[] = (int) ($_[0]);
460 460
                 break;
461 461
             case 'regex':
462 462
             case 'preg':
463 463
             case 'preg_match':
464 464
             case 'isinrole':
465
-                $this->condition[] = (int)(preg_match($opt, $value));
465
+                $this->condition[] = (int) (preg_match($opt, $value));
466 466
                 break;
467 467
             case 'ir':
468 468
             case 'memberof':
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
             case 'show':
480 480
             case 'this':
481 481
                 $conditional = implode(' ', $this->condition);
482
-                $isvalid = (int)(eval("return ({$conditional});"));
482
+                $isvalid = (int) (eval("return ({$conditional});"));
483 483
                 if ($isvalid) {
484 484
                     return $this->srcValue;
485 485
                 }
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                 return null;
488 488
             case 'then':
489 489
                 $conditional = implode(' ', $this->condition);
490
-                $isvalid = (int)eval("return ({$conditional});");
490
+                $isvalid = (int) eval("return ({$conditional});");
491 491
                 if ($isvalid) {
492 492
                     return $opt;
493 493
                 }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
                 return null;
496 496
             case 'else':
497 497
                 $conditional = implode(' ', $this->condition);
498
-                $isvalid = (int)eval("return ({$conditional});");
498
+                $isvalid = (int) eval("return ({$conditional});");
499 499
                 if (!$isvalid) {
500 500
                     return $opt;
501 501
                 }
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                 return $this->strpos($value, $opt);
655 655
             case 'wordwrap':
656 656
                 // default: 70
657
-                $wrapat = (int)$opt > 0 ? (int)$opt : 70;
657
+                $wrapat = (int) $opt > 0 ? (int) $opt : 70;
658 658
                 if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
659 659
                     return $this->includeMdfFile('wordwrap');
660 660
                 } else {
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 if (strpos($opt, ',') !== false) {
687 687
                     list($b, $e) = explode(',', $opt, 2);
688 688
 
689
-                    return $this->substr($value, $b, (int)$e);
689
+                    return $this->substr($value, $b, (int) $e);
690 690
                 } else {
691 691
                     return $this->substr($value, $opt);
692 692
                 }
@@ -705,9 +705,9 @@  discard block
 block discarded – undo
705 705
                     $str = '';
706 706
                 }
707 707
                 if (preg_match('/^[1-9][0-9]*$/', $len)) {
708
-                    return $this->substr($value, 0, $len) . $str;
708
+                    return $this->substr($value, 0, $len).$str;
709 709
                 } elseif (preg_match('/^\-[1-9][0-9]*$/', $len)) {
710
-                    return $str . $this->substr($value, $len);
710
+                    return $str.$this->substr($value, $len);
711 711
                 }
712 712
                 break;
713 713
             case 'summary':
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
             case 'concatenate':
773 773
             case '.':
774 774
                 if ($value !== '') {
775
-                    return $value . $opt;
775
+                    return $value.$opt;
776 776
                 }
777 777
                 break;
778 778
             case 'sprintf':
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
             case 'money_format':
791 791
                 setlocale(LC_MONETARY, setlocale(LC_TIME, 0));
792 792
                 if ($value !== '') {
793
-                    return money_format($opt, (double)$value);
793
+                    return money_format($opt, (double) $value);
794 794
                 }
795 795
                 break;
796 796
             case 'tobool':
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                 return strtotime($value);
866 866
             #####  mathematical function
867 867
             case 'toint':
868
-                return (int)$value;
868
+                return (int) $value;
869 869
             case 'tofloat':
870 870
                 return floatval($value);
871 871
             case 'round':
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
                 return $cmd($value);
884 884
             case 'math':
885 885
             case 'calc':
886
-                $value = (int)$value;
886
+                $value = (int) $value;
887 887
                 if (empty($value)) {
888 888
                     $value = '0';
889 889
                 }
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
                 $where = implode(' AND ', $where);
1027 1027
                 $children = $modx->getDocumentChildren($value, $published, '0', 'id', $where);
1028 1028
                 $result = array();
1029
-                foreach ((array)$children as $child) {
1029
+                foreach ((array) $children as $child) {
1030 1030
                     $result[] = $child['id'];
1031 1031
                 }
1032 1032
 
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                     $opt .= '/';
1131 1131
                 }
1132 1132
 
1133
-                $filename = MODX_BASE_PATH . $opt . $filename;
1133
+                $filename = MODX_BASE_PATH.$opt.$filename;
1134 1134
 
1135 1135
                 if (is_file($filename)) {
1136 1136
                     clearstatcache();
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
         $value = $this->value;
1292 1292
         $opt = $this->opt;
1293 1293
 
1294
-        return include(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1294
+        return include(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php");
1295 1295
     }
1296 1296
 
1297 1297
     public function getValueFromElement($key, $value, $cmd, $opt)
@@ -1307,13 +1307,13 @@  discard block
 block discarded – undo
1307 1307
                 $row = $modx->getDatabase()->getRow($result);
1308 1308
                 $php = $row['snippet'];
1309 1309
             } elseif ($total == 0) {
1310
-                $assets_path = MODX_BASE_PATH . 'assets/';
1311
-                if (is_file($assets_path . "modifiers/mdf_{$cmd}.inc.php")) {
1312
-                    $modifiers_path = $assets_path . "modifiers/mdf_{$cmd}.inc.php";
1313
-                } elseif (is_file($assets_path . "plugins/phx/modifiers/{$cmd}.phx.php")) {
1314
-                    $modifiers_path = $assets_path . "plugins/phx/modifiers/{$cmd}.phx.php";
1315
-                } elseif (is_file(MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1316
-                    $modifiers_path = MODX_MANAGER_PATH . "includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1310
+                $assets_path = MODX_BASE_PATH.'assets/';
1311
+                if (is_file($assets_path."modifiers/mdf_{$cmd}.inc.php")) {
1312
+                    $modifiers_path = $assets_path."modifiers/mdf_{$cmd}.inc.php";
1313
+                } elseif (is_file($assets_path."plugins/phx/modifiers/{$cmd}.phx.php")) {
1314
+                    $modifiers_path = $assets_path."plugins/phx/modifiers/{$cmd}.phx.php";
1315
+                } elseif (is_file(MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php")) {
1316
+                    $modifiers_path = MODX_MANAGER_PATH."includes/extenders/modifiers/mdf_{$cmd}.inc.php";
1317 1317
                 } else {
1318 1318
                     $modifiers_path = false;
1319 1319
                 }
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
                         $php = substr($php, 0, -2);
1332 1332
                     }
1333 1333
                     if ($this->elmName !== '') {
1334
-                        $modx->snippetCache[$this->elmName . 'Props'] = '';
1334
+                        $modx->snippetCache[$this->elmName.'Props'] = '';
1335 1335
                     }
1336 1336
                 } else {
1337 1337
                     $php = false;
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
             $custom = eval($php);
1369 1369
             $msg = ob_get_contents();
1370 1370
             if ($value === $this->bt) {
1371
-                $value = $msg . $custom;
1371
+                $value = $msg.$custom;
1372 1372
             }
1373 1373
             ob_end_clean();
1374 1374
         } elseif ($html !== false && isset($value) && $value !== '') {
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
     public function ucfirst($str)
1543 1543
     {
1544 1544
         if (function_exists('mb_strtoupper')) {
1545
-            return mb_strtoupper($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1545
+            return mb_strtoupper($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1546 1546
         }
1547 1547
 
1548 1548
         return ucfirst($str);
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
     public function lcfirst($str)
1552 1552
     {
1553 1553
         if (function_exists('mb_strtolower')) {
1554
-            return mb_strtolower($this->substr($str, 0, 1)) . $this->substr($str, 1, $this->strlen($str));
1554
+            return mb_strtolower($this->substr($str, 0, 1)).$this->substr($str, 1, $this->strlen($str));
1555 1555
         }
1556 1556
 
1557 1557
         return lcfirst($str);
Please login to merge, or discard this patch.
install/src/controllers/install.php 1 patch
Spacing   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (file_exists(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php")) {
3
-    include_once(dirname(dirname(dirname(__DIR__))) . "/assets/cache/siteManager.php");
2
+if (file_exists(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php")) {
3
+    include_once(dirname(dirname(dirname(__DIR__)))."/assets/cache/siteManager.php");
4 4
 } else {
5 5
     define('MGR_DIR', 'manager');
6 6
 }
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 // set timout limit
26 26
 @ set_time_limit(120); // used @ to prevent warning when using safe mode?
27 27
 
28
-$installMode = (int)$_POST['installmode'];
29
-$installData = (int)!empty($_POST['installdata']);
28
+$installMode = (int) $_POST['installmode'];
29
+$installData = (int) !empty($_POST['installdata']);
30 30
 
31 31
 // get db info from post
32 32
 $database_server = $_POST['databasehost'];
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $database_charset = substr($database_collation, 0, strpos($database_collation, '_'));
37 37
 $database_connection_charset = $_POST['database_connection_charset'];
38 38
 $database_connection_method = $_POST['database_connection_method'];
39
-$dbase = "`" . $_POST['database_name'] . "`";
39
+$dbase = "`".$_POST['database_name']."`";
40 40
 $table_prefix = $_POST['tableprefix'];
41 41
 $adminname = $_POST['cmsadmin'];
42 42
 $adminemail = $_POST['cmsadminemail'];
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 // set session name variable
48 48
 if (!isset ($site_sessionname)) {
49
-    $site_sessionname = 'SN' . uniqid('');
49
+    $site_sessionname = 'SN'.uniqid('');
50 50
 }
51 51
 
52 52
 // get base path and url
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 }
63 63
 $pth = implode('install', $a);
64 64
 unset ($a);
65
-$base_url = $url . (substr($url, -1) != '/' ? '/' : '');
66
-$base_path = $pth . (substr($pth, -1) != '/' ? '/' : '');
65
+$base_url = $url.(substr($url, -1) != '/' ? '/' : '');
66
+$base_path = $pth.(substr($pth, -1) != '/' ? '/' : '');
67 67
 
68 68
 // connect to the database
69 69
 $conn = @mysqli_connect($database_server, $database_user, $database_password);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     if ($installLevel === 1) {
93 93
         // check table prefix
94 94
         if ($installMode === 0) {
95
-            $query = "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`";
95
+            $query = "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`";
96 96
             if (@mysqli_query($conn, $query)) {
97 97
                 $errors += 1;
98 98
             } else {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         // check status of Inherit Parent Template plugin
108 108
         $auto_template_logic = 'parent';
109 109
         if ($installMode !== 0) {
110
-            $query = "SELECT properties, disabled FROM " . $dbase . ".`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'";
110
+            $query = "SELECT properties, disabled FROM ".$dbase.".`".$table_prefix."site_plugins` WHERE name='Inherit Parent Template'";
111 111
             $rs = mysqli_query($conn, $query);
112 112
             $row = mysqli_fetch_row($rs);
113 113
             if (!$row) {
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
         }
131 131
 
132 132
         // open db connection
133
-        include dirname(__DIR__) . '/processor/result.php';
134
-        include_once dirname(__DIR__) . '/sqlParser.class.php';
133
+        include dirname(__DIR__).'/processor/result.php';
134
+        include_once dirname(__DIR__).'/sqlParser.class.php';
135 135
         $sqlParser = new SqlParser(
136 136
             $database_server,
137 137
             $database_user,
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
         $confph['lastInstallTime'] = time();
178 178
         $confph['site_sessionname'] = $site_sessionname;
179 179
 
180
-        $configString = file_get_contents(dirname(dirname(__DIR__)) . '/stubs/config.tpl');
180
+        $configString = file_get_contents(dirname(dirname(__DIR__)).'/stubs/config.tpl');
181 181
         $configString = parse($configString, $confph);
182 182
 
183
-        $filename = dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config.inc.php';
183
+        $filename = dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config.inc.php';
184 184
         $configFileFailed = false;
185 185
         if (@ !$handle = fopen($filename, 'w')) {
186 186
             $configFileFailed = true;
@@ -208,13 +208,13 @@  discard block
 block discarded – undo
208 208
             $siteid = uniqid('');
209 209
             mysqli_query(
210 210
                     $sqlParser->conn,
211
-                "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"
211
+                "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid'),('manager_theme','default')"
212 212
             );
213 213
         } else {
214 214
             // update site_id if missing
215 215
             $ds = mysqli_query(
216 216
                     $sqlParser->conn,
217
-                "SELECT setting_name,setting_value FROM $dbase.`" . $table_prefix . "system_settings` WHERE setting_name='site_id'"
217
+                "SELECT setting_name,setting_value FROM $dbase.`".$table_prefix."system_settings` WHERE setting_name='site_id'"
218 218
             );
219 219
             if ($ds) {
220 220
                 $r = mysqli_fetch_assoc($ds);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     $siteid = uniqid('');
224 224
                     mysqli_query(
225 225
                             $sqlParser->conn,
226
-                        "REPLACE INTO $dbase.`" . $table_prefix . "system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"
226
+                        "REPLACE INTO $dbase.`".$table_prefix."system_settings` (setting_name,setting_value) VALUES('site_id','$siteid')"
227 227
                     );
228 228
                 }
229 229
             }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     if ($installLevel === 5 && (isset ($_POST['template']) || $installData)) {
250 250
         $selTemplates = $_POST['template'];
251 251
         foreach ($moduleTemplates as $k => $moduleTemplate) {
252
-            if (! is_array($moduleTemplate)) {
252
+            if (!is_array($moduleTemplate)) {
253 253
                 continue;
254 254
             }
255 255
             $installDataLevel['templates'][$moduleTemplate[0]] = array(
@@ -287,12 +287,12 @@  discard block
 block discarded – undo
287 287
                     $template = mysqli_real_escape_string($conn, $template);
288 288
 
289 289
                     // See if the template already exists
290
-                    $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name'";
290
+                    $query = "SELECT * FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name'";
291 291
                     $rs = mysqli_query($sqlParser->conn, $query);
292 292
 
293 293
                     if (mysqli_num_rows($rs)) {
294 294
                         $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'update';
295
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
295
+                        $query = "UPDATE $dbase.`".$table_prefix."site_templates` SET content='$template', description='$desc', category=$category_id, locked='$locked'  WHERE templatename='$name' LIMIT 1;";
296 296
                         if (!mysqli_query($sqlParser->conn, $query)) {
297 297
                             $errors += 1;
298 298
                             $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array(
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                         if (!is_null($save_sql_id_as)) {
306 306
                             $sql_id = @mysqli_insert_id($sqlParser->conn);
307 307
                             if (!$sql_id) {
308
-                                $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$name' LIMIT 1;";
308
+                                $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$name' LIMIT 1;";
309 309
                                 $idQuery = mysqli_fetch_assoc(mysqli_query($sqlParser->conn, $query));
310 310
                                 $sql_id = $idQuery['id'];
311 311
                             }
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                         }
314 314
                     } else {
315 315
                         $installDataLevel['templates'][$moduleTemplate[0]]['type'] = 'create';
316
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');";
316
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_templates` (templatename,description,content,category,locked) VALUES('$name','$desc','$template',$category_id,'$locked');";
317 317
                         if (!@mysqli_query($sqlParser->conn, $query)) {
318 318
                             $errors += 1;
319 319
                             $installDataLevel['templates'][$moduleTemplate[0]]['error'] = array(
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
                 // Create the category if it does not already exist
379 379
                 $category = getCreateDbCategory($category, $sqlParser);
380 380
 
381
-                $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name'";
382
-                $rs = mysqli_query($sqlParser->conn,$query);
381
+                $query = "SELECT * FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name'";
382
+                $rs = mysqli_query($sqlParser->conn, $query);
383 383
                 if (mysqli_num_rows($rs)) {
384 384
                     $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'update';
385 385
                     while ($row = mysqli_fetch_assoc($rs)) {
386
-                        $query = "UPDATE $dbase.`" . $table_prefix . "site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
386
+                        $query = "UPDATE $dbase.`".$table_prefix."site_tmplvars` SET type='$input_type', caption='$caption', description='$desc', category=$category, locked=$locked, elements='$input_options', display='$output_widget', display_params='$output_widget_params', default_text='$input_default' WHERE id={$row['id']};";
387 387
                         if (!mysqli_query($sqlParser->conn, $query)) {
388 388
                             $installDataLevel['tvs'][$moduleTV[0]]['error'] = array(
389 389
                                 'type' => 'sql',
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                     }
397 397
                 } else {
398 398
                     $installDataLevel['tvs'][$moduleTV[0]]['type'] = 'create';
399
-                    $q = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
399
+                    $q = "INSERT INTO $dbase.`".$table_prefix."site_tmplvars` (type,name,caption,description,category,locked,elements,display,display_params,default_text) VALUES('$input_type','$name','$caption','$desc',$category,$locked,'$input_options','$output_widget','$output_widget_params','$input_default');";
400 400
                     if (!mysqli_query($sqlParser->conn, $q)) {
401 401
                         $installDataLevel['tvs'][$moduleTV[0]]['error'] = array(
402 402
                             'type' => 'sql',
@@ -413,23 +413,23 @@  discard block
 block discarded – undo
413 413
                 if (count($assignments) > 0) {
414 414
 
415 415
                     // remove existing tv -> template assignments
416
-                    $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_tmplvars` WHERE name='$name' AND description='$desc';";
416
+                    $query = "SELECT id FROM $dbase.`".$table_prefix."site_tmplvars` WHERE name='$name' AND description='$desc';";
417 417
                     $ds = mysqli_query($sqlParser->conn, $query);
418 418
                     $row = mysqli_fetch_assoc($ds);
419 419
                     $id = $row["id"];
420
-                    $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_tmplvar_templates` WHERE tmplvarid = \'' . $id . '\'';
420
+                    $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_tmplvar_templates` WHERE tmplvarid = \''.$id.'\'';
421 421
                     mysqli_query($sqlParser->conn, $query);
422 422
 
423 423
                     // add tv -> template assignments
424 424
                     foreach ($assignments as $assignment) {
425 425
                         $template = mysqli_real_escape_string($conn, $assignment);
426
-                        $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_templates` WHERE templatename='$template';";
426
+                        $query = "SELECT id FROM $dbase.`".$table_prefix."site_templates` WHERE templatename='$template';";
427 427
                         $ts = mysqli_query($sqlParser->conn, $query);
428 428
                         if ($ds && $ts) {
429 429
                             $tRow = mysqli_fetch_assoc($ts);
430 430
                             $templateId = $tRow['id'];
431
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)";
432
-                            mysqli_query($sqlParser->conn,$query);
431
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)";
432
+                            mysqli_query($sqlParser->conn, $query);
433 433
                         }
434 434
                     }
435 435
                 }
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['chunk']) || $installData)) {
442 442
         $selChunks = $_POST['chunk'];
443 443
         foreach ($moduleChunks as $k => $moduleChunk) {
444
-            if (! is_array($moduleChunk)) {
444
+            if (!is_array($moduleChunk)) {
445 445
                 continue;
446 446
             }
447 447
             $installDataLevel['chunks'][$moduleChunk[0]] = array(
@@ -479,14 +479,14 @@  discard block
 block discarded – undo
479 479
                     $chunk = mysqli_real_escape_string($conn, $chunk);
480 480
                     $rs = mysqli_query(
481 481
                         $sqlParser->conn,
482
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$name'"
482
+                        "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$name'"
483 483
                     );
484 484
                     $count_original_name = mysqli_num_rows($rs);
485 485
                     if ($overwrite == 'false') {
486
-                        $newname = $name . '-' . str_replace('.', '_', $modx_version);
486
+                        $newname = $name.'-'.str_replace('.', '_', $modx_version);
487 487
                         $rs = mysqli_query(
488 488
                             $sqlParser->conn,
489
-                            "SELECT * FROM $dbase.`" . $table_prefix . "site_htmlsnippets` WHERE name='$newname'"
489
+                            "SELECT * FROM $dbase.`".$table_prefix."site_htmlsnippets` WHERE name='$newname'"
490 490
                         );
491 491
                         $count_new_name = mysqli_num_rows($rs);
492 492
                     }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                     if ($update) {
495 495
                         $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'update';
496 496
                         if (!mysqli_query($sqlParser->conn,
497
-                            "UPDATE $dbase.`" . $table_prefix . "site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
497
+                            "UPDATE $dbase.`".$table_prefix."site_htmlsnippets` SET snippet='$chunk', description='$desc', category=$category_id WHERE name='$name';")) {
498 498
                             $errors += 1;
499 499
                             $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array(
500 500
                                 'type' => 'sql',
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                         } else {
512 512
                             $installDataLevel['chunks'][$moduleChunk[0]]['type'] = 'create';
513 513
                         }
514
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);";
514
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_htmlsnippets` (name,description,snippet,category) VALUES('$name','$desc','$chunk',$category_id);";
515 515
                         if (!mysqli_query($sqlParser->conn, $query)) {
516 516
                             $errors += 1;
517 517
                             $installDataLevel['chunks'][$moduleChunk[0]]['error'] = array(
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['module']) || $installData)) {
535 535
         $selModules = $_POST['module'];
536 536
         foreach ($moduleModules as $k => $moduleModule) {
537
-            if (! is_array($moduleModule)) {
537
+            if (!is_array($moduleModule)) {
538 538
                 continue;
539 539
             }
540 540
             $installDataLevel['modules'][$moduleModule[0]] = array(
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
                     // $module = removeDocblock($module, 'module'); // Modules have no fileBinding, keep docblock for info-tab
574 574
                     $module = mysqli_real_escape_string($conn, $module);
575 575
                     $rs = mysqli_query($sqlParser->conn,
576
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_modules` WHERE name='$name'");
576
+                        "SELECT * FROM $dbase.`".$table_prefix."site_modules` WHERE name='$name'");
577 577
                     if (mysqli_num_rows($rs)) {
578 578
                         $installDataLevel['modules'][$moduleModule[0]]['type'] = 'update';
579 579
                         $row = mysqli_fetch_assoc($rs);
580 580
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
581 581
                         if (!mysqli_query($sqlParser->conn,
582
-                            "UPDATE $dbase.`" . $table_prefix . "site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
582
+                            "UPDATE $dbase.`".$table_prefix."site_modules` SET modulecode='$module', description='$desc', properties='$props', enable_sharedparams='$shared' WHERE name='$name';")) {
583 583
                             $installDataLevel['modules'][$moduleModule[0]]['error'] = array(
584 584
                                 'type' => 'sql',
585 585
                                 'content' => mysqli_error($sqlParser->conn)
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                         $installDataLevel['modules'][$moduleModule[0]]['type'] = 'create';
592 592
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
593 593
                         if (!mysqli_query($sqlParser->conn,
594
-                            "INSERT INTO $dbase.`" . $table_prefix . "site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
594
+                            "INSERT INTO $dbase.`".$table_prefix."site_modules` (name,description,modulecode,properties,guid,enable_sharedparams,category) VALUES('$name','$desc','$module','$properties','$guid','$shared', $category);")) {
595 595
                             $installDataLevel['modules'][$moduleModule[0]]['error'] = array(
596 596
                                 'type' => 'sql',
597 597
                                 'content' => mysqli_error($sqlParser->conn)
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['plugin']) || $installData)) {
612 612
         $selPlugs = $_POST['plugin'];
613 613
         foreach ($modulePlugins as $k => $modulePlugin) {
614
-            if (! is_array($modulePlugin)) {
614
+            if (!is_array($modulePlugin)) {
615 615
                 continue;
616 616
             }
617 617
             $installDataLevel['plugins'][$modulePlugin[0]] = array(
@@ -645,12 +645,12 @@  discard block
 block discarded – undo
645 645
                 $disabled = $modulePlugin[9];
646 646
                 if (array_key_exists(7, $modulePlugin)) {
647 647
                     // parse comma-separated legacy names and prepare them for sql IN clause
648
-                    $leg_names = "'" . implode(
648
+                    $leg_names = "'".implode(
649 649
                             "','",
650 650
                             preg_split('/\s*,\s*/', mysqli_real_escape_string($conn, $modulePlugin[7]))
651
-                        ) . "'";
651
+                        )."'";
652 652
                 }
653
-                if (! file_exists($filecontent)) {
653
+                if (!file_exists($filecontent)) {
654 654
                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
655 655
                         'type' => 'file_not_found'
656 656
                     );
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 
659 659
                     // disable legacy versions based on legacy_names provided
660 660
                     if (!empty($leg_names)) {
661
-                        $update_query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
661
+                        $update_query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE name IN ($leg_names);";
662 662
                         $rs = mysqli_query($sqlParser->conn, $update_query);
663 663
                     }
664 664
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
                     $plugin = end(preg_split("/(\/\/)?\s*\<\?php/", file_get_contents($filecontent), 2));
669 669
                     $plugin = removeDocblock($plugin, 'plugin');
670 670
                     $plugin = mysqli_real_escape_string($conn, $plugin);
671
-                    $query = "SELECT * FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name'";
671
+                    $query = "SELECT * FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name'";
672 672
                     $rs = mysqli_query($sqlParser->conn, $query);
673 673
                     if (mysqli_num_rows($rs)) {
674 674
                         $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'update';
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                         while ($row = mysqli_fetch_assoc($rs)) {
677 677
                             $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
678 678
                             if ($row['description'] == $desc) {
679
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
679
+                                $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET plugincode='$plugin', description='$desc', properties='$props' WHERE id={$row['id']};";
680 680
                                 if (!mysqli_query($sqlParser->conn, $query)) {
681 681
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
682 682
                                         'type' => 'sql',
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
                                 }
688 688
                                 $insert = false;
689 689
                             } else {
690
-                                $query = "UPDATE $dbase.`" . $table_prefix . "site_plugins` SET disabled='1' WHERE id={$row['id']};";
690
+                                $query = "UPDATE $dbase.`".$table_prefix."site_plugins` SET disabled='1' WHERE id={$row['id']};";
691 691
                                 if (!mysqli_query($sqlParser->conn, $query)) {
692 692
                                     $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
693 693
                                         'type' => 'sql',
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
                         }
701 701
                         if ($insert === true) {
702 702
                             $properties = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
703
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);";
703
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,disabled,category) VALUES('$name','$desc','$plugin','$properties','$guid','0',$category);";
704 704
                             if (!mysqli_query($sqlParser->conn, $query)) {
705 705
                                 $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
706 706
                                     'type' => 'sql',
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
                     } else {
714 714
                         $installDataLevel['plugins'][$modulePlugin[0]]['type'] = 'create';
715 715
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
716
-                        $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);";
716
+                        $query = "INSERT INTO $dbase.`".$table_prefix."site_plugins` (name,description,plugincode,properties,moduleguid,category,disabled) VALUES('$name','$desc','$plugin','$properties','$guid',$category,$disabled);";
717 717
                         if (!mysqli_query($sqlParser->conn, $query)) {
718 718
                             $installDataLevel['plugins'][$modulePlugin[0]]['error'] = array(
719 719
                                 'type' => 'sql',
@@ -725,17 +725,17 @@  discard block
 block discarded – undo
725 725
                     }
726 726
                     // add system events
727 727
                     if (count($events) > 0) {
728
-                        $query = "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';";
728
+                        $query = "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';";
729 729
                         $ds = mysqli_query($sqlParser->conn, $query);
730 730
                         if ($ds) {
731 731
                             $row = mysqli_fetch_assoc($ds);
732 732
                             $id = $row["id"];
733 733
                             // remove existing events
734
-                            $query = 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\'';
734
+                            $query = 'DELETE FROM '.$dbase.'.`'.$table_prefix.'site_plugin_events` WHERE pluginid = \''.$id.'\'';
735 735
                             mysqli_query($sqlParser->conn, $query);
736 736
                             // add new events
737
-                            $query = "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')";
738
-                            mysqli_query($sqlParser->conn,$query);
737
+                            $query = "INSERT INTO $dbase.`".$table_prefix."site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`".$table_prefix."system_eventnames` se WHERE name IN ('".implode("','", $events)."')";
738
+                            mysqli_query($sqlParser->conn, $query);
739 739
                         }
740 740
                     }
741 741
                 }
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
     if ($installLevel === 5 && $errorData === false && (isset ($_POST['snippet']) || $installData)) {
750 750
         $selSnips = $_POST['snippet'];
751 751
         foreach ($moduleSnippets as $k => $moduleSnippet) {
752
-            if (! is_array($moduleSnippet)) {
752
+            if (!is_array($moduleSnippet)) {
753 753
                 continue;
754 754
             }
755 755
             $installDataLevel['snippets'][$moduleSnippet[0]] = array(
@@ -784,13 +784,13 @@  discard block
 block discarded – undo
784 784
                     $snippet = removeDocblock($snippet, 'snippet');
785 785
                     $snippet = mysqli_real_escape_string($conn, $snippet);
786 786
                     $rs = mysqli_query($sqlParser->conn,
787
-                        "SELECT * FROM $dbase.`" . $table_prefix . "site_snippets` WHERE name='$name'");
787
+                        "SELECT * FROM $dbase.`".$table_prefix."site_snippets` WHERE name='$name'");
788 788
                     if (mysqli_num_rows($rs)) {
789 789
                         $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'update';
790 790
                         $row = mysqli_fetch_assoc($rs);
791 791
                         $props = mysqli_real_escape_string($conn, propUpdate($properties, $row['properties']));
792 792
                         if (!mysqli_query($sqlParser->conn,
793
-                            "UPDATE $dbase.`" . $table_prefix . "site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
793
+                            "UPDATE $dbase.`".$table_prefix."site_snippets` SET snippet='$snippet', description='$desc', properties='$props' WHERE name='$name';")) {
794 794
                             $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array(
795 795
                                 'type' => 'sql',
796 796
                                 'content' => mysqli_error($sqlParser->conn)
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
                         $installDataLevel['snippets'][$moduleSnippet[0]]['type'] = 'create';
803 803
                         $properties = mysqli_real_escape_string($conn, parseProperties($properties, true));
804 804
                         if (!mysqli_query($sqlParser->conn,
805
-                            "INSERT INTO $dbase.`" . $table_prefix . "site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
805
+                            "INSERT INTO $dbase.`".$table_prefix."site_snippets` (name,description,snippet,properties,category) VALUES('$name','$desc','$snippet','$properties',$category);")) {
806 806
                             $installDataLevel['snippets'][$moduleSnippet[0]]['error'] = array(
807 807
                                 'type' => 'sql',
808 808
                                 'content' => mysqli_error($sqlParser->conn)
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
                     'content' => '' //dependency name or error message
870 870
                 )*/
871 871
             );
872
-            $query = 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"';
872
+            $query = 'SELECT id, guid FROM '.$dbase.'`'.$sqlParser->prefix.'site_modules` WHERE name="'.$dependency['module'].'"';
873 873
             $ds = mysqli_query($sqlParser->conn, $query);
874 874
             if (!$ds) {
875 875
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
                 $moduleGuid = $row["guid"];
885 885
             }
886 886
             // get extra id
887
-            $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"';
887
+            $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE '.$dependency['column'].'="'.$dependency['name'].'"';
888 888
             $ds = mysqli_query($sqlParser->conn, $query);
889 889
             if (!$ds) {
890 890
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
                 $extraId = $row["id"];
899 899
             }
900 900
             // setup extra as module dependency
901
-            $query = 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1';
901
+            $query = 'SELECT module FROM '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'].' LIMIT 1';
902 902
             $ds = mysqli_query($sqlParser->conn, $query);
903 903
             if (!$ds) {
904 904
                 $installDependencyLevel[$dependency['module']]['error'] = array(
@@ -909,17 +909,17 @@  discard block
 block discarded – undo
909 909
                 break;
910 910
             } else {
911 911
                 if (mysqli_num_rows($ds) === 0) {
912
-                    $query = 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')';
912
+                    $query = 'INSERT INTO '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` (module, resource, type) VALUES('.$moduleId.','.$extraId.','.$dependency['type'].')';
913 913
                     mysqli_query($sqlParser->conn, $query);
914 914
                     $installDependencyLevel[$dependency['module']]['type'] = 'create';
915 915
                 } else {
916
-                    $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'];
916
+                    $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_module_depobj` SET module = '.$moduleId.', resource = '.$extraId.', type = '.$dependency['type'].' WHERE module='.$moduleId.' AND resource='.$extraId.' AND type='.$dependency['type'];
917 917
                     mysqli_query($sqlParser->conn, $query);
918 918
                     $installDependencyLevel[$dependency['module']]['type'] = 'update';
919 919
                 }
920 920
                 if ($dependency['type'] == 30 || $dependency['type'] == 40) {
921 921
                     // set extra guid for plugins and snippets
922
-                    $query = 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1';
922
+                    $query = 'SELECT id FROM '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` WHERE id='.$extraId.' LIMIT 1';
923 923
                     $ds = mysqli_query($sqlParser->conn, $query);
924 924
                     if (!$ds) {
925 925
                         $installDependencyLevel[$dependency['module']]['extra'] = array(
@@ -930,8 +930,8 @@  discard block
 block discarded – undo
930 930
                         break;
931 931
                     } else {
932 932
                         if (mysqli_num_rows($ds) != 0) {
933
-                            $query = 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId;
934
-                            $ds= mysqli_query($sqlParser->conn, $query);
933
+                            $query = 'UPDATE '.$dbase.'`'.$sqlParser->prefix.'site_'.$dependency['table'].'` SET moduleguid = '.$moduleGuid.' WHERE id='.$extraId;
934
+                            $ds = mysqli_query($sqlParser->conn, $query);
935 935
                             $installDependencyLevel[$dependency['module']]['extra'] = array(
936 936
                                 'type' => 'done',
937 937
                                 'content' => $dependency['name']
@@ -953,28 +953,28 @@  discard block
 block discarded – undo
953 953
         }
954 954
 
955 955
         // Setup the MODX API -- needed for the cache processor
956
-        if (file_exists(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php')) {
957
-            require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/config_mutator.php';
956
+        if (file_exists(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php')) {
957
+            require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/config_mutator.php';
958 958
         }
959 959
         define('MODX_API_MODE', true);
960 960
         if (!defined('MODX_BASE_PATH')) {
961 961
             define('MODX_BASE_PATH', $base_path);
962 962
         }
963 963
         if (!defined('MODX_MANAGER_PATH')) {
964
-            define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/');
964
+            define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/');
965 965
         }
966 966
         $database_type = 'mysqli';
967 967
         // initiate a new document parser
968 968
         if (!defined('EVO_BOOTSTRAP_FILE')) {
969 969
             define('EVO_BOOTSTRAP_FILE',
970
-                dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php');
971
-            require_once dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/bootstrap.php';
970
+                dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php');
971
+            require_once dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/bootstrap.php';
972 972
         }
973 973
 
974
-        if (! defined('EVO_SERVICES_FILE')) {
975
-            define('EVO_SERVICES_FILE', dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/services.php');
974
+        if (!defined('EVO_SERVICES_FILE')) {
975
+            define('EVO_SERVICES_FILE', dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/services.php');
976 976
         }
977
-        if (! defined('MODX_CLASS')) {
977
+        if (!defined('MODX_CLASS')) {
978 978
             define('MODX_CLASS', '\EvolutionCMS\Core');
979 979
         }
980 980
         
@@ -982,25 +982,25 @@  discard block
 block discarded – undo
982 982
         $modx->getDatabase()->connect();
983 983
         // always empty cache after install
984 984
         $sync = new EvolutionCMS\Cache();
985
-        $sync->setCachepath(dirname(dirname(dirname(__DIR__))) . '/assets/cache/');
985
+        $sync->setCachepath(dirname(dirname(dirname(__DIR__))).'/assets/cache/');
986 986
         $sync->setReport(false);
987 987
         $sync->emptyCache(); // first empty the cache
988 988
 
989 989
         // try to chmod the cache go-rwx (for suexeced php)
990
-        @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/siteCache.idx.php', 0600);
991
-        @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/sitePublishing.idx.php', 0600);
990
+        @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/siteCache.idx.php', 0600);
991
+        @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/sitePublishing.idx.php', 0600);
992 992
 
993 993
         // remove any locks on the manager functions so initial manager login is not blocked
994
-        mysqli_query($conn, "TRUNCATE TABLE `" . $table_prefix . "active_users`");
994
+        mysqli_query($conn, "TRUNCATE TABLE `".$table_prefix."active_users`");
995 995
 
996 996
         // close db connection
997 997
         $sqlParser->close();
998 998
 
999 999
         // andrazk 20070416 - release manager access
1000
-        if (file_exists(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php')) {
1001
-            @chmod(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php', 0755);
1002
-            unlink(dirname(dirname(dirname(__DIR__))) . '/assets/cache/installProc.inc.php');
1000
+        if (file_exists(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php')) {
1001
+            @chmod(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php', 0755);
1002
+            unlink(dirname(dirname(dirname(__DIR__))).'/assets/cache/installProc.inc.php');
1003 1003
         }
1004 1004
     }
1005 1005
 }
1006
-include_once dirname(__DIR__) . '/template/actions/install.php';
1006
+include_once dirname(__DIR__).'/template/actions/install.php';
Please login to merge, or discard this patch.