Completed
Pull Request — develop (#716)
by Agel_Nash
09:00
created
manager/includes/src/ManagerTheme.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     {
39 39
         $found = $this->core->findElements(
40 40
             'chunk',
41
-            MODX_MANAGER_PATH . 'media/style/'. $this->theme .'/snippets/',
41
+            MODX_MANAGER_PATH.'media/style/'.$this->theme.'/snippets/',
42 42
             array('php')
43 43
         );
44 44
         foreach ($found as $name => $code) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $found = $this->core->findElements(
52 52
             'chunk',
53
-            MODX_MANAGER_PATH . 'media/style/'. $this->theme .'/chunks/',
53
+            MODX_MANAGER_PATH.'media/style/'.$this->theme.'/chunks/',
54 54
             array('tpl', 'html')
55 55
         );
56 56
         foreach ($found as $name => $code) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $this->core->addSnippet(
64 64
             $name,
65 65
             $code,
66
-            $this->templateNamespace  . '#',
66
+            $this->templateNamespace.'#',
67 67
             array(
68 68
                 'managerTheme' => $this
69 69
             )
@@ -72,6 +72,6 @@  discard block
 block discarded – undo
72 72
 
73 73
     public function addChunk($name, $code)
74 74
     {
75
-        $this->core->addChunk($name, $code, $this->templateNamespace . '#');
75
+        $this->core->addChunk($name, $code, $this->templateNamespace.'#');
76 76
     }
77 77
 }
Please login to merge, or discard this patch.
manager/actions/welcome.static.php 3 patches
Indentation   +144 added lines, -144 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
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 8
 if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9
-	// seems to be a new install - send the user to the configuration page
10
-	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
9
+    // seems to be a new install - send the user to the configuration page
10
+    exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
12 12
 
13 13
 // set placeholders
@@ -17,93 +17,93 @@  discard block
 block discarded – undo
17 17
 
18 18
 // setup message info
19 19
 if($modx->hasPermission('messages')) {
20
-	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
-	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
-	$_SESSION['nrnewmessages'] = $nrnewmessages;
23
-
24
-	$msg = array();
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>)' : '';
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';
29
-	$welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
-	$msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
-	$ph['MessageInfo'] = implode("\n", $msg);
20
+    include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21
+    $_SESSION['nrtotalmessages'] = $nrtotalmessages;
22
+    $_SESSION['nrnewmessages'] = $nrnewmessages;
23
+
24
+    $msg = array();
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>)' : '';
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';
29
+    $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages);
30
+    $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
31
+    $ph['MessageInfo'] = implode("\n", $msg);
32 32
 }
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36 36
 if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37
-	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
-	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
37
+    $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
+    $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40 40
 if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41
-	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
-	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
41
+    $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
+    $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44 44
 if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45
-	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
-	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
45
+    $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
+    $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48 48
 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')) {
