Completed
Push — develop ( 8dee05 )
by Dmytro
20:08
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->getDatabase()->delete($modx->getDatabase()->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/remove_locks.processor.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -4,23 +4,23 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+    if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 
9
-	// Remove all locks
10
-	$modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks'));
9
+    // Remove all locks
10
+    $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks'));
11 11
 
12
-	$header = "Location: index.php?a=2";
13
-	header($header);
12
+    $header = "Location: index.php?a=2";
13
+    header($header);
14 14
 } else {
15
-	// Remove single locks via AJAX / window.onbeforeunload
16
-	$type = (int)$_GET['type'];
17
-	$id = (int)$_GET['id'];
18
-	$includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
-	if($type && $id) {
20
-		$modx->unlockElement($type, $id, $includeAllUsers);
21
-		echo '1';
22
-		exit;
23
-	} else {
24
-		echo 'No type or id sent with request.';
25
-	}
15
+    // Remove single locks via AJAX / window.onbeforeunload
16
+    $type = (int)$_GET['type'];
17
+    $id = (int)$_GET['id'];
18
+    $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
+    if($type && $id) {
20
+        $modx->unlockElement($type, $id, $includeAllUsers);
21
+        echo '1';
22
+        exit;
23
+    } else {
24
+        echo 'No type or id sent with request.';
25
+    }
26 26
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  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
 
6
-if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+if (!isset($_GET['id'])) {
7
+	if (!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
8 8
 
9 9
 	// Remove all locks
10 10
 	$modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks'));
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
 	header($header);
14 14
 } else {
15 15
 	// Remove single locks via AJAX / window.onbeforeunload
16
-	$type = (int)$_GET['type'];
17
-	$id = (int)$_GET['id'];
16
+	$type = (int) $_GET['type'];
17
+	$id = (int) $_GET['id'];
18 18
 	$includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button
19
-	if($type && $id) {
19
+	if ($type && $id) {
20 20
 		$modx->unlockElement($type, $id, $includeAllUsers);
21 21
 		echo '1';
22 22
 		exit;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,9 @@
 block discarded – undo
4 4
 }
5 5
 
6 6
 if(!isset($_GET['id'])) {
7
-	if(!$modx->hasPermission('remove_locks')) $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7
+	if(!$modx->hasPermission('remove_locks')) {
8
+	    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
9
+	}
8 10
 
9 11
 	// Remove all locks
10 12
 	$modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('active_user_locks'));
Please login to merge, or discard this patch.
manager/processors/duplicate_plugin.processor.php 3 patches
Indentation   +18 added lines, -18 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('new_plugin')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
@@ -19,25 +19,25 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate Plugin
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'name'=>'',
24
-		'description'=>'',
25
-		'disabled'=>'',
26
-		'moduleguid'=>'',
27
-		'plugincode'=>'',
28
-		'properties'=>'',
29
-		'category'=>'',
30
-		), $modx->getDatabase()->getFullTableName('site_plugins'), // Insert into
31
-	"CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getDatabase()->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'name'=>'',
24
+        'description'=>'',
25
+        'disabled'=>'',
26
+        'moduleguid'=>'',
27
+        'plugincode'=>'',
28
+        'properties'=>'',
29
+        'category'=>'',
30
+        ), $modx->getDatabase()->getFullTableName('site_plugins'), // Insert into
31
+    "CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, description, '1' AS disabled, moduleguid, plugincode, properties, category", $modx->getDatabase()->getFullTableName('site_plugins'), "id='{$id}'"); // Copy from
32 32
 
33 33
 // duplicate Plugin Event Listeners
34 34
 $modx->getDatabase()->insert(
35
-	array(
36
-		'pluginid'=>'',
37
-		'evtid'=>'',
38
-		'priority'=>'',
39
-		), $modx->getDatabase()->getFullTableName('site_plugin_events'), // Insert into
40
-	"'{$newid}', evtid, priority", $modx->getDatabase()->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
35
+    array(
36
+        'pluginid'=>'',
37
+        'evtid'=>'',
38
+        'priority'=>'',
39
+        ), $modx->getDatabase()->getFullTableName('site_plugin_events'), // Insert into
40
+    "'{$newid}', evtid, priority", $modx->getDatabase()->getFullTableName('site_plugin_events'), "pluginid='{$id}'"); // Copy from
41 41
 
42 42
 // Set the item name for logger
43 43
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_plugins'), "id='{$newid}'"));
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  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('new_plugin')) {
5
+if (!$modx->hasPermission('new_plugin')) {
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->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate Plugin
@@ -44,5 +44,5 @@  discard block
 block discarded – undo
44 44
 $_SESSION['itemname'] = $name;
45 45
 
46 46
 // finish duplicating - redirect to new plugin
47
-$header="Location: index.php?r=2&a=102&id=$newid";
47
+$header = "Location: index.php?r=2&a=102&id=$newid";
48 48
 header($header);
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,11 @@
 block discarded – undo
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
18
-else $count = '';
17
+if($count>=1) {
18
+    $count = ' '.($count+1);
19
+} else {
20
+    $count = '';
21
+}
19 22
 
20 23
 // duplicate Plugin
21 24
 $newid = $modx->getDatabase()->insert(
Please login to merge, or discard this patch.
manager/processors/delete_content.processor.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /*******ищем родителя чтобы к нему вернуться********/
15
-$content=$modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************ а заодно и путь возврата (сам путь внизу файла) **********/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /*****************************/
25 25
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                             "children"=>$children
46 46
                         ));
47 47
 
48
-if (count($children)>0) {
48
+if (count($children) > 0) {
49 49
     $modx->getDatabase()->update(
50 50
         array(
51 51
             'deleted'   => 1,
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
         ), $modx->getDatabase()->getFullTableName('site_content'), "id IN (".implode(", ", $children).")");
55 55
 }
56 56
 
57
-if ($site_start==$id) {
57
+if ($site_start == $id) {
58 58
     $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!");
59 59
 }
60 60
 
61
-if ($site_unavailable_page==$id) {
61
+if ($site_unavailable_page == $id) {
62 62
     $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!");
63 63
 }
64 64
 
65
-if ($error_page==$id) {
65
+if ($error_page == $id) {
66 66
     $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!");
67 67
 }
68 68
 
69
-if ($unauthorized_page==$id) {
69
+if ($unauthorized_page == $id) {
70 70
     $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!");
71 71
 }
72 72
 
@@ -92,5 +92,5 @@  discard block
 block discarded – undo
92 92
 $modx->clearCache('full');
93 93
 
94 94
 // finished emptying cache - redirect
95
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
95
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
96 96
 header($header);
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
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->getDatabase()->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getDatabase()->getFullTableName("site_module_access")." sma
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -3,51 +3,51 @@
 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('exec_module')) {
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
 // check if user has access permission, except admins
15 15
 if($_SESSION['mgrRole']!=1){
16
-	$rs = $modx->getDatabase()->select(
17
-		'sma.usergroup,mg.member',
18
-		$modx->getDatabase()->getFullTableName("site_module_access")." sma
16
+    $rs = $modx->getDatabase()->select(
17
+        'sma.usergroup,mg.member',
18
+        $modx->getDatabase()->getFullTableName("site_module_access")." sma
19 19
 			LEFT JOIN ".$modx->getDatabase()->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'",
20
-		"sma.module = '{$id}'"
21
-		);
22
-	//initialize permission to -1, if it stays -1 no permissions
23
-	//attached so permission granted
24
-	$permissionAccessInt = -1;
20
+        "sma.module = '{$id}'"
21
+        );
22
+    //initialize permission to -1, if it stays -1 no permissions
23
+    //attached so permission granted
24
+    $permissionAccessInt = -1;
25 25
 
26
-	while ($row = $modx->getDatabase()->getRow($rs)) {
27
-		if($row["usergroup"] && $row["member"]) {
28
-			//if there are permissions and this member has permission, ofcourse
29
-			//this is granted
30
-			$permissionAccessInt = 1;
31
-		} elseif ($permissionAccessInt==-1) {
32
-			//if there are permissions but this member has no permission and the
33
-			//variable was still in init state we set permission to 0; no permissions
34
-			$permissionAccessInt = 0;
35
-		}
36
-	}
26
+    while ($row = $modx->getDatabase()->getRow($rs)) {
27
+        if($row["usergroup"] && $row["member"]) {
28
+            //if there are permissions and this member has permission, ofcourse
29
+            //this is granted
30
+            $permissionAccessInt = 1;
31
+        } elseif ($permissionAccessInt==-1) {
32
+            //if there are permissions but this member has no permission and the
33
+            //variable was still in init state we set permission to 0; no permissions
34
+            $permissionAccessInt = 0;
35
+        }
36
+    }
37 37
 
38
-	if($permissionAccessInt==0) {
39
-		$modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40
-	}
38
+    if($permissionAccessInt==0) {
39
+        $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106");
40
+    }
41 41
 }
42 42
 
43 43
 // get module data
44 44
 $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName("site_modules"), "id='{$id}'");
45 45
 $content = $modx->getDatabase()->getRow($rs);
46 46
 if(!$content) {
47
-	$modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
47
+    $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
48 48
 }
49 49
 if($content['disabled']) {
50
-	$modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
50
+    $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
51 51
 }
52 52
 
53 53
 // Set the item name for logger
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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('exec_module')) {
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->getDatabase()->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getDatabase()->getFullTableName("site_module_access")." sma
@@ -24,18 +24,18 @@  discard block
 block discarded – undo
24 24
 	$permissionAccessInt = -1;
25 25
 
26 26
 	while ($row = $modx->getDatabase()->getRow($rs)) {
27
-		if($row["usergroup"] && $row["member"]) {
27
+		if ($row["usergroup"] && $row["member"]) {
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
 }
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
43 43
 // get module data
44 44
 $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName("site_modules"), "id='{$id}'");
45 45
 $content = $modx->getDatabase()->getRow($rs);
46
-if(!$content) {
46
+if (!$content) {
47 47
 	$modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106");
48 48
 }
49
-if($content['disabled']) {
49
+if ($content['disabled']) {
50 50
 	$modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106");
51 51
 }
52 52
 
Please login to merge, or discard this patch.
manager/processors/save_role.processor.php 2 patches
Indentation   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -1,135 +1,135 @@
 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('save_role')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 extract($_POST);
10 10
 
11 11
 if($name == '' || !isset ($name)) {
12
-	$modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : ""));
12
+    $modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : ""));
13 13
 }
14 14
 
15 15
 // setup fields
16 16
 $fields = array(
17
-	'name' => $name,
18
-	'description' => $description,
19
-	'frames' => $frames,
20
-	'home' => $home,
21
-	'view_document' => $view_document,
22
-	'new_document' => $new_document,
23
-	'save_document' => $save_document,
24
-	'publish_document' => $publish_document,
25
-	'delete_document' => $delete_document,
26
-	'empty_trash' => $empty_trash,
27
-	'action_ok' => $action_ok,
28
-	'logout' => $logout,
29
-	'help' => $help,
30
-	'messages' => $messages,
31
-	'new_user' => $new_user,
32
-	'edit_user' => $edit_user,
33
-	'logs' => $logs,
34
-	'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0',
35
-	'save_parser' => (isset ($save_parser)) ? $save_parser : '0',
36
-	'edit_template' => $edit_template,
37
-	'settings' => $settings,
38
-	'credits' => $credits,
39
-	'new_template' => $new_template,
40
-	'save_template' => $save_template,
41
-	'delete_template' => $delete_template,
42
-	'edit_snippet' => $edit_snippet,
43
-	'new_snippet' => $new_snippet,
44
-	'save_snippet' => $save_snippet,
45
-	'delete_snippet' => $delete_snippet,
46
-	'edit_chunk' => $edit_chunk,
47
-	'new_chunk' => $new_chunk,
48
-	'save_chunk' => $save_chunk,
49
-	'delete_chunk' => $delete_chunk,
50
-	'empty_cache' => $empty_cache,
51
-	'edit_document' => $edit_document,
52
-	'change_password' => $change_password,
53
-	'error_dialog' => $error_dialog,
54
-	'about' => $about,
55
-	'file_manager' => $file_manager,
56
-	'assets_files' => $assets_files,
57
-	'assets_images' => $assets_images,
58
-	'save_user' => $save_user,
59
-	'delete_user' => $delete_user,
60
-	'save_password' => $save_password,
61
-	'edit_role' => $edit_role,
62
-	'save_role' => $save_role,
63
-	'delete_role' => $delete_role,
64
-	'new_role' => $new_role,
65
-	'access_permissions' => $access_permissions,
66
-	'bk_manager' => $bk_manager,
67
-	'new_plugin' => $new_plugin,
68
-	'edit_plugin' => $edit_plugin,
69
-	'save_plugin' => $save_plugin,
70
-	'delete_plugin' => $delete_plugin,
71
-	'new_module' => $new_module,
72
-	'edit_module' => $edit_module,
73
-	'save_module' => $save_module,
74
-	'delete_module' => $delete_module,
75
-	'exec_module' => $exec_module,
76
-	'view_eventlog' => $view_eventlog,
77
-	'delete_eventlog' => $delete_eventlog,
78
-	'new_web_user' => $new_web_user,
79
-	'edit_web_user' => $edit_web_user,
80
-	'save_web_user' => $save_web_user,
81
-	'delete_web_user' => $delete_web_user,
82
-	'web_access_permissions' => $web_access_permissions,
83
-	'view_unpublished' => $view_unpublished,
84
-	'import_static' => $import_static,
85
-	'export_static' => $export_static,
86
-	'remove_locks' => $remove_locks,
87
-	'display_locks' => $display_locks,
88
-	'change_resourcetype' => $change_resourcetype,
89
-	'category_manager' => $category_manager
17
+    'name' => $name,
18
+    'description' => $description,
19
+    'frames' => $frames,
20
+    'home' => $home,
21
+    'view_document' => $view_document,
22
+    'new_document' => $new_document,
23
+    'save_document' => $save_document,
24
+    'publish_document' => $publish_document,
25
+    'delete_document' => $delete_document,
26
+    'empty_trash' => $empty_trash,
27
+    'action_ok' => $action_ok,
28
+    'logout' => $logout,
29
+    'help' => $help,
30
+    'messages' => $messages,
31
+    'new_user' => $new_user,
32
+    'edit_user' => $edit_user,
33
+    'logs' => $logs,
34
+    'edit_parser' => (isset ($edit_parser)) ? $edit_parser : '0',
35
+    'save_parser' => (isset ($save_parser)) ? $save_parser : '0',
36
+    'edit_template' => $edit_template,
37
+    'settings' => $settings,
38
+    'credits' => $credits,
39
+    'new_template' => $new_template,
40
+    'save_template' => $save_template,
41
+    'delete_template' => $delete_template,
42
+    'edit_snippet' => $edit_snippet,
43
+    'new_snippet' => $new_snippet,
44
+    'save_snippet' => $save_snippet,
45
+    'delete_snippet' => $delete_snippet,
46
+    'edit_chunk' => $edit_chunk,
47
+    'new_chunk' => $new_chunk,
48
+    'save_chunk' => $save_chunk,
49
+    'delete_chunk' => $delete_chunk,
50
+    'empty_cache' => $empty_cache,
51
+    'edit_document' => $edit_document,
52
+    'change_password' => $change_password,
53
+    'error_dialog' => $error_dialog,
54
+    'about' => $about,
55
+    'file_manager' => $file_manager,
56
+    'assets_files' => $assets_files,
57
+    'assets_images' => $assets_images,
58
+    'save_user' => $save_user,
59
+    'delete_user' => $delete_user,
60
+    'save_password' => $save_password,
61
+    'edit_role' => $edit_role,
62
+    'save_role' => $save_role,
63
+    'delete_role' => $delete_role,
64
+    'new_role' => $new_role,
65
+    'access_permissions' => $access_permissions,
66
+    'bk_manager' => $bk_manager,
67
+    'new_plugin' => $new_plugin,
68
+    'edit_plugin' => $edit_plugin,
69
+    'save_plugin' => $save_plugin,
70
+    'delete_plugin' => $delete_plugin,
71
+    'new_module' => $new_module,
72
+    'edit_module' => $edit_module,
73
+    'save_module' => $save_module,
74
+    'delete_module' => $delete_module,
75
+    'exec_module' => $exec_module,
76
+    'view_eventlog' => $view_eventlog,
77
+    'delete_eventlog' => $delete_eventlog,
78
+    'new_web_user' => $new_web_user,
79
+    'edit_web_user' => $edit_web_user,
80
+    'save_web_user' => $save_web_user,
81
+    'delete_web_user' => $delete_web_user,
82
+    'web_access_permissions' => $web_access_permissions,
83
+    'view_unpublished' => $view_unpublished,
84
+    'import_static' => $import_static,
85
+    'export_static' => $export_static,
86
+    'remove_locks' => $remove_locks,
87
+    'display_locks' => $display_locks,
88
+    'change_resourcetype' => $change_resourcetype,
89
+    'category_manager' => $category_manager
90 90
 );
91 91
 
92 92
 $fields = $modx->getDatabase()->escape($fields);
93 93
 
94 94
 switch($_POST['mode']) {
95
-	case '38' :
96
-		$tbl = $modx->getDatabase()->getFullTableName("user_roles");
95
+    case '38' :
96
+        $tbl = $modx->getDatabase()->getFullTableName("user_roles");
97 97
 
98
-		// disallow duplicate names for role
99
-		$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}'");
100
-		if($modx->getDatabase()->getValue($rs) > 0) {
101
-			$modx->getManagerApi()->saveFormValues(38);
102
-			$modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38");
103
-		}
98
+        // disallow duplicate names for role
99
+        $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}'");
100
+        if($modx->getDatabase()->getValue($rs) > 0) {
101
+            $modx->getManagerApi()->saveFormValues(38);
102
+            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38");
103
+        }
104 104
 
105
-		$modx->getDatabase()->insert($fields, $tbl);
105
+        $modx->getDatabase()->insert($fields, $tbl);
106 106
 
107
-		// Set the item name for logger
108
-		$_SESSION['itemname'] = $_POST['name'];
107
+        // Set the item name for logger
108
+        $_SESSION['itemname'] = $_POST['name'];
109 109
 
110
-		$header = "Location: index.php?a=86&r=2";
111
-		header($header);
112
-		break;
113
-	case '35' :
114
-		$tbl = $modx->getDatabase()->getFullTableName("user_roles");
110
+        $header = "Location: index.php?a=86&r=2";
111
+        header($header);
112
+        break;
113
+    case '35' :
114
+        $tbl = $modx->getDatabase()->getFullTableName("user_roles");
115 115
 
116
-		// disallow duplicate names for role
117
-		$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'");
118
-		if($modx->getDatabase()->getValue($rs) > 0) {
119
-			$modx->getManagerApi()->saveFormValues(35);
120
-			$modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}");
121
-		}
116
+        // disallow duplicate names for role
117
+        $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'");
118
+        if($modx->getDatabase()->getValue($rs) > 0) {
119
+            $modx->getManagerApi()->saveFormValues(35);
120
+            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}");
121
+        }
122 122
 
123
-		$modx->getDatabase()->update($fields, $tbl, "id='{$id}'");
123
+        $modx->getDatabase()->update($fields, $tbl, "id='{$id}'");
124 124
 
125
-		// Set the item name for logger
126
-		$_SESSION['itemname'] = $_POST['name'];
125
+        // Set the item name for logger
126
+        $_SESSION['itemname'] = $_POST['name'];
127 127
 
128
-		$header = "Location: index.php?a=86&r=2";
129
-		header($header);
130
-		break;
131
-	default :
132
-		$modx->webAlertAndQuit("No operation set in request.");
128
+        $header = "Location: index.php?a=86&r=2";
129
+        header($header);
130
+        break;
131
+    default :
132
+        $modx->webAlertAndQuit("No operation set in request.");
133 133
 }
134 134
 
135 135
 $modx->unlockElement(8, $id);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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_role')) {
5
+if (!$modx->hasPermission('save_role')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 extract($_POST);
10 10
 
11
-if($name == '' || !isset ($name)) {
12
-	$modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}" . ($mode = 35 ? "&id={$id}" : ""));
11
+if ($name == '' || !isset ($name)) {
12
+	$modx->webAlertAndQuit("Please enter a name for this role!", "index.php?a={$mode}".($mode = 35 ? "&id={$id}" : ""));
13 13
 }
14 14
 
15 15
 // setup fields
@@ -91,13 +91,13 @@  discard block
 block discarded – undo
91 91
 
92 92
 $fields = $modx->getDatabase()->escape($fields);
93 93
 
94
-switch($_POST['mode']) {
94
+switch ($_POST['mode']) {
95 95
 	case '38' :
96 96
 		$tbl = $modx->getDatabase()->getFullTableName("user_roles");
97 97
 
98 98
 		// disallow duplicate names for role
99 99
 		$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}'");
100
-		if($modx->getDatabase()->getValue($rs) > 0) {
100
+		if ($modx->getDatabase()->getValue($rs) > 0) {
101 101
 			$modx->getManagerApi()->saveFormValues(38);
102 102
 			$modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=38");
103 103
 		}
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
 		// disallow duplicate names for role
117 117
 		$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_roles'), "name='{$fields['name']}' AND id!='{$id}'");
118
-		if($modx->getDatabase()->getValue($rs) > 0) {
118
+		if ($modx->getDatabase()->getValue($rs) > 0) {
119 119
 			$modx->getManagerApi()->saveFormValues(35);
120 120
 			$modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['role'], $name), "index.php?a=35&id={$id}");
121 121
 		}
Please login to merge, or discard this patch.
manager/processors/delete_role.processor.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -3,22 +3,22 @@
 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_role')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 if($id==1){
15
-	$modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!");
15
+    $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!");
16 16
 }
17 17
 
18 18
 $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$id}'");
