@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if(!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | // check to see the edit settings page isn't locked |
12 | 12 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
13 | -if($username = $modx->db->getValue($rs)) { |
|
13 | +if($username = $modx->db->getValue($rs)) { |
|
14 | 14 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
15 | 15 | } |
16 | 16 | // end check for lock |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $settings = array(); |
21 | 21 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
22 | 22 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings'); |
23 | -while($row = $modx->db->getRow($rs)) { |
|
23 | +while($row = $modx->db->getRow($rs)) { |
|
24 | 24 | $settings[$row['setting_name']] = $row['setting_value']; |
25 | 25 | } |
26 | 26 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | // load languages and keys |
32 | 32 | $lang_keys = array(); |
33 | 33 | $dir = dir('includes/lang'); |
34 | -while($file = $dir->read()) { |
|
35 | - if(strpos($file, '.inc.php') > 0) { |
|
34 | +while($file = $dir->read()) { |
|
35 | + if(strpos($file, '.inc.php') > 0) { |
|
36 | 36 | $endpos = strpos($file, '.'); |
37 | 37 | $languagename = substr($file, 0, $endpos); |
38 | 38 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -131,6 +131,6 @@ discard block |
||
131 | 131 | }); |
132 | 132 | </script> |
133 | 133 | <?php |
134 | -if(is_numeric($_GET['tab'])) { |
|
134 | +if(is_numeric($_GET['tab'])) { |
|
135 | 135 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
136 | 136 | } |
@@ -118,18 +118,18 @@ |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->db->query($articul_query); |
120 | 120 | $articul_id_array = $modx->db->makeArray($articul_result); |
121 | - if(count($articul_id_array)>0){ |
|
121 | + if(count($articul_id_array)>0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | 124 | foreach( $articul_id_array as $articul ) { |
125 | 125 | $articul_id.=$articul['contentid']; |
126 | - if($i !== count($articul_id_array)){ |
|
126 | + if($i !== count($articul_id_array)) { |
|
127 | 127 | $articul_id.=','; |
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
132 | - }else{ |
|
132 | + } else { |
|
133 | 133 | $articul_id_query = ''; |
134 | 134 | } |
135 | 135 | /*end search by TV*/ |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('view_eventlog')) { |
|
5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $modx->manager->initPageViewState(); |
16 | 16 | |
17 | 17 | // get and save search string |
18 | -if($_REQUEST['op'] == 'reset') { |
|
18 | +if($_REQUEST['op'] == 'reset') { |
|
19 | 19 | $sqlQuery = $query = ''; |
20 | 20 | $_PAGE['vs']['search'] = ''; |
21 | -} else { |
|
21 | +} else { |
|
22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
23 | - if(!is_numeric($sqlQuery)) { |
|
23 | + if(!is_numeric($sqlQuery)) { |
|
24 | 24 | $sqlQuery = $modx->db->escape($query); |
25 | 25 | } |
26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | $grd->colWidths = "1%,,1%,1%,1%"; |
144 | 144 | $grd->colAligns = "center,,,center,center"; |
145 | 145 | $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
146 | - if($listmode == '1') { |
|
146 | + if($listmode == '1') { |
|
147 | 147 | $grd->pageSize = 0; |
148 | 148 | } |
149 | - if($_REQUEST['op'] == 'reset') { |
|
149 | + if($_REQUEST['op'] == 'reset') { |
|
150 | 150 | $grd->pageNumber = 1; |
151 | 151 | } |
152 | 152 | // render grid |
@@ -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 88: |
8 | - if(!$modx->hasPermission('edit_web_user')) { |
|
8 | + if(!$modx->hasPermission('edit_web_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 87: |
13 | - if(!$modx->hasPermission('new_web_user')) { |
|
13 | + if(!$modx->hasPermission('new_web_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -23,33 +23,35 @@ discard block |
||
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | -if($username = $modx->db->getValue($rs)) { |
|
26 | +if($username = $modx->db->getValue($rs)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | -if($modx->manager->action == '88') { |
|
31 | +if($modx->manager->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->db->getRow($rs); |
35 | - if(!$userdata) { |
|
35 | + if(!$userdata) { |
|
36 | 36 | $modx->webAlertAndQuit("No user returned!"); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$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 | extract($usersettings, EXTR_OVERWRITE); |
44 | 46 | |
45 | 47 | // get user name |
46 | 48 | $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 49 | $usernamedata = $modx->db->getRow($rs); |
48 | - if(!$usernamedata) { |
|
50 | + if(!$usernamedata) { |
|
49 | 51 | $modx->webAlertAndQuit("No user returned while getting username!"); |
50 | 52 | } |
51 | 53 | $_SESSION['itemname'] = $usernamedata['username']; |
52 | -} else { |
|
54 | +} else { |
|
53 | 55 | $userdata = array(); |
54 | 56 | $usersettings = array(); |
55 | 57 | $usernamedata = array(); |
@@ -57,14 +59,14 @@ discard block |
||
57 | 59 | } |
58 | 60 | |
59 | 61 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | -foreach($userdata as $key => $val) { |
|
62 | +foreach($userdata as $key => $val) { |
|
61 | 63 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
62 | 64 | }; |
63 | 65 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 66 | |
65 | 67 | // restore saved form |
66 | 68 | $formRestored = false; |
67 | -if($modx->manager->hasFormValues()) { |
|
69 | +if($modx->manager->hasFormValues()) { |
|
68 | 70 | $modx->manager->loadFormValues(); |
69 | 71 | // restore post values |
70 | 72 | $userdata = array_merge($userdata, $_POST); |
@@ -78,9 +80,9 @@ discard block |
||
78 | 80 | |
79 | 81 | // include the country list language file |
80 | 82 | $_country_lang = array(); |
81 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
83 | +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
82 | 84 | include_once "lang/country/" . $manager_language . "_country.inc.php"; |
83 | -} else { |
|
85 | +} else { |
|
84 | 86 | include_once "lang/country/english_country.inc.php"; |
85 | 87 | } |
86 | 88 | asort($_country_lang); |
@@ -191,7 +193,7 @@ discard block |
||
191 | 193 | <?php |
192 | 194 | // invoke OnWUsrFormPrerender event |
193 | 195 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
194 | - if(is_array($evtOut)) { |
|
196 | + if(is_array($evtOut)) { |
|
195 | 197 | echo implode("", $evtOut); |
196 | 198 | } |
197 | 199 | ?> |
@@ -324,7 +326,7 @@ discard block |
||
324 | 326 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
325 | 327 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
326 | 328 | <?php |
327 | - foreach($_country_lang as $key => $country) { |
|
329 | + foreach($_country_lang as $key => $country) { |
|
328 | 330 | echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
329 | 331 | } |
330 | 332 | ?> |
@@ -496,17 +498,20 @@ discard block |
||
496 | 498 | </table> |
497 | 499 | </div> |
498 | 500 | <?php |
499 | - if($use_udperms == 1) { |
|
501 | + if($use_udperms == 1) { |
|
500 | 502 | |
501 | 503 | $groupsarray = array(); |
502 | 504 | |
503 | - if($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
505 | + if($modx->manager->action == '88') { |
|
506 | +// only do this bit if the user is being edited |
|
504 | 507 | $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
505 | 508 | $groupsarray = $modx->db->getColumn('webgroup', $rs); |
506 | 509 | } |
507 | 510 | // retain selected user groups between post |
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
511 | + if(is_array($_POST['user_groups'])) { |
|
512 | + foreach($_POST['user_groups'] as $n => $v) { |
|
513 | + $groupsarray[] = $v; |
|
514 | + } |
|
510 | 515 | } |
511 | 516 | ?> |
512 | 517 | <div class="tab-page" id="tabPermissions"> |
@@ -515,7 +520,7 @@ discard block |
||
515 | 520 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 521 | <?php |
517 | 522 | $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
518 | - while($row = $modx->db->getRow($rs)) { |
|
523 | + while($row = $modx->db->getRow($rs)) { |
|
519 | 524 | echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
520 | 525 | } |
521 | 526 | } |
@@ -526,7 +531,7 @@ discard block |
||
526 | 531 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
527 | 532 | "id" => $user |
528 | 533 | )); |
529 | - if(is_array($evtOut)) { |
|
534 | + if(is_array($evtOut)) { |
|
530 | 535 | echo implode("", $evtOut); |
531 | 536 | } |
532 | 537 | ?> |
@@ -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 | ?> |
@@ -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( |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
6 | +if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { |
|
7 | 7 | |
8 | 8 | $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
9 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | if(substr($target,0,6)==='@CHUNK') { |
36 | 36 | $target = trim(substr($target,7)); |
37 | 37 | $lockout_tpl = $modx->getChunk($target); |
38 | - } |
|
39 | - elseif(substr($target,0,5)==='@FILE') { |
|
38 | + } elseif(substr($target,0,5)==='@FILE') { |
|
40 | 39 | $target = trim(substr($target,6)); |
41 | 40 | $lockout_tpl = file_get_contents($target); |
42 | 41 | } |
@@ -44,24 +43,20 @@ discard block |
||
44 | 43 | $chunk = $modx->getChunk($target); |
45 | 44 | if($chunk!==false && !empty($chunk)) { |
46 | 45 | $lockout_tpl = $chunk; |
47 | - } |
|
48 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
46 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
49 | 47 | $target = MODX_BASE_PATH . $target; |
50 | 48 | $lockout_tpl = file_get_contents($target); |
51 | - } |
|
52 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
49 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
53 | 50 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
54 | 51 | $lockout_tpl = file_get_contents($target); |
55 | - } |
|
56 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
52 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
57 | 53 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
58 | 54 | $login_tpl = file_get_contents($target); |
59 | - } |
|
60 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
55 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { |
|
56 | +// ClipperCMS compatible |
|
61 | 57 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
62 | 58 | $lockout_tpl = file_get_contents($target); |
63 | - } |
|
64 | - else { |
|
59 | + } else { |
|
65 | 60 | $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
66 | 61 | $lockout_tpl = file_get_contents($target); |
67 | 62 | } |
@@ -12,16 +12,20 @@ |
||
12 | 12 | $modx->loadExtension('EXPORT_SITE'); |
13 | 13 | |
14 | 14 | |
15 | -if(is_dir(MODX_BASE_PATH . 'temp')) $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
16 | -elseif(is_dir(MODX_BASE_PATH . 'assets')) $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
15 | +if(is_dir(MODX_BASE_PATH . 'temp')) { |
|
16 | + $export_dir = MODX_BASE_PATH . 'temp/export'; |
|
17 | +} elseif(is_dir(MODX_BASE_PATH . 'assets')) { |
|
18 | + $export_dir = MODX_BASE_PATH . 'assets/export'; |
|
19 | +} |
|
17 | 20 | $modx->export->targetDir = $export_dir; |
18 | 21 | |
19 | -if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) |
|
22 | +if(strpos($modx->config['base_path'],"{$export_dir}/")===0 && 0 <= strlen(str_replace("{$export_dir}/",'',$modx->config['base_path']))) { |
|
20 | 23 | return $_lang['export_site.static.php6']; |
21 | -elseif($modx->config['rb_base_dir'] === $export_dir . '/') |
|
24 | +} elseif($modx->config['rb_base_dir'] === $export_dir . '/') { |
|
22 | 25 | return $modx->parsePlaceholder($_lang['export_site.static.php7'],'rb_base_url=' . $modx->config['base_url'] . $modx->config['rb_base_url']); |
23 | -elseif(!is_writable($export_dir)) |
|
26 | +} elseif(!is_writable($export_dir)) { |
|
24 | 27 | return $_lang['export_site_target_unwritable']; |
28 | +} |
|
25 | 29 | |
26 | 30 | $modx->export->generate_mode = $_POST['generate_mode']; |
27 | 31 |
@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_plugins'), "id='{$id}'")); |
16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_plugins'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate Plugin |
21 | 24 | $newid = $modx->db->insert( |