49
-	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
-	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
49
+    $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
+    $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52 52
 if($modx->hasPermission('bk_manager')) {
53
-	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
-	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
53
+    $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
+    $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56 56
 if($modx->hasPermission('help')) {
57
-	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
-	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
57
+    $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
+    $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61 61
 if($modx->hasPermission('new_document')) {
62
-	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
-	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
-	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
-	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
62
+    $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
+    $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64
+    $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
+    $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67 67
 if($modx->hasPermission('assets_images')) {
68
-	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
-	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
68
+    $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
+    $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71 71
 if($modx->hasPermission('assets_files')) {
72
-	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
-	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
72
+    $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
+    $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75 75
 if($modx->hasPermission('change_password')) {
76
-	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
-	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
76
+    $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
+    $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
79 79
 $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]';
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83 83
 if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
86
-		$ph['config_check_results'] = $config_check_results;
87
-		$ph['config_display'] = 'block';
88
-	} else {
89
-		$ph['config_display'] = 'none';
90
-	}
84
+    include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
+    if($config_check_results != $_lang['configcheck_ok']) {
86
+        $ph['config_check_results'] = $config_check_results;
87
+        $ph['config_display'] = 'block';
88
+    } else {
89
+        $ph['config_display'] = 'none';
90
+    }
91 91
 } else {
92
-	$ph['config_display'] = 'none';
92
+    $ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96 96
 if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
98
-		case 'logout_reminder':
99
-			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
-			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
-			break;
102
-	}
103
-	$ph['show_logout_reminder'] = 'block';
104
-	unset($_SESSION['show_logout_reminder']);
97
+    switch($_SESSION['show_logout_reminder']['type']) {
98
+        case 'logout_reminder':
99
+            $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100
+            $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
101
+            break;
102
+    }
103
+    $ph['show_logout_reminder'] = 'block';
104
+    unset($_SESSION['show_logout_reminder']);
105 105
 } else {
106
-	$ph['show_logout_reminder'] = 'none';
106
+    $ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
109 109
 // Check multiple sessions
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
 $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
152 152
 
153 153
 $ph['UserInfo'] = $modx->parseText($tpl, array(
154
-	'username' => $modx->getLoginUserName(),
155
-	'role' => $_SESSION['mgrPermissions']['name'],
156
-	'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
-	'logincount' => $_SESSION['mgrLogincount'] + 1,
158
-	'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
154
+    'username' => $modx->getLoginUserName(),
155
+    'role' => $_SESSION['mgrPermissions']['name'],
156
+    'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time),
157
+    'logincount' => $_SESSION['mgrLogincount'] + 1,
158
+    'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages)
159 159
 ));
160 160
 
161 161
 $from = array();
@@ -164,13 +164,13 @@  discard block
 block discarded – undo
164 164
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166 166
 if($modx->db->getRecordCount($rs) < 1) {
167
-	$html = '<p>[%no_active_users_found%]</p>';
167
+    $html = '<p>[%no_active_users_found%]</p>';
168 168
 } else {
169
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
-	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
-	$ph['now'] = strftime('%H:%M:%S', $now);
172
-	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
-	$html = '
169
+    include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170
+    $now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171
+    $ph['now'] = strftime('%H:%M:%S', $now);
172
+    $timetocheck = ($now - (60 * 20)); //+$server_offset_time;
173
+    $html = '
174 174
 	<div class="card-body">
175 175
 		[%onlineusers_message%] 
176 176
 		<b>[+now+]</b>):
@@ -188,33 +188,33 @@  discard block
 block discarded – undo
188 188
 	</thead>
189 189
 	<tbody>';
190 190
 
191
-	$userList = array();
192
-	$userCount = array();
193
-	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->db->getRow($rs)) {
195
-		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
-
197
-		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
-		$webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
-		$ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
-		$currentaction = getAction($activeusers['action'], $activeusers['id']);
201
-		$userList[] = array(
202
-			$idle,
203
-			'',
204
-			$activeusers['username'],
205
-			$webicon,
206
-			abs($activeusers['internalKey']),
207
-			$ip,
208
-			strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
-			$currentaction
210
-		);
211
-	}
212
-	foreach($userList as $params) {
213
-		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
-		$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);
215
-	}
216
-
217
-	$html .= '
191
+    $userList = array();
192
+    $userCount = array();
193
+    // Create userlist with session-count first before output
194
+    while($activeusers = $modx->db->getRow($rs)) {
195
+        $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196
+
197
+        $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
198
+        $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" />&nbsp;' : '';
199
+        $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip'];
200
+        $currentaction = getAction($activeusers['action'], $activeusers['id']);
201
+        $userList[] = array(
202
+            $idle,
203
+            '',
204
+            $activeusers['username'],
205
+            $webicon,
206
+            abs($activeusers['internalKey']),
207
+            $ip,
208
+            strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
209
+            $currentaction
210
+        );
211
+    }
212
+    foreach($userList as $params) {
213
+        $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
+        $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);
215
+    }
216
+
217
+    $html .= '
218 218
 	</tbody>
219 219
 	</table>
220 220
 </div>
