Completed
Push — develop ( dd48c1...053968 )
by Maxim
06:38 queued 01:16
created
manager/processors/delete_template.processor.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_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
 // delete the template, but first check it doesn't have any documents using it
15 15
 $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->db->getRecordCount($rs);
17 17
 if($limit > 0) {
18
-	include "header.inc.php";
19
-	?>
18
+    include "header.inc.php";
19
+    ?>
20 20
 
21 21
 	<h1><?php echo $_lang['manage_templates']; ?></h1>
22 22
 
@@ -28,20 +28,20 @@  discard block
 block discarded – undo
28 28
 			<p>Documents using this template:</p>
29 29
 			<ul>
30 30
 				<?php
31
-				while($row = $modx->db->getRow($rs)) {
32
-					echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
-				}
34
-				?>
31
+                while($row = $modx->db->getRow($rs)) {
32
+                    echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
33
+                }
34
+                ?>
35 35
 			</ul>
36 36
 		</div>
37 37
 	</div>
38 38
 	<?php
39
-	include_once "footer.inc.php";
40
-	exit;
39
+    include_once "footer.inc.php";
40
+    exit;
41 41
 }
42 42
 
43 43
 if($id == $default_template) {
44
-	$modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
44
+    $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
45 45
 }
46 46
 
47 47
 // Set the item name for logger
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 
51 51
 // invoke OnBeforeTempFormDelete event
52 52
 $modx->invokeEvent("OnBeforeTempFormDelete", array(
53
-		"id" => $id
54
-	));
53
+        "id" => $id
54
+    ));
55 55
 
56 56
 // delete the document.
57 57
 $modx->db->delete($modx->getFullTableName('site_templates'), "id='{$id}'");
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
 // invoke OnTempFormDelete event
62 62
 $modx->invokeEvent("OnTempFormDelete", array(
63
-		"id" => $id
64
-	));
63
+        "id" => $id
64
+    ));
65 65
 
66 66
 // empty cache
67 67
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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('delete_template')) {
5
+if (!$modx->hasPermission('delete_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
 // delete the template, but first check it doesn't have any documents using it
15 15
 $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->db->getRecordCount($rs);
17
-if($limit > 0) {
17
+if ($limit > 0) {
18 18
 	include "header.inc.php";
19 19
 	?>
20 20
 
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 			<p>Documents using this template:</p>
29 29
 			<ul>
30 30
 				<?php
31
-				while($row = $modx->db->getRow($rs)) {
32
-					echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>';
31
+				while ($row = $modx->db->getRow($rs)) {
32
+					echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>';
33 33
 				}
34 34
 				?>
35 35
 			</ul>
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	exit;
41 41
 }
42 42
 
43
-if($id == $default_template) {
43
+if ($id == $default_template) {
44 44
 	$modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template.");
45 45
 }
46 46
 
Please login to merge, or discard this patch.
manager/processors/delete_snippet.processor.php 2 patches
Indentation   +8 added lines, -8 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_snippet')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // Set the item name for logger
@@ -17,18 +17,18 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeSnipFormDelete event
19 19
 $modx->invokeEvent("OnBeforeSnipFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the snippet.
25 25
 $modx->db->delete($modx->getFullTableName('site_snippets'), "id='{$id}'");
26 26
 
27 27
 // invoke OnSnipFormDelete event
28 28
 $modx->invokeEvent("OnSnipFormDelete",
29
-	array(
30
-		"id"	=> $id
31
-	));
29
+    array(
30
+        "id"	=> $id
31
+    ));
32 32
 
33 33
 // empty cache
34 34
 $modx->clearCache('full');
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('delete_snippet')) {
5
+if (!$modx->hasPermission('delete_snippet')) {
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
 
@@ -34,5 +34,5 @@  discard block
 block discarded – undo
34 34
 $modx->clearCache('full');
35 35
 
36 36
 // finished emptying cache - redirect
37
-$header="Location: index.php?a=76&r=2";
37
+$header = "Location: index.php?a=76&r=2";
38 38
 header($header);
Please login to merge, or discard this patch.
manager/processors/optimize_table.processor.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,33 +3,33 @@
 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') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 if (isset($_REQUEST['t'])) {
10 10
 
11
-	if (empty($_REQUEST['t'])) {
12
-		$modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]);
13
-	}
11
+    if (empty($_REQUEST['t'])) {
12
+        $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]);
13
+    }
14 14
 
15
-	// Set the item name for logger
16
-	$_SESSION['itemname'] = $_REQUEST['t'];
15
+    // Set the item name for logger
16
+    $_SESSION['itemname'] = $_REQUEST['t'];
17 17
 
18
-	$modx->db->optimize($_REQUEST['t']);
18
+    $modx->db->optimize($_REQUEST['t']);
19 19
 
20 20
 } elseif (isset($_REQUEST['u'])) {
21 21
 
22
-	if (empty($_REQUEST['u'])) {
23
-		$modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]);
24
-	}
22
+    if (empty($_REQUEST['u'])) {
23
+        $modx->webAlertAndQuit($_lang["error_no_truncate_tablename"]);
24
+    }
25 25
 
26
-	// Set the item name for logger
27
-	$_SESSION['itemname'] = $_REQUEST['u'];
26
+    // Set the item name for logger
27
+    $_SESSION['itemname'] = $_REQUEST['u'];
28 28
 
29
-	$modx->db->truncate($_REQUEST['u']);
29
+    $modx->db->truncate($_REQUEST['u']);
30 30
 
31 31
 } else {
32
-	$modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]);
32
+    $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]);
33 33
 }
