Completed
Pull Request — develop (#518)
by Agel_Nash
06:14
created
manager/index.php 1 patch
Braces   +37 added lines, -18 removed lines patch added patch discarded remove patch
@@ -61,9 +61,13 @@  discard block
 block discarded – undo
61 61
 $mgr_dir   = substr($self_dir,strrpos($self_dir,'/')+1);
62 62
 $base_path = str_replace($mgr_dir . '/index.php','',$self);
63 63
 $site_mgr_path = $base_path . 'assets/cache/siteManager.php';
64
-if(is_file($site_mgr_path)) include_once($site_mgr_path);
64
+if(is_file($site_mgr_path)) {
65
+    include_once($site_mgr_path);
66
+}
65 67
 $site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php';
66
-if(is_file($site_hostnames_path)) include_once($site_hostnames_path);
68
+if(is_file($site_hostnames_path)) {
69
+    include_once($site_hostnames_path);
70
+}
67 71
 if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) {
68 72
 	$src = "<?php\n";
69 73
 	$src .= "define('MGR_DIR', '{$mgr_dir}');\n";
@@ -117,9 +121,15 @@  discard block
 block discarded – undo
117 121
 $incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond
118 122
 set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
119 123
 
120
-if (!defined("ENT_COMPAT")) define("ENT_COMPAT", 2);
121
-if (!defined("ENT_NOQUOTES")) define("ENT_NOQUOTES", 0);
122
-if (!defined("ENT_QUOTES")) define("ENT_QUOTES", 3);
124
+if (!defined("ENT_COMPAT")) {
125
+    define("ENT_COMPAT", 2);
126
+}
127
+if (!defined("ENT_NOQUOTES")) {
128
+    define("ENT_NOQUOTES", 0);
129
+}
130
+if (!defined("ENT_QUOTES")) {
131
+    define("ENT_QUOTES", 3);
132
+}
123 133
 
124 134
 // set the document_root :|
125 135
 if(!isset($_SERVER["DOCUMENT_ROOT"]) || empty($_SERVER["DOCUMENT_ROOT"])) {
@@ -182,10 +192,11 @@  discard block
 block discarded – undo
182 192
 
183 193
 $s = array('[+MGR_DIR+]');
184 194
 $r = array(MGR_DIR);
185
-foreach($_lang as $k=>$v)
186
-{
187
-	if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v);
188
-}
195
+foreach($_lang as $k=>$v) {
196
+	if(strpos($v,'[+')!==false) {
197
+	    $_lang[$k] = str_replace($s, $r, $v);
198
+	}
199
+	}
189 200
 
190 201
 // send the charset header
191 202
 header('Content-Type: text/html; charset='.$modx_manager_charset);
@@ -198,7 +209,7 @@  discard block
 block discarded – undo
198 209
 include_once "accesscontrol.inc.php";
199 210
 
200 211
 // double check the session
201
-if(!isset($_SESSION['mgrValidated'])){
212
+if(!isset($_SESSION['mgrValidated'])) {
202 213
 	echo "Not Logged In!";
203 214
 	exit;
204 215
 }
@@ -215,7 +226,9 @@  discard block
 block discarded – undo
215 226
 }
216 227
 
217 228
 // Initialize System Alert Message Queque
218
-if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array();
229
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
230
+    $_SESSION['SystemAlertMsgQueque'] = array();
231
+}
219 232
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
220 233
 
221 234
 // first we check to see if this is a frameset request
@@ -223,7 +236,7 @@  discard block
 block discarded – undo
223 236
 	// this looks to be a top-level frameset request, so let's serve up a frameset
224 237
 	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) {
225 238
 		include_once "media/style/".$manager_theme."/frames/1.php";
226
-	}else{
239
+	} else {
227 240
 		include_once "frames/1.php";
228 241
 	}
229 242
 	exit;
@@ -231,10 +244,15 @@  discard block
 block discarded – undo
231 244
 
232 245
 // OK, let's retrieve the action directive from the request
233 246
 $option = array('min_range'=>1,'max_range'=>2000);
234
-if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']);
235
-elseif(isset($_GET['a']))  $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option);
236
-elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option);
237
-else                       $action = null;
247
+if(isset($_GET['a']) && isset($_POST['a'])) {
248
+    $modx->webAlertAndQuit($_lang['error_double_action']);
249
+} elseif(isset($_GET['a'])) {
250
+    $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option);
251
+} elseif(isset($_POST['a'])) {
252
+    $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option);
253
+} else {
254
+    $action = null;
255
+}
238 256
 