@@ -255,17 +255,17 @@  discard block
 block discarded – undo
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257 257
 if(is_array($evtOut)) {
258
-	$output = implode('', $evtOut);
259
-	$ph['OnManagerWelcomePrerender'] = $output;
258
+    $output = implode('', $evtOut);
259
+    $ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
261 261
 
262 262
 $widgets['welcome'] = array(
263
-	'menuindex' => '10',
264
-	'id' => 'welcome',
265
-	'cols' => 'col-lg-6',
266
-	'icon' => 'fa-home',
267
-	'title' => '[%welcome_title%]',
268
-	'body' => '
263
+    'menuindex' => '10',
264
+    'id' => 'welcome',
265
+    'cols' => 'col-lg-6',
266
+    'icon' => 'fa-home',
267
+    'title' => '[%welcome_title%]',
268
+    'body' => '
269 269
 				<div class="wm_buttons card-body"> 
270 270
 					<!--@IF:[[#hasPermission?key=new_document]]--> 
271 271
 					<span class="wm_button">
@@ -339,25 +339,25 @@  discard block
 block discarded – undo
339 339
 					</table>
340 340
 				</div>
341 341
 		',
342
-	'hide'=>'0'
342
+    'hide'=>'0'
343 343
 );
344 344
 $widgets['onlineinfo'] = array(
345
-	'menuindex' => '20',
346
-	'id' => 'onlineinfo',
347
-	'cols' => 'col-lg-6',
348
-	'icon' => 'fa-user',
349
-	'title' => '[%onlineusers_title%]',
350
-	'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
-	'hide'=>'0'
345
+    'menuindex' => '20',
346
+    'id' => 'onlineinfo',
347
+    'cols' => 'col-lg-6',
348
+    'icon' => 'fa-user',
349
+    'title' => '[%onlineusers_title%]',
350
+    'body' => '<div class="userstable">[+OnlineInfo+]</div>',
351
+    'hide'=>'0'
352 352
 );
353 353
 $widgets['recentinfo'] = array(
354
-	'menuindex' => '30',
355
-	'id' => 'modxrecent_widget',
356
-	'cols' => 'col-sm-12',
357
-	'icon' => 'fa-pencil-square-o',
358
-	'title' => '[%activity_title%]',
359
-	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
-	'hide'=>'0'
354
+    'menuindex' => '30',
355
+    'id' => 'modxrecent_widget',
356
+    'cols' => 'col-sm-12',
357
+    'icon' => 'fa-pencil-square-o',
358
+    'title' => '[%activity_title%]',
359
+    'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360
+    'hide'=>'0'
361 361
 );
362 362
 if ($modx->config['rss_url_news']) {
363 363
     $widgets['news'] = array(
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387 387
 if(is_array($sitewidgets)) {
388
-	$newwidgets = array();
388
+    $newwidgets = array();
389 389
     foreach($sitewidgets as $widget){
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
@@ -393,21 +393,21 @@  discard block
 block discarded – undo
393 393
 }
394 394
 
395 395
 usort($widgets, function ($a, $b) {
396
-	return $a['menuindex'] - $b['menuindex'];
396
+    return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401 401
 foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
403
-		$output .= $modx->parseText($tpl, $widget);
404
-	}
402
+    if ($widget['hide'] != '1'){
403
+        $output .= $modx->parseText($tpl, $widget);
404
+    }
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409 409
 if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
410
+    $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
411 411
 }
412 412
 
413 413
 $target = $modx->config['manager_welcome_tpl'];
@@ -415,27 +415,27 @@  discard block
 block discarded – undo
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417 417
 if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
419
-		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
421
-		$content = file_get_contents(trim(substr($target, 6)));
422
-	} else {
423
-		$content = '';
424
-	}
418
+    if(substr($target, 0, 6) === '@CHUNK') {
419
+        $content = $modx->getChunk(trim(substr($target, 7)));
420
+    } elseif(substr($target, 0, 5) === '@FILE') {
421
+        $content = file_get_contents(trim(substr($target, 6)));
422
+    } else {
423
+        $content = '';
424
+    }
425 425
 } else {
426
-	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
428
-		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
-		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
-	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
-	} else {
437
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
-	}
426
+    $chunk = $modx->getChunk($target);
427
+    if($chunk !== false && !empty($chunk)) {
428
+        $content = $chunk;
429
+    } elseif(is_file(MODX_BASE_PATH . $target)) {
430
+        $content = file_get_contents(MODX_BASE_PATH . $target);
431
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
+    } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
+    {
435
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
+    } else {
437
+        $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438
+    }
439 439
 }
440 440
 
441 441
 // merge placeholders
@@ -443,8 +443,8 @@  discard block
 block discarded – undo
443 443
 $content = $modx->mergeSettingsContent($content);
444 444
 $content = $modx->parseText($content, $ph);
445 445
 if(strpos($content, '[+') !== false) {
446
-	$modx->toPlaceholders($ph);
447
-	$content = $modx->mergePlaceholderContent($content);
446
+    $modx->toPlaceholders($ph);
447
+    $content = $modx->mergePlaceholderContent($content);
448 448
 }
449 449
 $content = $modx->parseDocumentSource($content);
450 450
 $content = $modx->parseText($content, $_lang, '[%', '%]');
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 453
 
454 454
 if($js = $modx->getRegisteredClientScripts()) {
455
-	$content .= $js;
455
+    $content .= $js;
456 456
 }
457 457
 
458 458
 echo $content;
Please login to merge, or discard this patch.
Spacing   +61 added lines, -61 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,16 +16,16 @@  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);
@@ -33,56 +33,56 @@  discard block
 block discarded – undo
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
+if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37 37
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38
-	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
38
+	$ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75);
39 39
 }
