@@ -1,16 +1,16 @@ 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 />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | -include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/functions.inc.php'); |
|
9 | +include_once(MODX_MANAGER_PATH.'actions/mutate_settings/functions.inc.php'); |
|
10 | 10 | |
11 | 11 | // check to see the edit settings page isn't locked |
12 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
13 | -if($username = $modx->db->getValue($rs)) { |
|
12 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'"); |
|
13 | +if ($username = $modx->db->getValue($rs)) { |
|
14 | 14 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
15 | 15 | } |
16 | 16 | // end check for lock |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | // reload system settings from the database. |
19 | 19 | // this will prevent user-defined settings from being saved as system setting |
20 | 20 | $settings = array(); |
21 | -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
|
21 | +include_once(MODX_MANAGER_PATH.'includes/default_config.php'); |
|
22 | 22 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); |
23 | -while($row = $modx->db->getRow($rs)) { |
|
23 | +while ($row = $modx->db->getRow($rs)) { |
|
24 | 24 | $settings[$row['setting_name']] = $row['setting_value']; |
25 | 25 | } |
26 | -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
|
27 | -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
|
26 | +$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']); |
|
27 | +$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']); |
|
28 | 28 | |
29 | 29 | extract($settings, EXTR_OVERWRITE); |
30 | 30 | |
31 | 31 | // load languages and keys |
32 | 32 | $lang_keys = array(); |
33 | 33 | $dir = dir('includes/lang'); |
34 | -while($file = $dir->read()) { |
|
35 | - if(strpos($file, '.inc.php') > 0) { |
|
34 | +while ($file = $dir->read()) { |
|
35 | + if (strpos($file, '.inc.php') > 0) { |
|
36 | 36 | $endpos = strpos($file, '.'); |
37 | 37 | $languagename = substr($file, 0, $endpos); |
38 | 38 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
70 | 70 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" /> |
71 | 71 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
72 | - <?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
72 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
73 | 73 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
74 | 74 | <?php } ?> |
75 | 75 | <div class="tab-pane" id="settingsPane"> |
@@ -78,13 +78,13 @@ discard block |
||
78 | 78 | </script> |
79 | 79 | |
80 | 80 | <?php |
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
86 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
87 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
86 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
87 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
88 | 88 | ?> |
89 | 89 | </div> |
90 | 90 | </div> |
@@ -131,6 +131,6 @@ discard block |
||
131 | 131 | }); |
132 | 132 | </script> |
133 | 133 | <?php |
134 | -if(is_numeric($_GET['tab'])) { |
|
135 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
134 | +if (is_numeric($_GET['tab'])) { |
|
135 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
136 | 136 | } |
@@ -1,9 +1,9 @@ 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 | 5 | |
6 | -if(!$modx->hasPermission('edit_module')) { |
|
6 | +if (!$modx->hasPermission('edit_module')) { |
|
7 | 7 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
8 | 8 | } |
9 | 9 | |
@@ -24,41 +24,41 @@ discard block |
||
24 | 24 | $modx->manager->initPageViewState(); |
25 | 25 | |
26 | 26 | // check to see the editor isn't locked |
27 | -$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
28 | -if($username = $modx->db->getValue($rs)) { |
|
27 | +$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
28 | +if ($username = $modx->db->getValue($rs)) { |
|
29 | 29 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
30 | 30 | } |
31 | 31 | // end check for lock |
32 | 32 | |
33 | 33 | // take action |
34 | -switch($_REQUEST['op']) { |
|
34 | +switch ($_REQUEST['op']) { |
|
35 | 35 | case 'add': |
36 | 36 | // convert ids to numbers |
37 | 37 | $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
38 | 38 | |
39 | - if(count($opids) > 0) { |
|
39 | + if (count($opids) > 0) { |
|
40 | 40 | // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
41 | 41 | $rt = strtolower($_REQUEST["rt"]); |
42 | - if($rt == 'chunk') { |
|
42 | + if ($rt == 'chunk') { |
|
43 | 43 | $type = 10; |
44 | 44 | } |
45 | - if($rt == 'doc') { |
|
45 | + if ($rt == 'doc') { |
|
46 | 46 | $type = 20; |
47 | 47 | } |
48 | - if($rt == 'plug') { |
|
48 | + if ($rt == 'plug') { |
|
49 | 49 | $type = 30; |
50 | 50 | } |
51 | - if($rt == 'snip') { |
|
51 | + if ($rt == 'snip') { |
|
52 | 52 | $type = 40; |
53 | 53 | } |
54 | - if($rt == 'tpl') { |
|
54 | + if ($rt == 'tpl') { |
|
55 | 55 | $type = 50; |
56 | 56 | } |
57 | - if($rt == 'tv') { |
|
57 | + if ($rt == 'tv') { |
|
58 | 58 | $type = 60; |
59 | 59 | } |
60 | - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | - foreach($opids as $opid) { |
|
60 | + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'"); |
|
61 | + foreach ($opids as $opid) { |
|
62 | 62 | $modx->db->insert(array( |
63 | 63 | 'module' => $id, |
64 | 64 | 'resource' => $opid, |
@@ -72,15 +72,15 @@ discard block |
||
72 | 72 | $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
73 | 73 | |
74 | 74 | // get resources that needs to be removed |
75 | - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
75 | + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")"); |
|
76 | 76 | // loop through resources and look for plugins and snippets |
77 | 77 | $plids = array(); |
78 | 78 | $snid = array(); |
79 | - while($row = $modx->db->getRow($ds)) { |
|
80 | - if($row['type'] == '30') { |
|
79 | + while ($row = $modx->db->getRow($ds)) { |
|
80 | + if ($row['type'] == '30') { |
|
81 | 81 | $plids[$i] = $row['resource']; |
82 | 82 | } |
83 | - if($row['type'] == '40') { |
|
83 | + if ($row['type'] == '40') { |
|
84 | 84 | $snids[$i] = $row['resource']; |
85 | 85 | } |
86 | 86 | } |
@@ -88,28 +88,28 @@ discard block |
||
88 | 88 | $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
89 | 89 | $guid = $modx->db->getValue($ds); |
90 | 90 | // reset moduleguid for deleted resources |
91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
92 | - if($cp) { |
|
93 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
91 | + if (($cp = count($plids)) || ($cs = count($snids))) { |
|
92 | + if ($cp) { |
|
93 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'"); |
|
94 | 94 | } |
95 | - if($cs) { |
|
96 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
95 | + if ($cs) { |
|
96 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'"); |
|
97 | 97 | } |
98 | 98 | // reset cache |
99 | 99 | $modx->clearCache('full'); |
100 | 100 | } |
101 | - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
101 | + $modx->db->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")"); |
|
102 | 102 | break; |
103 | 103 | } |
104 | 104 | |
105 | 105 | // load record |
106 | 106 | $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); |
107 | 107 | $content = $modx->db->getRow($rs); |
108 | -if(!$content) { |
|
108 | +if (!$content) { |
|
109 | 109 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
110 | 110 | } |
111 | 111 | $_SESSION['itemname'] = $content['name']; |
112 | -if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
112 | +if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
113 | 113 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
114 | 114 | } |
115 | 115 | |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | <input type="hidden" name="id" value="<?php echo $content['id']; ?>" /> |
189 | 189 | |
190 | 190 | <h1> |
191 | - <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?> |
|
191 | + <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?> |
|
192 | 192 | </h1> |
193 | 193 | |
194 | 194 | <?php echo $_style['actionbuttons']['dynamic']['close'] ?> |
195 | 195 | |
196 | 196 | <div class="section"> |
197 | - <div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div> |
|
197 | + <div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div> |
|
198 | 198 | <div class="sectionBody"> |
199 | 199 | <p><?php echo $_lang['module_resource_msg']; ?></p> |
200 | 200 | <br /> |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' |
219 | 219 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' |
220 | 220 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); |
221 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
221 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
222 | 222 | $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
223 | 223 | $grd->noRecordMsg = $_lang["no_records_found"]; |
224 | 224 | $grd->cssClass = "grid"; |
225 | 225 | $grd->columnHeaderClass = "gridHeader"; |
226 | 226 | $grd->itemClass = "gridItem"; |
227 | 227 | $grd->altItemClass = "gridAltItem"; |
228 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
228 | + $grd->columns = $_lang["element_name"]." ,".$_lang["type"]; |
|
229 | 229 | $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
230 | 230 | $grd->fields = "name,type"; |
231 | 231 | echo $grd->render(); |
@@ -1,11 +1,11 @@ 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_template') && $modx->manager->action == '301') { |
|
5 | +if (!$modx->hasPermission('edit_template') && $modx->manager->action == '301') { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | -if(!$modx->hasPermission('new_template') && $modx->manager->action == '300') { |
|
8 | +if (!$modx->hasPermission('new_template') && $modx->manager->action == '300') { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $tbl_documentgroup_names = $modx->getFullTableName('documentgroup_names'); |
20 | 20 | |
21 | 21 | // check to see the snippet editor isn't locked |
22 | -if($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
22 | +if ($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
23 | 23 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
24 | 24 | } |
25 | 25 | // end check for lock |
@@ -29,25 +29,25 @@ discard block |
||
29 | 29 | |
30 | 30 | global $content; |
31 | 31 | $content = array(); |
32 | -if(isset($_GET['id'])) { |
|
32 | +if (isset($_GET['id'])) { |
|
33 | 33 | $rs = $modx->db->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
34 | 34 | $content = $modx->db->getRow($rs); |
35 | - if(!$content) { |
|
36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
35 | + if (!$content) { |
|
36 | + header("Location: ".MODX_SITE_URL."index.php?id={$site_start}"); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $_SESSION['itemname'] = $content['caption']; |
40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
40 | + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | 41 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
42 | 42 | } |
43 | -} else if(isset($_REQUEST['itemname'])) { |
|
43 | +} else if (isset($_REQUEST['itemname'])) { |
|
44 | 44 | $content['name'] = $_REQUEST['itemname']; |
45 | 45 | } else { |
46 | 46 | $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
47 | 47 | $content['category'] = intval($_REQUEST['catid']); |
48 | 48 | } |
49 | 49 | |
50 | -if($modx->manager->hasFormValues()) { |
|
50 | +if ($modx->manager->hasFormValues()) { |
|
51 | 51 | $modx->manager->loadFormValues(); |
52 | 52 | } |
53 | 53 | |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | // Add lock-element JS-Script |
57 | 57 | $lockElementId = $id; |
58 | 58 | $lockElementType = 2; |
59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
60 | 60 | |
61 | 61 | // get available RichText Editors |
62 | 62 | $RTEditors = ''; |
63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
64 | -if(is_array($evtOut)) { |
|
64 | +if (is_array($evtOut)) { |
|
65 | 65 | $RTEditors = implode(',', $evtOut); |
66 | 66 | } |
67 | 67 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | }, |
108 | 108 | cancel: function() { |
109 | 109 | documentDirty = false; |
110 | - document.location.href = 'index.php?a=<?= $origin ?><?=($originId != NULL ? '&id=' . $originId : '') ?>'; |
|
110 | + document.location.href = 'index.php?a=<?= $origin ?><?=($originId != NULL ? '&id='.$originId : '') ?>'; |
|
111 | 111 | } |
112 | 112 | }; |
113 | 113 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | // invoke OnTVFormPrerender event |
281 | 281 | $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
282 | - if(is_array($evtOut)) { |
|
282 | + if (is_array($evtOut)) { |
|
283 | 283 | echo implode("", $evtOut); |
284 | 284 | } |
285 | 285 | ?> |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | <input type="hidden" name="params" value="<?= $modx->htmlspecialchars($content['display_params']) ?>"> |
292 | 292 | |
293 | 293 | <h1> |
294 | - <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
294 | + <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
295 | 295 | </h1> |
296 | 296 | |
297 | 297 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | <div class="col-md-9 col-lg-10"> |
315 | 315 | <div class="form-control-name clearfix"> |
316 | 316 | <input name="name" type="text" maxlength="50" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
317 | - <?php if($modx->hasPermission('save_role')): ?> |
|
318 | - <label class="custom-control" title="<?= $_lang['lock_tmplvars'] . "\n" . $_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
317 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
318 | + <label class="custom-control" title="<?= $_lang['lock_tmplvars']."\n".$_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
319 | 319 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
320 | 320 | <i class="fa fa-lock"></i> |
321 | 321 | </label> |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
344 | 344 | <option> </option> |
345 | 345 | <?php |
346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | - foreach(getCategories() as $n => $v) { |
|
348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
346 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
347 | + foreach (getCategories() as $n => $v) { |
|
348 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>"; |
|
349 | 349 | } |
350 | 350 | ?> |
351 | 351 | </select> |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | <optgroup label="Custom Type"> |
384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
385 | 385 | <?php |
386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | - foreach($custom_tvs as $ctv) { |
|
388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
386 | + $custom_tvs = scandir(MODX_BASE_PATH.'assets/tvs'); |
|
387 | + foreach ($custom_tvs as $ctv) { |
|
388 | + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | + $selected = ($content['type'] == 'custom_tv:'.$ctv ? "selected='selected'" : ""); |
|
390 | + echo '<option value="custom_tv:'.$ctv.'" '.$selected.'>'.$ctv.'</option>'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | ?> |
@@ -462,36 +462,36 @@ discard block |
||
462 | 462 | $tplList = '<ul>'; |
463 | 463 | $preCat = ''; |
464 | 464 | $insideUl = 0; |
465 | - while($row = $modx->db->getRow($rs)) { |
|
465 | + while ($row = $modx->db->getRow($rs)) { |
|
466 | 466 | $row['category'] = stripslashes($row['category']); //pixelchutes |
467 | - if($preCat !== $row['category']) { |
|
467 | + if ($preCat !== $row['category']) { |
|
468 | 468 | $tplList .= $insideUl ? '</ul>' : ''; |
469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
469 | + $tplList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
470 | 470 | $insideUl = 1; |
471 | 471 | } |
472 | 472 | |
473 | - if($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
473 | + if ($modx->manager->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | 474 | $checked = true; |
475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
475 | + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | 476 | $checked = true; |
477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
477 | + } elseif ($id == 0 && is_array($_POST['template'])) { |
|
478 | 478 | $checked = in_array($row['id'], $_POST['template']); |
479 | 479 | } else { |
480 | 480 | $checked = $row['tmplvarid']; |
481 | 481 | } |
482 | 482 | $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
483 | 483 | $checked = $checked ? ' checked="checked"' : ''; |
484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
484 | + $tplId = ' <small>('.$row['id'].')</small>'; |
|
485 | + $desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : ''; |
|
486 | 486 | |
487 | 487 | $tplInfo = array(); |
488 | - if($row['tpllocked']) { |
|
488 | + if ($row['tpllocked']) { |
|
489 | 489 | $tplInfo[] = $_lang['locked']; |
490 | 490 | } |
491 | - if($row['id'] == $modx->config['default_template']) { |
|
491 | + if ($row['id'] == $modx->config['default_template']) { |
|
492 | 492 | $tplInfo[] = $_lang['defaulttemplate_title']; |
493 | 493 | } |
494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : ''; |
|
494 | + $tplInfo = !empty($tplInfo) ? ' <em>('.join(', ', $tplInfo).')</em>' : ''; |
|
495 | 495 | |
496 | 496 | $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
497 | 497 | $tplList .= '</li>'; |
@@ -506,13 +506,13 @@ discard block |
||
506 | 506 | |
507 | 507 | <!-- Access Permissions --> |
508 | 508 | <?php |
509 | - if($use_udperms == 1) { |
|
509 | + if ($use_udperms == 1) { |
|
510 | 510 | // fetch permissions for the variable |
511 | 511 | $rs = $modx->db->select('documentgroup', $modx->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
512 | 512 | $groupsarray = $modx->db->getColumn('documentgroup', $rs); |
513 | 513 | |
514 | 514 | ?> |
515 | - <?php if($modx->hasPermission('access_permissions')) { ?> |
|
515 | + <?php if ($modx->hasPermission('access_permissions')) { ?> |
|
516 | 516 | <script type="text/javascript"> |
517 | 517 | function makePublic(b) { |
518 | 518 | var notPublic = false; |
@@ -541,26 +541,26 @@ discard block |
||
541 | 541 | <?php |
542 | 542 | $chk = ''; |
543 | 543 | $rs = $modx->db->select('name, id', $tbl_documentgroup_names); |
544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
544 | + if (empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | 545 | $groupsarray = $_POST['docgroups']; |
546 | 546 | } |
547 | - while($row = $modx->db->getRow($rs)) { |
|
547 | + while ($row = $modx->db->getRow($rs)) { |
|
548 | 548 | $checked = in_array($row['id'], $groupsarray); |
549 | - if($modx->hasPermission('access_permissions')) { |
|
550 | - if($checked) { |
|
549 | + if ($modx->hasPermission('access_permissions')) { |
|
550 | + if ($checked) { |
|
551 | 551 | $notPublic = true; |
552 | 552 | } |
553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>"; |
|
554 | 554 | } else { |
555 | - if($checked) { |
|
556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
555 | + if ($checked) { |
|
556 | + echo "<input type='hidden' name='docgroups[]' value='".$row['id']."' />"; |
|
557 | 557 | } |
558 | 558 | } |
559 | 559 | } |
560 | - if($modx->hasPermission('access_permissions')) { |
|
561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
560 | + if ($modx->hasPermission('access_permissions')) { |
|
561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' ".(!$notPublic ? "checked='checked'" : '')." onclick=\"makePublic(true)\" /> <span class='warning'>".$_lang['all_doc_groups']."</span></label></li>".$chks; |
|
562 | 562 | } |
563 | - echo '<ul>' . $chks . '</ul>'; |
|
563 | + echo '<ul>'.$chks.'</ul>'; |
|
564 | 564 | ?> |
565 | 565 | <?php } ?> |
566 | 566 | <?php } ?> |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | <?php |
574 | 574 | // invoke OnTVFormRender event |
575 | 575 | $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
576 | - if(is_array($evtOut)) { |
|
576 | + if (is_array($evtOut)) { |
|
577 | 577 | echo implode('', $evtOut); |
578 | 578 | } |
579 | 579 | ?> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $updateMsg = ''; |
16 | 16 | |
17 | 17 | if (isset($_POST['listSubmitted'])) { |
18 | - $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>'; |
|
18 | + $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>'; |
|
19 | 19 | foreach ($_POST as $listName => $listValue) { |
20 | 20 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
21 | 21 | continue; |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | $sortableList = '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
41 | 41 | while ($row = $modx->db->getRow($rs)) { |
42 | 42 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
43 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
43 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
44 | 44 | } |
45 | 45 | $sortableList .= '</ul></div>'; |
46 | 46 | } else { |
47 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
47 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
48 | 48 | } |
49 | 49 | ?> |
50 | 50 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | // context menu |
28 | -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
|
28 | +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; |
|
29 | 29 | $cm = new ContextMenu("cntxm", 150); |
30 | 30 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0)); |
31 | 31 | if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
@@ -108,24 +108,24 @@ discard block |
||
108 | 108 | <div class="table-responsive"> |
109 | 109 | <?php |
110 | 110 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
111 | - $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon |
|
112 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
|
113 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
114 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
115 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
111 | + $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"'.$_lang['yes'].'","-") as disabled, IF(sm.icon<>"",sm.icon,"'.$_style['icons_modules'].'") as icon |
|
112 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm |
|
113 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
114 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
115 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
116 | 116 | ORDER BY sm.name'); |
117 | 117 | if ($modx->hasPermission('edit_module')) { |
118 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
118 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
119 | 119 | } else if ($modx->hasPermission('exec_module')) { |
120 | - $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
120 | + $title = "<a href='index.php?a=112&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
121 | 121 | } else { |
122 | 122 | $title = '[+value+]'; |
123 | 123 | } |
124 | 124 | } else { |
125 | 125 | $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name"); |
126 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
126 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
127 | 127 | } |
128 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
128 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
129 | 129 | $grd = new DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items |
130 | 130 | $grd->noRecordMsg = $_lang["no_records_found"]; |
131 | 131 | $grd->cssClass = "table data"; |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | $grd->itemClass = "tableItem"; |
134 | 134 | $grd->altItemClass = "tableAltItem"; |
135 | 135 | $grd->fields = "icon,name,description,locked,disabled"; |
136 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; |
|
136 | + $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"]; |
|
137 | 137 | $grd->colWidths = "34,,,60,60"; |
138 | 138 | $grd->colAligns = "center,,,center,center"; |
139 | - $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
|
139 | + $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='[+value+]'></i></a>||template:".$title; |
|
140 | 140 | if ($listmode == '1') { |
141 | 141 | $grd->pageSize = 0; |
142 | 142 | } |
@@ -1,23 +1,23 @@ 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 | 5 | |
6 | 6 | $tpl = array( |
7 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
8 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
9 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
10 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
11 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
7 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_viewForm.tpl'), |
|
8 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
9 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
10 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
11 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl') |
|
12 | 12 | ); |
13 | 13 | |
14 | -function parsePh($tpl, $ph) { |
|
14 | +function parsePh($tpl, $ph){ |
|
15 | 15 | global $modx, $_lang; |
16 | 16 | $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
17 | 17 | return $modx->parseText($tpl, $ph); |
18 | 18 | } |
19 | 19 | |
20 | -function renderViewSwitchButtons($cssId) { |
|
20 | +function renderViewSwitchButtons($cssId){ |
|
21 | 21 | global $modx, $_lang, $tpl; |
22 | 22 | |
23 | 23 | return parsePh($tpl['viewForm'], array( |
@@ -25,20 +25,20 @@ discard block |
||
25 | 25 | )); |
26 | 26 | } |
27 | 27 | |
28 | -function createResourceList($resourceTable, $resources) { |
|
28 | +function createResourceList($resourceTable, $resources){ |
|
29 | 29 | global $modx, $_lang, $_style, $modx_textdir, $tpl; |
30 | 30 | |
31 | 31 | $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
32 | 32 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
33 | 33 | |
34 | - if(!$items) { |
|
34 | + if (!$items) { |
|
35 | 35 | return $_lang['no_results']; |
36 | 36 | } |
37 | 37 | |
38 | 38 | // Prepare elements- and categories-list |
39 | 39 | $elements = array(); |
40 | 40 | $categories = array(); |
41 | - foreach($items as $row) { |
|
41 | + foreach ($items as $row) { |
|
42 | 42 | $catid = $row['catid'] ? $row['catid'] : 0; |
43 | 43 | $categories[$catid] = array('name' => stripslashes($row['category'])); |
44 | 44 | $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
@@ -46,18 +46,18 @@ discard block |
||
46 | 46 | |
47 | 47 | // Now render categories / panel-collapse |
48 | 48 | $panelGroup = ''; |
49 | - foreach($elements as $catid => $elList) { |
|
49 | + foreach ($elements as $catid => $elList) { |
|
50 | 50 | // Add panel-heading / category-collapse to output |
51 | 51 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
52 | 52 | 'tab' => $resourceTable, |
53 | 53 | 'category' => $categories[$catid]['name'], |
54 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
54 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '', |
|
55 | 55 | 'catid' => $catid, |
56 | 56 | )); |
57 | 57 | |
58 | 58 | // Prepare content for panel-collapse |
59 | 59 | $panelCollapse = ''; |
60 | - foreach($elList as $el) { |
|
60 | + foreach ($elList as $el) { |
|
61 | 61 | $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
62 | 62 | } |
63 | 63 | |
@@ -75,30 +75,30 @@ discard block |
||
75 | 75 | )); |
76 | 76 | } |
77 | 77 | |
78 | -function createCombinedView($resources) { |
|
78 | +function createCombinedView($resources){ |
|
79 | 79 | global $modx, $_lang, $_style, $modx_textdir; |
80 | 80 | |
81 | 81 | $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
82 | 82 | $types = isset($resources->types) ? $resources->types : false; |
83 | 83 | $categories = isset($resources->categories) ? $resources->categories : false; |
84 | 84 | |
85 | - if(!$itemsPerCategory) { |
|
85 | + if (!$itemsPerCategory) { |
|
86 | 86 | return $_lang['no_results']; |
87 | 87 | } |
88 | 88 | |
89 | 89 | $tpl = array( |
90 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
91 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
92 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
93 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
90 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelGroup.tpl'), |
|
91 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelHeading.tpl'), |
|
92 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_panelCollapse.tpl'), |
|
93 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH.'actions/resources/tpl_elementsRow.tpl'), |
|
94 | 94 | ); |
95 | 95 | |
96 | 96 | // Easily loop through $itemsPerCategory-Array |
97 | 97 | $panelGroup = ''; |
98 | - foreach($categories as $catid => $category) { |
|
98 | + foreach ($categories as $catid => $category) { |
|
99 | 99 | // Prepare collapse content / elements-list |
100 | 100 | $panelCollapse = ''; |
101 | - foreach($itemsPerCategory[$catid] as $el) { |
|
101 | + foreach ($itemsPerCategory[$catid] as $el) { |
|
102 | 102 | $resourceTable = $el['type']; |
103 | 103 | $ph = prepareElementRowPh($el, $resourceTable, $resources); |
104 | 104 | $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
109 | 109 | 'tab' => 'categories_list', |
110 | 110 | 'category' => $categories[$catid], |
111 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
111 | + 'categoryid' => $catid != '' ? ' <small>('.$catid.')</small>' : '', |
|
112 | 112 | 'catid' => $catid, |
113 | 113 | )); |
114 | 114 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | )); |
127 | 127 | } |
128 | 128 | |
129 | -function prepareElementRowPh($row, $resourceTable, $resources) { |
|
129 | +function prepareElementRowPh($row, $resourceTable, $resources){ |
|
130 | 130 | global $modx, $modx_textdir, $_style, $_lang; |
131 | 131 | |
132 | 132 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
@@ -134,32 +134,32 @@ discard block |
||
134 | 134 | $class = ''; |
135 | 135 | $_lang["confirm_delete"] = $_lang["delete"]; |
136 | 136 | |
137 | - if($resourceTable == 'site_templates') { |
|
137 | + if ($resourceTable == 'site_templates') { |
|
138 | 138 | $class = $row['selectable'] ? '' : 'disabledPlugin'; |
139 | 139 | $lockElementType = 1; |
140 | 140 | $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; |
141 | 141 | } |
142 | - if($resourceTable == 'site_tmplvars') { |
|
142 | + if ($resourceTable == 'site_tmplvars') { |
|
143 | 143 | $class = $row['reltpl'] ? '' : 'disabledPlugin'; |
144 | 144 | $lockElementType = 2; |
145 | 145 | $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; |
146 | 146 | } |
147 | - if($resourceTable == 'site_htmlsnippets') { |
|
147 | + if ($resourceTable == 'site_htmlsnippets') { |
|
148 | 148 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
149 | 149 | $lockElementType = 3; |
150 | 150 | $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; |
151 | 151 | } |
152 | - if($resourceTable == 'site_snippets') { |
|
152 | + if ($resourceTable == 'site_snippets') { |
|
153 | 153 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
154 | 154 | $lockElementType = 4; |
155 | 155 | $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; |
156 | 156 | } |
157 | - if($resourceTable == 'site_plugins') { |
|
157 | + if ($resourceTable == 'site_plugins') { |
|
158 | 158 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
159 | 159 | $lockElementType = 5; |
160 | 160 | $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; |
161 | 161 | } |
162 | - if($resourceTable == 'site_modules') { |
|
162 | + if ($resourceTable == 'site_modules') { |
|
163 | 163 | $class = $row['disabled'] ? '' : 'disabledPlugin'; |
164 | 164 | $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; |
165 | 165 | } |
@@ -167,65 +167,65 @@ discard block |
||
167 | 167 | // Prepare displaying user-locks |
168 | 168 | $lockedByUser = ''; |
169 | 169 | $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
170 | - if($rowLock && $modx->hasPermission('display_locks')) { |
|
171 | - if($rowLock['sid'] == $modx->sid) { |
|
170 | + if ($rowLock && $modx->hasPermission('display_locks')) { |
|
171 | + if ($rowLock['sid'] == $modx->sid) { |
|
172 | 172 | $title = $modx->parseText($_lang["lock_element_editing"], array( |
173 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
173 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
174 | 174 | 'lasthit_df' => $rowLock['lasthit_df'] |
175 | 175 | )); |
176 | - $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
176 | + $lockedByUser = '<span title="'.$title.'" class="editResource" style="cursor:context-menu;">'.$_style['tree_preview_resource'].'</span> '; |
|
177 | 177 | } else { |
178 | 178 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
179 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
179 | + 'element_type' => $_lang["lock_element_type_".$lockElementType], |
|
180 | 180 | 'username' => $rowLock['username'], |
181 | 181 | 'lasthit_df' => $rowLock['lasthit_df'] |
182 | 182 | )); |
183 | - if($modx->hasPermission('remove_locks')) { |
|
184 | - $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>'; |
|
183 | + if ($modx->hasPermission('remove_locks')) { |
|
184 | + $lockedByUser = '<a href="javascript:;" onclick="unlockElement('.$lockElementType.', '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource"><i class="'.$_style['icons_secured'].'"></i></a>'; |
|
185 | 185 | } else { |
186 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
186 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource" style="cursor:context-menu;"><i class="'.$_style['icons_secured'].'"></i></span>'; |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | } |
190 | - if($lockedByUser) { |
|
191 | - $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
190 | + if ($lockedByUser) { |
|
191 | + $lockedByUser = '<div class="lockCell">'.$lockedByUser.'</div>'; |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | // Caption |
195 | - if($resourceTable == 'site_tmplvars') { |
|
196 | - $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption']; |
|
195 | + if ($resourceTable == 'site_tmplvars') { |
|
196 | + $caption = !empty($row['description']) ? ' '.$row['caption'].' <small>('.$row['description'].')</small>' : ' '.$row['caption']; |
|
197 | 197 | } else { |
198 | - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
198 | + $caption = !empty($row['description']) ? ' '.$row['description'] : ''; |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | // Special marks |
202 | 202 | $tplInfo = array(); |
203 | - if($row['locked']) { |
|
203 | + if ($row['locked']) { |
|
204 | 204 | $tplInfo[] = $_lang['locked']; |
205 | 205 | } |
206 | - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
206 | + if ($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
207 | 207 | $tplInfo[] = $_lang['defaulttemplate_title']; |
208 | 208 | } |
209 | - $marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : ''; |
|
209 | + $marks = !empty($tplInfo) ? ' <em>('.join(', ', $tplInfo).')</em>' : ''; |
|
210 | 210 | |
211 | 211 | /* row buttons */ |
212 | 212 | $buttons = ''; |
213 | - if($modx->hasPermission($types['actions']['edit'][1])) { |
|
214 | - $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
213 | + if ($modx->hasPermission($types['actions']['edit'][1])) { |
|
214 | + $buttons .= '<li><a title="'.$_lang["edit_resource"].'" href="index.php?a='.$types['actions']['edit'][0].'&id='.$row['id'].'"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
215 | 215 | } |
216 | - if($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
217 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
216 | + if ($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
217 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_duplicate_record"].'\')" title="'.$_lang["resource_duplicate"].'" href="index.php?a='.$types['actions']['duplicate'][0].'&id='.$row['id'].'"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
218 | 218 | } |
219 | - if($modx->hasPermission($types['actions']['remove'][1])) { |
|
220 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
219 | + if ($modx->hasPermission($types['actions']['remove'][1])) { |
|
220 | + $buttons .= '<li><a onclick="return confirm(\''.$_lang["confirm_delete"].'\')" title="'.$_lang["delete"].'" href="index.php?a='.$types['actions']['remove'][0].'&id='.$row['id'].'"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
221 | 221 | } |
222 | - $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
222 | + $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">'.$buttons.'</ul></div>' : ''; |
|
223 | 223 | |
224 | 224 | $catid = $row['catid'] ? $row['catid'] : 0; |
225 | 225 | |
226 | 226 | // Placeholders for elements-row |
227 | 227 | return array( |
228 | - 'class' => $class ? ' class="' . $class . '"' : '', |
|
228 | + 'class' => $class ? ' class="'.$class.'"' : '', |
|
229 | 229 | 'lockedByUser' => $lockedByUser, |
230 | 230 | 'name' => $row['name'], |
231 | 231 | 'caption' => $caption, |
@@ -1,75 +1,75 @@ 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 | -class mgrResources { |
|
4 | +class mgrResources{ |
|
5 | 5 | var $types = array(); |
6 | 6 | var $items = array(); |
7 | 7 | var $categories = array(); |
8 | 8 | var $itemsPerCategory = array(); |
9 | 9 | |
10 | - function __construct() { |
|
10 | + function __construct(){ |
|
11 | 11 | $this->setTypes(); |
12 | 12 | $this->queryItemsFromDB(); |
13 | 13 | $this->prepareCategoryArrays(); |
14 | 14 | } |
15 | 15 | |
16 | - function setTypes() { |
|
16 | + function setTypes(){ |
|
17 | 17 | global $_lang; |
18 | - $this->types['site_templates'] = array( |
|
18 | + $this->types['site_templates'] = array( |
|
19 | 19 | 'title'=>$_lang["manage_templates"], |
20 | - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
21 | - 'permissions'=>array('new_template','edit_template'), |
|
20 | + 'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')), |
|
21 | + 'permissions'=>array('new_template', 'edit_template'), |
|
22 | 22 | 'name'=>'templatename' |
23 | 23 | ); |
24 | - $this->types['site_tmplvars'] = array( |
|
24 | + $this->types['site_tmplvars'] = array( |
|
25 | 25 | 'title'=>$_lang["tmplvars"], |
26 | - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
27 | - 'permissions'=>array('new_template','edit_template'), |
|
26 | + 'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')), |
|
27 | + 'permissions'=>array('new_template', 'edit_template'), |
|
28 | 28 | ); |
29 | 29 | $this->types['site_htmlsnippets'] = array( |
30 | 30 | 'title'=>$_lang["manage_htmlsnippets"], |
31 | - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
32 | - 'permissions'=>array('new_chunk','edit_chunk'), |
|
31 | + 'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')), |
|
32 | + 'permissions'=>array('new_chunk', 'edit_chunk'), |
|
33 | 33 | ); |
34 | - $this->types['site_snippets'] = array( |
|
34 | + $this->types['site_snippets'] = array( |
|
35 | 35 | 'title'=>$_lang["manage_snippets"], |
36 | - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
37 | - 'permissions'=>array('new_snippet','edit_snippet'), |
|
36 | + 'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')), |
|
37 | + 'permissions'=>array('new_snippet', 'edit_snippet'), |
|
38 | 38 | ); |
39 | - $this->types['site_plugins'] = array( |
|
39 | + $this->types['site_plugins'] = array( |
|
40 | 40 | 'title'=>$_lang["manage_plugins"], |
41 | - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
42 | - 'permissions'=>array('new_plugin','edit_plugin'), |
|
41 | + 'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')), |
|
42 | + 'permissions'=>array('new_plugin', 'edit_plugin'), |
|
43 | 43 | ); |
44 | - $this->types['site_modules'] = array( |
|
44 | + $this->types['site_modules'] = array( |
|
45 | 45 | 'title'=>$_lang["manage_modules"], |
46 | - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
47 | - 'permissions'=>array('new_module','edit_module'), |
|
46 | + 'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')), |
|
47 | + 'permissions'=>array('new_module', 'edit_module'), |
|
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | - function queryItemsFromDB() { |
|
52 | - foreach($this->types as $resourceTable=>$type) { |
|
53 | - if($this->hasAnyPermissions($type['permissions'])) { |
|
51 | + function queryItemsFromDB(){ |
|
52 | + foreach ($this->types as $resourceTable=>$type) { |
|
53 | + if ($this->hasAnyPermissions($type['permissions'])) { |
|
54 | 54 | $nameField = isset($type['name']) ? $type['name'] : 'name'; |
55 | 55 | $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | - function hasAnyPermissions($permissions) { |
|
60 | + function hasAnyPermissions($permissions){ |
|
61 | 61 | global $modx; |
62 | 62 | |
63 | - foreach($permissions as $p) |
|
64 | - if($modx->hasPermission($p)) return true; |
|
63 | + foreach ($permissions as $p) |
|
64 | + if ($modx->hasPermission($p)) return true; |
|
65 | 65 | |
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - function queryResources($resourceTable, $nameField = 'name') { |
|
69 | + function queryResources($resourceTable, $nameField = 'name'){ |
|
70 | 70 | global $modx, $_lang; |
71 | 71 | |
72 | - $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : ''; |
|
72 | + $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable.'.disabled, ' : ''; |
|
73 | 73 | |
74 | 74 | $tvsql = ''; |
75 | 75 | $tvjoin = ''; |
@@ -84,14 +84,14 @@ discard block |
||
84 | 84 | |
85 | 85 | $rs = $modx->db->select( |
86 | 86 | "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
87 | - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
88 | - LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
|
87 | + $modx->getFullTableName($resourceTable)." AS {$resourceTable} |
|
88 | + LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
|
89 | 89 | "", |
90 | 90 | "category,name" |
91 | 91 | ); |
92 | 92 | $limit = $modx->db->getRecordCount($rs); |
93 | 93 | |
94 | - if($limit < 1) return false; |
|
94 | + if ($limit < 1) return false; |
|
95 | 95 | |
96 | 96 | $result = array(); |
97 | 97 | while ($row = $modx->db->getRow($rs)) { |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | return $result; |
101 | 101 | } |
102 | 102 | |
103 | - function prepareCategoryArrays() { |
|
104 | - foreach($this->items as $type=>$items) { |
|
105 | - foreach((array)$items as $item) { |
|
103 | + function prepareCategoryArrays(){ |
|
104 | + foreach ($this->items as $type=>$items) { |
|
105 | + foreach ((array) $items as $item) { |
|
106 | 106 | $catid = $item['catid'] ? $item['catid'] : 0; |
107 | 107 | $this->categories[$catid] = $item['category']; |
108 | 108 | |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | natcasesort($this->categories); |
116 | 116 | |
117 | 117 | // Now sort by name |
118 | - foreach($this->itemsPerCategory as $catid=>$items) { |
|
119 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
118 | + foreach ($this->itemsPerCategory as $catid=>$items) { |
|
119 | + usort($this->itemsPerCategory[$catid], function($a, $b){ |
|
120 | 120 | return strcasecmp($a['name'], $b['name']); |
121 | 121 | }); |
122 | 122 | } |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | $collation = $modx->db->getRow($res, 'num'); |
13 | 13 | |
14 | 14 | $serverArr = array( |
15 | - $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext, |
|
15 | + $_lang['modx_version'] => $modx->getVersionData('version').' '.$newversiontext, |
|
16 | 16 | $_lang['release_date'] => $modx->getVersionData('release_date'), |
17 | 17 | 'PHP Version' => phpversion(), |
18 | - 'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">' . $_lang['view'] . '</a>', |
|
18 | + 'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">'.$_lang['view'].'</a>', |
|
19 | 19 | $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']), |
20 | 20 | $_lang['servertime'] => strftime('%H:%M:%S', time()), |
21 | 21 | $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time), |
22 | - $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h', |
|
22 | + $_lang['serveroffset'] => $server_offset_time / (60 * 60).' h', |
|
23 | 23 | $_lang['database_name'] => trim($dbase, '`'), |
24 | 24 | $_lang['database_server'] => $database_server, |
25 | 25 | $_lang['database_version'] => $modx->db->getVersion(), |
@@ -95,33 +95,33 @@ discard block |
||
95 | 95 | </thead> |
96 | 96 | <tbody> |
97 | 97 | <?php |
98 | - $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; |
|
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 | 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> |
105 | - <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $log_status['Comment'] . '"></i>' : '') ?></td> |
|
105 | + <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$log_status['Comment'].'"></i>' : '') ?></td> |
|
106 | 106 | <td class="text-xs-right"><?= $log_status['Rows'] ?></td> |
107 | 107 | |
108 | 108 | <?php |
109 | 109 | $truncateable = array( |
110 | - $modx->db->config['table_prefix'] . 'event_log', |
|
111 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
110 | + $modx->db->config['table_prefix'].'event_log', |
|
111 | + $modx->db->config['table_prefix'].'manager_log', |
|
112 | 112 | ); |
113 | 113 | if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
114 | 114 | echo "<td class=\"text-xs-right\">"; |
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>"; |
|
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 | 117 | } else { |
118 | - echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
|
118 | + echo "<td class=\"text-xs-right\">".$modx->nicesize($log_status['Data_length'] + $log_status['Data_free'])."</td>"; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | if ($modx->hasPermission('settings')) { |
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>"; |
|
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 | 123 | } else { |
124 | - echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
|
124 | + echo "<td class=\"text-xs-right\">".($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-")."</td>"; |
|
125 | 125 | } |
126 | 126 | ?> |
127 | 127 | <td class="text-xs-right"><?= $modx->nicesize($log_status['Data_length'] - $log_status['Data_free']) ?></td> |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | <tr class="unstyled"> |
137 | 137 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
138 | 138 | <td colspan="3"> </td> |
139 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">" . $modx->nicesize($totaloverhead) . "</b><br />(" . number_format($totaloverhead) . " B)" : "-" ?></td> |
|
139 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">".$modx->nicesize($totaloverhead)."</b><br />(".number_format($totaloverhead)." B)" : "-" ?></td> |
|
140 | 140 | <td colspan="2"> </td> |
141 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
141 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
142 | 142 | </tr> |
143 | 143 | </tbody> |
144 | 144 | </table> |
@@ -1,8 +1,8 @@ |
||
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('change_password')) { |
|
5 | +if (!$modx->hasPermission('change_password')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | ?> |