@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><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 | ?> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><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,22 +1,22 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (IN_MANAGER_MODE != "true") {
|
|
| 2 | +if (IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if (!$modx->hasPermission('logs')) {
|
|
| 5 | +if (!$modx->hasPermission('logs')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -function array_unique_multi($array, $checkKey) |
|
| 10 | -{
|
|
| 9 | +function array_unique_multi($array, $checkKey) |
|
| 10 | +{ |
|
| 11 | 11 | // Use the builtin if we're not a multi-dimensional array |
| 12 | - if (!is_array(current($array)) || empty($checkKey)) {
|
|
| 12 | + if (!is_array(current($array)) || empty($checkKey)) { |
|
| 13 | 13 | return array_unique($array); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | $ret = array(); |
| 17 | 17 | $checkValues = array(); // contains the unique key Values |
| 18 | - foreach ($array as $key => $current) {
|
|
| 19 | - if (in_array($current[$checkKey], $checkValues)) {
|
|
| 18 | + foreach ($array as $key => $current) { |
|
| 19 | + if (in_array($current[$checkKey], $checkValues)) { |
|
| 20 | 20 | continue; |
| 21 | 21 | } // duplicate |
| 22 | 22 | |
@@ -26,17 +26,17 @@ discard block |
||
| 26 | 26 | return $ret; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -function record_sort($array, $key) |
|
| 30 | -{
|
|
| 29 | +function record_sort($array, $key) |
|
| 30 | +{ |
|
| 31 | 31 | $hash = array(); |
| 32 | - foreach ($array as $k => $v) {
|
|
| 32 | + foreach ($array as $k => $v) { |
|
| 33 | 33 | $hash[$k] = $v[$key]; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | natsort($hash); |
| 37 | 37 | |
| 38 | 38 | $records = array(); |
| 39 | - foreach ($hash as $k => $row) {
|
|
| 39 | + foreach ($hash as $k => $row) { |
|
| 40 | 40 | $records[$k] = $array[$k]; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | <?php |
| 64 | 64 | // get all users currently in the log |
| 65 | 65 | $logs_user = record_sort(array_unique_multi($logs, 'internalKey'), 'username'); |
| 66 | - foreach ($logs_user as $row) {
|
|
| 66 | + foreach ($logs_user as $row) { |
|
| 67 | 67 | $selectedtext = $row['internalKey'] == $_REQUEST['searchuser'] ? ' selected="selected"' : ''; |
| 68 | 68 | echo "\t\t" . '<option value="' . $row['internalKey'] . '"' . $selectedtext . '>' . $row['username'] . "</option>\n"; |
| 69 | 69 | } |
@@ -80,9 +80,9 @@ discard block |
||
| 80 | 80 | // get all available actions in the log |
| 81 | 81 | include_once "actionlist.inc.php"; |
| 82 | 82 | $logs_actions = record_sort(array_unique_multi($logs, 'action'), 'action'); |
| 83 | - foreach ($logs_actions as $row) {
|
|
| 83 | + foreach ($logs_actions as $row) { |
|
| 84 | 84 | $action = getAction($row['action']); |
| 85 | - if ($action == 'Idle') {
|
|
| 85 | + if ($action == 'Idle') { |
|
| 86 | 86 | continue; |
| 87 | 87 | } |
| 88 | 88 | $selectedtext = $row['action'] == $_REQUEST['action'] ? ' selected="selected"' : ''; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | <?php |
| 101 | 101 | // get all itemid currently in logging |
| 102 | 102 | $logs_items = record_sort(array_unique_multi($logs, 'itemid'), 'itemid'); |
| 103 | - foreach ($logs_items as $row) {
|
|
| 103 | + foreach ($logs_items as $row) { |
|
| 104 | 104 | $selectedtext = $row['itemid'] == $_REQUEST['itemid'] ? ' selected="selected"' : ''; |
| 105 | 105 | echo "\t\t" . '<option value="' . $row['itemid'] . '"' . $selectedtext . '>' . $row['itemid'] . "</option>\n"; |
| 106 | 106 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | <?php |
| 117 | 117 | // get all itemname currently in logging |
| 118 | 118 | $logs_names = record_sort(array_unique_multi($logs, 'itemname'), 'itemname'); |
| 119 | - foreach ($logs_names as $row) {
|
|
| 119 | + foreach ($logs_names as $row) { |
|
| 120 | 120 | $selectedtext = $row['itemname'] == $_REQUEST['itemname'] ? ' selected="selected"' : ''; |
| 121 | 121 | echo "\t\t" . '<option value="' . $row['itemname'] . '"' . $selectedtext . '>' . $row['itemname'] . "</option>\n"; |
| 122 | 122 | } |
@@ -172,36 +172,36 @@ discard block |
||
| 172 | 172 | <div class="container container-body"> |
| 173 | 173 | |
| 174 | 174 | <?php |
| 175 | -if (isset($_REQUEST['log_submit'])) {
|
|
| 175 | +if (isset($_REQUEST['log_submit'])) { |
|
| 176 | 176 | // get the selections the user made. |
| 177 | 177 | $sqladd = array(); |
| 178 | - if ($_REQUEST['searchuser'] != 0) {
|
|
| 178 | + if ($_REQUEST['searchuser'] != 0) { |
|
| 179 | 179 | $sqladd[] = "internalKey='" . intval($_REQUEST['searchuser']) . "'"; |
| 180 | 180 | } |
| 181 | - if ($_REQUEST['action'] != 0) {
|
|
| 181 | + if ($_REQUEST['action'] != 0) { |
|
| 182 | 182 | $sqladd[] = "action=" . intval($_REQUEST['action']); |
| 183 | 183 | } |
| 184 | - if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") {
|
|
| 184 | + if ($_REQUEST['itemid'] != 0 || $_REQUEST['itemid'] == "-") { |
|
| 185 | 185 | $sqladd[] = "itemid='" . $_REQUEST['itemid'] . "'"; |
| 186 | 186 | } |
| 187 | - if ($_REQUEST['itemname'] != '0') {
|
|
| 187 | + if ($_REQUEST['itemname'] != '0') { |
|
| 188 | 188 | $sqladd[] = "itemname='" . $modx->db->escape($_REQUEST['itemname']) . "'"; |
| 189 | 189 | } |
| 190 | - if ($_REQUEST['message'] != "") {
|
|
| 190 | + if ($_REQUEST['message'] != "") { |
|
| 191 | 191 | $sqladd[] = "message LIKE '%" . $modx->db->escape($_REQUEST['message']) . "%'"; |
| 192 | 192 | } |
| 193 | 193 | // date stuff |
| 194 | - if ($_REQUEST['datefrom'] != "") {
|
|
| 194 | + if ($_REQUEST['datefrom'] != "") { |
|
| 195 | 195 | $sqladd[] = "timestamp>" . $modx->toTimeStamp($_REQUEST['datefrom']); |
| 196 | 196 | } |
| 197 | - if ($_REQUEST['dateto'] != "") {
|
|
| 197 | + if ($_REQUEST['dateto'] != "") { |
|
| 198 | 198 | $sqladd[] = "timestamp<" . $modx->toTimeStamp($_REQUEST['dateto']); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // If current position is not set, set it to zero |
| 202 | - if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) {
|
|
| 202 | + if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
|
| 203 | 203 | $int_cur_position = 0; |
| 204 | - } else {
|
|
| 204 | + } else { |
|
| 205 | 205 | $int_cur_position = $_REQUEST['int_cur_position']; |
| 206 | 206 | } |
| 207 | 207 | |
@@ -215,9 +215,9 @@ discard block |
||
| 215 | 215 | |
| 216 | 216 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_log'), (!empty($sqladd) ? implode(' AND ', $sqladd) : ''), 'timestamp DESC, id DESC', "{$int_cur_position}, {$int_num_result}");
|
| 217 | 217 | |
| 218 | -if ($limit < 1) {
|
|
| 218 | +if ($limit < 1) { |
|
| 219 | 219 | echo '<p>' . $_lang["mgrlog_emptysrch"] . '</p>'; |
| 220 | -} else {
|
|
| 220 | +} else { |
|
| 221 | 221 | echo '<p>' . $_lang["mgrlog_sortinst"] . '</p>'; |
| 222 | 222 | |
| 223 | 223 | include_once "paginate.inc.php"; |
@@ -236,14 +236,14 @@ discard block |
||
| 236 | 236 | $paging = $array_paging['first_link'] . $_lang["paging_first"] . (isset($array_paging['first_link']) ? "</a> " : " "); |
| 237 | 237 | $paging .= $array_paging['previous_link'] . $_lang["paging_prev"] . (isset($array_paging['previous_link']) ? "</a> " : " "); |
| 238 | 238 | $pagesfound = sizeof($array_row_paging); |
| 239 | - if ($pagesfound > 6) {
|
|
| 239 | + if ($pagesfound > 6) { |
|
| 240 | 240 | $paging .= $array_row_paging[$current_row - 2]; // ." "; |
| 241 | 241 | $paging .= $array_row_paging[$current_row - 1]; // ." "; |
| 242 | 242 | $paging .= $array_row_paging[$current_row]; // ." "; |
| 243 | 243 | $paging .= $array_row_paging[$current_row + 1]; // ." "; |
| 244 | 244 | $paging .= $array_row_paging[$current_row + 2]; // ." "; |
| 245 | - } else {
|
|
| 246 | - for ($i = 0; $i < $pagesfound; $i++) {
|
|
| 245 | + } else { |
|
| 246 | + for ($i = 0; $i < $pagesfound; $i++) { |
|
| 247 | 247 | $paging .= $array_row_paging[$i] . " "; |
| 248 | 248 | } |
| 249 | 249 | } |
@@ -278,12 +278,12 @@ discard block |
||
| 278 | 278 | // grab the entire log file... |
| 279 | 279 | $logentries = array(); |
| 280 | 280 | $i = 0; |
| 281 | - while ($logentry = $modx->db->getRow($rs)) {
|
|
| 282 | - if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) {
|
|
| 281 | + while ($logentry = $modx->db->getRow($rs)) { |
|
| 282 | + if (!preg_match("/^[0-9]+$/", $logentry['itemid'])) { |
|
| 283 | 283 | $item = '<div style="text-align:center;">-</div>'; |
| 284 | - } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) {
|
|
| 284 | + } elseif ($logentry['action'] == 3 || $logentry['action'] == 27 || $logentry['action'] == 5) { |
|
| 285 | 285 | $item = '<a href="index.php?a=3&id=' . $logentry['itemid'] . '">' . $logentry['itemname'] . '</a>'; |
| 286 | - } else {
|
|
| 286 | + } else { |
|
| 287 | 287 | $item = $logentry['itemname']; |
| 288 | 288 | } |
| 289 | 289 | //index.php?a=13&searchuser=' . $logentry['internalKey'] . '&action=' . $logentry['action'] . '&itemname=' . $logentry['itemname'] . '&log_submit=true' |
@@ -318,6 +318,6 @@ discard block |
||
| 318 | 318 | // @see index.php @ 915 |
| 319 | 319 | global $action; |
| 320 | 320 | $action = 1; |
| 321 | -} else {
|
|
| 321 | +} else { |
|
| 322 | 322 | echo $_lang["mgrlog_noquery"]; |
| 323 | 323 | } |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 2 | +if(IN_MANAGER_MODE!="true") { |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | +} |
|
| 3 | 5 | |
| 4 | 6 | if(!$modx->hasPermission('category_manager')) { |
| 5 | 7 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
@@ -26,16 +28,14 @@ discard block |
||
| 26 | 28 | $cm = new Module_Categories_Manager(); |
| 27 | 29 | |
| 28 | 30 | // assign module_params to internal params |
| 29 | -foreach( $_module_params as $param => $value ) |
|
| 30 | -{ |
|
| 31 | +foreach( $_module_params as $param => $value ) { |
|
| 31 | 32 | $cm->set( $param, $value ); |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | // catch the request actions |
| 35 | 36 | include_once $cm->get('inc_dir') . 'request_trigger.inc.php'; |
| 36 | 37 | |
| 37 | -if( !$categories = $cm->getCategories() ) |
|
| 38 | -{ |
|
| 38 | +if( !$categories = $cm->getCategories() ) { |
|
| 39 | 39 | setcookie('webfxtab_manage-categories-pane', 0 ); |
| 40 | 40 | $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
| 41 | 41 | } |
@@ -28,7 +28,9 @@ discard block |
||
| 28 | 28 | 'type7' => $_lang["lock_element_type_7"], |
| 29 | 29 | 'type8' => $_lang["lock_element_type_8"] |
| 30 | 30 | ); |
| 31 | -foreach($unlockTranslations as $key => $value) $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
| 31 | +foreach($unlockTranslations as $key => $value) { |
|
| 32 | + $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
| 33 | +} |
|
| 32 | 34 | |
| 33 | 35 | // Prepare lang-strings for mgrResAction() |
| 34 | 36 | $mraTranslations = array( |
@@ -44,7 +46,9 @@ discard block |
||
| 44 | 46 | 'confirm_delete_plugin' => $_lang["confirm_delete_plugin"], |
| 45 | 47 | 'confirm_delete_module' => $_lang["confirm_delete_module"], |
| 46 | 48 | ); |
| 47 | -foreach($mraTranslations as $key => $value) $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
| 49 | +foreach($mraTranslations as $key => $value) { |
|
| 50 | + $mraTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
|
| 51 | +} |
|
| 48 | 52 | ?> |
| 49 | 53 | <script>var trans = <?php echo json_encode($unlockTranslations); ?>;</script> |
| 50 | 54 | <script>var mraTrans = <?php echo json_encode($mraTranslations); ?>;</script> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | <?php |
| 20 | 20 | $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
| 21 | 21 | $limit = $modx->db->getRecordCount($rs); |
| 22 | - if($limit < 1) {
|
|
| 22 | + if($limit < 1) { |
|
| 23 | 23 | ?> |
| 24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
| 25 | 25 | <?php |
| 26 | - } else {
|
|
| 26 | + } else { |
|
| 27 | 27 | ?> |
| 28 | 28 | <div class="table-responsive"> |
| 29 | 29 | <table class="grid sortabletable" id="table-1"> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | </thead> |
| 37 | 37 | <tbody> |
| 38 | 38 | <?php |
| 39 | - while($row = $modx->db->getRow($rs)) {
|
|
| 39 | + while($row = $modx->db->getRow($rs)) { |
|
| 40 | 40 | ?> |
| 41 | 41 | <tr> |
| 42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | <?php |
| 59 | 59 | $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
| 60 | 60 | $limit = $modx->db->getRecordCount($rs); |
| 61 | - if($limit < 1) {
|
|
| 61 | + if($limit < 1) { |
|
| 62 | 62 | ?> |
| 63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
| 64 | 64 | <?php |
| 65 | - } else {
|
|
| 65 | + } else { |
|
| 66 | 66 | ?> |
| 67 | 67 | <div class="table-responsive"> |
| 68 | 68 | <table class="grid sortabletable" id="table-2"> |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | </thead> |
| 76 | 76 | <tbody> |
| 77 | 77 | <?php |
| 78 | - while($row = $modx->db->getRow($rs)) {
|
|
| 78 | + while($row = $modx->db->getRow($rs)) { |
|
| 79 | 79 | ?> |
| 80 | 80 | <tr> |
| 81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | <?php |
| 98 | 98 | $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
| 99 | 99 | $limit = $modx->db->getRecordCount($rs); |
| 100 | - if($limit < 1) {
|
|
| 100 | + if($limit < 1) { |
|
| 101 | 101 | ?> |
| 102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
| 103 | 103 | <?php |
| 104 | - } else {
|
|
| 104 | + } else { |
|
| 105 | 105 | ?> |
| 106 | 106 | <div class="table-responsive"> |
| 107 | 107 | <table class="grid sortabletable" id="table-3"> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </thead> |
| 116 | 116 | <tbody> |
| 117 | 117 | <?php |
| 118 | - while($row = $modx->db->getRow($rs)) {
|
|
| 118 | + while($row = $modx->db->getRow($rs)) { |
|
| 119 | 119 | ?> |
| 120 | 120 | <tr> |
| 121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -1,15 +1,15 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -switch($modx->manager->action) {
|
|
| 5 | +switch($modx->manager->action) { |
|
| 6 | 6 | case 107: |
| 7 | - if(!$modx->hasPermission('new_module')) {
|
|
| 7 | + if(!$modx->hasPermission('new_module')) { |
|
| 8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 9 | 9 | } |
| 10 | 10 | break; |
| 11 | 11 | case 108: |
| 12 | - if(!$modx->hasPermission('edit_module')) {
|
|
| 12 | + if(!$modx->hasPermission('edit_module')) { |
|
| 13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 14 | 14 | } |
| 15 | 15 | break; |
@@ -29,7 +29,8 @@ discard block |
||
| 29 | 29 | $tbl_site_templates = $modx->getFullTableName('site_templates');
|
| 30 | 30 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars');
|
| 31 | 31 | // create globally unique identifiers (guid) |
| 32 | -function createGUID() {
|
|
| 32 | +function createGUID() |
|
| 33 | +{ |
|
| 33 | 34 | srand((double) microtime() * 1000000); |
| 34 | 35 | $r = rand(); |
| 35 | 36 | $u = uniqid(getmypid() . $r . (double) microtime() * 1000000, 1); |
@@ -38,7 +39,7 @@ discard block |
||
| 38 | 39 | } |
| 39 | 40 | |
| 40 | 41 | // check to see the module editor isn't locked |
| 41 | -if($lockedEl = $modx->elementIsLocked(6, $id)) {
|
|
| 42 | +if($lockedEl = $modx->elementIsLocked(6, $id)) { |
|
| 42 | 43 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
| 43 | 44 | } |
| 44 | 45 | // end check for lock |
@@ -46,22 +47,22 @@ discard block |
||
| 46 | 47 | // Lock snippet for other users to edit |
| 47 | 48 | $modx->lockElement(6, $id); |
| 48 | 49 | |
| 49 | -if(isset($_GET['id'])) {
|
|
| 50 | +if(isset($_GET['id'])) { |
|
| 50 | 51 | $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
|
| 51 | 52 | $content = $modx->db->getRow($rs); |
| 52 | - if(!$content) {
|
|
| 53 | + if(!$content) { |
|
| 53 | 54 | $modx->webAlertAndQuit("Module not found for id '{$id}'.");
|
| 54 | 55 | } |
| 55 | 56 | $content['properties'] = str_replace("&", "&", $content['properties']);
|
| 56 | 57 | $_SESSION['itemname'] = $content['name']; |
| 57 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 58 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 58 | 59 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 59 | 60 | } |
| 60 | -} else {
|
|
| 61 | +} else { |
|
| 61 | 62 | $_SESSION['itemname'] = $_lang["new_module"]; |
| 62 | 63 | $content['wrap'] = '1'; |
| 63 | 64 | } |
| 64 | -if($modx->manager->hasFormValues()) {
|
|
| 65 | +if($modx->manager->hasFormValues()) { |
|
| 65 | 66 | $modx->manager->loadFormValues(); |
| 66 | 67 | } |
| 67 | 68 | |
@@ -435,7 +436,7 @@ discard block |
||
| 435 | 436 | <?php |
| 436 | 437 | // invoke OnModFormPrerender event |
| 437 | 438 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
|
| 438 | - if(is_array($evtOut)) {
|
|
| 439 | + if(is_array($evtOut)) { |
|
| 439 | 440 | echo implode('', $evtOut);
|
| 440 | 441 | } |
| 441 | 442 | |
@@ -498,7 +499,7 @@ discard block |
||
| 498 | 499 | <option> </option> |
| 499 | 500 | <?php |
| 500 | 501 | include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
| 501 | - foreach(getCategories() as $n => $v) {
|
|
| 502 | + foreach(getCategories() as $n => $v) { |
|
| 502 | 503 | echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
| 503 | 504 | } |
| 504 | 505 | ?> |
@@ -650,7 +651,7 @@ discard block |
||
| 650 | 651 | $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
|
| 651 | 652 | $groupsarray = $modx->db->getColumn('usergroup', $rs);
|
| 652 | 653 | |
| 653 | - if($modx->hasPermission('access_permissions')) {
|
|
| 654 | + if($modx->hasPermission('access_permissions')) { |
|
| 654 | 655 | ?> |
| 655 | 656 | <!-- User Group Access Permissions --> |
| 656 | 657 | <script type="text/javascript"> |
@@ -678,21 +679,21 @@ discard block |
||
| 678 | 679 | } |
| 679 | 680 | $chk = ''; |
| 680 | 681 | $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
|
| 681 | - while($row = $modx->db->getRow($rs)) {
|
|
| 682 | + while($row = $modx->db->getRow($rs)) { |
|
| 682 | 683 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
| 683 | 684 | $checked = in_array($row['id'], $groupsarray); |
| 684 | - if($modx->hasPermission('access_permissions')) {
|
|
| 685 | - if($checked) {
|
|
| 685 | + if($modx->hasPermission('access_permissions')) { |
|
| 686 | + if($checked) { |
|
| 686 | 687 | $notPublic = true; |
| 687 | 688 | } |
| 688 | 689 | $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
| 689 | - } else {
|
|
| 690 | - if($checked) {
|
|
| 690 | + } else { |
|
| 691 | + if($checked) { |
|
| 691 | 692 | $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
| 692 | 693 | } |
| 693 | 694 | } |
| 694 | 695 | } |
| 695 | - if($modx->hasPermission('access_permissions')) {
|
|
| 696 | + if($modx->hasPermission('access_permissions')) { |
|
| 696 | 697 | $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
| 697 | 698 | } |
| 698 | 699 | echo $chks; |
@@ -714,7 +715,7 @@ discard block |
||
| 714 | 715 | <?php |
| 715 | 716 | // invoke OnModFormRender event |
| 716 | 717 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
|
| 717 | - if(is_array($evtOut)) {
|
|
| 718 | + if(is_array($evtOut)) { |
|
| 718 | 719 | echo implode('', $evtOut);
|
| 719 | 720 | } |
| 720 | 721 | ?> |
@@ -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*/ |
@@ -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 | 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'), |
@@ -110,8 +100,7 @@ discard block |
||
| 110 | 100 | "`id` = '" . (int)$element_id . "'" |
| 111 | 101 | ); |
| 112 | 102 | |
| 113 | - if( $this->db->getAffectedRows() === 1 ) |
|
| 114 | - { |
|
| 103 | + if( $this->db->getAffectedRows() === 1 ) { |
|
| 115 | 104 | return true; |
| 116 | 105 | } |
| 117 | 106 | return false; |
@@ -121,7 +110,9 @@ discard block |
||
| 121 | 110 | function txt( $txt ) |
| 122 | 111 | { |
| 123 | 112 | global $_lang; |
| 124 | - if(isset($_lang[$txt])) return $_lang[$txt]; |
|
| 113 | + if(isset($_lang[$txt])) { |
|
| 114 | + return $_lang[$txt]; |
|
| 115 | + } |
|
| 125 | 116 | return $txt; |
| 126 | 117 | } |
| 127 | 118 | } |
| 128 | 119 | \ No newline at end of file |