34 34
 
35 35
 $mode = (int)$_REQUEST['mode'];
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) {
5
+if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs') || $modx->hasPermission('bk_manager')))) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -32,6 +32,6 @@  discard block
 block discarded – undo
32 32
 	$modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]);
33 33
 }
34 34
 
35
-$mode = (int)$_REQUEST['mode'];
36
-$header="Location: index.php?a={$mode}&s=4";
35
+$mode = (int) $_REQUEST['mode'];
36
+$header = "Location: index.php?a={$mode}&s=4";
37 37
 header($header);
Please login to merge, or discard this patch.
manager/processors/remove_locks.processor.php 2 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->db->truncate($modx->getFullTableName('active_user_locks'));
9
+    // Remove all locks
10
+    $modx->db->truncate($modx->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->db->truncate($modx->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.
manager/processors/duplicate_tmplvars.processor.php 2 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->db->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->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->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->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->getFullTableName('site_tmplvars'), "id='{$id}'"); // Copy from
35 35
 
36 36
 
37 37
 // duplicate TV Template Access Permissions
38 38
 $modx->db->insert(
39
-	array(
40
-		'tmplvarid'=>'',
41
-		'templateid'=>'',
42
-		'rank'=>'',
43
-		), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
44
-	"'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
39
+    array(
40
+        'tmplvarid'=>'',
41
+        'templateid'=>'',
42
+        'rank'=>'',
43
+        ), $modx->getFullTableName('site_tmplvar_templates'), // Insert into
44
+    "'{$newid}', templateid, rank", $modx->getFullTableName('site_tmplvar_templates'), "tmplvarid='{$id}'"); // Copy from
45 45
 
46 46
 // duplicate TV Access Permissions
47 47
 $modx->db->insert(
48
-	array(
49
-		'tmplvarid'=>'',
50
-		'documentgroup'=>'',
51
-		), $modx->getFullTableName('site_tmplvar_access'), // Insert into
52
-	"'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
48
+    array(
49
+        'tmplvarid'=>'',
50
+        'documentgroup'=>'',
51
+        ), $modx->getFullTableName('site_tmplvar_access'), // Insert into
52
+    "'{$newid}', documentgroup", $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); // Copy from
53 53
 
54 54
 // Set the item name for logger
55 55
 $name = $modx->db->getValue($modx->db->select('name', $modx->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->db->getValue($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'"));
16 16
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $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.
manager/processors/delete_content.processor.php 1 patch
Spacing   +21 added lines, -21 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->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************ а заодно и путь возврата (сам путь внизу файла) **********/
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
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 $children = array();
28 28
 
29 29
 // check permissions on the document
30
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
30
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
31 31
 $udperms = new udperms();
32 32
 $udperms->user = $modx->getLoginUserID();
33 33
 $udperms->document = $id;
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 
49 49
     $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent={$parent} AND deleted=0");
50 50
         // the document has children documents, we'll need to delete those too
51
-        while ($childid=$modx->db->getValue($rs)) {
52
-            if ($childid==$site_start) {
51
+        while ($childid = $modx->db->getValue($rs)) {
52
+            if ($childid == $site_start) {
53 53
                 $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site start' document, and cannot be deleted. Please assign another document as your 'Site start' document and try again.");
54 54
             }
55
-            if ($childid==$site_unavailable_page) {
55
+            if ($childid == $site_unavailable_page) {
56 56
                 $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unavailable page' document, and cannot be deleted. Please assign another document as your 'Site unavailable page' document and try again.");
57 57
             }
58
-            if ($childid==$error_page) {
58
+            if ($childid == $error_page) {
59 59
                 $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site error page' document, and cannot be deleted. Please assign another document as your 'Site error page' document and try again.");
60 60
             }
61
-            if ($childid==$unauthorized_page) {
61
+            if ($childid == $unauthorized_page) {
62 62
                 $modx->webAlertAndQuit("The document you are trying to delete is a folder containing document {$childid}. This document is registered as the 'Site unauthorized page' document, and cannot be deleted. Please assign another document as your 'Site unauthorized page' document and try again.");
63 63
             }
64 64
             $children[] = $childid;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                             "children"=>$children
77 77
                         ));
78 78
 
79
-if (count($children)>0) {
79
+if (count($children) > 0) {
80 80
     $modx->db->update(
81 81
         array(
82 82
             'deleted'   => 1,
@@ -85,19 +85,19 @@  discard block
 block discarded – undo
85 85
         ), $modx->getFullTableName('site_content'), "id IN (".implode(", ", $children).")");
86 86
 }
87 87
 
88
-if ($site_start==$id) {
88
+if ($site_start == $id) {
89 89
     $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!");
90 90
 }
91 91
 
92
-if ($site_unavailable_page==$id) {
92
+if ($site_unavailable_page == $id) {
93 93
     $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!");
94 94
 }
95 95
 
96
-if ($error_page==$id) {
96
+if ($error_page == $id) {
97 97
     $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!");
98 98
 }
99 99
 
100
-if ($unauthorized_page==$id) {
100
+if ($unauthorized_page == $id) {
101 101
     $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!");
102 102
 }
103 103
 
@@ -123,5 +123,5 @@  discard block
 block discarded – undo
123 123
 $modx->clearCache('full');
124 124
 
125 125
 // finished emptying cache - redirect
126
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
126
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
127 127
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_role.processor.php 2 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->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'");
19 19
 $count=$modx->db->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->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'");
19
-$count=$modx->db->getValue($rs);
20
-if($count>0){
19
+$count = $modx->db->getValue($rs);
20
+if ($count > 0) {
21 21
 	$modx->webAlertAndQuit("There are users with this role. It can't be deleted.");
22 22
 }
23 23
 
@@ -28,5 +28,5 @@  discard block
 block discarded – undo
28 28
 // delete the attributes
29 29
 $modx->db->delete($modx->getFullTableName('user_roles'), "id='{$id}'");
30 30
 
31
-$header="Location: index.php?a=86";
31
+$header = "Location: index.php?a=86";
32 32
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_htmlsnippet.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('save_chunk')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $snippet = $modx->db->escape($_POST['post']);
11 11
 $name = $modx->db->escape(trim($_POST['name']));
12 12
 $description = $modx->db->escape($_POST['description']);
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 
17 17
 //Kyle Jaebker - added category support
18 18
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
19
-    $categoryid = (int)$_POST['categoryid'];
19
+    $categoryid = (int) $_POST['categoryid'];
20 20
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
21 21
     $categoryid = 0;
22 22
 } else {
23
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
23
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
24 24
     $categoryid = checkCategory($_POST['newcategory']);
25 25
     if (!$categoryid) {
26 26
         $categoryid = newCategory($_POST['newcategory']);
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         // finished emptying cache - redirect
81 81
         if ($_POST['stay'] != '') {
82 82
             $a = ($_POST['stay'] == '2') ? "78&id=$newid" : "77";
83
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
83
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
84 84
             header($header);
85 85
         } else {
86 86
             $header = "Location: index.php?a=76&r=2";
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         // finished emptying cache - redirect
130 130
         if ($_POST['stay'] != '') {
131 131
             $a = ($_POST['stay'] == '2') ? "78&id=$id" : "77";
132
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
132
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
133 133
             header($header);
134 134
         } else {
135 135
             $modx->unlockElement(3, $id);
Please login to merge, or discard this patch.
manager/processors/delete_tmplvars.processor.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,26 +1,26 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if(!$modx->hasPermission('delete_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
 $forced = isset($_GET['force']) ? $_GET['force'] : 0;
15 15
 
16 16
 // check for relations
17 17
 if(!$forced) {
18
-	$drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc
18
+    $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc
19 19
 			INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20
-	$count = $modx->db->getRecordCount($drs);
21
-	if($count > 0) {
22
-		include_once "header.inc.php";
23
-		?>
20
+    $count = $modx->db->getRecordCount($drs);
21
+    if($count > 0) {
22
+        include_once "header.inc.php";
23
+        ?>
24 24
 		<script>
25 25
 			var actions = {
26 26
 				delete: function() {
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
 				<p><?= $_lang['tmplvar_inuse'] ?></p>
43 43
 				<ul>
44 44
 					<?php
45
-					while($row = $modx->db->getRow($drs)) {
46
-						echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
-					}
48
-					?>
45
+                    while($row = $modx->db->getRow($drs)) {
46
+                        echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
47
+                    }
48
+                    ?>
49 49
 				</ul>
50 50
 			</div>
51 51
 		</div>
52 52
 		<?php
53
-		include_once "footer.inc.php";
54
-		exit;
55
-	}
53
+        include_once "footer.inc.php";
54
+        exit;
55
+    }
56 56
 }
57 57
 
58 58
 // Set the item name for logger
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
 // invoke OnBeforeTVFormDelete event
63 63
 $modx->invokeEvent("OnBeforeTVFormDelete", array(
64
-	"id" => $id
64
+    "id" => $id
65 65
 ));
66 66
 
67 67
 // delete variable
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
 // invoke OnTVFormDelete event
80 80
 $modx->invokeEvent("OnTVFormDelete", array(
81
-	"id" => $id
81
+    "id" => $id
82 82
 ));
83 83
 
84 84
 // empty cache
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@  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_template')) {
5
+if (!$modx->hasPermission('delete_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
 $forced = isset($_GET['force']) ? $_GET['force'] : 0;
15 15
 
16 16
 // check for relations
17
-if(!$forced) {
18
-	$drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc
19
-			INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
17
+if (!$forced) {
18
+	$drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content')." AS sc
19
+			INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'");
20 20
 	$count = $modx->db->getRecordCount($drs);
21
-	if($count > 0) {
21
+	if ($count > 0) {
22 22
 		include_once "header.inc.php";
23 23
 		?>
24 24
 		<script>
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 				<p><?= $_lang['tmplvar_inuse'] ?></p>
43 43
 				<ul>
44 44
 					<?php
45
-					while($row = $modx->db->getRow($drs)) {
46
-						echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>';
45
+					while ($row = $modx->db->getRow($drs)) {
46
+						echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['description'] != '' ? ' - '.$row['description'] : '').'</li>';
47 47
 					}
48 48
 					?>
49 49
 				</ul>
Please login to merge, or discard this patch.