Completed
Push — develop ( e6bcf2...351294 )
by Dmytro
06:18
created
manager/processors/remove_content.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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('delete_document')) {
@@ -17,15 +17,15 @@  discard block
 block discarded – undo
17 17
 
18 18
 // remove the document groups link.
19 19
 $sql = "DELETE document_groups
20
-		FROM " . $modx->getFullTableName('document_groups') . " AS document_groups
21
-		INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = document_groups.document
20
+		FROM " . $modx->getFullTableName('document_groups')." AS document_groups
21
+		INNER JOIN " . $modx->getFullTableName('site_content')." AS site_content ON site_content.id = document_groups.document
22 22
 		WHERE site_content.deleted=1";
23 23
 $modx->db->query($sql);
24 24
 
25 25
 // remove the TV content values.
26 26
 $sql = "DELETE site_tmplvar_contentvalues
27
-		FROM " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS site_tmplvar_contentvalues
28
-		INNER JOIN " . $modx->getFullTableName('site_content') . " AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid
27
+		FROM " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS site_tmplvar_contentvalues
28
+		INNER JOIN " . $modx->getFullTableName('site_content')." AS site_content ON site_content.id = site_tmplvar_contentvalues.contentid
29 29
 		WHERE site_content.deleted=1";
30 30
 $modx->db->query($sql);
31 31
 
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
     $modx->clearCache('full');
43 43
 
44 44
     // finished emptying cache - redirect
45
-    $header="Location: index.php?a=2&r=1";
45
+    $header = "Location: index.php?a=2&r=1";
46 46
     header($header);
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,31 +1,31 @@  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('delete_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
 // check permissions on the document
28
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
28
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
29 29
 $udperms = new udperms();
30 30
 $udperms->user = $modx->getLoginUserID();
31 31
 $udperms->document = $id;
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
     global $children;
54 54
     global $deltime;
55 55
 
56
-    $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='" . (int)$parent . "' AND deleted=1 AND deletedon='" . (int)$deltime . "'");
56
+    $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent='".(int) $parent."' AND deleted=1 AND deletedon='".(int) $deltime."'");
57 57
     // the document has children documents, we'll need to delete those too
58
-    while ($row=$modx->db->getRow($rs)) {
58
+    while ($row = $modx->db->getRow($rs)) {
59 59
         $children[] = $row['id'];
60 60
         getChildren($row['id']);
61 61
         //echo "Found childNode of parentNode $parent: ".$row['id']."<br />";
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 
65 65
 getChildren($id);
66 66
 
67
-if (count($children)>0) {
67
+if (count($children) > 0) {
68 68
     $modx->db->update(
69 69
         array(
70 70
             'deleted'   => 0,
71 71
             'deletedby' => 0,
72 72
             'deletedon' => 0,
73
-        ), $modx->getFullTableName('site_content'), "id IN(" . implode(", ", $children) . ")");
73
+        ), $modx->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
74 74
 }
75 75
 //'undelete' the document.
76 76
 $modx->db->update(
@@ -93,5 +93,5 @@  discard block
 block discarded – undo
93 93
 $modx->clearCache('full');
94 94
 
95 95
 // finished emptying cache - redirect
96
-$header="Location: index.php?a=3&id=$pid&r=1" . $add_path;
96
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
97 97
 header($header);
Please login to merge, or discard this patch.
manager/processors/duplicate_tmplvars.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@  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('edit_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if ($count>=1) {
18
-    $count = ' ' . ($count+1);
17
+if ($count >= 1) {
18
+    $count = ' '.($count + 1);
19 19
 } else {
20 20
     $count = '';
21 21
 }
@@ -59,5 +59,5 @@  discard block
 block discarded – undo
59 59
 $_SESSION['itemname'] = $name;
60 60
 
61 61
 // finish duplicating - redirect to new variable
62
-$header="Location: index.php?r=2&a=301&id=$newid";
62
+$header = "Location: index.php?r=2&a=301&id=$newid";
63 63
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_role.processor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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_role')) {
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 extract($_POST);
10 10
 
11 11
 if ($name == '' || !isset($name)) {
12
-    $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : ""));
12
+    $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}".($mode = 35 ? "&id={$id}" : ""));
13 13
 }
14 14
 
15 15
 // setup fields
Please login to merge, or discard this patch.
manager/processors/logout.processor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 
@@ -41,4 +41,4 @@  discard block
 block discarded – undo
41 41
                         ));
42 42
 
43 43
 // show login screen
44
-header('Location: ' . MODX_MANAGER_URL);
44
+header('Location: '.MODX_MANAGER_URL);
Please login to merge, or discard this patch.
manager/processors/delete_role.processor.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  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('delete_role')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14
-if ($id==1) {
14
+if ($id == 1) {
15 15
     $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!");
16 16
 }
17 17
 
18 18
 $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'");
19
-$count=$modx->db->getValue($rs);
20
-if ($count>0) {
19
+$count = $modx->db->getValue($rs);
20
+if ($count > 0) {
21 21
     $modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
22 22
 }
23 23
 
@@ -28,5 +28,5 @@  discard block
 block discarded – undo
28 28
 // delete the attributes
29 29
 $modx->db->delete($modx->getFullTableName('user_roles'), "id='{$id}'");
30 30
 
31
-$header="Location: index.php?a=86";
31
+$header = "Location: index.php?a=86";
32 32
 header($header);
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  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('exec_module')) {
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
 // check if user has access permission, except admins
15
-if ($_SESSION['mgrRole']!=1) {
15
+if ($_SESSION['mgrRole'] != 1) {
16 16
     $rs = $modx->db->select(
17 17
         'sma.usergroup,mg.member',
18
-        $modx->getFullTableName("site_module_access") . " sma
19
-			LEFT JOIN " . $modx->getFullTableName("member_groups") . " mg ON mg.user_group = sma.usergroup AND member='" . $modx->getLoginUserID() . "'",
18
+        $modx->getFullTableName("site_module_access")." sma
19
+			LEFT JOIN " . $modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'",
20 20
         "sma.module = '{$id}'"
21 21
         );
22 22
     //initialize permission to -1, if it stays -1 no permissions
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
             //if there are permissions and this member has permission, ofcourse
29 29
             //this is granted
30 30
             $permissionAccessInt = 1;
31
-        } elseif ($permissionAccessInt==-1) {
31
+        } elseif ($permissionAccessInt == -1) {
32 32
             //if there are permissions but this member has no permission and the
33 33
             //variable was still in init state we set permission to 0; no permissions
34 34
             $permissionAccessInt = 0;
35 35
         }
36 36
     }
37 37
 
38
-    if ($permissionAccessInt==0) {
38
+    if ($permissionAccessInt == 0) {
39 39
         $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40 40
     }
41 41
 }
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 $output = evalModule($content["modulecode"], $parameter);
64
-if (strpos(trim($output), '<')===0 && strpos(trim($output), '<?xml')!==0) {
64
+if (strpos(trim($output), '<') === 0 && strpos(trim($output), '<?xml') !== 0) {
65 65
     echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
66 66
 }
67 67
 echo $output;
68
-include MODX_MANAGER_PATH . "includes/sysalert.display.inc.php";
68
+include MODX_MANAGER_PATH."includes/sysalert.display.inc.php";
69 69
 
70 70
 /**
71 71
  * evalModule
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
             default:
102 102
                 $error_level = 99;
103 103
         }
104
-        if ($modx->config['error_reporting']==='99' || 2<$error_level) {
105
-            $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
104
+        if ($modx->config['error_reporting'] === '99' || 2 < $error_level) {
105
+            $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg);
106 106
             $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
107 107
         }
108 108
     }
109 109
     unset($modx->event->params);
110
-    return $mod . $msg;
110
+    return $mod.$msg;
111 111
 }
Please login to merge, or discard this patch.
manager/processors/save_web_user.processor.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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_web_user')) {
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     $input[$k] = $v;
19 19
 }
20 20
 
21
-$id = (int)$input['id'];
21
+$id = (int) $input['id'];
22 22
 $oldusername = $input['oldusername'];
23 23
 $newusername = !empty($input['newusername']) ? trim($input['newusername']) : "New User";
24 24
 $esc_newusername = $modx->db->escape($newusername);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             if (!empty($user_groups)) {
121 121
                 for ($i = 0; $i < count($user_groups); $i++) {
122 122
                     $f = array();
123
-                    $f['webgroup'] = (int)$user_groups[$i];
123
+                    $f['webgroup'] = (int) $user_groups[$i];
124 124
                     $f['webuser'] = $internalKey;
125 125
                     $modx->db->insert($f, $tbl_web_groups);
126 126
                 }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             sendMailMessage($email, $newusername, $newpassword, $fullname);
149 149
             if ($input['stay'] != '') {
150 150
                 $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
151
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
151
+                $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
152 152
                 header($header);
153 153
             } else {
154 154
                 $header = "Location: index.php?a=99&r=2";
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         } else {
158 158
             if ($input['stay'] != '') {
159 159
                 $a = ($input['stay'] == '2') ? "88&id={$internalKey}" : "87";
160
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
160
+                $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
161 161
             } else {
162 162
                 $stayUrl = "index.php?a=99&r=2";
163 163
             }
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             if (!empty($user_groups)) {
257 257
                 for ($i = 0; $i < count($user_groups); $i++) {
258 258
                     $field = array();
259
-                    $field['webgroup'] = (int)$user_groups[$i];
259
+                    $field['webgroup'] = (int) $user_groups[$i];
260 260
                     $field['webuser'] = $id;
261 261
                     $modx->db->insert($field, $tbl_web_groups);
262 262
                 }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         if ($genpassword == 1 && $passwordnotifymethod == 's') {
296 296
             if ($input['stay'] != '') {
297 297
                 $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
298
-                $stayUrl = "index.php?a={$a}&r=2&stay=" . $input['stay'];
298
+                $stayUrl = "index.php?a={$a}&r=2&stay=".$input['stay'];
299 299
             } else {
300 300
                 $stayUrl = "index.php?a=99&r=2";
301 301
             }
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         } else {
325 325
             if ($input['stay'] != '') {
326 326
                 $a = ($input['stay'] == '2') ? "88&id={$id}" : "87";
327
-                $header = "Location: index.php?a={$a}&r=2&stay=" . $input['stay'];
327
+                $header = "Location: index.php?a={$a}&r=2&stay=".$input['stay'];
328 328
                 header($header);
329 329
             } else {
330 330
                 $header = "Location: index.php?a=99&r=2";
@@ -345,13 +345,13 @@  discard block
 block discarded – undo
345 345
 function save_user_quoted_printable($string)
346 346
 {
347 347
     $crlf = "\n";
348
-    $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string) . $crlf;
348
+    $string = preg_replace('!(\r\n|\r|\n)!', $crlf, $string).$crlf;
349 349
     $f[] = '/([\000-\010\013\014\016-\037\075\177-\377])/e';
350 350
     $r[] = "'=' . sprintf('%02X', ord('\\1'))";
351
-    $f[] = '/([\011\040])' . $crlf . '/e';
352
-    $r[] = "'=' . sprintf('%02X', ord('\\1')) . '" . $crlf . "'";
351
+    $f[] = '/([\011\040])'.$crlf.'/e';
352
+    $r[] = "'=' . sprintf('%02X', ord('\\1')) . '".$crlf."'";
353 353
     $string = preg_replace($f, $r, $string);
354
-    return trim(wordwrap($string, 70, ' =' . $crlf));
354
+    return trim(wordwrap($string, 70, ' ='.$crlf));
355 355
 }
356 356
 
357 357
 /**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
     global $id, $modx;
428 428
     $mode = $_POST['mode'];
429 429
     $modx->manager->saveFormValues($mode);
430
-    $modx->webAlertAndQuit($msg, "index.php?a={$mode}" . ($mode == '88' ? "&id={$id}" : ''));
430
+    $modx->webAlertAndQuit($msg, "index.php?a={$mode}".($mode == '88' ? "&id={$id}" : ''));
431 431
 }
432 432
 
433 433
 // Generate password
Please login to merge, or discard this patch.
manager/processors/move_document.processor.php 1 patch
Spacing   +11 added lines, -11 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 5
 if (!$modx->hasPermission('edit_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0;
10
-$documentID = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
9
+$newParentID = isset($_REQUEST['new_parent']) ? (int) $_REQUEST['new_parent'] : 0;
10
+$documentID = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
11 11
 
12 12
 // ok, two things to check.
13 13
 // first, document cannot be moved to itself
14 14
 // second, new parent must be a folder. If not, set it to folder.
15
-if ($documentID==$newParentID) {
15
+if ($documentID == $newParentID) {
16 16
     $modx->webAlertAndQuit($_lang["error_movedocument1"]);
17 17
 }
18 18
 if ($documentID <= 0) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 if ($use_udperms == 1) {
36 36
     if ($oldparent != $newParentID) {
37
-        include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
37
+        include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
38 38
         $udperms = new udperms();
39 39
         $udperms->user = $modx->getLoginUserID();
40 40
         $udperms->document = $newParentID;
@@ -53,12 +53,12 @@  discard block
 block discarded – undo
53 53
 function allChildren($currDocID)
54 54
 {
55 55
     $modx = evolutionCMS();
56
-    $children= array();
56
+    $children = array();
57 57
     $currDocID = $modx->db->escape($currDocID);
58 58
     $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'");
59
-    while ($child= $modx->db->getRow($rs)) {
60
-        $children[]= $child['id'];
61
-        $children= array_merge($children, allChildren($child['id']));
59
+    while ($child = $modx->db->getRow($rs)) {
60
+        $children[] = $child['id'];
61
+        $children = array_merge($children, allChildren($child['id']));
62 62
     }
63 63
     return $children;
64 64
 }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'");
94 94
     $limit = $modx->db->getValue($rs);
95 95
 
96
-    if (!$limit>0) {
96
+    if (!$limit > 0) {
97 97
         $modx->db->update(array(
98 98
             'isfolder' => 0,
99 99
         ), $modx->getFullTableName('site_content'), "id='{$oldparent}'");
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     // empty cache & sync site
112 112
     $modx->clearCache('full');
113 113
 
114
-    $header="Location: index.php?a=3&id={$documentID}&r=9";
114
+    $header = "Location: index.php?a=3&id={$documentID}&r=9";
115 115
     header($header);
116 116
 } else {
117 117
     $modx->webAlertAndQuit("You cannot move a document to a child document!");
Please login to merge, or discard this patch.