@@ -1,8 +1,8 @@ discard block |
||
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 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | <table class="table data table-sm nowrap"> |
56 | 56 | <tbody> |
57 | 57 | <?php |
58 | - foreach ($serverArr as $key => $value) { |
|
58 | + foreach ($serverArr as $key => $value) { |
|
59 | 59 | ?> |
60 | 60 | <tr> |
61 | 61 | <td width="1%"><?= $key ?></td> |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; |
99 | 99 | $rs = $modx->db->query($sql); |
100 | 100 | $i = 0; |
101 | - while ($log_status = $modx->db->getRow($rs)) { |
|
101 | + while ($log_status = $modx->db->getRow($rs)) { |
|
102 | 102 | ?> |
103 | 103 | <tr> |
104 | 104 | <td class="text-primary"><b><?= $log_status['Name'] ?></b></td> |
@@ -110,17 +110,17 @@ discard block |
||
110 | 110 | $modx->db->config['table_prefix'] . 'event_log', |
111 | 111 | $modx->db->config['table_prefix'] . 'manager_log', |
112 | 112 | ); |
113 | - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
113 | + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
114 | 114 | echo "<td class=\"text-xs-right\">"; |
115 | 115 | echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>"; |
116 | 116 | echo "</td>"; |
117 | - } else { |
|
117 | + } else { |
|
118 | 118 | echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
119 | 119 | } |
120 | 120 | |
121 | - if ($modx->hasPermission('settings')) { |
|
121 | + if ($modx->hasPermission('settings')) { |
|
122 | 122 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>"; |
123 | - } else { |
|
123 | + } else { |
|
124 | 124 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
125 | 125 | } |
126 | 126 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
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 | $helpBasePath = "actions/help/"; |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | </script> |
17 | 17 | |
18 | 18 | <?php |
19 | - if($handle = opendir('actions/help')) { |
|
20 | - while(false !== ($file = readdir($handle))) { |
|
21 | - if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { |
|
19 | + if($handle = opendir('actions/help')) { |
|
20 | + while(false !== ($file = readdir($handle))) { |
|
21 | + if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { |
|
22 | 22 | $help[] = $file; |
23 | 23 | } |
24 | 24 | } |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | |
28 | 28 | natcasesort($help); |
29 | 29 | |
30 | - foreach($help as $k => $v) { |
|
30 | + foreach($help as $k => $v) { |
|
31 | 31 | |
32 | 32 | $helpname = substr($v, 0, strrpos($v, '.')); |
33 | 33 | |
34 | 34 | $prefix = substr($helpname, 0, 2); |
35 | - if(is_numeric($prefix)) { |
|
35 | + if(is_numeric($prefix)) { |
|
36 | 36 | $helpname = substr($helpname, 2, strlen($helpname) - 1); |
37 | 37 | } |
38 | 38 |
@@ -18,8 +18,7 @@ |
||
18 | 18 | foreach($notices as $v) { |
19 | 19 | if ($v >= '1.3.0') { |
20 | 20 | $cms = 'EVO'; |
21 | - } |
|
22 | - else { |
|
21 | + } else { |
|
23 | 22 | $cms = 'MODX EVO'; |
24 | 23 | } |
25 | 24 | echo '<div class="sectionHeader"> '.$cms.' '.$v.'</div><div class="sectionBody">'; |
@@ -18,12 +18,15 @@ |
||
18 | 18 | 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
19 | 19 | ); |
20 | 20 | |
21 | -function createList($sectionHeader, $linkArr) { |
|
21 | +function createList($sectionHeader, $linkArr) |
|
22 | +{ |
|
22 | 23 | $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
23 | 24 | $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
24 | 25 | $links = ''; |
25 | 26 | foreach($linkArr as $row) { |
26 | - if (!is_array($row['link'])) $row['link'] = array($row['link']); |
|
27 | + if (!is_array($row['link'])) { |
|
28 | + $row['link'] = array($row['link']); |
|
29 | + } |
|
27 | 30 | foreach ($row['link'] as $link) { |
28 | 31 | $links .= $links != '' ? '<br/>' : ''; |
29 | 32 | $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
@@ -8,7 +8,8 @@ |
||
8 | 8 | <div class="sectionBody"> |
9 | 9 | <?php |
10 | 10 | $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt'; |
11 | - if(is_readable($changeLog)) |
|
12 | - echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
13 | -?> |
|
11 | + if(is_readable($changeLog)) { |
|
12 | + echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
13 | + } |
|
14 | + ?> |
|
14 | 15 | </div> |
@@ -3,19 +3,22 @@ discard block |
||
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 { |
|
6 | +class mgrResources |
|
7 | +{ |
|
7 | 8 | var $types = array(); |
8 | 9 | var $items = array(); |
9 | 10 | var $categories = array(); |
10 | 11 | var $itemsPerCategory = array(); |
11 | 12 | |
12 | - function __construct() { |
|
13 | + function __construct() |
|
14 | + { |
|
13 | 15 | $this->setTypes(); |
14 | 16 | $this->queryItemsFromDB(); |
15 | 17 | $this->prepareCategoryArrays(); |
16 | 18 | } |
17 | 19 | |
18 | - function setTypes() { |
|
20 | + function setTypes() |
|
21 | + { |
|
19 | 22 | global $_lang; |
20 | 23 | $this->types['site_templates'] = array( |
21 | 24 | 'title'=>$_lang["manage_templates"], |
@@ -50,7 +53,8 @@ discard block |
||
50 | 53 | ); |
51 | 54 | } |
52 | 55 | |
53 | - function queryItemsFromDB() { |
|
56 | + function queryItemsFromDB() |
|
57 | + { |
|
54 | 58 | foreach($this->types as $resourceTable=>$type) { |
55 | 59 | if($this->hasAnyPermissions($type['permissions'])) { |
56 | 60 | $nameField = isset($type['name']) ? $type['name'] : 'name'; |
@@ -59,16 +63,19 @@ discard block |
||
59 | 63 | } |
60 | 64 | } |
61 | 65 | |
62 | - function hasAnyPermissions($permissions) { |
|
66 | + function hasAnyPermissions($permissions) |
|
67 | + { |
|
63 | 68 | global $modx; |
64 | 69 | |
65 | - foreach($permissions as $p) |
|
66 | - if($modx->hasPermission($p)) return true; |
|
70 | + foreach($permissions as $p) { |
|
71 | + if($modx->hasPermission($p)) return true; |
|
72 | + } |
|
67 | 73 | |
68 | 74 | return false; |
69 | 75 | } |
70 | 76 | |
71 | - function queryResources($resourceTable, $nameField = 'name') { |
|
77 | + function queryResources($resourceTable, $nameField = 'name') |
|
78 | + { |
|
72 | 79 | global $modx, $_lang; |
73 | 80 | |
74 | 81 | $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : ''; |
@@ -79,8 +86,9 @@ discard block |
||
79 | 86 | $tvsql = 'site_tmplvars.caption, '; |
80 | 87 | $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
81 | 88 | $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
89 | + } else { |
|
90 | + $sttfield = ''; |
|
82 | 91 | } |
83 | - else $sttfield = ''; |
|
84 | 92 | |
85 | 93 | $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
86 | 94 | |
@@ -93,7 +101,9 @@ discard block |
||
93 | 101 | ); |
94 | 102 | $limit = $modx->db->getRecordCount($rs); |
95 | 103 | |
96 | - if($limit < 1) return false; |
|
104 | + if($limit < 1) { |
|
105 | + return false; |
|
106 | + } |
|
97 | 107 | |
98 | 108 | $result = array(); |
99 | 109 | while ($row = $modx->db->getRow($rs)) { |
@@ -102,7 +112,8 @@ discard block |
||
102 | 112 | return $result; |
103 | 113 | } |
104 | 114 | |
105 | - function prepareCategoryArrays() { |
|
115 | + function prepareCategoryArrays() |
|
116 | + { |
|
106 | 117 | foreach($this->items as $type=>$items) { |
107 | 118 | foreach((array)$items as $item) { |
108 | 119 | $catid = $item['catid'] ? $item['catid'] : 0; |
@@ -118,7 +129,7 @@ discard block |
||
118 | 129 | |
119 | 130 | // Now sort by name |
120 | 131 | foreach($this->itemsPerCategory as $catid=>$items) { |
121 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
132 | + usort($this->itemsPerCategory[$catid], function ($a, $b){ |
|
122 | 133 | return strcasecmp($a['name'], $b['name']); |
123 | 134 | }); |
124 | 135 | } |
@@ -1,15 +1,15 @@ discard block |
||
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,7 +29,8 @@ discard block |
||
29 | 29 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
30 | 30 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
31 | 31 | // create globally unique identifiers (guid) |
32 | -function createGUID() { |
|
32 | +function createGUID() |
|
33 | +{ |
|
33 | 34 | srand((double) microtime() * 1000000); |
34 | 35 | $r = rand(); |
35 | 36 | $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); |
@@ -38,7 +39,7 @@ discard block |
||
38 | 39 | } |
39 | 40 | |
40 | 41 | // check to see the module editor isn't locked |
41 | -if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
42 | +if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
42 | 43 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
43 | 44 | } |
44 | 45 | // end check for lock |
@@ -46,22 +47,22 @@ discard block |
||
46 | 47 | // Lock snippet for other users to edit |
47 | 48 | $modx->lockElement(6, $id); |
48 | 49 | |
49 | -if(isset($_GET['id'])) { |
|
50 | +if(isset($_GET['id'])) { |
|
50 | 51 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'"); |
51 | 52 | $content = $modx->db->getRow($rs); |
52 | - if(!$content) { |
|
53 | + if(!$content) { |
|
53 | 54 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
54 | 55 | } |
55 | 56 | $content['properties'] = str_replace("&", "&", $content['properties']); |
56 | 57 | $_SESSION['itemname'] = $content['name']; |
57 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
58 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
58 | 59 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
59 | 60 | } |
60 | -} else { |
|
61 | +} else { |
|
61 | 62 | $_SESSION['itemname'] = $_lang["new_module"]; |
62 | 63 | $content['wrap'] = '1'; |
63 | 64 | } |
64 | -if($modx->manager->hasFormValues()) { |
|
65 | +if($modx->manager->hasFormValues()) { |
|
65 | 66 | $modx->manager->loadFormValues(); |
66 | 67 | } |
67 | 68 | |
@@ -435,7 +436,7 @@ discard block |
||
435 | 436 | <?php |
436 | 437 | // invoke OnModFormPrerender event |
437 | 438 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id)); |
438 | - if(is_array($evtOut)) { |
|
439 | + if(is_array($evtOut)) { |
|
439 | 440 | echo implode('', $evtOut); |
440 | 441 | } |
441 | 442 | |
@@ -498,7 +499,7 @@ discard block |
||
498 | 499 | <option> </option> |
499 | 500 | <?php |
500 | 501 | include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
501 | - foreach(getCategories() as $n => $v) { |
|
502 | + foreach(getCategories() as $n => $v) { |
|
502 | 503 | echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
503 | 504 | } |
504 | 505 | ?> |
@@ -650,7 +651,7 @@ discard block |
||
650 | 651 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'"); |
651 | 652 | $groupsarray = $modx->db->getColumn('usergroup', $rs); |
652 | 653 | |
653 | - if($modx->hasPermission('access_permissions')) { |
|
654 | + if($modx->hasPermission('access_permissions')) { |
|
654 | 655 | ?> |
655 | 656 | <!-- User Group Access Permissions --> |
656 | 657 | <script type="text/javascript"> |
@@ -678,21 +679,21 @@ discard block |
||
678 | 679 | } |
679 | 680 | $chk = ''; |
680 | 681 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name'); |
681 | - while($row = $modx->db->getRow($rs)) { |
|
682 | + while($row = $modx->db->getRow($rs)) { |
|
682 | 683 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
683 | 684 | $checked = in_array($row['id'], $groupsarray); |
684 | - if($modx->hasPermission('access_permissions')) { |
|
685 | - if($checked) { |
|
685 | + if($modx->hasPermission('access_permissions')) { |
|
686 | + if($checked) { |
|
686 | 687 | $notPublic = true; |
687 | 688 | } |
688 | 689 | $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
689 | - } else { |
|
690 | - if($checked) { |
|
690 | + } else { |
|
691 | + if($checked) { |
|
691 | 692 | $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
692 | 693 | } |
693 | 694 | } |
694 | 695 | } |
695 | - if($modx->hasPermission('access_permissions')) { |
|
696 | + if($modx->hasPermission('access_permissions')) { |
|
696 | 697 | $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; |
697 | 698 | } |
698 | 699 | echo $chks; |
@@ -714,7 +715,7 @@ discard block |
||
714 | 715 | <?php |
715 | 716 | // invoke OnModFormRender event |
716 | 717 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id)); |
717 | - if(is_array($evtOut)) { |
|
718 | + if(is_array($evtOut)) { |
|
718 | 719 | echo implode('', $evtOut); |
719 | 720 | } |
720 | 721 | ?> |
@@ -28,16 +28,14 @@ |
||
28 | 28 | $cm = new Module_Categories_Manager(); |
29 | 29 | |
30 | 30 | // assign module_params to internal params |
31 | -foreach( $_module_params as $param => $value ) |
|
32 | -{ |
|
31 | +foreach( $_module_params as $param => $value ) { |
|
33 | 32 | $cm->set( $param, $value ); |
34 | 33 | } |
35 | 34 | |
36 | 35 | // catch the request actions |
37 | 36 | include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; |
38 | 37 | |
39 | -if( !$categories = $cm->getCategories() ) |
|
40 | -{ |
|
38 | +if( !$categories = $cm->getCategories() ) { |
|
41 | 39 | setcookie('webfxtab_manage-categories-pane', 0 ); |
42 | 40 | $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
43 | 41 | } |
@@ -1,8 +1,8 @@ |
||
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('change_password')) { |
|
5 | +if(!$modx->hasPermission('change_password')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | ?> |