40
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
+if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41 41
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42
-	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
42
+	$ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99);
43 43
 }
44
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
+if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45 45
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46
-	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
46
+	$ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106);
47 47
 }
48
-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
+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')) {
49 49
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50
-	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
50
+	$ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76);
51 51
 }
52
-if($modx->hasPermission('bk_manager')) {
52
+if ($modx->hasPermission('bk_manager')) {
53 53
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54
-	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
54
+	$ph['BackupIcon'] = sprintf($iconTpl, $icon, 93);
55 55
 }
56
-if($modx->hasPermission('help')) {
56
+if ($modx->hasPermission('help')) {
57 57
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58
-	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
58
+	$ph['HelpIcon'] = sprintf($iconTpl, $icon, 9);
59 59
 }
60 60
 
61
-if($modx->hasPermission('new_document')) {
61
+if ($modx->hasPermission('new_document')) {
62 62
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63
-	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
63
+	$ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4);
64 64
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65
-	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
65
+	$ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72);
66 66
 }
67
-if($modx->hasPermission('assets_images')) {
67
+if ($modx->hasPermission('assets_images')) {
68 68
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69
-	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
69
+	$ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72);
70 70
 }
71
-if($modx->hasPermission('assets_files')) {
71
+if ($modx->hasPermission('assets_files')) {
72 72
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73
-	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
73
+	$ph['FilesIcon'] = sprintf($iconTpl, $icon, 72);
74 74
 }
75
-if($modx->hasPermission('change_password')) {
75
+if ($modx->hasPermission('change_password')) {
76 76
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77
-	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
77
+	$ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28);
78 78
 }
79 79
 $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]';
80
-$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
80
+$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8);
81 81
 
82 82
 // do some config checks
