Completed
Pull Request — develop (#716)
by Agel_Nash
09:56
created
manager/frames/1.php 1 patch
Braces   +32 added lines, -29 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,29 +35,29 @@  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 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
49
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50 50
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
51
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
51
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52 52
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
56
-if ($navbar_position == 'left') {
56
+if ($navbar_position == 'left') {
57 57
     $body_class .= ' navbar-left navbar-left-icon-and-text';
58 58
 }
59 59
 
60
-if (isset($modx->pluginCache['ElementsInTree'])) {
60
+if (isset($modx->pluginCache['ElementsInTree'])) {
61 61
     $body_class .= ' ElementsInTree';
62 62
 }
63 63
 
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
     'type8' => $_lang["lock_element_type_8"]
74 74
 );
75 75
 
76
-foreach ($unlockTranslations as $key => $value) {
76
+foreach ($unlockTranslations as $key => $value) {
77 77
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
78 78
 }
79 79
 
80 80
 $user = $modx->getUserInfo($modx->getLoginUserID());
81
-if ($user['which_browser'] == 'default') {
81
+if ($user['which_browser'] == 'default') {
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85 85
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
86 86
 
87
-if ($modx->config['manager_theme'] == 'default') {
88
-    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')) {
87
+if ($modx->config['manager_theme'] == 'default') {
88
+    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')) {
89 89
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91 91
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $css = $minifier->minify();
103 103
         file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
105
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106 106
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
107 107
     }
108 108
 }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     <?php
258 258
     // invoke OnManagerTopPrerender event
259 259
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
260
-    if (is_array($evtOut)) {
260
+    if (is_array($evtOut)) {
261 261
         echo implode("\n", $evtOut);
262 262
     }
263 263
     ?>
@@ -428,11 +428,14 @@  discard block
 block discarded – undo
428 428
             <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller">
429 429
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
430 430
             </div>
431
-        <?php else: ?>
431
+        <?php else {
432
+    : ?>
432 433
             <div class="iframe-scroller">
433 434
                 <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
434 435
             </div>
435
-        <?php endif; ?>
436
+        <?php endif;
437
+}
438
+?>
436 439
         <script>
437 440
             if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
438 441
                 document.getElementById('mainframe').setAttribute('scrolling', 'no');
@@ -451,11 +454,11 @@  discard block
 block discarded – undo
451 454
             'tree_sortdir',
452 455
             'tree_nodename'
453 456
         );
454
-        foreach ($sortParams as $param) {
455
-            if (isset($_REQUEST[$param])) {
457
+        foreach ($sortParams as $param) {
458
+            if (isset($_REQUEST[$param])) {
456 459
                 $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]);
457 460
                 $_SESSION[$param] = $_REQUEST[$param];
458
-            } else if (!isset($_SESSION[$param])) {
461
+            } else if (!isset($_SESSION[$param])) {
459 462
                 $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
460 463
             }
461 464
         }
@@ -535,16 +538,16 @@  discard block
 block discarded – undo
535 538
     </div>
536 539
 
537 540
     <?php
538
-    if(!function_exists('constructLink')) {
541
+    if(!function_exists('constructLink')) {
539 542
         /**
540 543
          * @param string $action
541 544
          * @param string $img
542 545
          * @param string $text
543 546
          * @param bool $allowed
544 547
          */
545
-        function constructLink($action, $img, $text, $allowed)
546
-        {
547
-            if ((bool)$allowed) {
548
+        function constructLink($action, $img, $text, $allowed)
549
+        {
550
+            if ((bool)$allowed) {
548 551
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
549 552
                     $action);
550 553
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -651,7 +654,7 @@  discard block
 block discarded – undo
651 654
     ?>
652 655
 
653 656
 </div>
654
-<?php if ($modx->config['show_picker'] != "0") {
657
+<?php if ($modx->config['show_picker'] != "0") {
655 658
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
656 659
 } ?>
657 660
 </body>
Please login to merge, or discard this patch.
manager/actions/mutate_content.dynamic.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -476,7 +476,8 @@  discard block
 block discarded – undo
476 476
 			return s;
477 477
 		}
478 478
 
479
-		<?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?>
479
+		<?php if ($content['type'] == 'reference' || $modx->manager->action == '72') {
480
+// Web Link specific ?>
480 481
 		var lastImageCtrl;
481 482
 		var lastFileCtrl;
482 483
 
@@ -692,7 +693,8 @@  discard block
 block discarded – undo
692 693
 									</td>
693 694
 								</tr>
694 695
 
695
-								<?php if($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific ?>
696
+								<?php if($content['type'] == 'reference' || $modx->manager->action == '72') {
697
+// Web Link specific ?>
696 698
 
697 699
 									<tr>
698 700
 										<td><span class="warning"><?= $_lang['weblink'] ?></span>
@@ -1370,7 +1372,9 @@  discard block
 block discarded – undo
1370 1372
 						if($documentId > 0) {
1371 1373
 							// Load up, the permissions from the parent (if new document) or existing document
1372 1374
 							$rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'");
1373
-							while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1375
+							while($currentgroup = $modx->db->getRow($rs)) {
1376
+							    $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1377
+							}
1374 1378
 
1375 1379
 							// Load up the current permissions and names
1376 1380
 							$vs = array(
@@ -1432,7 +1436,9 @@  discard block
 block discarded – undo
1432 1436
 
1433 1437
 							// Create attribute string list
1434 1438
 							$inputString = array();
1435
-							foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"';
1439
+							foreach($inputAttributes as $k => $v) {
1440
+							    $inputString[] = $k . '="' . $v . '"';
1441
+							}
1436 1442
 
1437 1443
 							// Make the <input> HTML
1438 1444
 							$inputHTML = '<input ' . implode(' ', $inputString) . ' />';
Please login to merge, or discard this patch.
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/resources/mgrResources.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,4 +3,6 @@
 block discarded – undo
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
-class mgrResources extends EvolutionCMS\Legacy\mgrResources{}
6
+class mgrResources extends EvolutionCMS\Legacy\mgrResources
7
+{
8
+}
Please login to merge, or discard this patch.
manager/actions/resources/functions.inc.php 1 patch
Braces   +37 added lines, -37 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
 
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 	'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl')
12 12
 );
13 13
 
14
-if(!function_exists('parsePh')) {
14
+if(!function_exists('parsePh')) {
15 15
     /**
16 16
      * @param string $tpl
17 17
      * @param array $ph
18 18
      * @return string
19 19
      */
20
-    function parsePh($tpl, $ph)
21
-    {
20
+    function parsePh($tpl, $ph)
21
+    {
22 22
         $modx = evolutionCMS();
23 23
         global $_lang;
24 24
         $tpl = $modx->parseText($tpl, $_lang, '[%', '%]');
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     }
28 28
 }
29 29
 
30
-if(!function_exists('renderViewSwitchButtons')) {
30
+if(!function_exists('renderViewSwitchButtons')) {
31 31
     /**
32 32
      * @param string|int $cssId
33 33
      * @return string
34 34
      */
35
-    function renderViewSwitchButtons($cssId)
36
-    {
35
+    function renderViewSwitchButtons($cssId)
36
+    {
37 37
         $modx = evolutionCMS();
38 38
         global $_lang, $tpl;
39 39
 
@@ -43,27 +43,27 @@  discard block
 block discarded – undo
43 43
     }
44 44
 }
45 45
 
46
-if(!function_exists('createResourceList')) {
46
+if(!function_exists('createResourceList')) {
47 47
     /**
48 48
      * @param string $resourceTable
49 49
      * @param mgrResources $resources
50 50
      * @return string
51 51
      */
52
-    function createResourceList($resourceTable, $resources)
53
-    {
52
+    function createResourceList($resourceTable, $resources)
53
+    {
54 54
         $modx = evolutionCMS();
55 55
         global $_lang, $_style, $modx_textdir, $tpl;
56 56
 
57 57
         $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false;
58 58
 
59
-        if (!is_array($items) || empty($items)) {
59
+        if (!is_array($items) || empty($items)) {
60 60
             return $_lang['no_results'];
61 61
         }
62 62
 
63 63
         // Prepare elements- and categories-list
64 64
         $elements = array();
65 65
         $categories = array();
66
-        foreach ($items as $row) {
66
+        foreach ($items as $row) {
67 67
             $catid = $row['catid'] ? $row['catid'] : 0;
68 68
             $categories[$catid] = array('name' => stripslashes($row['category']));
69 69
             $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         // Now render categories / panel-collapse
73 73
         $panelGroup = '';
74
-        foreach ($elements as $catid => $elList) {
74
+        foreach ($elements as $catid => $elList) {
75 75
             // Add panel-heading / category-collapse to output
76 76
             $panelGroup .= parsePh($tpl['panelHeading'], array(
77 77
                 'tab'        => $resourceTable,
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
             // Prepare content for panel-collapse
84 84
             $panelCollapse = '';
85
-            foreach ($elList as $el) {
85
+            foreach ($elList as $el) {
86 86
                 $panelCollapse .= parsePh($tpl['elementsRow'], $el);
87 87
             }
88 88
 
@@ -101,13 +101,13 @@  discard block
 block discarded – undo
101 101
     }
102 102
 }
103 103
 
104
-if(!function_exists('createCombinedView')) {
104
+if(!function_exists('createCombinedView')) {
105 105
     /**
106 106
      * @param mgrResources $resources
107 107
      * @return string
108 108
      */
109
-    function createCombinedView($resources)
110
-    {
109
+    function createCombinedView($resources)
110
+    {
111 111
         $modx = evolutionCMS();
112 112
         global $_lang, $_style, $modx_textdir;
113 113
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         $types = isset($resources->types) ? $resources->types : false;
116 116
         $categories = isset($resources->categories) ? $resources->categories : false;
117 117
 
118
-        if (!$itemsPerCategory) {
118
+        if (!$itemsPerCategory) {
119 119
             return $_lang['no_results'];
120 120
         }
121 121
 
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
 
129 129
         // Easily loop through $itemsPerCategory-Array
130 130
         $panelGroup = '';
131
-        foreach ($categories as $catid => $category) {
131
+        foreach ($categories as $catid => $category) {
132 132
             // Prepare collapse content / elements-list
133 133
             $panelCollapse = '';
134
-            foreach ($itemsPerCategory[$catid] as $el) {
134
+            foreach ($itemsPerCategory[$catid] as $el) {
135 135
                 $resourceTable = $el['type'];
136 136
                 $ph = prepareElementRowPh($el, $resourceTable, $resources);
137 137
                 $panelCollapse .= parsePh($tpl['elementsRow'], $ph);
@@ -160,15 +160,15 @@  discard block
 block discarded – undo
160 160
     }
161 161
 }
162 162
 
163
-if(!function_exists('prepareElementRowPh')) {
163
+if(!function_exists('prepareElementRowPh')) {
164 164
     /**
165 165
      * @param array $row
166 166
      * @param string $resourceTable
167 167
      * @param mgrResources $resources
168 168
      * @return array
169 169
      */
170
-    function prepareElementRowPh($row, $resourceTable, $resources)
171
-    {
170
+    function prepareElementRowPh($row, $resourceTable, $resources)
171
+    {
172 172
         $modx = evolutionCMS();
173 173
         global $modx_textdir, $_style, $_lang;
174 174
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
         $_lang["confirm_delete"] = $_lang["delete"];
178 178
 
179
-        switch ($resourceTable) {
179
+        switch ($resourceTable) {
180 180
             case 'site_templates':
181 181
                 $class = $row['selectable'] ? '' : 'disabledPlugin';
182 182
                 $lockElementType = 1;
@@ -213,56 +213,56 @@  discard block
 block discarded – undo
213 213
         // Prepare displaying user-locks
214 214
         $lockedByUser = '';
215 215
         $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true);
216
-        if ($rowLock && $modx->hasPermission('display_locks')) {
217
-            if ($rowLock['sid'] == $modx->sid) {
216
+        if ($rowLock && $modx->hasPermission('display_locks')) {
217
+            if ($rowLock['sid'] == $modx->sid) {
218 218
                 $title = $modx->parseText($_lang["lock_element_editing"], array(
219 219
                     'element_type' => $_lang["lock_element_type_" . $lockElementType],
220 220
                     'lasthit_df'   => $rowLock['lasthit_df']
221 221
                 ));
222 222
                 $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span>&nbsp;';
223
-            } else {
223
+            } else {
224 224
                 $title = $modx->parseText($_lang["lock_element_locked_by"], array(
225 225
                     'element_type' => $_lang["lock_element_type_" . $lockElementType],
226 226
                     'username'     => $rowLock['username'],
227 227
                     'lasthit_df'   => $rowLock['lasthit_df']
228 228
                 ));
229
-                if ($modx->hasPermission('remove_locks')) {
229
+                if ($modx->hasPermission('remove_locks')) {
230 230
                     $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
231
-                } else {
231
+                } else {
232 232
                     $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>';
233 233
                 }
234 234
             }
235 235
         }
236
-        if ($lockedByUser) {
236
+        if ($lockedByUser) {
237 237
             $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>';
238 238
         }
239 239
 
240 240
         // Caption
241
-        if ($resourceTable == 'site_tmplvars') {
241
+        if ($resourceTable == 'site_tmplvars') {
242 242
             $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' &nbsp; <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
243
-        } else {
243
+        } else {
244 244
             $caption = !empty($row['description']) ? ' ' . $row['description'] : '';
245 245
         }
246 246
 
247 247
         // Special marks
248 248
         $tplInfo = array();
249
-        if ($row['locked']) {
249
+        if ($row['locked']) {
250 250
             $tplInfo[] = $_lang['locked'];
251 251
         }
252
-        if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
252
+        if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
253 253
             $tplInfo[] = $_lang['defaulttemplate_title'];
254 254
         }
255 255
         $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : '';
256 256
 
257 257
         /* row buttons */
258 258
         $buttons = '';
259
-        if ($modx->hasPermission($types['actions']['edit'][1])) {
259
+        if ($modx->hasPermission($types['actions']['edit'][1])) {
260 260
             $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>';
261 261
         }
262
-        if ($modx->hasPermission($types['actions']['duplicate'][1])) {
262
+        if ($modx->hasPermission($types['actions']['duplicate'][1])) {
263 263
             $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>';
264 264
         }
265
-        if ($modx->hasPermission($types['actions']['remove'][1])) {
265
+        if ($modx->hasPermission($types['actions']['remove'][1])) {
266 266
             $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&amp;id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>';
267 267
         }
268 268
         $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : '';
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,7 +491,9 @@
 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
+}
495 497
 
496 498
 if(!function_exists('import_sql')) {
497 499
     /**
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/actions/mutate_module.dynamic.php 1 patch
Braces   +23 added lines, -23 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;
@@ -29,14 +29,14 @@  discard block
 block discarded – undo
29 29
 $tbl_site_templates = $modx->getFullTableName('site_templates');
30 30
 $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
31 31
 
32
-if(!function_exists('createGUID')) {
32
+if(!function_exists('createGUID')) {
33 33
     /**
34 34
      * create globally unique identifiers (guid)
35 35
      *
36 36
      * @return string
37 37
      */
38
-    function createGUID()
39
-    {
38
+    function createGUID()
39
+    {
40 40
         srand((double)microtime() * 1000000);
41 41
         $r = rand();
42 42
         $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 // check to see the module editor isn't locked
50
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
50
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
51 51
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
52 52
 }
53 53
 // end check for lock
@@ -55,22 +55,22 @@  discard block
 block discarded – undo
55 55
 // Lock snippet for other users to edit
56 56
 $modx->lockElement(6, $id);
57 57
 
58
-if(isset($_GET['id'])) {
58
+if(isset($_GET['id'])) {
59 59
 	$rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
60 60
 	$content = $modx->db->getRow($rs);
61
-	if(!$content) {
61
+	if(!$content) {
62 62
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
63 63
 	}
64 64
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
65 65
 	$_SESSION['itemname'] = $content['name'];
66
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
66
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
67 67
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
68 68
 	}
69
-} else {
69
+} else {
70 70
 	$_SESSION['itemname'] = $_lang["new_module"];
71 71
 	$content['wrap'] = '1';
72 72
 }
73
-if($modx->manager->hasFormValues()) {
73
+if($modx->manager->hasFormValues()) {
74 74
 	$modx->manager->loadFormValues();
75 75
 }
76 76
 
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 	<?php
445 445
 	// invoke OnModFormPrerender event
446 446
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
447
-	if(is_array($evtOut)) {
447
+	if(is_array($evtOut)) {
448 448
 		echo implode('', $evtOut);
449 449
 	}
450 450
 
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 								<option>&nbsp;</option>
508 508
 								<?php
509 509
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
510
-								foreach(getCategories() as $n => $v) {
510
+								foreach(getCategories() as $n => $v) {
511 511
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
512 512
 								}
513 513
 								?>
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
 					$rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
660 660
 					$groupsarray = $modx->db->getColumn('usergroup', $rs);
661 661
 
662
-					if($modx->hasPermission('access_permissions')) {
662
+					if($modx->hasPermission('access_permissions')) {
663 663
 						?>
664 664
 						<!-- User Group Access Permissions -->
665 665
 						<script type="text/javascript">
@@ -687,21 +687,21 @@  discard block
 block discarded – undo
687 687
 					}
688 688
 					$chk = '';
689 689
 					$rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
690
-					while($row = $modx->db->getRow($rs)) {
690
+					while($row = $modx->db->getRow($rs)) {
691 691
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
692 692
 						$checked = in_array($row['id'], $groupsarray);
693
-						if($modx->hasPermission('access_permissions')) {
694
-							if($checked) {
693
+						if($modx->hasPermission('access_permissions')) {
694
+							if($checked) {
695 695
 								$notPublic = true;
696 696
 							}
697 697
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
698
-						} else {
699
-							if($checked) {
698
+						} else {
699
+							if($checked) {
700 700
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
701 701
 							}
702 702
 						}
703 703
 					}
704
-					if($modx->hasPermission('access_permissions')) {
704
+					if($modx->hasPermission('access_permissions')) {
705 705
 						$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;
706 706
 					}
707 707
 					echo $chks;
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
 		<?php
724 724
 		// invoke OnModFormRender event
725 725
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
726
-		if(is_array($evtOut)) {
726
+		if(is_array($evtOut)) {
727 727
 			echo implode('', $evtOut);
728 728
 		}
729 729
 		?>
Please login to merge, or discard this patch.
manager/actions/welcome.static.php 1 patch
Braces   +87 added lines, -83 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;
@@ -32,46 +32,46 @@  discard block
 block discarded – undo
32 32
 }
33 33
 
34 34
 // setup icons
35
-if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
35
+if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
36 36
 	$icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]';
37 37
 	$ph['SecurityIcon'] = wrapIcon($icon, 75);
38 38
 }
39
-if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
39
+if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
40 40
 	$icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]';
41 41
 	$ph['WebUserIcon'] = wrapIcon($icon, 99);
42 42
 }
43
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
43
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
44 44
 	$icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]';
45 45
 	$ph['ModulesIcon'] = wrapIcon($icon, 106);
46 46
 }
47
-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')) {
47
+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 48
 	$icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]';
49 49
 	$ph['ResourcesIcon'] = wrapIcon($icon, 76);
50 50
 }
51
-if($modx->hasPermission('bk_manager')) {
51
+if($modx->hasPermission('bk_manager')) {
52 52
 	$icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]';
53 53
 	$ph['BackupIcon'] = wrapIcon($icon, 93);
54 54
 }
55
-if($modx->hasPermission('help')) {
55
+if($modx->hasPermission('help')) {
56 56
 	$icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]';
57 57
 	$ph['HelpIcon'] = wrapIcon($icon, 9);
58 58
 }
59 59
 
60
-if($modx->hasPermission('new_document')) {
60
+if($modx->hasPermission('new_document')) {
61 61
 	$icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]';
62 62
 	$ph['ResourceIcon'] = wrapIcon($icon, 4);
63 63
 	$icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]';
64 64
 	$ph['WeblinkIcon'] = wrapIcon($icon, 72);
65 65
 }
66
-if($modx->hasPermission('assets_images')) {
66
+if($modx->hasPermission('assets_images')) {
67 67
 	$icon = '<i class="[&icons_images_large&]"></i>[%images_management%]';
68 68
 	$ph['ImagesIcon'] = wrapIcon($icon, 72);
69 69
 }
70
-if($modx->hasPermission('assets_files')) {
70
+if($modx->hasPermission('assets_files')) {
71 71
 	$icon = '<i class="[&icons_files_large&]"></i>[%files_management%]';
72 72
 	$ph['FilesIcon'] = wrapIcon($icon, 72);
73 73
 }
74
-if($modx->hasPermission('change_password')) {
74
+if($modx->hasPermission('change_password')) {
75 75
 	$icon = '<i class="[&icons_password_large&]"></i>[%change_password%]';
76 76
 	$ph['PasswordIcon'] = wrapIcon($icon, 28);
77 77
 }
@@ -79,21 +79,21 @@  discard block
 block discarded – undo
79 79
 $ph['LogoutIcon'] = wrapIcon($icon, 8);
80 80
 
81 81
 // do some config checks
82
-if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
82
+if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
83 83
 	include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php');
84
-	if($config_check_results != $_lang['configcheck_ok']) {
84
+	if($config_check_results != $_lang['configcheck_ok']) {
85 85
 		$ph['config_check_results'] = $config_check_results;
86 86
 		$ph['config_display'] = 'block';
87
-	} else {
87
+	} else {
88 88
 		$ph['config_display'] = 'none';
89 89
 	}
90
-} else {
90
+} else {
91 91
 	$ph['config_display'] = 'none';
92 92
 }
93 93
 
94 94
 // Check logout-reminder
95
-if(isset($_SESSION['show_logout_reminder'])) {
96
-	switch($_SESSION['show_logout_reminder']['type']) {
95
+if(isset($_SESSION['show_logout_reminder'])) {
96
+	switch($_SESSION['show_logout_reminder']['type']) {
97 97
 		case 'logout_reminder':
98 98
 			$date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly');
99 99
 			$ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	}
102 102
 	$ph['show_logout_reminder'] = 'block';
103 103
 	unset($_SESSION['show_logout_reminder']);
104
-} else {
104
+} else {
105 105
 	$ph['show_logout_reminder'] = 'none';
106 106
 }
107 107
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
 $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'";
163 163
 $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
164 164
 
165
-if($modx->db->getRecordCount($rs) < 1) {
165
+if($modx->db->getRecordCount($rs) < 1) {
166 166
 	$html = '<p>[%no_active_users_found%]</p>';
167
-} else {
167
+} else {
168 168
 	include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php');
169 169
 	$now = $_SERVER['REQUEST_TIME'] + $server_offset_time;
170 170
 	$ph['now'] = strftime('%H:%M:%S', $now);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	$userList = array();
191 191
 	$userCount = array();
192 192
 	// Create userlist with session-count first before output
193
-	while($activeusers = $modx->db->getRow($rs)) {
193
+	while($activeusers = $modx->db->getRow($rs)) {
194 194
 		$userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1;
195 195
 
196 196
 		$idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : '';
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			$currentaction
209 209
 		);
210 210
 	}
211
-	foreach($userList as $params) {
211
+	foreach($userList as $params) {
212 212
 		$params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : '';
213 213
 		$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);
214 214
 	}
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 // invoke event OnManagerWelcomePrerender
255 255
 $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
256
-if(is_array($evtOut)) {
256
+if(is_array($evtOut)) {
257 257
 	$output = implode('', $evtOut);
258 258
 	$ph['OnManagerWelcomePrerender'] = $output;
259 259
 }
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 	'body' => '<div class="widget-stage">[+RecentInfo+]</div>',
359 359
 	'hide'=>'0'
360 360
 );
361
-if ($modx->config['rss_url_news']) {
361
+if ($modx->config['rss_url_news']) {
362 362
     $widgets['news'] = array(
363 363
         'menuindex' => '40',
364 364
         'id' => 'news',
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         'hide'=>'0'
370 370
     );
371 371
 }
372
-if ($modx->config['rss_url_security']) {
372
+if ($modx->config['rss_url_security']) {
373 373
     $widgets['security'] = array(
374 374
         'menuindex' => '50',
375 375
         'id' => 'security',
@@ -383,29 +383,29 @@  discard block
 block discarded – undo
383 383
 
384 384
 // invoke OnManagerWelcomeHome event
385 385
 $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
386
-if(is_array($sitewidgets)) {
386
+if(is_array($sitewidgets)) {
387 387
 	$newwidgets = array();
388
-    foreach($sitewidgets as $widget){
388
+    foreach($sitewidgets as $widget) {
389 389
         $newwidgets = array_merge($newwidgets, unserialize($widget));
390 390
     }
391 391
     $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets;
392 392
 }
393 393
 
394
-usort($widgets, function ($a, $b) {
394
+usort($widgets, function ($a, $b){
395 395
 	return $a['menuindex'] - $b['menuindex'];
396 396
 });
397 397
 
398 398
 $tpl = getTplWidget();
399 399
 $output = '';
400
-foreach($widgets as $widget) {
401
-	if ($widget['hide'] != '1'){
400
+foreach($widgets as $widget) {
401
+	if ($widget['hide'] != '1') {
402 402
 		$output .= $modx->parseText($tpl, $widget);
403 403
 	}
404 404
 }
405 405
 $ph['widgets'] = $output;
406 406
 
407 407
 // load template
408
-if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
408
+if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
409 409
 	$modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl';
410 410
 }
411 411
 
@@ -413,26 +413,28 @@  discard block
 block discarded – undo
413 413
 $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
414 414
 $target = $modx->mergeSettingsContent($target);
415 415
 
416
-if(substr($target, 0, 1) === '@') {
417
-	if(substr($target, 0, 6) === '@CHUNK') {
416
+if(substr($target, 0, 1) === '@') {
417
+	if(substr($target, 0, 6) === '@CHUNK') {
418 418
 		$content = $modx->getChunk(trim(substr($target, 7)));
419
-	} elseif(substr($target, 0, 5) === '@FILE') {
419
+	} elseif(substr($target, 0, 5) === '@FILE') {
420 420
 		$content = file_get_contents(trim(substr($target, 6)));
421
-	} else {
421
+	} else {
422 422
 		$content = '';
423 423
 	}
424
-} else {
424
+} else {
425 425
 	$chunk = $modx->getChunk($target);
426
-	if($chunk !== false && !empty($chunk)) {
426
+	if($chunk !== false && !empty($chunk)) {
427 427
 		$content = $chunk;
428
-	} elseif(is_file(MODX_BASE_PATH . $target)) {
428
+	} elseif(is_file(MODX_BASE_PATH . $target)) {
429 429
 		$content = file_get_contents(MODX_BASE_PATH . $target);
430
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
430
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
431 431
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl');
432
-	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible
432
+	} elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) {
433
+	    // ClipperCMS compatible
433 434
 	{
434
-		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
435
-	} else {
435
+		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html');
436
+	}
437
+	} else {
436 438
 		$content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl');
437 439
 	}
438 440
 }
@@ -441,7 +443,7 @@  discard block
 block discarded – undo
441 443
 $content = $modx->mergeConditionalTagsContent($content);
442 444
 $content = $modx->mergeSettingsContent($content);
443 445
 $content = $modx->parseText($content, $ph);
444
-if(strpos($content, '[+') !== false) {
446
+if(strpos($content, '[+') !== false) {
445 447
 	$modx->toPlaceholders($ph);
446 448
 	$content = $modx->mergePlaceholderContent($content);
447 449
 }
@@ -450,7 +452,7 @@  discard block
 block discarded – undo
450 452
 $content = $modx->parseText($content, $_style, '[&', '&]');
451 453
 $content = $modx->cleanUpMODXTags($content); //cleanup
452 454
 
453
-if($js = $modx->getRegisteredClientScripts()) {
455
+if($js = $modx->getRegisteredClientScripts()) {
454 456
 	$content .= $js;
455 457
 }
456 458
 
@@ -460,9 +462,10 @@  discard block
 block discarded – undo
460 462
 //	<a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a>
461 463
 //  <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a>
462 464
 //</span>
463
-if(!function_exists('getTplWidget')) {
464
-    function getTplWidget()
465
-    { // recent document info
465
+if(!function_exists('getTplWidget')) {
466
+    function getTplWidget()
467
+    {
468
+// recent document info
466 469
         return '
467 470
 		<div class="[+cols+]" id="[+id+]">
468 471
 			<div class="card"[+cardAttr+]>
@@ -474,9 +477,10 @@  discard block
 block discarded – undo
474 477
     }
475 478
 }
476 479
 
477
-if(!function_exists('getRecentInfo')) {
478
-    function getRecentInfo()
479
-    { // recent document info
480
+if(!function_exists('getRecentInfo')) {
481
+    function getRecentInfo()
482
+    {
483
+// recent document info
480 484
         $modx = evolutionCMS();
481 485
 
482 486
         $modx->addSnippet('recentInfoList', 'getRecentInfoList');
@@ -504,14 +508,14 @@  discard block
 block discarded – undo
504 508
     }
505 509
 }
506 510
 
507
-if(!function_exists('getRecentInfoList')) {
508
-    function getRecentInfoList()
509
-    {
511
+if(!function_exists('getRecentInfoList')) {
512
+    function getRecentInfoList()
513
+    {
510 514
         $modx = evolutionCMS();
511 515
 
512 516
         $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
513 517
 
514
-        if ($modx->db->getRecordCount($rs) < 1) {
518
+        if ($modx->db->getRecordCount($rs) < 1) {
515 519
             return '<tr><td>[%no_activity_message%]</td></tr>';
516 520
         }
517 521
 
@@ -521,22 +525,22 @@  discard block
 block discarded – undo
521 525
         $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&amp;id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> ';
522 526
 
523 527
         $output = array();
524
-        while ($ph = $modx->db->getRow($rs)) {
528
+        while ($ph = $modx->db->getRow($rs)) {
525 529
             $docid = $ph['id'];
526 530
             $_ = $modx->getUserInfo($ph['editedby']);
527 531
             $ph['username'] = $_['username'];
528 532
 
529
-            if ($ph['deleted'] == 1) {
533
+            if ($ph['deleted'] == 1) {
530 534
                 $ph['status'] = 'deleted text-danger';
531
-            } elseif ($ph['published'] == 0) {
535
+            } elseif ($ph['published'] == 0) {
532 536
                 $ph['status'] = 'unpublished font-italic text-muted';
533
-            } else {
537
+            } else {
534 538
                 $ph['status'] = 'published';
535 539
             }
536 540
 
537
-            if ($modx->hasPermission('edit_document')) {
541
+            if ($modx->hasPermission('edit_document')) {
538 542
                 $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
539
-            } else {
543
+            } else {
540 544
                 $ph['edit_btn'] = '';
541 545
             }
542 546
 
@@ -549,24 +553,24 @@  discard block
 block discarded – undo
549 553
                 $preview_disabled
550 554
             ), $btntpl['preview_btn']);
551 555
 
552
-            if ($modx->hasPermission('delete_document')) {
553
-                if ($ph['deleted'] == 0) {
556
+            if ($modx->hasPermission('delete_document')) {
557
+                if ($ph['deleted'] == 0) {
554 558
                     $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&amp;id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> ';
555
-                } else {
559
+                } else {
556 560
                     $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&amp;id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> ';
557 561
                 }
558 562
                 $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
559
-            } else {
563
+            } else {
560 564
                 $ph['delete_btn'] = '';
561 565
             }
562 566
 
563
-            if ($ph['deleted'] == 1 && $ph['published'] == 0) {
567
+            if ($ph['deleted'] == 1 && $ph['published'] == 0) {
564 568
                 $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
565
-            } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
569
+            } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
566 570
                 $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
567
-            } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
571
+            } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
568 572
                 $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&amp;id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> ';
569
-            } else {
573
+            } else {
570 574
                 $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&amp;id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> ';
571 575
             }
572 576
             $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
@@ -574,16 +578,16 @@  discard block
 block discarded – undo
574 578
             $ph['info_btn'] = str_replace('[+id+]', $docid,
575 579
                 '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
576 580
 
577
-            if ($ph['longtitle'] == '') {
581
+            if ($ph['longtitle'] == '') {
578 582
                 $ph['longtitle'] = '(<i>[%not_set%]</i>)';
579 583
             }
580
-            if ($ph['description'] == '') {
584
+            if ($ph['description'] == '') {
581 585
                 $ph['description'] = '(<i>[%not_set%]</i>)';
582 586
             }
583
-            if ($ph['introtext'] == '') {
587
+            if ($ph['introtext'] == '') {
584 588
                 $ph['introtext'] = '(<i>[%not_set%]</i>)';
585 589
             }
586
-            if ($ph['alias'] == '') {
590
+            if ($ph['alias'] == '') {
587 591
                 $ph['alias'] = '(<i>[%not_set%]</i>)';
588 592
             }
589 593
 
@@ -594,9 +598,9 @@  discard block
 block discarded – undo
594 598
     }
595 599
 }
596 600
 
597
-if(!function_exists('getRecentInfoRowTpl')) {
598
-    function getRecentInfoRowTpl()
599
-    {
601
+if(!function_exists('getRecentInfoRowTpl')) {
602
+    function getRecentInfoRowTpl()
603
+    {
600 604
         $tpl = '
601 605
 						<tr>
602 606
 							<td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td>
@@ -626,18 +630,18 @@  discard block
 block discarded – undo
626 630
     }
627 631
 }
628 632
 
629
-if(!function_exists('wrapIcon')) {
633
+if(!function_exists('wrapIcon')) {
630 634
 // setup icons
631
-    function wrapIcon($i, $action)
632
-    {
635
+    function wrapIcon($i, $action)
636
+    {
633 637
         return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>',
634 638
             $action, $i);
635 639
     }
636 640
 }
637 641
 
638
-if(!function_exists('getStartUpScript')) {
639
-    function getStartUpScript()
640
-    {
642
+if(!function_exists('getStartUpScript')) {
643
+    function getStartUpScript()
644
+    {
641 645
         $script = '
642 646
         <script type="text/javascript">
643 647
         function hideConfigCheckWarning(key) {
Please login to merge, or discard this patch.