Completed
Push — develop ( dc55c3...b0abe3 )
by Serg
06:10
created
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.
manager/processors/publish_content.processor.php 2 patches
Indentation   +12 added lines, -12 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('save_document')||!$modx->hasPermission('publish_document')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 $id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10 10
 if($id==0) {
11
-	$modx->webAlertAndQuit($_lang["error_no_id"]);
11
+    $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************webber ********/
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
 $udperms->role = $_SESSION['mgrRole'];
34 34
 
35 35
 if(!$udperms->checkPermissions()) {
36
-	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
36
+    $modx->webAlertAndQuit($_lang["access_permission_denied"]);
37 37
 }
38 38
 
39 39
 // update the document
40 40
 $modx->db->update(
41
-	array(
42
-		'published'   => 1,
43
-		'pub_date'    => 0,
44
-		'unpub_date'  => 0,
45
-		'editedby'    => $modx->getLoginUserID(),
46
-		'editedon'    => time(),
47
-		'publishedby' => $modx->getLoginUserID(),
48
-		'publishedon' => time(),
49
-	), $modx->getFullTableName('site_content'), "id='{$id}'");
41
+    array(
42
+        'published'   => 1,
43
+        'pub_date'    => 0,
44
+        'unpub_date'  => 0,
45
+        'editedby'    => $modx->getLoginUserID(),
46
+        'editedon'    => time(),
47
+        'publishedby' => $modx->getLoginUserID(),
48
+        'publishedon' => time(),
49
+    ), $modx->getFullTableName('site_content'), "id='{$id}'");
50 50
 
51 51
 // invoke OnDocPublished  event
52 52
 $modx->invokeEvent("OnDocPublished",array("docid"=>$id));
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) {
5
+if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_document')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /************webber ********/
15
-$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
+$pid = ($content['parent'] == 0 ? $id : $content['parent']);
17 17
 
18 18
 /************** webber *************/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /***********************************/
25 25
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $udperms->document = $id;
32 32
 $udperms->role = $_SESSION['mgrRole'];
33 33
 
34
-if(!$udperms->checkPermissions()) {
34
+if (!$udperms->checkPermissions()) {
35 35
 	$modx->webAlertAndQuit($_lang["access_permission_denied"]);
36 36
 }
37 37
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	), $modx->getFullTableName('site_content'), "id='{$id}'");
49 49
 
50 50
 // invoke OnDocPublished  event
51
-$modx->invokeEvent("OnDocPublished",array("docid"=>$id));
51
+$modx->invokeEvent("OnDocPublished", array("docid"=>$id));
52 52
 
53 53
 // Set the item name for logger
54 54
 $_SESSION['itemname'] = $content['pagetitle'];
@@ -56,6 +56,6 @@  discard block
 block discarded – undo
56 56
 // empty cache
57 57
 $modx->clearCache('full');
58 58
 
59
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
59
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
60 60
 
61 61
 header($header);
Please login to merge, or discard this patch.
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->db->delete($modx->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/delete_web_user.processor.php 2 patches
Indentation   +12 added lines, -12 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_web_user')) {
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,9 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 // invoke OnBeforeWUsrFormDelete event
19 19
 $modx->invokeEvent("OnBeforeWUsrFormDelete",
20
-	array(
21
-		"id"	=> $id
22
-	));
20
+    array(
21
+        "id"	=> $id
22
+    ));
23 23
 
24 24
 // delete the user.
25 25
 $modx->db->delete($modx->getFullTableName('web_users'), "id='{$id}'");
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 
33 33
 // invoke OnWebDeleteUser event
34 34
 $modx->invokeEvent("OnWebDeleteUser",
35
-	array(
36
-		"userid"		=> $id,
37
-		"username"		=> $username
38
-	));
35
+    array(
36
+        "userid"		=> $id,
37
+        "username"		=> $username
38
+    ));
39 39
 
40 40
 // invoke OnWUsrFormDelete event
41 41
 $modx->invokeEvent("OnWUsrFormDelete",
42
-	array(
43
-		"id"	=> $id
44
-	));
42
+    array(
43
+        "id"	=> $id
44
+    ));
45 45
 
46 46
 $header="Location: index.php?a=99";
47 47
 header($header);
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_web_user')) {
5
+if (!$modx->hasPermission('delete_web_user')) {
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
 
@@ -43,5 +43,5 @@  discard block
 block discarded – undo
43 43
 		"id"	=> $id
44 44
 	));
45 45
 