83
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
-	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
83
+if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84
+	include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php');
85
+	if ($config_check_results != $_lang['configcheck_ok']) {
86 86
 		$ph['config_check_results'] = $config_check_results;
87 87
 		$ph['config_display'] = 'block';
88 88
 	} else {
@@ -93,8 +93,8 @@  discard block
 block discarded – undo
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96
-if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
96
+if (isset($_SESSION['show_logout_reminder'])) {
97
+	switch ($_SESSION['show_logout_reminder']['type']) {
98 98
 		case 'logout_reminder':
99 99
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100 100
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	</tr>
149 149
 </table>';
150 150
 
151
-$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>';
151
+$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>';
152 152
 
153 153
 $ph['UserInfo'] = $modx->parseText($tpl, array(
154 154
 	'username' => $modx->getLoginUserName(),
@@ -163,10 +163,10 @@  discard block
 block discarded – undo
163 163
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
164 164
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166
-if($modx->db->getRecordCount($rs) < 1) {
166
+if ($modx->db->getRecordCount($rs) < 1) {
167 167
 	$html = '<p>[%no_active_users_found%]</p>';
168 168
 } else {
169
-	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
169
+	include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php');
170 170
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171 171
 	$ph['now'] = strftime('%H:%M:%S', $now);
172 172
 	$timetocheck = ($now - (60 * 20)); //+$server_offset_time;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	$userList = array();
192 192
 	$userCount = array();
193 193
 	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->db->getRow($rs)) {
194
+	while ($activeusers = $modx->db->getRow($rs)) {
195 195
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196 196
 
197 197
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
 			$currentaction
210 210
 		);
211 211
 	}
212
-	foreach($userList as $params) {
212
+	foreach ($userList as $params) {
213 213
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214
-		$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
+		$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);
215 215
 	}
216 216
 
217 217
 	$html .= '
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 $ph['OnlineInfo'] = $html;
224 224
 
225 225
 // include rss feeds for important forum topics
226
-include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php');
226
+include_once(MODX_MANAGER_PATH.'includes/rss.inc.php');
227 227
 $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content'];
228 228
 $ph['modx_news_content'] = $feedData['modx_news_content'];
229 229
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257
-if(is_array($evtOut)) {
257
+if (is_array($evtOut)) {
258 258
 	$output = implode('', $evtOut);
259 259
 	$ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
@@ -384,57 +384,57 @@  discard block
 block discarded – undo
384 384
 
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387
-if(is_array($sitewidgets)) {
387
+if (is_array($sitewidgets)) {
388 388
 	$newwidgets = array();
389
-    foreach($sitewidgets as $widget){
389
+    foreach ($sitewidgets as $widget) {
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
392 392
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
393 393
 }
394 394
 
395
-usort($widgets, function ($a, $b) {
395
+usort($widgets, function($a, $b){
396 396
 	return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401
-foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
401
+foreach ($widgets as $widget) {
402
+	if ($widget['hide'] != '1') {
403 403
 		$output .= $modx->parseText($tpl, $widget);
404 404
 	}
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
-	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
409
+if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
+	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl';
411 411
 }
412 412
 
413 413
 $target = $modx->config['manager_welcome_tpl'];
414 414
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417
-if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
417
+if (substr($target, 0, 1) === '@') {
418
+	if (substr($target, 0, 6) === '@CHUNK') {
419 419
 		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
420
+	} elseif (substr($target, 0, 5) === '@FILE') {
421 421
 		$content = file_get_contents(trim(substr($target, 6)));
422 422
 	} else {
423 423
 		$content = '';
424 424
 	}
425 425
 } else {
426 426
 	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
427
+	if ($chunk !== false && !empty($chunk)) {
428 428
 		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
-		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
429
+	} elseif (is_file(MODX_BASE_PATH.$target)) {
430
+		$content = file_get_contents(MODX_BASE_PATH.$target);
431
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
432
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl');
433
+	} elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible
434 434
 	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
435
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html');
436 436
 	} else {
437
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
437
+		$content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl');
438 438
 	}
439 439
 }
440 440
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 $content = $modx->mergeConditionalTagsContent($content);
443 443
 $content = $modx->mergeSettingsContent($content);
444 444
 $content = $modx->parseText($content, $ph);
445
-if(strpos($content, '[+') !== false) {
445
+if (strpos($content, '[+') !== false) {
446 446
 	$modx->toPlaceholders($ph);
447 447
 	$content = $modx->mergePlaceholderContent($content);
448 448
 }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 $content = $modx->parseText($content, $_style, '[&', '&]');
452 452
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 453
 
454
-if($js = $modx->getRegisteredClientScripts()) {
454
+if ($js = $modx->getRegisteredClientScripts()) {
455 455
 	$content .= $js;
456 456
 }
457 457
 
Please login to merge, or discard this patch.
Braces   +48 added lines, -46 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,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
19
+if($modx->hasPermission('messages')) {
20 20
 	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
@@ -33,46 +33,46 @@  discard block
 block discarded – undo
33 33
 
34 34
 $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
35 35
 // setup icons
36
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
+if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37 37
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38 38
 	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
+if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41 41
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42 42
 	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45 45
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46 46
 	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48
-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
+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')) {
49 49
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50 50
 	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52
-if($modx->hasPermission('bk_manager')) {
52
+if($modx->hasPermission('bk_manager')) {
53 53
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54 54
 	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56
-if($modx->hasPermission('help')) {
56
+if($modx->hasPermission('help')) {
57 57
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58 58
 	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61
-if($modx->hasPermission('new_document')) {
61
+if($modx->hasPermission('new_document')) {
62 62
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63 63
 	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64 64
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65 65
 	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67
-if($modx->hasPermission('assets_images')) {
67
+if($modx->hasPermission('assets_images')) {
68 68
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69 69
 	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71
-if($modx->hasPermission('assets_files')) {
71
+if($modx->hasPermission('assets_files')) {
72 72
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73 73
 	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75
-if($modx->hasPermission('change_password')) {
75
+if($modx->hasPermission('change_password')) {
76 76
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77 77
 	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
@@ -80,21 +80,21 @@  discard block
 block discarded – undo
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
+if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84 84
 	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
85
+	if($config_check_results != $_lang['configcheck_ok']) {
86 86
 		$ph['config_check_results'] = $config_check_results;
87 87
 		$ph['config_display'] = 'block';
88
-	} else {
88
+	} else {
89 89
 		$ph['config_display'] = 'none';
90 90
 	}
91
-} else {
91
+} else {
92 92
 	$ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96
-if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
96
+if(isset($_SESSION['show_logout_reminder'])) {
97
+	switch($_SESSION['show_logout_reminder']['type']) {
98 98
 		case 'logout_reminder':
99 99
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100 100
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	}
103 103
 	$ph['show_logout_reminder'] = 'block';
104 104
 	unset($_SESSION['show_logout_reminder']);
105
-} else {
105
+} else {
106 106
 	$ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
164 164
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
165 165
 
166
-if($modx->db->getRecordCount($rs) < 1) {
166
+if($modx->db->getRecordCount($rs) < 1) {
167 167
 	$html = '<p>[%no_active_users_found%]</p>';
168
-} else {
168
+} else {
169 169
 	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
170 170
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
171 171
 	$ph['now'] = strftime('%H:%M:%S', $now);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	$userList = array();
192 192
 	$userCount = array();
193 193
 	// Create userlist with session-count first before output
194
-	while($activeusers = $modx->db->getRow($rs)) {
194
+	while($activeusers = $modx->db->getRow($rs)) {
195 195
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
196 196
 
197 197
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 			$currentaction
210 210
 		);
211 211
 	}
212
-	foreach($userList as $params) {
212
+	foreach($userList as $params) {
213 213
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
214 214
 		$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);
215 215
 	}
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 // invoke event OnManagerWelcomePrerender
256 256
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
257
-if(is_array($evtOut)) {
257
+if(is_array($evtOut)) {
258 258
 	$output = implode('', $evtOut);
259 259
 	$ph['OnManagerWelcomePrerender'] = $output;
260 260
 }
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
360 360
 	'hide'=>'0'
361 361
 );
362
-if ($modx->config['rss_url_news']) {
362
+if ($modx->config['rss_url_news']) {
363 363
     $widgets['news'] = array(
364 364
         'menuindex' => '40',
365 365
         'id' => 'news',
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         'hide'=>'0'
371 371
     );
372 372
 }
373
-if ($modx->config['rss_url_security']) {
373
+if ($modx->config['rss_url_security']) {
374 374
     $widgets['security'] = array(
375 375
         'menuindex' => '50',
376 376
         'id' => 'security',
@@ -384,29 +384,29 @@  discard block
 block discarded – undo
384 384
 
385 385
 // invoke OnManagerWelcomeHome event
386 386
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
387
-if(is_array($sitewidgets)) {
387
+if(is_array($sitewidgets)) {
388 388
 	$newwidgets = array();
389
-    foreach($sitewidgets as $widget){
389
+    foreach($sitewidgets as $widget) {
390 390
         $newwidgets = array_merge($newwidgets, unserialize($widget));
391 391
     }
392 392
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
393 393
 }
394 394
 
395
-usort($widgets, function ($a, $b) {
395
+usort($widgets, function ($a, $b){
396 396
 	return $a['menuindex'] - $b['menuindex'];
397 397
 });
398 398
 
399 399
 $tpl = $modx->getChunk('manager#welcome\Widget');
400 400
 $output = '';
401
-foreach($widgets as $widget) {
402
-	if ($widget['hide'] != '1'){
401
+foreach($widgets as $widget) {
402
+	if ($widget['hide'] != '1') {
403 403
 		$output .= $modx->parseText($tpl, $widget);
404 404
 	}
405 405
 }
406 406
 $ph['widgets'] = $output;
407 407
 
408 408
 // load template
409
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409
+if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410 410
 	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
411 411
 }
412 412
 
@@ -414,26 +414,28 @@  discard block
 block discarded – undo
414 414
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
415 415
 $target = $modx->mergeSettingsContent($target);
416 416
 
417
-if(substr($target, 0, 1) === '@') {
418
-	if(substr($target, 0, 6) === '@CHUNK') {
417
+if(substr($target, 0, 1) === '@') {
418
+	if(substr($target, 0, 6) === '@CHUNK') {
419 419
 		$content = $modx->getChunk(trim(substr($target, 7)));
420
-	} elseif(substr($target, 0, 5) === '@FILE') {
420
+	} elseif(substr($target, 0, 5) === '@FILE') {
421 421
 		$content = file_get_contents(trim(substr($target, 6)));
422
-	} else {
422
+	} else {
423 423
 		$content = '';
424 424
 	}
425
-} else {
425
+} else {
426 426
 	$chunk = $modx->getChunk($target);
427
-	if($chunk !== false && !empty($chunk)) {
427
+	if($chunk !== false && !empty($chunk)) {
428 428
 		$content = $chunk;
429
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
429
+	} elseif(is_file(MODX_BASE_PATH . $target)) {
430 430
 		$content = file_get_contents(MODX_BASE_PATH . $target);
431
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
431
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432 432
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
433
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
433
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) {
434
+	    // ClipperCMS compatible
434 435
 	{
435
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
-	} else {
436
+		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
437
+	}
438
+	} else {
437 439
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
438 440
 	}
439 441
 }
@@ -442,7 +444,7 @@  discard block
 block discarded – undo
442 444
 $content = $modx->mergeConditionalTagsContent($content);
443 445
 $content = $modx->mergeSettingsContent($content);
444 446
 $content = $modx->parseText($content, $ph);
445
-if(strpos($content, '[+') !== false) {
447
+if(strpos($content, '[+') !== false) {
446 448
 	$modx->toPlaceholders($ph);
447 449
 	$content = $modx->mergePlaceholderContent($content);
448 450
 }
@@ -451,7 +453,7 @@  discard block
 block discarded – undo
451 453
 $content = $modx->parseText($content, $_style, '[&', '&]');
452 454
 $content = $modx->cleanUpMODXTags($content); //cleanup
453 455
 
454
-if($js = $modx->getRegisteredClientScripts()) {
456
+if($js = $modx->getRegisteredClientScripts()) {
455 457
 	$content .= $js;
456 458
 }
457 459
 
Please login to merge, or discard this patch.