@@ -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->getManagerApi()->action) { |
|
6 | +switch ($modx->getManagerApi()->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; |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
24 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->getDatabase()->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->getManagerApi()->action == '12') { |
|
30 | +if ($modx->getManagerApi()->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->getDatabase()->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
38 | - if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
38 | + if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | // get user settings |
44 | 44 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
45 | 45 | $usersettings = array(); |
46 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
46 | + while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | 47 | // manually extract so that user display settings are not overwritten |
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
48 | + foreach ($usersettings as $k => $v) { |
|
49 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | 50 | ${$k} = $v; |
51 | 51 | } |
52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // get user name |
55 | 55 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
56 | 56 | $usernamedata = $modx->getDatabase()->getRow($rs); |
57 | - if(!$usernamedata) { |
|
57 | + if (!$usernamedata) { |
|
58 | 58 | $modx->webAlertAndQuit("No user returned while getting username!"); |
59 | 59 | } |
60 | 60 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | -foreach($userdata as $key => $val) { |
|
69 | +foreach ($userdata as $key => $val) { |
|
70 | 70 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | -if($modx->getManagerApi()->hasFormValues()) { |
|
76 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
77 | 77 | $modx->getManagerApi()->loadFormValues(); |
78 | 78 | // restore post values |
79 | 79 | $userdata = array_merge($userdata, $_POST); |
@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | |
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | -include_once MODX_MANAGER_PATH . "includes/lang/country/english_country.inc.php"; |
|
91 | -if($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
92 | - include_once MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php"; |
|
90 | +include_once MODX_MANAGER_PATH."includes/lang/country/english_country.inc.php"; |
|
91 | +if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
92 | + include_once MODX_MANAGER_PATH."includes/lang/country/".$manager_language."_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | -if($which_browser == 'default') { |
|
97 | +if ($which_browser == 'default') { |
|
98 | 98 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
99 | 99 | } |
100 | 100 | ?> |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | document.userform.save.click(); |
187 | 187 | }, |
188 | 188 | delete: function() { |
189 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
189 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
190 | 190 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
191 | 191 | <?php } else { ?> |
192 | 192 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
210 | 210 | "id" => $user |
211 | 211 | )); |
212 | - if(is_array($evtOut)) { |
|
212 | + if (is_array($evtOut)) { |
|
213 | 213 | echo implode("", $evtOut); |
214 | 214 | } |
215 | 215 | ?> |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | <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" ?>" /> |
219 | 219 | |
220 | 220 | <h1> |
221 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
221 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
222 | 222 | </h1> |
223 | 223 | |
224 | 224 | <?=ManagerTheme::getStyle('actionbuttons.dynamic.user') ?> |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
237 | 237 | <tr> |
238 | 238 | <td colspan="3"><span id="blocked" class="warning"> |
239 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
239 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
240 | 240 | <?php echo $_lang['user_is_blocked']; ?> |
241 | 241 | <?php } ?> |
242 | 242 | </span> |
243 | 243 | <br /></td> |
244 | 244 | </tr> |
245 | - <?php if(!empty($userdata['id'])) { ?> |
|
245 | + <?php if (!empty($userdata['id'])) { ?> |
|
246 | 246 | <tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
247 | 247 | <th><?php echo $_lang['username']; ?>:</th> |
248 | 248 | <td> </td> |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
258 | 258 | </tr> |
259 | 259 | <tr> |
260 | - <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
260 | + <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
261 | 261 | <td> </td> |
262 | 262 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "11" ? " checked disabled" : ""; ?>> |
263 | 263 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -315,8 +315,8 @@ discard block |
||
315 | 315 | ?> |
316 | 316 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
317 | 317 | <?php |
318 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
319 | - if($modx->getManagerApi()->action == '11') { |
|
318 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
319 | + if ($modx->getManagerApi()->action == '11') { |
|
320 | 320 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
321 | 321 | } else { |
322 | 322 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
371 | 371 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
372 | 372 | <?php |
373 | - foreach($_country_lang as $key => $country) { |
|
374 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
373 | + foreach ($_country_lang as $key => $country) { |
|
374 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
375 | 375 | } |
376 | 376 | ?> |
377 | 377 | </select></td> |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | <td> </td> |
398 | 398 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars($userdata['comment']); ?></textarea></td> |
399 | 399 | </tr> |
400 | - <?php if($modx->getManagerApi()->action == '12') { ?> |
|
400 | + <?php if ($modx->getManagerApi()->action == '12') { ?> |
|
401 | 401 | <tr> |
402 | 402 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
403 | 403 | <td> </td> |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | </tr> |
435 | 435 | <?php } ?> |
436 | 436 | </table> |
437 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
437 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
438 | 438 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
439 | 439 | <?php } ?> |
440 | 440 | </div> |
@@ -451,8 +451,8 @@ discard block |
||
451 | 451 | <?php |
452 | 452 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
453 | 453 | $dir = dir("includes/lang"); |
454 | - while($file = $dir->read()) { |
|
455 | - if(strpos($file, ".inc.php") > 0) { |
|
454 | + while ($file = $dir->read()) { |
|
455 | + if (strpos($file, ".inc.php") > 0) { |
|
456 | 456 | $endpos = strpos($file, "."); |
457 | 457 | $languagename = substr($file, 0, $endpos); |
458 | 458 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -539,17 +539,17 @@ discard block |
||
539 | 539 | <option value=""></option> |
540 | 540 | <?php |
541 | 541 | $dir = dir("media/style/"); |
542 | - while($file = $dir->read()) { |
|
543 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
542 | + while ($file = $dir->read()) { |
|
543 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
544 | 544 | $themename = $file; |
545 | - if($themename === 'common') { |
|
545 | + if ($themename === 'common') { |
|
546 | 546 | continue; |
547 | 547 | } |
548 | - $attr = 'value="' . $themename . '" '; |
|
549 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
548 | + $attr = 'value="'.$themename.'" '; |
|
549 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
550 | 550 | $attr .= 'selected="selected" '; |
551 | 551 | } |
552 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
552 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 | $dir->close(); |
@@ -590,12 +590,12 @@ discard block |
||
590 | 590 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
591 | 591 | <?php |
592 | 592 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
593 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
594 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
593 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
594 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
595 | 595 | $dir = str_replace('\\', '/', $dir); |
596 | 596 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
597 | 597 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
598 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
598 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
599 | 599 | } |
600 | 600 | ?> |
601 | 601 | </select></td> |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | </tr> |
623 | 623 | <tr> |
624 | 624 | <td> </td> |
625 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
625 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
626 | 626 | </tr> |
627 | 627 | <tr> |
628 | 628 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | </tr> |
635 | 635 | <tr> |
636 | 636 | <td> </td> |
637 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
637 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
638 | 638 | </tr> |
639 | 639 | <tr> |
640 | 640 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | </tr> |
647 | 647 | <tr> |
648 | 648 | <td> </td> |
649 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
649 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
650 | 650 | </tr> |
651 | 651 | <tr> |
652 | 652 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | </tr> |
659 | 659 | <tr> |
660 | 660 | <td> </td> |
661 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
661 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
662 | 662 | </tr> |
663 | 663 | <tr class='row2'> |
664 | 664 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -677,11 +677,11 @@ discard block |
||
677 | 677 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
678 | 678 | // invoke OnRichTextEditorRegister event |
679 | 679 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
680 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
681 | - if(is_array($evtOut)) { |
|
682 | - for($i = 0; $i < count($evtOut); $i++) { |
|
680 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
681 | + if (is_array($evtOut)) { |
|
682 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
683 | 683 | $editor = $evtOut[$i]; |
684 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
684 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
685 | 685 | } |
686 | 686 | } |
687 | 687 | ?> |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | <?php |
720 | 720 | // invoke OnInterfaceSettingsRender event |
721 | 721 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
722 | - if(is_array($evtOut)) { |
|
722 | + if (is_array($evtOut)) { |
|
723 | 723 | echo implode("", $evtOut); |
724 | 724 | } |
725 | 725 | ?> |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | function BrowseServer() { |
747 | 747 | var w = screen.width * 0.7; |
748 | 748 | var h = screen.height * 0.7; |
749 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
749 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
750 | 750 | } |
751 | 751 | |
752 | 752 | function SetUrl(url, width, height, alt) { |
@@ -769,17 +769,17 @@ discard block |
||
769 | 769 | </tr> |
770 | 770 | </table> |
771 | 771 | </div> |
772 | - <?php if($modx->getConfig('use_udperms')) { |
|
772 | + <?php if ($modx->getConfig('use_udperms')) { |
|
773 | 773 | |
774 | 774 | $groupsarray = array(); |
775 | 775 | |
776 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
776 | + if ($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
777 | 777 | $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
778 | 778 | $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
779 | 779 | } |
780 | 780 | // retain selected doc groups between post |
781 | - if(is_array($_POST['user_groups'])) { |
|
782 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
781 | + if (is_array($_POST['user_groups'])) { |
|
782 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
783 | 783 | } |
784 | 784 | ?> |
785 | 785 | <div class="tab-page" id="tabAccess"> |
@@ -788,8 +788,8 @@ discard block |
||
788 | 788 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
789 | 789 | <?php |
790 | 790 | $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
791 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
792 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
791 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
792 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | ?> |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
803 | 803 | "id" => $user |
804 | 804 | )); |
805 | - if(is_array($evtOut)) { |
|
805 | + if (is_array($evtOut)) { |
|
806 | 806 | echo implode("", $evtOut); |
807 | 807 | } |
808 | 808 | ?> |
@@ -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 | -switch ((int)$modx->getManagerApi()->action) { |
|
6 | +switch ((int) $modx->getManagerApi()->action) { |
|
7 | 7 | case 35: |
8 | 8 | if (!$modx->hasPermission('edit_role')) { |
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getDatabase()->getFullTableName('user_roles'); |
24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= ManagerTheme::getStyle('actionbuttons.dynamic.savedelete') ?> |
@@ -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('bk_manager')) { |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | $dbase = $modx->getDatabase()->getConfig('database'); |
10 | 10 | |
11 | 11 | if (!$modx->getConfig('snapshot_path')) { |
12 | - if (is_dir(MODX_BASE_PATH . 'temp/backup/')) { |
|
13 | - $modx->setConfig('snapshot_path', MODX_BASE_PATH . 'temp/backup/'); |
|
12 | + if (is_dir(MODX_BASE_PATH.'temp/backup/')) { |
|
13 | + $modx->setConfig('snapshot_path', MODX_BASE_PATH.'temp/backup/'); |
|
14 | 14 | } else { |
15 | - $modx->setConfig('snapshot_path', MODX_BASE_PATH . 'assets/backup/'); |
|
15 | + $modx->setConfig('snapshot_path', MODX_BASE_PATH.'assets/backup/'); |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if ($mode == 'restore1') { |
24 | 24 | if (isset($_POST['textarea']) && !empty($_POST['textarea'])) { |
25 | 25 | $source = trim($_POST['textarea']); |
26 | - $_SESSION['textarea'] = $source . "\n"; |
|
26 | + $_SESSION['textarea'] = $source."\n"; |
|
27 | 27 | } else { |
28 | 28 | $source = file_get_contents($_FILES['sqlfile']['tmp_name']); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | header('Location: index.php?r=9&a=93'); |
32 | 32 | exit; |
33 | 33 | } elseif ($mode == 'restore2') { |
34 | - $path = $modx->getConfig('snapshot_path') . $_POST['filename']; |
|
34 | + $path = $modx->getConfig('snapshot_path').$_POST['filename']; |
|
35 | 35 | if (file_exists($path)) { |
36 | 36 | $source = file_get_contents($path); |
37 | 37 | import_sql($source); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!is_writable(rtrim($modx->getConfig(snapshot_path), '/'))) { |
78 | 78 | $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->getConfig(snapshot_path)))); |
79 | 79 | } |
80 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->getConfig('prefix')) . "%'"; |
|
80 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->getDatabase()->escape($modx->getDatabase()->getConfig('prefix'))."%'"; |
|
81 | 81 | $rs = $modx->getDatabase()->query($sql); |
82 | 82 | $tables = $modx->getDatabase()->getColumn('Name', $rs); |
83 | 83 | $today = date('Y-m-d_H-i-s'); |
@@ -109,18 +109,18 @@ discard block |
||
109 | 109 | $modx->webAlertAndQuit('Unable to Backup Database'); |
110 | 110 | } |
111 | 111 | } else { |
112 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; // start normal header |
|
112 | + include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { |
116 | 116 | switch ($_SESSION['result_msg']) { |
117 | 117 | case 'import_ok': |
118 | - $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
119 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
118 | + $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
119 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
120 | 120 | break; |
121 | 121 | case 'snapshot_ok': |
122 | 122 | $ph['result_msg_import'] = ''; |
123 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>'; |
|
123 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>'; |
|
124 | 124 | break; |
125 | 125 | } |
126 | 126 | $_SESSION['result_msg'] = ''; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | f.style.display = 'none'; |
180 | 180 | } |
181 | 181 | } |
182 | - <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?> |
|
182 | + <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?> |
|
183 | 183 | |
184 | 184 | </script> |
185 | 185 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | </thead> |
224 | 224 | <tbody> |
225 | 225 | <?php |
226 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->getConfig('prefix')) . "%'"; |
|
226 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->getDatabase()->escape($modx->getDatabase()->getConfig('prefix'))."%'"; |
|
227 | 227 | $rs = $modx->getDatabase()->query($sql); |
228 | 228 | $i = 0; |
229 | 229 | $total = 0; |
@@ -235,29 +235,29 @@ discard block |
||
235 | 235 | $table_string = ''; |
236 | 236 | } |
237 | 237 | |
238 | - echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n"; |
|
239 | - echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n"; |
|
240 | - echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n"; |
|
241 | - echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n"; |
|
238 | + echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n"; |
|
239 | + echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n"; |
|
240 | + echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n"; |
|
241 | + echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n"; |
|
242 | 242 | |
243 | 243 | // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty |
244 | 244 | $truncateable = array( |
245 | - $modx->getDatabase()->getConfig('prefix') . 'event_log', |
|
246 | - $modx->getDatabase()->getConfig('prefix') . 'manager_log', |
|
245 | + $modx->getDatabase()->getConfig('prefix').'event_log', |
|
246 | + $modx->getDatabase()->getConfig('prefix').'manager_log', |
|
247 | 247 | ); |
248 | 248 | if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { |
249 | - echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n"; |
|
249 | + echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n"; |
|
250 | 250 | } else { |
251 | - echo '<td class="text-xs-right">' . nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n"; |
|
251 | + echo '<td class="text-xs-right">'.nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | if ($modx->hasPermission('settings')) { |
255 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n"; |
|
255 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n"; |
|
256 | 256 | } else { |
257 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? nicesize($db_status['Data_free']) : '-') . '</td>' . "\n"; |
|
257 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? nicesize($db_status['Data_free']) : '-').'</td>'."\n"; |
|
258 | 258 | } |
259 | 259 | |
260 | - echo '<td class="text-xs-right">' . nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>"; |
|
260 | + echo '<td class="text-xs-right">'.nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>"; |
|
261 | 261 | |
262 | 262 | $total += $db_status['Index_length'] + $db_status['Data_length']; |
263 | 263 | $totaloverhead += $db_status['Data_free']; |
@@ -268,9 +268,9 @@ discard block |
||
268 | 268 | <tr> |
269 | 269 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
270 | 270 | <td colspan="4"> </td> |
271 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td> |
|
271 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td> |
|
272 | 272 | <td colspan="2"> </td> |
273 | - <td class="text-xs-right"><?= "<b>" . nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
273 | + <td class="text-xs-right"><?= "<b>".nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
274 | 274 | </tr> |
275 | 275 | </tfoot> |
276 | 276 | </table> |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | foreach ($last_result['0'] as $k => $v) { |
322 | 322 | $title[] = $k; |
323 | 323 | } |
324 | - $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>'; |
|
324 | + $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>'; |
|
325 | 325 | $result .= '<tbody>'; |
326 | 326 | foreach ($last_result as $row) { |
327 | 327 | $result_value = array(); |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | foreach ($row as $k => $v) { |
330 | 330 | $result_value[] = $v; |
331 | 331 | } |
332 | - $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>'; |
|
332 | + $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>'; |
|
333 | 333 | } |
334 | 334 | } |
335 | 335 | $result .= '</tbody>'; |
336 | - $result = '<table class="table data">' . $result . '</table>'; |
|
336 | + $result = '<table class="table data">'.$result.'</table>'; |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | while ($count < 11) { |
436 | 436 | $line = fgets($file); |
437 | 437 | foreach ($detailFields as $label) { |
438 | - $fileLabel = '# ' . $label; |
|
438 | + $fileLabel = '# '.$label; |
|
439 | 439 | if (strpos($line, $fileLabel) !== false) { |
440 | 440 | $details[$label] = htmlentities(trim(str_replace(array( |
441 | 441 | $fileLabel, |
@@ -448,10 +448,10 @@ discard block |
||
448 | 448 | }; |
449 | 449 | fclose($file); |
450 | 450 | |
451 | - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; |
|
452 | - $tooltip .= "Server version: " . $details["Server version"] . "\n"; |
|
453 | - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; |
|
454 | - $tooltip .= "Host: " . $details["Host"] . "\n"; |
|
451 | + $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; |
|
452 | + $tooltip .= "Server version: ".$details["Server version"]."\n"; |
|
453 | + $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; |
|
454 | + $tooltip .= "Host: ".$details["Host"]."\n"; |
|
455 | 455 | ?> |
456 | 456 | <tr> |
457 | 457 | <td><?= $filename ?></td> |
@@ -483,10 +483,10 @@ discard block |
||
483 | 483 | <?php |
484 | 484 | |
485 | 485 | if (is_numeric($_GET['tab'])) { |
486 | - echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
486 | + echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
487 | 487 | } |
488 | 488 | |
489 | -include_once MODX_MANAGER_PATH . "includes/footer.inc.php"; // send footer |
|
489 | +include_once MODX_MANAGER_PATH."includes/footer.inc.php"; // send footer |
|
490 | 490 | ?> |
491 | 491 | |
492 | 492 | <?php |
@@ -1,13 +1,13 @@ 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 | |
10 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
10 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
11 | 11 | |
12 | 12 | // Get table names (alphabetical) |
13 | 13 | $tbl_active_users = $modx->getDatabase()->getFullTableName('active_users'); |
@@ -24,41 +24,41 @@ discard block |
||
24 | 24 | $modx->getManagerApi()->initPageViewState(); |
25 | 25 | |
26 | 26 | // check to see the editor isn't locked |
27 | -$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
28 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
27 | +$rs = $modx->getDatabase()->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
28 | +if ($username = $modx->getDatabase()->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->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
61 | - foreach($opids as $opid) { |
|
60 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'"); |
|
61 | + foreach ($opids as $opid) { |
|
62 | 62 | $modx->getDatabase()->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->getDatabase()->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
75 | + $ds = $modx->getDatabase()->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->getDatabase()->getRow($ds)) { |
|
80 | - if($row['type'] == '30') { |
|
79 | + while ($row = $modx->getDatabase()->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->getDatabase()->select('guid', $tbl_site_modules, "id='{$id}'"); |
89 | 89 | $guid = $modx->getDatabase()->getValue($ds); |
90 | 90 | // reset moduleguid for deleted resources |
91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
92 | - if($cp) { |
|
93 | - $modx->getDatabase()->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->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'"); |
|
94 | 94 | } |
95 | - if($cs) { |
|
96 | - $modx->getDatabase()->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
95 | + if ($cs) { |
|
96 | + $modx->getDatabase()->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->getDatabase()->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
101 | + $modx->getDatabase()->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")"); |
|
102 | 102 | break; |
103 | 103 | } |
104 | 104 | |
105 | 105 | // load record |
106 | 106 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id = '{$id}'"); |
107 | 107 | $content = $modx->getDatabase()->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 ManagerTheme::getStyle('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 /> |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $grd->columnHeaderClass = "gridHeader"; |
225 | 225 | $grd->itemClass = "gridItem"; |
226 | 226 | $grd->altItemClass = "gridAltItem"; |
227 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
227 | + $grd->columns = $_lang["element_name"]." ,".$_lang["type"]; |
|
228 | 228 | $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
229 | 229 | $grd->fields = "name,type"; |
230 | 230 | echo $grd->render(); |
@@ -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->getManagerApi()->action) { |
|
6 | +switch ($modx->getManagerApi()->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; |
@@ -18,34 +18,34 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
26 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
25 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
26 | +if ($username = $modx->getDatabase()->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->getManagerApi()->action == '88') { |
|
31 | +if ($modx->getManagerApi()->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | 43 | extract($usersettings, EXTR_OVERWRITE); |
44 | 44 | |
45 | 45 | // get user name |
46 | 46 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 47 | $usernamedata = $modx->getDatabase()->getRow($rs); |
48 | - if(!$usernamedata) { |
|
48 | + if (!$usernamedata) { |
|
49 | 49 | $modx->webAlertAndQuit("No user returned while getting username!"); |
50 | 50 | } |
51 | 51 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | -foreach($userdata as $key => $val) { |
|
60 | +foreach ($userdata as $key => $val) { |
|
61 | 61 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
62 | 62 | }; |
63 | 63 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 64 | |
65 | 65 | // restore saved form |
66 | 66 | $formRestored = false; |
67 | -if($modx->getManagerApi()->hasFormValues()) { |
|
67 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
68 | 68 | $modx->getManagerApi()->loadFormValues(); |
69 | 69 | // restore post values |
70 | 70 | $userdata = array_merge($userdata, $_POST); |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | |
79 | 79 | // include the country list language file |
80 | 80 | $_country_lang = array(); |
81 | -if($manager_language != "english" && file_exists(MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
82 | - include_once MODX_MANAGER_PATH . "includes/lang/country/" . $manager_language . "_country.inc.php"; |
|
81 | +if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
82 | + include_once MODX_MANAGER_PATH."includes/lang/country/".$manager_language."_country.inc.php"; |
|
83 | 83 | } else { |
84 | - include_once MODX_MANAGER_PATH . "includes/lang/country/english_country.inc.php"; |
|
84 | + include_once MODX_MANAGER_PATH."includes/lang/country/english_country.inc.php"; |
|
85 | 85 | } |
86 | 86 | asort($_country_lang); |
87 | 87 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <?php |
192 | 192 | // invoke OnWUsrFormPrerender event |
193 | 193 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
194 | - if(is_array($evtOut)) { |
|
194 | + if (is_array($evtOut)) { |
|
195 | 195 | echo implode("", $evtOut); |
196 | 196 | } |
197 | 197 | ?> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <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" ?>" /> |
201 | 201 | |
202 | 202 | <h1> |
203 | - <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['web_user_title']) ?> |
|
203 | + <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['web_user_title']) ?> |
|
204 | 204 | </h1> |
205 | 205 | |
206 | 206 | <?= ManagerTheme::getStyle('actionbuttons.dynamic.user') ?> |
@@ -218,13 +218,13 @@ discard block |
||
218 | 218 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
219 | 219 | <tr> |
220 | 220 | <td colspan="3"><span id="blocked" class="warning"> |
221 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
221 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
222 | 222 | <b><?php echo $_lang['user_is_blocked']; ?></b> |
223 | 223 | <?php } ?> |
224 | 224 | </span> |
225 | 225 | <br /></td> |
226 | 226 | </tr> |
227 | - <?php if(!empty($userdata['id'])) { ?> |
|
227 | + <?php if (!empty($userdata['id'])) { ?> |
|
228 | 228 | <tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
229 | 229 | <th><?php echo $_lang['username']; ?>:</th> |
230 | 230 | <td> </td> |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
240 | 240 | </tr> |
241 | 241 | <tr> |
242 | - <th><?php echo $modx->getManagerApi()->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
242 | + <th><?php echo $modx->getManagerApi()->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
243 | 243 | <td> </td> |
244 | 244 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "87" ? " checked disabled" : ""; ?>> |
245 | 245 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -326,8 +326,8 @@ discard block |
||
326 | 326 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
327 | 327 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
328 | 328 | <?php |
329 | - foreach($_country_lang as $key => $country) { |
|
330 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
329 | + foreach ($_country_lang as $key => $country) { |
|
330 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
331 | 331 | } |
332 | 332 | ?> |
333 | 333 | </select></td> |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | <td> </td> |
354 | 354 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> |
355 | 355 | </tr> |
356 | - <?php if($modx->getManagerApi()->action == '88') { ?> |
|
356 | + <?php if ($modx->getManagerApi()->action == '88') { ?> |
|
357 | 357 | <tr> |
358 | 358 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
359 | 359 | <td> </td> |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | function BrowseServer() { |
475 | 475 | var w = screen.width * 0.7; |
476 | 476 | var h = screen.height * 0.7; |
477 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
477 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
478 | 478 | } |
479 | 479 | |
480 | 480 | function SetUrl(url, width, height, alt) { |
@@ -493,22 +493,22 @@ discard block |
||
493 | 493 | <td class='comment'><?php echo $_lang["user_photo_message"] ?></td> |
494 | 494 | </tr> |
495 | 495 | <tr> |
496 | - <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "") . $_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "") . $userdata['photo'] : $_style["tx"]; ?>" /></td> |
|
496 | + <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "").$_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "").$userdata['photo'] : $_style["tx"]; ?>" /></td> |
|
497 | 497 | </tr> |
498 | 498 | </table> |
499 | 499 | </div> |
500 | 500 | <?php |
501 | - if($modx->getConfig('use_udperms')) { |
|
501 | + if ($modx->getConfig('use_udperms')) { |
|
502 | 502 | |
503 | 503 | $groupsarray = array(); |
504 | 504 | |
505 | - if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
505 | + if ($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
506 | 506 | $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
507 | 507 | $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
508 | 508 | } |
509 | 509 | // retain selected user groups between post |
510 | - if(is_array($_POST['user_groups'])) { |
|
511 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | + if (is_array($_POST['user_groups'])) { |
|
511 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
512 | 512 | } |
513 | 513 | ?> |
514 | 514 | <div class="tab-page" id="tabPermissions"> |
@@ -517,8 +517,8 @@ discard block |
||
517 | 517 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
518 | 518 | <?php |
519 | 519 | $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
520 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
521 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
520 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
521 | + echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />'; |
|
522 | 522 | } |
523 | 523 | } |
524 | 524 | ?> |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
529 | 529 | "id" => $user |
530 | 530 | )); |
531 | - if(is_array($evtOut)) { |
|
531 | + if (is_array($evtOut)) { |
|
532 | 532 | echo implode("", $evtOut); |
533 | 533 | } |
534 | 534 | ?> |
@@ -1,12 +1,12 @@ 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('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | |
12 | 12 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $templatename = ''; |
20 | 20 | |
21 | 21 | if (isset($_POST['listSubmitted'])) { |
22 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
22 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
23 | 23 | foreach ($_POST as $listName => $listValue) { |
24 | 24 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
25 | 25 | continue; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | while ($row = $modx->getDatabase()->getRow($rs)) { |
48 | 48 | $templatename = $row['templatename']; |
49 | 49 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
50 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
50 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
51 | 51 | } |
52 | 52 | $sortableList .= '</ul></div>'; |
53 | 53 | } else { |
54 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
54 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | </script> |
129 | 129 | |
130 | 130 | <h1> |
131 | - <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?> |
|
131 | + <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?> |
|
132 | 132 | </h1> |
133 | 133 | |
134 | 134 | <?= ManagerTheme::getStyle('actionbuttons.dynamic.save') ?> |
@@ -1,18 +1,18 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | define('MODX_API_MODE', true); |
3 | 3 | |
4 | -if (file_exists(__DIR__ . '/config.php')) { |
|
5 | - $config = require __DIR__ . '/config.php'; |
|
6 | -} elseif (file_exists(dirname(__DIR__) . '/config.php')) { |
|
7 | - $config = require dirname(__DIR__) . '/config.php'; |
|
4 | +if (file_exists(__DIR__.'/config.php')) { |
|
5 | + $config = require __DIR__.'/config.php'; |
|
6 | +} elseif (file_exists(dirname(__DIR__).'/config.php')) { |
|
7 | + $config = require dirname(__DIR__).'/config.php'; |
|
8 | 8 | } else { |
9 | 9 | $config = [ |
10 | 10 | 'root' => dirname(__DIR__) |
11 | 11 | ]; |
12 | 12 | } |
13 | 13 | |
14 | -if (!empty($config['root']) && file_exists($config['root']. '/index.php')) { |
|
15 | - require_once $config['root'] . '/index.php'; |
|
14 | +if (!empty($config['root']) && file_exists($config['root'].'/index.php')) { |
|
15 | + require_once $config['root'].'/index.php'; |
|
16 | 16 | } else { |
17 | 17 | echo "<h3>Unable to load configuration settings</h3>"; |
18 | 18 | echo "Please run the EVO <a href='../install'>install utility</a>"; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $modx->getSettings(); |
24 | 24 | |
25 | 25 | $modx->documentMethod = 'id'; |
26 | -$modx->documentIdentifier = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 1; |
|
26 | +$modx->documentIdentifier = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 1; |
|
27 | 27 | $modx->documentObject = $modx->getDocumentObject('id', $modx->documentIdentifier); |
28 | 28 | |
29 | 29 | $modx->invokeEvent('OnWebPageInit'); |
@@ -44,33 +44,33 @@ discard block |
||
44 | 44 | * Initialize Document Parsing |
45 | 45 | * ----------------------------- |
46 | 46 | */ |
47 | -if (! isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
47 | +if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
48 | 48 | $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
49 | 49 | } |
50 | 50 | $mstart = memory_get_usage(); |
51 | 51 | |
52 | 52 | $config = [ |
53 | - 'core' => __DIR__ . '/core', |
|
54 | - 'manager' => __DIR__ . '/manager', |
|
53 | + 'core' => __DIR__.'/core', |
|
54 | + 'manager' => __DIR__.'/manager', |
|
55 | 55 | 'root' => __DIR__ |
56 | 56 | ]; |
57 | 57 | |
58 | -if (file_exists(__DIR__ . '/config.php')) { |
|
59 | - $config = array_merge($config, require __DIR__ . '/config.php'); |
|
58 | +if (file_exists(__DIR__.'/config.php')) { |
|
59 | + $config = array_merge($config, require __DIR__.'/config.php'); |
|
60 | 60 | } |
61 | -if (! file_exists($config['core'] . '/bootstrap.php')) { |
|
62 | - $path = __DIR__ . '/install/src/template/not_installed.tpl'; |
|
61 | +if (!file_exists($config['core'].'/bootstrap.php')) { |
|
62 | + $path = __DIR__.'/install/src/template/not_installed.tpl'; |
|
63 | 63 | if (file_exists($path)) { |
64 | 64 | readfile($path); |
65 | 65 | } |
66 | 66 | exit; |
67 | 67 | } |
68 | -require $config['core'] . '/bootstrap.php'; |
|
68 | +require $config['core'].'/bootstrap.php'; |
|
69 | 69 | |
70 | 70 | // set some settings, and address some IE issues |
71 | 71 | @ini_set('url_rewriter.tags', ''); |
72 | 72 | @ini_set('session.use_trans_sid', 0); |
73 | -@ini_set('session.use_only_cookies',1); |
|
73 | +@ini_set('session.use_only_cookies', 1); |
|
74 | 74 | header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE. |
75 | 75 | header('Cache-Control: private, must-revalidate'); |
76 | 76 | ob_start(); |
@@ -81,13 +81,13 @@ discard block |
||
81 | 81 | */ |
82 | 82 | |
83 | 83 | define('IN_PARSER_MODE', true); |
84 | -if (! defined('IN_MANAGER_MODE')) { |
|
84 | +if (!defined('IN_MANAGER_MODE')) { |
|
85 | 85 | define('IN_MANAGER_MODE', false); |
86 | 86 | } |
87 | -if (! defined('MODX_API_MODE')) { |
|
87 | +if (!defined('MODX_API_MODE')) { |
|
88 | 88 | define('MODX_API_MODE', false); |
89 | 89 | } |
90 | -if (! defined('MODX_CLI')) { |
|
90 | +if (!defined('MODX_CLI')) { |
|
91 | 91 | define('MODX_CLI', false); |
92 | 92 | } |
93 | 93 | |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | $modx->stopOnNotice = false; |
107 | 107 | |
108 | 108 | // Don't show PHP errors to the public |
109 | -if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { |
|
110 | - @ini_set("display_errors","0"); |
|
109 | +if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { |
|
110 | + @ini_set("display_errors", "0"); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | if (is_cli()) { |
114 | 114 | @set_time_limit(0); |
115 | - @ini_set('max_execution_time',0); |
|
115 | + @ini_set('max_execution_time', 0); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | // execute the parser if index.php was not included |
@@ -3,24 +3,24 @@ discard block |
||
3 | 3 | * EVO Installer |
4 | 4 | */ |
5 | 5 | error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); |
6 | -$base_path = dirname(__DIR__) . '/'; |
|
6 | +$base_path = dirname(__DIR__).'/'; |
|
7 | 7 | |
8 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
9 | - include_once $base_path . 'assets/cache/siteManager.php'; |
|
8 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
9 | + include_once $base_path.'assets/cache/siteManager.php'; |
|
10 | 10 | } |
11 | -if (! defined('MGR_DIR')) { |
|
12 | - if (is_dir($base_path . 'manager')) { |
|
11 | +if (!defined('MGR_DIR')) { |
|
12 | + if (is_dir($base_path.'manager')) { |
|
13 | 13 | define('MGR_DIR', 'manager'); |
14 | 14 | } else { |
15 | 15 | die('MGR_DIR is not defined'); |
16 | 16 | } |
17 | 17 | } |
18 | 18 | if (!defined('MODX_MANAGER_PATH')) { |
19 | - define('MODX_MANAGER_PATH', $base_path . MGR_DIR . '/'); |
|
19 | + define('MODX_MANAGER_PATH', $base_path.MGR_DIR.'/'); |
|
20 | 20 | } |
21 | -if (! defined('EVO_CORE_PATH')) { |
|
22 | - if (is_dir($base_path . 'core')) { |
|
23 | - define('EVO_CORE_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR); |
|
21 | +if (!defined('EVO_CORE_PATH')) { |
|
22 | + if (is_dir($base_path.'core')) { |
|
23 | + define('EVO_CORE_PATH', dirname(__DIR__).DIRECTORY_SEPARATOR.'core'.DIRECTORY_SEPARATOR); |
|
24 | 24 | } else { |
25 | 25 | die('EVO_CORE_PATH is not defined'); |
26 | 26 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | require_once 'src/functions.php'; |
30 | 30 | |
31 | 31 | if (empty($_GET['self'])) { |
32 | - require_once '../' . MGR_DIR . '/includes/version.inc.php'; |
|
32 | + require_once '../'.MGR_DIR.'/includes/version.inc.php'; |
|
33 | 33 | |
34 | 34 | // start session |
35 | 35 | session_start(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | install_sessionCheck(); |
38 | 38 | |
39 | 39 | $moduleName = 'EVO'; |
40 | - $moduleVersion = $modx_branch . ' ' . $modx_version; |
|
40 | + $moduleVersion = $modx_branch.' '.$modx_version; |
|
41 | 41 | $moduleRelease = $modx_release_date; |
42 | 42 | $moduleSQLBaseFile = 'stubs/sql/setup.sql'; |
43 | 43 | $moduleSQLDataFile = 'stubs/sql/setup.data.sql'; |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $action = isset($_GET['action']) ? trim(strip_tags($_GET['action'])) : 'language'; |
79 | 79 | str_replace('.', '', $action); |
80 | 80 | |
81 | - $controller = 'src/controllers/' . $action . '.php'; |
|
82 | - if (! file_exists($controller)) { |
|
81 | + $controller = 'src/controllers/'.$action.'.php'; |
|
82 | + if (!file_exists($controller)) { |
|
83 | 83 | die("Invalid install action attempted. [action={$action}]"); |
84 | 84 | } |
85 | 85 | require $controller; |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | } else { |
92 | 92 | $action = isset($_GET['action']) && is_scalar($_GET['action']) ? trim($_GET['action']) : 'language'; |
93 | 93 | str_replace('.', '', $action); |
94 | - $controller = 'src/controllers/' . $action . '.php'; |
|
95 | - if (! file_exists($controller)) { |
|
94 | + $controller = 'src/controllers/'.$action.'.php'; |
|
95 | + if (!file_exists($controller)) { |
|
96 | 96 | die("Invalid install action attempted. [action={$action}]"); |
97 | 97 | } |
98 | 98 | require $controller; |