@@ -3,7 +3,7 @@ discard block |
||
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 | if(!$modx->hasPermission('access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // access group processor. |
@@ -20,113 +20,113 @@ discard block |
||
20 | 20 | $operation = $_REQUEST['operation']; |
21 | 21 | |
22 | 22 | switch ($operation) { |
23 | - case "add_user_group" : |
|
24 | - $newgroup = $_REQUEST['newusergroup']; |
|
25 | - if(empty($newgroup)) { |
|
26 | - $modx->webAlertAndQuit("No group name specified."); |
|
27 | - } else { |
|
28 | - $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_membergroup_names); |
|
23 | + case "add_user_group" : |
|
24 | + $newgroup = $_REQUEST['newusergroup']; |
|
25 | + if(empty($newgroup)) { |
|
26 | + $modx->webAlertAndQuit("No group name specified."); |
|
27 | + } else { |
|
28 | + $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_membergroup_names); |
|
29 | 29 | |
30 | - // invoke OnManagerCreateGroup event |
|
31 | - $modx->invokeEvent('OnManagerCreateGroup', array( |
|
32 | - 'groupid' => $id, |
|
33 | - 'groupname' => $newgroup, |
|
34 | - )); |
|
35 | - } |
|
36 | - break; |
|
37 | - case "add_document_group" : |
|
38 | - $newgroup = $_REQUEST['newdocgroup']; |
|
39 | - if(empty($newgroup)) { |
|
40 | - $modx->webAlertAndQuit("No group name specified."); |
|
41 | - } else { |
|
42 | - $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_documentgroup_names); |
|
30 | + // invoke OnManagerCreateGroup event |
|
31 | + $modx->invokeEvent('OnManagerCreateGroup', array( |
|
32 | + 'groupid' => $id, |
|
33 | + 'groupname' => $newgroup, |
|
34 | + )); |
|
35 | + } |
|
36 | + break; |
|
37 | + case "add_document_group" : |
|
38 | + $newgroup = $_REQUEST['newdocgroup']; |
|
39 | + if(empty($newgroup)) { |
|
40 | + $modx->webAlertAndQuit("No group name specified."); |
|
41 | + } else { |
|
42 | + $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_documentgroup_names); |
|
43 | 43 | |
44 | - // invoke OnCreateDocGroup event |
|
45 | - $modx->invokeEvent('OnCreateDocGroup', array( |
|
46 | - 'groupid' => $id, |
|
47 | - 'groupname' => $newgroup, |
|
48 | - )); |
|
49 | - } |
|
50 | - break; |
|
51 | - case "delete_user_group" : |
|
52 | - $updategroupaccess = true; |
|
53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | - if(empty($usergroup)) { |
|
55 | - $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
56 | - } else { |
|
57 | - $modx->db->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
|
44 | + // invoke OnCreateDocGroup event |
|
45 | + $modx->invokeEvent('OnCreateDocGroup', array( |
|
46 | + 'groupid' => $id, |
|
47 | + 'groupname' => $newgroup, |
|
48 | + )); |
|
49 | + } |
|
50 | + break; |
|
51 | + case "delete_user_group" : |
|
52 | + $updategroupaccess = true; |
|
53 | + $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | + if(empty($usergroup)) { |
|
55 | + $modx->webAlertAndQuit("No user group id specified for deletion."); |
|
56 | + } else { |
|
57 | + $modx->db->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
|
58 | 58 | |
59 | - $modx->db->delete($tbl_membergroup_access, "membergroup='{$usergroup}'"); |
|
59 | + $modx->db->delete($tbl_membergroup_access, "membergroup='{$usergroup}'"); |
|
60 | 60 | |
61 | - $modx->db->delete($tbl_member_groups, "user_group='{$usergroup}'"); |
|
62 | - } |
|
63 | - break; |
|
64 | - case "delete_document_group" : |
|
65 | - $group = (int)$_REQUEST['documentgroup']; |
|
66 | - if(empty($group)) { |
|
67 | - $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
68 | - } else { |
|
69 | - $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
61 | + $modx->db->delete($tbl_member_groups, "user_group='{$usergroup}'"); |
|
62 | + } |
|
63 | + break; |
|
64 | + case "delete_document_group" : |
|
65 | + $group = (int)$_REQUEST['documentgroup']; |
|
66 | + if(empty($group)) { |
|
67 | + $modx->webAlertAndQuit("No document group id specified for deletion."); |
|
68 | + } else { |
|
69 | + $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
|
70 | 70 | |
71 | - $modx->db->delete($tbl_membergroup_access, "documentgroup='{$group}'"); |
|
71 | + $modx->db->delete($tbl_membergroup_access, "documentgroup='{$group}'"); |
|
72 | 72 | |
73 | - $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); |
|
74 | - } |
|
75 | - break; |
|
76 | - case "rename_user_group" : |
|
77 | - $newgroupname = $_REQUEST['newgroupname']; |
|
78 | - if(empty($newgroupname)) { |
|
79 | - $modx->webAlertAndQuit("No group name specified."); |
|
80 | - } |
|
81 | - $groupid = (int)$_REQUEST['groupid']; |
|
82 | - if(empty($groupid)) { |
|
83 | - $modx->webAlertAndQuit("No group id specified for rename."); |
|
84 | - } |
|
73 | + $modx->db->delete($tbl_document_groups, "document_group='{$group}'"); |
|
74 | + } |
|
75 | + break; |
|
76 | + case "rename_user_group" : |
|
77 | + $newgroupname = $_REQUEST['newgroupname']; |
|
78 | + if(empty($newgroupname)) { |
|
79 | + $modx->webAlertAndQuit("No group name specified."); |
|
80 | + } |
|
81 | + $groupid = (int)$_REQUEST['groupid']; |
|
82 | + if(empty($groupid)) { |
|
83 | + $modx->webAlertAndQuit("No group id specified for rename."); |
|
84 | + } |
|
85 | 85 | |
86 | - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_membergroup_names, "id='{$groupid}'"); |
|
87 | - break; |
|
88 | - case "rename_document_group" : |
|
89 | - $newgroupname = $_REQUEST['newgroupname']; |
|
90 | - if(empty($newgroupname)) { |
|
91 | - $modx->webAlertAndQuit("No group name specified."); |
|
92 | - } |
|
93 | - $groupid = (int)$_REQUEST['groupid']; |
|
94 | - if(empty($groupid)) { |
|
95 | - $modx->webAlertAndQuit("No group id specified for rename."); |
|
96 | - } |
|
86 | + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_membergroup_names, "id='{$groupid}'"); |
|
87 | + break; |
|
88 | + case "rename_document_group" : |
|
89 | + $newgroupname = $_REQUEST['newgroupname']; |
|
90 | + if(empty($newgroupname)) { |
|
91 | + $modx->webAlertAndQuit("No group name specified."); |
|
92 | + } |
|
93 | + $groupid = (int)$_REQUEST['groupid']; |
|
94 | + if(empty($groupid)) { |
|
95 | + $modx->webAlertAndQuit("No group id specified for rename."); |
|
96 | + } |
|
97 | 97 | |
98 | - $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
99 | - break; |
|
100 | - case "add_document_group_to_user_group" : |
|
101 | - $updategroupaccess = true; |
|
102 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
104 | - $rs = $modx->db->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
105 | - $limit = $modx->db->getValue($rs); |
|
106 | - if($limit<=0) { |
|
107 | - $modx->db->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
|
108 | - } else { |
|
109 | - //alert user that coupling already exists? |
|
110 | - } |
|
111 | - break; |
|
112 | - case "remove_document_group_from_user_group" : |
|
113 | - $updategroupaccess = true; |
|
114 | - $coupling = (int)$_REQUEST['coupling']; |
|
115 | - $modx->db->delete($tbl_membergroup_access, "id='{$coupling}'"); |
|
116 | - break; |
|
117 | - default : |
|
118 | - $modx->webAlertAndQuit("No operation set in request."); |
|
98 | + $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
|
99 | + break; |
|
100 | + case "add_document_group_to_user_group" : |
|
101 | + $updategroupaccess = true; |
|
102 | + $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | + $docgroup = (int)$_REQUEST['docgroup']; |
|
104 | + $rs = $modx->db->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
|
105 | + $limit = $modx->db->getValue($rs); |
|
106 | + if($limit<=0) { |
|
107 | + $modx->db->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
|
108 | + } else { |
|
109 | + //alert user that coupling already exists? |
|
110 | + } |
|
111 | + break; |
|
112 | + case "remove_document_group_from_user_group" : |
|
113 | + $updategroupaccess = true; |
|
114 | + $coupling = (int)$_REQUEST['coupling']; |
|
115 | + $modx->db->delete($tbl_membergroup_access, "id='{$coupling}'"); |
|
116 | + break; |
|
117 | + default : |
|
118 | + $modx->webAlertAndQuit("No operation set in request."); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // secure manager documents - flag as private |
122 | 122 | if($updategroupaccess==true){ |
123 | - include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
124 | - secureMgrDocument(); |
|
123 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
124 | + secureMgrDocument(); |
|
125 | 125 | |
126 | - // Update the private group column |
|
127 | - $modx->db->update( |
|
128 | - 'dgn.private_memgroup = (mga.membergroup IS NOT NULL)', |
|
129 | - "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_membergroup_access} AS mga ON mga.documentgroup = dgn.id"); |
|
126 | + // Update the private group column |
|
127 | + $modx->db->update( |
|
128 | + 'dgn.private_memgroup = (mga.membergroup IS NOT NULL)', |
|
129 | + "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_membergroup_access} AS mga ON mga.documentgroup = dgn.id"); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $header = "Location: index.php?a=40"; |
@@ -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('access_permissions')) { |
|
5 | +if (!$modx->hasPermission('access_permissions')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | switch ($operation) { |
23 | 23 | case "add_user_group" : |
24 | 24 | $newgroup = $_REQUEST['newusergroup']; |
25 | - if(empty($newgroup)) { |
|
25 | + if (empty($newgroup)) { |
|
26 | 26 | $modx->webAlertAndQuit("No group name specified."); |
27 | 27 | } else { |
28 | 28 | $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_membergroup_names); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | break; |
37 | 37 | case "add_document_group" : |
38 | 38 | $newgroup = $_REQUEST['newdocgroup']; |
39 | - if(empty($newgroup)) { |
|
39 | + if (empty($newgroup)) { |
|
40 | 40 | $modx->webAlertAndQuit("No group name specified."); |
41 | 41 | } else { |
42 | 42 | $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_documentgroup_names); |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | break; |
51 | 51 | case "delete_user_group" : |
52 | 52 | $updategroupaccess = true; |
53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
54 | - if(empty($usergroup)) { |
|
53 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
54 | + if (empty($usergroup)) { |
|
55 | 55 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
56 | 56 | } else { |
57 | 57 | $modx->db->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | } |
63 | 63 | break; |
64 | 64 | case "delete_document_group" : |
65 | - $group = (int)$_REQUEST['documentgroup']; |
|
66 | - if(empty($group)) { |
|
65 | + $group = (int) $_REQUEST['documentgroup']; |
|
66 | + if (empty($group)) { |
|
67 | 67 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
68 | 68 | } else { |
69 | 69 | $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | break; |
76 | 76 | case "rename_user_group" : |
77 | 77 | $newgroupname = $_REQUEST['newgroupname']; |
78 | - if(empty($newgroupname)) { |
|
78 | + if (empty($newgroupname)) { |
|
79 | 79 | $modx->webAlertAndQuit("No group name specified."); |
80 | 80 | } |
81 | - $groupid = (int)$_REQUEST['groupid']; |
|
82 | - if(empty($groupid)) { |
|
81 | + $groupid = (int) $_REQUEST['groupid']; |
|
82 | + if (empty($groupid)) { |
|
83 | 83 | $modx->webAlertAndQuit("No group id specified for rename."); |
84 | 84 | } |
85 | 85 | |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | break; |
88 | 88 | case "rename_document_group" : |
89 | 89 | $newgroupname = $_REQUEST['newgroupname']; |
90 | - if(empty($newgroupname)) { |
|
90 | + if (empty($newgroupname)) { |
|
91 | 91 | $modx->webAlertAndQuit("No group name specified."); |
92 | 92 | } |
93 | - $groupid = (int)$_REQUEST['groupid']; |
|
94 | - if(empty($groupid)) { |
|
93 | + $groupid = (int) $_REQUEST['groupid']; |
|
94 | + if (empty($groupid)) { |
|
95 | 95 | $modx->webAlertAndQuit("No group id specified for rename."); |
96 | 96 | } |
97 | 97 | |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | break; |
100 | 100 | case "add_document_group_to_user_group" : |
101 | 101 | $updategroupaccess = true; |
102 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
103 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
102 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
103 | + $docgroup = (int) $_REQUEST['docgroup']; |
|
104 | 104 | $rs = $modx->db->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
105 | 105 | $limit = $modx->db->getValue($rs); |
106 | - if($limit<=0) { |
|
106 | + if ($limit <= 0) { |
|
107 | 107 | $modx->db->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
108 | 108 | } else { |
109 | 109 | //alert user that coupling already exists? |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | break; |
112 | 112 | case "remove_document_group_from_user_group" : |
113 | 113 | $updategroupaccess = true; |
114 | - $coupling = (int)$_REQUEST['coupling']; |
|
114 | + $coupling = (int) $_REQUEST['coupling']; |
|
115 | 115 | $modx->db->delete($tbl_membergroup_access, "id='{$coupling}'"); |
116 | 116 | break; |
117 | 117 | default : |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | // secure manager documents - flag as private |
122 | -if($updategroupaccess==true){ |
|
122 | +if ($updategroupaccess == true) { |
|
123 | 123 | include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
124 | 124 | secureMgrDocument(); |
125 | 125 |
@@ -1,22 +1,22 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_template')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
10 | 10 | if($id == 0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // delete the template, but first check it doesn't have any documents using it |
15 | 15 | $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
16 | 16 | $limit = $modx->db->getRecordCount($rs); |
17 | 17 | if($limit > 0) { |
18 | - include "header.inc.php"; |
|
19 | - ?> |
|
18 | + include "header.inc.php"; |
|
19 | + ?> |
|
20 | 20 | |
21 | 21 | <h1><?php echo $_lang['manage_templates']; ?></h1> |
22 | 22 | |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | <p>Documents using this template:</p> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - while($row = $modx->db->getRow($rs)) { |
|
32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | - } |
|
34 | - ?> |
|
31 | + while($row = $modx->db->getRow($rs)) { |
|
32 | + echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
33 | + } |
|
34 | + ?> |
|
35 | 35 | </ul> |
36 | 36 | </div> |
37 | 37 | </div> |
38 | 38 | <?php |
39 | - include_once "footer.inc.php"; |
|
40 | - exit; |
|
39 | + include_once "footer.inc.php"; |
|
40 | + exit; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if($id == $default_template) { |
44 | - $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
44 | + $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Set the item name for logger |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | |
51 | 51 | // invoke OnBeforeTempFormDelete event |
52 | 52 | $modx->invokeEvent("OnBeforeTempFormDelete", array( |
53 | - "id" => $id |
|
54 | - )); |
|
53 | + "id" => $id |
|
54 | + )); |
|
55 | 55 | |
56 | 56 | // delete the document. |
57 | 57 | $modx->db->delete($modx->getFullTableName('site_templates'), "id='{$id}'"); |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | // invoke OnTempFormDelete event |
62 | 62 | $modx->invokeEvent("OnTempFormDelete", array( |
63 | - "id" => $id |
|
64 | - )); |
|
63 | + "id" => $id |
|
64 | + )); |
|
65 | 65 | |
66 | 66 | // empty cache |
67 | 67 | $modx->clearCache('full'); |
@@ -1,20 +1,20 @@ 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('delete_template')) { |
|
5 | +if (!$modx->hasPermission('delete_template')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
10 | -if($id == 0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | // delete the template, but first check it doesn't have any documents using it |
15 | 15 | $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
16 | 16 | $limit = $modx->db->getRecordCount($rs); |
17 | -if($limit > 0) { |
|
17 | +if ($limit > 0) { |
|
18 | 18 | include "header.inc.php"; |
19 | 19 | ?> |
20 | 20 | |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | <p>Documents using this template:</p> |
29 | 29 | <ul> |
30 | 30 | <?php |
31 | - while($row = $modx->db->getRow($rs)) { |
|
32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
31 | + while ($row = $modx->db->getRow($rs)) { |
|
32 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>'; |
|
33 | 33 | } |
34 | 34 | ?> |
35 | 35 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | exit; |
41 | 41 | } |
42 | 42 | |
43 | -if($id == $default_template) { |
|
43 | +if ($id == $default_template) { |
|
44 | 44 | $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
45 | 45 | } |
46 | 46 |
@@ -3,12 +3,12 @@ discard block |
||
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 | if(!$modx->hasPermission('delete_snippet')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // Set the item name for logger |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeSnipFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeSnipFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the snippet. |
25 | 25 | $modx->db->delete($modx->getFullTableName('site_snippets'), "id='{$id}'"); |
26 | 26 | |
27 | 27 | // invoke OnSnipFormDelete event |
28 | 28 | $modx->invokeEvent("OnSnipFormDelete", |
29 | - array( |
|
30 | - "id" => $id |
|
31 | - )); |
|
29 | + array( |
|
30 | + "id" => $id |
|
31 | + )); |
|
32 | 32 | |
33 | 33 | // empty cache |
34 | 34 | $modx->clearCache('full'); |
@@ -1,13 +1,13 @@ 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('delete_snippet')) { |
|
5 | +if (!$modx->hasPermission('delete_snippet')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
@@ -34,5 +34,5 @@ discard block |
||
34 | 34 | $modx->clearCache('full'); |
35 | 35 | |
36 | 36 | // finished emptying cache - redirect |
37 | -$header="Location: index.php?a=76&r=2"; |
|
37 | +$header = "Location: index.php?a=76&r=2"; |
|
38 | 38 | header($header); |
@@ -3,33 +3,33 @@ |
||
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 | if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (isset($_REQUEST['t'])) { |
10 | 10 | |
11 | - if (empty($_REQUEST['t'])) { |
|
12 | - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
13 | - } |
|
11 | + if (empty($_REQUEST['t'])) { |
|
12 | + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
13 | + } |
|
14 | 14 | |
15 | - // Set the item name for logger |
|
16 | - $_SESSION['itemname'] = $_REQUEST['t']; |
|
15 | + // Set the item name for logger |
|
16 | + $_SESSION['itemname'] = $_REQUEST['t']; |
|
17 | 17 | |
18 | - $modx->db->optimize($_REQUEST['t']); |
|
18 | + $modx->db->optimize($_REQUEST['t']); |
|
19 | 19 | |
20 | 20 | } elseif (isset($_REQUEST['u'])) { |
21 | 21 | |
22 | - if (empty($_REQUEST['u'])) { |
|
23 | - $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); |
|
24 | - } |
|
22 | + if (empty($_REQUEST['u'])) { |
|
23 | + $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]); |
|
24 | + } |
|
25 | 25 | |
26 | - // Set the item name for logger |
|
27 | - $_SESSION['itemname'] = $_REQUEST['u']; |
|
26 | + // Set the item name for logger |
|
27 | + $_SESSION['itemname'] = $_REQUEST['u']; |
|
28 | 28 | |
29 | - $modx->db->truncate($_REQUEST['u']); |
|
29 | + $modx->db->truncate($_REQUEST['u']); |
|
30 | 30 | |
31 | 31 | } else { |
32 | - $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
32 | + $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $mode = (int)$_REQUEST['mode']; |
@@ -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('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { |
|
5 | +if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs') || $modx->hasPermission('bk_manager')))) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -32,6 +32,6 @@ discard block |
||
32 | 32 | $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
33 | 33 | } |
34 | 34 | |
35 | -$mode = (int)$_REQUEST['mode']; |
|
36 | -$header="Location: index.php?a={$mode}&s=4"; |
|
35 | +$mode = (int) $_REQUEST['mode']; |
|
36 | +$header = "Location: index.php?a={$mode}&s=4"; |
|
37 | 37 | header($header); |
@@ -4,23 +4,23 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!isset($_GET['id'])) { |
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | |
9 | - // Remove all locks |
|
10 | - $modx->db->truncate($modx->getFullTableName('active_user_locks')); |
|
9 | + // Remove all locks |
|
10 | + $modx->db->truncate($modx->getFullTableName('active_user_locks')); |
|
11 | 11 | |
12 | - $header = "Location: index.php?a=2"; |
|
13 | - header($header); |
|
12 | + $header = "Location: index.php?a=2"; |
|
13 | + header($header); |
|
14 | 14 | } else { |
15 | - // Remove single locks via AJAX / window.onbeforeunload |
|
16 | - $type = (int)$_GET['type']; |
|
17 | - $id = (int)$_GET['id']; |
|
18 | - $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | - if($type && $id) { |
|
20 | - $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | - echo '1'; |
|
22 | - exit; |
|
23 | - } else { |
|
24 | - echo 'No type or id sent with request.'; |
|
25 | - } |
|
15 | + // Remove single locks via AJAX / window.onbeforeunload |
|
16 | + $type = (int)$_GET['type']; |
|
17 | + $id = (int)$_GET['id']; |
|
18 | + $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
|
19 | + if($type && $id) { |
|
20 | + $modx->unlockElement($type, $id, $includeAllUsers); |
|
21 | + echo '1'; |
|
22 | + exit; |
|
23 | + } else { |
|
24 | + echo 'No type or id sent with request.'; |
|
25 | + } |
|
26 | 26 | } |
@@ -1,10 +1,10 @@ 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 | -if(!isset($_GET['id'])) { |
|
7 | - if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | +if (!isset($_GET['id'])) { |
|
7 | + if (!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | |
9 | 9 | // Remove all locks |
10 | 10 | $modx->db->truncate($modx->getFullTableName('active_user_locks')); |
@@ -13,10 +13,10 @@ discard block |
||
13 | 13 | header($header); |
14 | 14 | } else { |
15 | 15 | // Remove single locks via AJAX / window.onbeforeunload |
16 | - $type = (int)$_GET['type']; |
|
17 | - $id = (int)$_GET['id']; |
|
16 | + $type = (int) $_GET['type']; |
|
17 | + $id = (int) $_GET['id']; |
|
18 | 18 | $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
19 | - if($type && $id) { |
|
19 | + if ($type && $id) { |
|
20 | 20 | $modx->unlockElement($type, $id, $includeAllUsers); |
21 | 21 | echo '1'; |
22 | 22 | exit; |
@@ -3,12 +3,12 @@ discard block |
||
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 | if(!$modx->hasPermission('edit_template')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
@@ -19,37 +19,37 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate TV |
21 | 21 | $newid = $modx->db->insert( |
22 | - array( |
|
23 | - 'type'=>'', |
|
24 | - 'name'=>'', |
|
25 | - 'caption'=>'', |
|
26 | - 'description'=>'', |
|
27 | - 'default_text'=>'', |
|
28 | - 'elements'=>'', |
|
29 | - 'rank'=>'', |
|
30 | - 'display'=>'', |
|
31 | - 'display_params'=>'', |
|
32 | - 'category'=>'', |
|
33 | - ), $modx->getFullTableName('site_tmplvars'), // Insert into |
|
34 | - "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'type'=>'', |
|
24 | + 'name'=>'', |
|
25 | + 'caption'=>'', |
|
26 | + 'description'=>'', |
|
27 | + 'default_text'=>'', |
|
28 | + 'elements'=>'', |
|
29 | + 'rank'=>'', |
|
30 | + 'display'=>'', |
|
31 | + 'display_params'=>'', |
|
32 | + 'category'=>'', |
|
33 | + ), $modx->getFullTableName('site_tmplvars'), // Insert into |
|
34 | + "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from |
|
35 | 35 | |
36 | 36 | |
37 | 37 | // duplicate TV Template Access Permissions |
38 | 38 | $modx->db->insert( |
39 | - array( |
|
40 | - 'tmplvarid'=>'', |
|
41 | - 'templateid'=>'', |
|
42 | - 'rank'=>'', |
|
43 | - ), $modx->getFullTableName('site_tmplvar_templates'), // Insert into |
|
44 | - "'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from |
|
39 | + array( |
|
40 | + 'tmplvarid'=>'', |
|
41 | + 'templateid'=>'', |
|
42 | + 'rank'=>'', |
|
43 | + ), $modx->getFullTableName('site_tmplvar_templates'), // Insert into |
|
44 | + "'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from |
|
45 | 45 | |
46 | 46 | // duplicate TV Access Permissions |
47 | 47 | $modx->db->insert( |
48 | - array( |
|
49 | - 'tmplvarid'=>'', |
|
50 | - 'documentgroup'=>'', |
|
51 | - ), $modx->getFullTableName('site_tmplvar_access'), // Insert into |
|
52 | - "'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from |
|
48 | + array( |
|
49 | + 'tmplvarid'=>'', |
|
50 | + 'documentgroup'=>'', |
|
51 | + ), $modx->getFullTableName('site_tmplvar_access'), // Insert into |
|
52 | + "'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from |
|
53 | 53 | |
54 | 54 | // Set the item name for logger |
55 | 55 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$newid}'")); |
@@ -1,20 +1,20 @@ 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('edit_template')) { |
|
5 | +if (!$modx->hasPermission('edit_template')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
17 | +if ($count >= 1) $count = ' '.($count + 1); |
|
18 | 18 | else $count = ''; |
19 | 19 | |
20 | 20 | // duplicate TV |
@@ -56,5 +56,5 @@ discard block |
||
56 | 56 | $_SESSION['itemname'] = $name; |
57 | 57 | |
58 | 58 | // finish duplicating - redirect to new variable |
59 | -$header="Location: index.php?r=2&a=301&id=$newid"; |
|
59 | +$header = "Location: index.php?r=2&a=301&id=$newid"; |
|
60 | 60 | header($header); |
@@ -1,25 +1,25 @@ 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 | if (!$modx->hasPermission('delete_document')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if ($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | /*******ищем родителя чтобы к нему вернуться********/ |
15 | -$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | -$pid=($content['parent']==0?$id:$content['parent']); |
|
15 | +$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
16 | +$pid = ($content['parent'] == 0 ? $id : $content['parent']); |
|
17 | 17 | |
18 | 18 | /************ а заодно и путь возврата (сам путь внизу файла) **********/ |
19 | -$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC'; |
|
20 | -$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon'; |
|
21 | -$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:''; |
|
22 | -$add_path=$sd.$sb.$pg; |
|
19 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
20 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
21 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
22 | +$add_path = $sd.$sb.$pg; |
|
23 | 23 | |
24 | 24 | /*****************************/ |
25 | 25 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $children = array(); |
28 | 28 | |
29 | 29 | // check permissions on the document |
30 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
30 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
31 | 31 | $udperms = new udperms(); |
32 | 32 | $udperms->user = $modx->getLoginUserID(); |
33 | 33 | $udperms->document = $id; |
@@ -48,17 +48,17 @@ discard block |
||
48 | 48 | |
49 | 49 | $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent={$parent} AND deleted=0"); |
50 | 50 | // the document has children documents, we'll need to delete those too |
51 | - while ($childid=$modx->db->getValue($rs)) { |
|
52 | - if ($childid==$site_start) { |
|
51 | + while ($childid = $modx->db->getValue($rs)) { |
|
52 | + if ($childid == $site_start) { |
|
53 | 53 | $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site start' document, and cannot be deleted. Please assign another document as your 'Site start' document and try again."); |
54 | 54 | } |
55 | - if ($childid==$site_unavailable_page) { |
|
55 | + if ($childid == $site_unavailable_page) { |
|
56 | 56 | $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unavailable page' document, and cannot be deleted. Please assign another document as your 'Site unavailable page' document and try again."); |
57 | 57 | } |
58 | - if ($childid==$error_page) { |
|
58 | + if ($childid == $error_page) { |
|
59 | 59 | $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site error page' document, and cannot be deleted. Please assign another document as your 'Site error page' document and try again."); |
60 | 60 | } |
61 | - if ($childid==$unauthorized_page) { |
|
61 | + if ($childid == $unauthorized_page) { |
|
62 | 62 | $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unauthorized page' document, and cannot be deleted. Please assign another document as your 'Site unauthorized page' document and try again."); |
63 | 63 | } |
64 | 64 | $children[] = $childid; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | "children"=>$children |
77 | 77 | )); |
78 | 78 | |
79 | -if (count($children)>0) { |
|
79 | +if (count($children) > 0) { |
|
80 | 80 | $modx->db->update( |
81 | 81 | array( |
82 | 82 | 'deleted' => 1, |
@@ -85,19 +85,19 @@ discard block |
||
85 | 85 | ), $modx->getFullTableName('site_content'), "id IN (".implode(", ", $children).")"); |
86 | 86 | } |
87 | 87 | |
88 | -if ($site_start==$id) { |
|
88 | +if ($site_start == $id) { |
|
89 | 89 | $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!"); |
90 | 90 | } |
91 | 91 | |
92 | -if ($site_unavailable_page==$id) { |
|
92 | +if ($site_unavailable_page == $id) { |
|
93 | 93 | $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!"); |
94 | 94 | } |
95 | 95 | |
96 | -if ($error_page==$id) { |
|
96 | +if ($error_page == $id) { |
|
97 | 97 | $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!"); |
98 | 98 | } |
99 | 99 | |
100 | -if ($unauthorized_page==$id) { |
|
100 | +if ($unauthorized_page == $id) { |
|
101 | 101 | $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!"); |
102 | 102 | } |
103 | 103 | |
@@ -123,5 +123,5 @@ discard block |
||
123 | 123 | $modx->clearCache('full'); |
124 | 124 | |
125 | 125 | // finished emptying cache - redirect |
126 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
126 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
127 | 127 | header($header); |
@@ -3,22 +3,22 @@ |
||
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 | if(!$modx->hasPermission('delete_role')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | if($id==1){ |
15 | - $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
15 | + $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
19 | 19 | $count=$modx->db->getValue($rs); |
20 | 20 | if($count>0){ |
21 | - $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
21 | + $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // Set the item name for logger |
@@ -1,23 +1,23 @@ 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('delete_role')) { |
|
5 | +if (!$modx->hasPermission('delete_role')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | -if($id==1){ |
|
14 | +if ($id == 1) { |
|
15 | 15 | $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
16 | 16 | } |
17 | 17 | |
18 | 18 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
19 | -$count=$modx->db->getValue($rs); |
|
20 | -if($count>0){ |
|
19 | +$count = $modx->db->getValue($rs); |
|
20 | +if ($count > 0) { |
|
21 | 21 | $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
22 | 22 | } |
23 | 23 | |
@@ -28,5 +28,5 @@ discard block |
||
28 | 28 | // delete the attributes |
29 | 29 | $modx->db->delete($modx->getFullTableName('user_roles'), "id='{$id}'"); |
30 | 30 | |
31 | -$header="Location: index.php?a=86"; |
|
31 | +$header = "Location: index.php?a=86"; |
|
32 | 32 | header($header); |
@@ -1,12 +1,12 @@ 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 | if (!$modx->hasPermission('save_chunk')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $snippet = $modx->db->escape($_POST['post']); |
11 | 11 | $name = $modx->db->escape(trim($_POST['name'])); |
12 | 12 | $description = $modx->db->escape($_POST['description']); |
@@ -16,11 +16,11 @@ discard block |
||
16 | 16 | |
17 | 17 | //Kyle Jaebker - added category support |
18 | 18 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
19 | - $categoryid = (int)$_POST['categoryid']; |
|
19 | + $categoryid = (int) $_POST['categoryid']; |
|
20 | 20 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
21 | 21 | $categoryid = 0; |
22 | 22 | } else { |
23 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
23 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
24 | 24 | $categoryid = checkCategory($_POST['newcategory']); |
25 | 25 | if (!$categoryid) { |
26 | 26 | $categoryid = newCategory($_POST['newcategory']); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // finished emptying cache - redirect |
81 | 81 | if ($_POST['stay'] != '') { |
82 | 82 | $a = ($_POST['stay'] == '2') ? "78&id=$newid" : "77"; |
83 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
83 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
84 | 84 | header($header); |
85 | 85 | } else { |
86 | 86 | $header = "Location: index.php?a=76&r=2"; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // finished emptying cache - redirect |
130 | 130 | if ($_POST['stay'] != '') { |
131 | 131 | $a = ($_POST['stay'] == '2') ? "78&id=$id" : "77"; |
132 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
132 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
133 | 133 | header($header); |
134 | 134 | } else { |
135 | 135 | $modx->unlockElement(3, $id); |