@@ -1,13 +1,13 @@ discard block |
||
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,92 +17,92 @@ discard block |
||
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"> <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"> <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 | // setup icons |
35 | 35 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
36 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | - $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
36 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | + $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
38 | 38 | } |
39 | 39 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
40 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | - $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
40 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | + $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
42 | 42 | } |
43 | 43 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
44 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | - $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
44 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | + $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
46 | 46 | } |
47 | 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 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | - $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
48 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | + $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
50 | 50 | } |
51 | 51 | if($modx->hasPermission('bk_manager')) { |
52 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | - $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
52 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | + $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
54 | 54 | } |
55 | 55 | if($modx->hasPermission('help')) { |
56 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | - $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
56 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | + $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if($modx->hasPermission('new_document')) { |
61 | - $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
62 | - $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
63 | - $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
64 | - $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
61 | + $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
62 | + $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
63 | + $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
64 | + $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
65 | 65 | } |
66 | 66 | if($modx->hasPermission('assets_images')) { |
67 | - $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
68 | - $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
67 | + $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
68 | + $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
69 | 69 | } |
70 | 70 | if($modx->hasPermission('assets_files')) { |
71 | - $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
72 | - $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
71 | + $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
72 | + $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
73 | 73 | } |
74 | 74 | if($modx->hasPermission('change_password')) { |
75 | - $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
76 | - $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
75 | + $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
76 | + $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
77 | 77 | } |
78 | 78 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
80 | 80 | |
81 | 81 | // do some config checks |
82 | 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 | - $ph['config_check_results'] = $config_check_results; |
|
86 | - $ph['config_display'] = 'block'; |
|
87 | - } else { |
|
88 | - $ph['config_display'] = 'none'; |
|
89 | - } |
|
83 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
84 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
85 | + $ph['config_check_results'] = $config_check_results; |
|
86 | + $ph['config_display'] = 'block'; |
|
87 | + } else { |
|
88 | + $ph['config_display'] = 'none'; |
|
89 | + } |
|
90 | 90 | } else { |
91 | - $ph['config_display'] = 'none'; |
|
91 | + $ph['config_display'] = 'none'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | // Check logout-reminder |
95 | 95 | if(isset($_SESSION['show_logout_reminder'])) { |
96 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
97 | - case 'logout_reminder': |
|
98 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
99 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
100 | - break; |
|
101 | - } |
|
102 | - $ph['show_logout_reminder'] = 'block'; |
|
103 | - unset($_SESSION['show_logout_reminder']); |
|
96 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
97 | + case 'logout_reminder': |
|
98 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
99 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
100 | + break; |
|
101 | + } |
|
102 | + $ph['show_logout_reminder'] = 'block'; |
|
103 | + unset($_SESSION['show_logout_reminder']); |
|
104 | 104 | } else { |
105 | - $ph['show_logout_reminder'] = 'none'; |
|
105 | + $ph['show_logout_reminder'] = 'none'; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | // Check multiple sessions |
@@ -150,11 +150,11 @@ discard block |
||
150 | 150 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
151 | 151 | |
152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
153 | - 'username' => $modx->getLoginUserName(), |
|
154 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
155 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
156 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
157 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
153 | + 'username' => $modx->getLoginUserName(), |
|
154 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
155 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
156 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
157 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
158 | 158 | )); |
159 | 159 | |
160 | 160 | $from = array(); |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); |
164 | 164 | |
165 | 165 | if($modx->db->getRecordCount($rs) < 1) { |
166 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
166 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
167 | 167 | } else { |
168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
170 | - $ph['now'] = strftime('%H:%M:%S', $now); |
|
171 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
172 | - $html = ' |
|
168 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
170 | + $ph['now'] = strftime('%H:%M:%S', $now); |
|
171 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
172 | + $html = ' |
|
173 | 173 | <div class="card-body"> |
174 | 174 | [%onlineusers_message%] |
175 | 175 | <b>[+now+]</b>): |
@@ -187,33 +187,33 @@ discard block |
||
187 | 187 | </thead> |
188 | 188 | <tbody>'; |
189 | 189 | |
190 | - $userList = array(); |
|
191 | - $userCount = array(); |
|
192 | - // Create userlist with session-count first before output |
|
193 | - while($activeusers = $modx->db->getRow($rs)) { |
|
194 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
195 | - |
|
196 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
197 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
198 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
199 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
200 | - $userList[] = array( |
|
201 | - $idle, |
|
202 | - '', |
|
203 | - $activeusers['username'], |
|
204 | - $webicon, |
|
205 | - abs($activeusers['internalKey']), |
|
206 | - $ip, |
|
207 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
208 | - $currentaction |
|
209 | - ); |
|
210 | - } |
|
211 | - foreach($userList as $params) { |
|
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); |
|
214 | - } |
|
215 | - |
|
216 | - $html .= ' |
|
190 | + $userList = array(); |
|
191 | + $userCount = array(); |
|
192 | + // Create userlist with session-count first before output |
|
193 | + while($activeusers = $modx->db->getRow($rs)) { |
|
194 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
195 | + |
|
196 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
197 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
198 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
199 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
200 | + $userList[] = array( |
|
201 | + $idle, |
|
202 | + '', |
|
203 | + $activeusers['username'], |
|
204 | + $webicon, |
|
205 | + abs($activeusers['internalKey']), |
|
206 | + $ip, |
|
207 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
208 | + $currentaction |
|
209 | + ); |
|
210 | + } |
|
211 | + foreach($userList as $params) { |
|
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); |
|
214 | + } |
|
215 | + |
|
216 | + $html .= ' |
|
217 | 217 | </tbody> |
218 | 218 | </table> |
219 | 219 | </div> |
@@ -254,17 +254,17 @@ discard block |
||
254 | 254 | // invoke event OnManagerWelcomePrerender |
255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
256 | 256 | if(is_array($evtOut)) { |
257 | - $output = implode('', $evtOut); |
|
258 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
257 | + $output = implode('', $evtOut); |
|
258 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | $widgets['welcome'] = array( |
262 | - 'menuindex' => '10', |
|
263 | - 'id' => 'welcome', |
|
264 | - 'cols' => 'col-lg-6', |
|
265 | - 'icon' => 'fa-home', |
|
266 | - 'title' => '[%welcome_title%]', |
|
267 | - 'body' => ' |
|
262 | + 'menuindex' => '10', |
|
263 | + 'id' => 'welcome', |
|
264 | + 'cols' => 'col-lg-6', |
|
265 | + 'icon' => 'fa-home', |
|
266 | + 'title' => '[%welcome_title%]', |
|
267 | + 'body' => ' |
|
268 | 268 | <div class="wm_buttons card-body"> |
269 | 269 | <!--@IF:[[#hasPermission?key=new_document]]--> |
270 | 270 | <span class="wm_button"> |
@@ -338,25 +338,25 @@ discard block |
||
338 | 338 | </table> |
339 | 339 | </div> |
340 | 340 | ', |
341 | - 'hide'=>'0' |
|
341 | + 'hide'=>'0' |
|
342 | 342 | ); |
343 | 343 | $widgets['onlineinfo'] = array( |
344 | - 'menuindex' => '20', |
|
345 | - 'id' => 'onlineinfo', |
|
346 | - 'cols' => 'col-lg-6', |
|
347 | - 'icon' => 'fa-user', |
|
348 | - 'title' => '[%onlineusers_title%]', |
|
349 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
350 | - 'hide'=>'0' |
|
344 | + 'menuindex' => '20', |
|
345 | + 'id' => 'onlineinfo', |
|
346 | + 'cols' => 'col-lg-6', |
|
347 | + 'icon' => 'fa-user', |
|
348 | + 'title' => '[%onlineusers_title%]', |
|
349 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
350 | + 'hide'=>'0' |
|
351 | 351 | ); |
352 | 352 | $widgets['recentinfo'] = array( |
353 | - 'menuindex' => '30', |
|
354 | - 'id' => 'modxrecent_widget', |
|
355 | - 'cols' => 'col-sm-12', |
|
356 | - 'icon' => 'fa-pencil-square-o', |
|
357 | - 'title' => '[%activity_title%]', |
|
358 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
359 | - 'hide'=>'0' |
|
353 | + 'menuindex' => '30', |
|
354 | + 'id' => 'modxrecent_widget', |
|
355 | + 'cols' => 'col-sm-12', |
|
356 | + 'icon' => 'fa-pencil-square-o', |
|
357 | + 'title' => '[%activity_title%]', |
|
358 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
359 | + 'hide'=>'0' |
|
360 | 360 | ); |
361 | 361 | if ($modx->config['rss_url_news']) { |
362 | 362 | $widgets['news'] = array( |
@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | // invoke OnManagerWelcomeHome event |
385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
386 | 386 | if(is_array($sitewidgets)) { |
387 | - $newwidgets = array(); |
|
387 | + $newwidgets = array(); |
|
388 | 388 | foreach($sitewidgets as $widget){ |
389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
390 | 390 | } |
@@ -392,21 +392,21 @@ discard block |
||
392 | 392 | } |
393 | 393 | |
394 | 394 | usort($widgets, function ($a, $b) { |
395 | - return $a['menuindex'] - $b['menuindex']; |
|
395 | + return $a['menuindex'] - $b['menuindex']; |
|
396 | 396 | }); |
397 | 397 | |
398 | 398 | $tpl = getTplWidget(); |
399 | 399 | $output = ''; |
400 | 400 | foreach($widgets as $widget) { |
401 | - if ($widget['hide'] != '1'){ |
|
402 | - $output .= $modx->parseText($tpl, $widget); |
|
403 | - } |
|
401 | + if ($widget['hide'] != '1'){ |
|
402 | + $output .= $modx->parseText($tpl, $widget); |
|
403 | + } |
|
404 | 404 | } |
405 | 405 | $ph['widgets'] = $output; |
406 | 406 | |
407 | 407 | // load template |
408 | 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'; |
|
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']; |
@@ -414,27 +414,27 @@ discard block |
||
414 | 414 | $target = $modx->mergeSettingsContent($target); |
415 | 415 | |
416 | 416 | if(substr($target, 0, 1) === '@') { |
417 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
418 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
419 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | - $content = file_get_contents(trim(substr($target, 6))); |
|
421 | - } else { |
|
422 | - $content = ''; |
|
423 | - } |
|
417 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
418 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
419 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + $content = file_get_contents(trim(substr($target, 6))); |
|
421 | + } else { |
|
422 | + $content = ''; |
|
423 | + } |
|
424 | 424 | } else { |
425 | - $chunk = $modx->getChunk($target); |
|
426 | - if($chunk !== false && !empty($chunk)) { |
|
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 |
|
433 | - { |
|
434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | - } else { |
|
436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | - } |
|
425 | + $chunk = $modx->getChunk($target); |
|
426 | + if($chunk !== false && !empty($chunk)) { |
|
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 |
|
433 | + { |
|
434 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | + } else { |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | + } |
|
438 | 438 | } |
439 | 439 | |
440 | 440 | // merge placeholders |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | $content = $modx->mergeSettingsContent($content); |
443 | 443 | $content = $modx->parseText($content, $ph); |
444 | 444 | if(strpos($content, '[+') !== false) { |
445 | - $modx->toPlaceholders($ph); |
|
446 | - $content = $modx->mergePlaceholderContent($content); |
|
445 | + $modx->toPlaceholders($ph); |
|
446 | + $content = $modx->mergePlaceholderContent($content); |
|
447 | 447 | } |
448 | 448 | $content = $modx->parseDocumentSource($content); |
449 | 449 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $content = $modx->cleanUpMODXTags($content); //cleanup |
452 | 452 | |
453 | 453 | if($js = $modx->getRegisteredClientScripts()) { |
454 | - $content .= $js; |
|
454 | + $content .= $js; |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | echo $content; |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
462 | 462 | //</span> |
463 | 463 | function getTplWidget() { // recent document info |
464 | - return ' |
|
464 | + return ' |
|
465 | 465 | <div class="[+cols+]" id="[+id+]"> |
466 | 466 | <div class="card"[+cardAttr+]> |
467 | 467 | <div class="card-header"[+headAttr+]> <i class="fa [+icon+]"></i> [+title+] </div> |
@@ -472,11 +472,11 @@ discard block |
||
472 | 472 | } |
473 | 473 | |
474 | 474 | function getRecentInfo() { // recent document info |
475 | - global $modx; |
|
475 | + global $modx; |
|
476 | 476 | |
477 | - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
|
477 | + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
|
478 | 478 | |
479 | - $html = ' |
|
479 | + $html = ' |
|
480 | 480 | <div class="table-responsive"> |
481 | 481 | <table class="table data"> |
482 | 482 | <thead> |
@@ -494,96 +494,96 @@ discard block |
||
494 | 494 | </table> |
495 | 495 | </div> |
496 | 496 | '; |
497 | - return $html; |
|
497 | + return $html; |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | function getRecentInfoList() { |
501 | - global $modx; |
|
502 | - |
|
503 | - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
|
504 | - |
|
505 | - if($modx->db->getRecordCount($rs) < 1) { |
|
506 | - return '<tr><td>[%no_activity_message%]</td></tr>'; |
|
507 | - } |
|
508 | - |
|
509 | - $tpl = getRecentInfoRowTpl(); |
|
510 | - |
|
511 | - $btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> '; |
|
512 | - $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
|
513 | - |
|
514 | - $output = array(); |
|
515 | - while($ph = $modx->db->getRow($rs)) { |
|
516 | - $docid = $ph['id']; |
|
517 | - $_ = $modx->getUserInfo($ph['editedby']); |
|
518 | - $ph['username'] = $_['username']; |
|
519 | - |
|
520 | - if($ph['deleted'] == 1) { |
|
521 | - $ph['status'] = 'deleted text-danger'; |
|
522 | - } elseif($ph['published'] == 0) { |
|
523 | - $ph['status'] = 'unpublished font-italic text-muted'; |
|
524 | - } else { |
|
525 | - $ph['status'] = 'published'; |
|
526 | - } |
|
527 | - |
|
528 | - if($modx->hasPermission('edit_document')) { |
|
529 | - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
|
530 | - } else { |
|
531 | - $ph['edit_btn'] = ''; |
|
532 | - } |
|
533 | - |
|
534 | - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; |
|
535 | - $ph['preview_btn'] = str_replace(array( |
|
536 | - '[+id+]', |
|
537 | - '[+preview_disabled+]' |
|
538 | - ), array( |
|
539 | - $docid, |
|
540 | - $preview_disabled |
|
541 | - ), $btntpl['preview_btn']); |
|
542 | - |
|
543 | - if($modx->hasPermission('delete_document')) { |
|
544 | - if($ph['deleted'] == 0) { |
|
545 | - $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
|
546 | - } else { |
|
547 | - $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
|
548 | - } |
|
549 | - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
|
550 | - } else { |
|
551 | - $ph['delete_btn'] = ''; |
|
552 | - } |
|
553 | - |
|
554 | - if($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
555 | - $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
556 | - } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
557 | - $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
558 | - } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
559 | - $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
560 | - } else { |
|
561 | - $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
562 | - } |
|
563 | - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
|
564 | - |
|
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 | - |
|
567 | - if($ph['longtitle'] == '') { |
|
568 | - $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
|
569 | - } |
|
570 | - if($ph['description'] == '') { |
|
571 | - $ph['description'] = '(<i>[%not_set%]</i>)'; |
|
572 | - } |
|
573 | - if($ph['introtext'] == '') { |
|
574 | - $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
|
575 | - } |
|
576 | - if($ph['alias'] == '') { |
|
577 | - $ph['alias'] = '(<i>[%not_set%]</i>)'; |
|
578 | - } |
|
579 | - |
|
580 | - $output[] = $modx->parseText($tpl, $ph); |
|
581 | - } |
|
582 | - return implode("\n", $output); |
|
501 | + global $modx; |
|
502 | + |
|
503 | + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
|
504 | + |
|
505 | + if($modx->db->getRecordCount($rs) < 1) { |
|
506 | + return '<tr><td>[%no_activity_message%]</td></tr>'; |
|
507 | + } |
|
508 | + |
|
509 | + $tpl = getRecentInfoRowTpl(); |
|
510 | + |
|
511 | + $btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> '; |
|
512 | + $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
|
513 | + |
|
514 | + $output = array(); |
|
515 | + while($ph = $modx->db->getRow($rs)) { |
|
516 | + $docid = $ph['id']; |
|
517 | + $_ = $modx->getUserInfo($ph['editedby']); |
|
518 | + $ph['username'] = $_['username']; |
|
519 | + |
|
520 | + if($ph['deleted'] == 1) { |
|
521 | + $ph['status'] = 'deleted text-danger'; |
|
522 | + } elseif($ph['published'] == 0) { |
|
523 | + $ph['status'] = 'unpublished font-italic text-muted'; |
|
524 | + } else { |
|
525 | + $ph['status'] = 'published'; |
|
526 | + } |
|
527 | + |
|
528 | + if($modx->hasPermission('edit_document')) { |
|
529 | + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
|
530 | + } else { |
|
531 | + $ph['edit_btn'] = ''; |
|
532 | + } |
|
533 | + |
|
534 | + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; |
|
535 | + $ph['preview_btn'] = str_replace(array( |
|
536 | + '[+id+]', |
|
537 | + '[+preview_disabled+]' |
|
538 | + ), array( |
|
539 | + $docid, |
|
540 | + $preview_disabled |
|
541 | + ), $btntpl['preview_btn']); |
|
542 | + |
|
543 | + if($modx->hasPermission('delete_document')) { |
|
544 | + if($ph['deleted'] == 0) { |
|
545 | + $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
|
546 | + } else { |
|
547 | + $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
|
548 | + } |
|
549 | + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
|
550 | + } else { |
|
551 | + $ph['delete_btn'] = ''; |
|
552 | + } |
|
553 | + |
|
554 | + if($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
555 | + $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
556 | + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
557 | + $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
558 | + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
559 | + $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
560 | + } else { |
|
561 | + $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
562 | + } |
|
563 | + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
|
564 | + |
|
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 | + |
|
567 | + if($ph['longtitle'] == '') { |
|
568 | + $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
|
569 | + } |
|
570 | + if($ph['description'] == '') { |
|
571 | + $ph['description'] = '(<i>[%not_set%]</i>)'; |
|
572 | + } |
|
573 | + if($ph['introtext'] == '') { |
|
574 | + $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
|
575 | + } |
|
576 | + if($ph['alias'] == '') { |
|
577 | + $ph['alias'] = '(<i>[%not_set%]</i>)'; |
|
578 | + } |
|
579 | + |
|
580 | + $output[] = $modx->parseText($tpl, $ph); |
|
581 | + } |
|
582 | + return implode("\n", $output); |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | function getRecentInfoRowTpl() { |
586 | - $tpl = ' |
|
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> |
589 | 589 | <td data-toggle="collapse" data-target=".collapse[+id+]"><a class="[+status+]" title="[%edit_resource%]" href="index.php?a=3&id=[+id+]" target="main">[+pagetitle+]</a></td> |
@@ -607,16 +607,16 @@ discard block |
||
607 | 607 | </div> |
608 | 608 | </td> |
609 | 609 | </tr>'; |
610 | - return $tpl; |
|
610 | + return $tpl; |
|
611 | 611 | } |
612 | 612 | |
613 | 613 | // setup icons |
614 | 614 | function wrapIcon($i, $action) { |
615 | - return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i); |
|
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 | 618 | function getStartUpScript() { |
619 | - $script = ' |
|
619 | + $script = ' |
|
620 | 620 | <script type="text/javascript"> |
621 | 621 | function hideConfigCheckWarning(key) { |
622 | 622 | var xhr = new XMLHttpRequest(); |
@@ -640,5 +640,5 @@ discard block |
||
640 | 640 | })(jQuery); |
641 | 641 | </script> |
642 | 642 | '; |
643 | - return $script; |
|
643 | + return $script; |
|
644 | 644 | } |