Completed
Push — develop ( d0bb9b...5613ed )
by Maxim
05:28
created
manager/processors/delete_message.processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
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'])? (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
 
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
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);
Please login to merge, or discard this patch.
manager/processors/delete_web_user.processor.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
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'])? (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,9 +17,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
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'])? (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
 
@@ -43,5 +43,5 @@  discard block
 block discarded – undo
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);
Please login to merge, or discard this patch.
manager/processors/save_tmplvars.processor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
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')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $name = $modx->db->escape(trim($_POST['name']));
11 11
 $description = $modx->db->escape($_POST['description']);
12 12
 $caption = $modx->db->escape($_POST['caption']);
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
 $display = $modx->db->escape($_POST['display']);
18 18
 $params = $modx->db->escape($_POST['params']);
19 19
 $locked = $_POST['locked'] == 'on' ? 1 : 0;
20
-$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76;
21
-$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null;
20
+$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76;
21
+$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : null;
22 22
 $currentdate = time() + $modx->config['server_offset_time'];
23 23
 
24 24
 //Kyle Jaebker - added category support
25 25
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
26
-    $categoryid = (int)$_POST['categoryid'];
26
+    $categoryid = (int) $_POST['categoryid'];
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
 block discarded – undo
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
 block discarded – undo
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" . (empty($originId) ? '' : '&id=' . $originId);
167
+            $header = "Location: index.php?a=".$origin."&r=2".(empty($originId) ? '' : '&id='.$originId);
168 168
             header($header);
169 169
         }
170 170
 
Please login to merge, or discard this patch.
manager/processors/delete_eventlog.processor.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 block discarded – undo
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_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 if (isset($_GET['cls']) && $_GET['cls']==1) {
10
-	$where = '';
10
+    $where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-	if($id==0) {
14
-		$modx->webAlertAndQuit($_lang["error_no_id"]);
15
-	}
16
-	$where = "id='{$id}'";
12
+    $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
+    if($id==0) {
14
+        $modx->webAlertAndQuit($_lang["error_no_id"]);
15
+    }
16
+    $where = "id='{$id}'";
17 17
 }
18 18
 
