Completed
Pull Request — develop (#534)
by Agel_Nash
05:08
created
manager/processors/save_content.processor.php 1 patch
Braces   +33 added lines, -24 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                 }
85 85
                 $alias = $tempAlias;
86 86
             }
87
-        }else{
87
+        } else {
88 88
             if ($modx->db->getValue($modx->db->select('COUNT(id)', $tbl_site_content, "id<>'$id' AND parent=$parent AND alias='$alias'")) != 0) {
89 89
                 $cnt = 1;
90 90
                 $tempAlias = $alias;
@@ -134,8 +134,7 @@  discard block
 block discarded – undo
134 134
         }
135 135
         //end webber
136 136
     }
137
-}
138
-elseif ($alias) {
137
+} elseif ($alias) {
139 138
     $alias = $modx->stripAlias($alias);
140 139
 }
141 140
 
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 
150 149
     if ($pub_date < $currentdate) {
151 150
         $published = 1;
152
-    }
153
-    elseif ($pub_date > $currentdate) {
151
+    } elseif ($pub_date > $currentdate) {
154 152
         $published = 0;
155 153
     }
156 154
 }
@@ -278,8 +276,7 @@  discard block
 block discarded – undo
278 276
     case 'new' :
279 277
 
280 278
         // invoke OnBeforeDocFormSave event
