Completed
Pull Request — develop (#522)
by Agel_Nash
07:16
created
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.