@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | if(!$modx->hasPermission('edit_module')) { |
7 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
8 | 8 | } |
9 | 9 | |
10 | 10 | $id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -26,91 +26,91 @@ discard block |
||
26 | 26 | // check to see the editor isn't locked |
27 | 27 | $rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
28 | 28 | if($username = $modx->db->getValue($rs)) { |
29 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
29 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
|
30 | 30 | } |
31 | 31 | // end check for lock |
32 | 32 | |
33 | 33 | // take action |
34 | 34 | switch($_REQUEST['op']) { |
35 | - case 'add': |
|
36 | - // convert ids to numbers |
|
37 | - $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
38 | - |
|
39 | - if(count($opids) > 0) { |
|
40 | - // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
41 | - $rt = strtolower($_REQUEST["rt"]); |
|
42 | - if($rt == 'chunk') { |
|
43 | - $type = 10; |
|
44 | - } |
|
45 | - if($rt == 'doc') { |
|
46 | - $type = 20; |
|
47 | - } |
|
48 | - if($rt == 'plug') { |
|
49 | - $type = 30; |
|
50 | - } |
|
51 | - if($rt == 'snip') { |
|
52 | - $type = 40; |
|
53 | - } |
|
54 | - if($rt == 'tpl') { |
|
55 | - $type = 50; |
|
56 | - } |
|
57 | - if($rt == 'tv') { |
|
58 | - $type = 60; |
|
59 | - } |
|
60 | - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | - foreach($opids as $opid) { |
|
62 | - $modx->db->insert(array( |
|
63 | - 'module' => $id, |
|
64 | - 'resource' => $opid, |
|
65 | - 'type' => $type, |
|
66 | - ), $tbl_site_module_depobj); |
|
67 | - } |
|
68 | - } |
|
69 | - break; |
|
70 | - case 'del': |
|
71 | - // convert ids to numbers |
|
72 | - $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
73 | - |
|
74 | - // get resources that needs to be removed |
|
75 | - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
76 | - // loop through resources and look for plugins and snippets |
|
77 | - $plids = array(); |
|
78 | - $snid = array(); |
|
79 | - while($row = $modx->db->getRow($ds)) { |
|
80 | - if($row['type'] == '30') { |
|
81 | - $plids[$i] = $row['resource']; |
|
82 | - } |
|
83 | - if($row['type'] == '40') { |
|
84 | - $snids[$i] = $row['resource']; |
|
85 | - } |
|
86 | - } |
|
87 | - // get guid |
|
88 | - $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
89 | - $guid = $modx->db->getValue($ds); |
|
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}'"); |
|
94 | - } |
|
95 | - if($cs) { |
|
96 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
97 | - } |
|
98 | - // reset cache |
|
99 | - $modx->clearCache('full'); |
|
100 | - } |
|
101 | - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
102 | - break; |
|
35 | + case 'add': |
|
36 | + // convert ids to numbers |
|
37 | + $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
|
38 | + |
|
39 | + if(count($opids) > 0) { |
|
40 | + // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
|
41 | + $rt = strtolower($_REQUEST["rt"]); |
|
42 | + if($rt == 'chunk') { |
|
43 | + $type = 10; |
|
44 | + } |
|
45 | + if($rt == 'doc') { |
|
46 | + $type = 20; |
|
47 | + } |
|
48 | + if($rt == 'plug') { |
|
49 | + $type = 30; |
|
50 | + } |
|
51 | + if($rt == 'snip') { |
|
52 | + $type = 40; |
|
53 | + } |
|
54 | + if($rt == 'tpl') { |
|
55 | + $type = 50; |
|
56 | + } |
|
57 | + if($rt == 'tv') { |
|
58 | + $type = 60; |
|
59 | + } |
|
60 | + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | + foreach($opids as $opid) { |
|
62 | + $modx->db->insert(array( |
|
63 | + 'module' => $id, |
|
64 | + 'resource' => $opid, |
|
65 | + 'type' => $type, |
|
66 | + ), $tbl_site_module_depobj); |
|
67 | + } |
|
68 | + } |
|
69 | + break; |
|
70 | + case 'del': |
|
71 | + // convert ids to numbers |
|
72 | + $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
|
73 | + |
|
74 | + // get resources that needs to be removed |
|
75 | + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
76 | + // loop through resources and look for plugins and snippets |
|
77 | + $plids = array(); |
|
78 | + $snid = array(); |
|
79 | + while($row = $modx->db->getRow($ds)) { |
|
80 | + if($row['type'] == '30') { |
|
81 | + $plids[$i] = $row['resource']; |
|
82 | + } |
|
83 | + if($row['type'] == '40') { |
|
84 | + $snids[$i] = $row['resource']; |
|
85 | + } |
|
86 | + } |
|
87 | + // get guid |
|
88 | + $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
|
89 | + $guid = $modx->db->getValue($ds); |
|
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}'"); |
|
94 | + } |
|
95 | + if($cs) { |
|
96 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
97 | + } |
|
98 | + // reset cache |
|
99 | + $modx->clearCache('full'); |
|
100 | + } |
|
101 | + $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
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 | 108 | if(!$content) { |
109 | - $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
109 | + $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
|
110 | 110 | } |
111 | 111 | $_SESSION['itemname'] = $content['name']; |
112 | 112 | if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
113 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
113 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | ?> |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | <tr> |
204 | 204 | <td valign="top" align="left"> |
205 | 205 | <?php |
206 | - $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
206 | + $ds = $modx->db->select("smd.id,COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) as name, |
|
207 | 207 | CASE smd.type |
208 | 208 | WHEN 10 THEN 'Chunk' |
209 | 209 | WHEN 20 THEN 'Document' |
@@ -218,18 +218,18 @@ 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"; |
|
222 | - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
223 | - $grd->noRecordMsg = $_lang["no_records_found"]; |
|
224 | - $grd->cssClass = "grid"; |
|
225 | - $grd->columnHeaderClass = "gridHeader"; |
|
226 | - $grd->itemClass = "gridItem"; |
|
227 | - $grd->altItemClass = "gridAltItem"; |
|
228 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
229 | - $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
230 | - $grd->fields = "name,type"; |
|
231 | - echo $grd->render(); |
|
232 | - ?> |
|
221 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
222 | + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
|
223 | + $grd->noRecordMsg = $_lang["no_records_found"]; |
|
224 | + $grd->cssClass = "grid"; |
|
225 | + $grd->columnHeaderClass = "gridHeader"; |
|
226 | + $grd->itemClass = "gridItem"; |
|
227 | + $grd->altItemClass = "gridAltItem"; |
|
228 | + $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
229 | + $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
|
230 | + $grd->fields = "name,type"; |
|
231 | + echo $grd->render(); |
|
232 | + ?> |
|
233 | 233 | </td> |
234 | 234 | <td valign="top" style="width: 150px;"> |
235 | 235 | <a class="btn btn-block btn-danger text-left" style="margin-bottom:10px;" href="javascript:;" onclick="removeDependencies();return false;"><i class="<?php echo $_style["actions_delete"] ?>"></i> <?php echo $_lang['remove']; ?></a> |
@@ -1,9 +1,9 @@ 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 | |
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,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 | if (!$modx->hasPermission('file_manager')) { |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | $newToken = makeToken(); |
10 | 10 | |
11 | 11 | // settings |
12 | -$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
12 | +$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
13 | 13 | $excludes = array( |
14 | 14 | '.', |
15 | 15 | '..', |
16 | 16 | '.svn' |
17 | 17 | ); |
18 | -$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : ''; |
|
19 | -$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json' . $alias_suffix); |
|
20 | -$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json' . $alias_suffix); |
|
18 | +$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : ''; |
|
19 | +$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json'.$alias_suffix); |
|
20 | +$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json'.$alias_suffix); |
|
21 | 21 | $viewablefiles = explode(',', 'jpg,gif,png,ico'); |
22 | 22 | |
23 | 23 | $editablefiles = add_dot($editablefiles); |
@@ -30,31 +30,31 @@ discard block |
||
30 | 30 | { |
31 | 31 | */ |
32 | 32 | $protected_path[] = $modx->config['site_manager_path']; |
33 | -$protected_path[] = $modx->config['base_path'] . 'temp/backup'; |
|
34 | -$protected_path[] = $modx->config['base_path'] . 'assets/backup'; |
|
33 | +$protected_path[] = $modx->config['base_path'].'temp/backup'; |
|
34 | +$protected_path[] = $modx->config['base_path'].'assets/backup'; |
|
35 | 35 | |
36 | 36 | if (!$modx->hasPermission('save_plugin')) { |
37 | - $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; |
|
37 | + $protected_path[] = $modx->config['base_path'].'assets/plugins'; |
|
38 | 38 | } |
39 | 39 | if (!$modx->hasPermission('save_snippet')) { |
40 | - $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; |
|
40 | + $protected_path[] = $modx->config['base_path'].'assets/snippets'; |
|
41 | 41 | } |
42 | 42 | if (!$modx->hasPermission('save_template')) { |
43 | - $protected_path[] = $modx->config['base_path'] . 'assets/templates'; |
|
43 | + $protected_path[] = $modx->config['base_path'].'assets/templates'; |
|
44 | 44 | } |
45 | 45 | if (!$modx->hasPermission('save_module')) { |
46 | - $protected_path[] = $modx->config['base_path'] . 'assets/modules'; |
|
46 | + $protected_path[] = $modx->config['base_path'].'assets/modules'; |
|
47 | 47 | } |
48 | 48 | if (!$modx->hasPermission('empty_cache')) { |
49 | - $protected_path[] = $modx->config['base_path'] . 'assets/cache'; |
|
49 | + $protected_path[] = $modx->config['base_path'].'assets/cache'; |
|
50 | 50 | } |
51 | 51 | if (!$modx->hasPermission('import_static')) { |
52 | - $protected_path[] = $modx->config['base_path'] . 'temp/import'; |
|
53 | - $protected_path[] = $modx->config['base_path'] . 'assets/import'; |
|
52 | + $protected_path[] = $modx->config['base_path'].'temp/import'; |
|
53 | + $protected_path[] = $modx->config['base_path'].'assets/import'; |
|
54 | 54 | } |
55 | 55 | if (!$modx->hasPermission('export_static')) { |
56 | - $protected_path[] = $modx->config['base_path'] . 'temp/export'; |
|
57 | - $protected_path[] = $modx->config['base_path'] . 'assets/export'; |
|
56 | + $protected_path[] = $modx->config['base_path'].'temp/export'; |
|
57 | + $protected_path[] = $modx->config['base_path'].'assets/export'; |
|
58 | 58 | } |
59 | 59 | /* |
60 | 60 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | { |
80 | 80 | $count = count($array); |
81 | 81 | for ($i = 0; $i < $count; $i++) { |
82 | - $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :) |
|
82 | + $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :) |
|
83 | 83 | } |
84 | 84 | return $array; |
85 | 85 | } |
@@ -104,15 +104,15 @@ discard block |
||
104 | 104 | $rw = realpath('../'); |
105 | 105 | $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf)); |
106 | 106 | if (substr($webstart_path, 0, 1) == '/') { |
107 | - $webstart_path = '..' . $webstart_path; |
|
107 | + $webstart_path = '..'.$webstart_path; |
|
108 | 108 | } else { |
109 | - $webstart_path = '../' . $webstart_path; |
|
109 | + $webstart_path = '../'.$webstart_path; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | ?> |
113 | 113 | <script type="text/javascript"> |
114 | 114 | |
115 | - var current_path = '<?= $startpath;?>'; |
|
115 | + var current_path = '<?= $startpath; ?>'; |
|
116 | 116 | |
117 | 117 | function viewfile (url) |
118 | 118 | { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | function unzipFile (file) |
149 | 149 | { |
150 | 150 | if (confirmUnzip()) { |
151 | - window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>"; |
|
151 | + window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>"; |
|
152 | 152 | return false; |
153 | 153 | } |
154 | 154 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | function deleteFolder (folder, status) |
171 | 171 | { |
172 | 172 | if (confirmDeleteFolder(status)) { |
173 | - window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>"; |
|
173 | + window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>"; |
|
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | function deleteFile (file) |
179 | 179 | { |
180 | 180 | if (confirmDelete()) { |
181 | - window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>"; |
|
181 | + window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>"; |
|
182 | 182 | return false; |
183 | 183 | } |
184 | 184 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
189 | 189 | if (newFilename !== null && newFilename !== file) { |
190 | - window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
190 | + window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir); |
197 | 197 | if (newDirname !== null && newDirname !== dir) { |
198 | - window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>"; |
|
198 | + window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>"; |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | { |
204 | 204 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
205 | 205 | if (newFilename !== null && newFilename !== file) { |
206 | - window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
206 | + window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | <?php endif ?> |
223 | 223 | <?php |
224 | 224 | if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') { |
225 | - $href = 'a=31&path=' . urlencode($_REQUEST['path']); |
|
225 | + $href = 'a=31&path='.urlencode($_REQUEST['path']); |
|
226 | 226 | } else { |
227 | 227 | $href = 'a=2'; |
228 | 228 | } |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>'; |
233 | 233 | $ph['image'] = $_style['files_folder-open']; |
234 | 234 | $ph['subject'] = $_lang['add_folder']; |
235 | - $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name='; |
|
235 | + $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name='; |
|
236 | 236 | $_ = parsePlaceholder($tpl, $ph); |
237 | 237 | |
238 | - $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>'; |
|
238 | + $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>'; |
|
239 | 239 | $ph['image'] = $_style['files_page_html']; |
240 | - $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name='; |
|
240 | + $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name='; |
|
241 | 241 | $_ .= parsePlaceholder($tpl, $ph); |
242 | 242 | echo $_; |
243 | 243 | } |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | $ph = array(); |
268 | 268 | $ph['style_path'] = $theme_image_path; |
269 | 269 | // To Top Level with folder icon to the left |
270 | - if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) { |
|
271 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
270 | + if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) { |
|
271 | + $ph['image'] = ''.$_style['files_top'].''; |
|
272 | 272 | $ph['subject'] = '<span>Top</span>'; |
273 | 273 | } else { |
274 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
275 | - $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/'; |
|
274 | + $ph['image'] = ''.$_style['files_top'].''; |
|
275 | + $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/'; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | echo parsePlaceholder($tpl, $ph); |
@@ -289,12 +289,12 @@ discard block |
||
289 | 289 | if (empty($v)) { |
290 | 290 | continue; |
291 | 291 | } |
292 | - $path .= rtrim($v, '/') . '/'; |
|
292 | + $path .= rtrim($v, '/').'/'; |
|
293 | 293 | if (1 < $count) { |
294 | - $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path); |
|
295 | - $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>'; |
|
294 | + $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path); |
|
295 | + $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>'; |
|
296 | 296 | } else { |
297 | - $pieces[$i] = '<span>' . trim($v, '/') . '</span>'; |
|
297 | + $pieces[$i] = '<span>'.trim($v, '/').'</span>'; |
|
298 | 298 | } |
299 | 299 | $count--; |
300 | 300 | } |
@@ -307,16 +307,16 @@ discard block |
||
307 | 307 | </div> |
308 | 308 | <?php |
309 | 309 | // check to see user isn't trying to move below the document_root |
310 | - if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) { |
|
310 | + if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) { |
|
311 | 311 | $modx->webAlertAndQuit($_lang["files_access_denied"]); |
312 | 312 | } |
313 | 313 | |
314 | 314 | // Unzip .zip files - by Raymond |
315 | 315 | if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) { |
316 | - if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) { |
|
317 | - echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />'; |
|
316 | + if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) { |
|
317 | + echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />'; |
|
318 | 318 | } else { |
319 | - echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />'; |
|
319 | + echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />'; |
|
320 | 320 | } |
321 | 321 | } |
322 | 322 | // End Unzip - Raymond |
@@ -328,9 +328,9 @@ discard block |
||
328 | 328 | if ($_REQUEST['mode'] == 'deletefolder') { |
329 | 329 | $folder = $_REQUEST['folderpath']; |
330 | 330 | if (!$token_check || !@rrmdir($folder)) { |
331 | - echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />'; |
|
331 | + echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />'; |
|
332 | 332 | } else { |
333 | - echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />'; |
|
333 | + echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />'; |
|
334 | 334 | } |
335 | 335 | } |
336 | 336 | |
@@ -341,10 +341,10 @@ discard block |
||
341 | 341 | if (!mkdirs("{$startpath}/{$foldername}", 0777)) { |
342 | 342 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
343 | 343 | } else { |
344 | - if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) { |
|
345 | - echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />'; |
|
344 | + if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) { |
|
345 | + echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />'; |
|
346 | 346 | } else { |
347 | - echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />'; |
|
347 | + echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />'; |
|
348 | 348 | } |
349 | 349 | } |
350 | 350 | umask($old_umask); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $filename = $modx->db->escape($filename); |
357 | 357 | |
358 | 358 | if (!checkExtension($filename)) { |
359 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
359 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
360 | 360 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) { |
361 | 361 | echo $_lang['files.dynamic.php3']; |
362 | 362 | } else { |
@@ -378,11 +378,11 @@ discard block |
||
378 | 378 | $newFilename = $modx->db->escape($newFilename); |
379 | 379 | |
380 | 380 | if (!checkExtension($newFilename)) { |
381 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
381 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
382 | 382 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
383 | 383 | echo $_lang['files.dynamic.php3']; |
384 | 384 | } else { |
385 | - if (!copy($filename, MODX_BASE_PATH . $newFilename)) { |
|
385 | + if (!copy($filename, MODX_BASE_PATH.$newFilename)) { |
|
386 | 386 | echo $_lang['files.dynamic.php5']; |
387 | 387 | } |
388 | 388 | umask($old_umask); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | // Rename folder here |
392 | 392 | if ($_REQUEST['mode'] == 'renameFolder') { |
393 | 393 | $old_umask = umask(0); |
394 | - $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname']; |
|
394 | + $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname']; |
|
395 | 395 | $dirname = $modx->db->escape($dirname); |
396 | 396 | $newDirname = str_replace(array( |
397 | 397 | '..\\', |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { |
405 | 405 | echo $_lang['files.dynamic.php3']; |
406 | - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { |
|
406 | + } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) { |
|
407 | 407 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
408 | 408 | } |
409 | 409 | umask($old_umask); |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | $newFilename = $modx->db->escape($newFilename); |
424 | 424 | |
425 | 425 | if (!checkExtension($newFilename)) { |
426 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
426 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
427 | 427 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
428 | 428 | echo $_lang['files.dynamic.php3']; |
429 | 429 | } else { |
430 | - if (!rename($filename, $path . '/' . $newFilename)) { |
|
430 | + if (!rename($filename, $path.'/'.$newFilename)) { |
|
431 | 431 | echo $_lang['files.dynamic.php5']; |
432 | 432 | } |
433 | 433 | umask($old_umask); |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | ls($startpath); |
461 | 461 | echo "\n\n\n"; |
462 | 462 | if ($folders == 0 && $files == 0) { |
463 | - echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>'; |
|
463 | + echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>'; |
|
464 | 464 | } |
465 | 465 | ?> |
466 | 466 | </table> |
@@ -469,10 +469,10 @@ discard block |
||
469 | 469 | <div class="container"> |
470 | 470 | <p> |
471 | 471 | <?php |
472 | - echo $_lang['files_directories'] . ': <b>' . $folders . '</b> '; |
|
473 | - echo $_lang['files_files'] . ': <b>' . $files . '</b> '; |
|
474 | - echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> '; |
|
475 | - echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>' |
|
472 | + echo $_lang['files_directories'].': <b>'.$folders.'</b> '; |
|
473 | + echo $_lang['files_files'].': <b>'.$files.'</b> '; |
|
474 | + echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> '; |
|
475 | + echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>' |
|
476 | 476 | ?> |
477 | 477 | </p> |
478 | 478 | |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | </form> |
498 | 498 | <?php |
499 | 499 | } else { |
500 | - echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>"; |
|
500 | + echo "<p>".$_lang['files_upload_inhibited_msg']."</p>"; |
|
501 | 501 | } |
502 | 502 | ?> |
503 | 503 | <div id="imageviewer"></div> |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | if ($file == $selFile) { |
577 | 577 | $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default']; |
578 | 578 | } |
579 | - return '<i class="' . $icon . ' FilesPage"></i>'; |
|
579 | + return '<i class="'.$icon.' FilesPage"></i>'; |
|
580 | 580 | } |
581 | 581 | |
582 | 582 | function markRow($file, $selFile, $mode) |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | ); |
589 | 589 | if ($file == $selFile) { |
590 | 590 | $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default']; |
591 | - return ' class="' . $class . '"'; |
|
591 | + return ' class="'.$class.'"'; |
|
592 | 592 | } |
593 | 593 | return ''; |
594 | 594 | } |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx; |
600 | 600 | $dircounter = 0; |
601 | 601 | $filecounter = 0; |
602 | - $curpath = str_replace('//', '/', $curpath . '/'); |
|
602 | + $curpath = str_replace('//', '/', $curpath.'/'); |
|
603 | 603 | |
604 | 604 | if (!is_dir($curpath)) { |
605 | 605 | echo 'Invalid path "', $curpath, '"<br />'; |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | |
610 | 610 | // first, get info |
611 | 611 | foreach ($dir as $file) { |
612 | - $newpath = $curpath . $file; |
|
612 | + $newpath = $curpath.$file; |
|
613 | 613 | if ($file === '..' || $file === '.') { |
614 | 614 | continue; |
615 | 615 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | if ($file === '..' || $file === '.') { |
620 | 620 | continue; |
621 | 621 | } elseif (!in_array($file, $excludes) && !in_array($newpath, $protected_path)) { |
622 | - $dirs_array[$dircounter]['text'] = '<i class="' . $_style['files_folder'] . ' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path=' . urlencode($newpath) . '"><b>' . $file . '</b></a>'; |
|
622 | + $dirs_array[$dircounter]['text'] = '<i class="'.$_style['files_folder'].' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path='.urlencode($newpath).'"><b>'.$file.'</b></a>'; |
|
623 | 623 | |
624 | 624 | $dfiles = scandir($newpath); |
625 | 625 | foreach ($dfiles as $i => $infile) { |
@@ -632,13 +632,13 @@ discard block |
||
632 | 632 | } |
633 | 633 | $file_exists = (0 < count($dfiles)) ? 'file_exists' : ''; |
634 | 634 | |
635 | - $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\'' . urlencode($file) . '\',\'' . $file_exists . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></a>' : ''; |
|
635 | + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\''.urlencode($file).'\',\''.$file_exists.'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></a>' : ''; |
|
636 | 636 | } else { |
637 | - $dirs_array[$dircounter]['text'] = '<span><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> ' . $file . '</span>'; |
|
638 | - $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></span>' : ''; |
|
637 | + $dirs_array[$dircounter]['text'] = '<span><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> '.$file.'</span>'; |
|
638 | + $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></span>' : ''; |
|
639 | 639 | } |
640 | 640 | |
641 | - $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" title="' . $_lang['rename'] . '"></i></a> ' : ''; |
|
641 | + $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" title="'.$_lang['rename'].'"></i></a> ' : ''; |
|
642 | 642 | |
643 | 643 | // increment the counter |
644 | 644 | $dircounter++; |
@@ -646,14 +646,14 @@ discard block |
||
646 | 646 | $type = getExtension($newpath); |
647 | 647 | $files_array[$filecounter]['file'] = $newpath; |
648 | 648 | $files_array[$filecounter]['stats'] = lstat($newpath); |
649 | - $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']) . ' ' . $file; |
|
650 | - $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\'' . $webstart_path . substr($newpath, $len, strlen($newpath)) . '\');"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : (($enablefiledownload && in_array($type, $uploadablefiles)) ? '<a href="' . $webstart_path . implode('/', array_map('rawurlencode', explode('/', substr($newpath, $len, strlen($newpath))))) . '" style="cursor:pointer;"><i class="' . $_style['files_download'] . '" title="' . $_lang['file_download_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></span>'); |
|
651 | - $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path=' . urlencode($newpath) . '"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : $files_array[$filecounter]['view']; |
|
652 | - $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_unzip'] . '" title="' . $_lang['file_download_unzip'] . '"></i></a>' : ''; |
|
653 | - $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path=' . urlencode($newpath) . '#file_editfile"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></span>'; |
|
654 | - $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_duplicate'] . '" title="' . $_lang['duplicate'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_duplicate'] . '" align="absmiddle" title="' . $_lang['duplicate'] . '"></i></span>'; |
|
655 | - $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></span>'; |
|
656 | - $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></span>'; |
|
649 | + $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']).' '.$file; |
|
650 | + $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\''.$webstart_path.substr($newpath, $len, strlen($newpath)).'\');"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : (($enablefiledownload && in_array($type, $uploadablefiles)) ? '<a href="'.$webstart_path.implode('/', array_map('rawurlencode', explode('/', substr($newpath, $len, strlen($newpath))))).'" style="cursor:pointer;"><i class="'.$_style['files_download'].'" title="'.$_lang['file_download_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></span>'); |
|
651 | + $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path='.urlencode($newpath).'"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : $files_array[$filecounter]['view']; |
|
652 | + $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\''.urlencode($file).'\');"><i class="'.$_style['files_unzip'].'" title="'.$_lang['file_download_unzip'].'"></i></a>' : ''; |
|
653 | + $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path='.urlencode($newpath).'#file_editfile"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></span>'; |
|
654 | + $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\''.urlencode($file).'\');"><i class="'.$_style['files_duplicate'].'" title="'.$_lang['duplicate'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_duplicate'].'" align="absmiddle" title="'.$_lang['duplicate'].'"></i></span>'; |
|
655 | + $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></span>'; |
|
656 | + $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\''.urlencode($file).'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></span>'; |
|
657 | 657 | |
658 | 658 | // increment the counter |
659 | 659 | $filecounter++; |
@@ -666,9 +666,9 @@ discard block |
||
666 | 666 | for ($i = 0; $i < $folders; $i++) { |
667 | 667 | $filesizes += $dirs_array[$i]['stats']['7']; |
668 | 668 | echo '<tr>'; |
669 | - echo '<td>' . $dirs_array[$i]['text'] . '</td>'; |
|
670 | - echo '<td class="text-nowrap">' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . '</td>'; |
|
671 | - echo '<td class="text-right">' . $modx->nicesize($dirs_array[$i]['stats']['7']) . '</td>'; |
|
669 | + echo '<td>'.$dirs_array[$i]['text'].'</td>'; |
|
670 | + echo '<td class="text-nowrap">'.$modx->toDateFormat($dirs_array[$i]['stats']['9']).'</td>'; |
|
671 | + echo '<td class="text-right">'.$modx->nicesize($dirs_array[$i]['stats']['7']).'</td>'; |
|
672 | 672 | echo '<td class="actions text-right">'; |
673 | 673 | echo $dirs_array[$i]['rename']; |
674 | 674 | echo $dirs_array[$i]['delete']; |
@@ -681,10 +681,10 @@ discard block |
||
681 | 681 | sort($files_array); // sorting the array alphabetically (Thanks pxl8r!) |
682 | 682 | for ($i = 0; $i < $files; $i++) { |
683 | 683 | $filesizes += $files_array[$i]['stats']['7']; |
684 | - echo '<tr ' . markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']) . '>'; |
|
685 | - echo '<td>' . $files_array[$i]['text'] . '</td>'; |
|
686 | - echo '<td class="text-nowrap">' . $modx->toDateFormat($files_array[$i]['stats']['9']) . '</td>'; |
|
687 | - echo '<td class="text-right">' . $modx->nicesize($files_array[$i]['stats']['7']) . '</td>'; |
|
684 | + echo '<tr '.markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']).'>'; |
|
685 | + echo '<td>'.$files_array[$i]['text'].'</td>'; |
|
686 | + echo '<td class="text-nowrap">'.$modx->toDateFormat($files_array[$i]['stats']['9']).'</td>'; |
|
687 | + echo '<td class="text-right">'.$modx->nicesize($files_array[$i]['stats']['7']).'</td>'; |
|
688 | 688 | echo '<td class="actions text-right">'; |
689 | 689 | echo $files_array[$i]['unzip']; |
690 | 690 | echo $files_array[$i]['view']; |
@@ -792,17 +792,17 @@ discard block |
||
792 | 792 | $zip = zip_open($file); |
793 | 793 | if ($zip) { |
794 | 794 | $old_umask = umask(0); |
795 | - $path = rtrim($path, '/') . '/'; |
|
795 | + $path = rtrim($path, '/').'/'; |
|
796 | 796 | while ($zip_entry = zip_read($zip)) { |
797 | 797 | if (zip_entry_filesize($zip_entry) > 0) { |
798 | 798 | // str_replace must be used under windows to convert "/" into "\" |
799 | 799 | $zip_entry_name = zip_entry_name($zip_entry); |
800 | - $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name)); |
|
801 | - $complete_name = $path . str_replace('\\', '/', $zip_entry_name); |
|
800 | + $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name)); |
|
801 | + $complete_name = $path.str_replace('\\', '/', $zip_entry_name); |
|
802 | 802 | if (!file_exists($complete_path)) { |
803 | 803 | $tmp = ''; |
804 | 804 | foreach (explode('/', $complete_path) AS $k) { |
805 | - $tmp .= $k . '/'; |
|
805 | + $tmp .= $k.'/'; |
|
806 | 806 | if (!is_dir($tmp)) { |
807 | 807 | mkdir($tmp, 0777); |
808 | 808 | } |
@@ -823,7 +823,7 @@ discard block |
||
823 | 823 | |
824 | 824 | function rrmdir($dir) |
825 | 825 | { |
826 | - foreach (glob($dir . '/*') as $file) { |
|
826 | + foreach (glob($dir.'/*') as $file) { |
|
827 | 827 | if (is_dir($file)) { |
828 | 828 | rrmdir($file); |
829 | 829 | } else { |
@@ -855,12 +855,12 @@ discard block |
||
855 | 855 | $userfile['type'] = $_FILES['userfile']['type'][$i]; |
856 | 856 | |
857 | 857 | // this seems to be an upload action. |
858 | - $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath)); |
|
859 | - $path = rtrim($path, '/') . '/' . $userfile['name']; |
|
858 | + $path = $modx->config['site_url'].substr($startpath, strlen($filemanager_path), strlen($startpath)); |
|
859 | + $path = rtrim($path, '/').'/'.$userfile['name']; |
|
860 | 860 | $msg .= $path; |
861 | 861 | if ($userfile['error'] == 0) { |
862 | - $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="' . $path . '" height="75" />' : ''; |
|
863 | - $msg .= "<p>" . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '</p>'; |
|
862 | + $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="'.$path.'" height="75" />' : ''; |
|
863 | + $msg .= "<p>".$_lang['files_file_type'].$userfile['type'].", ".$modx->nicesize(filesize($userfile['tmp_name'])).$img.'</p>'; |
|
864 | 864 | } |
865 | 865 | |
866 | 866 | $userfilename = $userfile['tmp_name']; |
@@ -868,15 +868,15 @@ discard block |
||
868 | 868 | if (is_uploaded_file($userfilename)) { |
869 | 869 | // file is uploaded file, process it! |
870 | 870 | if (!checkExtension($userfile['name'])) { |
871 | - $msg .= '<p><span class="warning">' . $_lang['files_filetype_notok'] . '</span></p>'; |
|
871 | + $msg .= '<p><span class="warning">'.$_lang['files_filetype_notok'].'</span></p>'; |
|
872 | 872 | } else { |
873 | - if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) { |
|
873 | + if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'].'/'.$userfile['name'])) { |
|
874 | 874 | // Ryan: Repair broken permissions issue with file manager |
875 | 875 | if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { |
876 | - @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions); |
|
876 | + @chmod($_POST['path']."/".$userfile['name'], $new_file_permissions); |
|
877 | 877 | } |
878 | 878 | // Ryan: End |
879 | - $msg .= '<p><span class="success">' . $_lang['files_upload_ok'] . '</span></p><hr/>'; |
|
879 | + $msg .= '<p><span class="success">'.$_lang['files_upload_ok'].'</span></p><hr/>'; |
|
880 | 880 | |
881 | 881 | // invoke OnFileManagerUpload event |
882 | 882 | $modx->invokeEvent('OnFileManagerUpload', array( |
@@ -884,13 +884,13 @@ discard block |
||
884 | 884 | 'filename' => $userfile['name'] |
885 | 885 | )); |
886 | 886 | // Log the change |
887 | - logFileChange('upload', $_POST['path'] . '/' . $userfile['name']); |
|
887 | + logFileChange('upload', $_POST['path'].'/'.$userfile['name']); |
|
888 | 888 | } else { |
889 | - $msg .= '<p><span class="warning">' . $_lang['files_upload_copyfailed'] . '</span> ' . $_lang["files_upload_permissions_error"] . '</p>'; |
|
889 | + $msg .= '<p><span class="warning">'.$_lang['files_upload_copyfailed'].'</span> '.$_lang["files_upload_permissions_error"].'</p>'; |
|
890 | 890 | } |
891 | 891 | } |
892 | 892 | } else { |
893 | - $msg .= '<br /><span class="warning"><b>' . $_lang['files_upload_error'] . ':</b>'; |
|
893 | + $msg .= '<br /><span class="warning"><b>'.$_lang['files_upload_error'].':</b>'; |
|
894 | 894 | switch ($userfile['error']) { |
895 | 895 | case 0: //no error; possible file attack! |
896 | 896 | $msg .= $_lang['files_upload_error0']; |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | } |
916 | 916 | } |
917 | 917 | } |
918 | - return $msg . '<br/>'; |
|
918 | + return $msg.'<br/>'; |
|
919 | 919 | } |
920 | 920 | |
921 | 921 | function textsave() |
@@ -928,9 +928,9 @@ discard block |
||
928 | 928 | |
929 | 929 | // Write $content to our opened file. |
930 | 930 | if (file_put_contents($filename, $content) === false) { |
931 | - $msg .= '<span class="warning"><b>' . $_lang['file_not_saved'] . '</b></span><br /><br />'; |
|
931 | + $msg .= '<span class="warning"><b>'.$_lang['file_not_saved'].'</b></span><br /><br />'; |
|
932 | 932 | } else { |
933 | - $msg .= '<span class="success"><b>' . $_lang['file_saved'] . '</b></span><br /><br />'; |
|
933 | + $msg .= '<span class="success"><b>'.$_lang['file_saved'].'</b></span><br /><br />'; |
|
934 | 934 | $_REQUEST['mode'] = 'edit'; |
935 | 935 | } |
936 | 936 | // Log the change |
@@ -946,9 +946,9 @@ discard block |
||
946 | 946 | |
947 | 947 | $file = $_REQUEST['path']; |
948 | 948 | if (!$token_check || !@unlink($file)) { |
949 | - $msg .= '<span class="warning"><b>' . $_lang['file_not_deleted'] . '</b></span><br /><br />'; |
|
949 | + $msg .= '<span class="warning"><b>'.$_lang['file_not_deleted'].'</b></span><br /><br />'; |
|
950 | 950 | } else { |
951 | - $msg .= '<span class="success"><b>' . $_lang['file_deleted'] . '</b></span><br /><br />'; |
|
951 | + $msg .= '<span class="success"><b>'.$_lang['file_deleted'].'</b></span><br /><br />'; |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | // Log the change |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | switch($modx->manager->action) { |
7 | - case 12: |
|
8 | - if(!$modx->hasPermission('edit_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 11: |
|
13 | - if(!$modx->hasPermission('new_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 12: |
|
8 | + if(!$modx->hasPermission('edit_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 11: |
|
13 | + if(!$modx->hasPermission('new_user')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
@@ -23,75 +23,75 @@ discard block |
||
23 | 23 | // check to see the snippet editor isn't locked |
24 | 24 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | 25 | if($username = $modx->db->getValue($rs)) { |
26 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
26 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | 30 | if($modx->manager->action == '12') { |
31 | - // get user attribute |
|
32 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | - $userdata = $modx->db->getRow($rs); |
|
34 | - if(!$userdata) { |
|
35 | - $modx->webAlertAndQuit("No user returned!"); |
|
36 | - } |
|
37 | - |
|
38 | - |
|
39 | - // get user settings |
|
40 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
41 | - $usersettings = array(); |
|
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | - // manually extract so that user display settings are not overwritten |
|
44 | - foreach($usersettings as $k => $v) { |
|
45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | - ${$k} = $v; |
|
47 | - } |
|
48 | - } |
|
49 | - |
|
50 | - // get user name |
|
51 | - $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
52 | - $usernamedata = $modx->db->getRow($rs); |
|
53 | - if(!$usernamedata) { |
|
54 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
55 | - } |
|
56 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
31 | + // get user attribute |
|
32 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | + $userdata = $modx->db->getRow($rs); |
|
34 | + if(!$userdata) { |
|
35 | + $modx->webAlertAndQuit("No user returned!"); |
|
36 | + } |
|
37 | + |
|
38 | + |
|
39 | + // get user settings |
|
40 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
|
41 | + $usersettings = array(); |
|
42 | + while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | + // manually extract so that user display settings are not overwritten |
|
44 | + foreach($usersettings as $k => $v) { |
|
45 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | + ${$k} = $v; |
|
47 | + } |
|
48 | + } |
|
49 | + |
|
50 | + // get user name |
|
51 | + $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
|
52 | + $usernamedata = $modx->db->getRow($rs); |
|
53 | + if(!$usernamedata) { |
|
54 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
55 | + } |
|
56 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
57 | 57 | } else { |
58 | - $userdata = array(); |
|
59 | - $usersettings = array(); |
|
60 | - $usernamedata = array(); |
|
61 | - $_SESSION['itemname'] = $_lang["new_user"]; |
|
58 | + $userdata = array(); |
|
59 | + $usersettings = array(); |
|
60 | + $usernamedata = array(); |
|
61 | + $_SESSION['itemname'] = $_lang["new_user"]; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
65 | 65 | foreach($userdata as $key => $val) { |
66 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
66 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
67 | 67 | }; |
68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
69 | 69 | |
70 | 70 | // restore saved form |
71 | 71 | $formRestored = false; |
72 | 72 | if($modx->manager->hasFormValues()) { |
73 | - $modx->manager->loadFormValues(); |
|
74 | - // restore post values |
|
75 | - $userdata = array_merge($userdata, $_POST); |
|
76 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
77 | - $usernamedata['username'] = $userdata['newusername']; |
|
78 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
79 | - $usersettings = array_merge($usersettings, $userdata); |
|
80 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
81 | - extract($usersettings, EXTR_OVERWRITE); |
|
73 | + $modx->manager->loadFormValues(); |
|
74 | + // restore post values |
|
75 | + $userdata = array_merge($userdata, $_POST); |
|
76 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
77 | + $usernamedata['username'] = $userdata['newusername']; |
|
78 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
79 | + $usersettings = array_merge($usersettings, $userdata); |
|
80 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
81 | + extract($usersettings, EXTR_OVERWRITE); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // include the country list language file |
85 | 85 | $_country_lang = array(); |
86 | 86 | include_once "lang/country/english_country.inc.php"; |
87 | 87 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
88 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
89 | 89 | } |
90 | 90 | asort($_country_lang); |
91 | 91 | |
92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
93 | 93 | if($which_browser == 'default') { |
94 | - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
94 | + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
95 | 95 | } |
96 | 96 | ?> |
97 | 97 | <script type="text/javascript"> |
@@ -201,14 +201,14 @@ discard block |
||
201 | 201 | <form action="index.php?a=32" method="post" name="userform"> |
202 | 202 | <?php |
203 | 203 | |
204 | - // invoke OnUserFormPrerender event |
|
205 | - $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
206 | - "id" => $user |
|
207 | - )); |
|
208 | - if(is_array($evtOut)) { |
|
209 | - echo implode("", $evtOut); |
|
210 | - } |
|
211 | - ?> |
|
204 | + // invoke OnUserFormPrerender event |
|
205 | + $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
206 | + "id" => $user |
|
207 | + )); |
|
208 | + if(is_array($evtOut)) { |
|
209 | + echo implode("", $evtOut); |
|
210 | + } |
|
211 | + ?> |
|
212 | 212 | <input type="hidden" name="mode" value="<?php echo $modx->manager->action; ?>"> |
213 | 213 | <input type="hidden" name="id" value="<?php echo $user ?>"> |
214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -301,21 +301,21 @@ discard block |
||
301 | 301 | <td> </td> |
302 | 302 | <td><?php |
303 | 303 | |
304 | - $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
305 | - ?> |
|
304 | + $rs = $modx->db->select('name, id', '[+prefix+]user_roles', ($modx->hasPermission('save_role')) ? '' : 'id != 1'); |
|
305 | + ?> |
|
306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
307 | 307 | <?php |
308 | - while($row = $modx->db->getRow($rs)) { |
|
309 | - if($modx->manager->action == '11') { |
|
310 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
311 | - } else { |
|
312 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
313 | - } |
|
314 | - ?> |
|
308 | + while($row = $modx->db->getRow($rs)) { |
|
309 | + if($modx->manager->action == '11') { |
|
310 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
311 | + } else { |
|
312 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
313 | + } |
|
314 | + ?> |
|
315 | 315 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
316 | 316 | <?php |
317 | - } |
|
318 | - ?> |
|
317 | + } |
|
318 | + ?> |
|
319 | 319 | </select></td> |
320 | 320 | </tr> |
321 | 321 | <tr> |
@@ -360,10 +360,10 @@ discard block |
||
360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
362 | 362 | <?php |
363 | - foreach($_country_lang as $key => $country) { |
|
364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
365 | - } |
|
366 | - ?> |
|
363 | + foreach($_country_lang as $key => $country) { |
|
364 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
365 | + } |
|
366 | + ?> |
|
367 | 367 | </select></td> |
368 | 368 | </tr> |
369 | 369 | <tr> |
@@ -439,21 +439,21 @@ discard block |
||
439 | 439 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
440 | 440 | <option value=""></option> |
441 | 441 | <?php |
442 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
443 | - $dir = dir("includes/lang"); |
|
444 | - while($file = $dir->read()) { |
|
445 | - if(strpos($file, ".inc.php") > 0) { |
|
446 | - $endpos = strpos($file, "."); |
|
447 | - $languagename = substr($file, 0, $endpos); |
|
448 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
449 | - ?> |
|
442 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
443 | + $dir = dir("includes/lang"); |
|
444 | + while($file = $dir->read()) { |
|
445 | + if(strpos($file, ".inc.php") > 0) { |
|
446 | + $endpos = strpos($file, "."); |
|
447 | + $languagename = substr($file, 0, $endpos); |
|
448 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
449 | + ?> |
|
450 | 450 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
451 | 451 | <?php |
452 | 452 | |
453 | - } |
|
454 | - } |
|
455 | - $dir->close(); |
|
456 | - ?> |
|
453 | + } |
|
454 | + } |
|
455 | + $dir->close(); |
|
456 | + ?> |
|
457 | 457 | </select></td> |
458 | 458 | </tr> |
459 | 459 | <tr> |
@@ -528,22 +528,22 @@ discard block |
||
528 | 528 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
529 | 529 | <option value=""></option> |
530 | 530 | <?php |
531 | - $dir = dir("media/style/"); |
|
532 | - while($file = $dir->read()) { |
|
533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | - $themename = $file; |
|
535 | - if($themename === 'common') { |
|
536 | - continue; |
|
537 | - } |
|
538 | - $attr = 'value="' . $themename . '" '; |
|
539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | - $attr .= 'selected="selected" '; |
|
541 | - } |
|
542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
543 | - } |
|
544 | - } |
|
545 | - $dir->close(); |
|
546 | - ?> |
|
531 | + $dir = dir("media/style/"); |
|
532 | + while($file = $dir->read()) { |
|
533 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | + $themename = $file; |
|
535 | + if($themename === 'common') { |
|
536 | + continue; |
|
537 | + } |
|
538 | + $attr = 'value="' . $themename . '" '; |
|
539 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | + $attr .= 'selected="selected" '; |
|
541 | + } |
|
542 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
543 | + } |
|
544 | + } |
|
545 | + $dir->close(); |
|
546 | + ?> |
|
547 | 547 | </select> |
548 | 548 | <input type="hidden" name="theme_refresher" value=""></td> |
549 | 549 | </tr> |
@@ -555,15 +555,15 @@ discard block |
||
555 | 555 | <th><?php echo $_lang["which_browser_title"] ?></th> |
556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
557 | 557 | <?php |
558 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | - $dir = str_replace('\\', '/', $dir); |
|
562 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
563 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
564 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
565 | - } |
|
566 | - ?> |
|
558 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
559 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | + $dir = str_replace('\\', '/', $dir); |
|
562 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
563 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
564 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
565 | + } |
|
566 | + ?> |
|
567 | 567 | </select></td> |
568 | 568 | </tr> |
569 | 569 | <tr> |
@@ -640,17 +640,17 @@ discard block |
||
640 | 640 | <option value=""></option> |
641 | 641 | <?php |
642 | 642 | |
643 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
644 | - // invoke OnRichTextEditorRegister event |
|
645 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | - if(is_array($evtOut)) { |
|
648 | - for($i = 0; $i < count($evtOut); $i++) { |
|
649 | - $editor = $evtOut[$i]; |
|
650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
651 | - } |
|
652 | - } |
|
653 | - ?> |
|
643 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
644 | + // invoke OnRichTextEditorRegister event |
|
645 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
646 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | + if(is_array($evtOut)) { |
|
648 | + for($i = 0; $i < count($evtOut); $i++) { |
|
649 | + $editor = $evtOut[$i]; |
|
650 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
651 | + } |
|
652 | + } |
|
653 | + ?> |
|
654 | 654 | </select></td> |
655 | 655 | </tr> |
656 | 656 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -683,12 +683,12 @@ discard block |
||
683 | 683 | </tr> |
684 | 684 | </table> |
685 | 685 | <?php |
686 | - // invoke OnInterfaceSettingsRender event |
|
687 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
688 | - if(is_array($evtOut)) { |
|
689 | - echo implode("", $evtOut); |
|
690 | - } |
|
691 | - ?> |
|
686 | + // invoke OnInterfaceSettingsRender event |
|
687 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
688 | + if(is_array($evtOut)) { |
|
689 | + echo implode("", $evtOut); |
|
690 | + } |
|
691 | + ?> |
|
692 | 692 | </div> |
693 | 693 | |
694 | 694 | <!-- Photo --> |
@@ -737,39 +737,39 @@ discard block |
||
737 | 737 | </div> |
738 | 738 | <?php if($use_udperms == 1) { |
739 | 739 | |
740 | - $groupsarray = array(); |
|
741 | - |
|
742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | - $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
744 | - $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
745 | - } |
|
746 | - // retain selected doc groups between post |
|
747 | - if(is_array($_POST['user_groups'])) { |
|
748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | - } |
|
750 | - ?> |
|
740 | + $groupsarray = array(); |
|
741 | + |
|
742 | + if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | + $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
|
744 | + $groupsarray = $modx->db->getColumn('user_group', $rs); |
|
745 | + } |
|
746 | + // retain selected doc groups between post |
|
747 | + if(is_array($_POST['user_groups'])) { |
|
748 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | + } |
|
750 | + ?> |
|
751 | 751 | <div class="tab-page" id="tabAccess"> |
752 | 752 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
753 | 753 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
755 | 755 | <?php |
756 | - $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
757 | - while($row = $modx->db->getRow($rs)) { |
|
758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
759 | - } |
|
760 | - } |
|
761 | - ?> |
|
756 | + $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
|
757 | + while($row = $modx->db->getRow($rs)) { |
|
758 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
759 | + } |
|
760 | + } |
|
761 | + ?> |
|
762 | 762 | </div> |
763 | 763 | </div> |
764 | 764 | </div> |
765 | 765 | <input type="submit" name="save" style="display:none"> |
766 | 766 | <?php |
767 | - // invoke OnUserFormRender event |
|
768 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
769 | - "id" => $user |
|
770 | - )); |
|
771 | - if(is_array($evtOut)) { |
|
772 | - echo implode("", $evtOut); |
|
773 | - } |
|
774 | - ?> |
|
767 | + // invoke OnUserFormRender event |
|
768 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
769 | + "id" => $user |
|
770 | + )); |
|
771 | + if(is_array($evtOut)) { |
|
772 | + echo implode("", $evtOut); |
|
773 | + } |
|
774 | + ?> |
|
775 | 775 | </form> |
@@ -1,16 +1,16 @@ 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 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch ($modx->manager->action) { |
|
7 | 7 | case 12: |
8 | - if(!$modx->hasPermission('edit_user')) { |
|
8 | + if (!$modx->hasPermission('edit_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 11: |
13 | - if(!$modx->hasPermission('new_user')) { |
|
13 | + if (!$modx->hasPermission('new_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->db->getValue($rs)) { |
|
24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->db->getValue($rs)) { |
|
26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | -if($modx->manager->action == '12') { |
|
30 | +if ($modx->manager->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->db->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | 43 | // manually extract so that user display settings are not overwritten |
44 | - foreach($usersettings as $k => $v) { |
|
45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
44 | + foreach ($usersettings as $k => $v) { |
|
45 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | 46 | ${$k} = $v; |
47 | 47 | } |
48 | 48 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // get user name |
51 | 51 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
52 | 52 | $usernamedata = $modx->db->getRow($rs); |
53 | - if(!$usernamedata) { |
|
53 | + if (!$usernamedata) { |
|
54 | 54 | $modx->webAlertAndQuit("No user returned while getting username!"); |
55 | 55 | } |
56 | 56 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
65 | -foreach($userdata as $key => $val) { |
|
65 | +foreach ($userdata as $key => $val) { |
|
66 | 66 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
67 | 67 | }; |
68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
69 | 69 | |
70 | 70 | // restore saved form |
71 | 71 | $formRestored = false; |
72 | -if($modx->manager->hasFormValues()) { |
|
72 | +if ($modx->manager->hasFormValues()) { |
|
73 | 73 | $modx->manager->loadFormValues(); |
74 | 74 | // restore post values |
75 | 75 | $userdata = array_merge($userdata, $_POST); |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | // include the country list language file |
85 | 85 | $_country_lang = array(); |
86 | 86 | include_once "lang/country/english_country.inc.php"; |
87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
87 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
88 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
89 | 89 | } |
90 | 90 | asort($_country_lang); |
91 | 91 | |
92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
93 | -if($which_browser == 'default') { |
|
93 | +if ($which_browser == 'default') { |
|
94 | 94 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
95 | 95 | } |
96 | 96 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | document.userform.save.click(); |
183 | 183 | }, |
184 | 184 | delete: function() { |
185 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
185 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
186 | 186 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
187 | 187 | <?php } else { ?> |
188 | 188 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
206 | 206 | "id" => $user |
207 | 207 | )); |
208 | - if(is_array($evtOut)) { |
|
208 | + if (is_array($evtOut)) { |
|
209 | 209 | echo implode("", $evtOut); |
210 | 210 | } |
211 | 211 | ?> |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
215 | 215 | |
216 | 216 | <h1> |
217 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
217 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
218 | 218 | </h1> |
219 | 219 | |
220 | 220 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
233 | 233 | <tr> |
234 | 234 | <td colspan="3"><span id="blocked" class="warning"> |
235 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
235 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
236 | 236 | <?php echo $_lang['user_is_blocked']; ?> |
237 | 237 | <?php } ?> |
238 | 238 | </span> |
239 | 239 | <br /></td> |
240 | 240 | </tr> |
241 | - <?php if(!empty($userdata['id'])) { ?> |
|
241 | + <?php if (!empty($userdata['id'])) { ?> |
|
242 | 242 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
243 | 243 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
244 | 244 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
252 | 252 | </tr> |
253 | 253 | <tr> |
254 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
254 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
255 | 255 | <td> </td> |
256 | 256 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> |
257 | 257 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | ?> |
306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
307 | 307 | <?php |
308 | - while($row = $modx->db->getRow($rs)) { |
|
309 | - if($modx->manager->action == '11') { |
|
308 | + while ($row = $modx->db->getRow($rs)) { |
|
309 | + if ($modx->manager->action == '11') { |
|
310 | 310 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
311 | 311 | } else { |
312 | 312 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
362 | 362 | <?php |
363 | - foreach($_country_lang as $key => $country) { |
|
364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
363 | + foreach ($_country_lang as $key => $country) { |
|
364 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
365 | 365 | } |
366 | 366 | ?> |
367 | 367 | </select></td> |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | <td> </td> |
388 | 388 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> |
389 | 389 | </tr> |
390 | - <?php if($modx->manager->action == '12') { ?> |
|
390 | + <?php if ($modx->manager->action == '12') { ?> |
|
391 | 391 | <tr> |
392 | 392 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
393 | 393 | <td> </td> |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | </tr> |
425 | 425 | <?php } ?> |
426 | 426 | </table> |
427 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
427 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
428 | 428 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
429 | 429 | <?php } ?> |
430 | 430 | </div> |
@@ -441,8 +441,8 @@ discard block |
||
441 | 441 | <?php |
442 | 442 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
443 | 443 | $dir = dir("includes/lang"); |
444 | - while($file = $dir->read()) { |
|
445 | - if(strpos($file, ".inc.php") > 0) { |
|
444 | + while ($file = $dir->read()) { |
|
445 | + if (strpos($file, ".inc.php") > 0) { |
|
446 | 446 | $endpos = strpos($file, "."); |
447 | 447 | $languagename = substr($file, 0, $endpos); |
448 | 448 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -529,17 +529,17 @@ discard block |
||
529 | 529 | <option value=""></option> |
530 | 530 | <?php |
531 | 531 | $dir = dir("media/style/"); |
532 | - while($file = $dir->read()) { |
|
533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
532 | + while ($file = $dir->read()) { |
|
533 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | 534 | $themename = $file; |
535 | - if($themename === 'common') { |
|
535 | + if ($themename === 'common') { |
|
536 | 536 | continue; |
537 | 537 | } |
538 | - $attr = 'value="' . $themename . '" '; |
|
539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
538 | + $attr = 'value="'.$themename.'" '; |
|
539 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | 540 | $attr .= 'selected="selected" '; |
541 | 541 | } |
542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
542 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | $dir->close(); |
@@ -556,12 +556,12 @@ discard block |
||
556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
557 | 557 | <?php |
558 | 558 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
559 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
560 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | 561 | $dir = str_replace('\\', '/', $dir); |
562 | 562 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
563 | 563 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
564 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
564 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
565 | 565 | } |
566 | 566 | ?> |
567 | 567 | </select></td> |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | </tr> |
589 | 589 | <tr> |
590 | 590 | <td> </td> |
591 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
591 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
592 | 592 | </tr> |
593 | 593 | <tr> |
594 | 594 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | </tr> |
601 | 601 | <tr> |
602 | 602 | <td> </td> |
603 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
603 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
604 | 604 | </tr> |
605 | 605 | <tr> |
606 | 606 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | </tr> |
613 | 613 | <tr> |
614 | 614 | <td> </td> |
615 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
615 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
616 | 616 | </tr> |
617 | 617 | <tr> |
618 | 618 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | </tr> |
625 | 625 | <tr> |
626 | 626 | <td> </td> |
627 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
627 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
628 | 628 | </tr> |
629 | 629 | <tr class='row2'> |
630 | 630 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -643,11 +643,11 @@ discard block |
||
643 | 643 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
644 | 644 | // invoke OnRichTextEditorRegister event |
645 | 645 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | - if(is_array($evtOut)) { |
|
648 | - for($i = 0; $i < count($evtOut); $i++) { |
|
646 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
647 | + if (is_array($evtOut)) { |
|
648 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
649 | 649 | $editor = $evtOut[$i]; |
650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
650 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
651 | 651 | } |
652 | 652 | } |
653 | 653 | ?> |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | <?php |
686 | 686 | // invoke OnInterfaceSettingsRender event |
687 | 687 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
688 | - if(is_array($evtOut)) { |
|
688 | + if (is_array($evtOut)) { |
|
689 | 689 | echo implode("", $evtOut); |
690 | 690 | } |
691 | 691 | ?> |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | function BrowseServer() { |
713 | 713 | var w = screen.width * 0.7; |
714 | 714 | var h = screen.height * 0.7; |
715 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
715 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | function SetUrl(url, width, height, alt) { |
@@ -735,17 +735,17 @@ discard block |
||
735 | 735 | </tr> |
736 | 736 | </table> |
737 | 737 | </div> |
738 | - <?php if($use_udperms == 1) { |
|
738 | + <?php if ($use_udperms == 1) { |
|
739 | 739 | |
740 | 740 | $groupsarray = array(); |
741 | 741 | |
742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
742 | + if ($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | 743 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
744 | 744 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
745 | 745 | } |
746 | 746 | // retain selected doc groups between post |
747 | - if(is_array($_POST['user_groups'])) { |
|
748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
747 | + if (is_array($_POST['user_groups'])) { |
|
748 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | 749 | } |
750 | 750 | ?> |
751 | 751 | <div class="tab-page" id="tabAccess"> |
@@ -754,8 +754,8 @@ discard block |
||
754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
755 | 755 | <?php |
756 | 756 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
757 | - while($row = $modx->db->getRow($rs)) { |
|
758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
757 | + while ($row = $modx->db->getRow($rs)) { |
|
758 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
759 | 759 | } |
760 | 760 | } |
761 | 761 | ?> |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
769 | 769 | "id" => $user |
770 | 770 | )); |
771 | - if(is_array($evtOut)) { |
|
771 | + if (is_array($evtOut)) { |
|
772 | 772 | echo implode("", $evtOut); |
773 | 773 | } |
774 | 774 | ?> |
@@ -1,16 +1,16 @@ 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 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch($modx->manager->action) { |
|
7 | 7 | case 12: |
8 | - if(!$modx->hasPermission('edit_user')) { |
|
8 | + if(!$modx->hasPermission('edit_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 11: |
13 | - if(!$modx->hasPermission('new_user')) { |
|
13 | + if(!$modx->hasPermission('new_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | 24 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | -if($username = $modx->db->getValue($rs)) { |
|
25 | +if($username = $modx->db->getValue($rs)) { |
|
26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | -if($modx->manager->action == '12') { |
|
30 | +if($modx->manager->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->db->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if(!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
@@ -39,10 +39,12 @@ discard block |
||
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while($row = $modx->db->getRow($rs)) { |
|
43 | + $usersettings[$row['setting_name']] = $row['setting_value']; |
|
44 | + } |
|
43 | 45 | // manually extract so that user display settings are not overwritten |
44 | - foreach($usersettings as $k => $v) { |
|
45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | + foreach($usersettings as $k => $v) { |
|
47 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | 48 | ${$k} = $v; |
47 | 49 | } |
48 | 50 | } |
@@ -50,11 +52,11 @@ discard block |
||
50 | 52 | // get user name |
51 | 53 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
52 | 54 | $usernamedata = $modx->db->getRow($rs); |
53 | - if(!$usernamedata) { |
|
55 | + if(!$usernamedata) { |
|
54 | 56 | $modx->webAlertAndQuit("No user returned while getting username!"); |
55 | 57 | } |
56 | 58 | $_SESSION['itemname'] = $usernamedata['username']; |
57 | -} else { |
|
59 | +} else { |
|
58 | 60 | $userdata = array(); |
59 | 61 | $usersettings = array(); |
60 | 62 | $usernamedata = array(); |
@@ -62,14 +64,14 @@ discard block |
||
62 | 64 | } |
63 | 65 | |
64 | 66 | // avoid doubling htmlspecialchars (already encoded in DB) |
65 | -foreach($userdata as $key => $val) { |
|
67 | +foreach($userdata as $key => $val) { |
|
66 | 68 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
67 | 69 | }; |
68 | 70 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
69 | 71 | |
70 | 72 | // restore saved form |
71 | 73 | $formRestored = false; |
72 | -if($modx->manager->hasFormValues()) { |
|
74 | +if($modx->manager->hasFormValues()) { |
|
73 | 75 | $modx->manager->loadFormValues(); |
74 | 76 | // restore post values |
75 | 77 | $userdata = array_merge($userdata, $_POST); |
@@ -84,13 +86,13 @@ discard block |
||
84 | 86 | // include the country list language file |
85 | 87 | $_country_lang = array(); |
86 | 88 | include_once "lang/country/english_country.inc.php"; |
87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
89 | +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
88 | 90 | include_once "lang/country/" . $manager_language . "_country.inc.php"; |
89 | 91 | } |
90 | 92 | asort($_country_lang); |
91 | 93 | |
92 | 94 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
93 | -if($which_browser == 'default') { |
|
95 | +if($which_browser == 'default') { |
|
94 | 96 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
95 | 97 | } |
96 | 98 | ?> |
@@ -205,7 +207,7 @@ discard block |
||
205 | 207 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
206 | 208 | "id" => $user |
207 | 209 | )); |
208 | - if(is_array($evtOut)) { |
|
210 | + if(is_array($evtOut)) { |
|
209 | 211 | echo implode("", $evtOut); |
210 | 212 | } |
211 | 213 | ?> |
@@ -305,10 +307,10 @@ discard block |
||
305 | 307 | ?> |
306 | 308 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
307 | 309 | <?php |
308 | - while($row = $modx->db->getRow($rs)) { |
|
309 | - if($modx->manager->action == '11') { |
|
310 | + while($row = $modx->db->getRow($rs)) { |
|
311 | + if($modx->manager->action == '11') { |
|
310 | 312 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
311 | - } else { |
|
313 | + } else { |
|
312 | 314 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
313 | 315 | } |
314 | 316 | ?> |
@@ -360,7 +362,7 @@ discard block |
||
360 | 362 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
361 | 363 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
362 | 364 | <?php |
363 | - foreach($_country_lang as $key => $country) { |
|
365 | + foreach($_country_lang as $key => $country) { |
|
364 | 366 | echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
365 | 367 | } |
366 | 368 | ?> |
@@ -441,8 +443,8 @@ discard block |
||
441 | 443 | <?php |
442 | 444 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
443 | 445 | $dir = dir("includes/lang"); |
444 | - while($file = $dir->read()) { |
|
445 | - if(strpos($file, ".inc.php") > 0) { |
|
446 | + while($file = $dir->read()) { |
|
447 | + if(strpos($file, ".inc.php") > 0) { |
|
446 | 448 | $endpos = strpos($file, "."); |
447 | 449 | $languagename = substr($file, 0, $endpos); |
448 | 450 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -529,14 +531,14 @@ discard block |
||
529 | 531 | <option value=""></option> |
530 | 532 | <?php |
531 | 533 | $dir = dir("media/style/"); |
532 | - while($file = $dir->read()) { |
|
533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | + while($file = $dir->read()) { |
|
535 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | 536 | $themename = $file; |
535 | - if($themename === 'common') { |
|
537 | + if($themename === 'common') { |
|
536 | 538 | continue; |
537 | 539 | } |
538 | 540 | $attr = 'value="' . $themename . '" '; |
539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
541 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | 542 | $attr .= 'selected="selected" '; |
541 | 543 | } |
542 | 544 | echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
@@ -557,7 +559,7 @@ discard block |
||
557 | 559 | <?php |
558 | 560 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
559 | 561 | echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
562 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | 563 | $dir = str_replace('\\', '/', $dir); |
562 | 564 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
563 | 565 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
@@ -644,8 +646,8 @@ discard block |
||
644 | 646 | // invoke OnRichTextEditorRegister event |
645 | 647 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
646 | 648 | echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
647 | - if(is_array($evtOut)) { |
|
648 | - for($i = 0; $i < count($evtOut); $i++) { |
|
649 | + if(is_array($evtOut)) { |
|
650 | + for($i = 0; $i < count($evtOut); $i++) { |
|
649 | 651 | $editor = $evtOut[$i]; |
650 | 652 | echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
651 | 653 | } |
@@ -685,7 +687,7 @@ discard block |
||
685 | 687 | <?php |
686 | 688 | // invoke OnInterfaceSettingsRender event |
687 | 689 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
688 | - if(is_array($evtOut)) { |
|
690 | + if(is_array($evtOut)) { |
|
689 | 691 | echo implode("", $evtOut); |
690 | 692 | } |
691 | 693 | ?> |
@@ -735,17 +737,20 @@ discard block |
||
735 | 737 | </tr> |
736 | 738 | </table> |
737 | 739 | </div> |
738 | - <?php if($use_udperms == 1) { |
|
740 | + <?php if($use_udperms == 1) { |
|
739 | 741 | |
740 | 742 | $groupsarray = array(); |
741 | 743 | |
742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
744 | + if($modx->manager->action == '12') { |
|
745 | +// only do this bit if the user is being edited |
|
743 | 746 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
744 | 747 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
745 | 748 | } |
746 | 749 | // retain selected doc groups between post |
747 | - if(is_array($_POST['user_groups'])) { |
|
748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
750 | + if(is_array($_POST['user_groups'])) { |
|
751 | + foreach($_POST['user_groups'] as $n => $v) { |
|
752 | + $groupsarray[] = $v; |
|
753 | + } |
|
749 | 754 | } |
750 | 755 | ?> |
751 | 756 | <div class="tab-page" id="tabAccess"> |
@@ -754,7 +759,7 @@ discard block |
||
754 | 759 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
755 | 760 | <?php |
756 | 761 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
757 | - while($row = $modx->db->getRow($rs)) { |
|
762 | + while($row = $modx->db->getRow($rs)) { |
|
758 | 763 | echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
759 | 764 | } |
760 | 765 | } |
@@ -768,7 +773,7 @@ discard block |
||
768 | 773 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
769 | 774 | "id" => $user |
770 | 775 | )); |
771 | - if(is_array($evtOut)) { |
|
776 | + if(is_array($evtOut)) { |
|
772 | 777 | echo implode("", $evtOut); |
773 | 778 | } |
774 | 779 | ?> |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
23 | 23 | { |
24 | - $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
|
24 | + $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | foreach( $cm->getCategories() as $category ) |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | |
107 | 107 | if( empty( $category ) ) |
108 | 108 | { |
109 | - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
110 | - return; |
|
109 | + $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
110 | + return; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if( $cm->isCategoryExists( $category ) ) |
114 | 114 | { |
115 | - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
116 | - return; |
|
115 | + $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
116 | + return; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | if( $cm->addCategory( $category, $rank ) !== 0 ) |
@@ -2,16 +2,16 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Ajax Requests |
4 | 4 | */ |
5 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
5 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
6 | 6 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
7 | 7 | } |
8 | 8 | |
9 | -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) |
|
9 | +if (isset($_REQUEST[$cm->get('request_key')]['ajax'])) |
|
10 | 10 | { |
11 | 11 | $_data = $_REQUEST[$cm->get('request_key')]; |
12 | 12 | $output = ''; |
13 | 13 | $task = $_data['task']; |
14 | - switch( $task ) |
|
14 | + switch ($task) |
|
15 | 15 | { |
16 | 16 | /** |
17 | 17 | * get categories |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | case 'categorize_load_elements': |
20 | 20 | $elements = $_data['elements']; |
21 | 21 | |
22 | - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
|
22 | + if ($uncategorized_elements = $cm->getAssignedElements(0, $_data['elements'])) |
|
23 | 23 | { |
24 | 24 | $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
25 | 25 | } |
26 | 26 | |
27 | - foreach( $cm->getCategories() as $category ) |
|
27 | + foreach ($cm->getCategories() as $category) |
|
28 | 28 | { |
29 | - $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); |
|
29 | + $category['elements'] = $cm->getAssignedElements($category['id'], $_data['elements']); |
|
30 | 30 | $output .= $cm->renderView('chunks/categorize/category', $category); |
31 | 31 | } |
32 | 32 | break; |
33 | 33 | } |
34 | - exit( $output ); |
|
34 | + exit($output); |
|
35 | 35 | } |
36 | 36 | /** |
37 | 37 | * Categorize elements |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 |
42 | 42 | * |
43 | 43 | */ |
44 | -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) |
|
44 | +if (isset($_POST[$cm->get('request_key')]['categorize']['submit'])) |
|
45 | 45 | { |
46 | 46 | $_data = $_POST[$cm->get('request_key')]['categorize']; |
47 | 47 | $_changes = 0; |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | 'categorize' |
55 | 55 | ); |
56 | 56 | |
57 | - if( !isset( $_data['elements'] ) ) |
|
57 | + if (!isset($_data['elements'])) |
|
58 | 58 | { |
59 | - $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); |
|
59 | + $cm->addMessage($cm->txt('cm_unknown_error'), 'categorize'); |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
63 | - foreach( $_data['elements'] as $element_id => $data ) |
|
63 | + foreach ($_data['elements'] as $element_id => $data) |
|
64 | 64 | { |
65 | - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) |
|
65 | + if ($cm->updateElement($_data['elementsgroup'], $element_id, $data['category_id'])) |
|
66 | 66 | { |
67 | 67 | $cm->addMessage( |
68 | 68 | sprintf( |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - if( $_changes === 0 ) |
|
81 | + if ($_changes === 0) |
|
82 | 82 | { |
83 | - $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); |
|
83 | + $cm->addMessage($cm->txt('cm_no_categorization'), 'categorize'); |
|
84 | 84 | return; |
85 | 85 | } |
86 | 86 | else |
@@ -98,29 +98,29 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * Add a new category |
100 | 100 | */ |
101 | -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) |
|
101 | +if (isset($_POST[$cm->get('request_key')]['add']['submit'])) |
|
102 | 102 | { |
103 | 103 | $_data = $_POST[$cm->get('request_key')]['add']['data']; |
104 | - $category = trim( html_entity_decode($_data['name']) ); |
|
104 | + $category = trim(html_entity_decode($_data['name'])); |
|
105 | 105 | $rank = (int) $_data['rank']; |
106 | 106 | |
107 | - if( empty( $category ) ) |
|
107 | + if (empty($category)) |
|
108 | 108 | { |
109 | - $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
|
109 | + $cm->addMessage($cm->txt('cm_enter_name_for_category'), 'add'); |
|
110 | 110 | return; |
111 | 111 | } |
112 | 112 | |
113 | - if( $cm->isCategoryExists( $category ) ) |
|
113 | + if ($cm->isCategoryExists($category)) |
|
114 | 114 | { |
115 | - $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
|
115 | + $cm->addMessage(sprintf($cm->txt('cm_category_x_exists'), $category), 'add'); |
|
116 | 116 | return; |
117 | 117 | } |
118 | 118 | |
119 | - if( $cm->addCategory( $category, $rank ) !== 0 ) |
|
119 | + if ($cm->addCategory($category, $rank) !== 0) |
|
120 | 120 | { |
121 | 121 | $cm->addMessage( |
122 | 122 | sprintf( |
123 | - $cm->txt( 'cm_category_x_saved_at_position_y' ), |
|
123 | + $cm->txt('cm_category_x_saved_at_position_y'), |
|
124 | 124 | $category, |
125 | 125 | $rank |
126 | 126 | ), |
@@ -129,26 +129,26 @@ discard block |
||
129 | 129 | } |
130 | 130 | else |
131 | 131 | { |
132 | - $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); |
|
132 | + $cm->addMessage($cm->txt('cm_unknown_error'), 'add'); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
137 | 137 | * Sort categories |
138 | 138 | */ |
139 | -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) |
|
139 | +if (isset($_POST[$cm->get('request_key')]['sort']['submit'])) |
|
140 | 140 | { |
141 | 141 | $categories = $_POST[$cm->get('request_key')]['sort']['data']; |
142 | 142 | $_changes = 0; |
143 | 143 | |
144 | - foreach( $categories as $category_id => $_data ) |
|
144 | + foreach ($categories as $category_id => $_data) |
|
145 | 145 | { |
146 | 146 | $data = array( |
147 | - 'category' => urldecode( $_data['category'] ), |
|
147 | + 'category' => urldecode($_data['category']), |
|
148 | 148 | 'rank' => $_data['rank'] |
149 | 149 | ); |
150 | 150 | |
151 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
151 | + if ($cm->updateCategory($category_id, $data)) |
|
152 | 152 | { |
153 | 153 | $cm->addMessage( |
154 | 154 | sprintf( |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | } |
163 | 163 | } |
164 | 164 | |
165 | - if( $_changes === 0 ) |
|
165 | + if ($_changes === 0) |
|
166 | 166 | { |
167 | - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); |
|
167 | + $cm->addMessage($cm->txt('cm_no_changes'), 'sort'); |
|
168 | 168 | } |
169 | 169 | else |
170 | 170 | { |
@@ -181,21 +181,21 @@ discard block |
||
181 | 181 | /** |
182 | 182 | * Edit categories |
183 | 183 | */ |
184 | -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) |
|
184 | +if (isset($_POST[$cm->get('request_key')]['edit']['submit'])) |
|
185 | 185 | { |
186 | 186 | $categories = $_POST[$cm->get('request_key')]['edit']['data']; |
187 | 187 | $_changes = 0; |
188 | 188 | |
189 | - foreach( $categories as $category_id => $_data ) |
|
189 | + foreach ($categories as $category_id => $_data) |
|
190 | 190 | { |
191 | - if( isset( $_data['delete'] ) ) |
|
191 | + if (isset($_data['delete'])) |
|
192 | 192 | { |
193 | - if( $cm->deleteCategory( $category_id ) ) |
|
193 | + if ($cm->deleteCategory($category_id)) |
|
194 | 194 | { |
195 | 195 | $cm->addMessage( |
196 | 196 | sprintf( |
197 | 197 | $cm->txt('cm_category_x_deleted'), |
198 | - urldecode( $_data['origin'] ) |
|
198 | + urldecode($_data['origin']) |
|
199 | 199 | ), |
200 | 200 | 'edit' |
201 | 201 | ); |
@@ -205,16 +205,16 @@ discard block |
||
205 | 205 | } |
206 | 206 | |
207 | 207 | $data = array( |
208 | - 'category' => trim( html_entity_decode( $_data['category'] ) ), |
|
208 | + 'category' => trim(html_entity_decode($_data['category'])), |
|
209 | 209 | 'rank' => $_data['rank'] |
210 | 210 | ); |
211 | 211 | |
212 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
212 | + if ($cm->updateCategory($category_id, $data)) |
|
213 | 213 | { |
214 | 214 | $cm->addMessage( |
215 | 215 | sprintf( |
216 | 216 | $cm->txt('cm_category_x_renamed_to_y'), |
217 | - urldecode( $_data['origin'] ), |
|
217 | + urldecode($_data['origin']), |
|
218 | 218 | $data['category'] |
219 | 219 | ), |
220 | 220 | 'edit' |
@@ -223,26 +223,26 @@ discard block |
||
223 | 223 | } |
224 | 224 | } |
225 | 225 | |
226 | - if( $_changes === 0 ) |
|
226 | + if ($_changes === 0) |
|
227 | 227 | { |
228 | - $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); |
|
228 | + $cm->addMessage($cm->txt('cm_no_changes'), 'edit'); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
233 | 233 | * Delete singel category by $_GET |
234 | 234 | */ |
235 | -if( isset( $_GET[$cm->get('request_key')]['delete'] ) |
|
236 | - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) |
|
235 | +if (isset($_GET[$cm->get('request_key')]['delete']) |
|
236 | + && !empty($_GET[$cm->get('request_key')]['delete'])) |
|
237 | 237 | { |
238 | - $category_id = (int)$_GET[$cm->get('request_key')]['delete']; |
|
238 | + $category_id = (int) $_GET[$cm->get('request_key')]['delete']; |
|
239 | 239 | |
240 | - if( $cm->deleteCategory( $category_id ) ) |
|
240 | + if ($cm->deleteCategory($category_id)) |
|
241 | 241 | { |
242 | 242 | $cm->addMessage( |
243 | 243 | sprintf( |
244 | 244 | $cm->txt('cm_category_x_deleted'), |
245 | - urldecode( $_GET[$cm->get('request_key')]['category'] ) |
|
245 | + urldecode($_GET[$cm->get('request_key')]['category']) |
|
246 | 246 | ), |
247 | 247 | 'edit' |
248 | 248 | ); |
@@ -251,15 +251,15 @@ discard block |
||
251 | 251 | /** |
252 | 252 | * Translate phrases |
253 | 253 | */ |
254 | -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) |
|
254 | +if (isset($_POST[$cm->get('request_key')]['translate']['submit'])) |
|
255 | 255 | { |
256 | 256 | $translations = $_POST[$cm->get('request_key')]['translate']['data']; |
257 | 257 | |
258 | - foreach( $translations as $native_phrase => $translation ) |
|
258 | + foreach ($translations as $native_phrase => $translation) |
|
259 | 259 | { |
260 | - $native_phrase = urldecode( $native_phrase ); |
|
260 | + $native_phrase = urldecode($native_phrase); |
|
261 | 261 | |
262 | - if( empty( $translation ) ) |
|
262 | + if (empty($translation)) |
|
263 | 263 | { |
264 | 264 | $translation = $native_phrase; |
265 | 265 | |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | ); |
273 | 273 | } |
274 | 274 | |
275 | - $cm->c('Translator')->addTranslation( $native_phrase, $translation, 'phrase' ); |
|
275 | + $cm->c('Translator')->addTranslation($native_phrase, $translation, 'phrase'); |
|
276 | 276 | |
277 | 277 | $cm->addMessage( |
278 | 278 | sprintf( |
@@ -6,26 +6,22 @@ discard block |
||
6 | 6 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
7 | 7 | } |
8 | 8 | |
9 | -if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) |
|
10 | -{ |
|
9 | +if( isset( $_REQUEST[$cm->get('request_key')]['ajax'] ) ) { |
|
11 | 10 | $_data = $_REQUEST[$cm->get('request_key')]; |
12 | 11 | $output = ''; |
13 | 12 | $task = $_data['task']; |
14 | - switch( $task ) |
|
15 | - { |
|
13 | + switch( $task ) { |
|
16 | 14 | /** |
17 | 15 | * get categories |
18 | 16 | */ |
19 | 17 | case 'categorize_load_elements': |
20 | 18 | $elements = $_data['elements']; |
21 | 19 | |
22 | - if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) |
|
23 | - { |
|
20 | + if( $uncategorized_elements = $cm->getAssignedElements( 0, $_data['elements'] ) ) { |
|
24 | 21 | $output .= $cm->renderView('chunks/categorize/uncategorized_elements', $uncategorized_elements); |
25 | 22 | } |
26 | 23 | |
27 | - foreach( $cm->getCategories() as $category ) |
|
28 | - { |
|
24 | + foreach( $cm->getCategories() as $category ) { |
|
29 | 25 | $category['elements'] = $cm->getAssignedElements( $category['id'], $_data['elements'] ); |
30 | 26 | $output .= $cm->renderView('chunks/categorize/category', $category); |
31 | 27 | } |
@@ -41,8 +37,7 @@ discard block |
||
41 | 37 | * @see http://modxcms.com/forums/index.php/topic,40430.msg251476.html#msg251476 |
42 | 38 | * |
43 | 39 | */ |
44 | -if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) |
|
45 | -{ |
|
40 | +if( isset( $_POST[$cm->get('request_key')]['categorize']['submit'] ) ) { |
|
46 | 41 | $_data = $_POST[$cm->get('request_key')]['categorize']; |
47 | 42 | $_changes = 0; |
48 | 43 | |
@@ -54,16 +49,13 @@ discard block |
||
54 | 49 | 'categorize' |
55 | 50 | ); |
56 | 51 | |
57 | - if( !isset( $_data['elements'] ) ) |
|
58 | - { |
|
52 | + if( !isset( $_data['elements'] ) ) { |
|
59 | 53 | $cm->addMessage( $cm->txt('cm_unknown_error'), 'categorize' ); |
60 | 54 | return; |
61 | 55 | } |
62 | 56 | |
63 | - foreach( $_data['elements'] as $element_id => $data ) |
|
64 | - { |
|
65 | - if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) |
|
66 | - { |
|
57 | + foreach( $_data['elements'] as $element_id => $data ) { |
|
58 | + if( $cm->updateElement( $_data['elementsgroup'], $element_id, $data['category_id'] ) ) { |
|
67 | 59 | $cm->addMessage( |
68 | 60 | sprintf( |
69 | 61 | $cm->txt('cm_x_assigned_to_category_y'), |
@@ -78,13 +70,10 @@ discard block |
||
78 | 70 | } |
79 | 71 | } |
80 | 72 | |
81 | - if( $_changes === 0 ) |
|
82 | - { |
|
73 | + if( $_changes === 0 ) { |
|
83 | 74 | $cm->addMessage( $cm->txt('cm_no_categorization'), 'categorize' ); |
84 | 75 | return; |
85 | - } |
|
86 | - else |
|
87 | - { |
|
76 | + } else { |
|
88 | 77 | $cm->addMessage( |
89 | 78 | sprintf( |
90 | 79 | $cm->txt('cm_x_changes_made'), |
@@ -98,26 +87,22 @@ discard block |
||
98 | 87 | /** |
99 | 88 | * Add a new category |
100 | 89 | */ |
101 | -if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) |
|
102 | -{ |
|
90 | +if( isset( $_POST[$cm->get('request_key')]['add']['submit'] ) ) { |
|
103 | 91 | $_data = $_POST[$cm->get('request_key')]['add']['data']; |
104 | 92 | $category = trim( html_entity_decode($_data['name']) ); |
105 | 93 | $rank = (int) $_data['rank']; |
106 | 94 | |
107 | - if( empty( $category ) ) |
|
108 | - { |
|
95 | + if( empty( $category ) ) { |
|
109 | 96 | $cm->addMessage( $cm->txt('cm_enter_name_for_category'), 'add' ); |
110 | 97 | return; |
111 | 98 | } |
112 | 99 | |
113 | - if( $cm->isCategoryExists( $category ) ) |
|
114 | - { |
|
100 | + if( $cm->isCategoryExists( $category ) ) { |
|
115 | 101 | $cm->addMessage( sprintf( $cm->txt('cm_category_x_exists'), $category ), 'add' ); |
116 | 102 | return; |
117 | 103 | } |
118 | 104 | |
119 | - if( $cm->addCategory( $category, $rank ) !== 0 ) |
|
120 | - { |
|
105 | + if( $cm->addCategory( $category, $rank ) !== 0 ) { |
|
121 | 106 | $cm->addMessage( |
122 | 107 | sprintf( |
123 | 108 | $cm->txt( 'cm_category_x_saved_at_position_y' ), |
@@ -126,9 +111,7 @@ discard block |
||
126 | 111 | ), |
127 | 112 | 'add' |
128 | 113 | ); |
129 | - } |
|
130 | - else |
|
131 | - { |
|
114 | + } else { |
|
132 | 115 | $cm->addMessage( $cm->txt('cm_unknown_error'), 'add' ); |
133 | 116 | } |
134 | 117 | } |
@@ -136,20 +119,17 @@ discard block |
||
136 | 119 | /** |
137 | 120 | * Sort categories |
138 | 121 | */ |
139 | -if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) |
|
140 | -{ |
|
122 | +if( isset( $_POST[$cm->get('request_key')]['sort']['submit'] ) ) { |
|
141 | 123 | $categories = $_POST[$cm->get('request_key')]['sort']['data']; |
142 | 124 | $_changes = 0; |
143 | 125 | |
144 | - foreach( $categories as $category_id => $_data ) |
|
145 | - { |
|
126 | + foreach( $categories as $category_id => $_data ) { |
|
146 | 127 | $data = array( |
147 | 128 | 'category' => urldecode( $_data['category'] ), |
148 | 129 | 'rank' => $_data['rank'] |
149 | 130 | ); |
150 | 131 | |
151 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
152 | - { |
|
132 | + if( $cm->updateCategory( $category_id, $data ) ) { |
|
153 | 133 | $cm->addMessage( |
154 | 134 | sprintf( |
155 | 135 | $cm->txt('cm_category_x_moved_to_position_y'), |
@@ -162,12 +142,9 @@ discard block |
||
162 | 142 | } |
163 | 143 | } |
164 | 144 | |
165 | - if( $_changes === 0 ) |
|
166 | - { |
|
145 | + if( $_changes === 0 ) { |
|
167 | 146 | $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'sort'); |
168 | - } |
|
169 | - else |
|
170 | - { |
|
147 | + } else { |
|
171 | 148 | $cm->addMessage( |
172 | 149 | sprintf( |
173 | 150 | $cm->txt('cm_x_changes_made'), |
@@ -181,17 +158,13 @@ discard block |
||
181 | 158 | /** |
182 | 159 | * Edit categories |
183 | 160 | */ |
184 | -if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) |
|
185 | -{ |
|
161 | +if( isset( $_POST[$cm->get('request_key')]['edit']['submit'] ) ) { |
|
186 | 162 | $categories = $_POST[$cm->get('request_key')]['edit']['data']; |
187 | 163 | $_changes = 0; |
188 | 164 | |
189 | - foreach( $categories as $category_id => $_data ) |
|
190 | - { |
|
191 | - if( isset( $_data['delete'] ) ) |
|
192 | - { |
|
193 | - if( $cm->deleteCategory( $category_id ) ) |
|
194 | - { |
|
165 | + foreach( $categories as $category_id => $_data ) { |
|
166 | + if( isset( $_data['delete'] ) ) { |
|
167 | + if( $cm->deleteCategory( $category_id ) ) { |
|
195 | 168 | $cm->addMessage( |
196 | 169 | sprintf( |
197 | 170 | $cm->txt('cm_category_x_deleted'), |
@@ -209,8 +182,7 @@ discard block |
||
209 | 182 | 'rank' => $_data['rank'] |
210 | 183 | ); |
211 | 184 | |
212 | - if( $cm->updateCategory( $category_id, $data ) ) |
|
213 | - { |
|
185 | + if( $cm->updateCategory( $category_id, $data ) ) { |
|
214 | 186 | $cm->addMessage( |
215 | 187 | sprintf( |
216 | 188 | $cm->txt('cm_category_x_renamed_to_y'), |
@@ -223,8 +195,7 @@ discard block |
||
223 | 195 | } |
224 | 196 | } |
225 | 197 | |
226 | - if( $_changes === 0 ) |
|
227 | - { |
|
198 | + if( $_changes === 0 ) { |
|
228 | 199 | $cm->addMessage( $cm->txt( 'cm_no_changes' ), 'edit'); |
229 | 200 | } |
230 | 201 | } |
@@ -233,12 +204,10 @@ discard block |
||
233 | 204 | * Delete singel category by $_GET |
234 | 205 | */ |
235 | 206 | if( isset( $_GET[$cm->get('request_key')]['delete'] ) |
236 | - && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) |
|
237 | -{ |
|
207 | + && !empty( $_GET[$cm->get('request_key')]['delete'] ) ) { |
|
238 | 208 | $category_id = (int)$_GET[$cm->get('request_key')]['delete']; |
239 | 209 | |
240 | - if( $cm->deleteCategory( $category_id ) ) |
|
241 | - { |
|
210 | + if( $cm->deleteCategory( $category_id ) ) { |
|
242 | 211 | $cm->addMessage( |
243 | 212 | sprintf( |
244 | 213 | $cm->txt('cm_category_x_deleted'), |
@@ -251,16 +220,13 @@ discard block |
||
251 | 220 | /** |
252 | 221 | * Translate phrases |
253 | 222 | */ |
254 | -if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) |
|
255 | -{ |
|
223 | +if( isset( $_POST[$cm->get('request_key')]['translate']['submit'] ) ) { |
|
256 | 224 | $translations = $_POST[$cm->get('request_key')]['translate']['data']; |
257 | 225 | |
258 | - foreach( $translations as $native_phrase => $translation ) |
|
259 | - { |
|
226 | + foreach( $translations as $native_phrase => $translation ) { |
|
260 | 227 | $native_phrase = urldecode( $native_phrase ); |
261 | 228 | |
262 | - if( empty( $translation ) ) |
|
263 | - { |
|
229 | + if( empty( $translation ) ) { |
|
264 | 230 | $translation = $native_phrase; |
265 | 231 | |
266 | 232 | $cm->addMessage( |
@@ -2,13 +2,13 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Class for MODx Categories Manager |
4 | 4 | */ |
5 | -if( !is_object( $modx ) |
|
6 | - || $modx->isBackend() === false ) |
|
5 | +if (!is_object($modx) |
|
6 | + || $modx->isBackend() === false) |
|
7 | 7 | { |
8 | 8 | die('Please use the MODx Backend.'); |
9 | 9 | } |
10 | 10 | |
11 | -require_once realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'Categories.php'; |
|
11 | +require_once realpath(dirname(__FILE__)).DIRECTORY_SEPARATOR.'Categories.php'; |
|
12 | 12 | |
13 | 13 | class Module_Categories_Manager extends Categories |
14 | 14 | { |
@@ -37,19 +37,19 @@ discard block |
||
37 | 37 | * @return mixed return the parameter value if exists, otherwise false |
38 | 38 | * @param string $key Paramter-key |
39 | 39 | */ |
40 | - public function get( $key ) |
|
40 | + public function get($key) |
|
41 | 41 | { |
42 | 42 | global $modx; |
43 | 43 | |
44 | - if( isset( $this->params[$key] ) ) |
|
44 | + if (isset($this->params[$key])) |
|
45 | 45 | { |
46 | 46 | return $this->params[$key]; |
47 | 47 | } |
48 | - elseif( isset( $modx->config[$key] ) ) |
|
48 | + elseif (isset($modx->config[$key])) |
|
49 | 49 | { |
50 | 50 | return $modx->config[$key]; |
51 | 51 | } |
52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
52 | + elseif (isset($modx->event->params[$key])) |
|
53 | 53 | { |
54 | 54 | return $modx->event->params[$key]; |
55 | 55 | } |
@@ -57,15 +57,15 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | |
60 | - public function addMessage( $message, $namespace = 'default' ) |
|
60 | + public function addMessage($message, $namespace = 'default') |
|
61 | 61 | { |
62 | 62 | $this->params['messages'][$namespace][] = $message; |
63 | 63 | } |
64 | 64 | |
65 | 65 | |
66 | - public function getMessages( $namespace = 'default' ) |
|
66 | + public function getMessages($namespace = 'default') |
|
67 | 67 | { |
68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
68 | + if (isset($this->params['messages'][$namespace])) |
|
69 | 69 | { |
70 | 70 | return $this->params['messages'][$namespace]; |
71 | 71 | } |
@@ -73,16 +73,16 @@ discard block |
||
73 | 73 | } |
74 | 74 | |
75 | 75 | |
76 | - public function renderView( $view_name, $data = array() ) |
|
76 | + public function renderView($view_name, $data = array()) |
|
77 | 77 | { |
78 | 78 | global $_lang, $_style; |
79 | 79 | |
80 | - $filename = trim( $view_name ) . '.tpl.phtml'; |
|
81 | - $file = self::get('views_dir') . $filename; |
|
80 | + $filename = trim($view_name).'.tpl.phtml'; |
|
81 | + $file = self::get('views_dir').$filename; |
|
82 | 82 | $view = & $this; |
83 | 83 | |
84 | - if( is_file( $file ) |
|
85 | - && is_readable( $file ) ) |
|
84 | + if (is_file($file) |
|
85 | + && is_readable($file)) |
|
86 | 86 | { |
87 | 87 | include $file; |
88 | 88 | } |
@@ -96,28 +96,28 @@ discard block |
||
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | - public function updateElement( $element, $element_id, $category_id ) |
|
99 | + public function updateElement($element, $element_id, $category_id) |
|
100 | 100 | { |
101 | 101 | |
102 | 102 | $_update = array( |
103 | - 'id' => (int)$element_id, |
|
104 | - 'category' => (int)$category_id |
|
103 | + 'id' => (int) $element_id, |
|
104 | + 'category' => (int) $category_id |
|
105 | 105 | ); |
106 | 106 | |
107 | 107 | $this->db->update( |
108 | 108 | $_update, |
109 | 109 | $this->db_tbl[$element], |
110 | - "`id` = '" . (int)$element_id . "'" |
|
110 | + "`id` = '".(int) $element_id."'" |
|
111 | 111 | ); |
112 | 112 | |
113 | 113 | return $this->db->getAffectedRows() === 1; |
114 | 114 | } |
115 | 115 | |
116 | 116 | |
117 | - public function txt( $txt ) |
|
117 | + public function txt($txt) |
|
118 | 118 | { |
119 | 119 | global $_lang; |
120 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
120 | + if (isset($_lang[$txt])) return $_lang[$txt]; |
|
121 | 121 | return $txt; |
122 | 122 | } |
123 | 123 | } |
@@ -3,8 +3,7 @@ discard block |
||
3 | 3 | * Class for MODx Categories Manager |
4 | 4 | */ |
5 | 5 | if( !is_object( $modx ) |
6 | - || $modx->isBackend() === false ) |
|
7 | -{ |
|
6 | + || $modx->isBackend() === false ) { |
|
8 | 7 | die('Please use the MODx Backend.'); |
9 | 8 | } |
10 | 9 | |
@@ -41,16 +40,11 @@ discard block |
||
41 | 40 | { |
42 | 41 | global $modx; |
43 | 42 | |
44 | - if( isset( $this->params[$key] ) ) |
|
45 | - { |
|
43 | + if( isset( $this->params[$key] ) ) { |
|
46 | 44 | return $this->params[$key]; |
47 | - } |
|
48 | - elseif( isset( $modx->config[$key] ) ) |
|
49 | - { |
|
45 | + } elseif( isset( $modx->config[$key] ) ) { |
|
50 | 46 | return $modx->config[$key]; |
51 | - } |
|
52 | - elseif( isset( $modx->event->params[$key] ) ) |
|
53 | - { |
|
47 | + } elseif( isset( $modx->event->params[$key] ) ) { |
|
54 | 48 | return $modx->event->params[$key]; |
55 | 49 | } |
56 | 50 | return false; |
@@ -65,8 +59,7 @@ discard block |
||
65 | 59 | |
66 | 60 | public function getMessages( $namespace = 'default' ) |
67 | 61 | { |
68 | - if( isset( $this->params['messages'][$namespace] ) ) |
|
69 | - { |
|
62 | + if( isset( $this->params['messages'][$namespace] ) ) { |
|
70 | 63 | return $this->params['messages'][$namespace]; |
71 | 64 | } |
72 | 65 | return false; |
@@ -82,12 +75,9 @@ discard block |
||
82 | 75 | $view = & $this; |
83 | 76 | |
84 | 77 | if( is_file( $file ) |
85 | - && is_readable( $file ) ) |
|
86 | - { |
|
78 | + && is_readable( $file ) ) { |
|
87 | 79 | include $file; |
88 | - } |
|
89 | - else |
|
90 | - { |
|
80 | + } else { |
|
91 | 81 | echo sprintf( |
92 | 82 | 'View "%s<strong>%s</strong>" not found.', |
93 | 83 | self::get('views_dir'), |
@@ -117,7 +107,9 @@ discard block |
||
117 | 107 | public function txt( $txt ) |
118 | 108 | { |
119 | 109 | global $_lang; |
120 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
110 | + if(isset($_lang[$txt])) { |
|
111 | + return $_lang[$txt]; |
|
112 | + } |
|
121 | 113 | return $txt; |
122 | 114 | } |
123 | 115 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | public $db = ''; |
8 | 8 | public $db_tbl = array(); |
9 | - public $elements = array( 'templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules' ); |
|
9 | + public $elements = array('templates', 'tmplvars', 'htmlsnippets', 'snippets', 'plugins', 'modules'); |
|
10 | 10 | |
11 | 11 | public function __construct() |
12 | 12 | { |
@@ -15,9 +15,9 @@ discard block |
||
15 | 15 | $this->db = & $modx->db; |
16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
17 | 17 | |
18 | - foreach( $this->elements as $element ) |
|
18 | + foreach ($this->elements as $element) |
|
19 | 19 | { |
20 | - $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
|
20 | + $this->db_tbl[$element] = $modx->getFullTableName('site_'.$element); |
|
21 | 21 | } |
22 | 22 | } |
23 | 23 | |
@@ -37,54 +37,54 @@ discard block |
||
37 | 37 | ) |
38 | 38 | ); |
39 | 39 | |
40 | - if( !empty( $categories ) ) |
|
40 | + if (!empty($categories)) |
|
41 | 41 | { |
42 | 42 | return $categories; |
43 | 43 | } |
44 | 44 | return false; |
45 | 45 | } |
46 | 46 | |
47 | - public function getCategory( $search, $where = 'category' ) |
|
47 | + public function getCategory($search, $where = 'category') |
|
48 | 48 | { |
49 | 49 | $category = $this->db->getRow( |
50 | 50 | $this->db->select( |
51 | 51 | '*', |
52 | 52 | $this->db_tbl['categories'], |
53 | - "`" . $where . "` = '" . $search . "'" |
|
53 | + "`".$where."` = '".$search."'" |
|
54 | 54 | ) |
55 | 55 | ); |
56 | 56 | return $category; |
57 | 57 | } |
58 | 58 | |
59 | - public function getCategoryValue( $value, $search, $where = 'category' ) |
|
59 | + public function getCategoryValue($value, $search, $where = 'category') |
|
60 | 60 | { |
61 | 61 | $_value = $this->db->getValue( |
62 | 62 | $this->db->select( |
63 | - '`' . $value . '`', |
|
63 | + '`'.$value.'`', |
|
64 | 64 | $this->db_tbl['categories'], |
65 | - "`" . $where . "` = '" . $search . "'" |
|
65 | + "`".$where."` = '".$search."'" |
|
66 | 66 | ) |
67 | 67 | ); |
68 | 68 | return $_value; |
69 | 69 | } |
70 | 70 | |
71 | - public function getAssignedElements( $category_id, $element ) |
|
71 | + public function getAssignedElements($category_id, $element) |
|
72 | 72 | { |
73 | - if( in_array( $element, $this->elements, true ) ) |
|
73 | + if (in_array($element, $this->elements, true)) |
|
74 | 74 | { |
75 | 75 | $elements = $this->db->makeArray( |
76 | 76 | $this->db->select( |
77 | 77 | '*', |
78 | 78 | $this->db_tbl[$element], |
79 | - "`category` = '" . $category_id . "'" |
|
79 | + "`category` = '".$category_id."'" |
|
80 | 80 | ) |
81 | 81 | ); |
82 | 82 | |
83 | 83 | // correct the name of templates |
84 | - if( $element === 'templates' ) |
|
84 | + if ($element === 'templates') |
|
85 | 85 | { |
86 | 86 | $_elements_count = count($elements); |
87 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
87 | + for ($i = 0; $i < $_elements_count; $i++) |
|
88 | 88 | { |
89 | 89 | $elements[$i]['name'] = $elements[$i]['templatename']; |
90 | 90 | } |
@@ -94,56 +94,56 @@ discard block |
||
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | |
97 | - public function getAllAssignedElements( $category_id ) |
|
97 | + public function getAllAssignedElements($category_id) |
|
98 | 98 | { |
99 | 99 | $elements = array(); |
100 | - foreach( $this->elements as $element ) |
|
100 | + foreach ($this->elements as $element) |
|
101 | 101 | { |
102 | - $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
|
102 | + $elements[$element] = $this->getAssignedElements($category_id, $element); |
|
103 | 103 | } |
104 | 104 | return $elements; |
105 | 105 | } |
106 | 106 | |
107 | - public function deleteCategory( $category_id ) |
|
107 | + public function deleteCategory($category_id) |
|
108 | 108 | { |
109 | 109 | $_update = array('category' => 0); |
110 | - foreach( $this->elements as $element ) |
|
110 | + foreach ($this->elements as $element) |
|
111 | 111 | { |
112 | 112 | $this->db->update( |
113 | 113 | $_update, |
114 | 114 | $this->db_tbl[$element], |
115 | - "`category` = '" . $category_id . "'" |
|
115 | + "`category` = '".$category_id."'" |
|
116 | 116 | ); |
117 | 117 | } |
118 | 118 | |
119 | 119 | $this->db->delete( |
120 | 120 | $this->db_tbl['categories'], |
121 | - "`id` = '" . $category_id . "'" |
|
121 | + "`id` = '".$category_id."'" |
|
122 | 122 | ); |
123 | 123 | |
124 | 124 | return $this->db->getAffectedRows() === 1; |
125 | 125 | } |
126 | 126 | |
127 | - public function updateCategory( $category_id, $data = array() ) |
|
127 | + public function updateCategory($category_id, $data = array()) |
|
128 | 128 | { |
129 | - if( empty( $data ) |
|
130 | - || empty( $category_id ) ) |
|
129 | + if (empty($data) |
|
130 | + || empty($category_id)) |
|
131 | 131 | { |
132 | 132 | return false; |
133 | 133 | } |
134 | 134 | |
135 | 135 | $_update = array( |
136 | - 'category' => $this->db->escape( $data['category'] ), |
|
137 | - 'rank' => (int)$data['rank'] |
|
136 | + 'category' => $this->db->escape($data['category']), |
|
137 | + 'rank' => (int) $data['rank'] |
|
138 | 138 | ); |
139 | 139 | |
140 | 140 | $this->db->update( |
141 | 141 | $_update, |
142 | 142 | $this->db_tbl['categories'], |
143 | - "`id` = '" . (int)$category_id . "'" |
|
143 | + "`id` = '".(int) $category_id."'" |
|
144 | 144 | ); |
145 | 145 | |
146 | - if( $this->db->getAffectedRows() === 1 ) |
|
146 | + if ($this->db->getAffectedRows() === 1) |
|
147 | 147 | { |
148 | 148 | return true; |
149 | 149 | } |
@@ -151,16 +151,16 @@ discard block |
||
151 | 151 | return false; |
152 | 152 | } |
153 | 153 | |
154 | - public function addCategory( $category_name, $category_rank ) |
|
154 | + public function addCategory($category_name, $category_rank) |
|
155 | 155 | { |
156 | - if( $this->isCategoryExists( $category_name ) ) |
|
156 | + if ($this->isCategoryExists($category_name)) |
|
157 | 157 | { |
158 | 158 | return false; |
159 | 159 | } |
160 | 160 | |
161 | 161 | $_insert = array( |
162 | - 'category' => $this->db->escape( $category_name ), |
|
163 | - 'rank' => (int)$category_rank |
|
162 | + 'category' => $this->db->escape($category_name), |
|
163 | + 'rank' => (int) $category_rank |
|
164 | 164 | ); |
165 | 165 | |
166 | 166 | $this->db->insert( |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | $this->db_tbl['categories'] |
169 | 169 | ); |
170 | 170 | |
171 | - if( $this->db->getAffectedRows() === 1 ) |
|
171 | + if ($this->db->getAffectedRows() === 1) |
|
172 | 172 | { |
173 | 173 | return $this->db->getInsertId(); |
174 | 174 | } |
@@ -176,19 +176,19 @@ discard block |
||
176 | 176 | return false; |
177 | 177 | } |
178 | 178 | |
179 | - public function isCategoryExists( $category_name ) |
|
179 | + public function isCategoryExists($category_name) |
|
180 | 180 | { |
181 | - $category = $this->db->escape( $category_name ); |
|
181 | + $category = $this->db->escape($category_name); |
|
182 | 182 | |
183 | 183 | $category_id = $this->db->getValue( |
184 | 184 | $this->db->select( |
185 | 185 | '`id`', |
186 | 186 | $this->db_tbl['categories'], |
187 | - "`category` = '" . $category . "'" |
|
187 | + "`category` = '".$category."'" |
|
188 | 188 | ) |
189 | 189 | ); |
190 | 190 | |
191 | - if( $this->db->getAffectedRows() === 1 ) |
|
191 | + if ($this->db->getAffectedRows() === 1) |
|
192 | 192 | { |
193 | 193 | return $category_id; |
194 | 194 | } |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | $this->db = & $modx->db; |
16 | 16 | $this->db_tbl['categories'] = $modx->getFullTableName('categories'); |
17 | 17 | |
18 | - foreach( $this->elements as $element ) |
|
19 | - { |
|
18 | + foreach( $this->elements as $element ) { |
|
20 | 19 | $this->db_tbl[$element] = $modx->getFullTableName('site_' . $element ); |
21 | 20 | } |
22 | 21 | } |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | ) |
38 | 37 | ); |
39 | 38 | |
40 | - if( !empty( $categories ) ) |
|
41 | - { |
|
39 | + if( !empty( $categories ) ) { |
|
42 | 40 | return $categories; |
43 | 41 | } |
44 | 42 | return false; |
@@ -70,8 +68,7 @@ discard block |
||
70 | 68 | |
71 | 69 | public function getAssignedElements( $category_id, $element ) |
72 | 70 | { |
73 | - if( in_array( $element, $this->elements, true ) ) |
|
74 | - { |
|
71 | + if( in_array( $element, $this->elements, true ) ) { |
|
75 | 72 | $elements = $this->db->makeArray( |
76 | 73 | $this->db->select( |
77 | 74 | '*', |
@@ -81,11 +78,9 @@ discard block |
||
81 | 78 | ); |
82 | 79 | |
83 | 80 | // correct the name of templates |
84 | - if( $element === 'templates' ) |
|
85 | - { |
|
81 | + if( $element === 'templates' ) { |
|
86 | 82 | $_elements_count = count($elements); |
87 | - for( $i=0; $i < $_elements_count; $i++ ) |
|
88 | - { |
|
83 | + for( $i=0; $i < $_elements_count; $i++ ) { |
|
89 | 84 | $elements[$i]['name'] = $elements[$i]['templatename']; |
90 | 85 | } |
91 | 86 | } |
@@ -97,8 +92,7 @@ discard block |
||
97 | 92 | public function getAllAssignedElements( $category_id ) |
98 | 93 | { |
99 | 94 | $elements = array(); |
100 | - foreach( $this->elements as $element ) |
|
101 | - { |
|
95 | + foreach( $this->elements as $element ) { |
|
102 | 96 | $elements[$element] = $this->getAssignedElements( $category_id, $element ); |
103 | 97 | } |
104 | 98 | return $elements; |
@@ -107,8 +101,7 @@ discard block |
||
107 | 101 | public function deleteCategory( $category_id ) |
108 | 102 | { |
109 | 103 | $_update = array('category' => 0); |
110 | - foreach( $this->elements as $element ) |
|
111 | - { |
|
104 | + foreach( $this->elements as $element ) { |
|
112 | 105 | $this->db->update( |
113 | 106 | $_update, |
114 | 107 | $this->db_tbl[$element], |
@@ -127,8 +120,7 @@ discard block |
||
127 | 120 | public function updateCategory( $category_id, $data = array() ) |
128 | 121 | { |
129 | 122 | if( empty( $data ) |
130 | - || empty( $category_id ) ) |
|
131 | - { |
|
123 | + || empty( $category_id ) ) { |
|
132 | 124 | return false; |
133 | 125 | } |
134 | 126 | |
@@ -143,8 +135,7 @@ discard block |
||
143 | 135 | "`id` = '" . (int)$category_id . "'" |
144 | 136 | ); |
145 | 137 | |
146 | - if( $this->db->getAffectedRows() === 1 ) |
|
147 | - { |
|
138 | + if( $this->db->getAffectedRows() === 1 ) { |
|
148 | 139 | return true; |
149 | 140 | } |
150 | 141 | |
@@ -153,8 +144,7 @@ discard block |
||
153 | 144 | |
154 | 145 | public function addCategory( $category_name, $category_rank ) |
155 | 146 | { |
156 | - if( $this->isCategoryExists( $category_name ) ) |
|
157 | - { |
|
147 | + if( $this->isCategoryExists( $category_name ) ) { |
|
158 | 148 | return false; |
159 | 149 | } |
160 | 150 | |
@@ -168,8 +158,7 @@ discard block |
||
168 | 158 | $this->db_tbl['categories'] |
169 | 159 | ); |
170 | 160 | |
171 | - if( $this->db->getAffectedRows() === 1 ) |
|
172 | - { |
|
161 | + if( $this->db->getAffectedRows() === 1 ) { |
|
173 | 162 | return $this->db->getInsertId(); |
174 | 163 | } |
175 | 164 | |
@@ -188,8 +177,7 @@ discard block |
||
188 | 177 | ) |
189 | 178 | ); |
190 | 179 | |
191 | - if( $this->db->getAffectedRows() === 1 ) |
|
192 | - { |
|
180 | + if( $this->db->getAffectedRows() === 1 ) { |
|
193 | 181 | return $category_id; |
194 | 182 | } |
195 | 183 | return false; |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | if(!$modx->hasPermission('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // get id |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | <div class="tab-page"> |
42 | 42 | <div class="container container-body"> |
43 | 43 | <?php |
44 | - $date = $modx->toDateFormat($content["createdon"]); |
|
45 | - if($content["type"] == 1) { |
|
46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
47 | - $msgtype = $_lang["information"]; |
|
48 | - } else if($content["type"] == 2) { |
|
49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | - $msgtype = $_lang["warning"]; |
|
51 | - } else if($content["type"] == 3) { |
|
52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | - $msgtype = $_lang["error"]; |
|
54 | - } |
|
55 | - ?> |
|
44 | + $date = $modx->toDateFormat($content["createdon"]); |
|
45 | + if($content["type"] == 1) { |
|
46 | + $icon = $_style['actions_info'] . ' text-info'; |
|
47 | + $msgtype = $_lang["information"]; |
|
48 | + } else if($content["type"] == 2) { |
|
49 | + $icon = $_style['actions_triangle'] . ' text-warning'; |
|
50 | + $msgtype = $_lang["warning"]; |
|
51 | + } else if($content["type"] == 3) { |
|
52 | + $icon = $_style['actions_error'] . ' text-danger'; |
|
53 | + $msgtype = $_lang["error"]; |
|
54 | + } |
|
55 | + ?> |
|
56 | 56 | <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
57 | 57 | <p> |
58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
@@ -1,17 +1,17 @@ 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('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> |
@@ -5,140 +5,140 @@ |
||
5 | 5 | |
6 | 6 | // action list |
7 | 7 | $GLOBALS['action_list'] = array( |
8 | - '1' => 'Loading a frame(set)', |
|
9 | - '2' => 'Viewing home page/ online users', |
|
10 | - '3' => 'Viewing data for resource', |
|
11 | - '4' => 'Creating a resource', |
|
12 | - '5' => 'Saving resource', |
|
13 | - '6' => 'Deleting resource', |
|
14 | - '7' => 'Waiting while MODX cleans up', |
|
15 | - '8' => 'Logged out', |
|
16 | - '9' => 'Viewing help', |
|
17 | - '10' => 'Viewing/ composing messages', |
|
18 | - '11' => 'Creating a user', |
|
19 | - '12' => 'Editing user', |
|
20 | - '13' => 'Viewing logging', |
|
21 | - '14' => 'Editing a parser', |
|
22 | - '15' => 'Saving a parser', |
|
23 | - '16' => 'Editing template', |
|
24 | - '17' => 'Editing settings', |
|
25 | - '18' => 'Viewing Credits :)', |
|
26 | - '19' => 'Creating a new template', |
|
27 | - '20' => 'Saving template', |
|
28 | - '21' => 'Deleting template', |
|
29 | - '22' => 'Editing Snippet', |
|
30 | - '23' => 'Creating a new Snippet', |
|
31 | - '24' => 'Saving Snippet', |
|
32 | - '25' => 'Deleting Snippet', |
|
33 | - '26' => 'Refreshing site', |
|
34 | - '27' => 'Editing resource', |
|
35 | - '28' => 'Changing password', |
|
36 | - '29' => 'Error', |
|
37 | - '30' => 'Saving settings', |
|
38 | - '31' => 'Using file manager', |
|
39 | - '32' => 'Saving user', |
|
40 | - '33' => 'Deleting user', |
|
41 | - '34' => 'Saving new password', |
|
42 | - '35' => 'Editing role', |
|
43 | - '36' => 'Saving role', |
|
44 | - '37' => 'Deleting role', |
|
45 | - '38' => 'Creating new role', |
|
46 | - '40' => 'Editing Access Permissions', |
|
47 | - '41' => 'Editing Access Permissions', |
|
48 | - '42' => 'Editing Access Permissions', |
|
49 | - '43' => 'Editing Access Permissions', |
|
50 | - '44' => 'Editing Access Permissions', |
|
51 | - '45' => 'Idle', |
|
52 | - '46' => 'Editing Access Permissions', |
|
53 | - '47' => 'Editing Access Permissions', |
|
54 | - '48' => 'Editing Access Permissions', |
|
55 | - '49' => 'Editing Access Permissions', |
|
56 | - '50' => 'Editing Access Permissions', |
|
57 | - '51' => 'Moving resource', |
|
58 | - '52' => 'Moved resource', |
|
59 | - '53' => 'Viewing system info', |
|
60 | - '54' => 'Optimizing a table', |
|
61 | - '55' => 'Empty logs', |
|
62 | - '56' => 'Refresh resource tree', |
|
63 | - '57' => 'Refresh menu', |
|
64 | - '58' => 'Logged in', |
|
65 | - '59' => 'About MODX', |
|
66 | - '60' => 'Emptying Recycle Bin', |
|
67 | - '61' => 'Publishing a resource', |
|
68 | - '62' => 'Un-publishing a resource', |
|
69 | - '63' => 'Un-deleting a resource', |
|
70 | - '64' => 'Removing deleted content', |
|
71 | - '65' => 'Deleting a message', |
|
72 | - '66' => 'Sending a message', |
|
73 | - '67' => 'Removing locks', |
|
74 | - '68' => 'Viewing site logging', |
|
75 | - '69' => 'Viewing online visitors', |
|
76 | - '70' => 'Viewing site schedule', |
|
77 | - '71' => 'Searching', |
|
78 | - '72' => 'Adding a weblink', |
|
79 | - '73' => 'Editing a weblink', |
|
80 | - //case "74" : return "Changing personal preferences"; break; |
|
81 | - '75' => 'User/ role management', |
|
82 | - '76' => 'Element management', |
|
83 | - '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | - '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | - '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | - '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | - '83' => 'Exporting a resource to HTML', |
|
88 | - '84' => 'Load Element Selector', |
|
89 | - '85' => 'Create Folder', |
|
90 | - '86' => 'Role management', |
|
91 | - '87' => 'Create new web user', |
|
92 | - '88' => 'Editing web user', |
|
93 | - '89' => 'Saving web user', |
|
94 | - '90' => 'Deleting web user', |
|
95 | - '91' => 'Editing Web Access Permissions', |
|
96 | - '92' => 'Editing Access Permissions', |
|
97 | - '93' => 'Backup Manager', |
|
98 | - '94' => 'Duplicate resource', |
|
99 | - '95' => 'Importing resources from HTML', |
|
100 | - '96' => 'Duplicate Template', |
|
101 | - '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | - '98' => 'Duplicate Snippet', |
|
103 | - '99' => 'Manage Web Users', |
|
104 | - '100' => 'Previewing resource', |
|
105 | - '101' => 'Create new plugin', |
|
106 | - '102' => 'Edit plugin', |
|
107 | - '103' => 'Saving plugin', |
|
108 | - '104' => 'Delete plugin', |
|
109 | - '105' => 'Duplicate plugin', |
|
110 | - '106' => 'Viewing Modules', |
|
111 | - '107' => 'Create new module', |
|
112 | - '108' => 'Edit module', |
|
113 | - '109' => 'Saving module', |
|
114 | - '110' => 'Delete module', |
|
115 | - '111' => 'Duplicate module', |
|
116 | - '112' => 'Execute module', |
|
117 | - '113' => 'Manage module dependencies', |
|
118 | - '114' => 'View event log', |
|
119 | - '115' => 'View event log details', |
|
120 | - '116' => 'Delete event log', |
|
121 | - '117' => 'Editing tv rank', |
|
122 | - '118' => 'Call settings ajax include', |
|
123 | - '119' => 'Login Fail (Temporary Block)', |
|
8 | + '1' => 'Loading a frame(set)', |
|
9 | + '2' => 'Viewing home page/ online users', |
|
10 | + '3' => 'Viewing data for resource', |
|
11 | + '4' => 'Creating a resource', |
|
12 | + '5' => 'Saving resource', |
|
13 | + '6' => 'Deleting resource', |
|
14 | + '7' => 'Waiting while MODX cleans up', |
|
15 | + '8' => 'Logged out', |
|
16 | + '9' => 'Viewing help', |
|
17 | + '10' => 'Viewing/ composing messages', |
|
18 | + '11' => 'Creating a user', |
|
19 | + '12' => 'Editing user', |
|
20 | + '13' => 'Viewing logging', |
|
21 | + '14' => 'Editing a parser', |
|
22 | + '15' => 'Saving a parser', |
|
23 | + '16' => 'Editing template', |
|
24 | + '17' => 'Editing settings', |
|
25 | + '18' => 'Viewing Credits :)', |
|
26 | + '19' => 'Creating a new template', |
|
27 | + '20' => 'Saving template', |
|
28 | + '21' => 'Deleting template', |
|
29 | + '22' => 'Editing Snippet', |
|
30 | + '23' => 'Creating a new Snippet', |
|
31 | + '24' => 'Saving Snippet', |
|
32 | + '25' => 'Deleting Snippet', |
|
33 | + '26' => 'Refreshing site', |
|
34 | + '27' => 'Editing resource', |
|
35 | + '28' => 'Changing password', |
|
36 | + '29' => 'Error', |
|
37 | + '30' => 'Saving settings', |
|
38 | + '31' => 'Using file manager', |
|
39 | + '32' => 'Saving user', |
|
40 | + '33' => 'Deleting user', |
|
41 | + '34' => 'Saving new password', |
|
42 | + '35' => 'Editing role', |
|
43 | + '36' => 'Saving role', |
|
44 | + '37' => 'Deleting role', |
|
45 | + '38' => 'Creating new role', |
|
46 | + '40' => 'Editing Access Permissions', |
|
47 | + '41' => 'Editing Access Permissions', |
|
48 | + '42' => 'Editing Access Permissions', |
|
49 | + '43' => 'Editing Access Permissions', |
|
50 | + '44' => 'Editing Access Permissions', |
|
51 | + '45' => 'Idle', |
|
52 | + '46' => 'Editing Access Permissions', |
|
53 | + '47' => 'Editing Access Permissions', |
|
54 | + '48' => 'Editing Access Permissions', |
|
55 | + '49' => 'Editing Access Permissions', |
|
56 | + '50' => 'Editing Access Permissions', |
|
57 | + '51' => 'Moving resource', |
|
58 | + '52' => 'Moved resource', |
|
59 | + '53' => 'Viewing system info', |
|
60 | + '54' => 'Optimizing a table', |
|
61 | + '55' => 'Empty logs', |
|
62 | + '56' => 'Refresh resource tree', |
|
63 | + '57' => 'Refresh menu', |
|
64 | + '58' => 'Logged in', |
|
65 | + '59' => 'About MODX', |
|
66 | + '60' => 'Emptying Recycle Bin', |
|
67 | + '61' => 'Publishing a resource', |
|
68 | + '62' => 'Un-publishing a resource', |
|
69 | + '63' => 'Un-deleting a resource', |
|
70 | + '64' => 'Removing deleted content', |
|
71 | + '65' => 'Deleting a message', |
|
72 | + '66' => 'Sending a message', |
|
73 | + '67' => 'Removing locks', |
|
74 | + '68' => 'Viewing site logging', |
|
75 | + '69' => 'Viewing online visitors', |
|
76 | + '70' => 'Viewing site schedule', |
|
77 | + '71' => 'Searching', |
|
78 | + '72' => 'Adding a weblink', |
|
79 | + '73' => 'Editing a weblink', |
|
80 | + //case "74" : return "Changing personal preferences"; break; |
|
81 | + '75' => 'User/ role management', |
|
82 | + '76' => 'Element management', |
|
83 | + '77' => 'Creating a new Chunk (HTML Snippet)', |
|
84 | + '78' => 'Editing Chunk (HTML Snippet)', |
|
85 | + '79' => 'Saving Chunk (HTML Snippet)', |
|
86 | + '80' => 'Deleting Chunk (HTML Snippet)', |
|
87 | + '83' => 'Exporting a resource to HTML', |
|
88 | + '84' => 'Load Element Selector', |
|
89 | + '85' => 'Create Folder', |
|
90 | + '86' => 'Role management', |
|
91 | + '87' => 'Create new web user', |
|
92 | + '88' => 'Editing web user', |
|
93 | + '89' => 'Saving web user', |
|
94 | + '90' => 'Deleting web user', |
|
95 | + '91' => 'Editing Web Access Permissions', |
|
96 | + '92' => 'Editing Access Permissions', |
|
97 | + '93' => 'Backup Manager', |
|
98 | + '94' => 'Duplicate resource', |
|
99 | + '95' => 'Importing resources from HTML', |
|
100 | + '96' => 'Duplicate Template', |
|
101 | + '97' => 'Duplicate Chunk (HTML Snippet)', |
|
102 | + '98' => 'Duplicate Snippet', |
|
103 | + '99' => 'Manage Web Users', |
|
104 | + '100' => 'Previewing resource', |
|
105 | + '101' => 'Create new plugin', |
|
106 | + '102' => 'Edit plugin', |
|
107 | + '103' => 'Saving plugin', |
|
108 | + '104' => 'Delete plugin', |
|
109 | + '105' => 'Duplicate plugin', |
|
110 | + '106' => 'Viewing Modules', |
|
111 | + '107' => 'Create new module', |
|
112 | + '108' => 'Edit module', |
|
113 | + '109' => 'Saving module', |
|
114 | + '110' => 'Delete module', |
|
115 | + '111' => 'Duplicate module', |
|
116 | + '112' => 'Execute module', |
|
117 | + '113' => 'Manage module dependencies', |
|
118 | + '114' => 'View event log', |
|
119 | + '115' => 'View event log details', |
|
120 | + '116' => 'Delete event log', |
|
121 | + '117' => 'Editing tv rank', |
|
122 | + '118' => 'Call settings ajax include', |
|
123 | + '119' => 'Login Fail (Temporary Block)', |
|
124 | 124 | |
125 | - '300' => 'Create Template Variable', |
|
126 | - '301' => 'Edit Template Variable', |
|
127 | - '302' => 'Save Template Variable', |
|
128 | - '303' => 'Delete Template Variable', |
|
129 | - '304' => 'Duplicate Template Variable', |
|
125 | + '300' => 'Create Template Variable', |
|
126 | + '301' => 'Edit Template Variable', |
|
127 | + '302' => 'Save Template Variable', |
|
128 | + '303' => 'Delete Template Variable', |
|
129 | + '304' => 'Duplicate Template Variable', |
|
130 | 130 | |
131 | - '200' => 'Viewing phpInfo()', |
|
132 | - '501' => 'Delete category', |
|
133 | - '998' => 'Viewing web page', |
|
134 | - '999' => 'Viewing test page', |
|
131 | + '200' => 'Viewing phpInfo()', |
|
132 | + '501' => 'Delete category', |
|
133 | + '998' => 'Viewing web page', |
|
134 | + '999' => 'Viewing test page', |
|
135 | 135 | ); |
136 | 136 | |
137 | 137 | function getAction($actionId, $itemid='') { |
138 | - global $action_list; |
|
138 | + global $action_list; |
|
139 | 139 | |
140 | - $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | - if (!$ret) $ret = "Idle (unknown)"; |
|
140 | + $ret = sprintf($action_list[$actionId], $itemid); |
|
141 | + if (!$ret) $ret = "Idle (unknown)"; |
|
142 | 142 | |
143 | - return $ret; |
|
143 | + return $ret; |
|
144 | 144 | } |
@@ -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 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | '999' => 'Viewing test page', |
135 | 135 | ); |
136 | 136 | |
137 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid = ''){ |
|
138 | 138 | global $action_list; |
139 | 139 | |
140 | 140 | $ret = sprintf($action_list[$actionId], $itemid); |
@@ -134,11 +134,14 @@ |
||
134 | 134 | '999' => 'Viewing test page', |
135 | 135 | ); |
136 | 136 | |
137 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid='') |
|
138 | +{ |
|
138 | 139 | global $action_list; |
139 | 140 | |
140 | 141 | $ret = sprintf($action_list[$actionId], $itemid); |
141 | - if (!$ret) $ret = "Idle (unknown)"; |
|
142 | + if (!$ret) { |
|
143 | + $ret = "Idle (unknown)"; |
|
144 | + } |
|
142 | 145 | |
143 | 146 | return $ret; |
144 | 147 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -if(( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE!="true") { |
|
2 | +if ((!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) && IN_PARSER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE ACCESS ERROR</b><br /><br />Direct access to this file prohibited."); |
4 | 4 | } |
5 | 5 | $tmpArray = array(); |