@@ -1,5 +1,5 @@ discard block |
||
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"); |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | |
12 | 12 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
13 | 13 | |
14 | -if (!isset($modx->config['manager_menu_height'])) { |
|
14 | +if (!isset($modx->config['manager_menu_height'])) { |
|
15 | 15 | $modx->config['manager_menu_height'] = 2.2; // rem |
16 | 16 | } |
17 | 17 | |
18 | -if (!isset($modx->config['manager_tree_width'])) { |
|
18 | +if (!isset($modx->config['manager_tree_width'])) { |
|
19 | 19 | $modx->config['manager_tree_width'] = 20; // rem |
20 | 20 | } |
21 | 21 | |
22 | -if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
22 | +if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
23 | 23 | $initMainframeAction = $_SESSION['onLoginForwardToAction']; |
24 | 24 | unset($_SESSION['onLoginForwardToAction']); |
25 | -} else { |
|
25 | +} else { |
|
26 | 26 | $initMainframeAction = 2; // welcome.static |
27 | 27 | } |
28 | 28 | |
29 | -if (!isset($_SESSION['tree_show_only_folders'])) { |
|
29 | +if (!isset($_SESSION['tree_show_only_folders'])) { |
|
30 | 30 | $_SESSION['tree_show_only_folders'] = 0; |
31 | 31 | } |
32 | 32 | |
@@ -35,29 +35,29 @@ discard block |
||
35 | 35 | $tree_width = $modx->config['manager_tree_width']; |
36 | 36 | $tree_min_width = 0; |
37 | 37 | |
38 | -if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
38 | +if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
39 | 39 | $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; |
40 | -} else { |
|
40 | +} else { |
|
41 | 41 | $MODX_widthSideBar = $tree_width; |
42 | 42 | } |
43 | 43 | |
44 | -if (!$MODX_widthSideBar) { |
|
44 | +if (!$MODX_widthSideBar) { |
|
45 | 45 | $body_class .= 'sidebar-closed'; |
46 | 46 | } |
47 | 47 | |
48 | 48 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); |
49 | -if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
49 | +if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
50 | 50 | $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
51 | -} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
|
51 | +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
|
52 | 52 | $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
53 | 53 | } |
54 | 54 | |
55 | 55 | $navbar_position = $modx->config['manager_menu_position']; |
56 | -if ($navbar_position == 'left') { |
|
56 | +if ($navbar_position == 'left') { |
|
57 | 57 | $body_class .= ' navbar-left navbar-left-icon-and-text'; |
58 | 58 | } |
59 | 59 | |
60 | -if (isset($modx->pluginCache['ElementsInTree'])) { |
|
60 | +if (isset($modx->pluginCache['ElementsInTree'])) { |
|
61 | 61 | $body_class .= ' ElementsInTree'; |
62 | 62 | } |
63 | 63 | |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | 'type8' => $_lang["lock_element_type_8"] |
74 | 74 | ); |
75 | 75 | |
76 | -foreach ($unlockTranslations as $key => $value) { |
|
76 | +foreach ($unlockTranslations as $key => $value) { |
|
77 | 77 | $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
78 | 78 | } |
79 | 79 | |
80 | 80 | $user = $modx->getUserInfo($modx->getLoginUserID()); |
81 | -if ($user['which_browser'] == 'default') { |
|
81 | +if ($user['which_browser'] == 'default') { |
|
82 | 82 | $user['which_browser'] = $modx->config['which_browser']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
86 | 86 | |
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')) { |
|
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 | 89 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
90 | 90 | $minifier = new Formatter\CSSMinify(); |
91 | 91 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $css = $minifier->minify(); |
103 | 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')) { |
|
105 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
106 | 106 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
107 | 107 | } |
108 | 108 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | <?php |
258 | 258 | // invoke OnManagerTopPrerender event |
259 | 259 | $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST); |
260 | - if (is_array($evtOut)) { |
|
260 | + if (is_array($evtOut)) { |
|
261 | 261 | echo implode("\n", $evtOut); |
262 | 262 | } |
263 | 263 | ?> |
@@ -428,11 +428,14 @@ discard block |
||
428 | 428 | <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller"> |
429 | 429 | <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
430 | 430 | </div> |
431 | - <?php else: ?> |
|
431 | + <?php else { |
|
432 | + : ?> |
|
432 | 433 | <div class="iframe-scroller"> |
433 | 434 | <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
434 | 435 | </div> |
435 | - <?php endif; ?> |
|
436 | + <?php endif; |
|
437 | +} |
|
438 | +?> |
|
436 | 439 | <script> |
437 | 440 | if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { |
438 | 441 | document.getElementById('mainframe').setAttribute('scrolling', 'no'); |
@@ -451,11 +454,11 @@ discard block |
||
451 | 454 | 'tree_sortdir', |
452 | 455 | 'tree_nodename' |
453 | 456 | ); |
454 | - foreach ($sortParams as $param) { |
|
455 | - if (isset($_REQUEST[$param])) { |
|
457 | + foreach ($sortParams as $param) { |
|
458 | + if (isset($_REQUEST[$param])) { |
|
456 | 459 | $modx->getManagerApi()->saveLastUserSetting($param, $_REQUEST[$param]); |
457 | 460 | $_SESSION[$param] = $_REQUEST[$param]; |
458 | - } else if (!isset($_SESSION[$param])) { |
|
461 | + } else if (!isset($_SESSION[$param])) { |
|
459 | 462 | $_SESSION[$param] = $modx->getManagerApi()->getLastUserSetting($param); |
460 | 463 | } |
461 | 464 | } |
@@ -506,16 +509,16 @@ discard block |
||
506 | 509 | </div> |
507 | 510 | |
508 | 511 | <?php |
509 | - if(!function_exists('constructLink')) { |
|
512 | + if(!function_exists('constructLink')) { |
|
510 | 513 | /** |
511 | 514 | * @param string $action |
512 | 515 | * @param string $img |
513 | 516 | * @param string $text |
514 | 517 | * @param bool $allowed |
515 | 518 | */ |
516 | - function constructLink($action, $img, $text, $allowed) |
|
517 | - { |
|
518 | - if ((bool)$allowed) { |
|
519 | + function constructLink($action, $img, $text, $allowed) |
|
520 | + { |
|
521 | + if ((bool)$allowed) { |
|
519 | 522 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, |
520 | 523 | $action); |
521 | 524 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
@@ -650,7 +653,7 @@ discard block |
||
650 | 653 | ?> |
651 | 654 | |
652 | 655 | </div> |
653 | -<?php if ($modx->config['show_picker'] != "0") { |
|
656 | +<?php if ($modx->config['show_picker'] != "0") { |
|
654 | 657 | include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
655 | 658 | } ?> |
656 | 659 | </body> |
@@ -32,7 +32,7 @@ discard block |
||
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', |
@@ -48,7 +48,7 @@ discard block |
||
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', |
@@ -64,7 +64,7 @@ discard block |
||
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', |
@@ -80,7 +80,7 @@ discard block |
||
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', |
@@ -97,7 +97,7 @@ discard block |
||
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', |
@@ -112,7 +112,7 @@ discard block |
||
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', |
@@ -127,7 +127,7 @@ discard block |
||
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', |
@@ -142,7 +142,7 @@ discard block |
||
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', |
@@ -157,7 +157,7 @@ discard block |
||
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', |
@@ -174,7 +174,7 @@ discard block |
||
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', |
@@ -189,7 +189,7 @@ discard block |
||
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', |
@@ -206,7 +206,7 @@ discard block |
||
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', |
@@ -222,19 +222,19 @@ discard block |
||
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->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 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 | - } else { |
|
233 | + } else { |
|
234 | 234 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
236 | + if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
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', |
@@ -270,7 +270,7 @@ discard block |
||
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', |
@@ -286,7 +286,7 @@ discard block |
||
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', |
@@ -302,7 +302,7 @@ discard block |
||
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', |
@@ -318,7 +318,7 @@ discard block |
||
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', |
@@ -374,7 +374,7 @@ discard block |
||
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', |
@@ -390,7 +390,7 @@ discard block |
||
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', |
@@ -406,7 +406,7 @@ discard block |
||
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', |
@@ -422,7 +422,7 @@ discard block |
||
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', |
@@ -439,19 +439,21 @@ discard block |
||
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; |
|
450 | -} |
|
449 | + if(count($newmenu)> 0) { |
|
450 | + $sitemenu = $newmenu; |
|
451 | + } |
|
452 | + } |
|
451 | 453 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
454 | +if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
454 | -} else { |
|
456 | +} else { |
|
455 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
456 | 458 | } |
457 | 459 | $menu = new EVOmenu(); |
@@ -476,7 +476,8 @@ discard block |
||
476 | 476 | return s; |
477 | 477 | } |
478 | 478 | |
479 | - <?php if ($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?> |
|
479 | + <?php if ($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { |
|
480 | +// Web Link specific ?> |
|
480 | 481 | var lastImageCtrl; |
481 | 482 | var lastFileCtrl; |
482 | 483 | |
@@ -692,7 +693,8 @@ discard block |
||
692 | 693 | </td> |
693 | 694 | </tr> |
694 | 695 | |
695 | - <?php if($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?> |
|
696 | + <?php if($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { |
|
697 | +// Web Link specific ?> |
|
696 | 698 | |
697 | 699 | <tr> |
698 | 700 | <td><span class="warning"><?= $_lang['weblink'] ?></span> |
@@ -1370,7 +1372,9 @@ discard block |
||
1370 | 1372 | if($documentId > 0) { |
1371 | 1373 | // Load up, the permissions from the parent (if new document) or existing document |
1372 | 1374 | $rs = $modx->getDatabase()->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
1373 | - while($currentgroup = $modx->getDatabase()->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
1375 | + while($currentgroup = $modx->getDatabase()->getRow($rs)) { |
|
1376 | + $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
1377 | + } |
|
1374 | 1378 | |
1375 | 1379 | // Load up the current permissions and names |
1376 | 1380 | $vs = array( |
@@ -1432,7 +1436,9 @@ discard block |
||
1432 | 1436 | |
1433 | 1437 | // Create attribute string list |
1434 | 1438 | $inputString = array(); |
1435 | - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; |
|
1439 | + foreach($inputAttributes as $k => $v) { |
|
1440 | + $inputString[] = $k . '="' . $v . '"'; |
|
1441 | + } |
|
1436 | 1442 | |
1437 | 1443 | // Make the <input> HTML |
1438 | 1444 | $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
@@ -1,8 +1,8 @@ discard block |
||
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('logs')) { |
|
5 | +if (!$modx->hasPermission('logs')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | <table class="table data table-sm nowrap"> |
56 | 56 | <tbody> |
57 | 57 | <?php |
58 | - foreach ($serverArr as $key => $value) { |
|
58 | + foreach ($serverArr as $key => $value) { |
|
59 | 59 | ?> |
60 | 60 | <tr> |
61 | 61 | <td width="1%"><?= $key ?></td> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix']) . "%';"; |
99 | 99 | $rs = $modx->getDatabase()->query($sql); |
100 | 100 | $i = 0; |
101 | - while ($log_status = $modx->getDatabase()->getRow($rs)) { |
|
101 | + while ($log_status = $modx->getDatabase()->getRow($rs)) { |
|
102 | 102 | ?> |
103 | 103 | <tr> |
104 | 104 | <td class="text-primary"><b><?= $log_status['Name'] ?></b></td> |
@@ -110,17 +110,17 @@ discard block |
||
110 | 110 | $modx->getDatabase()->config['table_prefix'] . 'event_log', |
111 | 111 | $modx->getDatabase()->config['table_prefix'] . 'manager_log', |
112 | 112 | ); |
113 | - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
113 | + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
114 | 114 | echo "<td class=\"text-xs-right\">"; |
115 | 115 | echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>"; |
116 | 116 | echo "</td>"; |
117 | - } else { |
|
117 | + } else { |
|
118 | 118 | echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
119 | 119 | } |
120 | 120 | |
121 | - if ($modx->hasPermission('settings')) { |
|
121 | + if ($modx->hasPermission('settings')) { |
|
122 | 122 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>"; |
123 | - } else { |
|
123 | + } else { |
|
124 | 124 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
125 | 125 | } |
126 | 126 | ?> |
@@ -1,16 +1,16 @@ discard block |
||
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 | -switch($modx->getManagerApi()->action) { |
|
6 | +switch($modx->getManagerApi()->action) { |
|
7 | 7 | case 88: |
8 | - if(!$modx->hasPermission('edit_web_user')) { |
|
8 | + if(!$modx->hasPermission('edit_web_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 87: |
13 | - if(!$modx->hasPermission('new_web_user')) { |
|
13 | + if(!$modx->hasPermission('new_web_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -23,33 +23,35 @@ discard block |
||
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
26 | +if($username = $modx->getDatabase()->getValue($rs)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | -if($modx->getManagerApi()->action == '88') { |
|
31 | +if($modx->getManagerApi()->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->getDatabase()->getRow($rs); |
35 | - if(!$userdata) { |
|
35 | + if(!$userdata) { |
|
36 | 36 | $modx->webAlertAndQuit("No user returned!"); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
43 | + $usersettings[$row['setting_name']] = $row['setting_value']; |
|
44 | + } |
|
43 | 45 | extract($usersettings, EXTR_OVERWRITE); |
44 | 46 | |
45 | 47 | // get user name |
46 | 48 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 49 | $usernamedata = $modx->getDatabase()->getRow($rs); |
48 | - if(!$usernamedata) { |
|
50 | + if(!$usernamedata) { |
|
49 | 51 | $modx->webAlertAndQuit("No user returned while getting username!"); |
50 | 52 | } |
51 | 53 | $_SESSION['itemname'] = $usernamedata['username']; |
52 | -} else { |
|
54 | +} else { |
|
53 | 55 | $userdata = array(); |
54 | 56 | $usersettings = array(); |
55 | 57 | $usernamedata = array(); |
@@ -57,14 +59,14 @@ discard block |
||
57 | 59 | } |
58 | 60 | |
59 | 61 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | -foreach($userdata as $key => $val) { |
|
62 | +foreach($userdata as $key => $val) { |
|
61 | 63 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
62 | 64 | }; |
63 | 65 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 66 | |
65 | 67 | // restore saved form |
66 | 68 | $formRestored = false; |
67 | -if($modx->getManagerApi()->hasFormValues()) { |
|
69 | +if($modx->getManagerApi()->hasFormValues()) { |
|
68 | 70 | $modx->getManagerApi()->loadFormValues(); |
69 | 71 | // restore post values |
70 | 72 | $userdata = array_merge($userdata, $_POST); |
@@ -78,9 +80,9 @@ discard block |
||
78 | 80 | |
79 | 81 | // include the country list language file |
80 | 82 | $_country_lang = array(); |
81 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
83 | +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
82 | 84 | include_once "lang/country/" . $manager_language . "_country.inc.php"; |
83 | -} else { |
|
85 | +} else { |
|
84 | 86 | include_once "lang/country/english_country.inc.php"; |
85 | 87 | } |
86 | 88 | asort($_country_lang); |
@@ -191,7 +193,7 @@ discard block |
||
191 | 193 | <?php |
192 | 194 | // invoke OnWUsrFormPrerender event |
193 | 195 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
194 | - if(is_array($evtOut)) { |
|
196 | + if(is_array($evtOut)) { |
|
195 | 197 | echo implode("", $evtOut); |
196 | 198 | } |
197 | 199 | ?> |
@@ -324,7 +326,7 @@ discard block |
||
324 | 326 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
325 | 327 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
326 | 328 | <?php |
327 | - foreach($_country_lang as $key => $country) { |
|
329 | + foreach($_country_lang as $key => $country) { |
|
328 | 330 | echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
329 | 331 | } |
330 | 332 | ?> |
@@ -496,17 +498,20 @@ discard block |
||
496 | 498 | </table> |
497 | 499 | </div> |
498 | 500 | <?php |
499 | - if($use_udperms == 1) { |
|
501 | + if($use_udperms == 1) { |
|
500 | 502 | |
501 | 503 | $groupsarray = array(); |
502 | 504 | |
503 | - if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
505 | + if($modx->getManagerApi()->action == '88') { |
|
506 | +// only do this bit if the user is being edited |
|
504 | 507 | $rs = $modx->getDatabase()->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
505 | 508 | $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
506 | 509 | } |
507 | 510 | // retain selected user groups between post |
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
511 | + if(is_array($_POST['user_groups'])) { |
|
512 | + foreach($_POST['user_groups'] as $n => $v) { |
|
513 | + $groupsarray[] = $v; |
|
514 | + } |
|
510 | 515 | } |
511 | 516 | ?> |
512 | 517 | <div class="tab-page" id="tabPermissions"> |
@@ -515,7 +520,7 @@ discard block |
||
515 | 520 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 521 | <?php |
517 | 522 | $rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
518 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
523 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
519 | 524 | echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
520 | 525 | } |
521 | 526 | } |
@@ -526,7 +531,7 @@ discard block |
||
526 | 531 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
527 | 532 | "id" => $user |
528 | 533 | )); |
529 | - if(is_array($evtOut)) { |
|
534 | + if(is_array($evtOut)) { |
|
530 | 535 | echo implode("", $evtOut); |
531 | 536 | } |
532 | 537 | ?> |
@@ -1,15 +1,15 @@ discard block |
||
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 | -switch($modx->getManagerApi()->action) { |
|
5 | +switch($modx->getManagerApi()->action) { |
|
6 | 6 | case 107: |
7 | - if(!$modx->hasPermission('new_module')) { |
|
7 | + if(!$modx->hasPermission('new_module')) { |
|
8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
9 | 9 | } |
10 | 10 | break; |
11 | 11 | case 108: |
12 | - if(!$modx->hasPermission('edit_module')) { |
|
12 | + if(!$modx->hasPermission('edit_module')) { |
|
13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
14 | 14 | } |
15 | 15 | break; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | |
33 | 33 | // check to see the module editor isn't locked |
34 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
34 | +if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
35 | 35 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
36 | 36 | } |
37 | 37 | // end check for lock |
@@ -39,22 +39,22 @@ discard block |
||
39 | 39 | // Lock snippet for other users to edit |
40 | 40 | $modx->lockElement(6, $id); |
41 | 41 | |
42 | -if(isset($_GET['id'])) { |
|
42 | +if(isset($_GET['id'])) { |
|
43 | 43 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'"); |
44 | 44 | $content = $modx->getDatabase()->getRow($rs); |
45 | - if(!$content) { |
|
45 | + if(!$content) { |
|
46 | 46 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
47 | 47 | } |
48 | 48 | $content['properties'] = str_replace("&", "&", $content['properties']); |
49 | 49 | $_SESSION['itemname'] = $content['name']; |
50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
50 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
51 | 51 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
52 | 52 | } |
53 | -} else { |
|
53 | +} else { |
|
54 | 54 | $_SESSION['itemname'] = $_lang["new_module"]; |
55 | 55 | $content['wrap'] = '1'; |
56 | 56 | } |
57 | -if($modx->getManagerApi()->hasFormValues()) { |
|
57 | +if($modx->getManagerApi()->hasFormValues()) { |
|
58 | 58 | $modx->getManagerApi()->loadFormValues(); |
59 | 59 | } |
60 | 60 | |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | <?php |
429 | 429 | // invoke OnModFormPrerender event |
430 | 430 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
431 | - if(is_array($evtOut)) { |
|
431 | + if(is_array($evtOut)) { |
|
432 | 432 | echo implode('', $evtOut); |
433 | 433 | } |
434 | 434 | |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | <option> </option> |
492 | 492 | <?php |
493 | 493 | include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
494 | - foreach(getCategories() as $n => $v) { |
|
494 | + foreach(getCategories() as $n => $v) { |
|
495 | 495 | echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
496 | 496 | } |
497 | 497 | ?> |
@@ -643,7 +643,7 @@ discard block |
||
643 | 643 | $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
644 | 644 | $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs); |
645 | 645 | |
646 | - if($modx->hasPermission('access_permissions')) { |
|
646 | + if($modx->hasPermission('access_permissions')) { |
|
647 | 647 | ?> |
648 | 648 | <!-- User Group Access Permissions --> |
649 | 649 | <script type="text/javascript"> |
@@ -671,21 +671,21 @@ discard block |
||
671 | 671 | } |
672 | 672 | $chk = ''; |
673 | 673 | $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name'); |
674 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
674 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
675 | 675 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
676 | 676 | $checked = in_array($row['id'], $groupsarray); |
677 | - if($modx->hasPermission('access_permissions')) { |
|
678 | - if($checked) { |
|
677 | + if($modx->hasPermission('access_permissions')) { |
|
678 | + if($checked) { |
|
679 | 679 | $notPublic = true; |
680 | 680 | } |
681 | 681 | $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
682 | - } else { |
|
683 | - if($checked) { |
|
682 | + } else { |
|
683 | + if($checked) { |
|
684 | 684 | $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
685 | 685 | } |
686 | 686 | } |
687 | 687 | } |
688 | - if($modx->hasPermission('access_permissions')) { |
|
688 | + if($modx->hasPermission('access_permissions')) { |
|
689 | 689 | $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
690 | 690 | } |
691 | 691 | echo $chks; |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | <?php |
708 | 708 | // invoke OnModFormRender event |
709 | 709 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
710 | - if(is_array($evtOut)) { |
|
710 | + if(is_array($evtOut)) { |
|
711 | 711 | echo implode('', $evtOut); |
712 | 712 | } |
713 | 713 | ?> |
@@ -1,14 +1,14 @@ discard block |
||
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 />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if(!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | 10 | $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
11 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
11 | +if($username = $modx->getDatabase()->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $settings = array(); |
19 | 19 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]system_settings'); |
21 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
21 | +while($row = $modx->getDatabase()->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | 24 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while($file = $dir->read()) { |
|
33 | + if(strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
132 | +if(is_numeric($_GET['tab'])) { |
|
133 | 133 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
134 | 134 | } |
@@ -1,8 +1,8 @@ discard block |
||
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('view_eventlog')) { |
|
5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | $rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); |
21 | 21 | $limit = $modx->getDatabase()->getRecordCount($rs); |
22 | - if($limit < 1) { |
|
22 | + if($limit < 1) { |
|
23 | 23 | ?> |
24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
25 | 25 | <?php |
26 | - } else { |
|
26 | + } else { |
|
27 | 27 | ?> |
28 | 28 | <div class="table-responsive"> |
29 | 29 | <table class="grid sortabletable" id="table-1"> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | </thead> |
37 | 37 | <tbody> |
38 | 38 | <?php |
39 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
39 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
40 | 40 | ?> |
41 | 41 | <tr> |
42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | <?php |
59 | 59 | $rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); |
60 | 60 | $limit = $modx->getDatabase()->getRecordCount($rs); |
61 | - if($limit < 1) { |
|
61 | + if($limit < 1) { |
|
62 | 62 | ?> |
63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
64 | 64 | <?php |
65 | - } else { |
|
65 | + } else { |
|
66 | 66 | ?> |
67 | 67 | <div class="table-responsive"> |
68 | 68 | <table class="grid sortabletable" id="table-2"> |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | </thead> |
76 | 76 | <tbody> |
77 | 77 | <?php |
78 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
78 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
79 | 79 | ?> |
80 | 80 | <tr> |
81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | <?php |
98 | 98 | $rs = $modx->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); |
99 | 99 | $limit = $modx->getDatabase()->getRecordCount($rs); |
100 | - if($limit < 1) { |
|
100 | + if($limit < 1) { |
|
101 | 101 | ?> |
102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
103 | 103 | <?php |
104 | - } else { |
|
104 | + } else { |
|
105 | 105 | ?> |
106 | 106 | <div class="table-responsive"> |
107 | 107 | <table class="grid sortabletable" id="table-3"> |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | </thead> |
116 | 116 | <tbody> |
117 | 117 | <?php |
118 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
118 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
119 | 119 | ?> |
120 | 120 | <tr> |
121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -1,11 +1,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
163 | 163 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | +if($modx->getDatabase()->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 |
||
191 | 191 | $userList = array(); |
192 | 192 | $userCount = array(); |
193 | 193 | // Create userlist with session-count first before output |
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
194 | + while($activeusers = $modx->getDatabase()->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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |