@@ -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_web_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? intval($_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,9 +17,9 @@ discard block |
||
17 | 17 | |
18 | 18 | // invoke OnBeforeWUsrFormDelete event |
19 | 19 | $modx->invokeEvent("OnBeforeWUsrFormDelete", |
20 | - array( |
|
21 | - "id" => $id |
|
22 | - )); |
|
20 | + array( |
|
21 | + "id" => $id |
|
22 | + )); |
|
23 | 23 | |
24 | 24 | // delete the user. |
25 | 25 | $modx->db->delete($modx->getFullTableName('web_users'), "id='{$id}'"); |
@@ -32,16 +32,16 @@ discard block |
||
32 | 32 | |
33 | 33 | // invoke OnWebDeleteUser event |
34 | 34 | $modx->invokeEvent("OnWebDeleteUser", |
35 | - array( |
|
36 | - "userid" => $id, |
|
37 | - "username" => $username |
|
38 | - )); |
|
35 | + array( |
|
36 | + "userid" => $id, |
|
37 | + "username" => $username |
|
38 | + )); |
|
39 | 39 | |
40 | 40 | // invoke OnWUsrFormDelete event |
41 | 41 | $modx->invokeEvent("OnWUsrFormDelete", |
42 | - array( |
|
43 | - "id" => $id |
|
44 | - )); |
|
42 | + array( |
|
43 | + "id" => $id |
|
44 | + )); |
|
45 | 45 | |
46 | 46 | $header="Location: index.php?a=99"; |
47 | 47 | header($header); |
@@ -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_web_user')) { |
|
5 | +if (!$modx->hasPermission('delete_web_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
@@ -43,5 +43,5 @@ discard block |
||
43 | 43 | "id" => $id |
44 | 44 | )); |
45 | 45 | |
46 | -$header="Location: index.php?a=99"; |
|
46 | +$header = "Location: index.php?a=99"; |
|
47 | 47 | header($header); |
@@ -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 | 5 | if (!$modx->hasPermission('messages')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
10 | -if ($id==0) { |
|
9 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit("Wrong number of messages returned!"); |
19 | 19 | } |
20 | 20 | |
21 | -if ($message['recipient']!=$modx->getLoginUserID()) { |
|
21 | +if ($message['recipient'] != $modx->getLoginUserID()) { |
|
22 | 22 | $modx->webAlertAndQuit("You are not allowed to delete this message!"); |
23 | 23 | } |
24 | 24 | |
25 | 25 | // delete message |
26 | 26 | $modx->db->delete($modx->getFullTableName('user_messages'), "id='{$id}'"); |
27 | 27 | |
28 | -$header="Location: index.php?a=10"; |
|
28 | +$header = "Location: index.php?a=10"; |
|
29 | 29 | 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'])? intval($_GET['id']) : 0; |
|
10 | -if ($id==0) { |
|
9 | +$id = isset($_GET['id']) ? intval($_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); |
@@ -1,135 +1,135 @@ |
||
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('save_role')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | extract($_POST); |
10 | 10 | |
11 | 11 | if($name == '' || !isset ($name)) { |
12 | - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); |
|
12 | + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | // setup fields |
16 | 16 | $fields = array( |
17 | - 'name' => $name, |
|
18 | - 'description' => $description, |
|
19 | - 'frames' => $frames, |
|
20 | - 'home' => $home, |
|
21 | - 'view_document' => $view_document, |
|
22 | - 'new_document' => $new_document, |
|
23 | - 'save_document' => $save_document, |
|
24 | - 'publish_document' => $publish_document, |
|
25 | - 'delete_document' => $delete_document, |
|
26 | - 'empty_trash' => $empty_trash, |
|
27 | - 'action_ok' => $action_ok, |
|
28 | - 'logout' => $logout, |
|
29 | - 'help' => $help, |
|
30 | - 'messages' => $messages, |
|
31 | - 'new_user' => $new_user, |
|
32 | - 'edit_user' => $edit_user, |
|
33 | - 'logs' => $logs, |
|
34 | - 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', |
|
35 | - 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', |
|
36 | - 'edit_template' => $edit_template, |
|
37 | - 'settings' => $settings, |
|
38 | - 'credits' => $credits, |
|
39 | - 'new_template' => $new_template, |
|
40 | - 'save_template' => $save_template, |
|
41 | - 'delete_template' => $delete_template, |
|
42 | - 'edit_snippet' => $edit_snippet, |
|
43 | - 'new_snippet' => $new_snippet, |
|
44 | - 'save_snippet' => $save_snippet, |
|
45 | - 'delete_snippet' => $delete_snippet, |
|
46 | - 'edit_chunk' => $edit_chunk, |
|
47 | - 'new_chunk' => $new_chunk, |
|
48 | - 'save_chunk' => $save_chunk, |
|
49 | - 'delete_chunk' => $delete_chunk, |
|
50 | - 'empty_cache' => $empty_cache, |
|
51 | - 'edit_document' => $edit_document, |
|
52 | - 'change_password' => $change_password, |
|
53 | - 'error_dialog' => $error_dialog, |
|
54 | - 'about' => $about, |
|
55 | - 'file_manager' => $file_manager, |
|
56 | - 'assets_files' => $assets_files, |
|
57 | - 'assets_images' => $assets_images, |
|
58 | - 'save_user' => $save_user, |
|
59 | - 'delete_user' => $delete_user, |
|
60 | - 'save_password' => $save_password, |
|
61 | - 'edit_role' => $edit_role, |
|
62 | - 'save_role' => $save_role, |
|
63 | - 'delete_role' => $delete_role, |
|
64 | - 'new_role' => $new_role, |
|
65 | - 'access_permissions' => $access_permissions, |
|
66 | - 'bk_manager' => $bk_manager, |
|
67 | - 'new_plugin' => $new_plugin, |
|
68 | - 'edit_plugin' => $edit_plugin, |
|
69 | - 'save_plugin' => $save_plugin, |
|
70 | - 'delete_plugin' => $delete_plugin, |
|
71 | - 'new_module' => $new_module, |
|
72 | - 'edit_module' => $edit_module, |
|
73 | - 'save_module' => $save_module, |
|
74 | - 'delete_module' => $delete_module, |
|
75 | - 'exec_module' => $exec_module, |
|
76 | - 'view_eventlog' => $view_eventlog, |
|
77 | - 'delete_eventlog' => $delete_eventlog, |
|
78 | - 'new_web_user' => $new_web_user, |
|
79 | - 'edit_web_user' => $edit_web_user, |
|
80 | - 'save_web_user' => $save_web_user, |
|
81 | - 'delete_web_user' => $delete_web_user, |
|
82 | - 'web_access_permissions' => $web_access_permissions, |
|
83 | - 'view_unpublished' => $view_unpublished, |
|
84 | - 'import_static' => $import_static, |
|
85 | - 'export_static' => $export_static, |
|
86 | - 'remove_locks' => $remove_locks, |
|
87 | - 'display_locks' => $display_locks, |
|
88 | - 'change_resourcetype' => $change_resourcetype, |
|
89 | - 'category_manager' => $category_manager |
|
17 | + 'name' => $name, |
|
18 | + 'description' => $description, |
|
19 | + 'frames' => $frames, |
|
20 | + 'home' => $home, |
|
21 | + 'view_document' => $view_document, |
|
22 | + 'new_document' => $new_document, |
|
23 | + 'save_document' => $save_document, |
|
24 | + 'publish_document' => $publish_document, |
|
25 | + 'delete_document' => $delete_document, |
|
26 | + 'empty_trash' => $empty_trash, |
|
27 | + 'action_ok' => $action_ok, |
|
28 | + 'logout' => $logout, |
|
29 | + 'help' => $help, |
|
30 | + 'messages' => $messages, |
|
31 | + 'new_user' => $new_user, |
|
32 | + 'edit_user' => $edit_user, |
|
33 | + 'logs' => $logs, |
|
34 | + 'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0', |
|
35 | + 'save_parser' => (isset ($save_parser)) ? $save_parser : '0', |
|
36 | + 'edit_template' => $edit_template, |
|
37 | + 'settings' => $settings, |
|
38 | + 'credits' => $credits, |
|
39 | + 'new_template' => $new_template, |
|
40 | + 'save_template' => $save_template, |
|
41 | + 'delete_template' => $delete_template, |
|
42 | + 'edit_snippet' => $edit_snippet, |
|
43 | + 'new_snippet' => $new_snippet, |
|
44 | + 'save_snippet' => $save_snippet, |
|
45 | + 'delete_snippet' => $delete_snippet, |
|
46 | + 'edit_chunk' => $edit_chunk, |
|
47 | + 'new_chunk' => $new_chunk, |
|
48 | + 'save_chunk' => $save_chunk, |
|
49 | + 'delete_chunk' => $delete_chunk, |
|
50 | + 'empty_cache' => $empty_cache, |
|
51 | + 'edit_document' => $edit_document, |
|
52 | + 'change_password' => $change_password, |
|
53 | + 'error_dialog' => $error_dialog, |
|
54 | + 'about' => $about, |
|
55 | + 'file_manager' => $file_manager, |
|
56 | + 'assets_files' => $assets_files, |
|
57 | + 'assets_images' => $assets_images, |
|
58 | + 'save_user' => $save_user, |
|
59 | + 'delete_user' => $delete_user, |
|
60 | + 'save_password' => $save_password, |
|
61 | + 'edit_role' => $edit_role, |
|
62 | + 'save_role' => $save_role, |
|
63 | + 'delete_role' => $delete_role, |
|
64 | + 'new_role' => $new_role, |
|
65 | + 'access_permissions' => $access_permissions, |
|
66 | + 'bk_manager' => $bk_manager, |
|
67 | + 'new_plugin' => $new_plugin, |
|
68 | + 'edit_plugin' => $edit_plugin, |
|
69 | + 'save_plugin' => $save_plugin, |
|
70 | + 'delete_plugin' => $delete_plugin, |
|
71 | + 'new_module' => $new_module, |
|
72 | + 'edit_module' => $edit_module, |
|
73 | + 'save_module' => $save_module, |
|
74 | + 'delete_module' => $delete_module, |
|
75 | + 'exec_module' => $exec_module, |
|
76 | + 'view_eventlog' => $view_eventlog, |
|
77 | + 'delete_eventlog' => $delete_eventlog, |
|
78 | + 'new_web_user' => $new_web_user, |
|
79 | + 'edit_web_user' => $edit_web_user, |
|
80 | + 'save_web_user' => $save_web_user, |
|
81 | + 'delete_web_user' => $delete_web_user, |
|
82 | + 'web_access_permissions' => $web_access_permissions, |
|
83 | + 'view_unpublished' => $view_unpublished, |
|
84 | + 'import_static' => $import_static, |
|
85 | + 'export_static' => $export_static, |
|
86 | + 'remove_locks' => $remove_locks, |
|
87 | + 'display_locks' => $display_locks, |
|
88 | + 'change_resourcetype' => $change_resourcetype, |
|
89 | + 'category_manager' => $category_manager |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | $fields = $modx->db->escape($fields); |
93 | 93 | |
94 | 94 | switch($_POST['mode']) { |
95 | - case '38' : |
|
96 | - $tbl = $modx->getFullTableName("user_roles"); |
|
95 | + case '38' : |
|
96 | + $tbl = $modx->getFullTableName("user_roles"); |
|
97 | 97 | |
98 | - // disallow duplicate names for role |
|
99 | - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); |
|
100 | - if($modx->db->getValue($rs) > 0) { |
|
101 | - $modx->manager->saveFormValues(38); |
|
102 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); |
|
103 | - } |
|
98 | + // disallow duplicate names for role |
|
99 | + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); |
|
100 | + if($modx->db->getValue($rs) > 0) { |
|
101 | + $modx->manager->saveFormValues(38); |
|
102 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); |
|
103 | + } |
|
104 | 104 | |
105 | - $modx->db->insert($fields, $tbl); |
|
105 | + $modx->db->insert($fields, $tbl); |
|
106 | 106 | |
107 | - // Set the item name for logger |
|
108 | - $_SESSION['itemname'] = $_POST['name']; |
|
107 | + // Set the item name for logger |
|
108 | + $_SESSION['itemname'] = $_POST['name']; |
|
109 | 109 | |
110 | - $header = "Location: index.php?a=86&r=2"; |
|
111 | - header($header); |
|
112 | - break; |
|
113 | - case '35' : |
|
114 | - $tbl = $modx->getFullTableName("user_roles"); |
|
110 | + $header = "Location: index.php?a=86&r=2"; |
|
111 | + header($header); |
|
112 | + break; |
|
113 | + case '35' : |
|
114 | + $tbl = $modx->getFullTableName("user_roles"); |
|
115 | 115 | |
116 | - // disallow duplicate names for role |
|
117 | - $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); |
|
118 | - if($modx->db->getValue($rs) > 0) { |
|
119 | - $modx->manager->saveFormValues(35); |
|
120 | - $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); |
|
121 | - } |
|
116 | + // disallow duplicate names for role |
|
117 | + $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); |
|
118 | + if($modx->db->getValue($rs) > 0) { |
|
119 | + $modx->manager->saveFormValues(35); |
|
120 | + $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); |
|
121 | + } |
|
122 | 122 | |
123 | - $modx->db->update($fields, $tbl, "id='{$id}'"); |
|
123 | + $modx->db->update($fields, $tbl, "id='{$id}'"); |
|
124 | 124 | |
125 | - // Set the item name for logger |
|
126 | - $_SESSION['itemname'] = $_POST['name']; |
|
125 | + // Set the item name for logger |
|
126 | + $_SESSION['itemname'] = $_POST['name']; |
|
127 | 127 | |
128 | - $header = "Location: index.php?a=86&r=2"; |
|
129 | - header($header); |
|
130 | - break; |
|
131 | - default : |
|
132 | - $modx->webAlertAndQuit("No operation set in request."); |
|
128 | + $header = "Location: index.php?a=86&r=2"; |
|
129 | + header($header); |
|
130 | + break; |
|
131 | + default : |
|
132 | + $modx->webAlertAndQuit("No operation set in request."); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $modx->unlockElement(8, $id); |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('save_role')) { |
|
5 | +if (!$modx->hasPermission('save_role')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | extract($_POST); |
10 | 10 | |
11 | -if($name == '' || !isset ($name)) { |
|
12 | - $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : "")); |
|
11 | +if ($name == '' || !isset ($name)) { |
|
12 | + $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}".($mode = 35 ? "&id={$id}" : "")); |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | // setup fields |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | |
92 | 92 | $fields = $modx->db->escape($fields); |
93 | 93 | |
94 | -switch($_POST['mode']) { |
|
94 | +switch ($_POST['mode']) { |
|
95 | 95 | case '38' : |
96 | 96 | $tbl = $modx->getFullTableName("user_roles"); |
97 | 97 | |
98 | 98 | // disallow duplicate names for role |
99 | 99 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}'"); |
100 | - if($modx->db->getValue($rs) > 0) { |
|
100 | + if ($modx->db->getValue($rs) > 0) { |
|
101 | 101 | $modx->manager->saveFormValues(38); |
102 | 102 | $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38"); |
103 | 103 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // disallow duplicate names for role |
117 | 117 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'"); |
118 | - if($modx->db->getValue($rs) > 0) { |
|
118 | + if ($modx->db->getValue($rs) > 0) { |
|
119 | 119 | $modx->manager->saveFormValues(35); |
120 | 120 | $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}"); |
121 | 121 | } |
@@ -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('new_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'])? intval($_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,14 +19,14 @@ discard block |
||
19 | 19 | |
20 | 20 | // duplicate Snippet |
21 | 21 | $newid = $modx->db->insert( |
22 | - array( |
|
23 | - 'name'=>'', |
|
24 | - 'description'=>'', |
|
25 | - 'snippet'=>'', |
|
26 | - 'properties'=>'', |
|
27 | - 'category'=>'', |
|
28 | - ), $modx->getFullTableName('site_snippets'), // Insert into |
|
29 | - "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
22 | + array( |
|
23 | + 'name'=>'', |
|
24 | + 'description'=>'', |
|
25 | + 'snippet'=>'', |
|
26 | + 'properties'=>'', |
|
27 | + 'category'=>'', |
|
28 | + ), $modx->getFullTableName('site_snippets'), // Insert into |
|
29 | + "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, snippet, properties, category", $modx->getFullTableName('site_snippets'), "id='{$id}'"); // Copy from |
|
30 | 30 | |
31 | 31 | // Set the item name for logger |
32 | 32 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "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('new_snippet')) { |
|
5 | +if (!$modx->hasPermission('new_snippet')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_GET['id']) ? intval($_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_snippets'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "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 Snippet |
@@ -33,5 +33,5 @@ discard block |
||
33 | 33 | $_SESSION['itemname'] = $name; |
34 | 34 | |
35 | 35 | // finish duplicating - redirect to new snippet |
36 | -$header="Location: index.php?r=2&a=22&id=$newid"; |
|
36 | +$header = "Location: index.php?r=2&a=22&id=$newid"; |
|
37 | 37 | header($header); |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate Snippet |
21 | 24 | $newid = $modx->db->insert( |
@@ -4,8 +4,8 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | if(!$modx->hasPermission('delete_plugin')) { |
7 | - $e->setError(3); |
|
8 | - $e->dumpError(); |
|
7 | + $e->setError(3); |
|
8 | + $e->dumpError(); |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | $tbl_site_plugins = $modx->getFullTablename('site_plugins'); |
@@ -1,9 +1,9 @@ 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 | exit(); |
4 | 4 | } |
5 | 5 | |
6 | -if(!$modx->hasPermission('delete_plugin')) { |
|
6 | +if (!$modx->hasPermission('delete_plugin')) { |
|
7 | 7 | $e->setError(3); |
8 | 8 | $e->dumpError(); |
9 | 9 | } |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | // Get unique list of latest added plugins by highest sql-id |
15 | 15 | $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); |
16 | 16 | $latestIds = array(); |
17 | -while($row = $modx->db->getRow($rs)) { |
|
17 | +while ($row = $modx->db->getRow($rs)) { |
|
18 | 18 | $latestIds[] = $row['id']; |
19 | 19 | } |
20 | 20 | |
21 | 21 | // Get list of plugins with disabled and enabled versions |
22 | 22 | $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); |
23 | 23 | |
24 | -while($row = $modx->db->getRow($rs)) { |
|
24 | +while ($row = $modx->db->getRow($rs)) { |
|
25 | 25 | |
26 | 26 | $id = $row['id']; |
27 | 27 | |
28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
28 | + if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins |
|
29 | 29 | |
30 | 30 | // invoke OnBeforePluginFormDelete event |
31 | 31 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -25,7 +25,10 @@ |
||
25 | 25 | |
26 | 26 | $id = $row['id']; |
27 | 27 | |
28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
28 | + if(in_array($id,$latestIds)) { |
|
29 | + continue; |
|
30 | + } |
|
31 | + // Keep latest version of disabled plugins |
|
29 | 32 | |
30 | 33 | // invoke OnBeforePluginFormDelete event |
31 | 34 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -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('save_document')||!$modx->hasPermission('publish_document')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_REQUEST['id'])? intval($_REQUEST['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 | /************webber ********/ |
@@ -33,20 +33,20 @@ discard block |
||
33 | 33 | $udperms->role = $_SESSION['mgrRole']; |
34 | 34 | |
35 | 35 | if(!$udperms->checkPermissions()) { |
36 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
36 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // update the document |
40 | 40 | $modx->db->update( |
41 | - array( |
|
42 | - 'published' => 0, |
|
43 | - 'pub_date' => 0, |
|
44 | - 'unpub_date' => 0, |
|
45 | - 'editedby' => $modx->getLoginUserID(), |
|
46 | - 'editedon' => time(), |
|
47 | - 'publishedby' => 0, |
|
48 | - 'publishedon' => 0, |
|
49 | - ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
41 | + array( |
|
42 | + 'published' => 0, |
|
43 | + 'pub_date' => 0, |
|
44 | + 'unpub_date' => 0, |
|
45 | + 'editedby' => $modx->getLoginUserID(), |
|
46 | + 'editedon' => time(), |
|
47 | + 'publishedby' => 0, |
|
48 | + 'publishedon' => 0, |
|
49 | + ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
|
50 | 50 | |
51 | 51 | // invoke OnDocUnPublished event |
52 | 52 | $modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
@@ -1,38 +1,38 @@ 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_document')||!$modx->hasPermission('publish_document')) { |
|
5 | +if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_document')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id'])? intval($_REQUEST['id']) : 0; |
|
10 | -if($id==0) { |
|
9 | +$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
|
10 | +if ($id == 0) { |
|
11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
12 | 12 | } |
13 | 13 | |
14 | 14 | /************webber ********/ |
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 | /************** webber *************/ |
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 | |
26 | 26 | |
27 | 27 | |
28 | 28 | // check permissions on the document |
29 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
29 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
30 | 30 | $udperms = new udperms(); |
31 | 31 | $udperms->user = $modx->getLoginUserID(); |
32 | 32 | $udperms->document = $id; |
33 | 33 | $udperms->role = $_SESSION['mgrRole']; |
34 | 34 | |
35 | -if(!$udperms->checkPermissions()) { |
|
35 | +if (!$udperms->checkPermissions()) { |
|
36 | 36 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
37 | 37 | } |
38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ), $modx->getFullTableName('site_content'), "id='{$id}'"); |
50 | 50 | |
51 | 51 | // invoke OnDocUnPublished event |
52 | -$modx->invokeEvent("OnDocUnPublished",array("docid"=>$id)); |
|
52 | +$modx->invokeEvent("OnDocUnPublished", array("docid"=>$id)); |
|
53 | 53 | |
54 | 54 | // Set the item name for logger |
55 | 55 | $_SESSION['itemname'] = $content['pagetitle']; |
@@ -57,6 +57,6 @@ discard block |
||
57 | 57 | // empty cache |
58 | 58 | $modx->clearCache('full'); |
59 | 59 | |
60 | -$header="Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
60 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
61 | 61 | |
62 | 62 | header($header); |
@@ -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']) ? intval($_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 | 9 | $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
10 | -if($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 |
@@ -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 | if (!$modx->hasPermission('save_template')) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
28 | 28 | $categoryid = 0; |
29 | 29 | } else { |
30 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
30 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
31 | 31 | $categoryid = checkCategory($_POST['newcategory']); |
32 | 32 | if (!$categoryid) { |
33 | 33 | $categoryid = newCategory($_POST['newcategory']); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // finished emptying cache - redirect |
100 | 100 | if ($_POST['stay'] != '') { |
101 | 101 | $a = ($_POST['stay'] == '2') ? "301&id=$newid" : "300"; |
102 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
102 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
103 | 103 | header($header); |
104 | 104 | } else { |
105 | 105 | $header = "Location: index.php?a=76&r=2"; |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | // finished emptying cache - redirect |
161 | 161 | if ($_POST['stay'] != '') { |
162 | 162 | $a = ($_POST['stay'] == '2') ? "301&id=$id" : "300"; |
163 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'] . "&or=" . $origin . "&oid=" . $originId; |
|
163 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']."&or=".$origin."&oid=".$originId; |
|
164 | 164 | header($header); |
165 | 165 | } else { |
166 | 166 | $modx->unlockElement(2, $id); |
167 | - $header = "Location: index.php?a=" . $origin . "&r=2" . ($originId != null ? '&id=' . $originId : ''); |
|
167 | + $header = "Location: index.php?a=".$origin."&r=2".($originId != null ? '&id='.$originId : ''); |
|
168 | 168 | header($header); |
169 | 169 | } |
170 | 170 |