Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/actions/resources/tab6_categoryview.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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
 
Please login to merge, or discard this patch.
manager/actions/resources/tab4_snippets.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- snippets -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab1_templates.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- Templates -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/resources/tab5_plugins.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <!-- plugins -->
2 2
 <?php
3
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
4 4
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
5 5
 }
6 6
 
Please login to merge, or discard this patch.
manager/actions/mutate_password.dynamic.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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('change_password')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
9 9
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 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('change_password')) {
5
+if (!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 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('change_password')) {
5
+if(!$modx->hasPermission('change_password')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 ?>
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/request_trigger.inc.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
             if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23 23
             {
24
-               $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
24
+                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
 
27 27
             foreach( $cm->getCategories() as $category )
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
 
107 107
     if( empty( $category ) )
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
-       return;
109
+        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110
+        return;
111 111
     }
112 112
 
113 113
     if( $cm->isCategoryExists( $category ) )
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116
-       return;
115
+        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116
+        return;
117 117
     }
118 118
 
119 119
     if( $cm->addCategory( $category, $rank ) !== 0 )
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -2,16 +2,16 @@  discard block
 block discarded – undo
2 2
 /**
3 3
  * Ajax Requests
4 4
  */
5
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
5
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
9
+if (isset($_REQUEST[$cm->get('request_key')]['ajax']))
10 10
 {
11 11
     $_data  = $_REQUEST[$cm->get('request_key')];
12 12
     $output = '';
13 13
     $task   = $_data['task'];
14
-    switch( $task )
14
+    switch ($task)
15 15
     {
16 16
         /**
17 17
          * get categories
@@ -19,19 +19,19 @@  discard block
 block discarded – undo
19 19
         case 'categorize_load_elements':
20 20
             $elements = $_data['elements'];
21 21
 
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
22
+            if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements']))
23 23
             {
24 24
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 25
             }
26 26
 
27
-            foreach( $cm->getCategories() as $category )
27
+            foreach ($cm->getCategories() as $category)
28 28
             {
29
-                $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
29
+                $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']);
30 30
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 31
             }
32 32
             break;
33 33
     }
34
-    exit( $output );
34
+    exit($output);
35 35
 }
36 36
 /**
37 37
  * Categorize elements
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476
42 42
  *
43 43
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
44
+if (isset($_POST[$cm->get('request_key')]['categorize']['submit']))
45 45
 {
46 46
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 47
     $_changes = 0;
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         'categorize'
55 55
     );
56 56
 
57
-    if( !isset( $_data['elements'] ) )
57
+    if (!isset($_data['elements']))
58 58
     {
59
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
59
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize');
60 60
         return;
61 61
     }
62 62
 
63
-    foreach( $_data['elements'] as $element_id => $data )
63
+    foreach ($_data['elements'] as $element_id => $data)
64 64
     {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
65
+        if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id']))
66 66
         {
67 67
             $cm->addMessage(
68 68
                 sprintf(
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         }
79 79
     }
80 80
 
81
-    if( $_changes === 0 )
81
+    if ($_changes === 0)
82 82
     {
83
-        $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
83
+        $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize');
84 84
         return;
85 85
     }
86 86
     else
@@ -98,29 +98,29 @@  discard block
 block discarded – undo
98 98
 /**
99 99
  * Add a new category
100 100
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
101
+if (isset($_POST[$cm->get('request_key')]['add']['submit']))
102 102
 {
103 103
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104
-    $category = trim( html_entity_decode($_data['name']) );
104
+    $category = trim(html_entity_decode($_data['name']));
105 105
     $rank     = (int) $_data['rank'];
106 106
 
107
-    if( empty( $category ) )
107
+    if (empty($category))
108 108
     {
109
-       $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
109
+       $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add');
110 110
        return;
111 111
     }
112 112
 
113
-    if( $cm->isCategoryExists( $category ) )
113
+    if ($cm->isCategoryExists($category))
114 114
     {
115
-       $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
115
+       $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add');
116 116
        return;
117 117
     }
118 118
 
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
119
+    if ($cm->addCategory($category, $rank) !== 0)
120 120
     {
121 121
         $cm->addMessage(
122 122
             sprintf(
123
-                $cm->txt( 'cm_category_x_saved_at_position_y' ),
123
+                $cm->txt('cm_category_x_saved_at_position_y'),
124 124
                 $category,
125 125
                 $rank
126 126
             ),
@@ -129,26 +129,26 @@  discard block
 block discarded – undo
129 129
     }
130 130
     else
131 131
     {
132
-        $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
132
+        $cm->addMessage($cm->txt('cm_unknown_error'), 'add');
133 133
     }
134 134
 }
135 135
 
136 136
 /**
137 137
  * Sort categories
138 138
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
139
+if (isset($_POST[$cm->get('request_key')]['sort']['submit']))
140 140
 {
141 141
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 142
     $_changes   = 0;
143 143
 
144
-    foreach( $categories as $category_id => $_data  )
144
+    foreach ($categories as $category_id => $_data)
145 145
     {
146 146
         $data = array(
147
-            'category' => urldecode( $_data['category'] ),
147
+            'category' => urldecode($_data['category']),
148 148
             'rank'     => $_data['rank']
149 149
         );
150 150
 
151
-        if( $cm->updateCategory( $category_id, $data ) )
151
+        if ($cm->updateCategory($category_id, $data))
152 152
         {
153 153
             $cm->addMessage(
154 154
                 sprintf(
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         }
163 163
     }
164 164
 
165
-    if( $_changes === 0 )
165
+    if ($_changes === 0)
166 166
     {
167
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
167
+        $cm->addMessage($cm->txt('cm_no_changes'), 'sort');
168 168
     }
169 169
     else
170 170
     {
@@ -181,21 +181,21 @@  discard block
 block discarded – undo
181 181
 /**
182 182
  * Edit categories
183 183
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
184
+if (isset($_POST[$cm->get('request_key')]['edit']['submit']))
185 185
 {
186 186
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 187
     $_changes   = 0;
188 188
 
189
-    foreach( $categories as $category_id => $_data  )
189
+    foreach ($categories as $category_id => $_data)
190 190
     {
191
-        if( isset( $_data['delete'] ) )
191
+        if (isset($_data['delete']))
192 192
         {
193
-            if( $cm->deleteCategory( $category_id ) )
193
+            if ($cm->deleteCategory($category_id))
194 194
             {
195 195
                 $cm->addMessage(
196 196
                     sprintf(
197 197
                         $cm->txt('cm_category_x_deleted'),
198
-                        urldecode( $_data['origin'] )
198
+                        urldecode($_data['origin'])
199 199
                     ),
200 200
                     'edit'
201 201
                 );
@@ -205,16 +205,16 @@  discard block
 block discarded – undo
205 205
         }
206 206
 
207 207
         $data = array(
208
-            'category' => trim( html_entity_decode( $_data['category'] ) ),
208
+            'category' => trim(html_entity_decode($_data['category'])),
209 209
             'rank'     => $_data['rank']
210 210
         );
211 211
 
212
-        if( $cm->updateCategory( $category_id, $data ) )
212
+        if ($cm->updateCategory($category_id, $data))
213 213
         {
214 214
             $cm->addMessage(
215 215
                 sprintf(
216 216
                     $cm->txt('cm_category_x_renamed_to_y'),
217
-                    urldecode( $_data['origin'] ),
217
+                    urldecode($_data['origin']),
218 218
                     $data['category']
219 219
                 ),
220 220
                 'edit'
@@ -223,26 +223,26 @@  discard block
 block discarded – undo
223 223
         }
224 224
     }
225 225
 
226
-    if( $_changes === 0 )
226
+    if ($_changes === 0)
227 227
     {
228
-        $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
228
+        $cm->addMessage($cm->txt('cm_no_changes'), 'edit');
229 229
     }
230 230
 }
231 231
 
232 232
 /**
233 233
  * Delete singel category by $_GET
234 234
  */
235
-if( isset( $_GET[$cm->get('request_key')]['delete'] )
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
235
+if (isset($_GET[$cm->get('request_key')]['delete'])
236
+    && !empty($_GET[$cm->get('request_key')]['delete']))
237 237
 {
238
-    $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
238
+    $category_id = (int) $_GET[$cm->get('request_key')]['delete'];
239 239
 
240
-    if( $cm->deleteCategory( $category_id ) )
240
+    if ($cm->deleteCategory($category_id))
241 241
     {
242 242
         $cm->addMessage(
243 243
             sprintf(
244 244
                 $cm->txt('cm_category_x_deleted'),
245
-                urldecode( $_GET[$cm->get('request_key')]['category'] )
245
+                urldecode($_GET[$cm->get('request_key')]['category'])
246 246
             ),
247 247
             'edit'
248 248
         );
@@ -251,15 +251,15 @@  discard block
 block discarded – undo
251 251
 /**
252 252
  * Translate phrases
253 253
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
254
+if (isset($_POST[$cm->get('request_key')]['translate']['submit']))
255 255
 {
256 256
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 257
 
258
-    foreach( $translations as $native_phrase => $translation )
258
+    foreach ($translations as $native_phrase => $translation)
259 259
     {
260
-        $native_phrase = urldecode( $native_phrase );
260
+        $native_phrase = urldecode($native_phrase);
261 261
 
262
-        if( empty( $translation ) )
262
+        if (empty($translation))
263 263
         {
264 264
             $translation = $native_phrase;
265 265
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
             );
273 273
         }
274 274
 
275
-        $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' );
275
+        $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase');
276 276
 
277 277
         $cm->addMessage(
278 278
             sprintf(
Please login to merge, or discard this patch.
Braces   +31 added lines, -65 removed lines patch added patch discarded remove patch
@@ -6,26 +6,22 @@  discard block
 block discarded – undo
6 6
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
7 7
 }
8 8
 
9
-if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) )
10
-{
9
+if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) {
11 10
     $_data  = $_REQUEST[$cm->get('request_key')];
12 11
     $output = '';
13 12
     $task   = $_data['task'];
14
-    switch( $task )
15
-    {
13
+    switch( $task ) {
16 14
         /**
17 15
          * get categories
18 16
          */
19 17
         case 'categorize_load_elements':
20 18
             $elements = $_data['elements'];
21 19
 
22
-            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) )
23
-            {
20
+            if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) {
24 21
                $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements);
25 22
             }
26 23
 
27
-            foreach( $cm->getCategories() as $category )
28
-            {
24
+            foreach( $cm->getCategories() as $category ) {
29 25
                 $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] );
30 26
                 $output .= $cm->renderView('chunks/categorize/category', $category);
31 27
             }
@@ -41,8 +37,7 @@  discard block
 block discarded – undo
41 37
  * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476
42 38
  *
43 39
  */
44
-if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) )
45
-{
40
+if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) {
46 41
     $_data = $_POST[$cm->get('request_key')]['categorize'];
47 42
     $_changes = 0;
48 43
 
@@ -54,16 +49,13 @@  discard block
 block discarded – undo
54 49
         'categorize'
55 50
     );
56 51
 
57
-    if( !isset( $_data['elements'] ) )
58
-    {
52
+    if( !isset( $_data['elements'] ) ) {
59 53
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' );
60 54
         return;
61 55
     }
62 56
 
63
-    foreach( $_data['elements'] as $element_id => $data )
64
-    {
65
-        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) )
66
-        {
57
+    foreach( $_data['elements'] as $element_id => $data ) {
58
+        if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) {
67 59
             $cm->addMessage(
68 60
                 sprintf(
69 61
                     $cm->txt('cm_x_assigned_to_category_y'),
@@ -78,13 +70,10 @@  discard block
 block discarded – undo
78 70
         }
79 71
     }
80 72
 
81
-    if( $_changes === 0 )
82
-    {
73
+    if( $_changes === 0 ) {
83 74
         $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' );
84 75
         return;
85
-    }
86
-    else
87
-    {
76
+    } else {
88 77
         $cm->addMessage(
89 78
             sprintf(
90 79
                 $cm->txt('cm_x_changes_made'),
@@ -98,26 +87,22 @@  discard block
 block discarded – undo
98 87
 /**
99 88
  * Add a new category
100 89
  */
101
-if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) )
102
-{
90
+if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) {
103 91
     $_data    = $_POST[$cm->get('request_key')]['add']['data'];
104 92
     $category = trim( html_entity_decode($_data['name']) );
105 93
     $rank     = (int) $_data['rank'];
106 94
 
107
-    if( empty( $category ) )
108
-    {
95
+    if( empty( $category ) ) {
109 96
        $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' );
110 97
        return;
111 98
     }
112 99
 
113
-    if( $cm->isCategoryExists( $category ) )
114
-    {
100
+    if( $cm->isCategoryExists( $category ) ) {
115 101
        $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' );
116 102
        return;
117 103
     }
118 104
 
119
-    if( $cm->addCategory( $category, $rank ) !== 0 )
120
-    {
105
+    if( $cm->addCategory( $category, $rank ) !== 0 ) {
121 106
         $cm->addMessage(
122 107
             sprintf(
123 108
                 $cm->txt( 'cm_category_x_saved_at_position_y' ),
@@ -126,9 +111,7 @@  discard block
 block discarded – undo
126 111
             ),
127 112
             'add'
128 113
         );
129
-    }
130
-    else
131
-    {
114
+    } else {
132 115
         $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' );
133 116
     }
134 117
 }
@@ -136,20 +119,17 @@  discard block
 block discarded – undo
136 119
 /**
137 120
  * Sort categories
138 121
  */
139
-if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) )
140
-{
122
+if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) {
141 123
     $categories = $_POST[$cm->get('request_key')]['sort']['data'];
142 124
     $_changes   = 0;
143 125
 
144
-    foreach( $categories as $category_id => $_data  )
145
-    {
126
+    foreach( $categories as $category_id => $_data  ) {
146 127
         $data = array(
147 128
             'category' => urldecode( $_data['category'] ),
148 129
             'rank'     => $_data['rank']
149 130
         );
150 131
 
151
-        if( $cm->updateCategory( $category_id, $data ) )
152
-        {
132
+        if( $cm->updateCategory( $category_id, $data ) ) {
153 133
             $cm->addMessage(
154 134
                 sprintf(
155 135
                     $cm->txt('cm_category_x_moved_to_position_y'),
@@ -162,12 +142,9 @@  discard block
 block discarded – undo
162 142
         }
163 143
     }
164 144
 
165
-    if( $_changes === 0 )
166
-    {
145
+    if( $_changes === 0 ) {
167 146
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort');
168
-    }
169
-    else
170
-    {
147
+    } else {
171 148
         $cm->addMessage(
172 149
             sprintf(
173 150
                 $cm->txt('cm_x_changes_made'),
@@ -181,17 +158,13 @@  discard block
 block discarded – undo
181 158
 /**
182 159
  * Edit categories
183 160
  */
184
-if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) )
185
-{
161
+if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) {
186 162
     $categories = $_POST[$cm->get('request_key')]['edit']['data'];
187 163
     $_changes   = 0;
188 164
 
189
-    foreach( $categories as $category_id => $_data  )
190
-    {
191
-        if( isset( $_data['delete'] ) )
192
-        {
193
-            if( $cm->deleteCategory( $category_id ) )
194
-            {
165
+    foreach( $categories as $category_id => $_data  ) {
166
+        if( isset( $_data['delete'] ) ) {
167
+            if( $cm->deleteCategory( $category_id ) ) {
195 168
                 $cm->addMessage(
196 169
                     sprintf(
197 170
                         $cm->txt('cm_category_x_deleted'),
@@ -209,8 +182,7 @@  discard block
 block discarded – undo
209 182
             'rank'     => $_data['rank']
210 183
         );
211 184
 
212
-        if( $cm->updateCategory( $category_id, $data ) )
213
-        {
185
+        if( $cm->updateCategory( $category_id, $data ) ) {
214 186
             $cm->addMessage(
215 187
                 sprintf(
216 188
                     $cm->txt('cm_category_x_renamed_to_y'),
@@ -223,8 +195,7 @@  discard block
 block discarded – undo
223 195
         }
224 196
     }
225 197
 
226
-    if( $_changes === 0 )
227
-    {
198
+    if( $_changes === 0 ) {
228 199
         $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit');
229 200
     }
230 201
 }
@@ -233,12 +204,10 @@  discard block
 block discarded – undo
233 204
  * Delete singel category by $_GET
234 205
  */
235 206
 if( isset( $_GET[$cm->get('request_key')]['delete'] )
236
-    && !empty( $_GET[$cm->get('request_key')]['delete'] ) )
237
-{
207
+    && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) {
238 208
     $category_id = (int)$_GET[$cm->get('request_key')]['delete'];
239 209
 
240
-    if( $cm->deleteCategory( $category_id ) )
241
-    {
210
+    if( $cm->deleteCategory( $category_id ) ) {
242 211
         $cm->addMessage(
243 212
             sprintf(
244 213
                 $cm->txt('cm_category_x_deleted'),
@@ -251,16 +220,13 @@  discard block
 block discarded – undo
251 220
 /**
252 221
  * Translate phrases
253 222
  */
254
-if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) )
255
-{
223
+if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) {
256 224
     $translations = $_POST[$cm->get('request_key')]['translate']['data'];
257 225
 
258
-    foreach( $translations as $native_phrase => $translation )
259
-    {
226
+    foreach( $translations as $native_phrase => $translation ) {
260 227
         $native_phrase = urldecode( $native_phrase );
261 228
 
262
-        if( empty( $translation ) )
263
-        {
229
+        if( empty( $translation ) ) {
264 230
             $translation = $native_phrase;
265 231
 
266 232
             $cm->addMessage(
Please login to merge, or discard this patch.
manager/actions/eventlog_details.dynamic.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
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('view_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // get id
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 	<div class="tab-page">
42 42
 		<div class="container container-body">
43 43
 			<?php
44
-			$date = $modx->toDateFormat($content["createdon"]);
45
-			if($content["type"] == 1) {
46
-				$icon = $_style['actions_info'] . ' text-info';
47
-				$msgtype = $_lang["information"];
48
-			} else if($content["type"] == 2) {
49
-				$icon = $_style['actions_triangle'] . ' text-warning';
50
-				$msgtype = $_lang["warning"];
51
-			} else if($content["type"] == 3) {
52
-				$icon = $_style['actions_error'] . ' text-danger';
53
-				$msgtype = $_lang["error"];
54
-			}
55
-			?>
44
+            $date = $modx->toDateFormat($content["createdon"]);
45
+            if($content["type"] == 1) {
46
+                $icon = $_style['actions_info'] . ' text-info';
47
+                $msgtype = $_lang["information"];
48
+            } else if($content["type"] == 2) {
49
+                $icon = $_style['actions_triangle'] . ' text-warning';
50
+                $msgtype = $_lang["warning"];
51
+            } else if($content["type"] == 3) {
52
+                $icon = $_style['actions_error'] . ' text-danger';
53
+                $msgtype = $_lang["error"];
54
+            }
55
+            ?>
56 56
 			<p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p>
57 57
 			<p>
58 58
 				<i class="<?= $icon ?>"></i> <?= $msgtype ?>
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@  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('view_eventlog')) {
5
+if (!$modx->hasPermission('view_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // get id
10
-$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
10
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12
-$ds = $modx->getDatabase()->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el 
13
-		LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0
14
-		LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'");
12
+$ds = $modx->getDatabase()->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el 
13
+		LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0
14
+		LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'");
15 15
 $content = $modx->getDatabase()->getRow($ds);
16 16
 
17 17
 ?>
@@ -42,18 +42,18 @@  discard block
 block discarded – undo
42 42
 		<div class="container container-body">
43 43
 			<?php
44 44
 			$date = $modx->toDateFormat($content["createdon"]);
45
-			if($content["type"] == 1) {
46
-				$icon = $_style['actions_info'] . ' text-info';
45
+			if ($content["type"] == 1) {
46
+				$icon = $_style['actions_info'].' text-info';
47 47
 				$msgtype = $_lang["information"];
48
-			} else if($content["type"] == 2) {
49
-				$icon = $_style['actions_triangle'] . ' text-warning';
48
+			} else if ($content["type"] == 2) {
49
+				$icon = $_style['actions_triangle'].' text-warning';
50 50
 				$msgtype = $_lang["warning"];
51
-			} else if($content["type"] == 3) {
52
-				$icon = $_style['actions_error'] . ' text-danger';
51
+			} else if ($content["type"] == 3) {
52
+				$icon = $_style['actions_error'].' text-danger';
53 53
 				$msgtype = $_lang["error"];
54 54
 			}
55 55
 			?>
56
-			<p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p>
56
+			<p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p>
57 57
 			<p>
58 58
 				<i class="<?= $icon ?>"></i> <?= $msgtype ?>
59 59
 			</p>
Please login to merge, or discard this patch.
manager/processors/web_access_groups.processor.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if($updategroupaccess==true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
Indentation   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  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('web_access_permissions')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 // web access group processor.
@@ -20,111 +20,111 @@  discard block
 block discarded – undo
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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_names);
29 29
 
30
-			// invoke OnWebCreateGroup event
31
-			$modx->invokeEvent('OnWebCreateGroup', 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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names);
30
+            // invoke OnWebCreateGroup event
31
+            $modx->invokeEvent('OnWebCreateGroup', 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->getDatabase()->insert(array('name'=>$modx->getDatabase()->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->getDatabase()->delete($tbl_webgroup_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->getDatabase()->delete($tbl_webgroup_names, "id='{$usergroup}'");
58 58
 
59
-			$modx->getDatabase()->delete($tbl_webgroup_access, "webgroup='{$usergroup}'");
59
+            $modx->getDatabase()->delete($tbl_webgroup_access, "webgroup='{$usergroup}'");
60 60
 
61
-			$modx->getDatabase()->delete($tbl_web_groups, "webuser='{$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->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'");
61
+            $modx->getDatabase()->delete($tbl_web_groups, "webuser='{$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->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'");
70 70
 
71
-			$modx->getDatabase()->delete($tbl_webgroup_access, "documentgroup='{$group}'");
71
+            $modx->getDatabase()->delete($tbl_webgroup_access, "documentgroup='{$group}'");
72 72
 
73
-			$modx->getDatabase()->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 user group id specified for rename.");
84
-		}
85
-		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86
-	break;
87
-	case "rename_document_group" :
88
-		$newgroupname = $_REQUEST['newgroupname'];
89
-		if(empty($newgroupname)) {
90
-			$modx->webAlertAndQuit("No group name specified.");
91
-		}
92
-		$groupid = (int)$_REQUEST['groupid'];
93
-		if(empty($groupid)) {
94
-			$modx->webAlertAndQuit("No document group id specified for rename.");
95
-		}
96
-		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97
-	break;
98
-	case "add_document_group_to_user_group" :
99
-		$updategroupaccess = true;
100
-		$usergroup = (int)$_REQUEST['usergroup'];
101
-		$docgroup = (int)$_REQUEST['docgroup'];
102
-		$rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103
-		$limit = $modx->getDatabase()->getValue($rs);
104
-		if($limit<=0) {
105
-			$modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106
-		} else {
107
-			//alert user that coupling already exists?
108
-		}
109
-	break;
110
-	case "remove_document_group_from_user_group" :
111
-		$updategroupaccess = true;
112
-		$coupling = (int)$_REQUEST['coupling'];
113
-		$modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'");
114
-	break;
115
-	default :
116
-		$modx->webAlertAndQuit("No operation set in request.");
73
+            $modx->getDatabase()->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 user group id specified for rename.");
84
+        }
85
+        $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86
+    break;
87
+    case "rename_document_group" :
88
+        $newgroupname = $_REQUEST['newgroupname'];
89
+        if(empty($newgroupname)) {
90
+            $modx->webAlertAndQuit("No group name specified.");
91
+        }
92
+        $groupid = (int)$_REQUEST['groupid'];
93
+        if(empty($groupid)) {
94
+            $modx->webAlertAndQuit("No document group id specified for rename.");
95
+        }
96
+        $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97
+    break;
98
+    case "add_document_group_to_user_group" :
99
+        $updategroupaccess = true;
100
+        $usergroup = (int)$_REQUEST['usergroup'];
101
+        $docgroup = (int)$_REQUEST['docgroup'];
102
+        $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103
+        $limit = $modx->getDatabase()->getValue($rs);
104
+        if($limit<=0) {
105
+            $modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106
+        } else {
107
+            //alert user that coupling already exists?
108
+        }
109
+    break;
110
+    case "remove_document_group_from_user_group" :
111
+        $updategroupaccess = true;
112
+        $coupling = (int)$_REQUEST['coupling'];
113
+        $modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'");
114
+    break;
115
+    default :
116
+        $modx->webAlertAndQuit("No operation set in request.");
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120 120
 if($updategroupaccess==true){
121
-	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122
-	secureWebDocument();
121
+    include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122
+    secureWebDocument();
123 123
 
124
-	// Update the private group column
125
-	$modx->getDatabase()->update(
126
-		'dgn.private_webgroup = (wga.webgroup IS NOT NULL)',
127
-		"{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id");
124
+    // Update the private group column
125
+    $modx->getDatabase()->update(
126
+        'dgn.private_webgroup = (wga.webgroup IS NOT NULL)',
127
+        "{$tbl_documentgroup_names} AS dgn LEFT JOIN {$tbl_webgroup_access} AS wga ON wga.documentgroup = dgn.id");
128 128
 }
129 129
 
130 130
 $header = "Location: index.php?a=91";
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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('web_access_permissions')) {
5
+if (!$modx->hasPermission('web_access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_names);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names);
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
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->getDatabase()->delete($tbl_webgroup_names, "id='{$usergroup}'");
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
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->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'");
@@ -75,33 +75,33 @@  discard block
 block discarded – undo
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 user group id specified for rename.");
84 84
 		}
85 85
 		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86 86
 	break;
87 87
 	case "rename_document_group" :
88 88
 		$newgroupname = $_REQUEST['newgroupname'];
89
-		if(empty($newgroupname)) {
89
+		if (empty($newgroupname)) {
90 90
 			$modx->webAlertAndQuit("No group name specified.");
91 91
 		}
92
-		$groupid = (int)$_REQUEST['groupid'];
93
-		if(empty($groupid)) {
92
+		$groupid = (int) $_REQUEST['groupid'];
93
+		if (empty($groupid)) {
94 94
 			$modx->webAlertAndQuit("No document group id specified for rename.");
95 95
 		}
96 96
 		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97 97
 	break;
98 98
 	case "add_document_group_to_user_group" :
99 99
 		$updategroupaccess = true;
100
-		$usergroup = (int)$_REQUEST['usergroup'];
101
-		$docgroup = (int)$_REQUEST['docgroup'];
100
+		$usergroup = (int) $_REQUEST['usergroup'];
101
+		$docgroup = (int) $_REQUEST['docgroup'];
102 102
 		$rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103 103
 		$limit = $modx->getDatabase()->getValue($rs);
104
-		if($limit<=0) {
104
+		if ($limit <= 0) {
105 105
 			$modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106 106
 		} else {
107 107
 			//alert user that coupling already exists?
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	break;
110 110
 	case "remove_document_group_from_user_group" :
111 111
 		$updategroupaccess = true;
112
-		$coupling = (int)$_REQUEST['coupling'];
112
+		$coupling = (int) $_REQUEST['coupling'];
113 113
 		$modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'");
114 114
 	break;
115 115
 	default :
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if ($updategroupaccess == true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
manager/processors/purge_plugin.processor.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,10 @@
 block discarded – undo
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));
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  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
     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
 block discarded – undo
14 14
 // Get unique list of latest added plugins by highest sql-id
15 15
 $rs = $modx->getDatabase()->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->getDatabase()->getRow($rs)) {
17
+while ($row = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->getRow($rs)) {
24
+while ($row = $modx->getDatabase()->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));
Please login to merge, or discard this patch.