Completed
Pull Request — develop (#716)
by Serg
08:10 queued 01:53
created
manager/actions/mutate_categories.dynamic.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,16 +27,14 @@
 block discarded – undo
27 27
 $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager();
28 28
 
29 29
 // assign module_params to internal params
30
-foreach( $_module_params as $param => $value )
31
-{
30
+foreach( $_module_params as $param => $value ) {
32 31
 	$cm->set( $param, $value );
33 32
 }
34 33
 
35 34
 // catch the request actions
36 35
 include_once $cm->get('inc_dir') . 'request_trigger.inc.php';
37 36
 
38
-if( !$categories = $cm->getCategories() )
39
-{
37
+if( !$categories = $cm->getCategories() ) {
40 38
 	setcookie('webfxtab_manage-categories-pane', 0 );
41 39
 	$cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' );
42 40
 }
Please login to merge, or discard this patch.
manager/actions/category_mgr/inc/Categories.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,4 +4,6 @@
 block discarded – undo
4 4
  * Class to handle the modx-categories
5 5
  * @deprecated use EvolutionCMS\Legacy\Categories
6 6
  */
7
-class Categories extends EvolutionCMS\Legacy\Categories{}
7
+class Categories extends EvolutionCMS\Legacy\Categories
8
+{
9
+}
Please login to merge, or discard this patch.
manager/processors/execute_module.processor.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 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
Please login to merge, or discard this patch.
manager/processors/duplicate_module.processor.php 1 patch
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,11 @@
 block discarded – undo
31 31
 // count duplicates
32 32
 $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'"));
33 33
 $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'"));
34
-if($count>=1) $count = ' '.($count+1);
35
-else $count = '';
34
+if($count>=1) {
35
+    $count = ' '.($count+1);
36
+} else {
37
+    $count = '';
38
+}
36 39
 
37 40
 // duplicate module
38 41
 $newid = $modx->db->insert(
Please login to merge, or discard this patch.
manager/processors/move_document.processor.php 1 patch
Braces   +14 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,12 +12,20 @@  discard block
 block discarded – undo
12 12
 // ok, two things to check.
13 13
 // first, document cannot be moved to itself
14 14
 // second, new parent must be a folder. If not, set it to folder.
15
-if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]);
16
-if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
17
-if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]);
15
+if($documentID==$newParentID) {
16
+    $modx->webAlertAndQuit($_lang["error_movedocument1"]);
17
+}
18
+if($documentID <= 0) {
19
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
20
+}
21
+if($newParentID < 0) {
22
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
23
+}
18 24
 
19 25
 $parents = $modx->getParentIds($newParentID);
20
-if (in_array($documentID, $parents))  $modx->webAlertAndQuit($_lang["error_movedocument2"]);
26
+if (in_array($documentID, $parents)) {
27
+    $modx->webAlertAndQuit($_lang["error_movedocument2"]);
28
+}
21 29
 
22 30
 $rs = $modx->db->select('parent', $modx->getFullTableName('site_content'), "id='{$documentID}'");
23 31
 $oldparent = $modx->db->getValue($rs);
@@ -62,11 +70,11 @@  discard block
 block discarded – undo
62 70
 	"old_parent" => $oldparent,
63 71
 	"new_parent" => $newParentID
64 72
 ));
