Completed
Pull Request — develop (#725)
by Agel_Nash
08:07
created
manager/processors/execute_module.processor.php 1 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->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->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.
manager/processors/remove_locks.processor.php 1 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->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/web_access_groups.processor.php 1 patch
Spacing   +19 added lines, -19 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('web_access_permissions')) {
5
+if (!$modx->hasPermission('web_access_permissions')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 switch ($operation) {
23 23
 	case "add_user_group" :
24 24
 		$newgroup = $_REQUEST['newusergroup'];
25
-		if(empty($newgroup)) {
25
+		if (empty($newgroup)) {
26 26
 			$modx->webAlertAndQuit("No group name specified.");
27 27
 		} else {
28 28
 			$id = $modx->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_names);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 	break;
37 37
 	case "add_document_group" :
38 38
 		$newgroup = $_REQUEST['newdocgroup'];
39
-		if(empty($newgroup)) {
39
+		if (empty($newgroup)) {
40 40
 			$modx->webAlertAndQuit("No group name specified.");
41 41
 		} else {
42 42
 			$id = $modx->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_documentgroup_names);
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
 	break;
51 51
 	case "delete_user_group" :
52 52
 		$updategroupaccess = true;
53
-		$usergroup = (int)$_REQUEST['usergroup'];
54
-		if(empty($usergroup)) {
53
+		$usergroup = (int) $_REQUEST['usergroup'];
54
+		if (empty($usergroup)) {
55 55
 			$modx->webAlertAndQuit("No user group id specified for deletion.");
56 56
 		} else {
57 57
 			$modx->getDatabase()->delete($tbl_webgroup_names, "id='{$usergroup}'");
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 		}
63 63
 	break;
64 64
 	case "delete_document_group" :
65
-		$group = (int)$_REQUEST['documentgroup'];
66
-		if(empty($group)) {
65
+		$group = (int) $_REQUEST['documentgroup'];
66
+		if (empty($group)) {
67 67
 			$modx->webAlertAndQuit("No document group id specified for deletion.");
68 68
 		} else {
69 69
 			$modx->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'");
@@ -75,33 +75,33 @@  discard block
 block discarded – undo
75 75
 	break;
76 76
 	case "rename_user_group" :
77 77
 		$newgroupname = $_REQUEST['newgroupname'];
78
-		if(empty($newgroupname)) {
78
+		if (empty($newgroupname)) {
79 79
 			$modx->webAlertAndQuit("No group name specified.");
80 80
 		}
81
-		$groupid = (int)$_REQUEST['groupid'];
82
-		if(empty($groupid)) {
81
+		$groupid = (int) $_REQUEST['groupid'];
82
+		if (empty($groupid)) {
83 83
 			$modx->webAlertAndQuit("No user group id specified for rename.");
84 84
 		}
85 85
 		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'");
86 86
 	break;
87 87
 	case "rename_document_group" :
88 88
 		$newgroupname = $_REQUEST['newgroupname'];
89
-		if(empty($newgroupname)) {
89
+		if (empty($newgroupname)) {
90 90
 			$modx->webAlertAndQuit("No group name specified.");
91 91
 		}
92
-		$groupid = (int)$_REQUEST['groupid'];
93
-		if(empty($groupid)) {
92
+		$groupid = (int) $_REQUEST['groupid'];
93
+		if (empty($groupid)) {
94 94
 			$modx->webAlertAndQuit("No document group id specified for rename.");
95 95
 		}
96 96
 		$modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'");
97 97
 	break;
98 98
 	case "add_document_group_to_user_group" :
99 99
 		$updategroupaccess = true;
100
-		$usergroup = (int)$_REQUEST['usergroup'];
101
-		$docgroup = (int)$_REQUEST['docgroup'];
100
+		$usergroup = (int) $_REQUEST['usergroup'];
101
+		$docgroup = (int) $_REQUEST['docgroup'];
102 102
 		$rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'");
103 103
 		$limit = $modx->getDatabase()->getValue($rs);
104
-		if($limit<=0) {
104
+		if ($limit <= 0) {
105 105
 			$modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access);
106 106
 		} else {
107 107
 			//alert user that coupling already exists?
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	break;
110 110
 	case "remove_document_group_from_user_group" :
111 111
 		$updategroupaccess = true;
112
-		$coupling = (int)$_REQUEST['coupling'];
112
+		$coupling = (int) $_REQUEST['coupling'];
113 113
 		$modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'");
114 114
 	break;
115 115
 	default :
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 }
118 118
 
119 119
 // secure web documents - flag as private
120
-if($updategroupaccess==true){
120
+if ($updategroupaccess == true) {
121 121
 	include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php";
122 122
 	secureWebDocument();
123 123
 
Please login to merge, or discard this patch.
manager/processors/save_plugin.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_plugin')) {
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->getDatabase()->escape(trim($_POST['name']));
11 11
 $description = $modx->getDatabase()->escape($_POST['description']);
12 12
 $locked = $_POST['locked'] == 'on' ? '1' : '0';
@@ -20,11 +20,11 @@  discard block
 block discarded – undo
20 20
 
21 21
 //Kyle Jaebker - added category support
22 22
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
23
-    $categoryid = (int)$_POST['categoryid'];
23
+    $categoryid = (int) $_POST['categoryid'];
24 24
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
25 25
     $categoryid = 0;
26 26
 } else {
27
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
27
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
28 28
     $categoryid = getCategory($_POST['newcategory']);
29 29
 }
30 30
 
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
     $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid;
41 41
 
42 42
     $description = isset($parsed['description']) ? $parsed['description'] : $description;
43
-    $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : '';
43
+    $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : '';
44 44
     if ($version) {
45
-        $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
45
+        $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
46 46
     }
47 47
     if (isset($parsed['modx_category'])) {
48
-        include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
48
+        include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
49 49
         $categoryid = getCategory($parsed['modx_category']);
50 50
     }
51 51
 }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         // finished emptying cache - redirect
104 104
         if ($_POST['stay'] != '') {
105 105
             $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101';
106
-            $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay'];
106
+            $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay'];
107 107
             header($header);
108 108
         } else {
109 109
             $header = 'Location: index.php?a=76&r=2';
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
         // finished emptying cache - redirect
159 159
         if ($_POST['stay'] != '') {
160 160
             $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101';
161
-            $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay'];
161
+            $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay'];
162 162
             header($header);
163 163
         } else {
164 164
             $modx->unlockElement(5, $id);
Please login to merge, or discard this patch.
manager/processors/delete_role.processor.php 1 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->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->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/publish_content.processor.php 1 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->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'"));
16
-$pid=($content['parent']==0?$id:$content['parent']);
15
+$content = $modx->getDatabase()->getRow($modx->getDatabase()->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/purge_plugin.processor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  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
     exit();
4 4
 }
5 5
 
6
-if(!$modx->hasPermission('delete_plugin')) {
6
+if (!$modx->hasPermission('delete_plugin')) {
7 7
 	$e->setError(3);
8 8
 	$e->dumpError();
9 9
 }
@@ -14,18 +14,18 @@  discard block
 block discarded – undo
14 14
 // Get unique list of latest added plugins by highest sql-id
15 15
 $rs = $modx->getDatabase()->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;");
16 16
 $latestIds = array();
17
-while($row = $modx->getDatabase()->getRow($rs)) {
17
+while ($row = $modx->getDatabase()->getRow($rs)) {
18 18
     $latestIds[] = $row['id'];
19 19
 }
20 20
 
21 21
 // Get list of plugins with disabled and enabled versions
22 22
 $rs = $modx->getDatabase()->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)");
23 23
 
24
-while($row = $modx->getDatabase()->getRow($rs)) {
24
+while ($row = $modx->getDatabase()->getRow($rs)) {
25 25
 
26 26
     $id = $row['id'];
27 27
 
28
-    if(in_array($id,$latestIds)) continue;	// Keep latest version of disabled plugins
28
+    if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins
29 29
 
30 30
     // invoke OnBeforePluginFormDelete event
31 31
     $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id));
Please login to merge, or discard this patch.
manager/processors/send_message.processor.php 1 patch
Spacing   +11 added lines, -11 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('messages')) {
5
+if (!$modx->hasPermission('messages')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 $userid = $_REQUEST['user'];
11 11
 $groupid = $_REQUEST['group'];
12 12
 $subject = $modx->getDatabase()->escape($_REQUEST['messagesubject']);
13
-if($subject=="") $subject="(no subject)";
13
+if ($subject == "") $subject = "(no subject)";
14 14
 $message = $modx->getDatabase()->escape($_REQUEST['messagebody']);
15
-if($message=="") $message="(no message)";
15
+if ($message == "") $message = "(no message)";
16 16
 $postdate = time();
17 17
 
18
-if($sendto=='u') {
19
-	if($userid==0) {
18
+if ($sendto == 'u') {
19
+	if ($userid == 0) {
20 20
 		$modx->webAlertAndQuit($_lang["error_no_user_selected"]);
21 21
 	}
22 22
 	$modx->getDatabase()->insert(
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 		), $modx->getFullTableName('user_messages'));
32 32
 }
33 33
 
34
-if($sendto=='g') {
35
-	if($groupid==0) {
34
+if ($sendto == 'g') {
35
+	if ($groupid == 0) {
36 36
 		$modx->webAlertAndQuit($_lang["error_no_group_selected"]);
37 37
 	}
38 38
 	$rs = $modx->getDatabase()->select('internalKey', $modx->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'");
39
-	while ($row=$modx->getDatabase()->getRow($rs)) {
39
+	while ($row = $modx->getDatabase()->getRow($rs)) {
40 40
 		$modx->getDatabase()->insert(
41 41
 			array(
42 42
 				'recipient' => $row['internalKey'],
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 
54
-if($sendto=='a') {
54
+if ($sendto == 'a') {
55 55
 	$rs = $modx->getDatabase()->select('id', $modx->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'");
56
-	while ($row=$modx->getDatabase()->getRow($rs)) {
56
+	while ($row = $modx->getDatabase()->getRow($rs)) {
57 57
 		$modx->getDatabase()->insert(
58 58
 			array(
59 59
 				'recipient' => $row['id'],
Please login to merge, or discard this patch.
manager/processors/save_template.processor.php 1 patch
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->getDatabase()->escape($_POST['post']);
11 11
 $templatename = $modx->getDatabase()->escape(trim($_POST['templatename']));
12 12
 $description = $modx->getDatabase()->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.