46
-$header="Location: index.php?a=99";
46
+$header = "Location: index.php?a=99";
47 47
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_tmplvars.processor.php 1 patch
Spacing   +9 added lines, -9 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_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $name = $modx->db->escape(trim($_POST['name']));
11 11
 $description = $modx->db->escape($_POST['description']);
12 12
 $caption = $modx->db->escape($_POST['caption']);
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
 $display = $modx->db->escape($_POST['display']);
18 18
 $params = $modx->db->escape($_POST['params']);
19 19
 $locked = $_POST['locked'] == 'on' ? 1 : 0;
20
-$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76;
21
-$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null;
20
+$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76;
21
+$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : null;
22 22
 $currentdate = time() + $modx->config['server_offset_time'];
23 23
 
24 24
 //Kyle Jaebker - added category support
25 25
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
26
-    $categoryid = (int)$_POST['categoryid'];
26
+    $categoryid = (int) $_POST['categoryid'];
27 27
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
28 28
     $categoryid = 0;
29 29
 } else {
30
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
30
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
31 31
     $categoryid = checkCategory($_POST['newcategory']);
32 32
     if (!$categoryid) {
33 33
         $categoryid = newCategory($_POST['newcategory']);
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         // finished emptying cache - redirect
100 100
         if ($_POST['stay'] != '') {
101 101
             $a = ($_POST['stay'] == '2') ? "301&id=$newid" : "300";
102
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
102
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
103 103
             header($header);
104 104
         } else {
105 105
             $header = "Location: index.php?a=76&r=2";
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
         // finished emptying cache - redirect
161 161
         if ($_POST['stay'] != '') {
162 162
             $a = ($_POST['stay'] == '2') ? "301&id=$id" : "300";
163
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'] . "&or=" . $origin . "&oid=" . $originId;
163
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']."&or=".$origin."&oid=".$originId;
164 164
             header($header);
165 165
         } else {
166 166
             $modx->unlockElement(2, $id);
167
-            $header = "Location: index.php?a=" . $origin . "&r=2" . (empty($originId) ? '' : '&id=' . $originId);
167
+            $header = "Location: index.php?a=".$origin."&r=2".(empty($originId) ? '' : '&id='.$originId);
168 168
             header($header);
169 169
         }
170 170
 
Please login to merge, or discard this patch.
manager/processors/delete_eventlog.processor.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,17 +3,17 @@
 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_eventlog')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9 9
 if (isset($_GET['cls']) && $_GET['cls']==1) {
10
-	$where = '';
10
+    $where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-	if($id==0) {
14
-		$modx->webAlertAndQuit($_lang["error_no_id"]);
15
-	}
16
-	$where = "id='{$id}'";
12
+    $id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
+    if($id==0) {
14
+        $modx->webAlertAndQuit($_lang["error_no_id"]);
15
+    }
16
+    $where = "id='{$id}'";
17 17
 }
18 18
 
19 19
 // delete event log
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  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_eventlog')) {
5
+if (!$modx->hasPermission('delete_eventlog')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-if (isset($_GET['cls']) && $_GET['cls']==1) {
9
+if (isset($_GET['cls']) && $_GET['cls'] == 1) {
10 10
 	$where = '';
11 11
 } else {
12
-	$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
13
-	if($id==0) {
12
+	$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
13
+	if ($id == 0) {
14 14
 		$modx->webAlertAndQuit($_lang["error_no_id"]);
15 15
 	}
16 16
 	$where = "id='{$id}'";
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 // delete event log
20 20
 $modx->db->delete($modx->getFullTableName('event_log'), $where);
21 21
 
22
-$header="Location: index.php?a=114";
22
+$header = "Location: index.php?a=114";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_category.processor.php 1 patch
Spacing   +4 added lines, -4 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('save_plugin') && !$modx->hasPermission('save_snippet') && !$modx->hasPermission('save_template') && !$modx->hasPermission('save_module')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['catId'])? (int)$_GET['catId'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['catId']) ? (int) $_GET['catId'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
@@ -19,5 +19,5 @@  discard block
 block discarded – undo
19 19
 deleteCategory($id);
20 20
 
21 21
 // finished emptying cache - redirect
22
-$header="Location: index.php?a=76";
22
+$header = "Location: index.php?a=76";
23 23
 header($header);
Please login to merge, or discard this patch.
manager/processors/save_template.processor.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,27 +1,27 @@  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_template')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $template = $modx->db->escape($_POST['post']);
11 11
 $templatename = $modx->db->escape(trim($_POST['templatename']));
12 12
 $description = $modx->db->escape($_POST['description']);
13 13
 $locked = $_POST['locked'] == 'on' ? 1 : 0;
14
-$selectable = $id == $modx->config['default_template'] ? 1 :    // Force selectable
14
+$selectable = $id == $modx->config['default_template'] ? 1 : // Force selectable
15 15
     $_POST['selectable'] == 'on' ? 1 : 0;
16 16
 $currentdate = time() + $modx->config['server_offset_time'];
17 17
 
18 18
 //Kyle Jaebker - added category support
19 19
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
20
-    $categoryid = (int)$_POST['categoryid'];
20
+    $categoryid = (int) $_POST['categoryid'];
21 21
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
22 22
     $categoryid = 0;
23 23
 } else {
24
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
24
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
25 25
     $categoryid = checkCategory($_POST['newcategory']);
26 26
     if (!$categoryid) {
27 27
         $categoryid = newCategory($_POST['newcategory']);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         // finished emptying cache - redirect
79 79
         if ($_POST['stay'] != '') {
80 80
             $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
81
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
82 82
             header($header);
83 83
         } else {
84 84
             $header = "Location: index.php?a=76&r=2";
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         // finished emptying cache - redirect
131 131
         if ($_POST['stay'] != '') {
132 132
             $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
133
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
134 134
             header($header);
135 135
         } else {
136 136
             $modx->unlockElement(1, $id);
Please login to merge, or discard this patch.
Switch Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -33,113 +33,113 @@
 block discarded – undo
33 33
 }
34 34
 
35 35
 switch ($_POST['mode']) {
36
-    case '19':
37
-
38
-        // invoke OnBeforeTempFormSave event
39
-        $modx->invokeEvent("OnBeforeTempFormSave", array(
40
-            "mode" => "new",
41
-            "id" => $id
42
-        ));
43
-
44
-        // disallow duplicate names for new templates
45
-        $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}'");
46
-        $count = $modx->db->getValue($rs);
47
-        if ($count > 0) {
48
-            $modx->manager->saveFormValues(19);
49
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=19");
50
-        }
51
-
52
-        //do stuff to save the new doc
53
-        $newid = $modx->db->insert(array(
54
-            'templatename' => $templatename,
55
-            'description' => $description,
56
-            'content' => $template,
57
-            'locked' => $locked,
58
-            'selectable' => $selectable,
59
-            'category' => $categoryid,
60
-            'createdon' => $currentdate,
61
-            'editedon' => $currentdate
62
-        ), $modx->getFullTableName('site_templates'));
63
-
64
-        // invoke OnTempFormSave event
65
-        $modx->invokeEvent("OnTempFormSave", array(
66
-            "mode" => "new",
67
-            "id" => $newid
68
-        ));
69
-        // Set new assigned Tvs
70
-        saveTemplateAccess($newid);
71
-
72
-        // Set the item name for logger
73
-        $_SESSION['itemname'] = $templatename;
74
-
75
-        // empty cache
76
-        $modx->clearCache('full');
77
-
78
-        // finished emptying cache - redirect
79
-        if ($_POST['stay'] != '') {
80
-            $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
82
-            header($header);
83
-        } else {
84
-            $header = "Location: index.php?a=76&r=2";
85
-            header($header);
86
-        }
87
-
88
-        break;
89
-    case '16':
90
-
91
-        // invoke OnBeforeTempFormSave event
92
-        $modx->invokeEvent("OnBeforeTempFormSave", array(
93
-            "mode" => "upd",
94
-            "id" => $id
95
-        ));
96
-
97
-        // disallow duplicate names for templates
98
-        $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}' AND id!='{$id}'");
99
-        $count = $modx->db->getValue($rs);
100
-        if ($count > 0) {
101
-            $modx->manager->saveFormValues(16);
102
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=16&id={$id}");
103
-        }
104
-
105
-        //do stuff to save the edited doc
106
-        $modx->db->update(array(
107
-            'templatename' => $templatename,
108
-            'description' => $description,
109
-            'content' => $template,
110
-            'locked' => $locked,
111
-            'selectable' => $selectable,
112
-            'category' => $categoryid,
113
-            'editedon' => $currentdate
114
-        ), $modx->getFullTableName('site_templates'), "id='{$id}'");
115
-        // Set new assigned Tvs
116
-        saveTemplateAccess($id);
117
-
118
-        // invoke OnTempFormSave event
119
-        $modx->invokeEvent("OnTempFormSave", array(
120
-            "mode" => "upd",
121
-            "id" => $id
122
-        ));
123
-
124
-        // Set the item name for logger
125
-        $_SESSION['itemname'] = $templatename;
126
-
127
-        // first empty the cache
128
-        $modx->clearCache('full');
129
-
130
-        // finished emptying cache - redirect
131
-        if ($_POST['stay'] != '') {
132
-            $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
134
-            header($header);
135
-        } else {
136
-            $modx->unlockElement(1, $id);
137
-            $header = "Location: index.php?a=76&r=2";
138
-            header($header);
139
-        }
140
-
141
-
142
-        break;
143
-    default:
144
-        $modx->webAlertAndQuit("No operation set in request.");
36
+        case '19':
37
+
38
+            // invoke OnBeforeTempFormSave event
39
+            $modx->invokeEvent("OnBeforeTempFormSave", array(
40
+                "mode" => "new",
41
+                "id" => $id
42
+            ));
43
+
44
+            // disallow duplicate names for new templates
45
+            $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}'");
46
+            $count = $modx->db->getValue($rs);
47
+            if ($count > 0) {
48
+                $modx->manager->saveFormValues(19);
49
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=19");
50
+            }
51
+
52
+            //do stuff to save the new doc
53
+            $newid = $modx->db->insert(array(
54
+                'templatename' => $templatename,
55
+                'description' => $description,
56
+                'content' => $template,
57
+                'locked' => $locked,
58
+                'selectable' => $selectable,
59
+                'category' => $categoryid,
60
+                'createdon' => $currentdate,
61
+                'editedon' => $currentdate
62
+            ), $modx->getFullTableName('site_templates'));
63
+
64
+            // invoke OnTempFormSave event
65
+            $modx->invokeEvent("OnTempFormSave", array(
66
+                "mode" => "new",
67
+                "id" => $newid
68
+            ));
69
+            // Set new assigned Tvs
70
+            saveTemplateAccess($newid);
71
+
72
+            // Set the item name for logger
73
+            $_SESSION['itemname'] = $templatename;
74
+
75
+            // empty cache
76
+            $modx->clearCache('full');
77
+
78
+            // finished emptying cache - redirect
79
+            if ($_POST['stay'] != '') {
80
+                $a = ($_POST['stay'] == '2') ? "16&id=$newid" : "19";
81
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
82
+                header($header);
83
+            } else {
84
+                $header = "Location: index.php?a=76&r=2";
85
+                header($header);
86
+            }
87
+
88
+            break;
89
+        case '16':
90
+
91
+            // invoke OnBeforeTempFormSave event
92
+            $modx->invokeEvent("OnBeforeTempFormSave", array(
93
+                "mode" => "upd",
94
+                "id" => $id
95
+            ));
96
+
97
+            // disallow duplicate names for templates
98
+            $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_templates'), "templatename='{$templatename}' AND id!='{$id}'");
99
+            $count = $modx->db->getValue($rs);
100
+            if ($count > 0) {
101
+                $modx->manager->saveFormValues(16);
102
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['template'], $templatename), "index.php?a=16&id={$id}");
103
+            }
104
+
105
+            //do stuff to save the edited doc
106
+            $modx->db->update(array(
107
+                'templatename' => $templatename,
108
+                'description' => $description,
109
+                'content' => $template,
110
+                'locked' => $locked,
111
+                'selectable' => $selectable,
112
+                'category' => $categoryid,
113
+                'editedon' => $currentdate
114
+            ), $modx->getFullTableName('site_templates'), "id='{$id}'");
115
+            // Set new assigned Tvs
116
+            saveTemplateAccess($id);
117
+
118
+            // invoke OnTempFormSave event
119
+            $modx->invokeEvent("OnTempFormSave", array(
120
+                "mode" => "upd",
121
+                "id" => $id
122
+            ));
123
+
124
+            // Set the item name for logger
125
+            $_SESSION['itemname'] = $templatename;
126
+
127
+            // first empty the cache
128
+            $modx->clearCache('full');
129
+
130
+            // finished emptying cache - redirect
131
+            if ($_POST['stay'] != '') {
132
+                $a = ($_POST['stay'] == '2') ? "16&id=$id" : "19";
133
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
134
+                header($header);
135
+            } else {
136
+                $modx->unlockElement(1, $id);
137
+                $header = "Location: index.php?a=76&r=2";
138
+                header($header);
139
+            }
140
+
141
+
142
+            break;
143
+        default:
144
+            $modx->webAlertAndQuit("No operation set in request.");
145 145
 }
Please login to merge, or discard this patch.