19 19
 // delete event log
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
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_eventlog')) {
5
+if (!$modx->hasPermission('delete_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-if (isset($_GET['cls']) && $_GET['cls']==1) {
9
+if (isset($_GET['cls']) && $_GET['cls'] == 1) {
10 10
 	$where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-	if($id==0) {
12
+	$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
13
+	if ($id == 0) {
14 14
 		$modx->webAlertAndQuit($_lang["error_no_id"]);
15 15
 	}
16 16
 	$where = "id='{$id}'";
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 // delete event log
20 20
 $modx->db->delete($modx->getFullTableName('event_log'), $where);
21 21
 
22
-$header="Location: index.php?a=114";
22
+$header = "Location: index.php?a=114";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_category.processor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
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_plugin') && !$modx->hasPermission('save_snippet') && !$modx->hasPermission('save_template') && !$modx->hasPermission('save_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['catId'])? (int)$_GET['catId'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['catId']) ? (int) $_GET['catId'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 deleteCategory($id);
20 20
 
21 21
 // finished emptying cache - redirect
22
-$header="Location: index.php?a=76";
22
+$header = "Location: index.php?a=76";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_template.processor.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@  discard block
 block discarded – undo
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')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $template = $modx->db->escape($_POST['post']);
11 11
 $templatename = $modx->db->escape(trim($_POST['templatename']));
12 12
 $description = $modx->db->escape($_POST['description']);
13 13
 $locked = $_POST['locked'] == 'on' ? 1 : 0;
14
-$selectable = $id == $modx->config['default_template'] ? 1 :    // Force selectable
14
+$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable
15 15
     $_POST['selectable'] == 'on' ? 1 : 0;
16 16
 $currentdate = time() + $modx->config['server_offset_time'];
17 17
 
18 18
 //Kyle Jaebker - added category support
19 19
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
20
-    $categoryid = (int)$_POST['categoryid'];
20
+    $categoryid = (int) $_POST['categoryid'];
21 21
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
22 22
     $categoryid = 0;
23 23
 } else {
24
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
24
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
25 25
     $categoryid = checkCategory($_POST['newcategory']);
26 26
     if (!$categoryid) {
27 27
         $categoryid = newCategory($_POST['newcategory']);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // finished emptying cache - redirect
79 79
         if ($_POST['stay'] != '') {
80 80
             $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
81
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
82 82
             header($header);
83 83
         } else {
84 84
             $header = "Location: index.php?a=76&r=2";
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         // finished emptying cache - redirect
131 131
         if ($_POST['stay'] != '') {
132 132
             $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
133
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
134 134
             header($header);
135 135
         } else {
136 136
             $modx->unlockElement(1, $id);
Please login to merge, or discard this patch.
Switch Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -33,115 +33,115 @@
 block discarded – undo
33 33
 }
34 34
 
35 35
 switch ($_POST['mode']) {
36
-    case '19':
37
-
38
-        // invoke OnBeforeTempFormSave event
39
-        $modx->invokeEvent("OnBeforeTempFormSave", array(
40
-            "mode" => "new",
41
-            "id" => $id
42
-        ));
43
-
44
-        // disallow duplicate names for new templates
45
-        $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}'");
46
-        $count = $modx->db->getValue($rs);
47
-        if ($count > 0) {
48
-            $modx->manager->saveFormValues(19);
49
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=19");
50
-        }
51
-
52
-        //do stuff to save the new doc
53
-        $newid = $modx->db->insert(array(
54
-            'templatename' => $templatename,
55
-            'description' => $description,
56
-            'content' => $template,
57
-            'locked' => $locked,
58
-            'selectable' => $selectable,
59
-            'category' => $categoryid,
60
-            'createdon' => $currentdate,
61
-            'editedon' => $currentdate
62
-        ), $modx->getFullTableName('site_templates'));
63
-
64
-        // invoke OnTempFormSave event
65
-        $modx->invokeEvent("OnTempFormSave", array(
66
-            "mode" => "new",
67
-            "id" => $newid
68
-        ));
69
-        // Set new assigned Tvs
70
-        saveTemplateAccess($newid);
71
-
72
-        // Set the item name for logger
73
-        $_SESSION['itemname'] = $templatename;
74
-
75
-        // empty cache
76
-        $modx->clearCache('full');
77
-
78
-        // finished emptying cache - redirect
79
-        if ($_POST['stay'] != '') {
80
-            $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
82
-            header($header);
83
-        } else {
84
-            $header = "Location: index.php?a=76&r=2";
85
-            header($header);
86
-        }
87
-
88
-        break;
89
-    case '16':
90
-
91
-        // invoke OnBeforeTempFormSave event
92
-        $modx->invokeEvent("OnBeforeTempFormSave", array(
93
-            "mode" => "upd",
94
-            "id" => $id
95
-        ));
96
-
97
-        // disallow duplicate names for templates
98
-        $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}' AND id!='{$id}'");
99
-        $count = $modx->db->getValue($rs);
100
-        if ($count > 0) {
101
-            $modx->manager->saveFormValues(16);
102
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=16&id={$id}");
103
-        }
104
-
105
-        //do stuff to save the edited doc
106
-        $modx->db->update(array(
107
-            'templatename' => $templatename,
108
-            'description' => $description,
109
-            'content' => $template,
110
-            'locked' => $locked,
111
-            'selectable' => $selectable,
112
-            'category' => $categoryid,
113
-            'editedon' => $currentdate
114
-        ), $modx->getFullTableName('site_templates'), "id='{$id}'");
115
-        // Set new assigned Tvs
116
-        saveTemplateAccess($id);
117
-
118
-        // invoke OnTempFormSave event
119
-        $modx->invokeEvent("OnTempFormSave", array(
120
-            "mode" => "upd",
121
-            "id" => $id
122
-        ));
123
-
124
-        // Set the item name for logger
125
-        $_SESSION['itemname'] = $templatename;
126
-
127
-        // first empty the cache
128
-        $modx->clearCache('full');
129
-
130
-        // finished emptying cache - redirect
131
-        if ($_POST['stay'] != '') {
132
-            $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
134
-            header($header);
135
-        } else {
136
-            $modx->unlockElement(1, $id);
137
-            $header = "Location: index.php?a=76&r=2";
138
-            header($header);
139
-        }
140
-
141
-
142
-        break;
143
-    default:
144
-        $modx->webAlertAndQuit("No operation set in request.");
36
+        case '19':
37
+
38
+            // invoke OnBeforeTempFormSave event
39
+            $modx->invokeEvent("OnBeforeTempFormSave", array(
40
+                "mode" => "new",
41
+                "id" => $id
42
+            ));
43
+
44
+            // disallow duplicate names for new templates
45
+            $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}'");
46
+            $count = $modx->db->getValue($rs);
47
+            if ($count > 0) {
48
+                $modx->manager->saveFormValues(19);
49
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=19");
50
+            }
51
+
52
+            //do stuff to save the new doc
53
+            $newid = $modx->db->insert(array(
54
+                'templatename' => $templatename,
55
+                'description' => $description,
56
+                'content' => $template,
57
+                'locked' => $locked,
58
+                'selectable' => $selectable,
59
+                'category' => $categoryid,
60
+                'createdon' => $currentdate,
61
+                'editedon' => $currentdate
62
+            ), $modx->getFullTableName('site_templates'));
63
+
64
+            // invoke OnTempFormSave event
65
+            $modx->invokeEvent("OnTempFormSave", array(
66
+                "mode" => "new",
67
+                "id" => $newid
68
+            ));
69
+            // Set new assigned Tvs
70
+            saveTemplateAccess($newid);
71
+
72
+            // Set the item name for logger
73
+            $_SESSION['itemname'] = $templatename;
74
+
75
+            // empty cache
76
+            $modx->clearCache('full');
77
+
78
+            // finished emptying cache - redirect
79
+            if ($_POST['stay'] != '') {
80
+                $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
82
+                header($header);
83
+            } else {
84
+                $header = "Location: index.php?a=76&r=2";
85
+                header($header);
86
+            }
87
+
88
+            break;
89
+        case '16':
90
+
91
+            // invoke OnBeforeTempFormSave event
92
+            $modx->invokeEvent("OnBeforeTempFormSave", array(
93
+                "mode" => "upd",
94
+                "id" => $id
95
+            ));
96
+
97
+            // disallow duplicate names for templates
98
+            $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}' AND id!='{$id}'");
99
+            $count = $modx->db->getValue($rs);
100
+            if ($count > 0) {
101
+                $modx->manager->saveFormValues(16);
102
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=16&id={$id}");
103
+            }
104
+
105
+            //do stuff to save the edited doc
106
+            $modx->db->update(array(
107
+                'templatename' => $templatename,
108
+                'description' => $description,
109
+                'content' => $template,
110
+                'locked' => $locked,
111
+                'selectable' => $selectable,
112
+                'category' => $categoryid,
113
+                'editedon' => $currentdate
114
+            ), $modx->getFullTableName('site_templates'), "id='{$id}'");
115
+            // Set new assigned Tvs
116
+            saveTemplateAccess($id);
117
+
118
+            // invoke OnTempFormSave event
119
+            $modx->invokeEvent("OnTempFormSave", array(
120
+                "mode" => "upd",
121
+                "id" => $id
122
+            ));
123
+
124
+            // Set the item name for logger
125
+            $_SESSION['itemname'] = $templatename;
126
+
127
+            // first empty the cache
128
+            $modx->clearCache('full');
129
+
130
+            // finished emptying cache - redirect
131
+            if ($_POST['stay'] != '') {
132
+                $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
134
+                header($header);
135
+            } else {
136
+                $modx->unlockElement(1, $id);
137
+                $header = "Location: index.php?a=76&r=2";
138
+                header($header);
139
+            }
140
+
141
+
142
+            break;
143
+        default:
144
+            $modx->webAlertAndQuit("No operation set in request.");
145 145
 }
146 146
 
147 147
 /**
Please login to merge, or discard this patch.
manager/processors/delete_user.processor.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@  discard block
 block discarded – undo
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_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'])? (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 user, but first check if we are deleting our own record
15 15
 if($id==$modx->getLoginUserID()) {
16
-	$modx->webAlertAndQuit("You can't delete yourself!");
16
+    $modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
19 19
 // Set the item name for logger
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 // invoke OnBeforeUserFormDelete event
24 24
 $modx->invokeEvent("OnBeforeUserFormDelete",
25
-	array(
26
-		"id"	=> $id
27
-	));
25
+    array(
26
+        "id"	=> $id
27
+    ));
28 28
 
29 29
 // delete the user.
30 30
 $modx->db->delete($modx->getFullTableName('manager_users'), "id='{$id}'");
@@ -39,16 +39,16 @@  discard block
 block discarded – undo
39 39
 
40 40
 // invoke OnManagerDeleteUser event
41 41
 $modx->invokeEvent("OnManagerDeleteUser",
42
-	array(
43
-		"userid"		=> $id,
44
-		"username"		=> $username
45
-	));
42
+    array(
43
+        "userid"		=> $id,
44
+        "username"		=> $username
45
+    ));
46 46
 
47 47
 // invoke OnUserFormDelete event
48 48
 $modx->invokeEvent("OnUserFormDelete",
49
-	array(
50
-		"id"	=> $id
51
-	));
49
+    array(
50
+        "id"	=> $id
51
+    ));
52 52
 
53 53
 $header="Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@  discard block
 block discarded – undo
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_user')) {
5
+if (!$modx->hasPermission('delete_user')) {
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 user, but first check if we are deleting our own record
15
-if($id==$modx->getLoginUserID()) {
15
+if ($id == $modx->getLoginUserID()) {
16 16
 	$modx->webAlertAndQuit("You can't delete yourself!");
17 17
 }
18 18
 
@@ -50,5 +50,5 @@  discard block
 block discarded – undo
50 50
 		"id"	=> $id
51 51
 	));
52 52
 
53
-$header="Location: index.php?a=75";
53
+$header = "Location: index.php?a=75";
54 54
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_module.processor.php 2 patches
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
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_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $name = $modx->db->escape(trim($_POST['name']));
11 11
 $description = $modx->db->escape($_POST['description']);
12 12
 $resourcefile = $modx->db->escape($_POST['resourcefile']);
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
 
26 26
 //Kyle Jaebker - added category support
27 27
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
28
-    $categoryid = (int)$_POST['categoryid'];
28
+    $categoryid = (int) $_POST['categoryid'];
29 29
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
30 30
     $categoryid = 0;
31 31
 } else {
32
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
32
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
33 33
     $categoryid = checkCategory($_POST['newcategory']);
34 34
     if (!$categoryid) {
35 35
         $categoryid = newCategory($_POST['newcategory']);
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
     $name = isset($parsed['name']) ? $parsed['name'] : $name;
46 46
     $properties = isset($parsed['properties']) ? $parsed['properties'] : $properties;
47 47
     $guid = isset($parsed['guid']) ? $parsed['guid'] : $guid;
48
-    $enable_sharedparams = isset($parsed['shareparams']) ? (int)$parsed['shareparams'] : $enable_sharedparams;
48
+    $enable_sharedparams = isset($parsed['shareparams']) ? (int) $parsed['shareparams'] : $enable_sharedparams;
49 49
 
50 50
     $description = isset($parsed['description']) ? $parsed['description'] : $description;
51
-    $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : '';
51
+    $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : '';
52 52
     if ($version) {
53
-        $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
53
+        $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
54 54
     }
55 55
     if (isset($parsed['modx_category'])) {
56
-        include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
56
+        include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
57 57
         $categoryid = getCategory($parsed['modx_category']);
58 58
     }
59 59
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         // finished emptying cache - redirect
112 112
         if ($_POST['stay'] != '') {
113 113
             $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107";
114
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
114
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
115 115
             header($header);
116 116
         } else {
117 117
             $header = "Location: index.php?a=106&r=2";
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         // finished emptying cache - redirect
169 169
         if ($_POST['stay'] != '') {
170 170
             $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107";
171
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
171
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
172 172
             header($header);
173 173
         } else {
174 174
             $modx->unlockElement(6, $id);
Please login to merge, or discard this patch.
Switch Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -59,125 +59,125 @@
 block discarded – undo
59 59
 }
60 60
 
61 61
 switch ($_POST['mode']) {
62
-    case '107':
63
-        // invoke OnBeforeModFormSave event
64
-        $modx->invokeEvent("OnBeforeModFormSave", array(
65
-                "mode" => "new",
66
-                "id" => $id
67
-            ));
68
-
69
-        // disallow duplicate names for new modules
70
-        $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}'");
71
-        $count = $modx->db->getValue($rs);
72
-        if ($count > 0) {
73
-            $modx->manager->saveFormValues(107);
74
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=107");
75
-        }
62
+        case '107':
63
+            // invoke OnBeforeModFormSave event
64
+            $modx->invokeEvent("OnBeforeModFormSave", array(
65
+                    "mode" => "new",
66
+                    "id" => $id
67
+                ));
68
+
69
+            // disallow duplicate names for new modules
70
+            $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}'");
71
+            $count = $modx->db->getValue($rs);
72
+            if ($count > 0) {
73
+                $modx->manager->saveFormValues(107);
74
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=107");
75
+            }
76 76
 
77
-        // save the new module
78
-        $newid = $modx->db->insert(array(
79
-            'name' => $name,
80
-            'description' => $description,
81
-            'disabled' => $disabled,
82
-            'wrap' => $wrap,
83
-            'locked' => $locked,
84
-            'icon' => $icon,
85
-            'resourcefile' => $resourcefile,
86
-            'enable_resource' => $enable_resource,
87
-            'category' => $categoryid,
88
-            'enable_sharedparams' => $enable_sharedparams,
89
-            'guid' => $guid,
90
-            'modulecode' => $modulecode,
91
-            'properties' => $properties,
92
-            'createdon' => $currentdate,
93
-            'editedon' => $currentdate
94
-        ), $modx->getFullTableName('site_modules'));
95
-
96
-        // save user group access permissions
97
-        saveUserGroupAccessPermissons();
98
-
99
-        // invoke OnModFormSave event
100
-        $modx->invokeEvent("OnModFormSave", array(
101
-                "mode" => "new",
102
-                "id" => $newid
103
-            ));
104
-
105
-        // Set the item name for logger
106
-        $_SESSION['itemname'] = $name;
107
-
108
-        // empty cache
109
-        $modx->clearCache('full');
110
-
111
-        // finished emptying cache - redirect
112
-        if ($_POST['stay'] != '') {
113
-            $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107";
114
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
115
-            header($header);
116
-        } else {
117
-            $header = "Location: index.php?a=106&r=2";
118
-            header($header);
119
-        }
120
-        break;
121
-    case '108':
122
-        // invoke OnBeforeModFormSave event
123
-        $modx->invokeEvent("OnBeforeModFormSave", array(
124
-                "mode" => "upd",
125
-                "id" => $id
126
-            ));
127
-
128
-        // disallow duplicate names for new modules
129
-        $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}' AND id!='{$id}'");
130
-        if ($modx->db->getValue($rs) > 0) {
131
-            $modx->manager->saveFormValues(108);
132
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=108&id={$id}");
133
-        }
77
+            // save the new module
78
+            $newid = $modx->db->insert(array(
79
+                'name' => $name,
80
+                'description' => $description,
81
+                'disabled' => $disabled,
82
+                'wrap' => $wrap,
83
+                'locked' => $locked,
84
+                'icon' => $icon,
85
+                'resourcefile' => $resourcefile,
86
+                'enable_resource' => $enable_resource,
87
+                'category' => $categoryid,
88
+                'enable_sharedparams' => $enable_sharedparams,
89
+                'guid' => $guid,
90
+                'modulecode' => $modulecode,
91
+                'properties' => $properties,
92
+                'createdon' => $currentdate,
93
+                'editedon' => $currentdate
94
+            ), $modx->getFullTableName('site_modules'));
95
+
96
+            // save user group access permissions
97
+            saveUserGroupAccessPermissons();
98
+
99
+            // invoke OnModFormSave event
100
+            $modx->invokeEvent("OnModFormSave", array(
101
+                    "mode" => "new",
102
+                    "id" => $newid
103
+                ));
104
+
105
+            // Set the item name for logger
106
+            $_SESSION['itemname'] = $name;
107
+
108
+            // empty cache
109
+            $modx->clearCache('full');
110
+
111
+            // finished emptying cache - redirect
112
+            if ($_POST['stay'] != '') {
113
+                $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107";
114
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
115
+                header($header);
116
+            } else {
117
+                $header = "Location: index.php?a=106&r=2";
118
+                header($header);
119
+            }
120
+            break;
121
+        case '108':
122
+            // invoke OnBeforeModFormSave event
123
+            $modx->invokeEvent("OnBeforeModFormSave", array(
124
+                    "mode" => "upd",
125
+                    "id" => $id
126
+                ));
127
+
128
+            // disallow duplicate names for new modules
129
+            $rs = $modx->db->select('count(id)', $modx->getFullTableName('site_modules'), "name='{$name}' AND id!='{$id}'");
130
+            if ($modx->db->getValue($rs) > 0) {
131
+                $modx->manager->saveFormValues(108);
132
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_module'], $name), "index.php?a=108&id={$id}");
133
+            }
134 134
 
135
-        // save the edited module
136
-        $modx->db->update(array(
137
-            'name' => $name,
138
-            'description' => $description,
139
-            'icon' => $icon,
140
-            'enable_resource' => $enable_resource,
141
-            'resourcefile' => $resourcefile,
142
-            'disabled' => $disabled,
143
-            'wrap' => $wrap,
144
-            'locked' => $locked,
145
-            'category' => $categoryid,
146
-            'enable_sharedparams' => $enable_sharedparams,
147
-            'guid' => $guid,
148
-            'modulecode' => $modulecode,
149
-            'properties' => $properties,
150
-            'editedon' => $currentdate
151
-        ), $modx->getFullTableName('site_modules'), "id='{$id}'");
152
-
153
-        // save user group access permissions
154
-        saveUserGroupAccessPermissons();
155
-
156
-        // invoke OnModFormSave event
157
-        $modx->invokeEvent("OnModFormSave", array(
158
-                "mode" => "upd",
159
-                "id" => $id
160
-            ));
161
-
162
-        // Set the item name for logger
163
-        $_SESSION['itemname'] = $name;
164
-
165
-        // empty cache
166
-        $modx->clearCache('full');
167
-
168
-        // finished emptying cache - redirect
169
-        if ($_POST['stay'] != '') {
170
-            $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107";
171
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
172
-            header($header);
173
-        } else {
174
-            $modx->unlockElement(6, $id);
175
-            $header = "Location: index.php?a=106&r=2";
176
-            header($header);
177
-        }
178
-        break;
179
-    default:
180
-        $modx->webAlertAndQuit("No operation set in request.");
135
+            // save the edited module
136
+            $modx->db->update(array(
137
+                'name' => $name,
138
+                'description' => $description,
139
+                'icon' => $icon,
140
+                'enable_resource' => $enable_resource,
141
+                'resourcefile' => $resourcefile,
142
+                'disabled' => $disabled,
143
+                'wrap' => $wrap,
144
+                'locked' => $locked,
145
+                'category' => $categoryid,
146
+                'enable_sharedparams' => $enable_sharedparams,
147
+                'guid' => $guid,
148
+                'modulecode' => $modulecode,
149
+                'properties' => $properties,
150
+                'editedon' => $currentdate
151
+            ), $modx->getFullTableName('site_modules'), "id='{$id}'");
152
+
153
+            // save user group access permissions
154
+            saveUserGroupAccessPermissons();
155
+
156
+            // invoke OnModFormSave event
157
+            $modx->invokeEvent("OnModFormSave", array(
158
+                    "mode" => "upd",
159
+                    "id" => $id
160
+                ));
161
+
162
+            // Set the item name for logger
163
+            $_SESSION['itemname'] = $name;
164
+
165
+            // empty cache
166
+            $modx->clearCache('full');
167
+
168
+            // finished emptying cache - redirect
169
+            if ($_POST['stay'] != '') {
170
+                $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107";
171
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
172
+                header($header);
173
+            } else {
174
+                $modx->unlockElement(6, $id);
175
+                $header = "Location: index.php?a=106&r=2";
176
+                header($header);
177
+            }
178
+            break;
179
+        default:
180
+            $modx->webAlertAndQuit("No operation set in request.");
181 181
 }
182 182
 
183 183
 /**
Please login to merge, or discard this patch.
manager/processors/unpublish_content.processor.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -3,12 +3,12 @@  discard block
 block discarded – undo
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'])? (int)$_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
 block discarded – undo
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));
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,38 +1,38 @@  discard block
 block discarded – undo
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'])? (int)$_REQUEST['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.