65
-if (is_array($evtOut) && count($evtOut) > 0){
73
+if (is_array($evtOut) && count($evtOut) > 0) {
66 74
 	$newParent = array_pop($evtOut);
67 75
 	if($newParent == $oldparent) {
68 76
 		$modx->webAlertAndQuit($_lang["error_movedocument2"]);
69
-	}else{
77
+	} else {
70 78
 		$newParentID = $newParent;
71 79
 	}
72 80
 }
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Braces   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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
-switch($modx->manager->action) {
5
+switch($modx->manager->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if(!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if(!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 // check to see the module editor isn't locked
34
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
34
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
35 35
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
 // Lock snippet for other users to edit
40 40
 $modx->lockElement(6, $id);
41 41
 
42
-if(isset($_GET['id'])) {
42
+if(isset($_GET['id'])) {
43 43
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
44 44
 	$content = $modx->db->getRow($rs);
45
-	if(!$content) {
45
+	if(!$content) {
46 46
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47 47
 	}
48 48
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49 49
 	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
50
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51 51
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52 52
 	}
53
-} else {
53
+} else {
54 54
 	$_SESSION['itemname'] = $_lang["new_module"];
55 55
 	$content['wrap'] = '1';
56 56
 }
57
-if($modx->manager->hasFormValues()) {
57
+if($modx->manager->hasFormValues()) {
58 58
 	$modx->manager->loadFormValues();
59 59
 }
60 60
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	<?php
429 429
 	// invoke OnModFormPrerender event
430 430
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
431
+	if(is_array($evtOut)) {
432 432
 		echo implode('', $evtOut);
433 433
 	}
434 434
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493 493
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
494
+								foreach(getCategories() as $n => $v) {
495 495
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
496 496
 								}
497 497
 								?>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644 644
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
646
+					if($modx->hasPermission('access_permissions')) {
647 647
 						?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
@@ -671,21 +671,21 @@  discard block
 block discarded – undo
671 671
 					}
672 672
 					$chk = '';
673 673
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->db->getRow($rs)) {
674
+					while($row = $modx->db->getRow($rs)) {
675 675
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676 676
 						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
677
+						if($modx->hasPermission('access_permissions')) {
678
+							if($checked) {
679 679
 								$notPublic = true;
680 680
 							}
681 681
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
682
-						} else {
683
-							if($checked) {
682
+						} else {
683
+							if($checked) {
684 684
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
685 685
 							}
686 686
 						}
687 687
 					}
688
-					if($modx->hasPermission('access_permissions')) {
688
+					if($modx->hasPermission('access_permissions')) {
689 689
 						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
690 690
 					}
691 691
 					echo $chks;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		<?php
708 708
 		// invoke OnModFormRender event
709 709
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
710
+		if(is_array($evtOut)) {
711 711
 			echo implode('', $evtOut);
712 712
 		}
713 713
 		?>
Please login to merge, or discard this patch.
manager/actions/logging.static.php 1 patch
Braces   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if (!$modx->hasPermission('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
                             <?php
27 27
                             // get all users currently in the log
28 28
                             $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username');
29
-                            foreach ($logs_user as $row) {
29
+                            foreach ($logs_user as $row) {
30 30
                                 $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : '';
31 31
                                 echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n";
32 32
                             }
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
                             // get all available actions in the log
44 44
                             include_once "actionlist.inc.php";
45 45
                             $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action');
46
-                            foreach ($logs_actions as $row) {
46
+                            foreach ($logs_actions as $row) {
47 47
                                 $action = getAction($row['action']);
48
-                                if ($action == 'Idle') {
48
+                                if ($action == 'Idle') {
49 49
                                     continue;
50 50
                                 }
51 51
                                 $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : '';
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                             <?php
64 64
                             // get all itemid currently in logging
65 65
                             $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid');
66
-                            foreach ($logs_items as $row) {
66
+                            foreach ($logs_items as $row) {
67 67
                                 $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : '';
68 68
                                 echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n";
69 69
                             }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                             <?php
80 80
                             // get all itemname currently in logging
81 81
                             $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname');
82
-                            foreach ($logs_names as $row) {
82
+                            foreach ($logs_names as $row) {
83 83
                                 $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : '';
84 84
                                 echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n";
85 85
                             }
@@ -135,36 +135,36 @@  discard block
 block discarded – undo
135 135
     <div class="container container-body">
136 136
 
137 137
 <?php
138
-if (isset($_REQUEST['log_submit'])) {
138
+if (isset($_REQUEST['log_submit'])) {
139 139
     // get the selections the user made.
140 140
     $sqladd = array();
141
-    if ($_REQUEST['searchuser'] != 0) {
141
+    if ($_REQUEST['searchuser'] != 0) {
142 142
         $sqladd[] = "internalKey='" . (int)$_REQUEST['searchuser'] . "'";
143 143
     }
144
-    if ($_REQUEST['action'] != 0) {
144
+    if ($_REQUEST['action'] != 0) {
145 145
         $sqladd[] = "action=" . (int)$_REQUEST['action'];
146 146
     }
147
-    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
147
+    if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
148 148
         $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'";
149 149
     }
150
-    if ($_REQUEST['itemname'] != '0') {
150
+    if ($_REQUEST['itemname'] != '0') {
151 151
         $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'";
152 152
     }
153
-    if ($_REQUEST['message'] != "") {
153
+    if ($_REQUEST['message'] != "") {
154 154
         $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'";
155 155
     }
156 156
     // date stuff
157
-    if ($_REQUEST['datefrom'] != "") {
157
+    if ($_REQUEST['datefrom'] != "") {
158 158
         $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']);
159 159
     }
160
-    if ($_REQUEST['dateto'] != "") {
160
+    if ($_REQUEST['dateto'] != "") {
161 161
         $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']);
162 162
     }
163 163
 
164 164
     // If current position is not set, set it to zero
165
-    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
165
+    if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
166 166
         $int_cur_position = 0;
167
-    } else {
167
+    } else {
168 168
         $int_cur_position = $_REQUEST['int_cur_position'];
169 169
     }
170 170
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 
179 179
     $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
180 180
 
181
-if ($limit < 1) {
181
+if ($limit < 1) {
182 182
     echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>';
183
-} else {
183
+} else {
184 184
     echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>';
185 185
 
186 186
     // New instance of the Paging class, you can modify the color and the width of the html table
@@ -198,14 +198,14 @@  discard block
 block discarded – undo
198 198
     $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " ");
199 199
     $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " ");
200 200
     $pagesfound = sizeof($array_row_paging);
201
-    if ($pagesfound > 6) {
201
+    if ($pagesfound > 6) {
202 202
         $paging .= $array_row_paging[$current_row - 2]; // ."&nbsp;";
203 203
         $paging .= $array_row_paging[$current_row - 1]; // ."&nbsp;";
204 204
         $paging .= $array_row_paging[$current_row]; // ."&nbsp;";
205 205
         $paging .= $array_row_paging[$current_row + 1]; // ."&nbsp;";
206 206
         $paging .= $array_row_paging[$current_row + 2]; // ."&nbsp;";
207
-    } else {
208
-        for ($i = 0; $i < $pagesfound; $i++) {
207
+    } else {
208
+        for ($i = 0; $i < $pagesfound; $i++) {
209 209
             $paging .= $array_row_paging[$i] . "&nbsp;";
210 210
         }
211 211
     }
@@ -242,12 +242,12 @@  discard block
 block discarded – undo
242 242
                 // grab the entire log file...
243 243
                 $logentries = array();
244 244
                 $i = 0;
245
-                while ($logentry = $modx->db->getRow($rs)) {
246
-                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
245
+                while ($logentry = $modx->db->getRow($rs)) {
246
+                    if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
247 247
                         $item = '<div style="text-align:center;">-</div>';
248
-                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
248
+                    } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
249 249
                         $item = '<a href="index.php?a=3&amp;id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>';
250
-                    } else {
250
+                    } else {
251 251
                         $item = $logentry['itemname'];
252 252
                     }
253 253
                     //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true'
@@ -284,6 +284,6 @@  discard block
 block discarded – undo
284 284
     // @see index.php @ 915
285 285
     global $action;
286 286
     $action = 1;
287
-} else {
287
+} else {
288 288
     echo $_lang["mgrlog_noquery"];
289 289
 }
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
@@ -491,4 +491,6 @@
 block discarded – undo
491 491
 /**
492 492
  * @deprecated use EvolutionCMS\Support\MysqlDumper
493 493
  */
494
-class Mysqldumper extends EvolutionCMS\Support\MysqlDumper{}
494
+class Mysqldumper extends EvolutionCMS\Support\MysqlDumper
495
+{
496
+}
Please login to merge, or discard this patch.
manager/actions/welcome.static.php 1 patch
Braces   +48 added lines, -46 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
 unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes
7 7
 
8
-if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
8
+if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
9 9
 	// seems to be a new install - send the user to the configuration page
10 10
 	exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
11 11
 }
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 $_SESSION['nrnewmessages'] = 0;
17 17
 
18 18
 // setup message info
19
-if($modx->hasPermission('messages')) {
19
+if($modx->hasPermission('messages')) {
20 20
 	include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php');
21 21
 	$_SESSION['nrtotalmessages'] = $nrtotalmessages;
22 22
 	$_SESSION['nrnewmessages'] = $nrnewmessages;
@@ -33,46 +33,46 @@  discard block
 block discarded – undo
33 33
 
34 34
 $iconTpl = $managerTheme->getPartial('welcome/WrapIcon');
35 35
 // setup icons
36
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36
+if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
37 37
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
38 38
 	$ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75);
39 39
 }
40
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40
+if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
41 41
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
42 42
 	$ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99);
43 43
 }
44
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
45 45
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
46 46
 	$ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106);
47 47
 }
48
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
48
+if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
49 49
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
50 50
 	$ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76);
51 51
 }
52
-if($modx->hasPermission('bk_manager')) {
52
+if($modx->hasPermission('bk_manager')) {
53 53
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
54 54
 	$ph['BackupIcon'] = sprintf($iconTpl,$icon, 93);
55 55
 }
56
-if($modx->hasPermission('help')) {
56
+if($modx->hasPermission('help')) {
57 57
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
58 58
 	$ph['HelpIcon'] = sprintf($iconTpl,$icon, 9);
59 59
 }
60 60
 
61
-if($modx->hasPermission('new_document')) {
61
+if($modx->hasPermission('new_document')) {
62 62
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
63 63
 	$ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4);
64 64
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
65 65
 	$ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72);
66 66
 }
67
-if($modx->hasPermission('assets_images')) {
67
+if($modx->hasPermission('assets_images')) {
68 68
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
69 69
 	$ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72);
70 70
 }
71
-if($modx->hasPermission('assets_files')) {
71
+if($modx->hasPermission('assets_files')) {
72 72
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
73 73
 	$ph['FilesIcon'] = sprintf($iconTpl,$icon, 72);
74 74
 }
75
-if($modx->hasPermission('change_password')) {
75
+if($modx->hasPermission('change_password')) {
76 76
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
77 77
 	$ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28);
78 78
 }
@@ -80,21 +80,21 @@  discard block
 block discarded – undo
80 80
 $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8);
81 81
 
82 82
 // do some config checks
83
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83
+if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
84 84
 	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
85
-	if($config_check_results != $_lang['configcheck_ok']) {
85
+	if($config_check_results != $_lang['configcheck_ok']) {
86 86
 		$ph['config_check_results'] = $config_check_results;
87 87
 		$ph['config_display'] = 'block';
88
-	} else {
88
+	} else {
89 89
 		$ph['config_display'] = 'none';
90 90
 	}
91
-} else {
91
+} else {
92 92
 	$ph['config_display'] = 'none';
93 93
 }
94 94
 
95 95
 // Check logout-reminder
96
-if(isset($_SESSION['show_logout_reminder'])) {
97
-	switch($_SESSION['show_logout_reminder']['type']) {
96
+if(isset($_SESSION['show_logout_reminder'])) {
97
+	switch($_SESSION['show_logout_reminder']['type']) {
98 98
 		case 'logout_reminder':
99 99
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
100 100
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	}
103 103
 	$ph['show_logout_reminder'] = 'block';
104 104
 	unset($_SESSION['show_logout_reminder']);
105
-} else {
105
+} else {
106 106
 	$ph['show_logout_reminder'] = 'none';
107 107
 }
108 108
 
@@ -164,9 +164,9 @@  discard block
 block discarded – undo
164 164
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
165 165
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
166 166
 
167
-if($modx->db->getRecordCount($rs) < 1) {
167
+if($modx->db->getRecordCount($rs) < 1) {
168 168
 	$html = '<p>[%no_active_users_found%]</p>';
169
-} else {
169
+} else {
170 170
 	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
171 171
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
172 172
 	$ph['now'] = strftime('%H:%M:%S', $now);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 	$userList = array();
193 193
 	$userCount = array();
194 194
 	// Create userlist with session-count first before output
195
-	while($activeusers = $modx->db->getRow($rs)) {
195
+	while($activeusers = $modx->db->getRow($rs)) {
196 196
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
197 197
 
198 198
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 			$currentaction
211 211
 		);
212 212
 	}
213
-	foreach($userList as $params) {
213
+	foreach($userList as $params) {
214 214
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
215 215
 		$html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
216 216
 	}
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
 // invoke event OnManagerWelcomePrerender
257 257
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
258
-if(is_array($evtOut)) {
258
+if(is_array($evtOut)) {
259 259
 	$output = implode('', $evtOut);
260 260
 	$ph['OnManagerWelcomePrerender'] = $output;
261 261
 }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
361 361
 	'hide'=>'0'
362 362
 );
363
-if ($modx->config['rss_url_news']) {
363
+if ($modx->config['rss_url_news']) {
364 364
     $widgets['news'] = array(
365 365
         'menuindex' => '40',
366 366
         'id' => 'news',
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
         'hide'=>'0'
372 372
     );
373 373
 }
374
-if ($modx->config['rss_url_security']) {
374
+if ($modx->config['rss_url_security']) {
375 375
     $widgets['security'] = array(
376 376
         'menuindex' => '50',
377 377
         'id' => 'security',
@@ -385,29 +385,29 @@  discard block
 block discarded – undo
385 385
 
386 386
 // invoke OnManagerWelcomeHome event
387 387
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
388
-if(is_array($sitewidgets)) {
388
+if(is_array($sitewidgets)) {
389 389
 	$newwidgets = array();
390
-    foreach($sitewidgets as $widget){
390
+    foreach($sitewidgets as $widget) {
391 391
         $newwidgets = array_merge($newwidgets, unserialize($widget));
392 392
     }
393 393
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
394 394
 }
395 395
 
396
-usort($widgets, function ($a, $b) {
396
+usort($widgets, function ($a, $b){
397 397
 	return $a['menuindex'] - $b['menuindex'];
398 398
 });
399 399
 
400 400
 $tpl = $managerTheme->getPartial('welcome/Widget');
401 401
 $output = '';
402
-foreach($widgets as $widget) {
403
-	if ($widget['hide'] != '1'){
402
+foreach($widgets as $widget) {
403
+	if ($widget['hide'] != '1') {
404 404
 		$output .= $modx->parseText($tpl, $widget);
405 405
 	}
406 406
 }
407 407
 $ph['widgets'] = $output;
408 408
 
409 409
 // load template
410
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
410
+if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
411 411
 	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
412 412
 }
413 413
 
@@ -415,26 +415,28 @@  discard block
 block discarded – undo
415 415
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
416 416
 $target = $modx->mergeSettingsContent($target);
417 417
 
418
-if(substr($target, 0, 1) === '@') {
419
-	if(substr($target, 0, 6) === '@CHUNK') {
418
+if(substr($target, 0, 1) === '@') {
419
+	if(substr($target, 0, 6) === '@CHUNK') {
420 420
 		$content = $modx->getChunk(trim(substr($target, 7)));
421
-	} elseif(substr($target, 0, 5) === '@FILE') {
421
+	} elseif(substr($target, 0, 5) === '@FILE') {
422 422
 		$content = file_get_contents(trim(substr($target, 6)));
423
-	} else {
423
+	} else {
424 424
 		$content = '';
425 425
 	}
426
-} else {
426
+} else {
427 427
 	$chunk = $modx->getChunk($target);
428
-	if($chunk !== false && !empty($chunk)) {
428
+	if($chunk !== false && !empty($chunk)) {
429 429
 		$content = $chunk;
430
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
430
+	} elseif(is_file(MODX_BASE_PATH . $target)) {
431 431
 		$content = file_get_contents(MODX_BASE_PATH . $target);
432
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
432
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
433 433
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
434
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
434
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) {
435
+	    // ClipperCMS compatible
435 436
 	{
436
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
437
-	} else {
437
+		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
438
+	}
439
+	} else {
438 440
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
439 441
 	}
440 442
 }
@@ -443,7 +445,7 @@  discard block
 block discarded – undo
443 445
 $content = $modx->mergeConditionalTagsContent($content);
444 446
 $content = $modx->mergeSettingsContent($content);
445 447
 $content = $modx->parseText($content, $ph);
446
-if(strpos($content, '[+') !== false) {
448
+if(strpos($content, '[+') !== false) {
447 449
 	$modx->toPlaceholders($ph);
448 450
 	$content = $modx->mergePlaceholderContent($content);
449 451
 }
@@ -452,7 +454,7 @@  discard block
 block discarded – undo
452 454
 $content = $modx->parseText($content, $_style, '[&', '&]');
453 455
 $content = $modx->cleanUpMODXTags($content); //cleanup
454 456
 
455
-if($js = $modx->getRegisteredClientScripts()) {
457
+if($js = $modx->getRegisteredClientScripts()) {
456 458
 	$content .= $js;
457 459
 }
458 460
 
Please login to merge, or discard this patch.