Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/processors/delete_template.processor.php 1 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->getDatabase()->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0");
16 16
 $limit = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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/save_snippet.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_snippet')) {
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 = trim($_POST['post']);
11 11
 $name = $modx->getDatabase()->escape(trim($_POST['name']));
12 12
 $description = $modx->getDatabase()->escape($_POST['description']);
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 
34 34
 //Kyle Jaebker - added category support
35 35
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
36
-    $categoryid = (int)$_POST['categoryid'];
36
+    $categoryid = (int) $_POST['categoryid'];
37 37
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
38 38
     $categoryid = 0;
39 39
 } else {
40
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
40
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
41 41
     $categoryid = checkCategory($_POST['newcategory']);
42 42
     if (!$categoryid) {
43 43
         $categoryid = newCategory($_POST['newcategory']);
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
     $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid;
56 56
 
57 57
     $description = isset($parsed['description']) ? $parsed['description'] : $description;
58
-    $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : '';
58
+    $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : '';
59 59
     if ($version) {
60
-        $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
60
+        $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
61 61
     }
62 62
     if (isset($parsed['modx_category'])) {
63
-        include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
63
+        include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
64 64
         $categoryid = getCategory($parsed['modx_category']);
65 65
     }
66 66
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         // finished emptying cache - redirect
112 112
         if ($_POST['stay'] != '') {
113 113
             $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23";
114
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
114
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
115 115
             header($header);
116 116
         } else {
117 117
             $header = "Location: index.php?a=76&r=2";
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // finished emptying cache - redirect
164 164
         if ($_POST['stay'] != '') {
165 165
             $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23";
166
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
166
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
167 167
             header($header);
168 168
         } else {
169 169
             $modx->unlockElement(4, $id);
Please login to merge, or discard this patch.
manager/processors/save_settings.processor.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,46 +1,46 @@  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')) {
5
+if (!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
10 10
 unset($_POST);
11 11
 
12
-if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
12
+if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
14
+	$htaccess        = $modx->config['base_path'].'.htaccess';
15
+	$sample_htaccess = $modx->config['base_path'].'ht.access';
16
+	$dir = '/'.trim($modx->config['base_url'], '/');
17
+	if (is_file($htaccess))
18 18
 	{
19 19
 		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
20
+		if (strpos($_, 'RewriteBase') === false)
21 21
 		{
22 22
 			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23 23
 		}
24
-		elseif(is_writable($htaccess))
24
+		elseif (is_writable($htaccess))
25 25
 		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
26
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
27
+			if (!@file_put_contents($htaccess, $_))
28 28
 			{
29 29
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30 30
 			}
31 31
 		}
32 32
 	}
33
-	elseif(is_file($sample_htaccess))
33
+	elseif (is_file($sample_htaccess))
34 34
 	{
35
-		if(!@rename($sample_htaccess,$htaccess))
35
+		if (!@rename($sample_htaccess, $htaccess))
36 36
         {
37 37
         	$warnings[] = $_lang["settings_friendlyurls_alert"];
38 38
 		}
39
-		elseif($modx->config['base_url']!=='/')
39
+		elseif ($modx->config['base_url'] !== '/')
40 40
 		{
41 41
 			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
42
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
43
+			if (!@file_put_contents($htaccess, $_))
44 44
 			{
45 45
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46 46
 			}
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 }
50 50
 
51
-if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
52
-    unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css');
51
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
52
+    unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css');
53 53
 }
54 54
 
55
-$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']);
56
-$data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
55
+$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']);
56
+$data['rb_base_dir']      = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
59
+	if (isset($data['manager_language'])) {
60
+		$lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php';
61
+		if (is_file($lang_path)) {
62 62
 			include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 	$savethese = array();
68 68
 	$data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
69
+	$data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70 70
 	foreach ($data as $k => $v) {
71 71
 		switch ($k) {
72 72
 			case 'site_name':
73 73
 				$v = htmlspecialchars($v);
74 74
 				break;
75 75
             case 'settings_version':{
76
-                if($modx->getVersionData('version')!=$data['settings_version']){
77
-                    $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
76
+                if ($modx->getVersionData('version') != $data['settings_version']) {
77
+                    $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version');
78 78
                     $v = $modx->getVersionData('version');
79 79
                 }
80 80
                 break;
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
 			case 'rb_base_url':
96 96
 			case 'filemanager_path':
97 97
 				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
98
+				$v = rtrim($v, '/').'/';
99 99
 				break;
100 100
             case 'manager_language':
101
-                $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102
-                $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
101
+                $langDir = realpath(MODX_MANAGER_PATH.'includes/lang');
102
+                $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php');
103 103
                 $langFileDir = dirname($langFile);
104
-                if($langDir !== $langFileDir || !file_exists($langFile)) {
104
+                if ($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107 107
 				break;
108 108
 			case 'smtppw':
109 109
 				if ($v !== '********************' && $v !== '') {
110 110
 					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
111
+					$v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+					$v = str_replace('=', '%', $v);
113 113
 				} elseif ($v === '********************') {
114 114
 					$k = '';
115 115
 				}
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 				$v = str_replace(array(' ,', ', '), ',', $v);
119 119
 				if ($v !== ',') {
120 120
 					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
121
+					$configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n";
122
+					@file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString);
123 123
 				}
124 124
 				$k = '';
125 125
 				break;
126 126
 			case 'session_timeout':
127 127
 				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
128
+				$v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129 129
 				break;
130 130
 			default:
131 131
 			break;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
137
+		if (!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')';
138 138
 	}
139 139
 
140 140
 	// Run a single query to save all the values
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
 
145 145
 	// Reset Template Pages
146 146
 	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
147
+		$newtemplate = (int) $data['default_template'];
148
+		$oldtemplate = (int) $data['old_template'];
149 149
 		$tbl = $modx->getFullTableName('site_content');
150 150
 		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
151
+		if ($reset == 1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+		else if ($reset == 2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153 153
 	}
154 154
 
155 155
 	// empty cache
156 156
 	$modx->clearCache('full');
157 157
 }
158
-$header="Location: index.php?a=7&r=10";
158
+$header = "Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_content.processor.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 if (!$modx->hasPermission('delete_document')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if ($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
     $modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 /*******ищем родителя чтобы к нему вернуться********/
15
-$content=$modx->getDatabase()->getRow($modx->getDatabase()->select('parent, pagetitle', $modx->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
 /************ а заодно и путь возврата (сам путь внизу файла) **********/
19
-$sd=isset($_REQUEST['dir'])?'&dir='.$_REQUEST['dir']:'&dir=DESC';
20
-$sb=isset($_REQUEST['sort'])?'&sort='.$_REQUEST['sort']:'&sort=createdon';
21
-$pg=isset($_REQUEST['page'])?'&page='.(int)$_REQUEST['page']:'';
22
-$add_path=$sd.$sb.$pg;
19
+$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC';
20
+$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon';
21
+$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : '';
22
+$add_path = $sd.$sb.$pg;
23 23
 
24 24
 /*****************************/
25 25
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
                             "children"=>$children
46 46
                         ));
47 47
 
48
-if (count($children)>0) {
48
+if (count($children) > 0) {
49 49
     $modx->getDatabase()->update(
50 50
         array(
51 51
             'deleted'   => 1,
@@ -54,19 +54,19 @@  discard block
 block discarded – undo
54 54
         ), $modx->getFullTableName('site_content'), "id IN (".implode(", ", $children).")");
55 55
 }
56 56
 
57
-if ($site_start==$id) {
57
+if ($site_start == $id) {
58 58
     $modx->webAlertAndQuit("Document is 'Site start' and cannot be deleted!");
59 59
 }
60 60
 
61
-if ($site_unavailable_page==$id) {
61
+if ($site_unavailable_page == $id) {
62 62
     $modx->webAlertAndQuit("Document is used as the 'Site unavailable page' and cannot be deleted!");
63 63
 }
64 64
 
65
-if ($error_page==$id) {
65
+if ($error_page == $id) {
66 66
     $modx->webAlertAndQuit("Document is used as the 'Site error page' and cannot be deleted!");
67 67
 }
68 68
 
69
-if ($unauthorized_page==$id) {
69
+if ($unauthorized_page == $id) {
70 70
     $modx->webAlertAndQuit("Document is used as the 'Site unauthorized page' and cannot be deleted!");
71 71
 }
72 72
 
@@ -92,5 +92,5 @@  discard block
 block discarded – undo
92 92
 $modx->clearCache('full');
93 93
 
94 94
 // finished emptying cache - redirect
95
-$header="Location: index.php?a=3&id=$pid&r=1".$add_path;
95
+$header = "Location: index.php?a=3&id=$pid&r=1".$add_path;
96 96
 header($header);
Please login to merge, or discard this patch.
manager/processors/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->getDatabase()->escape(trim($_POST['name']));
11 11
 $description = $modx->getDatabase()->escape($_POST['description']);
12 12
 $caption = $modx->getDatabase()->escape($_POST['caption']);
@@ -17,17 +17,17 @@  discard block
 block discarded – undo
17 17
 $display = $modx->getDatabase()->escape($_POST['display']);
18 18
 $params = $modx->getDatabase()->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/duplicate_plugin.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('new_plugin')) {
5
+if (!$modx->hasPermission('new_plugin')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = isset($_GET['id'])? (int)$_GET['id'] : 0;
10
-if($id==0) {
9
+$id = isset($_GET['id']) ? (int) $_GET['id'] : 0;
10
+if ($id == 0) {
11 11
 	$modx->webAlertAndQuit($_lang["error_no_id"]);
12 12
 }
13 13
 
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
17
-if($count>=1) $count = ' '.($count+1);
17
+if ($count >= 1) $count = ' '.($count + 1);
18 18
 else $count = '';
19 19
 
20 20
 // duplicate Plugin
@@ -44,5 +44,5 @@  discard block
 block discarded – undo
44 44
 $_SESSION['itemname'] = $name;
45 45
 
46 46
 // finish duplicating - redirect to new plugin
47
-$header="Location: index.php?r=2&a=102&id=$newid";
47
+$header = "Location: index.php?r=2&a=102&id=$newid";
48 48
 header($header);
Please login to merge, or discard this patch.
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->getDatabase()->escape($_POST['post']);
11 11
 $name = $modx->getDatabase()->escape(trim($_POST['name']));
12 12
 $description = $modx->getDatabase()->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/duplicate_snippet.processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('new_snippet')) {
5
+if (!$modx->hasPermission('new_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
 
14 14
 // count duplicates
15 15
 $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'"));
16 16
 $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_snippets'), "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 Snippet
@@ -33,5 +33,5 @@  discard block
 block discarded – undo
33 33
 $_SESSION['itemname'] = $name;
34 34
 
35 35
 // finish duplicating - redirect to new snippet
36
-$header="Location: index.php?r=2&a=22&id=$newid";
36
+$header = "Location: index.php?r=2&a=22&id=$newid";
37 37
 header($header);
Please login to merge, or discard this patch.
manager/processors/delete_eventlog.processor.php 1 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->getDatabase()->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.