239 257
 if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) {
240 258
 	include_once 'messageCount.inc.php';
@@ -264,11 +282,12 @@  discard block
 block discarded – undo
264 282
 $modx->invokeEvent("OnManagerPageInit", array("action" => $action));
265 283
 
266 284
 // return element filepath
267
-function includeFileProcessor ($filepath,$manager_theme) {
285
+function includeFileProcessor ($filepath,$manager_theme)
286
+{
268 287
 	$element = "";
269 288
 	if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) {
270 289
 		$element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath;
271
-	}else{
290
+	} else {
272 291
 		$element = $filepath;
273 292
 	}
274 293
 	return $element;
Please login to merge, or discard this patch.
manager/includes/accesscontrol.inc.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,8 @@  discard block
 block discarded – undo
21 21
 if(file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
22 22
 	include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
23 23
 	if(isset($installStartTime)) {
24
-		if((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
24
+		if((time() - $installStartTime) > 5 * 60) {
25
+// if install flag older than 5 minutes, discard
25 26
 			unset($installStartTime);
26 27
 			@ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
27 28
 			unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
@@ -155,7 +156,8 @@  discard block
 block discarded – undo
155 156
 		} elseif(is_file($theme_path . 'templates/actions/login.tpl')) {
156 157
 			$target = $theme_path . 'templates/actions/login.tpl';
157 158
 			$login_tpl = file_get_contents($target);
158
-		} elseif(is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible
159
+		} elseif(is_file($theme_path . 'html/login.html')) {
160
+// ClipperCMS compatible
159 161
 			$target = $theme_path . 'html/login.html';
160 162
 			$login_tpl = file_get_contents($target);
161 163
 		} else {
Please login to merge, or discard this patch.
manager/includes/tmplvars.format.inc.php 1 patch
Braces   +21 added lines, -8 removed lines patch added patch discarded remove patch
@@ -5,7 +5,8 @@  discard block
 block discarded – undo
5 5
  */
6 6
 
7 7
 // Added by Raymond 20-Jan-2005
8
-function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '') {
8
+function getTVDisplayFormat($name, $value, $format, $paramstring = "", $tvtype = "", $docid = "", $sep = '')
9
+{
9 10
 
10 11
 	global $modx;
11 12
 
@@ -49,7 +50,9 @@  discard block
 block discarded – undo
49 50
 					if(isset($params['align']) && $params['align'] != 'none') {
50 51
 						$attr['align'] = $params['align'];
51 52
 					}
52
-					foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
53
+					foreach($attr as $k => $v) {
54
+					    $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
55
+					}
53 56
 					$attributes .= ' ' . $params['attrib'];
54 57
 
55 58
 					// Output the image with attributes
@@ -117,7 +120,9 @@  discard block
 block discarded – undo
117 120
 						'style' => $params['style'],
118 121
 						'target' => $params['target'],
119 122
 					);
120
-					foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
123
+					foreach($attr as $k => $v) {
124
+					    $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
125
+					}
121 126
 					$attributes .= ' ' . $params['attrib']; // add extra
122 127
 
123 128
 					// Output the link
@@ -145,7 +150,9 @@  discard block
 block discarded – undo
145 150
 					'class' => $params['class'],
146 151
 					'style' => $params['style'],
147 152
 				);
148
-				foreach($attr as $k => $v) $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
153
+				foreach($attr as $k => $v) {
154
+				    $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : '');
155
+				}
149 156
 				$attributes .= ' ' . $params['attrib']; // add extra
150 157
 
151 158
 				// Output the HTML Tag
@@ -325,19 +332,24 @@  discard block
 block discarded – undo
325 332
 	return $o;
326 333
 }
327 334
 
328
-function decodeParamValue($s) {
335
+function decodeParamValue($s)
336
+{
329 337
 	$s = str_replace("%3D", '=', $s); // =
330 338
 	$s = str_replace("%26", '&', $s); // &
331 339
 	return $s;
332 340
 }
333 341
 
334 342
 // returns an array if a delimiter is present. returns array is a recordset is present
335
-function parseInput($src, $delim = "||", $type = "string", $columns = true) { // type can be: string, array
343
+function parseInput($src, $delim = "||", $type = "string", $columns = true)
344
+{
345
+// type can be: string, array
336 346
 	global $modx;
337 347
 	if($modx->db->isResult($src)) {
338 348
 		// must be a recordset
339 349
 		$rows = array();
340
-		while($cols = $modx->db->getRow($src, 'num')) $rows[] = ($columns) ? $cols : implode(" ", $cols);
350
+		while($cols = $modx->db->getRow($src, 'num')) {
351
+		    $rows[] = ($columns) ? $cols : implode(" ", $cols);
352
+		}
341 353
 		return ($type == "array") ? $rows : implode($delim, $rows);
342 354
 	} else {
343 355
 		// must be a text
@@ -349,7 +361,8 @@  discard block
 block discarded – undo
349 361
 	}
350 362
 }
351 363
 
352
-function getUnixtimeFromDateString($value) {
364
+function getUnixtimeFromDateString($value)
365
+{
353 366
 	$timestamp = false;
354 367
 	// Check for MySQL or legacy style date
355 368
 	$date_match_1 = '/^([0-9]{2})-([0-9]{2})-([0-9]{4})\ ([0-9]{2}):([0-9]{2}):([0-9]{2})$/';
Please login to merge, or discard this patch.
manager/includes/rss.inc.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,8 @@  discard block
 block discarded – undo
29 29
 // include MagPieRSS
30 30
 require_once(MODX_MANAGER_PATH.'media/rss/rss_fetch.inc');
31 31
 // Convert relative path into absolute url
32
-function rel2abs( $rel, $base ) {
32
+function rel2abs( $rel, $base )
33
+{
33 34
 	// parse base URL  and convert to local variables: $scheme, $host,  $path
34 35
 	extract( parse_url( $base ) );
35 36
 	if ( strpos( $rel,"//" ) === 0 ) {
@@ -63,7 +64,7 @@  discard block
 block discarded – undo
63 64
 foreach ($urls as $section=>$url) {
64 65
 	$output = '';
65 66
     $rss = @fetch_rss($url);
66
-    if( !$rss ){
67
+    if( !$rss ) {
67 68
     	$feedData[$section] = 'Failed to retrieve ' . $url;
68 69
     	continue;
69 70
 	}
Please login to merge, or discard this patch.
manager/includes/secure_web_documents.inc.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if(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.");
4
+}
3 5
 
4 6
 /**
5 7
  *	Secure Web Documents
@@ -10,7 +12,8 @@  discard block
 block discarded – undo
10 12
  *
11 13
  */
12 14
 
13
-function secureWebDocument($docid='') {
15
+function secureWebDocument($docid='')
16
+{
14 17
 	global $modx;
15 18
 		
16 19
 	$modx->db->update('privateweb = 0', $modx->getFullTableName("site_content"), ($docid>0 ? "id='$docid'":"privateweb = 1"));
Please login to merge, or discard this patch.
manager/includes/charsets.php 1 patch
Braces   +31 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,21 +65,37 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if($modx_charset     == 'euc-jp') {
69
+    $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
70
+} elseif($modx_charset == 'shift_jis') {
71
+    $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
72
+} elseif($modx_charset == 'iso-2022-jp') {
73
+    $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
74
+} elseif($modx_charset == 'csISO2022JP') {
75
+    $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
76
+} elseif($modx_charset == 'EUC-CN') {
77
+    $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
78
+} elseif($modx_charset == 'hz-gb-2312') {
79
+    $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
80
+} elseif($modx_charset == 'x-mac-chinesesimp') {
81
+    $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
82
+} elseif($modx_charset == 'x-Chinese-CNS') {
83
+    $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
84
+} elseif($modx_charset == 'x-Chinese-Eten') {
85
+    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
86
+} elseif($modx_charset == 'x-mac-chinesetrad') {
87
+    $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
88
+} elseif($modx_charset == 'ks_c_5601-1987') {
89
+    $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
90
+} elseif($modx_charset == 'euc-kr') {
91
+    $_['euc-kr']         = 'Korean (EUC) - euc-kr';
92
+} elseif($modx_charset == 'iso-2022-kr') {
93
+    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
94
+} elseif($modx_charset == 'Johab') {
95
+    $_['Johab']          = 'Korean (Johab) - Johab';
96
+} elseif($modx_charset == 'x-mac-korean') {
97
+    $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
98
+}
83 99
 
84 100
 $tpl = '<option value="%s" %s>%s</option>';
85 101
 $options = array();
Please login to merge, or discard this patch.
manager/includes/mutate_settings.ajax.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,9 @@  discard block
 block discarded – undo
3 3
  * mutate_settings.ajax.php
4 4
  * 
5 5
  */
6
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
6
+if(IN_MANAGER_MODE!="true") {
7
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
8
+}
7 9
  
8 10
 require_once(dirname(__FILE__) . '/protect.inc.php');
9 11
 
@@ -20,7 +22,7 @@  discard block
 block discarded – undo
20 22
 $str = '';
21 23
 $emptyCache = false;
22 24
 
23
-switch(true){
25
+switch(true) {
24 26
     case ($action == 'get' && preg_match('/^[A-z0-9_-]+$/',$lang) && file_exists(dirname(__FILE__) . '/lang/'.$lang.'.inc.php')):{
25 27
         include(dirname(__FILE__) . '/lang/'.$lang.'.inc.php');
26 28
         $str = isset($key,$_lang,$_lang[$key]) ? $_lang[$key] : "" ;
Please login to merge, or discard this patch.
manager/includes/preload.functions.inc.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,13 +3,15 @@  discard block
 block discarded – undo
3 3
 global $site_sessionname;
4 4
 $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession
5 5
 
6
-function genEvoSessionName() {
6
+function genEvoSessionName()
7
+{
7 8
     $_ = crc32(__FILE__);
8 9
     $_ = sprintf('%u', $_);
9 10
     return 'evo' . base_convert($_,10,36);
10 11
 }
11 12
 
12
-function startCMSSession(){
13
+function startCMSSession()
14
+{
13 15
     
14 16
     global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain;
15 17
     
@@ -23,24 +25,27 @@  discard block
 block discarded – undo
23 25
     session_start();
24 26
 
25 27
     $key = "modx.{$context}.session.cookie.lifetime";
26
-    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
28
+    if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) {
27 29
         $cookieLifetime= intval($_SESSION[$key]);
28
-        if($cookieLifetime) $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime;
30
+        if($cookieLifetime) {
31
+            $cookieExpiration = $_SERVER['REQUEST_TIME']+$cookieLifetime;
32
+        }
29 33
         setcookie(session_name(), session_id(), $cookieExpiration, $cookiePath, $cookieDomain, $secure, true);
30 34
     }
31
-    if (!isset($_SESSION['modx.session.created.time'])) {
35
+    if (!isset($_SESSION['modx.session.created.time'])) {
32 36
         $_SESSION['modx.session.created.time'] = $_SERVER['REQUEST_TIME'];
33 37
     }
34 38
 }
35 39
 
36
-function removeInvalidCmsSessionFromStorage(&$storage, $session_name) {
37
-    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted'))
38
-    {
40
+function removeInvalidCmsSessionFromStorage(&$storage, $session_name)
41
+{
42
+    if (isset($storage[$session_name]) && ($storage[$session_name] === '' || $storage[$session_name] === 'deleted')) {
39 43
     unset($storage[$session_name]);
40 44
     }
41 45
 }
42 46
 
43
-function removeInvalidCmsSessionIds($session_name) {
47
+function removeInvalidCmsSessionIds($session_name)
48
+{
44 49
     // session ids is invalid iff it is empty string
45 50
     // storage priorioty can see in PHP source ext/session/session.c
46 51
     removeInvalidCmsSessionFromStorage($_COOKIE, $session_name);
Please login to merge, or discard this patch.
manager/includes/categories.inc.php 1 patch
Braces   +16 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,18 +3,22 @@  discard block
 block discarded – undo
3 3
 //Kyle Jaebker - 08/07/06
4 4
 
5 5
 //Create a new category
6
-function newCategory($newCat) {
6
+function newCategory($newCat)
7
+{
7 8
     global $modx;
8 9
     $useTable = $modx->getFullTableName('categories');
9 10
     $categoryId = $modx->db->insert(
10 11
         array(
11 12
             'category' => $modx->db->escape($newCat),
12 13
         ), $useTable);
13
-    if (!$categoryId) $categoryId = 0;
14
+    if (!$categoryId) {
15
+        $categoryId = 0;
16
+    }
14 17
     return $categoryId;
15 18
 }
16 19
 //check if new category already exists
17
-function checkCategory($newCat = '') {
20
+function checkCategory($newCat = '')
21
+{
18 22
     global $modx;
19 23
     $useTable = $modx->getFullTableName('categories');
20 24
     $newCat = $modx->db->escape($newCat);
@@ -25,13 +29,17 @@  discard block
 block discarded – undo
25 29
     return 0;
26 30
 }
27 31
 //Check for category, create new if not exists
28
-function getCategory($category='') {
32
+function getCategory($category='')
33
+{
29 34
     $categoryId = checkCategory($category);
30
-    if(!$categoryId) $categoryId = newCategory($category);
35
+    if(!$categoryId) {
36
+        $categoryId = newCategory($category);
37
+    }
31 38
     return $categoryId;
32 39
 }
33 40
 //Get all categories
34
-function getCategories() {
41
+function getCategories()
42
+{
35 43
     global $modx;
36 44
     $useTable = $modx->getFullTableName('categories');
37 45
     $cats = $modx->db->select('id, category', $modx->getFullTableName('categories'), '', 'category');
@@ -43,7 +51,8 @@  discard block
 block discarded – undo
43 51
     return $resourceArray;
44 52
 }
45 53
 //Delete category & associations
46
-function deleteCategory($catId=0) {
54
+function deleteCategory($catId=0)
55
+{
47 56
     global $modx;
48 57
     if ($catId) {
49 58
         $resetTables = array('site_plugins', 'site_snippets', 'site_htmlsnippets', 'site_templates', 'site_tmplvars', 'site_modules');
Please login to merge, or discard this patch.