281
-        switch($modx->config['docid_incrmnt_method'])
282
-        {
279
+        switch($modx->config['docid_incrmnt_method']) {
283 280
             case '1':
284 281
                 $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id";
285 282
                 $where = "T1.id IS NULL";
@@ -310,7 +307,7 @@  discard block
 block discarded – undo
310 307
         $publishedon = ($published ? $currentdate : 0);
311 308
         $publishedby = ($published ? $modx->getLoginUserID() : 0);
312 309
 
313
-        if ((!empty($pub_date))&&($published)){
310
+        if ((!empty($pub_date))&&($published)) {
314 311
             $publishedon=$pub_date;
315 312
         }
316 313
 
@@ -348,8 +345,9 @@  discard block
 block discarded – undo
348 345
             "alias_visible"    => $aliasvisible
349 346
         );
350 347
 
351
-        if ($id != '')
352
-            $dbInsert["id"] = $id;
348
+        if ($id != '') {
349
+                    $dbInsert["id"] = $id;
350
+        }
353 351
 
354 352
         $key = $modx->db->insert( $dbInsert, $tbl_site_content);
355 353
 
@@ -425,11 +423,13 @@  discard block
 block discarded – undo
425 423
         // redirect/stay options
426 424
         if ($_POST['stay'] != '') {
427 425
             // weblink
428
-            if ($_POST['mode'] == "72")
429
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
426
+            if ($_POST['mode'] == "72") {
427
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent";
428
+            }
430 429
             // document
431
-            if ($_POST['mode'] == "4")
432
-                $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
430
+            if ($_POST['mode'] == "4") {
431
+                            $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent";
432
+            }
433 433
             $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'];
434 434
         } else {
435 435
             $header = "Location: index.php?a=3&id=$key&r=1";
@@ -490,10 +490,10 @@  discard block
 block discarded – undo
490 490
         if (!$was_published && $published) {
491 491
             $publishedon = $currentdate;
492 492
             $publishedby = $modx->getLoginUserID();
493
-            }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
493
+            } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) {
494 494
             $publishedon = $pub_date;
495 495
             $publishedby = $modx->getLoginUserID();
496
-               }elseif ($was_published && !$published) {
496
+               } elseif ($was_published && !$published) {
497 497
             $publishedon = 0;
498 498
             $publishedby = 0;
499 499
         } else {
@@ -549,7 +549,9 @@  discard block
 block discarded – undo
549 549
         $tvChanges = array();
550 550
         foreach ($tmplvars as $field => $value) {
551 551
             if (!is_array($value)) {
552
-                if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value];
552
+                if (isset($tvIds[$value])) {
553
+                    $tvDeletions[] = $tvIds[$value];
554
+                }
553 555
             } else {
554 556
                 $tvId = $value[0];
555 557
                 $tvVal = $value[1];
@@ -597,7 +599,9 @@  discard block
 block discarded – undo
597 599
                 "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'"
598 600
                 );
599 601
             $old_groups = array();
600
-            while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id'];
602
+            while ($row = $modx->db->getRow($rs)) {
603
+                $old_groups[$row['document_group']] = $row['id'];
604
+            }
601 605
 
602 606
             // update the permissions in the database
603 607
             $insertions = $deletions = array();
@@ -659,17 +663,22 @@  discard block
 block discarded – undo
659 663
             $keys = array('alias','parent','published','isfolder','menuindex','alias_visible');
660 664
             $flag = '';
661 665
             foreach($keys as $key) {
662
-                if ($existingDocument[$key]===$_POST[$key]) continue;
666
+                if ($existingDocument[$key]===$_POST[$key]) {
667
+                    continue;
668
+                }
663 669
                 $flag = 'full';
664 670
                 break;
665 671
             }
666
-            if($flag==='full') $modx->clearCache('full');
667
-            else               $modx->clearCache($id);
672
+            if($flag==='full') {
673
+                $modx->clearCache('full');
674
+            } else {
675
+                $modx->clearCache($id);
676
+            }
668 677
         }
669 678
 
670
-        if ($_POST['refresh_preview'] == '1')
671
-            $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
672
-        else {
679
+        if ($_POST['refresh_preview'] == '1') {
680
+                    $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev";
681
+        } else {
673 682
             if ($_POST['stay'] != '2' && $id > 0) {
674 683
                 $modx->unlockElement(7, $id);
675 684
             }
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 1 patch
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
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->db->select(
17 17
 		'sma.usergroup,mg.member',
18 18
 		$modx->getFullTableName("site_module_access")." sma
@@ -64,7 +64,8 @@  discard block
 block discarded – undo
64 64
 include MODX_MANAGER_PATH."includes/sysalert.display.inc.php";
65 65
 
66 66
 // evalModule
67
-function evalModule($moduleCode,$params){
67
+function evalModule($moduleCode,$params)
68
+{
68 69
 	global $modx;
69 70
 	$modx->event->params = &$params; // store params inside event object
70 71
 	if(is_array($params)) {
@@ -74,11 +75,9 @@  discard block
 block discarded – undo
74 75
 	$mod = eval($moduleCode);
75 76
 	$msg = ob_get_contents();
76 77
 	ob_end_clean();
77
-	if (isset($php_errormsg))
78
-	{
78
+	if (isset($php_errormsg)) {
79 79
 		$error_info = error_get_last();
80
-        switch($error_info['type'])
81
-        {
80
+        switch($error_info['type']) {
82 81
         	case E_NOTICE :
83 82
         		$error_level = 1;
84 83
         	case E_USER_NOTICE :
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
         	default:
92 91
         		$error_level = 99;
93 92
         }
94
-		if($modx->config['error_reporting']==='99' || 2<$error_level)
95
-		{
93
+		if($modx->config['error_reporting']==='99' || 2<$error_level) {
96 94
 			$modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg);
97 95
 			$modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>");
98 96
 		}
Please login to merge, or discard this patch.
manager/processors/send_message.processor.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,9 +10,13 @@
 block discarded – undo
10 10
 $userid = $_REQUEST['user'];
11 11
 $groupid = $_REQUEST['group'];
12 12
 $subject = $modx->db->escape($_REQUEST['messagesubject']);
13
-if($subject=="") $subject="(no subject)";
13
+if($subject=="") {
14
+    $subject="(no subject)";
15
+}
14 16
 $message = $modx->db->escape($_REQUEST['messagebody']);
15
-if($message=="") $message="(no message)";
17
+if($message=="") {
18
+    $message="(no message)";
19
+}
16 20
 $postdate = time();
17 21
 
18 22
 if($sendto=='u') {
Please login to merge, or discard this patch.
manager/processors/access_groups.processor.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
 }
120 120
 
121 121
 // secure manager documents - flag as private
122
-if($updategroupaccess==true){
122
+if($updategroupaccess==true) {
123 123
 	include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php";
124 124
 	secureMgrDocument();
125 125
 
Please login to merge, or discard this patch.
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/frames/tree.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  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 6
 // invoke OnManagerTreeInit event
7 7
 $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
8
-if(is_array($evtOut)) {
8
+if(is_array($evtOut)) {
9 9
 	echo implode("\n", $evtOut);
10 10
 }
11 11
 ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		<?php
55 55
 		// invoke OnManagerTreePrerender event
56 56
 		$evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST));
57
-		if(is_array($evtOut)) {
57
+		if(is_array($evtOut)) {
58 58
 			echo implode("\n", $evtOut);
59 59
 		}
60 60
 		?>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		<?php
67 67
 		// invoke OnManagerTreeRender event
68 68
 		$evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST));
69
-		if(is_array($evtOut)) {
69
+		if(is_array($evtOut)) {
70 70
 			echo implode("\n", $evtOut);
71 71
 		}
72 72
 		?>
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Braces   +29 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 header("X-XSS-Protection: 0");
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 
12 12
 $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
13 13
 
14
-if (!isset($modx->config['manager_menu_height'])) {
14
+if (!isset($modx->config['manager_menu_height'])) {
15 15
     $modx->config['manager_menu_height'] = 2.2; // rem
16 16
 }
17 17
 
18
-if (!isset($modx->config['manager_tree_width'])) {
18
+if (!isset($modx->config['manager_tree_width'])) {
19 19
     $modx->config['manager_tree_width'] = 20; // rem
20 20
 }
21 21
 
22
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
22
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
23 23
     $initMainframeAction = $_SESSION['onLoginForwardToAction'];
24 24
     unset($_SESSION['onLoginForwardToAction']);
25
-} else {
25
+} else {
26 26
     $initMainframeAction = 2; // welcome.static
27 27
 }
28 28
 
29
-if (!isset($_SESSION['tree_show_only_folders'])) {
29
+if (!isset($_SESSION['tree_show_only_folders'])) {
30 30
     $_SESSION['tree_show_only_folders'] = 0;
31 31
 }
32 32
 
@@ -35,21 +35,21 @@  discard block
 block discarded – undo
35 35
 $tree_width = $modx->config['manager_tree_width'];
36 36
 $tree_min_width = 0;
37 37
 
38
-if (isset($_COOKIE['MODX_widthSideBar'])) {
38
+if (isset($_COOKIE['MODX_widthSideBar'])) {
39 39
     $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
40
-} else {
40
+} else {
41 41
     $MODX_widthSideBar = $tree_width;
42 42
 }
43 43
 
44
-if (!$MODX_widthSideBar) {
44
+if (!$MODX_widthSideBar) {
45 45
     $body_class .= 'sidebar-closed';
46 46
 }
47 47
 
48
-if (isset($_COOKIE['MODX_themeColor'])) {
48
+if (isset($_COOKIE['MODX_themeColor'])) {
49 49
     $body_class .= ' ' . $_COOKIE['MODX_themeColor'];
50 50
 }
51 51
 
52
-if (isset($modx->pluginCache['ElementsInTree'])) {
52
+if (isset($modx->pluginCache['ElementsInTree'])) {
53 53
     $body_class .= ' ElementsInTree';
54 54
 }
55 55
 
@@ -65,19 +65,19 @@  discard block
 block discarded – undo
65 65
     'type8' => $_lang["lock_element_type_8"]
66 66
 );
67 67
 
68
-foreach ($unlockTranslations as $key => $value) {
68
+foreach ($unlockTranslations as $key => $value) {
69 69
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
70 70
 }
71 71
 
72 72
 $user = $modx->getUserInfo($modx->getLoginUserID());
73
-if ($user['which_browser'] == 'default') {
73
+if ($user['which_browser'] == 'default') {
74 74
     $user['which_browser'] = $modx->config['which_browser'];
75 75
 }
76 76
 
77 77
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
78 78
 
79
-if ($modx->config['manager_theme'] == 'default') {
80
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
79
+if ($modx->config['manager_theme'] == 'default') {
80
+    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
81 81
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
82 82
         $minifier = new Formatter\CSSMinify();
83 83
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         $css = $minifier->minify();
95 95
         file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
96 96
     }
97
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
97
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
98 98
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
99 99
     }
100 100
 }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     <?php
249 249
     // invoke OnManagerTopPrerender event
250 250
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
251
-    if (is_array($evtOut)) {
251
+    if (is_array($evtOut)) {
252 252
         echo implode("\n", $evtOut);
253 253
     }
254 254
     ?>
@@ -419,9 +419,12 @@  discard block
 block discarded – undo
419 419
             <div id="evo-tab-page-home" class="evo-tab-page show">
420 420
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
421 421
             </div>
422
-        <?php else: ?>
422
+        <?php else {
423
+    : ?>
423 424
             <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
424
-        <?php endif; ?>
425
+        <?php endif;
426
+}
427
+?>
425 428
         <div id="mainloader"></div>
426 429
     </div>
427 430
     <div id="resizer"></div>
@@ -434,11 +437,11 @@  discard block
 block discarded – undo
434 437
             'tree_sortdir',
435 438
             'tree_nodename'
436 439
         );
437
-        foreach ($sortParams as $param) {
438
-            if (isset($_REQUEST[$param])) {
440
+        foreach ($sortParams as $param) {
441
+            if (isset($_REQUEST[$param])) {
439 442
                 $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]);
440 443
                 $_SESSION[$param] = $_REQUEST[$param];
441
-            } else if (!isset($_SESSION[$param])) {
444
+            } else if (!isset($_SESSION[$param])) {
442 445
                 $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
443 446
             }
444 447
         }
@@ -518,9 +521,9 @@  discard block
 block discarded – undo
518 521
     </div>
519 522
 
520 523
     <?php
521
-    function constructLink($action, $img, $text, $allowed)
522
-    {
523
-        if ($allowed == 1) {
524
+    function constructLink($action, $img, $text, $allowed)
525
+    {
526
+        if ($allowed == 1) {
524 527
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
525 528
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
526 529
         }
@@ -625,7 +628,7 @@  discard block
 block discarded – undo
625 628
     ?>
626 629
 
627 630
 </div>
628
-<?php if ($modx->config['show_picker'] != "0") {
631
+<?php if ($modx->config['show_picker'] != "0") {
629 632
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
630 633
 } ?>
631 634
 </body>
Please login to merge, or discard this patch.
install/sqlParser.class.php 1 patch
Braces   +23 added lines, -10 removed lines patch added patch discarded remove patch
@@ -3,7 +3,8 @@  discard block
 block discarded – undo
3 3
 // MySQL Dump Parser
4 4
 // SNUFFKIN/ Alex 2004
5 5
 
6
-class SqlParser {
6
+class SqlParser
7
+{
7 8
 	public $host;
8 9
 	public $dbname;
9 10
 	public $prefix;
@@ -28,7 +29,8 @@  discard block
 block discarded – undo
28 29
     public $ignoreDuplicateErrors;
29 30
     public $autoTemplateLogic;
30 31
 
31
-	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') {
32
+	public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent')
33
+	{
32 34
 		$this->host = $host;
33 35
 		$this->dbname = $db;
34 36
 		$this->prefix = $prefix;
@@ -44,10 +46,13 @@  discard block
 block discarded – undo
44 46
         $this->autoTemplateLogic = $auto_template_logic;
45 47
 	}
46 48
 
47
-	public function connect() {
49
+	public function connect()
50
+	{
48 51
 		$this->conn = mysqli_connect($this->host, $this->user, $this->password);
49 52
 		mysqli_select_db($this->conn, $this->dbname);
50
-		if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset);
53
+		if (function_exists('mysqli_set_charset')) {
54
+		    mysqli_set_charset($this->conn, $this->connection_charset);
55
+		}
51 56
 
52 57
 		$this->dbVersion = 3.23; // assume version 3.23
53 58
 		if(function_exists("mysqli_get_server_info")) {
@@ -59,7 +64,8 @@  discard block
 block discarded – undo
59 64
         mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}");
60 65
 	}
61 66
 
62
-    public function process($filename) {
67
+    public function process($filename)
68
+    {
63 69
 	    global $custom_placeholders;
64 70
 
65 71
 		// check to make sure file exists
@@ -114,7 +120,9 @@  discard block
 block discarded – undo
114 120
 		foreach($sql_array as $sql_entry) {
115 121
 			$sql_do = trim($sql_entry, "\r\n; ");
116 122
 
117
-			if (preg_match('/^\#/', $sql_do)) continue;
123
+			if (preg_match('/^\#/', $sql_do)) {
124
+			    continue;
125
+			}
118 126
 
119 127
 			// strip out comments and \n for mysql 3.x
120 128
 			if ($this->dbVersion <4.0) {
@@ -125,11 +133,15 @@  discard block
 block discarded – undo
125 133
 
126 134
 
127 135
 			$num = $num + 1;
128
-			if ($sql_do) mysqli_query($this->conn, $sql_do);
136
+			if ($sql_do) {
137
+			    mysqli_query($this->conn, $sql_do);
138
+			}
129 139
 			if(mysqli_error($this->conn)) {
130 140
 				// Ignore duplicate and drop errors - Raymond
131
-				if ($this->ignoreDuplicateErrors){
132
-					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue;
141
+				if ($this->ignoreDuplicateErrors) {
142
+					if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) {
143
+					    continue;
144
+					}
133 145
 				}
134 146
 				// End Ignore duplicate
135 147
 				$this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do);
@@ -138,7 +150,8 @@  discard block
 block discarded – undo
138 150
 		}
139 151
 	}
140 152
 
141
-    public function close() {
153
+    public function close()
154
+    {
142 155
 		mysqli_close($this->conn);
143 156
 	}
144 157
 }
Please login to merge, or discard this patch.
manager/actions/bkmanager.static.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -597,7 +597,9 @@
 block discarded – undo
597 597
                 $insertdump = $lf;
598 598
                 $insertdump .= "INSERT INTO `{$tblval}` VALUES (";
599 599
                 $arr = $this->object2Array($row);
600
-                if( ! is_array($arr)) $arr = array();
600
+                if( ! is_array($arr)) {
601
+                    $arr = array();
602
+                }
601 603
                 foreach ($arr as $key => $value) {
602 604
                     if (is_null($value)) {
603 605
                         $value = 'NULL';
Please login to merge, or discard this patch.