Completed
Pull Request — develop (#689)
by
unknown
07:48
created
manager/actions/welcome.static.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
 	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
4 4
 }
5 5
 
6 6
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,62 +16,62 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
19
+if ($modx->hasPermission('messages')) {
20
+	include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
23 23
 
24 24
 	$msg = array();
25 25
 	$msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
26
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : '';
26
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : '';
27 27
 	$msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold">&nbsp;<a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
28
-	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0';
28
+	$nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0';
29 29
 	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30 30
 	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31 31
 	$ph['MessageInfo'] = implode("\n", $msg);
32 32
 }
33 33
 
34 34
 // setup icons
35
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
35
+if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36 36
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37 37
 	$ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
39
+if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40 40
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41 41
 	$ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
43
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44 44
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45 45
 	$ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
47
+if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48 48
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49 49
 	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51
-if($modx->hasPermission('bk_manager')) {
51
+if ($modx->hasPermission('bk_manager')) {
52 52
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53 53
 	$ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55
-if($modx->hasPermission('help')) {
55
+if ($modx->hasPermission('help')) {
56 56
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57 57
 	$ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 
60
-if($modx->hasPermission('new_document')) {
60
+if ($modx->hasPermission('new_document')) {
61 61
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
62 62
 	$ph['ResourceIcon'] = wrapIcon($icon, 4);
63 63
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
64 64
 	$ph['WeblinkIcon'] = wrapIcon($icon, 72);
65 65
 }
66
-if($modx->hasPermission('assets_images')) {
66
+if ($modx->hasPermission('assets_images')) {
67 67
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
68 68
 	$ph['ImagesIcon'] = wrapIcon($icon, 72);
69 69
 }
70
-if($modx->hasPermission('assets_files')) {
70
+if ($modx->hasPermission('assets_files')) {
71 71
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
72 72
 	$ph['FilesIcon'] = wrapIcon($icon, 72);
73 73
 }
74
-if($modx->hasPermission('change_password')) {
74
+if ($modx->hasPermission('change_password')) {
75 75
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
76 76
 	$ph['PasswordIcon'] = wrapIcon($icon, 28);
77 77
 }
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
 $ph['LogoutIcon'] = wrapIcon($icon, 8);
80 80
 
81 81
 // do some config checks
82
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
84
-	if($config_check_results != $_lang['configcheck_ok']) {
82
+if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
+	include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php');
84
+	if ($config_check_results != $_lang['configcheck_ok']) {
85 85
 		$ph['config_check_results'] = $config_check_results;
86 86
 		$ph['config_display'] = 'block';
87 87
 	} else {
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 }
93 93
 
94 94
 // Check logout-reminder
95
-if(isset($_SESSION['show_logout_reminder'])) {
96
-	switch($_SESSION['show_logout_reminder']['type']) {
95
+if (isset($_SESSION['show_logout_reminder'])) {
96
+	switch ($_SESSION['show_logout_reminder']['type']) {
97 97
 		case 'logout_reminder':
98 98
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
99 99
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 	</tr>
148 148
 </table>';
149 149
 
150
-$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
150
+$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>';
151 151
 
152 152
 $ph['UserInfo'] = $modx->parseText($tpl, array(
153 153
 	'username' => $modx->getLoginUserName(),
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
163 163
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
164 164
 
165
-if($modx->db->getRecordCount($rs) < 1) {
165
+if ($modx->db->getRecordCount($rs) < 1) {
166 166
 	$html = '<p>[%no_active_users_found%]</p>';
167 167
 } else {
168
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
168
+	include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
169 169
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
170 170
 	$ph['now'] = strftime('%H:%M:%S', $now);
171 171
 	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	$userList = array();
191 191
 	$userCount = array();
192 192
 	// Create userlist with session-count first before output
193
-	while($activeusers = $modx->db->getRow($rs)) {
193
+	while ($activeusers = $modx->db->getRow($rs)) {
194 194
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
195 195
 
196 196
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 			$currentaction
209 209
 		);
210 210
 	}
211
-	foreach($userList as $params) {
211
+	foreach ($userList as $params) {
212 212
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
213
-		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
213
+		$html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
214 214
 	}
215 215
 
216 216
 	$html .= '
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 $ph['OnlineInfo'] = $html;
223 223
 
224 224
 // include rss feeds for important forum topics
225
-include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php');
225
+include_once(MODX_MANAGER_PATH.'includes/rss.inc.php');
226 226
 $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content'];
227 227
 $ph['modx_news_content'] = $feedData['modx_news_content'];
228 228
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 // invoke event OnManagerWelcomePrerender
255 255
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
256
-if(is_array($evtOut)) {
256
+if (is_array($evtOut)) {
257 257
 	$output = implode('', $evtOut);
258 258
 	$ph['OnManagerWelcomePrerender'] = $output;
259 259
 }
@@ -383,57 +383,57 @@  discard block
 block discarded – undo
383 383
 
384 384
 // invoke OnManagerWelcomeHome event
385 385
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
386
-if(is_array($sitewidgets)) {
386
+if (is_array($sitewidgets)) {
387 387
 	$newwidgets = array();
388
-    foreach($sitewidgets as $widget){
388
+    foreach ($sitewidgets as $widget) {
389 389
         $newwidgets = array_merge($newwidgets, unserialize($widget));
390 390
     }
391 391
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
392 392
 }
393 393
 
394
-usort($widgets, function ($a, $b) {
394
+usort($widgets, function($a, $b){
395 395
 	return $a['menuindex'] - $b['menuindex'];
396 396
 });
397 397
 
398 398
 $tpl = getTplWidget();
399 399
 $output = '';
400
-foreach($widgets as $widget) {
401
-	if ($widget['hide'] != '1'){
400
+foreach ($widgets as $widget) {
401
+	if ($widget['hide'] != '1') {
402 402
 		$output .= $modx->parseText($tpl, $widget);
403 403
 	}
404 404
 }
405 405
 $ph['widgets'] = $output;
406 406
 
407 407
 // load template
408
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
408
+if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
+	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl';
410 410
 }
411 411
 
412 412
 $target = $modx->config['manager_welcome_tpl'];
413 413
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
414 414
 $target = $modx->mergeSettingsContent($target);
415 415
 
416
-if(substr($target, 0, 1) === '@') {
417
-	if(substr($target, 0, 6) === '@CHUNK') {
416
+if (substr($target, 0, 1) === '@') {
417
+	if (substr($target, 0, 6) === '@CHUNK') {
418 418
 		$content = $modx->getChunk(trim(substr($target, 7)));
419
-	} elseif(substr($target, 0, 5) === '@FILE') {
419
+	} elseif (substr($target, 0, 5) === '@FILE') {
420 420
 		$content = file_get_contents(trim(substr($target, 6)));
421 421
 	} else {
422 422
 		$content = '';
423 423
 	}
424 424
 } else {
425 425
 	$chunk = $modx->getChunk($target);
426
-	if($chunk !== false && !empty($chunk)) {
426
+	if ($chunk !== false && !empty($chunk)) {
427 427
 		$content = $chunk;
428
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
429
-		$content = file_get_contents(MODX_BASE_PATH . $target);
430
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
431
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
432
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
428
+	} elseif (is_file(MODX_BASE_PATH.$target)) {
429
+		$content = file_get_contents(MODX_BASE_PATH.$target);
430
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
431
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl');
432
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible
433 433
 	{
434
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
434
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html');
435 435
 	} else {
436
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
436
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl');
437 437
 	}
438 438
 }
439 439
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 $content = $modx->mergeConditionalTagsContent($content);
442 442
 $content = $modx->mergeSettingsContent($content);
443 443
 $content = $modx->parseText($content, $ph);
444
-if(strpos($content, '[+') !== false) {
444
+if (strpos($content, '[+') !== false) {
445 445
 	$modx->toPlaceholders($ph);
446 446
 	$content = $modx->mergePlaceholderContent($content);
447 447
 }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 $content = $modx->parseText($content, $_style, '[&', '&]');
451 451
 $content = $modx->cleanUpMODXTags($content); //cleanup
452 452
 
453
-if($js = $modx->getRegisteredClientScripts()) {
453
+if ($js = $modx->getRegisteredClientScripts()) {
454 454
 	$content .= $js;
455 455
 }
456 456
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
 //	<a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a>
461 461
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
462 462
 //</span>
463
-function getTplWidget() { // recent document info
463
+function getTplWidget(){ // recent document info
464 464
 	return '
465 465
 		<div class="[+cols+]" id="[+id+]">
466 466
 			<div class="card"[+cardAttr+]>
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 ';
472 472
 }
473 473
 
474
-function getRecentInfo() { // recent document info
474
+function getRecentInfo(){ // recent document info
475 475
 	global $modx;
476 476
 
477 477
 	$modx->addSnippet('recentInfoList', 'getRecentInfoList');
@@ -497,12 +497,12 @@  discard block
 block discarded – undo
497 497
 	return $html;
498 498
 }
499 499
 
500
-function getRecentInfoList() {
500
+function getRecentInfoList(){
501 501
 	global $modx;
502 502
 
503 503
 	$rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
504 504
 
505
-	if($modx->db->getRecordCount($rs) < 1) {
505
+	if ($modx->db->getRecordCount($rs) < 1) {
506 506
 		return '<tr><td>[%no_activity_message%]</td></tr>';
507 507
 	}
508 508
 
@@ -512,20 +512,20 @@  discard block
 block discarded – undo
512 512
 	$btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
513 513
 
514 514
 	$output = array();
515
-	while($ph = $modx->db->getRow($rs)) {
515
+	while ($ph = $modx->db->getRow($rs)) {
516 516
 		$docid = $ph['id'];
517 517
 		$_ = $modx->getUserInfo($ph['editedby']);
518 518
 		$ph['username'] = $_['username'];
519 519
 
520
-		if($ph['deleted'] == 1) {
520
+		if ($ph['deleted'] == 1) {
521 521
 			$ph['status'] = 'deleted text-danger';
522
-		} elseif($ph['published'] == 0) {
522
+		} elseif ($ph['published'] == 0) {
523 523
 			$ph['status'] = 'unpublished font-italic text-muted';
524 524
 		} else {
525 525
 			$ph['status'] = 'published';
526 526
 		}
527 527
 
528
-		if($modx->hasPermission('edit_document')) {
528
+		if ($modx->hasPermission('edit_document')) {
529 529
 			$ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
530 530
 		} else {
531 531
 			$ph['edit_btn'] = '';
@@ -540,8 +540,8 @@  discard block
 block discarded – undo
540 540
 			$preview_disabled
541 541
 		), $btntpl['preview_btn']);
542 542
 
543
-		if($modx->hasPermission('delete_document')) {
544
-			if($ph['deleted'] == 0) {
543
+		if ($modx->hasPermission('delete_document')) {
544
+			if ($ph['deleted'] == 0) {
545 545
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
546 546
 			} else {
547 547
 				$delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
@@ -551,11 +551,11 @@  discard block
 block discarded – undo
551 551
 			$ph['delete_btn'] = '';
552 552
 		}
553 553
 
554
-		if($ph['deleted'] == 1 && $ph['published'] == 0) {
554
+		if ($ph['deleted'] == 1 && $ph['published'] == 0) {
555 555
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
556
-		} elseif($ph['deleted'] == 1 && $ph['published'] == 1) {
556
+		} elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
557 557
 			$publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
558
-		} elseif($ph['deleted'] == 0 && $ph['published'] == 0) {
558
+		} elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
559 559
 			$publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
560 560
 		} else {
561 561
 			$publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
@@ -564,16 +564,16 @@  discard block
 block discarded – undo
564 564
 
565 565
 		$ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
566 566
 
567
-		if($ph['longtitle'] == '') {
567
+		if ($ph['longtitle'] == '') {
568 568
 			$ph['longtitle'] = '(<i>[%not_set%]</i>)';
569 569
 		}
570
-		if($ph['description'] == '') {
570
+		if ($ph['description'] == '') {
571 571
 			$ph['description'] = '(<i>[%not_set%]</i>)';
572 572
 		}
573
-		if($ph['introtext'] == '') {
573
+		if ($ph['introtext'] == '') {
574 574
 			$ph['introtext'] = '(<i>[%not_set%]</i>)';
575 575
 		}
576
-		if($ph['alias'] == '') {
576
+		if ($ph['alias'] == '') {
577 577
 			$ph['alias'] = '(<i>[%not_set%]</i>)';
578 578
 		}
579 579
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	return implode("\n", $output);
583 583
 }
584 584
 
585
-function getRecentInfoRowTpl() {
585
+function getRecentInfoRowTpl(){
586 586
 	$tpl = '
587 587
 						<tr>
588 588
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
 }
612 612
 
613 613
 // setup icons
614
-function wrapIcon($i, $action) {
614
+function wrapIcon($i, $action){
615 615
 	return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
616 616
 }
617 617
 
618
-function getStartUpScript() {
618
+function getStartUpScript(){
619 619
 	$script = '
620 620
         <script type="text/javascript">
621 621
         function hideConfigCheckWarning(key) {
Please login to merge, or discard this patch.
manager/processors/login.processor.php 1 patch
Spacing   +62 added lines, -62 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(!in_array($day,explode(',',$allowed_days))) {
150
+	if (!in_array($day, explode(',', $allowed_days))) {
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,25 +218,25 @@  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') {
232
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
231
+if ($rememberme == '1') {
232
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
233 233
 
234 234
 	// Set a cookie separate from the session cookie with the username in it.
235 235
 	// Are we using secure connection? If so, make sure the cookie is secure
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
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
 
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
-$id = (int)$modx->db->getValue($rs);
278
-if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
277
+$id = (int) $modx->db->getValue($rs);
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);
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
  *
297 297
  * @param string $msg
298 298
  */
299
-function jsAlert($msg) {
299
+function jsAlert($msg){
300 300
 	global $modx;
301
-	if($_POST['ajax'] != 1) {
302
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
301
+	if ($_POST['ajax'] != 1) {
302
+		echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
303 303
 	} else {
304
-		echo $msg . "\n";
304
+		echo $msg."\n";
305 305
 	}
306 306
 }
307 307
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
  * @param string $dbasePassword
312 312
  * @return bool
313 313
  */
314
-function login($username, $givenPassword, $dbasePassword) {
314
+function login($username, $givenPassword, $dbasePassword){
315 315
 	global $modx;
316 316
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
317 317
 }
@@ -323,21 +323,21 @@  discard block
 block discarded – undo
323 323
  * @param string $username
324 324
  * @return bool
325 325
  */
326
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
326
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username){
327 327
 	global $modx;
328 328
 
329 329
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
330 330
 
331
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
331
+	if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
332 332
 		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
333 333
 	}
334 334
 
335
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
335
+	if ($user_algo !== $modx->config['pwd_hash_algo']) {
336 336
 		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
337 337
 		$modx->config['pwd_hash_algo'] = $user_algo;
338 338
 	}
339 339
 
340
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
340
+	if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
341 341
 		return false;
342 342
 	}
343 343
 
@@ -353,10 +353,10 @@  discard block
 block discarded – undo
353 353
  * @param string $username
354 354
  * @return bool
355 355
  */
356
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
356
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){
357 357
 	global $modx;
358 358
 
359
-	if($dbasePassword != md5($givenPassword)) {
359
+	if ($dbasePassword != md5($givenPassword)) {
360 360
 		return false;
361 361
 	}
362 362
 	updateNewHash($username, $givenPassword);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
  * @param string $username
368 368
  * @param string $password
369 369
  */
370
-function updateNewHash($username, $password) {
370
+function updateNewHash($username, $password){
371 371
 	global $modx;
372 372
 
373 373
 	$field = array();
@@ -381,23 +381,23 @@  discard block
 block discarded – undo
381 381
  * @param int $failed_allowed
382 382
  * @param int $blocked_minutes
383 383
  */
384
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
384
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){
385 385
 	global $modx;
386 386
 
387 387
 	$failedlogins += 1;
388 388
 
389 389
 	$fields = array('failedlogincount' => $failedlogins);
390
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
390
+	if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
391 391
 	{
392 392
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393 393
 	}
394 394
 
395 395
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396 396
 
397
-	if($failedlogins < $failed_allowed) {
397
+	if ($failedlogins < $failed_allowed) {
398 398
 		//sleep to help prevent brute force attacks
399 399
 		$sleep = (int) $failedlogins / 2;
400
-		if($sleep > 5) {
400
+		if ($sleep > 5) {
401 401
 			$sleep = 5;
402 402
 		}
403 403
 		sleep($sleep);
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 header("X-XSS-Protection: 0");
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49 49
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
50
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
51 51
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
52
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
@@ -82,36 +82,36 @@  discard block
 block discarded – undo
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
85
+$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime;
86 86
 
87 87
 if ($modx->config['manager_theme'] == 'default') {
88
-    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')) {
89
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
88
+    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')) {
89
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
92
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
93
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
94
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
95
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
96
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
97
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
98
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
99
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
100
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
101
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
91
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css');
92
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css');
93
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css');
94
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css');
95
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css');
96
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css');
97
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css');
98
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css');
99
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css');
100
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css');
101
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css');
102 102
         $css = $minifier->minify();
103
-        file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
103
+        file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
105
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
106
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
107 107
     }
108 108
 }
109 109
 
110
-$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')));
110
+$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')));
111 111
 
112 112
 ?>
113 113
 <!DOCTYPE html>
114
-<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>>
114
+<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>>
115 115
 <head>
116 116
     <title><?= $site_name ?>- (EVO CMS Manager)</title>
117 117
     <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" />
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
         MODX_SITE_URL: '<?= MODX_SITE_URL ?>',
143 143
         MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>',
144 144
         user: {
145
-          role: <?= (int)$user['role'] ?>,
145
+          role: <?= (int) $user['role'] ?>,
146 146
           username: '<?= $user['username'] ?>'
147 147
         },
148 148
         config: {
149 149
           mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>,
150
-          menu_height: <?= (int)$menu_height ?>,
151
-          tree_width: <?= (int)$tree_width ?>,
152
-          tree_min_width: <?= (int)$tree_min_width ?>,
153
-          session_timeout: <?= (int)$modx->config['session_timeout'] ?>,
154
-          site_start: <?= (int)$modx->config['site_start'] ?>,
155
-          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>,
150
+          menu_height: <?= (int) $menu_height ?>,
151
+          tree_width: <?= (int) $tree_width ?>,
152
+          tree_min_width: <?= (int) $tree_min_width ?>,
153
+          session_timeout: <?= (int) $modx->config['session_timeout'] ?>,
154
+          site_start: <?= (int) $modx->config['site_start'] ?>,
155
+          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>,
156 156
           theme: '<?= $modx->config['manager_theme'] ?>',
157 157
           theme_mode: '<?= $modx->config['manager_theme_mode'] ?>',
158 158
           which_browser: '<?= $user['which_browser'] ?>',
159
-          layout: <?= (int)$manager_layout ?>,
159
+          layout: <?= (int) $manager_layout ?>,
160 160
           textdir: '<?= $modx_textdir ?>',
161 161
           global_tabs: <?= $modx->config['global_tabs'] ?>
162 162
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
           delete a[b];
242 242
         },
243 243
         openedArray: [],
244
-        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
244
+        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?>
245 245
       };
246 246
       <?php
247 247
       $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
248
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
248
+      echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n		modx.openedArray[", $opened).'] = 1;')."\n";
249 249
       ?>
250 250
     </script>
251 251
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
328 328
                                 <span class="username"><?= $user['username'] ?></span>
329 329
                                 <?php if ($user['photo']) { ?>
330
-                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
330
+                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span>
331 331
                                 <?php } else { ?>
332 332
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
333 333
                                 <?php } ?>
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                                 $version = 'Evolution';
355 355
                                 ?>
356 356
                                 <?php
357
-                                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']);
357
+                                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']);
358 358
                                 ?>
359 359
                             </ul>
360 360
                         </li>
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
      */
538 538
     function constructLink($action, $img, $text, $allowed)
539 539
     {
540
-        if ((bool)$allowed) {
540
+        if ((bool) $allowed) {
541 541
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
542 542
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
543 543
         }
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
     <script type="text/javascript">
549 549
 
550 550
       if (document.getElementById('treeMenu')) {
551
-          <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
551
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
552 552
 
553 553
         document.getElementById('treeMenu_openelements').onclick = function(e) {
554 554
           e.preventDefault();
@@ -566,12 +566,12 @@  discard block
 block discarded – undo
566 566
           }
567 567
         };
568 568
           <?php } ?>
569
-          <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
569
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
570 570
 
571 571
         document.getElementById('treeMenu_openimages').onclick = function(e) {
572 572
           e.preventDefault();
573 573
           if (modx.config.global_tabs && !e.shiftKey) {
574
-            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"] ?>'});
574
+            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"] ?>'});
575 575
           } else {
576 576
             var randomNum = '<?= $_lang["files_files"] ?>';
577 577
             if (e.shiftKey) {
@@ -584,12 +584,12 @@  discard block
 block discarded – undo
584 584
           }
585 585
         };
586 586
           <?php } ?>
587
-          <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
587
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
588 588
 
589 589
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
590 590
           e.preventDefault();
591 591
           if (modx.config.global_tabs && !e.shiftKey) {
592
-            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"] ?>'});
592
+            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"] ?>'});
593 593
           } else {
594 594
             var randomNum = '<?= $_lang["files_files"] ?>';
595 595
             if (e.shiftKey) {
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 
644 644
 </div>
645 645
 <?php if ($modx->config['show_picker'] != "0") {
646
-    include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
646
+    include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
647 647
 } ?>
648 648
 </body>
649 649
 </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-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>',
24
+	'<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$_lang['home'].'</span>',
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><span class="menu-item-text">' . $_lang['elements'] . '</span>',
39
+		'<i class="fa fa-th"></i><span class="menu-item-text">'.$_lang['elements'].'</span>',
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><span class="menu-item-text">' . $_lang['modules'] . '</span>',
55
+		'<i class="'.$_style['icons_modules'].'"></i><span class="menu-item-text">'.$_lang['modules'].'</span>',
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><span class="menu-item-text">' . $_lang['users'] . '</span>',
71
+		'<i class="fa fa-users"></i><span class="menu-item-text">'.$_lang['users'].'</span>',
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><span class="menu-item-text">' . $_lang['tools'] . '</span>',
87
+		'<i class="fa fa-wrench"></i><span class="menu-item-text">'.$_lang['tools'].'</span>',
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/actions/mutate_settings/tab1_site_settings.inc.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@  discard block
 block discarded – undo
13 13
   <tr>
14 14
     <th><?php echo $_lang['sitestatus_title'] ?><br><small>[(site_status)]</small></th>
15 15
     <td>
16
-        <?php echo wrap_label($_lang['online'],  form_radio('site_status', 1));?><br />
17
-        <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0));?>
16
+        <?php echo wrap_label($_lang['online'], form_radio('site_status', 1)); ?><br />
17
+        <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0)); ?>
18 18
     </td>
19 19
   </tr>
20 20
   <tr>
@@ -58,12 +58,12 @@  discard block
 block discarded – undo
58 58
       <br />
59 59
       <p><?php echo $_lang['update_settings_from_language']; ?></p>
60 60
       <select name="reload_site_unavailable" id="reload_site_unavailable_select" onchange="confirmLangChange(this, 'siteunavailable_message_default', 'site_unavailable_message_textarea');">
61
-<?php echo get_lang_options('siteunavailable_message_default');?>
61
+<?php echo get_lang_options('siteunavailable_message_default'); ?>
62 62
       </select>
63 63
     </th>
64 64
     <td> <textarea name="site_unavailable_message" id="site_unavailable_message_textarea" style="width:100%; height: 120px;"><?php echo $site_unavailable_message_view; ?></textarea>
65
-        <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']);?>" />
66
-  <div class="comment"><?php echo $_lang['siteunavailable_message'];?></div>
65
+        <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']); ?>" />
66
+  <div class="comment"><?php echo $_lang['siteunavailable_message']; ?></div>
67 67
     </td>
68 68
   </tr>
69 69
   <tr>
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
             'c.category, t.templatename ASC'
79 79
             );
80 80
     ?>
81
-      <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template;?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px">
81
+      <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template; ?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px">
82 82
         <?php
83 83
         
84 84
         $currentCategory = '';
85 85
                         while ($row = $modx->db->getRow($rs)) {
86 86
             $thisCategory = $row['category'];
87
-            if($thisCategory == null) {
87
+            if ($thisCategory == null) {
88 88
                 $thisCategory = $_lang['no_category'];
89 89
             }
90
-            if($thisCategory != $currentCategory) {
91
-                if($closeOptGroup) {
90
+            if ($thisCategory != $currentCategory) {
91
+                if ($closeOptGroup) {
92 92
                     echo "\t\t\t\t\t</optgroup>\n";
93 93
                 }
94 94
                 echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n";
107 107
             $currentCategory = $thisCategory;
108 108
         }
109
-        if($thisCategory != '') {
109
+        if ($thisCategory != '') {
110 110
             echo "\t\t\t\t\t</optgroup>\n";
111 111
         }
112 112
 ?>
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
           <br />
115 115
         <div id="template_reset_options_wrapper" style="display:none;">
116 116
             <label><input type="radio" name="reset_template" value="1" /> <?php echo $_lang['template_reset_all']; ?></label><br />
117
-            <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'],$oldTmpName); ?></label>
117
+            <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'], $oldTmpName); ?></label>
118 118
         </div>
119 119
         <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" />
120 120
   <div class="comment"><?php echo $_lang['defaulttemplate_message'] ?></div>
121 121
     </td>
122 122
   </tr>
123 123
   <tr>
124
-        <th><?php echo $_lang['defaulttemplate_logic_title'];?><br><small>[(auto_template_logic)]</small></th>
124
+        <th><?php echo $_lang['defaulttemplate_logic_title']; ?><br><small>[(auto_template_logic)]</small></th>
125 125
         <td>
126
-            <p><?php echo $_lang['defaulttemplate_logic_general_message'];?></p>
127
-            <label><input type="radio" name="auto_template_logic" value="system"<?php if($auto_template_logic == 'system') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br />
128
-            <label><input type="radio" name="auto_template_logic" value="parent"<?php if($auto_template_logic == 'parent') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br />
129
-            <label><input type="radio" name="auto_template_logic" value="sibling"<?php if($auto_template_logic == 'sibling') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br />
126
+            <p><?php echo $_lang['defaulttemplate_logic_general_message']; ?></p>
127
+            <label><input type="radio" name="auto_template_logic" value="system"<?php if ($auto_template_logic == 'system') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br />
128
+            <label><input type="radio" name="auto_template_logic" value="parent"<?php if ($auto_template_logic == 'parent') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br />
129
+            <label><input type="radio" name="auto_template_logic" value="sibling"<?php if ($auto_template_logic == 'sibling') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br />
130 130
         </td>
131 131
     </tr>
132 132
     <tr>
@@ -138,22 +138,22 @@  discard block
 block discarded – undo
138 138
               $modx->db->select('id', '[+prefix+]site_plugins', 
139 139
               "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1")
140 140
             );
141
-            if($count) {
141
+            if ($count) {
142 142
                 $disabledFilters = 1;
143 143
                 echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>';
144 144
             }
145 145
             else $disabledFilters = false;
146 146
         ?>
147
-        <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br />
148
-        <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?>
147
+        <?php echo wrap_label($_lang['yes'], form_radio('enable_filter', 1, '', $disabledFilters)); ?><br />
148
+        <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters)); ?>
149 149
         <div class="comment"><?php echo $_lang['enable_filter_message']; ?></div>
150 150
       </td>
151 151
     </tr>
152 152
     <tr>
153 153
       <th><?php echo $_lang['enable_at_syntax_title'] ?><br><small>[(enable_at_syntax)]</small></th>
154 154
       <td >
155
-        <?php echo wrap_label($_lang['yes'],form_radio('enable_at_syntax', 1));?><br />
156
-        <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0));?>
155
+        <?php echo wrap_label($_lang['yes'], form_radio('enable_at_syntax', 1)); ?><br />
156
+        <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0)); ?>
157 157
         <div class="comment">
158 158
             <?php echo $_lang['enable_at_syntax_message']; ?>
159 159
             <ul>
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
   <tr>
168 168
     <th><?php echo $_lang['defaultpublish_title'] ?><br><small>[(publish_default)]</small></th>
169 169
     <td>
170
-        <?php echo wrap_label($_lang['yes'],form_radio('publish_default', 1));?><br />
171
-        <?php echo wrap_label($_lang['no'],form_radio('publish_default', 0));?>
170
+        <?php echo wrap_label($_lang['yes'], form_radio('publish_default', 1)); ?><br />
171
+        <?php echo wrap_label($_lang['no'], form_radio('publish_default', 0)); ?>
172 172
         <div class="comment"><?php echo $_lang['defaultpublish_message'] ?></div>
173 173
     </td>
174 174
   </tr>
@@ -176,24 +176,24 @@  discard block
 block discarded – undo
176 176
   <tr>
177 177
     <th><?php echo $_lang['defaultcache_title'] ?><br><small>[(cache_default)]</small></th>
178 178
     <td>
179
-        <?php echo wrap_label($_lang['yes'],form_radio('cache_default', 1));?><br />
180
-        <?php echo wrap_label($_lang['no'],form_radio('cache_default', 0));?>
179
+        <?php echo wrap_label($_lang['yes'], form_radio('cache_default', 1)); ?><br />
180
+        <?php echo wrap_label($_lang['no'], form_radio('cache_default', 0)); ?>
181 181
         <div class="comment"><?php echo $_lang['defaultcache_message'] ?></div>
182 182
     </td>
183 183
   </tr>
184 184
   <tr>
185 185
     <th><?php echo $_lang['defaultsearch_title'] ?><br><small>[(search_default)]</small></th>
186 186
     <td>
187
-        <?php echo wrap_label($_lang['yes'],form_radio('search_default', 1));?><br />
188
-        <?php echo wrap_label($_lang['no'],form_radio('search_default', 0));?>
187
+        <?php echo wrap_label($_lang['yes'], form_radio('search_default', 1)); ?><br />
188
+        <?php echo wrap_label($_lang['no'], form_radio('search_default', 0)); ?>
189 189
         <div class="comment"><?php echo $_lang['defaultsearch_message'] ?></div>
190 190
     </td>
191 191
   </tr>
192 192
   <tr>
193 193
     <th><?php echo $_lang['defaultmenuindex_title'] ?><br><small>[(auto_menuindex)]</small></th>
194 194
     <td>
195
-        <?php echo wrap_label($_lang['yes'],form_radio('auto_menuindex', 1));?><br />
196
-        <?php echo wrap_label($_lang['no'],form_radio('auto_menuindex', 0));?>
195
+        <?php echo wrap_label($_lang['yes'], form_radio('auto_menuindex', 1)); ?><br />
196
+        <?php echo wrap_label($_lang['no'], form_radio('auto_menuindex', 0)); ?>
197 197
         <div class="comment"><?php echo $_lang['defaultmenuindex_message'] ?></div>
198 198
     </td>
199 199
   </tr>
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
     <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top">
204 204
     <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5">
205 205
     <?php
206
-        $ct = explode(",",$custom_contenttype);
207
-        for($i=0;$i<count($ct);$i++) {
206
+        $ct = explode(",", $custom_contenttype);
207
+        for ($i = 0; $i < count($ct); $i++) {
208 208
             echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>";
209 209
         }
210 210
     ?>
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 <th><?php echo $_lang['docid_incrmnt_method_title'] ?><br><small>[(docid_incrmnt_method)]</small></th>
219 219
 <td>
220 220
 <label><input type="radio" name="docid_incrmnt_method" value="0"
221
-    <?php echo ($docid_incrmnt_method=='0') ? 'checked="checked"' : "" ; ?> />
221
+    <?php echo ($docid_incrmnt_method == '0') ? 'checked="checked"' : ""; ?> />
222 222
     <?php echo $_lang['docid_incrmnt_method_0']?></label><br />
223 223
     
224 224
 <label><input type="radio" name="docid_incrmnt_method" value="1"
225
-    <?php echo ($docid_incrmnt_method=='1') ? 'checked="checked"' : "" ; ?> />
225
+    <?php echo ($docid_incrmnt_method == '1') ? 'checked="checked"' : ""; ?> />
226 226
     <?php echo $_lang['docid_incrmnt_method_1']?></label><br />
227 227
 <label><input type="radio" name="docid_incrmnt_method" value="2"
228
-    <?php echo ($docid_incrmnt_method=='2') ? 'checked="checked"' : "" ; ?> />
228
+    <?php echo ($docid_incrmnt_method == '2') ? 'checked="checked"' : ""; ?> />
229 229
     <?php echo $_lang['docid_incrmnt_method_2']?></label><br />
230 230
 </td>
231 231
 </tr>
@@ -233,24 +233,24 @@  discard block
 block discarded – undo
233 233
 <tr>
234 234
 <th><?php echo $_lang['enable_cache_title'] ?><br><small>[(enable_cache)]</small></th>
235 235
 <td>
236
-    <?php echo wrap_label($_lang['enabled'],form_radio('enable_cache', 1));?><br />
237
-    <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0));?><br />
238
-    <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2));?>
236
+    <?php echo wrap_label($_lang['enabled'], form_radio('enable_cache', 1)); ?><br />
237
+    <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0)); ?><br />
238
+    <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2)); ?>
239 239
 </td>
240 240
 </tr>
241 241
 
242 242
 <tr>
243 243
 <th><?php echo $_lang['cache_type_title'] ?><br><small>[(cache_type)]</small></th>
244 244
 <td>
245
-<?php echo wrap_label($_lang['cache_type_1'],form_radio('cache_type', 1));?><br />
246
-<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2));?>
245
+<?php echo wrap_label($_lang['cache_type_1'], form_radio('cache_type', 1)); ?><br />
246
+<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2)); ?>
247 247
 </td>
248 248
 </tr>
249 249
   <tr>
250 250
 <th><?php echo $_lang['minifyphp_incache_title'] ?><br><small>[(minifyphp_incache)]</small></th>
251 251
     <td>
252
-<?php echo wrap_label($_lang['enabled'],form_radio('minifyphp_incache', 1));?><br />
253
-<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0));?>
252
+<?php echo wrap_label($_lang['enabled'], form_radio('minifyphp_incache', 1)); ?><br />
253
+<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0)); ?>
254 254
 <div class="comment"><?php echo $_lang['minifyphp_incache_message'] ?></div>
255 255
     </td>
256 256
   </tr>
@@ -259,23 +259,23 @@  discard block
 block discarded – undo
259 259
       <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th>
260 260
       <td> <select name="server_offset_time" size="1" class="inputBox">
261 261
           <?php
262
-      for($i=-24; $i<25; $i++) {
263
-          $seconds = $i*60*60;
264
-          $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ;
262
+      for ($i = -24; $i < 25; $i++) {
263
+          $seconds = $i * 60 * 60;
264
+          $selectedtext = $seconds == $server_offset_time ? "selected='selected'" : "";
265 265
       ?>
266 266
           <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option>
267 267
           <?php
268 268
       }
269 269
       ?>
270 270
         </select>
271
-        <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div>
271
+        <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time() + $server_offset_time)); ?></div>
272 272
         </td>
273 273
     </tr>
274 274
     <tr>
275 275
       <th><?php echo $_lang['server_protocol_title'] ?><br><small>[(server_protocol)]</small></th>
276 276
       <td>
277
-        <?php echo wrap_label($_lang['server_protocol_http'],form_radio('server_protocol', 'http'));?><br />
278
-        <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https'));?>
277
+        <?php echo wrap_label($_lang['server_protocol_http'], form_radio('server_protocol', 'http')); ?><br />
278
+        <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https')); ?>
279 279
         <div class="comment"><?php echo $_lang['server_protocol_message'] ?></div>
280 280
       </td>
281 281
     </tr>
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
     <tr>
289 289
      <th><?php echo $_lang['track_visitors_title'] ?><br><small>[(track_visitors)]</small></th>
290 290
      <td>
291
-         <?php echo wrap_label($_lang['yes'],form_radio('track_visitors', 1));?><br />
292
-         <?php echo wrap_label($_lang['no'],form_radio('track_visitors', 0));?>
291
+         <?php echo wrap_label($_lang['yes'], form_radio('track_visitors', 1)); ?><br />
292
+         <?php echo wrap_label($_lang['no'], form_radio('track_visitors', 0)); ?>
293 293
          <div class="comment"><?php echo $_lang['track_visitors_message'] ?></div>
294 294
      </td>
295 295
    </tr>
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         <?php
302 302
             // invoke OnSiteSettingsRender event
303 303
             $evtOut = $modx->invokeEvent('OnSiteSettingsRender');
304
-            if(is_array($evtOut)) echo implode("",$evtOut);
304
+            if (is_array($evtOut)) echo implode("", $evtOut);
305 305
         ?>
306 306
     </td>
307 307
   </tr>
Please login to merge, or discard this patch.
manager/actions/mutate_settings/tab4_manager_settings.inc.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                             }
57 57
                             $themename = $file;
58 58
                             $selectedtext = $themename == $manager_theme ? "selected='selected'" : "";
59
-                            echo "<option value='$themename' $selectedtext>" . ucwords(str_replace("_", " ", $themename)) . "</option>";
59
+                            echo "<option value='$themename' $selectedtext>".ucwords(str_replace("_", " ", $themename))."</option>";
60 60
                         }
61 61
                     }
62 62
                     $dir->close();
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             function BrowseServer() {
125 125
               var w = screen.width * 0.7;
126 126
               var h = screen.height * 0.7;
127
-              OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
127
+              OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
128 128
             }
129 129
 
130 130
             function SetUrl(url, width, height, alt) {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             function BrowseServer() {
163 163
               var w = screen.width * 0.7;
164 164
               var h = screen.height * 0.7;
165
-              OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
165
+              OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
166 166
             }
167 167
 
168 168
             function SetUrl(url, width, height, alt) {
@@ -180,9 +180,9 @@  discard block
 block discarded – undo
180 180
       <tr>
181 181
         <th><?php echo $_lang['login_form_position_title'] ?><br><small>[(login_form_position)]</small></th>
182 182
         <td>
183
-            <?php echo wrap_label($_lang['login_form_position_left'],form_radio('login_form_position', 'left'));?><br />
184
-            <?php echo wrap_label($_lang['login_form_position_center'], form_radio('login_form_position', 'center'));?><br />
185
-            <?php echo wrap_label($_lang['login_form_position_right'], form_radio('login_form_position', 'right'));?>
183
+            <?php echo wrap_label($_lang['login_form_position_left'], form_radio('login_form_position', 'left')); ?><br />
184
+            <?php echo wrap_label($_lang['login_form_position_center'], form_radio('login_form_position', 'center')); ?><br />
185
+            <?php echo wrap_label($_lang['login_form_position_right'], form_radio('login_form_position', 'right')); ?>
186 186
         </td>
187 187
       </tr>
188 188
          <tr>
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
       <tr>
195 195
         <th><?php echo $_lang['manager_menu_position_title'] ?><br><small>[(manager_menu_position)]</small></th>
196 196
         <td>
197
-            <?php echo wrap_label($_lang['manager_menu_position_top'],form_radio('manager_menu_position', 'top'));?><br />
198
-            <?php echo wrap_label($_lang['manager_menu_position_left'], form_radio('manager_menu_position', 'left'));?><br />
197
+            <?php echo wrap_label($_lang['manager_menu_position_top'], form_radio('manager_menu_position', 'top')); ?><br />
198
+            <?php echo wrap_label($_lang['manager_menu_position_left'], form_radio('manager_menu_position', 'left')); ?><br />
199 199
         </td>
200 200
       </tr>
201 201
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             <td>
338 338
                 <select name="group_tvs" size="1" class="form-control">
339 339
                     <?php
340
-                    $tpl = '<option value="[+value+]" [+selected+]>[+title+]</option>' . "\n";
340
+                    $tpl = '<option value="[+value+]" [+selected+]>[+title+]</option>'."\n";
341 341
                     $option = explode(',', $_lang['settings_group_tv_options']);
342 342
                     $output = array();
343 343
                     foreach ($option as $k => $v) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             <td>
411 411
                 <select name="resource_tree_node_name" size="1" class="inputBox">
412 412
                     <?php
413
-                    $tpl = '<option value="[+value+]" [+selected+]>[*[+value+]*]</option>' . "\n";
413
+                    $tpl = '<option value="[+value+]" [+selected+]>[*[+value+]*]</option>'."\n";
414 414
                     $option = array('pagetitle', 'longtitle', 'menutitle', 'alias', 'createdon', 'editedon', 'publishedon');
415 415
                     $output = array();
416 416
                     foreach ($option as $v) {
@@ -496,8 +496,8 @@  discard block
 block discarded – undo
496 496
                     $str = '';
497 497
                     foreach ($datetime_format_list as $value) {
498 498
                         $selectedtext = ($datetime_format == $value) ? ' selected' : '';
499
-                        $str .= '<option value="' . $value . '"' . $selectedtext . '>';
500
-                        $str .= $value . '</option>' . PHP_EOL;
499
+                        $str .= '<option value="'.$value.'"'.$selectedtext.'>';
500
+                        $str .= $value.'</option>'.PHP_EOL;
501 501
                     }
502 502
                     echo $str;
503 503
                     ?>
@@ -607,10 +607,10 @@  discard block
 block discarded – undo
607 607
                 <select name="which_editor" onChange="documentDirty=true;">
608 608
                     <?php
609 609
                     // invoke OnRichTextEditorRegister event
610
-                    echo "<option value='none'" . ($which_editor == 'none' ? " selected='selected'" : "") . ">" . $_lang['none'] . "</option>\n";
610
+                    echo "<option value='none'".($which_editor == 'none' ? " selected='selected'" : "").">".$_lang['none']."</option>\n";
611 611
                     if (is_array($evtOut)) {
612 612
                         foreach ($evtOut as $editor) {
613
-                            echo "<option value='$editor'" . ($which_editor == $editor ? " selected='selected'" : "") . ">$editor</option>\n";
613
+                            echo "<option value='$editor'".($which_editor == $editor ? " selected='selected'" : "").">$editor</option>\n";
614 614
                         }
615 615
                     }
616 616
                     ?>
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  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('exec_module')) {
5
+if (!$modx->hasPermission('exec_module')) {
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
 // check if user has access permission, except admins
15
-if($_SESSION['mgrRole']!=1){
15
+if ($_SESSION['mgrRole'] != 1) {
16 16
 	$rs = $modx->db->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getFullTableName("site_module_access")." sma
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 	$permissionAccessInt = -1;
25 25
 
26 26
 	while ($row = $modx->db->getRow($rs)) {
27
-		if($row["usergroup"] && $row["member"]) {
27
+		if ($row["usergroup"] && $row["member"]) {
28 28
 			//if there are permissions and this member has permission, ofcourse
29 29
 			//this is granted
30 30
 			$permissionAccessInt = 1;
31
-		} elseif ($permissionAccessInt==-1) {
31
+		} elseif ($permissionAccessInt == -1) {
32 32
 			//if there are permissions but this member has no permission and the
33 33
 			//variable was still in init state we set permission to 0; no permissions
34 34
 			$permissionAccessInt = 0;
35 35
 		}
36 36
 	}
37 37
 
38
-	if($permissionAccessInt==0) {
38
+	if ($permissionAccessInt == 0) {
39 39
 		$modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40 40
 	}
41 41
 }
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 // get module data
44 44
 $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'");
45 45
 $content = $modx->db->getRow($rs);
46
-if(!$content) {
46
+if (!$content) {
47 47
 	$modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
48 48
 }
49
-if($content['disabled']) {
49
+if ($content['disabled']) {
50 50
 	$modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
51 51
 }
52 52
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 $_SESSION['itemname'] = $content['name'];
61 61
 
62 62
 
63
-$output = evalModule($content["modulecode"],$parameter);
64
-if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) {
63
+$output = evalModule($content["modulecode"], $parameter);
64
+if (strpos(trim($output), '<') === 0 && strpos(trim($output), '<?xml') !== 0) {
65 65
 	echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
  * @param array $params
75 75
  * @return string
76 76
  */
77
-function evalModule($moduleCode,$params){
77
+function evalModule($moduleCode, $params){
78 78
 	global $modx;
79 79
 	$modx->event->params = &$params; // store params inside event object
80
-	if(is_array($params)) {
80
+	if (is_array($params)) {
81 81
 		extract($params, EXTR_SKIP);
82 82
 	}
83 83
 	ob_start();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	if (isset($php_errormsg))
88 88
 	{
89 89
 		$error_info = error_get_last();
90
-        switch($error_info['type'])
90
+        switch ($error_info['type'])
91 91
         {
92 92
         	case E_NOTICE :
93 93
         		$error_level = 1;
@@ -101,9 +101,9 @@  discard block
 block discarded – undo
101 101
         	default:
102 102
         		$error_level = 99;
103 103
         }
104
-		if($modx->config['error_reporting']==='99' || 2<$error_level)
104
+		if ($modx->config['error_reporting'] === '99' || 2 < $error_level)
105 105
 		{
106
-			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
106
+			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg);
107 107
 			$modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
108 108
 		}
109 109
 	}
Please login to merge, or discard this patch.
manager/includes/document.parser.class.inc.php 1 patch
Spacing   +244 added lines, -244 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
      */
206 206
     function __call($method_name, $arguments)
207 207
     {
208
-        include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php');
208
+        include_once(MODX_MANAGER_PATH.'includes/extenders/deprecated.functions.inc.php');
209 209
         if (method_exists($this->old, $method_name)) {
210 210
             $error_type = 1;
211 211
         } else {
@@ -223,12 +223,12 @@  discard block
 block discarded – undo
223 223
             $info = debug_backtrace();
224 224
             $m[] = $msg;
225 225
             if (!empty($this->currentSnippet)) {
226
-                $m[] = 'Snippet - ' . $this->currentSnippet;
226
+                $m[] = 'Snippet - '.$this->currentSnippet;
227 227
             } elseif (!empty($this->event->activePlugin)) {
228
-                $m[] = 'Plugin - ' . $this->event->activePlugin;
228
+                $m[] = 'Plugin - '.$this->event->activePlugin;
229 229
             }
230 230
             $m[] = $this->decoded_request_uri;
231
-            $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')';
231
+            $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')';
232 232
             $msg = implode('<br />', $m);
233 233
             $this->logEvent(0, $error_type, $msg, $title);
234 234
         }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     {
246 246
         $flag = false;
247 247
         if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) {
248
-            $flag = (bool)$this->{$connector}->conn;
248
+            $flag = (bool) $this->{$connector}->conn;
249 249
         }
250 250
         return $flag;
251 251
     }
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         }
273 273
         if (!$out && $flag) {
274 274
             $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname)));
275
-            $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php";
275
+            $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php";
276 276
             $out = is_file($filename) ? include $filename : false;
277 277
         }
278 278
         if ($out && !in_array($extname, $this->extensions)) {
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     public function getMicroTime()
290 290
     {
291 291
         list ($usec, $sec) = explode(' ', microtime());
292
-        return ((float)$usec + (float)$sec);
292
+        return ((float) $usec + (float) $sec);
293 293
     }
294 294
 
295 295
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             // append the redirect count string to the url
314 314
             $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0;
315 315
             if ($currentNumberOfRedirects > 3) {
316
-                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>');
316
+                $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>');
317 317
             } else {
318 318
                 $currentNumberOfRedirects += 1;
319 319
                 if (strpos($url, "?") > 0) {
@@ -324,9 +324,9 @@  discard block
 block discarded – undo
324 324
             }
325 325
         }
326 326
         if ($type == 'REDIRECT_REFRESH') {
327
-            $header = 'Refresh: 0;URL=' . $url;
327
+            $header = 'Refresh: 0;URL='.$url;
328 328
         } elseif ($type == 'REDIRECT_META') {
329
-            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />';
329
+            $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />';
330 330
             echo $header;
331 331
             exit;
332 332
         } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) {
@@ -334,10 +334,10 @@  discard block
 block discarded – undo
334 334
             global $base_url, $site_url;
335 335
             if (substr($url, 0, strlen($base_url)) == $base_url) {
336 336
                 // append $site_url to make it work with Location:
337
-                $url = $site_url . substr($url, strlen($base_url));
337
+                $url = $site_url.substr($url, strlen($base_url));
338 338
             }
339 339
             if (strpos($url, "\n") === false) {
340
-                $header = 'Location: ' . $url;
340
+                $header = 'Location: '.$url;
341 341
             } else {
342 342
                 $this->messageQuit('No newline allowed in redirect url.');
343 343
             }
@@ -451,8 +451,8 @@  discard block
 block discarded – undo
451 451
 
452 452
     private function recoverySiteCache()
453 453
     {
454
-        $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
455
-        $site_cache_path = $site_cache_dir . 'siteCache.idx.php';
454
+        $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
455
+        $site_cache_path = $site_cache_dir.'siteCache.idx.php';
456 456
 
457 457
         if (is_file($site_cache_path)) {
458 458
             include($site_cache_path);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
             return;
462 462
         }
463 463
 
464
-        include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
464
+        include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
465 465
         $cache = new synccache();
466 466
         $cache->setCachepath($site_cache_dir);
467 467
         $cache->setReport(false);
@@ -513,8 +513,8 @@  discard block
 block discarded – undo
513 513
                 $this->invokeEvent("OnBeforeManagerPageInit");
514 514
             }
515 515
 
516
-            if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) {
517
-                $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet'];
516
+            if (isset ($_SESSION[$usrType.'UsrConfigSet'])) {
517
+                $usrSettings = &$_SESSION[$usrType.'UsrConfigSet'];
518 518
             } else {
519 519
                 if ($usrType == 'web') {
520 520
                     $from = $tbl_web_user_settings;
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                     $usrSettings[$row['setting_name']] = $row['setting_value'];
535 535
                 }
536 536
                 if (isset ($usrType)) {
537
-                    $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings;
537
+                    $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings;
538 538
                 } // store user settings in session
539 539
             }
540 540
         }
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
         $suf = $this->config['friendly_url_suffix'];
680 680
         $pre = preg_quote($pre, '/');
681 681
         $suf = preg_quote($suf, '/');
682
-        if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) {
682
+        if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) {
683 683
             $q = $_[1];
684 684
         }
685
-        if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) {
685
+        if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) {
686 686
             $q = $_[1];
687 687
         }
688 688
 
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
         if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */
705 705
             /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */
706 706
             if ($this->config['use_alias_path'] == 1) {
707
-                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
707
+                if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir.'/'.$q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) {
708 708
                     $this->documentMethod = 'id';
709 709
                     return $q;
710 710
                 } else { /* not a valid id in terms of virtualDir, treat as alias */
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
      */
739 739
     public function getHashFile($key)
740 740
     {
741
-        return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php";
741
+        return $this->getCacheFolder()."docid_".$key.".pageCache.php";
742 742
     }
743 743
 
744 744
     /**
@@ -757,7 +757,7 @@  discard block
 block discarded – undo
757 757
                 // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID.
758 758
                 $params = $_GET;
759 759
                 ksort($params);
760
-                $hash .= '_' . md5(http_build_query($params));
760
+                $hash .= '_'.md5(http_build_query($params));
761 761
             }
762 762
         }
763 763
         $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params));
@@ -903,12 +903,12 @@  discard block
 block discarded – undo
903 903
         if ($js = $this->getRegisteredClientStartupScripts()) {
904 904
             // change to just before closing </head>
905 905
             // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent);
906
-            $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput);
906
+            $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput);
907 907
         }
908 908
 
909 909
         // Insert jscripts & html block into template - template must have a </body> tag
910 910
         if ($js = $this->getRegisteredClientScripts()) {
911
-            $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput);
911
+            $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput);
912 912
         }
913 913
         // End fix by sirlancelot
914 914
 
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
         // send out content-type and content-disposition headers
920 920
         if (IN_PARSER_MODE == "true") {
921 921
             $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html";
922
-            header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']);
922
+            header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']);
923 923
             //            if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error)
924 924
             //                header('HTTP/1.0 404 Not Found');
925 925
             if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) {
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
                     $name = preg_replace('|-+|', '-', $name);
938 938
                     $name = trim($name, '-');
939 939
                 }
940
-                $header = 'Content-Disposition: attachment; filename=' . $name;
940
+                $header = 'Content-Disposition: attachment; filename='.$name;
941 941
                 header($header);
942 942
             }
943 943
         }
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 
946 946
         $stats = $this->getTimerStats($this->tstart);
947 947
 
948
-        $out =& $this->documentOutput;
948
+        $out = & $this->documentOutput;
949 949
         $out = str_replace("[^q^]", $stats['queries'], $out);
950 950
         $out = str_replace("[^qt^]", $stats['queryTime'], $out);
951 951
         $out = str_replace("[^p^]", $stats['phpTime'], $out);
@@ -984,17 +984,17 @@  discard block
 block discarded – undo
984 984
                 $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet
985 985
                 $tt += $t;
986 986
             }
987
-            echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />";
987
+            echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />";
988 988
             echo $this->snippetsCode;
989 989
         }
990 990
         if ($this->dumpPlugins) {
991 991
             $ps = "";
992 992
             $tt = 0;
993 993
             foreach ($this->pluginsTime as $s => $t) {
994
-                $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>";
994
+                $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>";
995 995
                 $tt += $t;
996 996
             }
997
-            echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />";
997
+            echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />";
998 998
             echo $this->pluginsCode;
999 999
         }
1000 1000
 
@@ -1020,7 +1020,7 @@  discard block
 block discarded – undo
1020 1020
         $srcTags = explode(',', $tags);
1021 1021
         $repTags = array();
1022 1022
         foreach ($srcTags as $tag) {
1023
-            $repTags[] = '\\' . $tag[0] . '\\' . $tag[1];
1023
+            $repTags[] = '\\'.$tag[0].'\\'.$tag[1];
1024 1024
         }
1025 1025
         return array($srcTags, $repTags);
1026 1026
     }
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
         $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']);
1043 1043
         $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache";
1044 1044
         $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0;
1045
-        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb";
1045
+        $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb";
1046 1046
 
1047 1047
         return $stats;
1048 1048
     }
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
     {
1076 1076
         $cacheRefreshTime = 0;
1077 1077
         $recent_update = 0;
1078
-        @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php');
1078
+        @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php');
1079 1079
         $this->recentUpdate = $recent_update;
1080 1080
 
1081 1081
         $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time'];
@@ -1145,8 +1145,8 @@  discard block
 block discarded – undo
1145 1145
                 }
1146 1146
 
1147 1147
                 $docObjSerial = serialize($this->documentObject);
1148
-                $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent;
1149
-                $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey);
1148
+                $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent;
1149
+                $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey);
1150 1150
                 file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent");
1151 1151
             }
1152 1152
         }
@@ -1197,7 +1197,7 @@  discard block
 block discarded – undo
1197 1197
         $pos[']]>'] = strpos($content, ']]>');
1198 1198
 
1199 1199
         if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) {
1200
-            $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3);
1200
+            $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3);
1201 1201
         }
1202 1202
 
1203 1203
         $lp = explode($left, $content);
@@ -1322,8 +1322,8 @@  discard block
 block discarded – undo
1322 1322
             }
1323 1323
 
1324 1324
             if (is_array($value)) {
1325
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.format.inc.php');
1326
-                include_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php');
1325
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php');
1326
+                include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php');
1327 1327
                 $value = getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]);
1328 1328
             }
1329 1329
 
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
             if (strpos($content, $s) !== false) {
1336 1336
                 $content = str_replace($s, $value, $content);
1337 1337
             } elseif ($this->debug) {
1338
-                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1338
+                $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1339 1339
             }
1340 1340
         }
1341 1341
 
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
             if (strpos($content, $s) !== false) {
1504 1504
                 $content = str_replace($s, $value, $content);
1505 1505
             } elseif ($this->debug) {
1506
-                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1506
+                $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1507 1507
             }
1508 1508
         }
1509 1509
         return $content;
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
             }
1557 1557
 
1558 1558
             $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags
1559
-            $value = $this->mergePlaceholderContent($value, $params);  // parse page global placeholers
1559
+            $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers
1560 1560
             if ($this->config['enable_at_syntax']) {
1561 1561
                 $value = $this->mergeConditionalTagsContent($value);
1562 1562
             }
@@ -1572,7 +1572,7 @@  discard block
 block discarded – undo
1572 1572
             if (strpos($content, $s) !== false) {
1573 1573
                 $content = str_replace($s, $value, $content);
1574 1574
             } elseif ($this->debug) {
1575
-                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1575
+                $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1576 1576
             }
1577 1577
         }
1578 1578
         return $content;
@@ -1631,7 +1631,7 @@  discard block
 block discarded – undo
1631 1631
             if (strpos($content, $s) !== false) {
1632 1632
                 $content = str_replace($s, $value, $content);
1633 1633
             } elseif ($this->debug) {
1634
-                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1634
+                $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1635 1635
             }
1636 1636
         }
1637 1637
         return $content;
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
             return $content;
1656 1656
         }
1657 1657
 
1658
-        $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#';
1658
+        $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#';
1659 1659
         $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content);
1660 1660
 
1661 1661
         $pieces = explode('<@IF:', $content);
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
             }
1667 1667
             list($cmd, $text) = explode('>', $split, 2);
1668 1668
             $cmd = str_replace("'", "\'", $cmd);
1669
-            $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1669
+            $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>";
1670 1670
             $content .= $text;
1671 1671
         }
1672 1672
         $pieces = explode('<@ELSEIF:', $content);
@@ -1677,13 +1677,13 @@  discard block
 block discarded – undo
1677 1677
             }
1678 1678
             list($cmd, $text) = explode('>', $split, 2);
1679 1679
             $cmd = str_replace("'", "\'", $cmd);
1680
-            $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>";
1680
+            $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>";
1681 1681
             $content .= $text;
1682 1682
         }
1683 1683
 
1684 1684
         $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content);
1685 1685
         ob_start();
1686
-        $content = eval('?>' . $content);
1686
+        $content = eval('?>'.$content);
1687 1687
         $content = ob_get_clean();
1688 1688
         $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content);
1689 1689
 
@@ -1808,7 +1808,7 @@  discard block
 block discarded – undo
1808 1808
         $matches = $this->getTagsFromContent($content, $left, $right);
1809 1809
         if (!empty($matches)) {
1810 1810
             foreach ($matches[0] as $i => $v) {
1811
-                $addBreakMatches[$i] = $v . "\n";
1811
+                $addBreakMatches[$i] = $v."\n";
1812 1812
             }
1813 1813
             $content = str_replace($addBreakMatches, '', $content);
1814 1814
             if (strpos($content, $left) !== false) {
@@ -1842,7 +1842,7 @@  discard block
 block discarded – undo
1842 1842
             if (strpos($content, $s) !== false) {
1843 1843
                 $content = str_replace($s, $v, $content);
1844 1844
             } elseif ($this->debug) {
1845
-                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2);
1845
+                $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2);
1846 1846
             }
1847 1847
         }
1848 1848
         return $content;
@@ -1906,7 +1906,7 @@  discard block
 block discarded – undo
1906 1906
                 $msg = ($msg === false) ? 'ob_get_contents() error' : $msg;
1907 1907
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg);
1908 1908
                 if ($this->isBackend()) {
1909
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>');
1909
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>');
1910 1910
                 }
1911 1911
             }
1912 1912
         } else {
@@ -1952,7 +1952,7 @@  discard block
 block discarded – undo
1952 1952
                 $echo = ($echo === false) ? 'ob_get_contents() error' : $echo;
1953 1953
                 $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo);
1954 1954
                 if ($this->isBackend()) {
1955
-                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>');
1955
+                    $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>');
1956 1956
                 }
1957 1957
             }
1958 1958
         }
@@ -1960,7 +1960,7 @@  discard block
 block discarded – undo
1960 1960
         if (is_array($return) || is_object($return)) {
1961 1961
             return $return;
1962 1962
         } else {
1963
-            return $echo . $return;
1963
+            return $echo.$return;
1964 1964
         }
1965 1965
     }
1966 1966
 
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
                 if (strpos($content, $s) !== false) {
2000 2000
                     $content = str_replace($s, $value, $content);
2001 2001
                 } elseif ($this->debug) {
2002
-                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2002
+                    $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2);
2003 2003
                 }
2004 2004
                 continue;
2005 2005
             }
@@ -2011,7 +2011,7 @@  discard block
 block discarded – undo
2011 2011
             if (strpos($content, $s) !== false) {
2012 2012
                 $content = str_replace($s, $value, $content);
2013 2013
             } elseif ($this->debug) {
2014
-                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2);
2014
+                $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2);
2015 2015
             }
2016 2016
         }
2017 2017
 
@@ -2102,7 +2102,7 @@  discard block
 block discarded – undo
2102 2102
             $eventtime = sprintf('%2.2f ms', $eventtime * 1000);
2103 2103
             $code = str_replace("\t", '  ', $this->htmlspecialchars($value));
2104 2104
             $piece = str_replace("\t", '  ', $this->htmlspecialchars($piece));
2105
-            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true)));
2105
+            $print_r_params = str_replace("\t", '  ', $this->htmlspecialchars('$modx->event->params = '.print_r($params, true)));
2106 2106
             $this->snippetsCode .= sprintf('<fieldset style="margin:1em;"><legend><b>%s</b>(%s)</legend><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">[[%s]]</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre></fieldset>', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code);
2107 2107
             $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime);
2108 2108
         }
@@ -2346,7 +2346,7 @@  discard block
 block discarded – undo
2346 2346
             $rs = $this->db->select('name,snippet,properties', '[+prefix+]site_snippets', $where);
2347 2347
             $count = $this->db->getRecordCount($rs);
2348 2348
             if (1 < $count) {
2349
-                exit('Error $modx->_getSnippetObject()' . $snip_name);
2349
+                exit('Error $modx->_getSnippetObject()'.$snip_name);
2350 2350
             }
2351 2351
             if ($count) {
2352 2352
                 $row = $this->db->getRow($rs);
@@ -2372,7 +2372,7 @@  discard block
 block discarded – undo
2372 2372
     public function toAlias($text)
2373 2373
     {
2374 2374
         $suff = $this->config['friendly_url_suffix'];
2375
-        return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2375
+        return str_replace(array('.xml'.$suff, '.rss'.$suff, '.js'.$suff, '.css'.$suff, '.txt'.$suff, '.json'.$suff, '.pdf'.$suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text);
2376 2376
     }
2377 2377
 
2378 2378
     /**
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
                 $suff = '/';
2405 2405
             }
2406 2406
 
2407
-            $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff;
2407
+            $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff;
2408 2408
         }
2409 2409
 
2410 2410
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
                 preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match);
2442 2442
                 $ids = implode(',', array_unique($match['1']));
2443 2443
                 if ($ids) {
2444
-                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'");
2444
+                    $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'");
2445 2445
                     while ($row = $this->db->getRow($res)) {
2446 2446
                         if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) {
2447 2447
                             $parent = $row['parent'];
@@ -2452,7 +2452,7 @@  discard block
 block discarded – undo
2452 2452
                                 $parent = $this->aliasListing[$parent]['parent'];
2453 2453
                             }
2454 2454
 
2455
-                            $aliases[$row['id']] = $path . '/' . $row['alias'];
2455
+                            $aliases[$row['id']] = $path.'/'.$row['alias'];
2456 2456
                         } else {
2457 2457
                             $aliases[$row['id']] = $row['alias'];
2458 2458
                         }
@@ -2464,7 +2464,7 @@  discard block
 block discarded – undo
2464 2464
             $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0);
2465 2465
             $pref = $this->config['friendly_url_prefix'];
2466 2466
             $suff = $this->config['friendly_url_suffix'];
2467
-            $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2467
+            $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) {
2468 2468
                 global $modx;
2469 2469
                 $thealias = $aliases[$m[1]];
2470 2470
                 $thefolder = $isfolder[$m[1]];
@@ -2480,7 +2480,7 @@  discard block
 block discarded – undo
2480 2480
 
2481 2481
         } else {
2482 2482
             $in = '!\[\~([0-9]+)\~\]!is';
2483
-            $out = "index.php?id=" . '\1';
2483
+            $out = "index.php?id=".'\1';
2484 2484
             $documentSource = preg_replace($in, $out, $documentSource);
2485 2485
         }
2486 2486
 
@@ -2501,7 +2501,7 @@  discard block
 block discarded – undo
2501 2501
         $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
2502 2502
         $len_base_url = strlen($this->config['base_url']);
2503 2503
 
2504
-        $url_path = $q;//LANG
2504
+        $url_path = $q; //LANG
2505 2505
 
2506 2506
         if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) {
2507 2507
             $url_path = substr($url_path, $len_base_url);
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
             $strictURL = substr($strictURL, $len_base_url);
2514 2514
         }
2515 2515
         $http_host = $_SERVER['HTTP_HOST'];
2516
-        $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG
2516
+        $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG
2517 2517
 
2518 2518
         $site_url = $this->config['site_url'];
2519 2519
         $url_query_string = explode('?', $_SERVER['REQUEST_URI']);
@@ -2531,7 +2531,7 @@  discard block
 block discarded – undo
2531 2531
                 }
2532 2532
                 if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) {
2533 2533
                     if (empty($_POST)) {
2534
-                        if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) {
2534
+                        if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) {
2535 2535
                             $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently');
2536 2536
                             exit(0);
2537 2537
                         }
@@ -2590,7 +2590,7 @@  discard block
 block discarded – undo
2590 2590
                 $docgrp = implode(",", $docgrp);
2591 2591
             }
2592 2592
             // get document
2593
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2593
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
2594 2594
             $rs = $this->db->select('sc.*', "{$tblsc} sc
2595 2595
                 LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1);
2596 2596
             if ($this->db->getRecordCount($rs) < 1) {
@@ -2626,9 +2626,9 @@  discard block
 block discarded – undo
2626 2626
             }
2627 2627
             if ($documentObject['template']) {
2628 2628
                 // load TVs and merge with document - Orig by Apodigm - Docvars
2629
-                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv
2630
-                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id
2631
-                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2629
+                $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars")." tv
2630
+                INNER JOIN " . $this->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id
2631
+                LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'");
2632 2632
                 $tmplvars = array();
2633 2633
                 while ($row = $this->db->getRow($rs)) {
2634 2634
                     $tmplvars[$row['name']] = array(
@@ -2674,7 +2674,7 @@  discard block
 block discarded – undo
2674 2674
                 $st = md5($source);
2675 2675
             }
2676 2676
             if ($this->dumpSnippets == 1) {
2677
-                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS " . ($i + 1) . "</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2677
+                $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS ".($i + 1)."</b></legend><p>The following snippets (if any) were parsed during this pass.</p>";
2678 2678
             }
2679 2679
 
2680 2680
             // invoke OnParseDocument event
@@ -2762,7 +2762,7 @@  discard block
 block discarded – undo
2762 2762
 
2763 2763
             // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path
2764 2764
             if ($this->config['use_alias_path'] == 1) {
2765
-                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier;
2765
+                $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier;
2766 2766
                 if (isset($this->documentListing[$alias])) {
2767 2767
                     $this->documentIdentifier = $this->documentListing[$alias];
2768 2768
                 } else {
@@ -2823,7 +2823,7 @@  discard block
 block discarded – undo
2823 2823
                 } else {
2824 2824
                     $docAlias = $this->db->escape($this->documentIdentifier);
2825 2825
                     $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'");
2826
-                    $this->documentIdentifier = (int)$this->db->getValue($rs);
2826
+                    $this->documentIdentifier = (int) $this->db->getValue($rs);
2827 2827
                 }
2828 2828
             }
2829 2829
             $this->documentMethod = 'id';
@@ -2880,7 +2880,7 @@  discard block
 block discarded – undo
2880 2880
                 $_REQUEST[$n] = $_GET[$n] = $v;
2881 2881
             }
2882 2882
         }
2883
-        $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path'];
2883
+        $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path'];
2884 2884
         $this->q = $qp['path'];
2885 2885
         return $qp['path'];
2886 2886
     }
@@ -2974,7 +2974,7 @@  discard block
 block discarded – undo
2974 2974
             $this->sendErrorPage();
2975 2975
         } else {
2976 2976
             // Inculde the necessary files to check document permissions
2977
-            include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php');
2977
+            include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php');
2978 2978
             $udperms = new udperms();
2979 2979
             $udperms->user = $this->getLoginUserID();
2980 2980
             $udperms->document = $this->documentIdentifier;
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
         while ($id && $height--) {
3029 3029
             $thisid = $id;
3030 3030
             if ($this->config['aliaslistingfolder'] == 1) {
3031
-                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM " . $this->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1");
3031
+                $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM ".$this->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1");
3032 3032
                 if (!$id || $id == '0') {
3033 3033
                     break;
3034 3034
                 }
@@ -3079,15 +3079,15 @@  discard block
 block discarded – undo
3079 3079
 
3080 3080
         if ($this->config['aliaslistingfolder'] == 1) {
3081 3081
 
3082
-            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'");
3082
+            $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'");
3083 3083
             $idx = array();
3084 3084
             while ($row = $this->db->getRow($res)) {
3085 3085
                 $pAlias = '';
3086 3086
                 if (isset($this->aliasListing[$row['parent']])) {
3087
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : '';
3088
-                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : '';
3087
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : '';
3088
+                    $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : '';
3089 3089
                 };
3090
-                $children[$pAlias . $row['alias']] = $row['id'];
3090
+                $children[$pAlias.$row['alias']] = $row['id'];
3091 3091
                 if ($row['isfolder'] == 1) {
3092 3092
                     $idx[] = $row['id'];
3093 3093
                 }
@@ -3119,7 +3119,7 @@  discard block
 block discarded – undo
3119 3119
                 $depth--;
3120 3120
 
3121 3121
                 foreach ($documentMap_cache[$id] as $childId) {
3122
-                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias'];
3122
+                    $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias'];
3123 3123
                     if (!strlen($pkey)) {
3124 3124
                         $pkey = "{$childId}";
3125 3125
                     }
@@ -3148,7 +3148,7 @@  discard block
 block discarded – undo
3148 3148
         if (substr(strtolower($url), 0, 11) == "javascript:") {
3149 3149
             $fnc = substr($url, 11);
3150 3150
         } elseif ($url) {
3151
-            $fnc = "window.location.href='" . addslashes($url) . "';";
3151
+            $fnc = "window.location.href='".addslashes($url)."';";
3152 3152
         } else {
3153 3153
             $fnc = "history.back(-1);";
3154 3154
         }
@@ -3157,7 +3157,7 @@  discard block
 block discarded – undo
3157 3157
             <meta http-equiv=\"Content-Type\" content=\"text/html; charset={$modx_manager_charset};\">
3158 3158
             <script>
3159 3159
                 function __alertQuit() {
3160
-                    alert('" . addslashes($msg) . "');
3160
+                    alert('".addslashes($msg)."');
3161 3161
                     {$fnc}
3162 3162
                 }
3163 3163
                 window.setTimeout('__alertQuit();',100);
@@ -3179,9 +3179,9 @@  discard block
 block discarded – undo
3179 3179
         $state = 0;
3180 3180
         $pms = $_SESSION['mgrPermissions'];
3181 3181
         if ($pms) {
3182
-            $state = ((bool)$pms[$pm] === true);
3182
+            $state = ((bool) $pms[$pm] === true);
3183 3183
         }
3184
-        return (int)$state;
3184
+        return (int) $state;
3185 3185
     }
3186 3186
 
3187 3187
     /**
@@ -3194,8 +3194,8 @@  discard block
 block discarded – undo
3194 3194
      */
3195 3195
     public function elementIsLocked($type, $id, $includeThisUser = false)
3196 3196
     {
3197
-        $id = (int)$id;
3198
-        $type = (int)$type;
3197
+        $id = (int) $id;
3198
+        $type = (int) $type;
3199 3199
         if (!$type || !$id) {
3200 3200
             return null;
3201 3201
         }
@@ -3245,7 +3245,7 @@  discard block
 block discarded – undo
3245 3245
             return $lockedElements;
3246 3246
         }
3247 3247
 
3248
-        $type = (int)$type;
3248
+        $type = (int) $type;
3249 3249
         if (isset($lockedElements[$type])) {
3250 3250
             return $lockedElements[$type];
3251 3251
         } else {
@@ -3262,7 +3262,7 @@  discard block
 block discarded – undo
3262 3262
             $this->lockedElements = array();
3263 3263
             $this->cleanupExpiredLocks();
3264 3264
 
3265
-            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul
3265
+            $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks')." ul
3266 3266
                 LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id");
3267 3267
             while ($row = $this->db->getRow($rs)) {
3268 3268
                 $this->lockedElements[$row['elementType']][$row['elementId']] = array(
@@ -3285,7 +3285,7 @@  discard block
 block discarded – undo
3285 3285
     public function cleanupExpiredLocks()
3286 3286
     {
3287 3287
         // Clean-up active_user_sessions first
3288
-        $timeout = (int)$this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3288
+        $timeout = (int) $this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum
3289 3289
         $validSessionTimeLimit = $this->time - $timeout;
3290 3290
         $this->db->delete($this->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}");
3291 3291
 
@@ -3298,7 +3298,7 @@  discard block
 block discarded – undo
3298 3298
             foreach ($rs as $row) {
3299 3299
                 $userSids[] = $row['sid'];
3300 3300
             }
3301
-            $userSids = "'" . implode("','", $userSids) . "'";
3301
+            $userSids = "'".implode("','", $userSids)."'";
3302 3302
             $this->db->delete($this->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})");
3303 3303
         } else {
3304 3304
             $this->db->delete($this->getFullTableName('active_user_locks'));
@@ -3382,8 +3382,8 @@  discard block
 block discarded – undo
3382 3382
     public function lockElement($type, $id)
3383 3383
     {
3384 3384
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3385
-        $type = (int)$type;
3386
-        $id = (int)$id;
3385
+        $type = (int) $type;
3386
+        $id = (int) $id;
3387 3387
         if (!$type || !$id || !$userId) {
3388 3388
             return false;
3389 3389
         }
@@ -3404,8 +3404,8 @@  discard block
 block discarded – undo
3404 3404
     public function unlockElement($type, $id, $includeAllUsers = false)
3405 3405
     {
3406 3406
         $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0;
3407
-        $type = (int)$type;
3408
-        $id = (int)$id;
3407
+        $type = (int) $type;
3408
+        $id = (int) $id;
3409 3409
         if (!$type || !$id) {
3410 3410
             return false;
3411 3411
         }
@@ -3472,8 +3472,8 @@  discard block
 block discarded – undo
3472 3472
         }
3473 3473
 
3474 3474
         $usertype = $this->isFrontend() ? 1 : 0;
3475
-        $evtid = (int)$evtid;
3476
-        $type = (int)$type;
3475
+        $evtid = (int) $evtid;
3476
+        $type = (int) $type;
3477 3477
 
3478 3478
         // Types: 1 = information, 2 = warning, 3 = error
3479 3479
         if ($type < 1) {
@@ -3495,8 +3495,8 @@  discard block
 block discarded – undo
3495 3495
         if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') {
3496 3496
             if ($this->config['send_errormail'] <= $type) {
3497 3497
                 $this->sendmail(array(
3498
-                    'subject' => 'MODX System Error on ' . $this->config['site_name'],
3499
-                    'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.',
3498
+                    'subject' => 'MODX System Error on '.$this->config['site_name'],
3499
+                    'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.',
3500 3500
                     'type' => 'text'
3501 3501
                 ));
3502 3502
             }
@@ -3544,7 +3544,7 @@  discard block
 block discarded – undo
3544 3544
             $p['fromname'] = $userinfo['username'];
3545 3545
         }
3546 3546
         if ($msg === '' && !isset($p['body'])) {
3547
-            $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER'];
3547
+            $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER'];
3548 3548
         } elseif (is_string($msg) && 0 < strlen($msg)) {
3549 3549
             $p['body'] = $msg;
3550 3550
         }
@@ -3584,8 +3584,8 @@  discard block
 block discarded – undo
3584 3584
             $files = array();
3585 3585
         }
3586 3586
         foreach ($files as $f) {
3587
-            if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) {
3588
-                $this->mail->AddAttachment(MODX_BASE_PATH . $f);
3587
+            if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) {
3588
+                $this->mail->AddAttachment(MODX_BASE_PATH.$f);
3589 3589
             }
3590 3590
         }
3591 3591
         $rs = $this->mail->send();
@@ -3655,14 +3655,14 @@  discard block
 block discarded – undo
3655 3655
         $tblsc = $this->getFullTableName("site_content");
3656 3656
         $tbldg = $this->getFullTableName("document_groups");
3657 3657
         // modify field names to use sc. table reference
3658
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3659
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3658
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3659
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3660 3660
         // get document groups for current user
3661 3661
         if ($docgrp = $this->getUserDocGroups()) {
3662 3662
             $docgrp = implode(",", $docgrp);
3663 3663
         }
3664 3664
         // build query
3665
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3665
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3666 3666
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3667 3667
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3668 3668
         $resourceArray = $this->db->makeArray($result);
@@ -3692,14 +3692,14 @@  discard block
 block discarded – undo
3692 3692
         $tbldg = $this->getFullTableName("document_groups");
3693 3693
 
3694 3694
         // modify field names to use sc. table reference
3695
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3696
-        $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3695
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3696
+        $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3697 3697
         // get document groups for current user
3698 3698
         if ($docgrp = $this->getUserDocGroups()) {
3699 3699
             $docgrp = implode(",", $docgrp);
3700 3700
         }
3701 3701
         // build query
3702
-        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3702
+        $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3703 3703
         $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3704 3704
                 LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}");
3705 3705
         $resourceArray = $this->db->makeArray($result);
@@ -3734,16 +3734,16 @@  discard block
 block discarded – undo
3734 3734
             return $this->tmpCache[__FUNCTION__][$cacheKey];
3735 3735
         }
3736 3736
 
3737
-        $published = ($published !== 'all') ? 'AND sc.published = ' . $published : '';
3738
-        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : '';
3737
+        $published = ($published !== 'all') ? 'AND sc.published = '.$published : '';
3738
+        $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : '';
3739 3739
 
3740 3740
         if ($where != '') {
3741
-            $where = 'AND ' . $where;
3741
+            $where = 'AND '.$where;
3742 3742
         }
3743 3743
 
3744 3744
         // modify field names to use sc. table reference
3745
-        $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3746
-        $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3745
+        $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3746
+        $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3747 3747
 
3748 3748
         // get document groups for current user
3749 3749
         if ($docgrp = $this->getUserDocGroups()) {
@@ -3751,7 +3751,7 @@  discard block
 block discarded – undo
3751 3751
         }
3752 3752
 
3753 3753
         // build query
3754
-        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3754
+        $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3755 3755
 
3756 3756
         $tblsc = $this->getFullTableName('site_content');
3757 3757
         $tbldg = $this->getFullTableName('document_groups');
@@ -3803,10 +3803,10 @@  discard block
 block discarded – undo
3803 3803
             return false;
3804 3804
         } else {
3805 3805
             // modify field names to use sc. table reference
3806
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3807
-            $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3806
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3807
+            $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort))));
3808 3808
             if ($where != '') {
3809
-                $where = 'AND ' . $where;
3809
+                $where = 'AND '.$where;
3810 3810
             }
3811 3811
 
3812 3812
             $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : '';
@@ -3817,13 +3817,13 @@  discard block
 block discarded – undo
3817 3817
                 $docgrp = implode(',', $docgrp);
3818 3818
             }
3819 3819
 
3820
-            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')');
3820
+            $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')');
3821 3821
 
3822 3822
             $tblsc = $this->getFullTableName('site_content');
3823 3823
             $tbldg = $this->getFullTableName('document_groups');
3824 3824
 
3825 3825
             $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc
3826
-                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3826
+                    LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (".implode(',', $ids).") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit);
3827 3827
 
3828 3828
             $resourceArray = $this->db->makeArray($result);
3829 3829
 
@@ -3928,12 +3928,12 @@  discard block
 block discarded – undo
3928 3928
             $tbldg = $this->getFullTableName("document_groups");
3929 3929
             $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : "";
3930 3930
             // modify field names to use sc. table reference
3931
-            $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3931
+            $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields))));
3932 3932
             // get document groups for current user
3933 3933
             if ($docgrp = $this->getUserDocGroups()) {
3934 3934
                 $docgrp = implode(",", $docgrp);
3935 3935
             }
3936
-            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3936
+            $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)");
3937 3937
             $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1);
3938 3938
             $pageInfo = $this->db->getRow($result);
3939 3939
 
@@ -3980,7 +3980,7 @@  discard block
 block discarded – undo
3980 3980
     {
3981 3981
         if ($this->currentSnippet) {
3982 3982
             $tbl = $this->getFullTableName("site_snippets");
3983
-            $rs = $this->db->select('id', $tbl, "name='" . $this->db->escape($this->currentSnippet) . "'", '', 1);
3983
+            $rs = $this->db->select('id', $tbl, "name='".$this->db->escape($this->currentSnippet)."'", '', 1);
3984 3984
             if ($snippetId = $this->db->getValue($rs)) {
3985 3985
                 return $snippetId;
3986 3986
             }
@@ -4007,23 +4007,23 @@  discard block
 block discarded – undo
4007 4007
      */
4008 4008
     public function clearCache($type = '', $report = false)
4009 4009
     {
4010
-        $cache_dir = MODX_BASE_PATH . $this->getCacheFolder();
4010
+        $cache_dir = MODX_BASE_PATH.$this->getCacheFolder();
4011 4011
         if (is_array($type)) {
4012 4012
             foreach ($type as $_) {
4013 4013
                 $this->clearCache($_, $report);
4014 4014
             }
4015 4015
         } elseif ($type == 'full') {
4016
-            include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php');
4016
+            include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php');
4017 4017
             $sync = new synccache();
4018 4018
             $sync->setCachepath($cache_dir);
4019 4019
             $sync->setReport($report);
4020 4020
             $sync->emptyCache();
4021 4021
         } elseif (preg_match('@^[1-9][0-9]*$@', $type)) {
4022 4022
             $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type;
4023
-            $file_name = "docid_" . $key . "_*.pageCache.php";
4024
-            $cache_path = $cache_dir . $file_name;
4023
+            $file_name = "docid_".$key."_*.pageCache.php";
4024
+            $cache_path = $cache_dir.$file_name;
4025 4025
             $files = glob($cache_path);
4026
-            $files[] = $cache_dir . "docid_" . $key . ".pageCache.php";
4026
+            $files[] = $cache_dir."docid_".$key.".pageCache.php";
4027 4027
             foreach ($files as $file) {
4028 4028
                 if (!is_file($file)) {
4029 4029
                     continue;
@@ -4031,7 +4031,7 @@  discard block
 block discarded – undo
4031 4031
                 unlink($file);
4032 4032
             }
4033 4033
         } else {
4034
-            $files = glob($cache_dir . '*');
4034
+            $files = glob($cache_dir.'*');
4035 4035
             foreach ($files as $file) {
4036 4036
                 $name = basename($file);
4037 4037
                 if (strpos($name, '.pageCache.php') === false) {
@@ -4100,7 +4100,7 @@  discard block
 block discarded – undo
4100 4100
                         $f_url_suffix = '/';
4101 4101
                     }
4102 4102
 
4103
-                    $alPath = !empty ($al['path']) ? $al['path'] . '/' : '';
4103
+                    $alPath = !empty ($al['path']) ? $al['path'].'/' : '';
4104 4104
 
4105 4105
                     if ($al && $al['alias']) {
4106 4106
                         $alias = $al['alias'];
@@ -4108,7 +4108,7 @@  discard block
 block discarded – undo
4108 4108
 
4109 4109
                 }
4110 4110
 
4111
-                $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix;
4111
+                $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix;
4112 4112
                 $url = "{$alias}{$args}";
4113 4113
             } else {
4114 4114
                 $url = "index.php?id={$id}{$args}";
@@ -4127,7 +4127,7 @@  discard block
 block discarded – undo
4127 4127
             }
4128 4128
 
4129 4129
             //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080)
4130
-            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host;
4130
+            $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host;
4131 4131
         }
4132 4132
 
4133 4133
         //fix strictUrl by Bumkaka
@@ -4136,9 +4136,9 @@  discard block
 block discarded – undo
4136 4136
         }
4137 4137
 
4138 4138
         if ($this->config['xhtml_urls']) {
4139
-            $url = preg_replace("/&(?!amp;)/", "&amp;", $host . $virtualDir . $url);
4139
+            $url = preg_replace("/&(?!amp;)/", "&amp;", $host.$virtualDir.$url);
4140 4140
         } else {
4141
-            $url = $host . $virtualDir . $url;
4141
+            $url = $host.$virtualDir.$url;
4142 4142
         }
4143 4143
 
4144 4144
         $evtOut = $this->invokeEvent('OnMakeDocUrl', array(
@@ -4162,21 +4162,21 @@  discard block
 block discarded – undo
4162 4162
         if (isset($this->aliasListing[$id])) {
4163 4163
             $out = $this->aliasListing[$id];
4164 4164
         } else {
4165
-            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM " . $this->getFullTableName("site_content") . " WHERE id=" . (int)$id);
4165
+            $q = $this->db->query("SELECT id,alias,isfolder,parent FROM ".$this->getFullTableName("site_content")." WHERE id=".(int) $id);
4166 4166
             if ($this->db->getRecordCount($q) == '1') {
4167 4167
                 $q = $this->db->getRow($q);
4168 4168
                 $this->aliasListing[$id] = array(
4169
-                    'id' => (int)$q['id'],
4169
+                    'id' => (int) $q['id'],
4170 4170
                     'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'],
4171
-                    'parent' => (int)$q['parent'],
4172
-                    'isfolder' => (int)$q['isfolder'],
4171
+                    'parent' => (int) $q['parent'],
4172
+                    'isfolder' => (int) $q['isfolder'],
4173 4173
                 );
4174 4174
                 if ($this->aliasListing[$id]['parent'] > 0) {
4175 4175
                     //fix alias_path_usage
4176 4176
                     if ($this->config['use_alias_path'] == '1') {
4177 4177
                         //&& $tmp['path'] != '' - fix error slash with epty path
4178 4178
                         $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']);
4179
-                        $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : '');
4179
+                        $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : '');
4180 4180
                     } else {
4181 4181
                         $this->aliasListing[$id]['path'] = '';
4182 4182
                     }
@@ -4217,7 +4217,7 @@  discard block
 block discarded – undo
4217 4217
         $out = array();
4218 4218
         if (empty($this->version) || !is_array($this->version)) {
4219 4219
             //include for compatibility modx version < 1.0.10
4220
-            include MODX_MANAGER_PATH . "includes/version.inc.php";
4220
+            include MODX_MANAGER_PATH."includes/version.inc.php";
4221 4221
             $this->version = array();
4222 4222
             $this->version['version'] = isset($modx_version) ? $modx_version : '';
4223 4223
             $this->version['branch'] = isset($modx_branch) ? $modx_branch : '';
@@ -4239,18 +4239,18 @@  discard block
 block discarded – undo
4239 4239
     {
4240 4240
         if (isset ($this->snippetCache[$snippetName])) {
4241 4241
             $snippet = $this->snippetCache[$snippetName];
4242
-            $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : '';
4242
+            $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : '';
4243 4243
         } else { // not in cache so let's check the db
4244
-            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "'  AND ss.disabled=0;";
4244
+            $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->db->escape($snippetName)."'  AND ss.disabled=0;";
4245 4245
             $result = $this->db->query($sql);
4246 4246
             if ($this->db->getRecordCount($result) == 1) {
4247 4247
                 $row = $this->db->getRow($result);
4248 4248
                 $snippet = $this->snippetCache[$snippetName] = $row['snippet'];
4249 4249
                 $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties']));
4250
-                $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties);
4250
+                $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties);
4251 4251
             } else {
4252 4252
                 $snippet = $this->snippetCache[$snippetName] = "return false;";
4253
-                $properties = $this->snippetCache[$snippetName . "Props"] = '';
4253
+                $properties = $this->snippetCache[$snippetName."Props"] = '';
4254 4254
             }
4255 4255
         }
4256 4256
         // load default params/properties
@@ -4351,7 +4351,7 @@  discard block
 block discarded – undo
4351 4351
             if (strpos($tpl, $s) !== false) {
4352 4352
                 $tpl = str_replace($s, $value, $tpl);
4353 4353
             } elseif ($this->debug) {
4354
-                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2);
4354
+                $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2);
4355 4355
             }
4356 4356
         }
4357 4357
 
@@ -4400,7 +4400,7 @@  discard block
 block discarded – undo
4400 4400
             case 'CODE':
4401 4401
                 break;
4402 4402
             case 'FILE':
4403
-                $template = file_get_contents(MODX_BASE_PATH . $template);
4403
+                $template = file_get_contents(MODX_BASE_PATH.$template);
4404 4404
                 break;
4405 4405
             case 'CHUNK':
4406 4406
                 $template = $this->getChunk($template);
@@ -4433,7 +4433,7 @@  discard block
 block discarded – undo
4433 4433
         if ($mode !== 'formatOnly' && empty($timestamp)) {
4434 4434
             return '-';
4435 4435
         }
4436
-        $timestamp = (int)$timestamp;
4436
+        $timestamp = (int) $timestamp;
4437 4437
 
4438 4438
         switch ($this->config['datetime_format']) {
4439 4439
             case 'YYYY/mm/dd':
@@ -4453,7 +4453,7 @@  discard block
 block discarded – undo
4453 4453
         }
4454 4454
 
4455 4455
         if (empty($mode)) {
4456
-            $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp);
4456
+            $strTime = strftime($dateFormat." %H:%M:%S", $timestamp);
4457 4457
         } elseif ($mode == 'dateOnly') {
4458 4458
             $strTime = strftime($dateFormat, $timestamp);
4459 4459
         } elseif ($mode == 'formatOnly') {
@@ -4507,7 +4507,7 @@  discard block
 block discarded – undo
4507 4507
             $S = 0;
4508 4508
         }
4509 4509
         $timeStamp = mktime($H, $M, $S, $m, $d, $Y);
4510
-        $timeStamp = (int)$timeStamp;
4510
+        $timeStamp = (int) $timeStamp;
4511 4511
         return $timeStamp;
4512 4512
     }
4513 4513
 
@@ -4549,7 +4549,7 @@  discard block
 block discarded – undo
4549 4549
                     if ($v === 'value') {
4550 4550
                         unset($_[$i]);
4551 4551
                     } else {
4552
-                        $_[$i] = 'tv.' . $v;
4552
+                        $_[$i] = 'tv.'.$v;
4553 4553
                     }
4554 4554
                 }
4555 4555
                 $fields = implode(',', $_);
@@ -4558,12 +4558,12 @@  discard block
 block discarded – undo
4558 4558
             }
4559 4559
 
4560 4560
             if ($tvsort != '') {
4561
-                $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4561
+                $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort))));
4562 4562
             }
4563 4563
             if ($tvidnames == "*") {
4564 4564
                 $query = "tv.id<>0";
4565 4565
             } else {
4566
-                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')";
4566
+                $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')";
4567 4567
             }
4568 4568
 
4569 4569
             $this->getUserDocGroups();
@@ -4725,18 +4725,18 @@  discard block
 block discarded – undo
4725 4725
             }
4726 4726
 
4727 4727
             // get user defined template variables
4728
-            $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4729
-            $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4728
+            $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields))));
4729
+            $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort))));
4730 4730
 
4731 4731
             if ($idnames == '*') {
4732 4732
                 $query = 'tv.id<>0';
4733 4733
             } else {
4734
-                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')";
4734
+                $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')";
4735 4735
             }
4736 4736
 
4737
-            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv
4738
-                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id
4739
-                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4737
+            $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars')." tv
4738
+                    INNER JOIN " . $this->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id
4739
+                    LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : ""));
4740 4740
 
4741 4741
             $result = $this->db->makeArray($rs);
4742 4742
 
@@ -4785,16 +4785,16 @@  discard block
 block discarded – undo
4785 4785
             $output = array();
4786 4786
             $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames);
4787 4787
 
4788
-            $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier;
4788
+            $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier;
4789 4789
             // remove sort for speed
4790 4790
             $result = $this->getTemplateVars($vars, '*', $docid, $published, '', '');
4791 4791
 
4792 4792
             if ($result == false) {
4793 4793
                 return false;
4794 4794
             } else {
4795
-                $baspath = MODX_MANAGER_PATH . 'includes';
4796
-                include_once $baspath . '/tmplvars.format.inc.php';
4797
-                include_once $baspath . '/tmplvars.commands.inc.php';
4795
+                $baspath = MODX_MANAGER_PATH.'includes';
4796
+                include_once $baspath.'/tmplvars.format.inc.php';
4797
+                include_once $baspath.'/tmplvars.commands.inc.php';
4798 4798
 
4799 4799
                 for ($i = 0; $i < count($result); $i++) {
4800 4800
                     $row = $result[$i];
@@ -4819,7 +4819,7 @@  discard block
 block discarded – undo
4819 4819
      */
4820 4820
     public function getFullTableName($tbl)
4821 4821
     {
4822
-        return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`";
4822
+        return $this->db->config['dbase'].".`".$this->db->config['table_prefix'].$tbl."`";
4823 4823
     }
4824 4824
 
4825 4825
     /**
@@ -4898,7 +4898,7 @@  discard block
 block discarded – undo
4898 4898
     public function getCachePath()
4899 4899
     {
4900 4900
         global $base_url;
4901
-        $pth = $base_url . $this->getCacheFolder();
4901
+        $pth = $base_url.$this->getCacheFolder();
4902 4902
         return $pth;
4903 4903
     }
4904 4904
 
@@ -4950,8 +4950,8 @@  discard block
 block discarded – undo
4950 4950
         $out = false;
4951 4951
 
4952 4952
         if (!empty($context)) {
4953
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4954
-                $out = $_SESSION[$context . 'InternalKey'];
4953
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
4954
+                $out = $_SESSION[$context.'InternalKey'];
4955 4955
             }
4956 4956
         } else {
4957 4957
             switch (true) {
@@ -4981,8 +4981,8 @@  discard block
 block discarded – undo
4981 4981
         $out = false;
4982 4982
 
4983 4983
         if (!empty($context)) {
4984
-            if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) {
4985
-                $out = $_SESSION[$context . 'Shortname'];
4984
+            if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) {
4985
+                $out = $_SESSION[$context.'Shortname'];
4986 4986
             }
4987 4987
         } else {
4988 4988
             switch (true) {
@@ -5055,8 +5055,8 @@  discard block
 block discarded – undo
5055 5055
      */
5056 5056
     public function getWebUserInfo($uid)
5057 5057
     {
5058
-        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu
5059
-                INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5058
+        $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users")." wu
5059
+                INNER JOIN " . $this->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'");
5060 5060
         if ($row = $this->db->getRow($rs)) {
5061 5061
             if (!isset($row['usertype']) or !$row["usertype"]) {
5062 5062
                 $row["usertype"] = "web";
@@ -5092,7 +5092,7 @@  discard block
 block discarded – undo
5092 5092
         } else if (is_array($dg)) {
5093 5093
             // resolve ids to names
5094 5094
             $dgn = array();
5095
-            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")");
5095
+            $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")");
5096 5096
             while ($row = $this->db->getRow($ds)) {
5097 5097
                 $dgn[] = $row['name'];
5098 5098
             }
@@ -5120,7 +5120,7 @@  discard block
 block discarded – undo
5120 5120
         $rt = false;
5121 5121
         if ($_SESSION["webValidated"] == 1) {
5122 5122
             $tbl = $this->getFullTableName("web_users");
5123
-            $ds = $this->db->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'");
5123
+            $ds = $this->db->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'");
5124 5124
             if ($row = $this->db->getRow($ds)) {
5125 5125
                 if ($row["password"] == md5($oldPwd)) {
5126 5126
                     if (strlen($newPwd) < 6) {
@@ -5130,7 +5130,7 @@  discard block
 block discarded – undo
5130 5130
                     } else {
5131 5131
                         $this->db->update(array(
5132 5132
                             'password' => $this->db->escape($newPwd),
5133
-                        ), $tbl, "id='" . $this->getLoginUserID() . "'");
5133
+                        ), $tbl, "id='".$this->getLoginUserID()."'");
5134 5134
                         // invoke OnWebChangePassword event
5135 5135
                         $this->invokeEvent("OnWebChangePassword", array(
5136 5136
                             "userid" => $row["id"],
@@ -5161,8 +5161,8 @@  discard block
 block discarded – undo
5161 5161
         // check cache
5162 5162
         $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false;
5163 5163
         if (!is_array($grpNames)) {
5164
-            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn
5165
-                    INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'");
5164
+            $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names")." wgn
5165
+                    INNER JOIN " . $this->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'");
5166 5166
             $grpNames = $this->db->getColumn("name", $rs);
5167 5167
             // save to cache
5168 5168
             $_SESSION['webUserGroupNames'] = $grpNames;
@@ -5195,7 +5195,7 @@  discard block
 block discarded – undo
5195 5195
         if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) {
5196 5196
             $this->sjscripts[$nextpos] = $src;
5197 5197
         } else {
5198
-            $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>';
5198
+            $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>';
5199 5199
         }
5200 5200
     }
5201 5201
 
@@ -5274,7 +5274,7 @@  discard block
 block discarded – undo
5274 5274
         }
5275 5275
 
5276 5276
         if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) {
5277
-            $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>';
5277
+            $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>';
5278 5278
         }
5279 5279
         if ($startup) {
5280 5280
             $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1;
@@ -5421,7 +5421,7 @@  discard block
 block discarded – undo
5421 5421
                 $eventtime = $this->getMicroTime() - $eventtime;
5422 5422
                 $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000);
5423 5423
                 foreach ($parameter as $k => $v) {
5424
-                    $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>';
5424
+                    $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>';
5425 5425
                 }
5426 5426
                 $this->pluginsCode .= '</fieldset><br />';
5427 5427
                 $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime;
@@ -5449,13 +5449,13 @@  discard block
 block discarded – undo
5449 5449
         $plugin = array();
5450 5450
         if (isset ($this->pluginCache[$pluginName])) {
5451 5451
             $pluginCode = $this->pluginCache[$pluginName];
5452
-            $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : '';
5452
+            $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : '';
5453 5453
         } else {
5454 5454
             $pluginName = $this->db->escape($pluginName);
5455 5455
             $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0");
5456 5456
             if ($row = $this->db->getRow($result)) {
5457 5457
                 $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode'];
5458
-                $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties'];
5458
+                $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties'];
5459 5459
             } else {
5460 5460
                 $pluginCode = $this->pluginCache[$pluginName] = "return false;";
5461 5461
                 $pluginProperties = '';
@@ -5562,7 +5562,7 @@  discard block
 block discarded – undo
5562 5562
     public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false)
5563 5563
     {
5564 5564
         $params = array();
5565
-        $fullpath = $element_dir . '/' . $filename;
5565
+        $fullpath = $element_dir.'/'.$filename;
5566 5566
         if (is_readable($fullpath)) {
5567 5567
             $tpl = @fopen($fullpath, "r");
5568 5568
             if ($tpl) {
@@ -5729,8 +5729,8 @@  discard block
 block discarded – undo
5729 5729
         $ph = array('site_url' => MODX_SITE_URL);
5730 5730
         $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/";
5731 5731
         $regexEmail = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i';
5732
-        $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : '';
5733
-        $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : '';
5732
+        $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : '';
5733
+        $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : '';
5734 5734
         foreach ($parsed as $key => $val) {
5735 5735
             if (is_array($val)) {
5736 5736
                 foreach ($val as $key2 => $val2) {
@@ -5739,7 +5739,7 @@  discard block
 block discarded – undo
5739 5739
                         $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2);
5740 5740
                     }
5741 5741
                     if (preg_match($regexEmail, $val2, $url)) {
5742
-                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2);
5742
+                        $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2);
5743 5743
                     }
5744 5744
                     $parsed[$key][$key2] = $val2;
5745 5745
                 }
@@ -5749,7 +5749,7 @@  discard block
 block discarded – undo
5749 5749
                     $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val);
5750 5750
                 }
5751 5751
                 if (preg_match($regexEmail, $val, $url)) {
5752
-                    $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val);
5752
+                    $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val);
5753 5753
                 }
5754 5754
                 $parsed[$key] = $val;
5755 5755
             }
@@ -5763,32 +5763,32 @@  discard block
 block discarded – undo
5763 5763
         );
5764 5764
 
5765 5765
         $nl = "\n";
5766
-        $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : '';
5767
-        $list .= '<p>' . $nl;
5768
-        $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : '';
5769
-        $list .= isset($parsed['description']) ? $parsed['description'] . $nl : '';
5770
-        $list .= '</p><br/>' . $nl;
5771
-        $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : '';
5772
-        $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : '';
5773
-        $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : '';
5774
-        $list .= '<br/>' . $nl;
5766
+        $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : '';
5767
+        $list .= '<p>'.$nl;
5768
+        $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : '';
5769
+        $list .= isset($parsed['description']) ? $parsed['description'].$nl : '';
5770
+        $list .= '</p><br/>'.$nl;
5771
+        $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : '';
5772
+        $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : '';
5773
+        $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : '';
5774
+        $list .= '<br/>'.$nl;
5775 5775
         $first = true;
5776 5776
         foreach ($arrayParams as $param => $label) {
5777 5777
             if (isset($parsed[$param])) {
5778 5778
                 if ($first) {
5779
-                    $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl;
5780
-                    $list .= '<ul class="docBlockList">' . $nl;
5779
+                    $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl;
5780
+                    $list .= '<ul class="docBlockList">'.$nl;
5781 5781
                     $first = false;
5782 5782
                 }
5783
-                $list .= '    <li><strong>' . $label . '</strong>' . $nl;
5784
-                $list .= '        <ul>' . $nl;
5783
+                $list .= '    <li><strong>'.$label.'</strong>'.$nl;
5784
+                $list .= '        <ul>'.$nl;
5785 5785
                 foreach ($parsed[$param] as $val) {
5786
-                    $list .= '            <li>' . $val . '</li>' . $nl;
5786
+                    $list .= '            <li>'.$val.'</li>'.$nl;
5787 5787
                 }
5788
-                $list .= '        </ul></li>' . $nl;
5788
+                $list .= '        </ul></li>'.$nl;
5789 5789
             }
5790 5790
         }
5791
-        $list .= !$first ? '</ul>' . $nl : '';
5791
+        $list .= !$first ? '</ul>'.$nl : '';
5792 5792
 
5793 5793
         return $list;
5794 5794
     }
@@ -5864,7 +5864,7 @@  discard block
 block discarded – undo
5864 5864
      */
5865 5865
     public function addSnippet($name, $phpCode)
5866 5866
     {
5867
-        $this->snippetCache['#' . $name] = $phpCode;
5867
+        $this->snippetCache['#'.$name] = $phpCode;
5868 5868
     }
5869 5869
 
5870 5870
     /**
@@ -5873,7 +5873,7 @@  discard block
 block discarded – undo
5873 5873
      */
5874 5874
     public function addChunk($name, $text)
5875 5875
     {
5876
-        $this->chunkCache['#' . $name] = $text;
5876
+        $this->chunkCache['#'.$name] = $text;
5877 5877
     }
5878 5878
 
5879 5879
     /**
@@ -5909,7 +5909,7 @@  discard block
 block discarded – undo
5909 5909
         }
5910 5910
 
5911 5911
         if (!$isSafe) {
5912
-            $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true);
5912
+            $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true);
5913 5913
             $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50)));
5914 5914
             $this->messageQuit($title, '', true, '', '', 'Parser', $msg);
5915 5915
             return;
@@ -5923,7 +5923,7 @@  discard block
 block discarded – undo
5923 5923
             return 'array()';
5924 5924
         }
5925 5925
 
5926
-        $output = $echo . $return;
5926
+        $output = $echo.$return;
5927 5927
         modx_sanitize_gpc($output);
5928 5928
         return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous
5929 5929
     }
@@ -5941,8 +5941,8 @@  discard block
 block discarded – undo
5941 5941
 
5942 5942
         $safe = explode(',', $safe_functions);
5943 5943
 
5944
-        $phpcode = rtrim($phpcode, ';') . ';';
5945
-        $tokens = token_get_all('<?php ' . $phpcode);
5944
+        $phpcode = rtrim($phpcode, ';').';';
5945
+        $tokens = token_get_all('<?php '.$phpcode);
5946 5946
         foreach ($tokens as $i => $token) {
5947 5947
             if (!is_array($token)) {
5948 5948
                 continue;
@@ -5978,7 +5978,7 @@  discard block
 block discarded – undo
5978 5978
     public function atBindFileContent($str = '')
5979 5979
     {
5980 5980
 
5981
-        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', '');
5981
+        $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', '');
5982 5982
 
5983 5983
         if (stripos($str, '@FILE') !== 0) {
5984 5984
             return $str;
@@ -6001,7 +6001,7 @@  discard block
 block discarded – undo
6001 6001
         $errorMsg = sprintf("Could not retrieve string '%s'.", $str);
6002 6002
 
6003 6003
         foreach ($search_path as $path) {
6004
-            $file_path = MODX_BASE_PATH . $path . $str;
6004
+            $file_path = MODX_BASE_PATH.$path.$str;
6005 6005
             if (strpos($file_path, MODX_MANAGER_PATH) === 0) {
6006 6006
                 return $errorMsg;
6007 6007
             } elseif (is_file($file_path)) {
@@ -6015,7 +6015,7 @@  discard block
 block discarded – undo
6015 6015
             return $errorMsg;
6016 6016
         }
6017 6017
 
6018
-        $content = (string)file_get_contents($file_path);
6018
+        $content = (string) file_get_contents($file_path);
6019 6019
         if ($content === false) {
6020 6020
             return $errorMsg;
6021 6021
         }
@@ -6128,22 +6128,22 @@  discard block
 block discarded – undo
6128 6128
 
6129 6129
         $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : '';
6130 6130
         $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : '';
6131
-        $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI'];
6131
+        $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI'];
6132 6132
         $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']);
6133 6133
         $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']);
6134 6134
         $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']);
6135 6135
         if ($is_error) {
6136 6136
             $str = '<h2 style="color:red">&laquo; Evo Parse Error &raquo;</h2>';
6137 6137
             if ($msg != 'PHP Parse Error') {
6138
-                $str .= '<h3 style="color:red">' . $msg . '</h3>';
6138
+                $str .= '<h3 style="color:red">'.$msg.'</h3>';
6139 6139
             }
6140 6140
         } else {
6141 6141
             $str = '<h2 style="color:#003399">&laquo; Evo Debug/ stop message &raquo;</h2>';
6142
-            $str .= '<h3 style="color:#003399">' . $msg . '</h3>';
6142
+            $str .= '<h3 style="color:#003399">'.$msg.'</h3>';
6143 6143
         }
6144 6144
 
6145 6145
         if (!empty ($query)) {
6146
-            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">' . $query . '</span></div>';
6146
+            $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL &gt; <span id="sqlHolder">'.$query.'</span></div>';
6147 6147
         }
6148 6148
 
6149 6149
         $errortype = array(
@@ -6166,13 +6166,13 @@  discard block
 block discarded – undo
6166 6166
 
6167 6167
         if (!empty($nr) || !empty($file)) {
6168 6168
             if ($text != '') {
6169
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>';
6169
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>';
6170 6170
             }
6171 6171
             if ($output != '') {
6172
-                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>';
6172
+                $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>';
6173 6173
             }
6174 6174
             if ($nr !== '') {
6175
-                $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]");
6175
+                $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]");
6176 6176
             }
6177 6177
             if ($file) {
6178 6178
                 $table[] = array('File', $file);
@@ -6192,7 +6192,7 @@  discard block
 block discarded – undo
6192 6192
         }
6193 6193
 
6194 6194
         if (!empty($this->event->activePlugin)) {
6195
-            $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')');
6195
+            $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')');
6196 6196
         }
6197 6197
 
6198 6198
         $str .= $MakeTable->create($table, array('Error information', ''));
@@ -6202,17 +6202,17 @@  discard block
 block discarded – undo
6202 6202
         $table[] = array('REQUEST_URI', $request_uri);
6203 6203
 
6204 6204
         if ($this->manager->action) {
6205
-            include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
6205
+            include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
6206 6206
             global $action_list;
6207 6207
             $actionName = (isset($action_list[$this->manager->action])) ? " - {$action_list[$this->manager->action]}" : '';
6208 6208
 
6209
-            $table[] = array('Manager action', $this->manager->action . $actionName);
6209
+            $table[] = array('Manager action', $this->manager->action.$actionName);
6210 6210
         }
6211 6211
 
6212 6212
         if (preg_match('@^[0-9]+@', $this->documentIdentifier)) {
6213 6213
             $resource = $this->getDocumentObject('id', $this->documentIdentifier);
6214 6214
             $url = $this->makeUrl($this->documentIdentifier, '', '', 'full');
6215
-            $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>');
6215
+            $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>');
6216 6216
         }
6217 6217
         $table[] = array('Referer', $referer);
6218 6218
         $table[] = array('User Agent', $ua);
@@ -6233,7 +6233,7 @@  discard block
 block discarded – undo
6233 6233
 
6234 6234
         $mem = memory_get_peak_usage(true);
6235 6235
         $total_mem = $mem - $this->mstart;
6236
-        $total_mem = ($total_mem / 1024 / 1024) . ' mb';
6236
+        $total_mem = ($total_mem / 1024 / 1024).' mb';
6237 6237
 
6238 6238
         $queryTime = $this->queryTime;
6239 6239
         $phpTime = $totalTime - $queryTime;
@@ -6254,18 +6254,18 @@  discard block
 block discarded – undo
6254 6254
         $str .= $this->get_backtrace(debug_backtrace());
6255 6255
         // Log error
6256 6256
         if (!empty($this->currentSnippet)) {
6257
-            $source = 'Snippet - ' . $this->currentSnippet;
6257
+            $source = 'Snippet - '.$this->currentSnippet;
6258 6258
         } elseif (!empty($this->event->activePlugin)) {
6259
-            $source = 'Plugin - ' . $this->event->activePlugin;
6259
+            $source = 'Plugin - '.$this->event->activePlugin;
6260 6260
         } elseif ($source !== '') {
6261
-            $source = 'Parser - ' . $source;
6261
+            $source = 'Parser - '.$source;
6262 6262
         } elseif ($query !== '') {
6263 6263
             $source = 'SQL Query';
6264 6264
         } else {
6265 6265
             $source = 'Parser';
6266 6266
         }
6267 6267
         if ($msg) {
6268
-            $source .= ' / ' . $msg;
6268
+            $source .= ' / '.$msg;
6269 6269
         }
6270 6270
         if (isset($actionName) && !empty($actionName)) {
6271 6271
             $source .= $actionName;
@@ -6297,12 +6297,12 @@  discard block
 block discarded – undo
6297 6297
 
6298 6298
         // Display error
6299 6299
         if (isset($_SESSION['mgrValidated'])) {
6300
-            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager ' . $version . ' &raquo; ' . $release_date . '</title>
6300
+            echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager '.$version.' &raquo; '.$release_date.'</title>
6301 6301
                  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6302
-                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" />
6302
+                 <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" />
6303 6303
                  <style type="text/css">body { padding:10px; } td {font:inherit;}</style>
6304 6304
                  </head><body>
6305
-                 ' . $str . '</body></html>';
6305
+                 ' . $str.'</body></html>';
6306 6306
 
6307 6307
         } else {
6308 6308
             echo 'Error';
@@ -6340,7 +6340,7 @@  discard block
 block discarded – undo
6340 6340
             switch ($val['type']) {
6341 6341
                 case '->':
6342 6342
                 case '::':
6343
-                    $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function'];
6343
+                    $functionName = $val['function'] = $val['class'].$val['type'].$val['function'];
6344 6344
                     break;
6345 6345
                 default:
6346 6346
                     $functionName = $val['function'];
@@ -6350,7 +6350,7 @@  discard block
 block discarded – undo
6350 6350
             $args = array_pad(array(), $_, '$var');
6351 6351
             $args = implode(", ", $args);
6352 6352
             $modx = &$this;
6353
-            $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) {
6353
+            $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) {
6354 6354
                 $arg = $val['args'][$tmp - 1];
6355 6355
                 switch (true) {
6356 6356
                     case is_null($arg):
@@ -6365,7 +6365,7 @@  discard block
 block discarded – undo
6365 6365
                         }
6366 6366
                     case is_scalar($arg):
6367 6367
                         {
6368
-                            $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'");
6368
+                            $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->htmlspecialchars(str_replace("'", "\\'", $arg))."'");
6369 6369
                             break;
6370 6370
                         }
6371 6371
                     case is_bool($arg):
@@ -6375,25 +6375,25 @@  discard block
 block discarded – undo
6375 6375
                         }
6376 6376
                     case is_array($arg):
6377 6377
                         {
6378
-                            $out = 'array $var' . $tmp;
6378
+                            $out = 'array $var'.$tmp;
6379 6379
                             break;
6380 6380
                         }
6381 6381
                     case is_object($arg):
6382 6382
                         {
6383
-                            $out = get_class($arg) . ' $var' . $tmp;
6383
+                            $out = get_class($arg).' $var'.$tmp;
6384 6384
                             break;
6385 6385
                         }
6386 6386
                     default:
6387 6387
                         {
6388
-                            $out = '$var' . $tmp;
6388
+                            $out = '$var'.$tmp;
6389 6389
                         }
6390 6390
                 }
6391 6391
                 $tmp++;
6392 6392
                 return $out;
6393 6393
             }, $args);
6394 6394
             $line = array(
6395
-                "<strong>" . $functionName . "</strong>(" . $args . ")",
6396
-                $path . " on line " . $val['line']
6395
+                "<strong>".$functionName."</strong>(".$args.")",
6396
+                $path." on line ".$val['line']
6397 6397
             );
6398 6398
             $table[] = array(implode("<br />", $line));
6399 6399
         }
@@ -6434,7 +6434,7 @@  discard block
 block discarded – undo
6434 6434
             $alias = strip_tags($alias); // strip HTML
6435 6435
             $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters
6436 6436
             $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash
6437
-            $alias = preg_replace('/-+/', '-', $alias);  // convert multiple dashes to one
6437
+            $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one
6438 6438
             $alias = trim($alias, '-'); // trim excess
6439 6439
             return $alias;
6440 6440
         }
@@ -6450,7 +6450,7 @@  discard block
 block discarded – undo
6450 6450
         $precisions = count($sizes) - 1;
6451 6451
         foreach ($sizes as $unit => $bytes) {
6452 6452
             if ($size >= $bytes) {
6453
-                return number_format($size / $bytes, $precisions) . ' ' . $unit;
6453
+                return number_format($size / $bytes, $precisions).' '.$unit;
6454 6454
             }
6455 6455
             $precisions--;
6456 6456
         }
@@ -6554,10 +6554,10 @@  discard block
 block discarded – undo
6554 6554
 
6555 6555
         if (strpos($str, MODX_MANAGER_PATH) === 0) {
6556 6556
             return false;
6557
-        } elseif (is_file(MODX_BASE_PATH . $str)) {
6558
-            $file_path = MODX_BASE_PATH . $str;
6559
-        } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) {
6560
-            $file_path = MODX_BASE_PATH . $tpl_dir . $str;
6557
+        } elseif (is_file(MODX_BASE_PATH.$str)) {
6558
+            $file_path = MODX_BASE_PATH.$str;
6559
+        } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) {
6560
+            $file_path = MODX_BASE_PATH.$tpl_dir.$str;
6561 6561
         } else {
6562 6562
             return false;
6563 6563
         }
@@ -6683,7 +6683,7 @@  discard block
 block discarded – undo
6683 6683
             $title = 'no title';
6684 6684
         }
6685 6685
         if (is_array($msg)) {
6686
-            $msg = '<pre>' . print_r($msg, true) . '</pre>';
6686
+            $msg = '<pre>'.print_r($msg, true).'</pre>';
6687 6687
         } elseif ($msg === '') {
6688 6688
             $msg = $_SERVER['REQUEST_URI'];
6689 6689
         }
@@ -6728,7 +6728,7 @@  discard block
 block discarded – undo
6728 6728
         if (is_array($SystemAlertMsgQueque)) {
6729 6729
             $title = '';
6730 6730
             if ($this->name && $this->activePlugin) {
6731
-                $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>";
6731
+                $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>";
6732 6732
             }
6733 6733
             $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>";
6734 6734
         }
Please login to merge, or discard this patch.