Completed
Push — develop ( 923a1c...1e9876 )
by Maxim
47s queued 29s
created
manager/processors/export_site.processor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
-if(!$modx->hasPermission('export_static')) {
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+if (!$modx->hasPermission('export_static')) {
4 4
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 5
 }
6 6
 
@@ -10,15 +10,15 @@  discard block
 block discarded – undo
10 10
 $modx->loadExtension('EXPORT_SITE');
11 11
 
12 12
 
13
-if(is_dir(MODX_BASE_PATH . 'temp'))       $export_dir = MODX_BASE_PATH . 'temp/export';
14
-elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export';
13
+if (is_dir(MODX_BASE_PATH.'temp'))       $export_dir = MODX_BASE_PATH.'temp/export';
14
+elseif (is_dir(MODX_BASE_PATH.'assets')) $export_dir = MODX_BASE_PATH.'assets/export';
15 15
 $modx->export->targetDir = $export_dir;
16 16
 
17
-if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path'])))
17
+if (strpos($modx->config['base_path'], "{$export_dir}/") === 0 && 0 <= strlen(str_replace("{$export_dir}/", '', $modx->config['base_path'])))
18 18
 	return $_lang['export_site.static.php6'];
19
-elseif($modx->config['rb_base_dir'] === $export_dir . '/')
20
-	return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']);
21
-elseif(!is_writable($export_dir))
19
+elseif ($modx->config['rb_base_dir'] === $export_dir.'/')
20
+	return $modx->parsePlaceholder($_lang['export_site.static.php7'], 'rb_base_url='.$modx->config['base_url'].$modx->config['rb_base_url']);
21
+elseif (!is_writable($export_dir))
22 22
 	return $_lang['export_site_target_unwritable'];
23 23
 
24 24
 $modx->export->generate_mode = $_POST['generate_mode'];
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 $repl_after      = $_POST['repl_after'];
32 32
 $includenoncache = $_POST['includenoncache'];
33 33
 
34
-if($ignore_ids!==$_POST['ignore_ids']
35
- ||$includenoncache!==$_POST['includenoncache']
36
- ||$repl_before!==$_POST['repl_before']
37
- ||$repl_after !==$_POST['repl_after']) {
34
+if ($ignore_ids !== $_POST['ignore_ids']
35
+ ||$includenoncache !== $_POST['includenoncache']
36
+ ||$repl_before !== $_POST['repl_before']
37
+ ||$repl_after !== $_POST['repl_after']) {
38 38
 	$modx->clearCache('full');
39 39
 }
40 40
 
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
 
51 51
 $exportend = $modx->export->get_mtime();
52 52
 $totaltime = ($exportend - $modx->export->exportstart);
53
-$output .= sprintf ('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3));
53
+$output .= sprintf('<p>'.$_lang["export_site_time"].'</p>', round($totaltime, 3));
54 54
 return $output;
Please login to merge, or discard this patch.
manager/processors/send_message.processor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
-if(!$modx->hasPermission('messages')) {
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+if (!$modx->hasPermission('messages')) {
4 4
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
5 5
 }
6 6
 
@@ -8,13 +8,13 @@  discard block
 block discarded – undo
8 8
 $userid = $_REQUEST['user'];
9 9
 $groupid = $_REQUEST['group'];
10 10
 $subject = $modx->db->escape($_REQUEST['messagesubject']);
11
-if($subject=="") $subject="(no subject)";
11
+if ($subject == "") $subject = "(no subject)";
12 12
 $message = $modx->db->escape($_REQUEST['messagebody']);
13
-if($message=="") $message="(no message)";
13
+if ($message == "") $message = "(no message)";
14 14
 $postdate = time();
15 15
 
16
-if($sendto=='u') {
17
-	if($userid==0) {
16
+if ($sendto == 'u') {
17
+	if ($userid == 0) {
18 18
 		$modx->webAlertAndQuit($_lang["error_no_user_selected"]);
19 19
 	}
20 20
 	$modx->db->insert(
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 		), $modx->getFullTableName('user_messages'));
30 30
 }
31 31
 
32
-if($sendto=='g') {
33
-	if($groupid==0) {
32
+if ($sendto == 'g') {
33
+	if ($groupid == 0) {
34 34
 		$modx->webAlertAndQuit($_lang["error_no_group_selected"]);
35 35
 	}
36 36
 	$rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'");
37
-	while ($row=$modx->db->getRow($rs)) {
37
+	while ($row = $modx->db->getRow($rs)) {
38 38
 		$modx->db->insert(
39 39
 			array(
40 40
 				'recipient' => $row['internalKey'],
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 }
50 50
 
51 51
 
52
-if($sendto=='a') {
52
+if ($sendto == 'a') {
53 53
 	$rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'");
54
-	while ($row=$modx->db->getRow($rs)) {
54
+	while ($row = $modx->db->getRow($rs)) {
55 55
 		$modx->db->insert(
56 56
 			array(
57 57
 				'recipient' => $row['id'],
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  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->db->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 $modx->loadExtension('ManagerAPI');
13 13
 $modx->loadExtension('phpass');
14 14
 
15
-$core_path = MODX_MANAGER_PATH . 'includes/';
15
+$core_path = MODX_MANAGER_PATH.'includes/';
16 16
 // include_once the language file
17 17
 $_lang = array();
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
20
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21 21
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 include_once("{$core_path}log.class.inc.php");
26 26
 
27 27
 // Initialize System Alert Message Queque
28
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
28
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
29 29
 	$_SESSION['SystemAlertMsgQueque'] = array();
30 30
 }
31 31
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 $rs = $modx->db->select($fields, $from, $where);
52 52
 $limit = $modx->db->getRecordCount($rs);
53 53
 
54
-if($limit == 0 || $limit > 1) {
54
+if ($limit == 0 || $limit > 1) {
55 55
 	jsAlert($_lang['login_processor_unknown_user']);
56 56
 	return;
57 57
 }
@@ -73,32 +73,32 @@  discard block
 block discarded – undo
73 73
 
74 74
 // get the user settings from the database
75 75
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
76
-while($row = $modx->db->getRow($rs)) {
76
+while ($row = $modx->db->getRow($rs)) {
77 77
 	extract($row);
78 78
 	${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
82
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83 83
 	@session_destroy();
84 84
 	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
85
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
86 86
 		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
87
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88 88
 		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
89
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
90 90
 		$ip = $cip;
91 91
 	} else {
92 92
 		$ip = "UNKNOWN";
93 93
 	}
94 94
 	$log = new logHandler;
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
95
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
96 96
 	jsAlert($_lang['login_processor_many_failed_logins']);
97 97
 	return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
101
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102 102
 	$fields = array();
103 103
 	$fields['failedlogincount'] = '0';
104 104
 	$fields['blockeduntil'] = time() - 1;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 // this user has been blocked by an admin, so no way he's loggin in!
109
-if($blocked == '1') {
109
+if ($blocked == '1') {
110 110
 	@session_destroy();
111 111
 	session_unset();
112 112
 	jsAlert($_lang['login_processor_blocked1']);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 }
115 115
 
116 116
 // blockuntil: this user has a block until date
117
-if($blockeduntildate > time()) {
117
+if ($blockeduntildate > time()) {
118 118
 	@session_destroy();
119 119
 	session_unset();
120 120
 	jsAlert($_lang['login_processor_blocked2']);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 }
123 123
 
124 124
 // blockafter: this user has a block after date
125
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
125
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
126 126
 	@session_destroy();
127 127
 	session_unset();
128 128
 	jsAlert($_lang['login_processor_blocked3']);
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
 }
131 131
 
132 132
 // allowed ip
133
-if($allowed_ip) {
134
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
+if ($allowed_ip) {
134
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136 136
 			jsAlert($_lang['login_processor_remotehost_ip']);
137 137
 			return;
138 138
 		}
139 139
 	}
140
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
140
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141 141
 		jsAlert($_lang['login_processor_remote_ip']);
142 142
 		return;
143 143
 	}
144 144
 }
145 145
 
146 146
 // allowed days
147
-if($allowed_days) {
147
+if ($allowed_days) {
148 148
 	$date = getdate();
149 149
 	$day = $date['wday'] + 1;
150
-	if(strpos($allowed_days, $day) === false) {
150
+	if (strpos($allowed_days, $day) === false) {
151 151
 		jsAlert($_lang['login_processor_date']);
152 152
 		return;
153 153
 	}
@@ -164,33 +164,33 @@  discard block
 block discarded – undo
164 164
 
165 165
 // check if plugin authenticated the user
166 166
 $matchPassword = false;
167
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
167
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
168 168
 	// check user password - local authentication
169 169
 	$hashType = $modx->manager->getHashType($dbasePassword);
170
-	if($hashType == 'phpass') {
170
+	if ($hashType == 'phpass') {
171 171
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
-	} elseif($hashType == 'md5') {
172
+	} elseif ($hashType == 'md5') {
173 173
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
-	} elseif($hashType == 'v1') {
174
+	} elseif ($hashType == 'v1') {
175 175
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176 176
 	} else {
177 177
 		$matchPassword = false;
178 178
 	}
179
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
179
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
180 180
 	$matchPassword = true;
181 181
 }
182 182
 
183
-if(!$matchPassword) {
183
+if (!$matchPassword) {
184 184
 	jsAlert($_lang['login_processor_wrong_password']);
185 185
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186 186
 	return;
187 187
 }
188 188
 
189
-if($modx->config['use_captcha'] == 1) {
190
-	if(!isset ($_SESSION['veriword'])) {
189
+if ($modx->config['use_captcha'] == 1) {
190
+	if (!isset ($_SESSION['veriword'])) {
191 191
 		jsAlert($_lang['login_processor_captcha_config']);
192 192
 		return;
193
-	} elseif($_SESSION['veriword'] != $captcha_code) {
193
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
194 194
 		jsAlert($_lang['login_processor_bad_code']);
195 195
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196 196
 		return;
@@ -218,17 +218,17 @@  discard block
 block discarded – undo
218 218
 $_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
219 219
 
220 220
 // successful login so reset fail count and update key values
221
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
221
+$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
222 222
 
223 223
 // get user's document groups
224 224
 $i = 0;
225
-$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
226
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
225
+$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
226
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
227 227
 $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
228 228
 
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231
-if($rememberme == '1') {
231
+if ($rememberme == '1') {
232 232
 	$_SESSION['modx.mgr.session.cookie.lifetime'] = intval($modx->config['session.cookie.lifetime']);
233 233
 
234 234
 	// Set a cookie separate from the session cookie with the username in it. 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 	global $https_port;
237 237
 
238 238
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
239
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
240 240
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241 241
 	} else {
242 242
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 // Check if user already has an active session, if not check if user pressed logout end of last session
252 252
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
253 253
 $activeSession = $modx->db->getValue($rs);
254
-if(!$activeSession) {
254
+if (!$activeSession) {
255 255
 	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
-	if($lastHit = $modx->db->getValue($rs)) {
256
+	if ($lastHit = $modx->db->getValue($rs)) {
257 257
 		$_SESSION['show_logout_reminder'] = array(
258 258
 			'type' => 'logout_reminder',
259 259
 			'lastHit' => $lastHit
@@ -275,16 +275,16 @@  discard block
 block discarded – undo
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277 277
 $id = intval($modx->db->getValue($rs));
278
-if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
278
+if ($id > 0) {
279
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
280
+	if ($_POST['ajax'] == 1) {
281 281
 		echo $header;
282 282
 	} else {
283 283
 		header($header);
284 284
 	}
285 285
 } else {
286
-	$header = 'Location: ' . MODX_MANAGER_URL;
287
-	if($_POST['ajax'] == 1) {
286
+	$header = 'Location: '.MODX_MANAGER_URL;
287
+	if ($_POST['ajax'] == 1) {
288 288
 		echo $header;
289 289
 	} else {
290 290
 		header($header);
@@ -292,35 +292,35 @@  discard block
 block discarded – undo
292 292
 }
293 293
 
294 294
 // show javascript alert
295
-function jsAlert($msg) {
295
+function jsAlert($msg){
296 296
 	global $modx;
297
-	if($_POST['ajax'] != 1) {
298
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
297
+	if ($_POST['ajax'] != 1) {
298
+		echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
299 299
 	} else {
300
-		echo $msg . "\n";
300
+		echo $msg."\n";
301 301
 	}
302 302
 }
303 303
 
304
-function login($username, $givenPassword, $dbasePassword) {
304
+function login($username, $givenPassword, $dbasePassword){
305 305
 	global $modx;
306 306
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
307 307
 }
308 308
 
309
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
309
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username){
310 310
 	global $modx;
311 311
 
312 312
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
313 313
 
314
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
314
+	if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
315 315
 		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
316 316
 	}
317 317
 
318
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
318
+	if ($user_algo !== $modx->config['pwd_hash_algo']) {
319 319
 		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
320 320
 		$modx->config['pwd_hash_algo'] = $user_algo;
321 321
 	}
322 322
 
323
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
323
+	if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
324 324
 		return false;
325 325
 	}
326 326
 
@@ -329,17 +329,17 @@  discard block
 block discarded – undo
329 329
 	return true;
330 330
 }
331 331
 
332
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
332
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){
333 333
 	global $modx;
334 334
 
335
-	if($dbasePassword != md5($givenPassword)) {
335
+	if ($dbasePassword != md5($givenPassword)) {
336 336
 		return false;
337 337
 	}
338 338
 	updateNewHash($username, $givenPassword);
339 339
 	return true;
340 340
 }
341 341
 
342
-function updateNewHash($username, $password) {
342
+function updateNewHash($username, $password){
343 343
 	global $modx;
344 344
 
345 345
 	$field = array();
@@ -347,23 +347,23 @@  discard block
 block discarded – undo
347 347
 	$modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
348 348
 }
349 349
 
350
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
350
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){
351 351
 	global $modx;
352 352
 
353 353
 	$failedlogins += 1;
354 354
 
355 355
 	$fields = array('failedlogincount' => $failedlogins);
356
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
356
+	if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
357 357
 	{
358 358
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
359 359
 	}
360 360
 
361 361
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
362 362
 
363
-	if($failedlogins < $failed_allowed) {
363
+	if ($failedlogins < $failed_allowed) {
364 364
 		//sleep to help prevent brute force attacks
365 365
 		$sleep = (int) $failedlogins / 2;
366
-		if($sleep > 5) {
366
+		if ($sleep > 5) {
367 367
 			$sleep = 5;
368 368
 		}
369 369
 		sleep($sleep);
Please login to merge, or discard this patch.
manager/frames/nodes.functions.inc.php 1 patch
Spacing   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != 'true') {
2
+if (IN_MANAGER_MODE != 'true') {
3 3
 	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @param $theme
11 11
  * @param string $hereid
12 12
  */
13
-function makeHTML($indent, $parent, $expandAll, $theme, $hereid = '') {
13
+function makeHTML($indent, $parent, $expandAll, $theme, $hereid = ''){
14 14
 	global $modx;
15 15
 	global $icons, $iconsPrivate, $_style;
16 16
 	global $_lang, $opened, $opened2, $closed2; //added global vars
@@ -21,35 +21,35 @@  discard block
 block discarded – undo
21 21
 	// setup spacer
22 22
 	$level = 0;
23 23
 	$spacer = '<span class="indent">';
24
-	for($i = 2; $i <= $indent; $i++) {
24
+	for ($i = 2; $i <= $indent; $i++) {
25 25
 		$spacer .= '<i></i>';
26 26
 		$level++;
27 27
 	}
28 28
 	$spacer .= '</span>';
29 29
 
30 30
 	// manage order-by
31
-	if(!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
31
+	if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
32 32
 		// This is the first startup, set default sort order
33 33
 		$_SESSION['tree_sortby'] = 'menuindex';
34 34
 		$_SESSION['tree_sortdir'] = 'ASC';
35 35
 	}
36 36
 
37
-	switch($_SESSION['tree_sortby']) {
37
+	switch ($_SESSION['tree_sortby']) {
38 38
 		case 'createdon':
39 39
 		case 'editedon':
40 40
 		case 'publishedon':
41 41
 		case 'pub_date':
42 42
 		case 'unpub_date':
43
-			$sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']);
43
+			$sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']);
44 44
 			break;
45 45
 		default:
46
-			$sortby = 'sc.' . $_SESSION['tree_sortby'];
46
+			$sortby = 'sc.'.$_SESSION['tree_sortby'];
47 47
 	};
48 48
 
49
-	$orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']);
49
+	$orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']);
50 50
 
51 51
 	// Folder sorting gets special setup ;) Add menuindex and pagetitle
52
-	if($_SESSION['tree_sortby'] == 'isfolder') {
52
+	if ($_SESSION['tree_sortby'] == 'isfolder') {
53 53
 		$orderby .= ', menuindex ASC, pagetitle';
54 54
 	}
55 55
 
@@ -59,12 +59,12 @@  discard block
 block discarded – undo
59 59
 	// get document groups for current user
60 60
 	$docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
61 61
 	$showProtected = false;
62
-	if(isset ($modx->config['tree_show_protected'])) {
62
+	if (isset ($modx->config['tree_show_protected'])) {
63 63
 		$showProtected = (boolean) $modx->config['tree_show_protected'];
64 64
 	}
65 65
 	$mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0';
66
-	if($showProtected == false) {
67
-		$access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
66
+	if ($showProtected == false) {
67
+		$access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))");
68 68
 	} else {
69 69
 		$access = '';
70 70
 	}
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 	$from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template";
75 75
 	$where = "(parent={$parent}) {$access} GROUP BY sc.id";
76 76
 	$result = $modx->db->select($field, $from, $where, $orderby);
77
-	if($modx->db->getRecordCount($result) == 0) {
77
+	if ($modx->db->getRecordCount($result) == 0) {
78 78
 		$output .= sprintf('<div><a class="empty">%s%s&nbsp;<span class="empty">%s</span></a></div>', $spacer, $_style['tree_deletedpage'], $_lang['empty_folder']);
79 79
 	}
80 80
 
81 81
 	$nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename'];
82 82
 
83
-	while($row = $modx->db->getRow($result)) {
83
+	while ($row = $modx->db->getRow($result)) {
84 84
 		$node = '';
85 85
 
86 86
 		$nodetitle = getNodeTitle($nodeNameSource, $row);
@@ -89,46 +89,46 @@  discard block
 block discarded – undo
89 89
 		$treeNodeClass = 'node';
90 90
 		$treeNodeClass .= $row['hasAccess'] == 0 ? ' protected' : '';
91 91
 
92
-		if($row['deleted'] == 1) {
92
+		if ($row['deleted'] == 1) {
93 93
 			$treeNodeClass .= ' deleted';
94 94
 			//$nodetitleDisplay = sprintf('<span class="deletedNode">%s</span>', $nodetitle);
95
-		} elseif($row['published'] == 0) {
95
+		} elseif ($row['published'] == 0) {
96 96
 			$treeNodeClass .= ' unpublished';
97 97
 			//$nodetitleDisplay = sprintf('<span class="unpublishedNode">%s</span>', $nodetitle);
98
-		} elseif($row['hidemenu'] == 1) {
98
+		} elseif ($row['hidemenu'] == 1) {
99 99
 			$treeNodeClass .= ' hidemenu';
100 100
 			//$nodetitleDisplay = sprintf('<span class="notInMenuNode%s">%s</span>', $protectedClass, $nodetitle);
101 101
 		} else {
102 102
 			//$nodetitleDisplay = sprintf('<span class="publishedNode%s">%s</span>', $protectedClass, $nodetitle);
103 103
 		}
104 104
 
105
-		if($row['id'] == $hereid) {
105
+		if ($row['id'] == $hereid) {
106 106
 			$treeNodeClass .= ' current';
107 107
 		}
108 108
 
109 109
 		$weblinkDisplay = $row['type'] == 'reference' ? sprintf('&nbsp;%s', $_style['tree_linkgo']) : '';
110
-		$pageIdDisplay = '<small>(' . ($modx_textdir ? '&rlm;' : '') . $row['id'] . ')</small>';
110
+		$pageIdDisplay = '<small>('.($modx_textdir ? '&rlm;' : '').$row['id'].')</small>';
111 111
 
112 112
 		// Prepare displaying user-locks
113 113
 		$lockedByUser = '';
114 114
 		$rowLock = $modx->elementIsLocked(7, $row['id'], true);
115
-		if($rowLock && $modx->hasPermission('display_locks')) {
116
-			if($rowLock['sid'] == $modx->sid) {
115
+		if ($rowLock && $modx->hasPermission('display_locks')) {
116
+			if ($rowLock['sid'] == $modx->sid) {
117 117
 				$title = $modx->parseText($_lang["lock_element_editing"], array(
118 118
 					'element_type' => $_lang["lock_element_type_7"],
119 119
 					'lasthit_df' => $rowLock['lasthit_df']
120 120
 				));
121
-				$lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>';
121
+				$lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>';
122 122
 			} else {
123 123
 				$title = $modx->parseText($_lang["lock_element_locked_by"], array(
124 124
 					'element_type' => $_lang["lock_element_type_7"],
125 125
 					'username' => $rowLock['username'],
126 126
 					'lasthit_df' => $rowLock['lasthit_df']
127 127
 				));
128
-				if($modx->hasPermission('remove_locks')) {
129
-					$lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>';
128
+				if ($modx->hasPermission('remove_locks')) {
129
+					$lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>';
130 130
 				} else {
131
-					$lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>';
131
+					$lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>';
132 132
 				}
133 133
 			}
134 134
 		}
@@ -136,23 +136,23 @@  discard block
 block discarded – undo
136 136
 		$url = $modx->makeUrl($row['id']);
137 137
 
138 138
 		$title = '';
139
-		if(isDateNode($nodeNameSource)) {
140
-			$title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]';
139
+		if (isDateNode($nodeNameSource)) {
140
+			$title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]';
141 141
 		}
142
-		$title .= $_lang['id'] . ': ' . $row['id'];
143
-		$title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle'];
144
-		$title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex'];
145
-		$title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-');
146
-		$title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename'];
147
-		$title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']);
148
-		$title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']);
149
-		$title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']);
150
-		$title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']);
151
-		$title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']);
152
-		$title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']);
153
-		$title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']);
142
+		$title .= $_lang['id'].': '.$row['id'];
143
+		$title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle'];
144
+		$title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex'];
145
+		$title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-');
146
+		$title .= '[+lf+]'.$_lang['template'].': '.$row['templatename'];
147
+		$title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']);
148
+		$title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']);
149
+		$title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']);
150
+		$title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']);
151
+		$title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']);
152
+		$title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']);
153
+		$title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']);
154 154
 		$title = $modx->htmlspecialchars($title);
155
-		$title = str_replace('[+lf+]', ' &#13;', $title);   // replace line-breaks with empty space as fall-back
155
+		$title = str_replace('[+lf+]', ' &#13;', $title); // replace line-breaks with empty space as fall-back
156 156
 
157 157
 		$data = array(
158 158
 			'id' => $row['id'],
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
 		$ph['expandAll'] = $expandAll;
202 202
 		$ph['isPrivate'] = ($row['privateweb'] || $row['privatemgr']) ? 1 : 0;
203 203
 
204
-		if(!$row['isfolder']) {
204
+		if (!$row['isfolder']) {
205 205
 			$tpl = getTplSingleNode();
206
-			switch($row['id']) {
206
+			switch ($row['id']) {
207 207
 				case $modx->config['site_start']            :
208 208
 					$icon = $_style['tree_page_home'];
209 209
 					break;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 					$icon = $_style['tree_page_info'];
218 218
 					break;
219 219
 				default:
220
-					if(isset($icons[$row['contentType']])) {
220
+					if (isset($icons[$row['contentType']])) {
221 221
 						$icon = $icons[$row['contentType']];
222 222
 					} else {
223 223
 						$icon = $_style['tree_page'];
@@ -227,20 +227,20 @@  discard block
 block discarded – undo
227 227
 
228 228
 			// invoke OnManagerNodePrerender event
229 229
 			$prenode = $modx->invokeEvent("OnManagerNodePrerender", array('ph' => $ph));
230
-			if(is_array($prenode)) {
230
+			if (is_array($prenode)) {
231 231
 				$phnew = array();
232
-				foreach($prenode as $pnode) {
232
+				foreach ($prenode as $pnode) {
233 233
 					$phnew = array_merge($phnew, unserialize($pnode));
234 234
 				}
235 235
 				$ph = (count($phnew) > 0) ? $phnew : $ph;
236 236
 			}
237 237
 
238
-			if($ph['contextmenu']) {
239
-				$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
238
+			if ($ph['contextmenu']) {
239
+				$ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
240 240
 			}
241 241
 
242
-			if($_SESSION['tree_show_only_folders']) {
243
-				if($row['parent'] == 0) {
242
+			if ($_SESSION['tree_show_only_folders']) {
243
+				if ($row['parent'] == 0) {
244 244
 					$node .= $modx->parseText($tpl, $ph);
245 245
 				} else {
246 246
 					$node .= '';
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 			$ph['icon_folder_open'] = $_style['tree_folderopen_new'];
254 254
 			$ph['icon_folder_close'] = $_style['tree_folder_new'];
255 255
 
256
-			if($_SESSION['tree_show_only_folders']) {
256
+			if ($_SESSION['tree_show_only_folders']) {
257 257
 				$tpl = getTplFolderNodeNotChildren();
258 258
 				$checkFolders = checkIsFolder($row['id'], 1) ? 1 : 0; // folders
259 259
 				$checkDocs = checkIsFolder($row['id'], 0) ? 1 : 0; // no folders
260 260
 				$ph['tree_page_click'] = 3;
261 261
 
262 262
 				// expandAll: two type for partial expansion
263
-				if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) {
264
-					if($expandAll == 1) {
263
+				if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) {
264
+					if ($expandAll == 1) {
265 265
 						$opened2[] = $row['id'];
266 266
 					}
267 267
 					$ph['icon'] = $ph['icon_folder_open'];
@@ -269,11 +269,11 @@  discard block
 block discarded – undo
269 269
 					$ph['node_toggle'] = 1;
270 270
 					$ph['subMenuState'] = ' open';
271 271
 
272
-					if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) {
272
+					if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) {
273 273
 						$ph['showChildren'] = 1;
274 274
 						$ph['icon_node_toggle'] = '';
275 275
 						$ph['icon'] = $ph['icon_folder_close'];
276
-					} elseif(!$checkDocs && $checkFolders) {
276
+					} elseif (!$checkDocs && $checkFolders) {
277 277
 						$ph['showChildren'] = 0;
278 278
 						$ph['openFolder'] = 2;
279 279
 					} else {
@@ -285,20 +285,20 @@  discard block
 block discarded – undo
285 285
 						'ph' => $ph,
286 286
 						'opened' => '1'
287 287
 					));
288
-					if(is_array($prenode)) {
288
+					if (is_array($prenode)) {
289 289
 						$phnew = array();
290
-						foreach($prenode as $pnode) {
290
+						foreach ($prenode as $pnode) {
291 291
 							$phnew = array_merge($phnew, unserialize($pnode));
292 292
 						}
293 293
 						$ph = (count($phnew) > 0) ? $phnew : $ph;
294 294
 					}
295 295
 
296
-					if($ph['contextmenu']) {
297
-						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
296
+					if ($ph['contextmenu']) {
297
+						$ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
298 298
 					}
299 299
 
300 300
 					$node .= $modx->parseText($tpl, $ph);
301
-					if($checkFolders) {
301
+					if ($checkFolders) {
302 302
 						$node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid);
303 303
 					}
304 304
 					$node .= '</div></div>';
@@ -308,10 +308,10 @@  discard block
 block discarded – undo
308 308
 					$ph['icon_node_toggle'] = $ph['tree_plusnode'];
309 309
 					$ph['node_toggle'] = 0;
310 310
 
311
-					if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) {
311
+					if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) {
312 312
 						$ph['showChildren'] = 1;
313 313
 						$ph['icon_node_toggle'] = '';
314
-					} elseif(!$checkDocs && $checkFolders) {
314
+					} elseif (!$checkDocs && $checkFolders) {
315 315
 						$ph['showChildren'] = 0;
316 316
 						$ph['openFolder'] = 2;
317 317
 					} else {
@@ -323,16 +323,16 @@  discard block
 block discarded – undo
323 323
 						'ph' => $ph,
324 324
 						'opened' => '0'
325 325
 					));
326
-					if(is_array($prenode)) {
326
+					if (is_array($prenode)) {
327 327
 						$phnew = array();
328
-						foreach($prenode as $pnode) {
328
+						foreach ($prenode as $pnode) {
329 329
 							$phnew = array_merge($phnew, unserialize($pnode));
330 330
 						}
331 331
 						$ph = (count($phnew) > 0) ? $phnew : $ph;
332 332
 					}
333 333
 
334
-					if($ph['contextmenu']) {
335
-						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
334
+					if ($ph['contextmenu']) {
335
+						$ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
336 336
 					}
337 337
 
338 338
 					$node .= $modx->parseText($tpl, $ph);
@@ -341,8 +341,8 @@  discard block
 block discarded – undo
341 341
 			} else {
342 342
 				$tpl = getTplFolderNode();
343 343
 				// expandAll: two type for partial expansion
344
-				if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) {
345
-					if($expandAll == 1) {
344
+				if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) {
345
+					if ($expandAll == 1) {
346 346
 						$opened2[] = $row['id'];
347 347
 					}
348 348
 					$ph['icon'] = $ph['icon_folder_open'];
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 					$ph['node_toggle'] = 1;
351 351
 					$ph['subMenuState'] = ' open';
352 352
 
353
-					if($ph['donthit'] == 1) {
353
+					if ($ph['donthit'] == 1) {
354 354
 						$ph['tree_page_click'] = 3;
355 355
 						$ph['icon_node_toggle'] = '';
356 356
 						$ph['icon'] = $ph['icon_folder_close'];
@@ -362,32 +362,32 @@  discard block
 block discarded – undo
362 362
 						'ph' => $ph,
363 363
 						'opened' => '1'
364 364
 					));
365
-					if(is_array($prenode)) {
365
+					if (is_array($prenode)) {
366 366
 						$phnew = array();
367
-						foreach($prenode as $pnode) {
367
+						foreach ($prenode as $pnode) {
368 368
 							$phnew = array_merge($phnew, unserialize($pnode));
369 369
 						}
370 370
 						$ph = (count($phnew) > 0) ? $phnew : $ph;
371
-						if($ph['showChildren'] == 0) {
371
+						if ($ph['showChildren'] == 0) {
372 372
 							unset($opened2[$row['id']]);
373 373
 							$ph['node_toggle'] = 0;
374 374
 							$ph['subMenuState'] = '';
375 375
 						}
376 376
 					}
377 377
 
378
-					if($ph['showChildren'] == 0) {
378
+					if ($ph['showChildren'] == 0) {
379 379
 						$ph['icon_node_toggle'] = '';
380 380
 						$ph['donthit'] = 1;
381 381
 						$ph['icon'] = $ph['icon_folder_close'];
382 382
 						$tpl = getTplFolderNodeNotChildren();
383 383
 					}
384 384
 
385
-					if($ph['contextmenu']) {
386
-						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
385
+					if ($ph['contextmenu']) {
386
+						$ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
387 387
 					}
388 388
 
389 389
 					$node .= $modx->parseText($tpl, $ph);
390
-					if($ph['donthit'] == 0) {
390
+					if ($ph['donthit'] == 0) {
391 391
 						$node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid);
392 392
 					}
393 393
 					$node .= '</div></div>';
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 					$ph['icon_node_toggle'] = $ph['tree_plusnode'];
398 398
 					$ph['node_toggle'] = 0;
399 399
 
400
-					if($ph['donthit'] == 1) {
400
+					if ($ph['donthit'] == 1) {
401 401
 						$ph['tree_page_click'] = 3;
402 402
 						$ph['icon_node_toggle'] = '';
403 403
 						$ph['icon'] = $ph['icon_folder_close'];
@@ -409,23 +409,23 @@  discard block
 block discarded – undo
409 409
 						'ph' => $ph,
410 410
 						'opened' => '0'
411 411
 					));
412
-					if(is_array($prenode)) {
412
+					if (is_array($prenode)) {
413 413
 						$phnew = array();
414
-						foreach($prenode as $pnode) {
414
+						foreach ($prenode as $pnode) {
415 415
 							$phnew = array_merge($phnew, unserialize($pnode));
416 416
 						}
417 417
 						$ph = (count($phnew) > 0) ? $phnew : $ph;
418 418
 					}
419 419
 
420
-					if($ph['showChildren'] == 0) {
420
+					if ($ph['showChildren'] == 0) {
421 421
 						$ph['icon_node_toggle'] = '';
422 422
 						$ph['donthit'] = 1;
423 423
 						$ph['icon'] = $ph['icon_folder_close'];
424 424
 						$tpl = getTplFolderNodeNotChildren();
425 425
 					}
426 426
 
427
-					if($ph['contextmenu']) {
428
-						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
427
+					if ($ph['contextmenu']) {
428
+						$ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"';
429 429
 					}
430 430
 
431 431
 					$node .= $modx->parseText($tpl, $ph);
@@ -437,10 +437,10 @@  discard block
 block discarded – undo
437 437
 		// invoke OnManagerNodeRender event
438 438
 		$data['node'] = $node;
439 439
 		$evtOut = $modx->invokeEvent('OnManagerNodeRender', $data);
440
-		if(is_array($evtOut)) {
440
+		if (is_array($evtOut)) {
441 441
 			$evtOut = implode("\n", $evtOut);
442 442
 		}
443
-		if($evtOut != '') {
443
+		if ($evtOut != '') {
444 444
 			$node = trim($evtOut);
445 445
 		}
446 446
 
@@ -450,14 +450,14 @@  discard block
 block discarded – undo
450 450
 	return $output;
451 451
 }
452 452
 
453
-function getIconInfo($_style) {
454
-	if(!isset($_style['tree_page_gif'])) {
453
+function getIconInfo($_style){
454
+	if (!isset($_style['tree_page_gif'])) {
455 455
 		$_style['tree_page_gif'] = $_style['tree_page'];
456 456
 	}
457
-	if(!isset($_style['tree_page_jpg'])) {
457
+	if (!isset($_style['tree_page_jpg'])) {
458 458
 		$_style['tree_page_jpg'] = $_style['tree_page'];
459 459
 	}
460
-	if(!isset($_style['tree_page_png'])) {
460
+	if (!isset($_style['tree_page_png'])) {
461 461
 		$_style['tree_page_png'] = $_style['tree_page'];
462 462
 	}
463 463
 	$icons = array(
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
 	return $icons;
478 478
 }
479 479
 
480
-function getPrivateIconInfo($_style) {
481
-	if(!isset($_style['tree_page_gif_secure'])) {
480
+function getPrivateIconInfo($_style){
481
+	if (!isset($_style['tree_page_gif_secure'])) {
482 482
 		$_style['tree_page_gif_secure'] = $_style['tree_page_secure'];
483 483
 	}
484
-	if(!isset($_style['tree_page_jpg_secure'])) {
484
+	if (!isset($_style['tree_page_jpg_secure'])) {
485 485
 		$_style['tree_page_jpg_secure'] = $_style['tree_page_secure'];
486 486
 	}
487
-	if(!isset($_style['tree_page_png_secure'])) {
487
+	if (!isset($_style['tree_page_png_secure'])) {
488 488
 		$_style['tree_page_png_secure'] = $_style['tree_page_secure'];
489 489
 	}
490 490
 	$iconsPrivate = array(
@@ -504,21 +504,21 @@  discard block
 block discarded – undo
504 504
 	return $iconsPrivate;
505 505
 }
506 506
 
507
-function getNodeTitle($nodeNameSource, $row) {
507
+function getNodeTitle($nodeNameSource, $row){
508 508
 	global $modx;
509 509
 
510
-	switch($nodeNameSource) {
510
+	switch ($nodeNameSource) {
511 511
 		case 'menutitle':
512 512
 			$nodetitle = $row['menutitle'] ? $row['menutitle'] : $row['pagetitle'];
513 513
 			break;
514 514
 		case 'alias':
515 515
 			$nodetitle = $row['alias'] ? $row['alias'] : $row['id'];
516
-			if(strpos($row['alias'], '.') === false) {
517
-				if($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) {
516
+			if (strpos($row['alias'], '.') === false) {
517
+				if ($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) {
518 518
 					$nodetitle .= $modx->config['friendly_url_suffix'];
519 519
 				}
520 520
 			}
521
-			$nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle;
521
+			$nodetitle = $modx->config['friendly_url_prefix'].$nodetitle;
522 522
 			break;
523 523
 		case 'pagetitle':
524 524
 			$nodetitle = $row['pagetitle'];
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 		case 'unpub_date':
534 534
 			$doc = $modx->getDocumentObject('id', $row['id']);
535 535
 			$date = $doc[$nodeNameSource];
536
-			if(!empty($date)) {
536
+			if (!empty($date)) {
537 537
 				$nodetitle = $modx->toDateFormat($date);
538 538
 			} else {
539 539
 				$nodetitle = '- - -';
@@ -550,8 +550,8 @@  discard block
 block discarded – undo
550 550
 	return $nodetitle;
551 551
 }
552 552
 
553
-function isDateNode($nodeNameSource) {
554
-	switch($nodeNameSource) {
553
+function isDateNode($nodeNameSource){
554
+	switch ($nodeNameSource) {
555 555
 		case 'createdon':
556 556
 		case 'editedon':
557 557
 		case 'publishedon':
@@ -563,13 +563,13 @@  discard block
 block discarded – undo
563 563
 	}
564 564
 }
565 565
 
566
-function checkIsFolder($parent = 0, $isfolder = 1) {
566
+function checkIsFolder($parent = 0, $isfolder = 1){
567 567
 	global $modx;
568 568
 
569
-	return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' '));
569
+	return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' '));
570 570
 }
571 571
 
572
-function _htmlentities($array) {
572
+function _htmlentities($array){
573 573
 	global $modx;
574 574
 
575 575
 	$array = json_encode($array, JSON_UNESCAPED_UNICODE);
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 	return $array;
579 579
 }
580 580
 
581
-function getTplSingleNode() {
581
+function getTplSingleNode(){
582 582
 	return '<div id="node[+id+]"><a class="[+treeNodeClass+]"
583 583
         onclick="modx.tree.treeAction(event,[+id+]);"
584 584
         oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');"
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
         title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a></div>';
603 603
 }
604 604
 
605
-function getTplFolderNode() {
605
+function getTplFolderNode(){
606 606
 	return '<div id="node[+id+]"><a class="[+treeNodeClass+]"
607 607
         onclick="modx.tree.treeAction(event,[+id+]);"
608 608
         oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');"
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
         title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>';
639 639
 }
640 640
 
641
-function getTplFolderNodeNotChildren() {
641
+function getTplFolderNodeNotChildren(){
642 642
 	return '<div id="node[+id+]"><a class="[+treeNodeClass+]"
643 643
         onclick="modx.tree.treeAction(event,[+id+]);"
644 644
         oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');"
@@ -670,11 +670,11 @@  discard block
 block discarded – undo
670 670
         title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>';
671 671
 }
672 672
 
673
-function dbug($str, $flag = false) {
673
+function dbug($str, $flag = false){
674 674
 	print('<pre>');
675 675
 	print_r($str);
676 676
 	print('</pre>');
677
-	if($flag) {
677
+	if ($flag) {
678 678
 		exit;
679 679
 	}
680 680
 }
Please login to merge, or discard this patch.
manager/frames/nodes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 $parent = intval($_REQUEST['parent']);
23 23
 $expandAll = intval($_REQUEST['expandAll']);
24 24
 $output = '';
25
-$theme = $manager_theme . "/";
25
+$theme = $manager_theme."/";
26 26
 $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : '';
27 27
 
28 28
 if (isset($_REQUEST['showonlyfolders'])) {
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 if (isset($_COOKIE['MODX_themeColor'])) {
50
-    $body_class .= ' ' . $_COOKIE['MODX_themeColor'];
50
+    $body_class .= ' '.$_COOKIE['MODX_themeColor'];
51 51
 }
52 52
 
53 53
 if (isset($modx->pluginCache['ElementsInTree'])) {
@@ -75,36 +75,36 @@  discard block
 block discarded – undo
75 75
     $user['which_browser'] = $modx->config['which_browser'];
76 76
 }
77 77
 
78
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
78
+$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime;
79 79
 
80 80
 if ($modx->config['manager_theme'] == 'default') {
81
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
82
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
81
+    if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
82
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
83 83
         $minifier = new Formatter\CSSMinify();
84
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
85
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
86
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
87
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
88
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
89
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
90
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
91
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
92
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
93
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
94
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
84
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css');
85
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css');
86
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css');
87
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css');
88
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css');
89
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css');
90
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css');
91
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css');
92
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css');
93
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css');
94
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css');
95 95
         $css = $minifier->minify();
96
-        file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
96
+        file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css);
97 97
     }
98
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
99
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
98
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
99
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
100 100
     }
101 101
 }
102 102
 
103
-$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
103
+$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
104 104
 
105 105
 ?>
106 106
 <!DOCTYPE html>
107
-<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>>
107
+<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>>
108 108
 <head>
109 109
     <title><?= $site_name ?>- (EVO CMS Manager)</title>
110 110
     <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" />
@@ -135,20 +135,20 @@  discard block
 block discarded – undo
135 135
         MODX_SITE_URL: '<?= MODX_SITE_URL ?>',
136 136
         MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>',
137 137
         user: {
138
-          role: <?= (int)$user['role'] ?>,
138
+          role: <?= (int) $user['role'] ?>,
139 139
           username: '<?= $user['username'] ?>'
140 140
         },
141 141
         config: {
142 142
           mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>,
143
-          menu_height: <?= (int)$menu_height ?>,
144
-          tree_width: <?= (int)$tree_width ?>,
145
-          tree_min_width: <?= (int)$tree_min_width ?>,
146
-          session_timeout: <?= (int)$modx->config['session_timeout'] ?>,
147
-          site_start: <?= (int)$modx->config['site_start'] ?>,
148
-          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>,
143
+          menu_height: <?= (int) $menu_height ?>,
144
+          tree_width: <?= (int) $tree_width ?>,
145
+          tree_min_width: <?= (int) $tree_min_width ?>,
146
+          session_timeout: <?= (int) $modx->config['session_timeout'] ?>,
147
+          site_start: <?= (int) $modx->config['site_start'] ?>,
148
+          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>,
149 149
           theme: '<?= $modx->config['manager_theme'] ?>',
150 150
           which_browser: '<?= $user['which_browser'] ?>',
151
-          layout: <?= (int)$manager_layout ?>,
151
+          layout: <?= (int) $manager_layout ?>,
152 152
           textdir: '<?= $modx_textdir ?>',
153 153
           global_tabs: <?= $modx->config['global_tabs'] ?>
154 154
 
@@ -233,11 +233,11 @@  discard block
 block discarded – undo
233 233
           delete a[b];
234 234
         },
235 235
         openedArray: [],
236
-        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
236
+        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?>
237 237
       };
238 238
       <?php
239 239
       $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
240
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
240
+      echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n		modx.openedArray[", $opened).'] = 1;')."\n";
241 241
       ?>
242 242
     </script>
243 243
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
367 367
                                 <span class="username"><?= $user['username'] ?></span>
368 368
                                 <?php if ($user['photo']) { ?>
369
-                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
369
+                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span>
370 370
                                 <?php } else { ?>
371 371
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
372 372
                                 <?php } ?>
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                                 $version = 'Evolution';
394 394
                                 ?>
395 395
                                 <?php
396
-                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
396
+                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
397 397
                                 ?>
398 398
                             </ul>
399 399
                         </li>
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
     <script type="text/javascript">
533 533
 
534 534
       if (document.getElementById('treeMenu')) {
535
-          <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
535
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
536 536
 
537 537
         document.getElementById('treeMenu_openelements').onclick = function(e) {
538 538
           e.preventDefault();
@@ -550,12 +550,12 @@  discard block
 block discarded – undo
550 550
           }
551 551
         };
552 552
           <?php } ?>
553
-          <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
553
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
554 554
 
555 555
         document.getElementById('treeMenu_openimages').onclick = function(e) {
556 556
           e.preventDefault();
557 557
           if (modx.config.global_tabs && !e.shiftKey) {
558
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
558
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
559 559
           } else {
560 560
             var randomNum = '<?= $_lang["files_files"] ?>';
561 561
             if (e.shiftKey) {
@@ -568,12 +568,12 @@  discard block
 block discarded – undo
568 568
           }
569 569
         };
570 570
           <?php } ?>
571
-          <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
571
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
572 572
 
573 573
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
574 574
           e.preventDefault();
575 575
           if (modx.config.global_tabs && !e.shiftKey) {
576
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
576
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
577 577
           } else {
578 578
             var randomNum = '<?= $_lang["files_files"] ?>';
579 579
             if (e.shiftKey) {
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 
628 628
 </div>
629 629
 <?php if ($modx->config['show_picker'] != "0") {
630
-    include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
630
+    include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
631 631
 } ?>
632 632
 </body>
633 633
 </html>
Please login to merge, or discard this patch.
manager/frames/mainmenu.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $sitemenu['site'] = array(
22 22
 	'site',
23 23
 	'main',
24
-	'<i class="fa fa-home"></i>' . $_lang['home'],
24
+	'<i class="fa fa-home"></i>'.$_lang['home'],
25 25
 	'index.php?a=2',
26 26
 	$_lang['home'],
27 27
 	'',
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 	'active'
33 33
 );
34 34
 
35
-if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
35
+if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
36 36
 	$sitemenu['elements'] = array(
37 37
 		'elements',
38 38
 		'main',
39
-		'<i class="fa fa-th"></i>' . $_lang['elements'],
39
+		'<i class="fa fa-th"></i>'.$_lang['elements'],
40 40
 		'javascript:;',
41 41
 		$_lang['elements'],
42 42
 		' return false;',
@@ -48,11 +48,11 @@  discard block
 block discarded – undo
48 48
 	);
49 49
 }
50 50
 
51
-if($modx->hasPermission('exec_module')) {
51
+if ($modx->hasPermission('exec_module')) {
52 52
 	$sitemenu['modules'] = array(
53 53
 		'modules',
54 54
 		'main',
55
-		'<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['modules'],
55
+		'<i class="'.$_style['icons_modules'].'"></i>'.$_lang['modules'],
56 56
 		'javascript:;',
57 57
 		$_lang['modules'],
58 58
 		' return false;',
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 	);
65 65
 }
66 66
 
67
-if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) {
67
+if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) {
68 68
 	$sitemenu['users'] = array(
69 69
 		'users',
70 70
 		'main',
71
-		'<i class="fa fa-users"></i>' . $_lang['users'],
71
+		'<i class="fa fa-users"></i>'.$_lang['users'],
72 72
 		'javascript:;',
73 73
 		$_lang['users'],
74 74
 		' return false;',
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 	);
81 81
 }
82 82
 
83
-if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
83
+if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
84 84
 	$sitemenu['tools'] = array(
85 85
 		'tools',
86 86
 		'main',
87
-		'<i class="fa fa-wrench"></i>' . $_lang['tools'],
87
+		'<i class="fa fa-wrench"></i>'.$_lang['tools'],
88 88
 		'javascript:;',
89 89
 		$_lang['tools'],
90 90
 		' return false;',
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
 }
98 98
 
99 99
 $tab = 0;
100
-if($modx->hasPermission('edit_template')) {
100
+if ($modx->hasPermission('edit_template')) {
101 101
 	$sitemenu['element_templates'] = array(
102 102
 		'element_templates',
103 103
 		'elements',
104
-		'<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>',
105
-		'index.php?a=76&tab=' . $tab++,
104
+		'<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>',
105
+		'index.php?a=76&tab='.$tab++,
106 106
 		$_lang['manage_templates'],
107 107
 		'',
108 108
 		'new_template,edit_template',
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 		'dropdown-toggle'
113 113
 	);
114 114
 }
115
-if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
115
+if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
116 116
 	$sitemenu['element_tplvars'] = array(
117 117
 		'element_tplvars',
118 118
 		'elements',
119
-		'<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>',
120
-		'index.php?a=76&tab=' . $tab++,
119
+		'<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>',
120
+		'index.php?a=76&tab='.$tab++,
121 121
 		$_lang['tmplvars'],
122 122
 		'',
123 123
 		'new_template,edit_template',
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
 		'dropdown-toggle'
128 128
 	);
129 129
 }
130
-if($modx->hasPermission('edit_chunk')) {
130
+if ($modx->hasPermission('edit_chunk')) {
131 131
 	$sitemenu['element_htmlsnippets'] = array(
132 132
 		'element_htmlsnippets',
133 133
 		'elements',
134
-		'<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>',
135
-		'index.php?a=76&tab=' . $tab++,
134
+		'<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>',
135
+		'index.php?a=76&tab='.$tab++,
136 136
 		$_lang['manage_htmlsnippets'],
137 137
 		'',
138 138
 		'new_chunk,edit_chunk',
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
 		'dropdown-toggle'
143 143
 	);
144 144
 }
145
-if($modx->hasPermission('edit_snippet')) {
145
+if ($modx->hasPermission('edit_snippet')) {
146 146
 	$sitemenu['element_snippets'] = array(
147 147
 		'element_snippets',
148 148
 		'elements',
149
-		'<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>',
150
-		'index.php?a=76&tab=' . $tab++,
149
+		'<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>',
150
+		'index.php?a=76&tab='.$tab++,
151 151
 		$_lang['manage_snippets'],
152 152
 		'',
153 153
 		'new_snippet,edit_snippet',
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 		'dropdown-toggle'
158 158
 	);
159 159
 }
160
-if($modx->hasPermission('edit_plugin')) {
160
+if ($modx->hasPermission('edit_plugin')) {
161 161
 	$sitemenu['element_plugins'] = array(
162 162
 		'element_plugins',
163 163
 		'elements',
164
-		'<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>',
165
-		'index.php?a=76&tab=' . $tab++,
164
+		'<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>',
165
+		'index.php?a=76&tab='.$tab++,
166 166
 		$_lang['manage_plugins'],
167 167
 		'',
168 168
 		'new_plugin,edit_plugin',
@@ -174,11 +174,11 @@  discard block
 block discarded – undo
174 174
 }
175 175
 //$sitemenu['element_categories']     = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,'');
176 176
 
177
-if($modx->hasPermission('file_manager')) {
177
+if ($modx->hasPermission('file_manager')) {
178 178
 	$sitemenu['manage_files'] = array(
179 179
 		'manage_files',
180 180
 		'elements',
181
-		'<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'],
181
+		'<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'],
182 182
 		'index.php?a=31',
183 183
 		$_lang['manage_files'],
184 184
 		'',
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
 		''
190 190
 	);
191 191
 }
192
-if($modx->hasPermission('category_manager')) {
192
+if ($modx->hasPermission('category_manager')) {
193 193
 	$sitemenu['manage_categories'] = array(
194 194
 		'manage_categories',
195 195
 		'elements',
196
-		'<i class="fa fa-object-group"></i>' . $_lang['manage_categories'],
196
+		'<i class="fa fa-object-group"></i>'.$_lang['manage_categories'],
197 197
 		'index.php?a=120',
198 198
 		$_lang['manage_categories'],
199 199
 		'',
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
 }
207 207
 
208 208
 // Modules Menu Items
209
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
209
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
210 210
 	$sitemenu['new_module'] = array(
211 211
 		'new_module',
212 212
 		'modules',
213
-		'<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'],
213
+		'<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'],
214 214
 		'index.php?a=106',
215 215
 		$_lang['module_management'],
216 216
 		'',
@@ -222,24 +222,24 @@  discard block
 block discarded – undo
222 222
 	);
223 223
 }
224 224
 
225
-if($modx->hasPermission('exec_module')) {
226
-	if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
225
+if ($modx->hasPermission('exec_module')) {
226
+	if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
227 227
 		$rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member
228
-				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
229
-				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
230
-				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
231
-                WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
228
+				FROM ' . $modx->getFullTableName('site_modules').' AS sm
229
+				LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
230
+				LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
231
+                WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1
232 232
                 ORDER BY sm.name');
233 233
 	} else {
234 234
 		$rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235 235
 	}
236
-	if($modx->db->getRecordCount($rs)) {
236
+	if ($modx->db->getRecordCount($rs)) {
237 237
 	    while ($row = $modx->db->getRow($rs)) {
238
-            $sitemenu['module' . $row['id']] = array(
239
-                'module' . $row['id'],
238
+            $sitemenu['module'.$row['id']] = array(
239
+                'module'.$row['id'],
240 240
                 'modules',
241
-                ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>') . $row['name'],
242
-                'index.php?a=112&id=' . $row['id'],
241
+                ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'],
242
+                'index.php?a=112&id='.$row['id'],
243 243
                 $row['name'],
244 244
                 '',
245 245
                 '',
@@ -254,11 +254,11 @@  discard block
 block discarded – undo
254 254
 
255 255
 // security menu items (users)
256 256
 
257
-if($modx->hasPermission('edit_user')) {
257
+if ($modx->hasPermission('edit_user')) {
258 258
 	$sitemenu['user_management_title'] = array(
259 259
 		'user_management_title',
260 260
 		'users',
261
-		'<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
261
+		'<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>',
262 262
 		'index.php?a=75',
263 263
 		$_lang['user_management_title'],
264 264
 		'',
@@ -270,11 +270,11 @@  discard block
 block discarded – undo
270 270
 	);
271 271
 }
272 272
 
273
-if($modx->hasPermission('edit_web_user')) {
273
+if ($modx->hasPermission('edit_web_user')) {
274 274
 	$sitemenu['web_user_management_title'] = array(
275 275
 		'web_user_management_title',
276 276
 		'users',
277
-		'<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
277
+		'<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>',
278 278
 		'index.php?a=99',
279 279
 		$_lang['web_user_management_title'],
280 280
 		'',
@@ -286,11 +286,11 @@  discard block
 block discarded – undo
286 286
 	);
287 287
 }
288 288
 
289
-if($modx->hasPermission('edit_role')) {
289
+if ($modx->hasPermission('edit_role')) {
290 290
 	$sitemenu['role_management_title'] = array(
291 291
 		'role_management_title',
292 292
 		'users',
293
-		'<i class="fa fa-legal"></i>' . $_lang['role_management_title'],
293
+		'<i class="fa fa-legal"></i>'.$_lang['role_management_title'],
294 294
 		'index.php?a=86',
295 295
 		$_lang['role_management_title'],
296 296
 		'',
@@ -302,11 +302,11 @@  discard block
 block discarded – undo
302 302
 	);
303 303
 }
304 304
 
305
-if($modx->hasPermission('access_permissions')) {
305
+if ($modx->hasPermission('access_permissions')) {
306 306
 	$sitemenu['manager_permissions'] = array(
307 307
 		'manager_permissions',
308 308
 		'users',
309
-		'<i class="fa fa-male"></i>' . $_lang['manager_permissions'],
309
+		'<i class="fa fa-male"></i>'.$_lang['manager_permissions'],
310 310
 		'index.php?a=40',
311 311
 		$_lang['manager_permissions'],
312 312
 		'',
@@ -318,11 +318,11 @@  discard block
 block discarded – undo
318 318
 	);
319 319
 }
320 320
 
321
-if($modx->hasPermission('web_access_permissions')) {
321
+if ($modx->hasPermission('web_access_permissions')) {
322 322
 	$sitemenu['web_permissions'] = array(
323 323
 		'web_permissions',
324 324
 		'users',
325
-		'<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'],
325
+		'<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'],
326 326
 		'index.php?a=91',
327 327
 		$_lang['web_permissions'],
328 328
 		'',
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 $sitemenu['refresh_site'] = array(
340 340
     'refresh_site',
341 341
     'tools',
342
-    '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'],
342
+    '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'],
343 343
     'index.php?a=26',
344 344
     $_lang['refresh_site'],
345 345
     '',
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             'a', // tag
354 354
             'javascript:;', // href
355 355
             'btn btn-secondary', // class or btn-success
356
-            'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
356
+            'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
357 357
             $_lang['refresh_site'], // title
358 358
             '<i class="fa fa-recycle"></i>' // innerHTML
359 359
         )
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 $sitemenu['search'] = array(
364 364
 	'search',
365 365
 	'tools',
366
-	'<i class="fa fa-search"></i>' . $_lang['search'],
366
+	'<i class="fa fa-search"></i>'.$_lang['search'],
367 367
 	'index.php?a=71',
368 368
 	$_lang['search'],
369 369
 	'',
@@ -374,11 +374,11 @@  discard block
 block discarded – undo
374 374
 	''
375 375
 );
376 376
 
377
-if($modx->hasPermission('bk_manager')) {
377
+if ($modx->hasPermission('bk_manager')) {
378 378
 	$sitemenu['bk_manager'] = array(
379 379
 		'bk_manager',
380 380
 		'tools',
381
-		'<i class="fa fa-database"></i>' . $_lang['bk_manager'],
381
+		'<i class="fa fa-database"></i>'.$_lang['bk_manager'],
382 382
 		'index.php?a=93',
383 383
 		$_lang['bk_manager'],
384 384
 		'',
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
 	);
391 391
 }
392 392
 
393
-if($modx->hasPermission('remove_locks')) {
393
+if ($modx->hasPermission('remove_locks')) {
394 394
 	$sitemenu['remove_locks'] = array(
395 395
 		'remove_locks',
396 396
 		'tools',
397
-		'<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'],
397
+		'<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'],
398 398
 		'javascript:modx.removeLocks();',
399 399
 		$_lang['remove_locks'],
400 400
 		'',
@@ -406,11 +406,11 @@  discard block
 block discarded – undo
406 406
 	);
407 407
 }
408 408
 
409
-if($modx->hasPermission('import_static')) {
409
+if ($modx->hasPermission('import_static')) {
410 410
 	$sitemenu['import_site'] = array(
411 411
 		'import_site',
412 412
 		'tools',
413
-		'<i class="fa fa-upload"></i>' . $_lang['import_site'],
413
+		'<i class="fa fa-upload"></i>'.$_lang['import_site'],
414 414
 		'index.php?a=95',
415 415
 		$_lang['import_site'],
416 416
 		'',
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
 	);
423 423
 }
424 424
 
425
-if($modx->hasPermission('export_static')) {
425
+if ($modx->hasPermission('export_static')) {
426 426
 	$sitemenu['export_site'] = array(
427 427
 		'export_site',
428 428
 		'tools',
429
-		'<i class="fa fa-download"></i>' . $_lang['export_site'],
429
+		'<i class="fa fa-download"></i>'.$_lang['export_site'],
430 430
 		'index.php?a=83',
431 431
 		$_lang['export_site'],
432 432
 		'',
@@ -439,20 +439,20 @@  discard block
 block discarded – undo
439 439
 }
440 440
 
441 441
 $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu));
442
-if(is_array($menu)) {
442
+if (is_array($menu)) {
443 443
 	$newmenu = array();
444
-	foreach($menu as $item){
445
-		if(is_array(unserialize($item))){
444
+	foreach ($menu as $item) {
445
+		if (is_array(unserialize($item))) {
446 446
 			$newmenu = array_merge($newmenu, unserialize($item));
447 447
 		}
448 448
 	}
449
-	if(count($newmenu)> 0) $sitemenu = $newmenu;
449
+	if (count($newmenu) > 0) $sitemenu = $newmenu;
450 450
 }
451 451
 
452
-if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
453
-	include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
452
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) {
453
+	include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php');
454 454
 } else {
455
-	include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
455
+	include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php');
456 456
 }
457 457
 $menu = new EVOmenu();
458 458
 $menu->Build($sitemenu, array(
Please login to merge, or discard this patch.
manager/frames/tree.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (IN_MANAGER_MODE != "true") {
3 3
 	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 // invoke OnManagerTreeInit event
7 7
 $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
8
-if(is_array($evtOut)) {
8
+if (is_array($evtOut)) {
9 9
 	echo implode("\n", $evtOut);
10 10
 }
11 11
 ?>
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a>
19 19
 
20
-		<?php if($modx->hasPermission('new_document')) { ?>
20
+		<?php if ($modx->hasPermission('new_document')) { ?>
21 21
 			<a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a>
22 22
 			<a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a>
23 23
 		<?php } ?>
@@ -26,23 +26,23 @@  discard block
 block discarded – undo
26 26
 
27 27
 		<a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a>
28 28
 
29
-		<?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?>
29
+		<?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?>
30 30
 			<a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a>
31 31
 		<?php } ?>
32 32
 
33
-		<?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
34
-			<a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a>
33
+		<?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
34
+			<a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a>
35 35
 		<?php } ?>
36 36
 
37
-		<?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
38
-			<a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a>
37
+		<?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
38
+			<a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a>
39 39
 		<?php } ?>
40 40
 
41
-		<?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
42
-			<a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a>
41
+		<?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
42
+			<a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a>
43 43
 		<?php } ?>
44 44
 
45
-		<?php if($modx->hasPermission('empty_trash')) { ?>
45
+		<?php if ($modx->hasPermission('empty_trash')) { ?>
46 46
 			<a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a>
47 47
 		<?php } ?>
48 48
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		<?php
55 55
 		// invoke OnManagerTreePrerender event
56 56
 		$evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST));
57
-		if(is_array($evtOut)) {
57
+		if (is_array($evtOut)) {
58 58
 			echo implode("\n", $evtOut);
59 59
 		}
60 60
 		?>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		<?php
67 67
 		// invoke OnManagerTreeRender event
68 68
 		$evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST));
69
-		if(is_array($evtOut)) {
69
+		if (is_array($evtOut)) {
70 70
 			echo implode("\n", $evtOut);
71 71
 		}
72 72
 		?>
Please login to merge, or discard this patch.
manager/media/calendar/datepicker.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-class DATEPICKER {
4
-	function __construct() {
3
+class DATEPICKER{
4
+	function __construct(){
5 5
 	}
6 6
 
7
-	function getDP() {
7
+	function getDP(){
8 8
 		global $modx, $_lang;
9 9
 
10
-		$tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl');
10
+		$tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl');
11 11
 		return $modx->parseText($tpl, $_lang, '[%', '%]');
12 12
 	}
13 13
 }
Please login to merge, or discard this patch.