@@ -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('save_password')) { |
|
5 | +if (!$modx->hasPermission('save_password')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | $pass1 = $_POST['pass1']; |
11 | 11 | $pass2 = $_POST['pass2']; |
12 | 12 | |
13 | -if($pass1!=$pass2){ |
|
13 | +if ($pass1 != $pass2) { |
|
14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
15 | 15 | } |
16 | 16 | |
17 | -if(strlen($pass1)<6){ |
|
17 | +if (strlen($pass1) < 6) { |
|
18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
19 | 19 | } |
20 | 20 | |
@@ -23,14 +23,14 @@ discard block |
||
23 | 23 | $uid = $modx->getLoginUserID(); |
24 | 24 | $modx->loadExtension('phpass'); |
25 | 25 | $f['password'] = $modx->phpass->HashPassword($pass1); |
26 | - $modx->db->update($f,$tbl_manager_users,"id='{$uid}'"); |
|
26 | + $modx->db->update($f, $tbl_manager_users, "id='{$uid}'"); |
|
27 | 27 | |
28 | 28 | // invoke OnManagerChangePassword event |
29 | - $modx->invokeEvent('OnManagerChangePassword', array ( |
|
29 | + $modx->invokeEvent('OnManagerChangePassword', array( |
|
30 | 30 | 'userid' => $uid, |
31 | 31 | 'username' => $_SESSION['mgrShortname'], |
32 | 32 | 'userpassword' => $pass1 |
33 | 33 | )); |
34 | 34 | |
35 | -$header="Location: index.php?a=2"; |
|
35 | +$header = "Location: index.php?a=2"; |
|
36 | 36 | header($header); |
@@ -1,12 +1,12 @@ |
||
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('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | $modx->db->truncate($modx->getFullTableName('manager_log')); |
10 | 10 | |
11 | -$header="Location: index.php?a=13"; |
|
11 | +$header = "Location: index.php?a=13"; |
|
12 | 12 | header($header); |
@@ -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('messages')) { |
|
5 | +if (!$modx->hasPermission('messages')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | $userid = $_REQUEST['user']; |
11 | 11 | $groupid = $_REQUEST['group']; |
12 | 12 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
13 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if ($subject == "") $subject = "(no subject)"; |
|
14 | 14 | $message = $modx->db->escape($_REQUEST['messagebody']); |
15 | -if($message=="") $message="(no message)"; |
|
15 | +if ($message == "") $message = "(no message)"; |
|
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | -if($sendto=='u') { |
|
19 | - if($userid==0) { |
|
18 | +if ($sendto == 'u') { |
|
19 | + if ($userid == 0) { |
|
20 | 20 | $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
21 | 21 | } |
22 | 22 | $modx->db->insert( |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | ), $modx->getFullTableName('user_messages')); |
32 | 32 | } |
33 | 33 | |
34 | -if($sendto=='g') { |
|
35 | - if($groupid==0) { |
|
34 | +if ($sendto == 'g') { |
|
35 | + if ($groupid == 0) { |
|
36 | 36 | $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
37 | 37 | } |
38 | 38 | $rs = $modx->db->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
39 | - while ($row=$modx->db->getRow($rs)) { |
|
39 | + while ($row = $modx->db->getRow($rs)) { |
|
40 | 40 | $modx->db->insert( |
41 | 41 | array( |
42 | 42 | 'recipient' => $row['internalKey'], |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | -if($sendto=='a') { |
|
54 | +if ($sendto == 'a') { |
|
55 | 55 | $rs = $modx->db->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
56 | - while ($row=$modx->db->getRow($rs)) { |
|
56 | + while ($row = $modx->db->getRow($rs)) { |
|
57 | 57 | $modx->db->insert( |
58 | 58 | array( |
59 | 59 | 'recipient' => $row['id'], |
@@ -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 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if (is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a> |
19 | 19 | |
20 | - <?php if($modx->hasPermission('new_document')) { ?> |
|
20 | + <?php if ($modx->hasPermission('new_document')) { ?> |
|
21 | 21 | <a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a> |
22 | 22 | <a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a> |
23 | 23 | <?php } ?> |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a> |
28 | 28 | |
29 | - <?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
29 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
30 | 30 | <a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a> |
31 | 31 | <?php } ?> |
32 | 32 | |
33 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
33 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
35 | 35 | <?php } ?> |
36 | 36 | |
37 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
37 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
39 | 39 | <?php } ?> |
40 | 40 | |
41 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
41 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if($modx->hasPermission('empty_trash')) { ?> |
|
45 | + <?php if ($modx->hasPermission('empty_trash')) { ?> |
|
46 | 46 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a> |
47 | 47 | <?php } ?> |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if (is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if (is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |
@@ -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"); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | if (isset($_COOKIE['MODX_themeColor'])) { |
49 | - $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
|
49 | + $body_class .= ' '.$_COOKIE['MODX_themeColor']; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if (isset($modx->pluginCache['ElementsInTree'])) { |
@@ -74,36 +74,36 @@ discard block |
||
74 | 74 | $user['which_browser'] = $modx->config['which_browser']; |
75 | 75 | } |
76 | 76 | |
77 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
|
77 | +$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime; |
|
78 | 78 | |
79 | 79 | if ($modx->config['manager_theme'] == 'default') { |
80 | - 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')) { |
|
81 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
80 | + 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')) { |
|
81 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
82 | 82 | $minifier = new Formatter\CSSMinify(); |
83 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
84 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
85 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
86 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
87 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
88 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
89 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
90 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
91 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
92 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
93 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
83 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
84 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
85 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
86 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
87 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
88 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
89 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
90 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
91 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
92 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
93 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
94 | 94 | $css = $minifier->minify(); |
95 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
95 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
96 | 96 | } |
97 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
98 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
97 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
98 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | |
102 | -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
102 | +$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
103 | 103 | |
104 | 104 | ?> |
105 | 105 | <!DOCTYPE html> |
106 | -<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>> |
|
106 | +<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>> |
|
107 | 107 | <head> |
108 | 108 | <title><?= $site_name ?>- (EVO CMS Manager)</title> |
109 | 109 | <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" /> |
@@ -134,20 +134,20 @@ discard block |
||
134 | 134 | MODX_SITE_URL: '<?= MODX_SITE_URL ?>', |
135 | 135 | MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>', |
136 | 136 | user: { |
137 | - role: <?= (int)$user['role'] ?>, |
|
137 | + role: <?= (int) $user['role'] ?>, |
|
138 | 138 | username: '<?= $user['username'] ?>' |
139 | 139 | }, |
140 | 140 | config: { |
141 | 141 | mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>, |
142 | - menu_height: <?= (int)$menu_height ?>, |
|
143 | - tree_width: <?= (int)$tree_width ?>, |
|
144 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
145 | - session_timeout: <?= (int)$modx->config['session_timeout'] ?>, |
|
146 | - site_start: <?= (int)$modx->config['site_start'] ?>, |
|
147 | - tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, |
|
142 | + menu_height: <?= (int) $menu_height ?>, |
|
143 | + tree_width: <?= (int) $tree_width ?>, |
|
144 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
145 | + session_timeout: <?= (int) $modx->config['session_timeout'] ?>, |
|
146 | + site_start: <?= (int) $modx->config['site_start'] ?>, |
|
147 | + tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>, |
|
148 | 148 | theme: '<?= $modx->config['manager_theme'] ?>', |
149 | 149 | which_browser: '<?= $user['which_browser'] ?>', |
150 | - layout: <?= (int)$manager_layout ?>, |
|
150 | + layout: <?= (int) $manager_layout ?>, |
|
151 | 151 | textdir: '<?= $modx_textdir ?>', |
152 | 152 | global_tabs: <?= $modx->config['global_tabs'] ?> |
153 | 153 | |
@@ -232,11 +232,11 @@ discard block |
||
232 | 232 | delete a[b]; |
233 | 233 | }, |
234 | 234 | openedArray: [], |
235 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
235 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
236 | 236 | }; |
237 | 237 | <?php |
238 | 238 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
239 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
239 | + echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n"; |
|
240 | 240 | ?> |
241 | 241 | </script> |
242 | 242 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | <a href="javascript:;" class="dropdown-toggle" onclick="return false;"> |
366 | 366 | <span class="username"><?= $user['username'] ?></span> |
367 | 367 | <?php if ($user['photo']) { ?> |
368 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span> |
|
368 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span> |
|
369 | 369 | <?php } else { ?> |
370 | 370 | <span class="icon"><?= $_style['menu_user'] ?></span> |
371 | 371 | <?php } ?> |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | $version = 'Evolution'; |
393 | 393 | ?> |
394 | 394 | <?php |
395 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
395 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
396 | 396 | ?> |
397 | 397 | </ul> |
398 | 398 | </li> |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | <script type="text/javascript"> |
532 | 532 | |
533 | 533 | if (document.getElementById('treeMenu')) { |
534 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
534 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
535 | 535 | |
536 | 536 | document.getElementById('treeMenu_openelements').onclick = function(e) { |
537 | 537 | e.preventDefault(); |
@@ -549,12 +549,12 @@ discard block |
||
549 | 549 | } |
550 | 550 | }; |
551 | 551 | <?php } ?> |
552 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
552 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
553 | 553 | |
554 | 554 | document.getElementById('treeMenu_openimages').onclick = function(e) { |
555 | 555 | e.preventDefault(); |
556 | 556 | if (modx.config.global_tabs && !e.shiftKey) { |
557 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
557 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
558 | 558 | } else { |
559 | 559 | var randomNum = '<?= $_lang["files_files"] ?>'; |
560 | 560 | if (e.shiftKey) { |
@@ -567,12 +567,12 @@ discard block |
||
567 | 567 | } |
568 | 568 | }; |
569 | 569 | <?php } ?> |
570 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
570 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
571 | 571 | |
572 | 572 | document.getElementById('treeMenu_openfiles').onclick = function(e) { |
573 | 573 | e.preventDefault(); |
574 | 574 | if (modx.config.global_tabs && !e.shiftKey) { |
575 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
575 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
576 | 576 | } else { |
577 | 577 | var randomNum = '<?= $_lang["files_files"] ?>'; |
578 | 578 | if (e.shiftKey) { |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | |
627 | 627 | </div> |
628 | 628 | <?php if ($modx->config['show_picker'] != "0") { |
629 | - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
|
629 | + include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php'); |
|
630 | 630 | } ?> |
631 | 631 | </body> |
632 | 632 | </html> |
@@ -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 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @param $theme |
11 | 11 | * @param string $hereid |
12 | 12 | */ |
13 | -function makeHTML($indent, $parent, $expandAll, $theme, $hereid = '') { |
|
13 | +function makeHTML($indent, $parent, $expandAll, $theme, $hereid = ''){ |
|
14 | 14 | global $modx; |
15 | 15 | global $icons, $iconsPrivate, $_style; |
16 | 16 | global $_lang, $opened, $opened2, $closed2; //added global vars |
@@ -21,35 +21,35 @@ discard block |
||
21 | 21 | // setup spacer |
22 | 22 | $level = 0; |
23 | 23 | $spacer = '<span class="indent">'; |
24 | - for($i = 2; $i <= $indent; $i++) { |
|
24 | + for ($i = 2; $i <= $indent; $i++) { |
|
25 | 25 | $spacer .= '<i></i>'; |
26 | 26 | $level++; |
27 | 27 | } |
28 | 28 | $spacer .= '</span>'; |
29 | 29 | |
30 | 30 | // manage order-by |
31 | - if(!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) { |
|
31 | + if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) { |
|
32 | 32 | // This is the first startup, set default sort order |
33 | 33 | $_SESSION['tree_sortby'] = 'menuindex'; |
34 | 34 | $_SESSION['tree_sortdir'] = 'ASC'; |
35 | 35 | } |
36 | 36 | |
37 | - switch($_SESSION['tree_sortby']) { |
|
37 | + switch ($_SESSION['tree_sortby']) { |
|
38 | 38 | case 'createdon': |
39 | 39 | case 'editedon': |
40 | 40 | case 'publishedon': |
41 | 41 | case 'pub_date': |
42 | 42 | case 'unpub_date': |
43 | - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); |
|
43 | + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']); |
|
44 | 44 | break; |
45 | 45 | default: |
46 | - $sortby = 'sc.' . $_SESSION['tree_sortby']; |
|
46 | + $sortby = 'sc.'.$_SESSION['tree_sortby']; |
|
47 | 47 | }; |
48 | 48 | |
49 | - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); |
|
49 | + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); |
|
50 | 50 | |
51 | 51 | // Folder sorting gets special setup ;) Add menuindex and pagetitle |
52 | - if($_SESSION['tree_sortby'] == 'isfolder') { |
|
52 | + if ($_SESSION['tree_sortby'] == 'isfolder') { |
|
53 | 53 | $orderby .= ', menuindex ASC, pagetitle'; |
54 | 54 | } |
55 | 55 | |
@@ -59,12 +59,12 @@ discard block |
||
59 | 59 | // get document groups for current user |
60 | 60 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
61 | 61 | $showProtected = false; |
62 | - if(isset ($modx->config['tree_show_protected'])) { |
|
62 | + if (isset ($modx->config['tree_show_protected'])) { |
|
63 | 63 | $showProtected = (boolean) $modx->config['tree_show_protected']; |
64 | 64 | } |
65 | 65 | $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
66 | - if($showProtected == false) { |
|
67 | - $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
66 | + if ($showProtected == false) { |
|
67 | + $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
68 | 68 | } else { |
69 | 69 | $access = ''; |
70 | 70 | } |
@@ -74,13 +74,13 @@ discard block |
||
74 | 74 | $from = "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id LEFT JOIN {$tblst} st on st.id = sc.template"; |
75 | 75 | $where = "(parent={$parent}) {$access} GROUP BY sc.id"; |
76 | 76 | $result = $modx->db->select($field, $from, $where, $orderby); |
77 | - if($modx->db->getRecordCount($result) == 0) { |
|
77 | + if ($modx->db->getRecordCount($result) == 0) { |
|
78 | 78 | $output .= sprintf('<div><a class="empty">%s%s <span class="empty">%s</span></a></div>', $spacer, $_style['tree_deletedpage'], $_lang['empty_folder']); |
79 | 79 | } |
80 | 80 | |
81 | 81 | $nodeNameSource = $_SESSION['tree_nodename'] == 'default' ? $modx->config['resource_tree_node_name'] : $_SESSION['tree_nodename']; |
82 | 82 | |
83 | - while($row = $modx->db->getRow($result)) { |
|
83 | + while ($row = $modx->db->getRow($result)) { |
|
84 | 84 | $node = ''; |
85 | 85 | |
86 | 86 | $nodetitle = getNodeTitle($nodeNameSource, $row); |
@@ -89,46 +89,46 @@ discard block |
||
89 | 89 | $treeNodeClass = 'node'; |
90 | 90 | $treeNodeClass .= $row['hasAccess'] == 0 ? ' protected' : ''; |
91 | 91 | |
92 | - if($row['deleted'] == 1) { |
|
92 | + if ($row['deleted'] == 1) { |
|
93 | 93 | $treeNodeClass .= ' deleted'; |
94 | 94 | //$nodetitleDisplay = sprintf('<span class="deletedNode">%s</span>', $nodetitle); |
95 | - } elseif($row['published'] == 0) { |
|
95 | + } elseif ($row['published'] == 0) { |
|
96 | 96 | $treeNodeClass .= ' unpublished'; |
97 | 97 | //$nodetitleDisplay = sprintf('<span class="unpublishedNode">%s</span>', $nodetitle); |
98 | - } elseif($row['hidemenu'] == 1) { |
|
98 | + } elseif ($row['hidemenu'] == 1) { |
|
99 | 99 | $treeNodeClass .= ' hidemenu'; |
100 | 100 | //$nodetitleDisplay = sprintf('<span class="notInMenuNode%s">%s</span>', $protectedClass, $nodetitle); |
101 | 101 | } else { |
102 | 102 | //$nodetitleDisplay = sprintf('<span class="publishedNode%s">%s</span>', $protectedClass, $nodetitle); |
103 | 103 | } |
104 | 104 | |
105 | - if($row['id'] == $hereid) { |
|
105 | + if ($row['id'] == $hereid) { |
|
106 | 106 | $treeNodeClass .= ' current'; |
107 | 107 | } |
108 | 108 | |
109 | 109 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
110 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
110 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
111 | 111 | |
112 | 112 | // Prepare displaying user-locks |
113 | 113 | $lockedByUser = ''; |
114 | 114 | $rowLock = $modx->elementIsLocked(7, $row['id'], true); |
115 | - if($rowLock && $modx->hasPermission('display_locks')) { |
|
116 | - if($rowLock['sid'] == $modx->sid) { |
|
115 | + if ($rowLock && $modx->hasPermission('display_locks')) { |
|
116 | + if ($rowLock['sid'] == $modx->sid) { |
|
117 | 117 | $title = $modx->parseText($_lang["lock_element_editing"], array( |
118 | 118 | 'element_type' => $_lang["lock_element_type_7"], |
119 | 119 | 'lasthit_df' => $rowLock['lasthit_df'] |
120 | 120 | )); |
121 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
121 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
122 | 122 | } else { |
123 | 123 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
124 | 124 | 'element_type' => $_lang["lock_element_type_7"], |
125 | 125 | 'username' => $rowLock['username'], |
126 | 126 | 'lasthit_df' => $rowLock['lasthit_df'] |
127 | 127 | )); |
128 | - if($modx->hasPermission('remove_locks')) { |
|
129 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
128 | + if ($modx->hasPermission('remove_locks')) { |
|
129 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
130 | 130 | } else { |
131 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
131 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | } |
@@ -136,23 +136,23 @@ discard block |
||
136 | 136 | $url = $modx->makeUrl($row['id']); |
137 | 137 | |
138 | 138 | $title = ''; |
139 | - if(isDateNode($nodeNameSource)) { |
|
140 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
139 | + if (isDateNode($nodeNameSource)) { |
|
140 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
141 | 141 | } |
142 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
143 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
144 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
145 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
146 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
147 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
148 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
149 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
150 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
151 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
152 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
153 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
142 | + $title .= $_lang['id'].': '.$row['id']; |
|
143 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
144 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
145 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
146 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
147 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
148 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
149 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
150 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
151 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
152 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
153 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
154 | 154 | $title = $modx->htmlspecialchars($title); |
155 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
155 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
156 | 156 | |
157 | 157 | $data = array( |
158 | 158 | 'id' => $row['id'], |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | $ph['expandAll'] = $expandAll; |
202 | 202 | $ph['isPrivate'] = ($row['privateweb'] || $row['privatemgr']) ? 1 : 0; |
203 | 203 | |
204 | - if(!$row['isfolder']) { |
|
204 | + if (!$row['isfolder']) { |
|
205 | 205 | $tpl = getTplSingleNode(); |
206 | - switch($row['id']) { |
|
206 | + switch ($row['id']) { |
|
207 | 207 | case $modx->config['site_start'] : |
208 | 208 | $icon = $_style['tree_page_home']; |
209 | 209 | break; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | $icon = $_style['tree_page_info']; |
218 | 218 | break; |
219 | 219 | default: |
220 | - if(isset($icons[$row['contentType']])) { |
|
220 | + if (isset($icons[$row['contentType']])) { |
|
221 | 221 | $icon = $icons[$row['contentType']]; |
222 | 222 | } else { |
223 | 223 | $icon = $_style['tree_page']; |
@@ -227,20 +227,20 @@ discard block |
||
227 | 227 | |
228 | 228 | // invoke OnManagerNodePrerender event |
229 | 229 | $prenode = $modx->invokeEvent("OnManagerNodePrerender", array('ph' => $ph)); |
230 | - if(is_array($prenode)) { |
|
230 | + if (is_array($prenode)) { |
|
231 | 231 | $phnew = array(); |
232 | - foreach($prenode as $pnode) { |
|
232 | + foreach ($prenode as $pnode) { |
|
233 | 233 | $phnew = array_merge($phnew, unserialize($pnode)); |
234 | 234 | } |
235 | 235 | $ph = (count($phnew) > 0) ? $phnew : $ph; |
236 | 236 | } |
237 | 237 | |
238 | - if($ph['contextmenu']) { |
|
239 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
238 | + if ($ph['contextmenu']) { |
|
239 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
240 | 240 | } |
241 | 241 | |
242 | - if($_SESSION['tree_show_only_folders']) { |
|
243 | - if($row['parent'] == 0) { |
|
242 | + if ($_SESSION['tree_show_only_folders']) { |
|
243 | + if ($row['parent'] == 0) { |
|
244 | 244 | $node .= $modx->parseText($tpl, $ph); |
245 | 245 | } else { |
246 | 246 | $node .= ''; |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | $ph['icon_folder_open'] = $_style['tree_folderopen_new']; |
254 | 254 | $ph['icon_folder_close'] = $_style['tree_folder_new']; |
255 | 255 | |
256 | - if($_SESSION['tree_show_only_folders']) { |
|
256 | + if ($_SESSION['tree_show_only_folders']) { |
|
257 | 257 | $tpl = getTplFolderNodeNotChildren(); |
258 | 258 | $checkFolders = checkIsFolder($row['id'], 1) ? 1 : 0; // folders |
259 | 259 | $checkDocs = checkIsFolder($row['id'], 0) ? 1 : 0; // no folders |
260 | 260 | $ph['tree_page_click'] = 3; |
261 | 261 | |
262 | 262 | // expandAll: two type for partial expansion |
263 | - if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { |
|
264 | - if($expandAll == 1) { |
|
263 | + if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { |
|
264 | + if ($expandAll == 1) { |
|
265 | 265 | $opened2[] = $row['id']; |
266 | 266 | } |
267 | 267 | $ph['icon'] = $ph['icon_folder_open']; |
@@ -269,11 +269,11 @@ discard block |
||
269 | 269 | $ph['node_toggle'] = 1; |
270 | 270 | $ph['subMenuState'] = ' open'; |
271 | 271 | |
272 | - if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { |
|
272 | + if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { |
|
273 | 273 | $ph['showChildren'] = 1; |
274 | 274 | $ph['icon_node_toggle'] = ''; |
275 | 275 | $ph['icon'] = $ph['icon_folder_close']; |
276 | - } elseif(!$checkDocs && $checkFolders) { |
|
276 | + } elseif (!$checkDocs && $checkFolders) { |
|
277 | 277 | $ph['showChildren'] = 0; |
278 | 278 | $ph['openFolder'] = 2; |
279 | 279 | } else { |
@@ -285,20 +285,20 @@ discard block |
||
285 | 285 | 'ph' => $ph, |
286 | 286 | 'opened' => '1' |
287 | 287 | )); |
288 | - if(is_array($prenode)) { |
|
288 | + if (is_array($prenode)) { |
|
289 | 289 | $phnew = array(); |
290 | - foreach($prenode as $pnode) { |
|
290 | + foreach ($prenode as $pnode) { |
|
291 | 291 | $phnew = array_merge($phnew, unserialize($pnode)); |
292 | 292 | } |
293 | 293 | $ph = (count($phnew) > 0) ? $phnew : $ph; |
294 | 294 | } |
295 | 295 | |
296 | - if($ph['contextmenu']) { |
|
297 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
296 | + if ($ph['contextmenu']) { |
|
297 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | $node .= $modx->parseText($tpl, $ph); |
301 | - if($checkFolders) { |
|
301 | + if ($checkFolders) { |
|
302 | 302 | $node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid); |
303 | 303 | } |
304 | 304 | $node .= '</div></div>'; |
@@ -308,10 +308,10 @@ discard block |
||
308 | 308 | $ph['icon_node_toggle'] = $ph['tree_plusnode']; |
309 | 309 | $ph['node_toggle'] = 0; |
310 | 310 | |
311 | - if(($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { |
|
311 | + if (($checkDocs && !$checkFolders) || (!$checkDocs && !$checkFolders)) { |
|
312 | 312 | $ph['showChildren'] = 1; |
313 | 313 | $ph['icon_node_toggle'] = ''; |
314 | - } elseif(!$checkDocs && $checkFolders) { |
|
314 | + } elseif (!$checkDocs && $checkFolders) { |
|
315 | 315 | $ph['showChildren'] = 0; |
316 | 316 | $ph['openFolder'] = 2; |
317 | 317 | } else { |
@@ -323,16 +323,16 @@ discard block |
||
323 | 323 | 'ph' => $ph, |
324 | 324 | 'opened' => '0' |
325 | 325 | )); |
326 | - if(is_array($prenode)) { |
|
326 | + if (is_array($prenode)) { |
|
327 | 327 | $phnew = array(); |
328 | - foreach($prenode as $pnode) { |
|
328 | + foreach ($prenode as $pnode) { |
|
329 | 329 | $phnew = array_merge($phnew, unserialize($pnode)); |
330 | 330 | } |
331 | 331 | $ph = (count($phnew) > 0) ? $phnew : $ph; |
332 | 332 | } |
333 | 333 | |
334 | - if($ph['contextmenu']) { |
|
335 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
334 | + if ($ph['contextmenu']) { |
|
335 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | $node .= $modx->parseText($tpl, $ph); |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | } else { |
342 | 342 | $tpl = getTplFolderNode(); |
343 | 343 | // expandAll: two type for partial expansion |
344 | - if($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { |
|
345 | - if($expandAll == 1) { |
|
344 | + if ($expandAll == 1 || ($expandAll == 2 && in_array($row['id'], $opened))) { |
|
345 | + if ($expandAll == 1) { |
|
346 | 346 | $opened2[] = $row['id']; |
347 | 347 | } |
348 | 348 | $ph['icon'] = $ph['icon_folder_open']; |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | $ph['node_toggle'] = 1; |
351 | 351 | $ph['subMenuState'] = ' open'; |
352 | 352 | |
353 | - if($ph['donthit'] == 1) { |
|
353 | + if ($ph['donthit'] == 1) { |
|
354 | 354 | $ph['tree_page_click'] = 3; |
355 | 355 | $ph['icon_node_toggle'] = ''; |
356 | 356 | $ph['icon'] = $ph['icon_folder_close']; |
@@ -362,32 +362,32 @@ discard block |
||
362 | 362 | 'ph' => $ph, |
363 | 363 | 'opened' => '1' |
364 | 364 | )); |
365 | - if(is_array($prenode)) { |
|
365 | + if (is_array($prenode)) { |
|
366 | 366 | $phnew = array(); |
367 | - foreach($prenode as $pnode) { |
|
367 | + foreach ($prenode as $pnode) { |
|
368 | 368 | $phnew = array_merge($phnew, unserialize($pnode)); |
369 | 369 | } |
370 | 370 | $ph = (count($phnew) > 0) ? $phnew : $ph; |
371 | - if($ph['showChildren'] == 0) { |
|
371 | + if ($ph['showChildren'] == 0) { |
|
372 | 372 | unset($opened2[$row['id']]); |
373 | 373 | $ph['node_toggle'] = 0; |
374 | 374 | $ph['subMenuState'] = ''; |
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
378 | - if($ph['showChildren'] == 0) { |
|
378 | + if ($ph['showChildren'] == 0) { |
|
379 | 379 | $ph['icon_node_toggle'] = ''; |
380 | 380 | $ph['donthit'] = 1; |
381 | 381 | $ph['icon'] = $ph['icon_folder_close']; |
382 | 382 | $tpl = getTplFolderNodeNotChildren(); |
383 | 383 | } |
384 | 384 | |
385 | - if($ph['contextmenu']) { |
|
386 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
385 | + if ($ph['contextmenu']) { |
|
386 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | $node .= $modx->parseText($tpl, $ph); |
390 | - if($ph['donthit'] == 0) { |
|
390 | + if ($ph['donthit'] == 0) { |
|
391 | 391 | $node .= makeHTML($indent + 1, $row['id'], $expandAll, $theme, $hereid); |
392 | 392 | } |
393 | 393 | $node .= '</div></div>'; |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $ph['icon_node_toggle'] = $ph['tree_plusnode']; |
398 | 398 | $ph['node_toggle'] = 0; |
399 | 399 | |
400 | - if($ph['donthit'] == 1) { |
|
400 | + if ($ph['donthit'] == 1) { |
|
401 | 401 | $ph['tree_page_click'] = 3; |
402 | 402 | $ph['icon_node_toggle'] = ''; |
403 | 403 | $ph['icon'] = $ph['icon_folder_close']; |
@@ -409,23 +409,23 @@ discard block |
||
409 | 409 | 'ph' => $ph, |
410 | 410 | 'opened' => '0' |
411 | 411 | )); |
412 | - if(is_array($prenode)) { |
|
412 | + if (is_array($prenode)) { |
|
413 | 413 | $phnew = array(); |
414 | - foreach($prenode as $pnode) { |
|
414 | + foreach ($prenode as $pnode) { |
|
415 | 415 | $phnew = array_merge($phnew, unserialize($pnode)); |
416 | 416 | } |
417 | 417 | $ph = (count($phnew) > 0) ? $phnew : $ph; |
418 | 418 | } |
419 | 419 | |
420 | - if($ph['showChildren'] == 0) { |
|
420 | + if ($ph['showChildren'] == 0) { |
|
421 | 421 | $ph['icon_node_toggle'] = ''; |
422 | 422 | $ph['donthit'] = 1; |
423 | 423 | $ph['icon'] = $ph['icon_folder_close']; |
424 | 424 | $tpl = getTplFolderNodeNotChildren(); |
425 | 425 | } |
426 | 426 | |
427 | - if($ph['contextmenu']) { |
|
428 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
427 | + if ($ph['contextmenu']) { |
|
428 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | $node .= $modx->parseText($tpl, $ph); |
@@ -437,10 +437,10 @@ discard block |
||
437 | 437 | // invoke OnManagerNodeRender event |
438 | 438 | $data['node'] = $node; |
439 | 439 | $evtOut = $modx->invokeEvent('OnManagerNodeRender', $data); |
440 | - if(is_array($evtOut)) { |
|
440 | + if (is_array($evtOut)) { |
|
441 | 441 | $evtOut = implode("\n", $evtOut); |
442 | 442 | } |
443 | - if($evtOut != '') { |
|
443 | + if ($evtOut != '') { |
|
444 | 444 | $node = trim($evtOut); |
445 | 445 | } |
446 | 446 | |
@@ -450,14 +450,14 @@ discard block |
||
450 | 450 | return $output; |
451 | 451 | } |
452 | 452 | |
453 | -function getIconInfo($_style) { |
|
454 | - if(!isset($_style['tree_page_gif'])) { |
|
453 | +function getIconInfo($_style){ |
|
454 | + if (!isset($_style['tree_page_gif'])) { |
|
455 | 455 | $_style['tree_page_gif'] = $_style['tree_page']; |
456 | 456 | } |
457 | - if(!isset($_style['tree_page_jpg'])) { |
|
457 | + if (!isset($_style['tree_page_jpg'])) { |
|
458 | 458 | $_style['tree_page_jpg'] = $_style['tree_page']; |
459 | 459 | } |
460 | - if(!isset($_style['tree_page_png'])) { |
|
460 | + if (!isset($_style['tree_page_png'])) { |
|
461 | 461 | $_style['tree_page_png'] = $_style['tree_page']; |
462 | 462 | } |
463 | 463 | $icons = array( |
@@ -477,14 +477,14 @@ discard block |
||
477 | 477 | return $icons; |
478 | 478 | } |
479 | 479 | |
480 | -function getPrivateIconInfo($_style) { |
|
481 | - if(!isset($_style['tree_page_gif_secure'])) { |
|
480 | +function getPrivateIconInfo($_style){ |
|
481 | + if (!isset($_style['tree_page_gif_secure'])) { |
|
482 | 482 | $_style['tree_page_gif_secure'] = $_style['tree_page_secure']; |
483 | 483 | } |
484 | - if(!isset($_style['tree_page_jpg_secure'])) { |
|
484 | + if (!isset($_style['tree_page_jpg_secure'])) { |
|
485 | 485 | $_style['tree_page_jpg_secure'] = $_style['tree_page_secure']; |
486 | 486 | } |
487 | - if(!isset($_style['tree_page_png_secure'])) { |
|
487 | + if (!isset($_style['tree_page_png_secure'])) { |
|
488 | 488 | $_style['tree_page_png_secure'] = $_style['tree_page_secure']; |
489 | 489 | } |
490 | 490 | $iconsPrivate = array( |
@@ -504,21 +504,21 @@ discard block |
||
504 | 504 | return $iconsPrivate; |
505 | 505 | } |
506 | 506 | |
507 | -function getNodeTitle($nodeNameSource, $row) { |
|
507 | +function getNodeTitle($nodeNameSource, $row){ |
|
508 | 508 | global $modx; |
509 | 509 | |
510 | - switch($nodeNameSource) { |
|
510 | + switch ($nodeNameSource) { |
|
511 | 511 | case 'menutitle': |
512 | 512 | $nodetitle = $row['menutitle'] ? $row['menutitle'] : $row['pagetitle']; |
513 | 513 | break; |
514 | 514 | case 'alias': |
515 | 515 | $nodetitle = $row['alias'] ? $row['alias'] : $row['id']; |
516 | - if(strpos($row['alias'], '.') === false) { |
|
517 | - if($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) { |
|
516 | + if (strpos($row['alias'], '.') === false) { |
|
517 | + if ($row['isfolder'] != 1 || $modx->config['make_folders'] != 1) { |
|
518 | 518 | $nodetitle .= $modx->config['friendly_url_suffix']; |
519 | 519 | } |
520 | 520 | } |
521 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
521 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
522 | 522 | break; |
523 | 523 | case 'pagetitle': |
524 | 524 | $nodetitle = $row['pagetitle']; |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | case 'unpub_date': |
534 | 534 | $doc = $modx->getDocumentObject('id', $row['id']); |
535 | 535 | $date = $doc[$nodeNameSource]; |
536 | - if(!empty($date)) { |
|
536 | + if (!empty($date)) { |
|
537 | 537 | $nodetitle = $modx->toDateFormat($date); |
538 | 538 | } else { |
539 | 539 | $nodetitle = '- - -'; |
@@ -550,8 +550,8 @@ discard block |
||
550 | 550 | return $nodetitle; |
551 | 551 | } |
552 | 552 | |
553 | -function isDateNode($nodeNameSource) { |
|
554 | - switch($nodeNameSource) { |
|
553 | +function isDateNode($nodeNameSource){ |
|
554 | + switch ($nodeNameSource) { |
|
555 | 555 | case 'createdon': |
556 | 556 | case 'editedon': |
557 | 557 | case 'publishedon': |
@@ -563,13 +563,13 @@ discard block |
||
563 | 563 | } |
564 | 564 | } |
565 | 565 | |
566 | -function checkIsFolder($parent = 0, $isfolder = 1) { |
|
566 | +function checkIsFolder($parent = 0, $isfolder = 1){ |
|
567 | 567 | global $modx; |
568 | 568 | |
569 | - return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
569 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
570 | 570 | } |
571 | 571 | |
572 | -function _htmlentities($array) { |
|
572 | +function _htmlentities($array){ |
|
573 | 573 | global $modx; |
574 | 574 | |
575 | 575 | $array = json_encode($array, JSON_UNESCAPED_UNICODE); |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | return $array; |
579 | 579 | } |
580 | 580 | |
581 | -function getTplSingleNode() { |
|
581 | +function getTplSingleNode(){ |
|
582 | 582 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
583 | 583 | onclick="modx.tree.treeAction(event,[+id+]);" |
584 | 584 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a></div>'; |
603 | 603 | } |
604 | 604 | |
605 | -function getTplFolderNode() { |
|
605 | +function getTplFolderNode(){ |
|
606 | 606 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
607 | 607 | onclick="modx.tree.treeAction(event,[+id+]);" |
608 | 608 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>'; |
639 | 639 | } |
640 | 640 | |
641 | -function getTplFolderNodeNotChildren() { |
|
641 | +function getTplFolderNodeNotChildren(){ |
|
642 | 642 | return '<div id="node[+id+]"><a class="[+treeNodeClass+]" |
643 | 643 | onclick="modx.tree.treeAction(event,[+id+]);" |
644 | 644 | oncontextmenu="modx.tree.showPopup(event,[+id+],\'[+nodetitle_esc+]\');" |
@@ -670,11 +670,11 @@ discard block |
||
670 | 670 | title="[+title+]">[+nodetitleDisplay+][+weblinkDisplay+]</span>[+pageIdDisplay+]</a><div>'; |
671 | 671 | } |
672 | 672 | |
673 | -function dbug($str, $flag = false) { |
|
673 | +function dbug($str, $flag = false){ |
|
674 | 674 | print('<pre>'); |
675 | 675 | print_r($str); |
676 | 676 | print('</pre>'); |
677 | - if($flag) { |
|
677 | + if ($flag) { |
|
678 | 678 | exit; |
679 | 679 | } |
680 | 680 | } |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |