Completed
Push — develop ( 6a553b...48041c )
by Agel_Nash
06:37
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/duplicate_tmplvars.processor.php 3 patches
Indentation   +26 added lines, -26 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('edit_template')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (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,37 +19,37 @@  discard block
 block discarded – undo
19 19
 
20 20
 // duplicate TV
21 21
 $newid = $modx->getDatabase()->insert(
22
-	array(
23
-		'type'=>'',
24
-		'name'=>'',
25
-		'caption'=>'',
26
-		'description'=>'',
27
-		'default_text'=>'',
28
-		'elements'=>'',
29
-		'rank'=>'',
30
-		'display'=>'',
31
-		'display_params'=>'',
32
-		'category'=>'',
33
-		), $modx->getDatabase()->getFullTableName('site_tmplvars'), // Insert into
34
-	"type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from
22
+    array(
23
+        'type'=>'',
24
+        'name'=>'',
25
+        'caption'=>'',
26
+        'description'=>'',
27
+        'default_text'=>'',
28
+        'elements'=>'',
29
+        'rank'=>'',
30
+        'display'=>'',
31
+        'display_params'=>'',
32
+        'category'=>'',
33
+        ), $modx->getDatabase()->getFullTableName('site_tmplvars'), // Insert into
34
+    "type, CONCAT(name, ' {$_lang['duplicated_el_suffix']}{$count}') AS name, CONCAT(caption, ' Duplicate{$count}') AS caption, description, default_text, elements, rank, display, display_params, category", $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from
35 35
 
36 36
 
37 37
 // duplicate TV Template Access Permissions
38 38
 $modx->getDatabase()->insert(
39
-	array(
40
-		'tmplvarid'=>'',
41
-		'templateid'=>'',
42
-		'rank'=>'',
43
-		), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
44
-	"'{$newid}', templateid, rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
39
+    array(
40
+        'tmplvarid'=>'',
41
+        'templateid'=>'',
42
+        'rank'=>'',
43
+        ), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), // Insert into
44
+    "'{$newid}', templateid, rank", $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
45 45
 
46 46
 // duplicate TV Access Permissions
47 47
 $modx->getDatabase()->insert(
48
-	array(
49
-		'tmplvarid'=>'',
50
-		'documentgroup'=>'',
51
-		), $modx->getDatabase()->getFullTableName('site_tmplvar_access'), // Insert into
52
-	"'{$newid}', documentgroup", $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
48
+    array(
49
+        'tmplvarid'=>'',
50
+        'documentgroup'=>'',
51
+        ), $modx->getDatabase()->getFullTableName('site_tmplvar_access'), // Insert into
52
+    "'{$newid}', documentgroup", $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
53 53
 
54 54
 // Set the item name for logger
55 55
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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('edit_template')) {
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->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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 TV
@@ -56,5 +56,5 @@  discard block
 block discarded – undo
56 56
 $_SESSION['itemname'] = $name;
57 57
 
58 58
 // finish duplicating - redirect to new variable
59
-$header="Location: index.php?r=2&a=301&id=$newid";
59
+$header = "Location: index.php?r=2&a=301&id=$newid";
60 60
 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_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getDatabase()->getFullTableName('site_tmplvars'), "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 TV
21 24
 $newid = $modx->getDatabase()->insert(
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
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -3,51 +3,51 @@  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('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
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 $output = evalModule($content["modulecode"],$parameter);
64 64
 if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) {
65
-	echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller
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 68
 include MODX_MANAGER_PATH."includes/sysalert.display.inc.php";
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 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
 
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 $_SESSION['itemname'] = $content['name'];
61 61
 
62 62
 
63
-$output = evalModule($content["modulecode"],$parameter);
64
-if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) {
63
+$output = evalModule($content["modulecode"], $parameter);
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;
Please login to merge, or discard this patch.
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.
manager/processors/move_document.processor.php 3 patches
Indentation   +48 added lines, -48 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('edit_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0;
@@ -25,68 +25,68 @@  discard block
 block discarded – undo
25 25
 // check user has permission to move document to chosen location
26 26
 
27 27
 if ($use_udperms == 1) {
28
-	if ($oldparent != $newParentID) {
29
-		$udperms = new EvolutionCMS\Legacy\Permissions();
30
-		$udperms->user = $modx->getLoginUserID();
31
-		$udperms->document = $newParentID;
32
-		$udperms->role = $_SESSION['mgrRole'];
28
+    if ($oldparent != $newParentID) {
29
+        $udperms = new EvolutionCMS\Legacy\Permissions();
30
+        $udperms->user = $modx->getLoginUserID();
31
+        $udperms->document = $newParentID;
32
+        $udperms->role = $_SESSION['mgrRole'];
33 33
 
34
-		 if (!$udperms->checkPermissions()) {
35
-			$modx->webAlertAndQuit($_lang["access_permission_parent_denied"]);
36
-		 }
37
-	}
34
+            if (!$udperms->checkPermissions()) {
35
+            $modx->webAlertAndQuit($_lang["access_permission_parent_denied"]);
36
+            }
37
+    }
38 38
 }
39 39
 
40 40
 $evtOut = $modx->invokeEvent("onBeforeMoveDocument", array (
41
-	"id_document" => $documentID,
42
-	"old_parent" => $oldparent,
43
-	"new_parent" => $newParentID
41
+    "id_document" => $documentID,
42
+    "old_parent" => $oldparent,
43
+    "new_parent" => $newParentID
44 44
 ));
45 45
 if (is_array($evtOut) && count($evtOut) > 0){
46
-	$newParent = array_pop($evtOut);
47
-	if($newParent == $oldparent) {
48
-		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
-	}else{
50
-		$newParentID = $newParent;
51
-	}
46
+    $newParent = array_pop($evtOut);
47
+    if($newParent == $oldparent) {
48
+        $modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
+    }else{
50
+        $newParentID = $newParent;
51
+    }
52 52
 }
53 53
 
54 54
 $children = allChildren($documentID);
55 55
 if (!array_search($newParentID, $children)) {
56
-	$modx->getDatabase()->update(array(
57
-		'isfolder' => 1,
58
-	), $modx->getDatabase()->getFullTableName('site_content'), "id='{$newParentID}'");
56
+    $modx->getDatabase()->update(array(
57
+        'isfolder' => 1,
58
+    ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$newParentID}'");
59 59
 
60
-	$modx->getDatabase()->update(array(
61
-		'parent'   => $newParentID,
62
-		'editedby' => $modx->getLoginUserID(),
63
-		'editedon' => time(),
64
-	), $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'");
60
+    $modx->getDatabase()->update(array(
61
+        'parent'   => $newParentID,
62
+        'editedby' => $modx->getLoginUserID(),
63
+        'editedon' => time(),
64
+    ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'");
65 65
 
66
-	// finished moving the document, now check to see if the old_parent should no longer be a folder.
67
-	$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('site_content'), "parent='{$oldparent}'");
68
-	$limit = $modx->getDatabase()->getValue($rs);
66
+    // finished moving the document, now check to see if the old_parent should no longer be a folder.
67
+    $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('site_content'), "parent='{$oldparent}'");
68
+    $limit = $modx->getDatabase()->getValue($rs);
69 69
 
70
-	if(!$limit>0) {
71
-		$modx->getDatabase()->update(array(
72
-			'isfolder' => 0,
73
-		), $modx->getDatabase()->getFullTableName('site_content'), "id='{$oldparent}'");
74
-	}
75
-	// Set the item name for logger
76
-	$pagetitle = $modx->getDatabase()->getValue($modx->getDatabase()->select('pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'"));
77
-	$_SESSION['itemname'] = $pagetitle;
70
+    if(!$limit>0) {
71
+        $modx->getDatabase()->update(array(
72
+            'isfolder' => 0,
73
+        ), $modx->getDatabase()->getFullTableName('site_content'), "id='{$oldparent}'");
74
+    }
75
+    // Set the item name for logger
76
+    $pagetitle = $modx->getDatabase()->getValue($modx->getDatabase()->select('pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'"));
77
+    $_SESSION['itemname'] = $pagetitle;
78 78
 
79
-	$modx->invokeEvent("onAfterMoveDocument", array (
80
-		"id_document" => $documentID,
81
-		"old_parent" => $oldparent,
82
-		"new_parent" => $newParentID
83
-	));
79
+    $modx->invokeEvent("onAfterMoveDocument", array (
80
+        "id_document" => $documentID,
81
+        "old_parent" => $oldparent,
82
+        "new_parent" => $newParentID
83
+    ));
84 84
 
85
-	// empty cache & sync site
86
-	$modx->clearCache('full');
85
+    // empty cache & sync site
86
+    $modx->clearCache('full');
87 87
 
88
-	$header="Location: index.php?a=3&id={$documentID}&r=9";
89
-	header($header);
88
+    $header="Location: index.php?a=3&id={$documentID}&r=9";
89
+    header($header);
90 90
 } else {
91
-	$modx->webAlertAndQuit("You cannot move a document to a child document!");
91
+    $modx->webAlertAndQuit("You cannot move a document to a child document!");
92 92
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 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('edit_document')) {
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) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
16
-if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
17
-if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
15
+if ($documentID == $newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
16
+if ($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
17
+if ($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
18 18
 
19 19
 $parents = $modx->getParentIds($newParentID);
20 20
 if (in_array($documentID, $parents))  $modx->webAlertAndQuit($_lang["error_movedocument2"]);
@@ -37,16 +37,16 @@  discard block
 block discarded – undo
37 37
 	}
38 38
 }
39 39
 
40
-$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array (
40
+$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array(
41 41
 	"id_document" => $documentID,
42 42
 	"old_parent" => $oldparent,
43 43
 	"new_parent" => $newParentID
44 44
 ));
45
-if (is_array($evtOut) && count($evtOut) > 0){
45
+if (is_array($evtOut) && count($evtOut) > 0) {
46 46
 	$newParent = array_pop($evtOut);
47
-	if($newParent == $oldparent) {
47
+	if ($newParent == $oldparent) {
48 48
 		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
-	}else{
49
+	} else {
50 50
 		$newParentID = $newParent;
51 51
 	}
52 52
 }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('site_content'), "parent='{$oldparent}'");
68 68
 	$limit = $modx->getDatabase()->getValue($rs);
69 69
 
70
-	if(!$limit>0) {
70
+	if (!$limit > 0) {
71 71
 		$modx->getDatabase()->update(array(
72 72
 			'isfolder' => 0,
73 73
 		), $modx->getDatabase()->getFullTableName('site_content'), "id='{$oldparent}'");
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	$pagetitle = $modx->getDatabase()->getValue($modx->getDatabase()->select('pagetitle', $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'"));
77 77
 	$_SESSION['itemname'] = $pagetitle;
78 78
 
79
-	$modx->invokeEvent("onAfterMoveDocument", array (
79
+	$modx->invokeEvent("onAfterMoveDocument", array(
80 80
 		"id_document" => $documentID,
81 81
 		"old_parent" => $oldparent,
82 82
 		"new_parent" => $newParentID
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	// empty cache & sync site
86 86
 	$modx->clearCache('full');
87 87
 
88
-	$header="Location: index.php?a=3&id={$documentID}&r=9";
88
+	$header = "Location: index.php?a=3&id={$documentID}&r=9";
89 89
 	header($header);
90 90
 } else {
91 91
 	$modx->webAlertAndQuit("You cannot move a document to a child document!");
Please login to merge, or discard this patch.
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,12 +12,20 @@  discard block
 block discarded – undo
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) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
16
-if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
17
-if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
15
+if($documentID==$newParentID) {
16
+    $modx->webAlertAndQuit($_lang["error_movedocument1"]);
17
+}
18
+if($documentID <= 0) {
19
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
20
+}
21
+if($newParentID < 0) {
22
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
23
+}
18 24
 
19 25
 $parents = $modx->getParentIds($newParentID);
20
-if (in_array($documentID, $parents))  $modx->webAlertAndQuit($_lang["error_movedocument2"]);
26
+if (in_array($documentID, $parents)) {
27
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
28
+}
21 29
 
22 30
 $rs = $modx->getDatabase()->select('parent', $modx->getDatabase()->getFullTableName('site_content'), "id='{$documentID}'");
23 31
 $oldparent = $modx->getDatabase()->getValue($rs);
@@ -42,11 +50,11 @@  discard block
 block discarded – undo
42 50
 	"old_parent" => $oldparent,
43 51
 	"new_parent" => $newParentID
44 52
 ));
45
-if (is_array($evtOut) && count($evtOut) > 0){
53
+if (is_array($evtOut) && count($evtOut) > 0) {
46 54
 	$newParent = array_pop($evtOut);
47 55
 	if($newParent == $oldparent) {
48 56
 		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
49
-	}else{
57
+	} else {
50 58
 		$newParentID = $newParent;
51 59
 	}
52 60
 }
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.