@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (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('export_static')) { |
|
5 | +if (!$modx->hasPermission('export_static')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | |
36 | 36 | <div class="container container-body"> |
37 | 37 | <?php |
38 | - if(isset($_POST['export'])) { |
|
39 | - $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); |
|
38 | + if (isset($_POST['export'])) { |
|
39 | + $rs = include_once(MODX_MANAGER_PATH.'processors/export_site.processor.php'); |
|
40 | 40 | echo $rs; |
41 | 41 | } else { |
42 | 42 | ?> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | <a href="javascript:;" class="btn btn-primary" onclick="document.exportFrm.submit();jQuery(this).hide();"><i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang["export_site_start"] ?></a> |
77 | 77 | <script> |
78 | 78 | jQuery('#exportButton a').click(function() { |
79 | - jQuery(this).parent().html('<?= $_style['ajax_loader'];?>'); |
|
79 | + jQuery(this).parent().html('<?= $_style['ajax_loader']; ?>'); |
|
80 | 80 | }); |
81 | 81 | </script> |
82 | 82 | </form> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (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('edit_user')) { |
|
5 | +if (!$modx->hasPermission('edit_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <?php |
21 | 21 | $rs = $modx->db->select('name, id, description', $modx->getFullTableName('user_roles'), '', 'name'); |
22 | 22 | $limit = $modx->db->getRecordCount($rs); |
23 | - if($limit < 1) { |
|
23 | + if ($limit < 1) { |
|
24 | 24 | ?> |
25 | 25 | <p><?= $_lang["no_records_found"] ?></p> |
26 | 26 | <?php |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - while($row = $modx->db->getRow($rs)) { |
|
41 | - if($row['id'] == 1) { |
|
40 | + while ($row = $modx->db->getRow($rs)) { |
|
41 | + if ($row['id'] == 1) { |
|
42 | 42 | ?> |
43 | 43 | <tr class="text-muted disabled"> |
44 | 44 | <td><b><?= $row['name'] ?></b></td> |
@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (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('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
10 | 10 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
11 | 11 | |
12 | -$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el |
|
13 | - LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0 |
|
14 | - LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
12 | +$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el |
|
13 | + LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0 |
|
14 | + LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
15 | 15 | $content = $modx->db->getRow($ds); |
16 | 16 | |
17 | 17 | ?> |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | 44 | $date = $modx->toDateFormat($content["createdon"]); |
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
45 | + if ($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'].' text-info'; |
|
47 | 47 | $msgtype = $_lang["information"]; |
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
48 | + } else if ($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'].' text-warning'; |
|
50 | 50 | $msgtype = $_lang["warning"]; |
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
51 | + } else if ($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'].' text-danger'; |
|
53 | 53 | $msgtype = $_lang["error"]; |
54 | 54 | } |
55 | 55 | ?> |
56 | - <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
|
56 | + <p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p> |
|
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
59 | 59 | </p> |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit(); |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE != 'true') exit(); |
|
3 | 3 | |
4 | -if(!$modx->hasPermission('delete_plugin')) { |
|
4 | +if (!$modx->hasPermission('delete_plugin')) { |
|
5 | 5 | $e->setError(3); |
6 | 6 | $e->dumpError(); |
7 | 7 | } |
@@ -12,18 +12,18 @@ discard block |
||
12 | 12 | // Get unique list of latest added plugins by highest sql-id |
13 | 13 | $rs = $modx->db->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); |
14 | 14 | $latestIds = array(); |
15 | -while($row = $modx->db->getRow($rs)) { |
|
15 | +while ($row = $modx->db->getRow($rs)) { |
|
16 | 16 | $latestIds[] = $row['id']; |
17 | 17 | } |
18 | 18 | |
19 | 19 | // Get list of plugins with disabled and enabled versions |
20 | 20 | $rs = $modx->db->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); |
21 | 21 | |
22 | -while($row = $modx->db->getRow($rs)) { |
|
22 | +while ($row = $modx->db->getRow($rs)) { |
|
23 | 23 | |
24 | 24 | $id = $row['id']; |
25 | 25 | |
26 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
26 | + if (in_array($id, $latestIds)) continue; // Keep latest version of disabled plugins |
|
27 | 27 | |
28 | 28 | // invoke OnBeforePluginFormDelete event |
29 | 29 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | 3 | |
4 | 4 | $internalKey = $modx->getLoginUserID(); |
5 | 5 | $username = $_SESSION['mgrShortname']; |
@@ -39,4 +39,4 @@ discard block |
||
39 | 39 | )); |
40 | 40 | |
41 | 41 | // show login screen |
42 | -header('Location: ' . MODX_MANAGER_URL); |
|
42 | +header('Location: '.MODX_MANAGER_URL); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
21 | 21 | $categoryid = 0; |
22 | 22 | } else { |
23 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
23 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
24 | 24 | $categoryid = checkCategory($_POST['newcategory']); |
25 | 25 | if (!$categoryid) { |
26 | 26 | $categoryid = newCategory($_POST['newcategory']); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // finished emptying cache - redirect |
81 | 81 | if ($_POST['stay'] != '') { |
82 | 82 | $a = ($_POST['stay'] == '2') ? "78&id=$newid" : "77"; |
83 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
83 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
84 | 84 | header($header); |
85 | 85 | } else { |
86 | 86 | $header = "Location: index.php?a=76&r=2"; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | // finished emptying cache - redirect |
130 | 130 | if ($_POST['stay'] != '') { |
131 | 131 | $a = ($_POST['stay'] == '2') ? "78&id=$id" : "77"; |
132 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
132 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
133 | 133 | header($header); |
134 | 134 | } else { |
135 | 135 | $modx->unlockElement(3, $id); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | -if(!$modx->hasPermission('delete_document')) { |
|
2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | +if (!$modx->hasPermission('delete_document')) { |
|
4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
5 | 5 | } |
6 | 6 | |
@@ -40,5 +40,5 @@ discard block |
||
40 | 40 | $modx->clearCache('full'); |
41 | 41 | |
42 | 42 | // finished emptying cache - redirect |
43 | - $header="Location: index.php?a=2&r=1"; |
|
43 | + $header = "Location: index.php?a=2&r=1"; |
|
44 | 44 | header($header); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
25 | 25 | $categoryid = 0; |
26 | 26 | } else { |
27 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
27 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
28 | 28 | $categoryid = getCategory($_POST['newcategory']); |
29 | 29 | } |
30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
41 | 41 | |
42 | 42 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
43 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
43 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
44 | 44 | if ($version) { |
45 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
45 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
46 | 46 | } |
47 | 47 | if (isset($parsed['modx_category'])) { |
48 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
48 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
49 | 49 | $categoryid = getCategory($parsed['modx_category']); |
50 | 50 | } |
51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // finished emptying cache - redirect |
104 | 104 | if ($_POST['stay'] != '') { |
105 | 105 | $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101'; |
106 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
106 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
107 | 107 | header($header); |
108 | 108 | } else { |
109 | 109 | $header = 'Location: index.php?a=76&r=2'; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // finished emptying cache - redirect |
159 | 159 | if ($_POST['stay'] != '') { |
160 | 160 | $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101'; |
161 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
161 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
162 | 162 | header($header); |
163 | 163 | } else { |
164 | 164 | $modx->unlockElement(5, $id); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // save selected system events |
178 | 178 | $formEventList = array(); |
179 | 179 | foreach ($sysevents as $evtId) { |
180 | - if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); |
|
180 | + if (!preg_match('@^[1-9][0-9]*$@', $evtId)) $evtId = getEventIdByName($evtId); |
|
181 | 181 | if ($mode == '101') { |
182 | 182 | $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); |
183 | 183 | } else { |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); |
203 | 203 | $dbEventList = array(); |
204 | 204 | $del = array(); |
205 | - while($row = $modx->db->getRow($rs)) { |
|
206 | - if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; |
|
205 | + while ($row = $modx->db->getRow($rs)) { |
|
206 | + if (!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; |
|
207 | 207 | } |
208 | 208 | |
209 | - if(!$del) return; |
|
209 | + if (!$del) return; |
|
210 | 210 | |
211 | - foreach($del as $delid) { |
|
211 | + foreach ($del as $delid) { |
|
212 | 212 | $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); |
213 | 213 | } |
214 | 214 | } |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | function getEventIdByName($name) |
217 | 217 | { |
218 | 218 | global $modx; |
219 | - static $eventIds=array(); |
|
219 | + static $eventIds = array(); |
|
220 | 220 | |
221 | - if(isset($eventIds[$name])) return $eventIds[$name]; |
|
221 | + if (isset($eventIds[$name])) return $eventIds[$name]; |
|
222 | 222 | |
223 | 223 | $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); |
224 | 224 | while ($row = $modx->db->getRow($rs)) { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
28 | 28 | $categoryid = 0; |
29 | 29 | } else { |
30 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
30 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
31 | 31 | $categoryid = checkCategory($_POST['newcategory']); |
32 | 32 | if (!$categoryid) { |
33 | 33 | $categoryid = newCategory($_POST['newcategory']); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | // finished emptying cache - redirect |
100 | 100 | if ($_POST['stay'] != '') { |
101 | 101 | $a = ($_POST['stay'] == '2') ? "301&id=$newid" : "300"; |
102 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
102 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
103 | 103 | header($header); |
104 | 104 | } else { |
105 | 105 | $header = "Location: index.php?a=76&r=2"; |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | // finished emptying cache - redirect |
161 | 161 | if ($_POST['stay'] != '') { |
162 | 162 | $a = ($_POST['stay'] == '2') ? "301&id=$id" : "300"; |
163 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'] . "&or=" . $origin . "&oid=" . $originId; |
|
163 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']."&or=".$origin."&oid=".$originId; |
|
164 | 164 | header($header); |
165 | 165 | } else { |
166 | 166 | $modx->unlockElement(2, $id); |
167 | - $header = "Location: index.php?a=" . $origin . "&r=2" . ($originId != null ? '&id=' . $originId : ''); |
|
167 | + $header = "Location: index.php?a=".$origin."&r=2".($originId != null ? '&id='.$originId : ''); |
|
168 | 168 | header($header); |
169 | 169 | } |
170 | 170 |