19 19
 $count=$modx->getDatabase()->getValue($rs);
20 20
 if($count>0){
21
-	$modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
21
+    $modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
22 22
 }
23 23
 
24 24
 // Set the item name for logger
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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
-if(!$modx->hasPermission('delete_role')) {
5
+if (!$modx->hasPermission('delete_role')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14
-if($id==1){
14
+if ($id == 1) {
15 15
 	$modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!");
16 16
 }
17 17
 
18 18
 $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$id}'");
19
-$count=$modx->getDatabase()->getValue($rs);
20
-if($count>0){
19
+$count = $modx->getDatabase()->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->getDatabase()->delete($modx->getDatabase()->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.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
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->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$id}'");
19 19
 $count=$modx->getDatabase()->getValue($rs);
20
-if($count>0){
20
+if($count>0) {
21 21
 	$modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
22 22
 }
23 23
 
Please login to merge, or discard this patch.
manager/processors/empty_table.processor.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 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('settings')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('manager_log'));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 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('settings')) {
5
+if (!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $modx->getDatabase()->truncate($modx->getDatabase()->getFullTableName('manager_log'));
10 10
 
11
-$header="Location: index.php?a=13";
11
+$header = "Location: index.php?a=13";
12 12
 header($header);
Please login to merge, or discard this patch.
manager/processors/undelete_content.processor.php 2 patches
Indentation   +15 added lines, -15 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_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 ********/
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33 33
 if(!$udperms->checkPermissions()) {
34
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
34
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->getDatabase()->select('deletedon', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->getDatabase()->getValue($rs);
40 40
 if(!$deltime) {
41
-	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
41
+    $modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
44 44
 $children = array();
@@ -46,20 +46,20 @@  discard block
 block discarded – undo
46 46
 getChildrenForUnDelete($id);
47 47
 
48 48
 if(count($children)>0) {
49
-	$modx->getDatabase()->update(
50
-		array(
51
-			'deleted'   => 0,
52
-			'deletedby' => 0,
53
-			'deletedon' => 0,
54
-		), $modx->getDatabase()->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
49
+    $modx->getDatabase()->update(
50
+        array(
51
+            'deleted'   => 0,
52
+            'deletedby' => 0,
53
+            'deletedon' => 0,
54
+        ), $modx->getDatabase()->getFullTableName('site_content'), "id IN(".implode(", ", $children).")");
55 55
 }
56 56
 //'undelete' the document.
57 57
 $modx->getDatabase()->update(
58
-	array(
59
-		'deleted'   => 0,
60
-		'deletedby' => 0,
61
-		'deletedon' => 0,
62
-	), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'");
58
+    array(
59
+        'deleted'   => 0,
60
+        'deletedby' => 0,
61
+        'deletedon' => 0,
62
+    ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'");
63 63
 
64 64
 $modx->invokeEvent("OnDocFormUnDelete",
65 65
     array(
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  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_document')) {
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->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getDatabase()->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
 
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
 $udperms->document = $id;
31 31
 $udperms->role = $_SESSION['mgrRole'];
32 32
 
33
-if(!$udperms->checkPermissions()) {
33
+if (!$udperms->checkPermissions()) {
34 34
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
35 35
 }
36 36
 
37 37
 // get the timestamp on which the document was deleted.
38 38
 $rs = $modx->getDatabase()->select('deletedon', $modx->getDatabase()->getFullTableName('site_content'), "id='{$id}' AND deleted=1");
39 39
 $deltime = $modx->getDatabase()->getValue($rs);
40
-if(!$deltime) {
40
+if (!$deltime) {
41 41
 	$modx->webAlertAndQuit("Couldn't find document to determine it's date of deletion!");
42 42
 }
43 43
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 getChildrenForUnDelete($id);
47 47
 
48
-if(count($children)>0) {
48
+if (count($children) > 0) {
49 49
 	$modx->getDatabase()->update(
50 50
 		array(
51 51
 			'deleted'   => 0,
@@ -74,5 +74,5 @@  discard block
 block discarded – undo
74 74
 $modx->clearCache('full');
75 75
 
76 76
 // finished emptying cache - redirect
77
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
77
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
78 78
 header($header);
Please login to merge, or discard this patch.