@@ -1,17 +1,17 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) { |
|
| 5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // get id |
| 10 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 10 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 11 | 11 | |
| 12 | -$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log") . " el |
|
| 13 | - LEFT JOIN " . $modx->getFullTableName("manager_users") . " mu ON mu.id=el.user AND el.usertype=0 |
|
| 14 | - LEFT JOIN " . $modx->getFullTableName("web_users") . " wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
| 12 | +$ds = $modx->db->select('el.*, IFNULL(wu.username,mu.username) as username', $modx->getFullTableName("event_log")." el |
|
| 13 | + LEFT JOIN " . $modx->getFullTableName("manager_users")." mu ON mu.id=el.user AND el.usertype=0 |
|
| 14 | + LEFT JOIN " . $modx->getFullTableName("web_users")." wu ON wu.id=el.user AND el.usertype=1", "el.id='{$id}'"); |
|
| 15 | 15 | $content = $modx->db->getRow($ds); |
| 16 | 16 | |
| 17 | 17 | ?> |
@@ -42,18 +42,18 @@ discard block |
||
| 42 | 42 | <div class="container container-body"> |
| 43 | 43 | <?php |
| 44 | 44 | $date = $modx->toDateFormat($content["createdon"]); |
| 45 | - if($content["type"] == 1) { |
|
| 46 | - $icon = $_style['actions_info'] . ' text-info'; |
|
| 45 | + if ($content["type"] == 1) { |
|
| 46 | + $icon = $_style['actions_info'].' text-info'; |
|
| 47 | 47 | $msgtype = $_lang["information"]; |
| 48 | - } else if($content["type"] == 2) { |
|
| 49 | - $icon = $_style['actions_triangle'] . ' text-warning'; |
|
| 48 | + } else if ($content["type"] == 2) { |
|
| 49 | + $icon = $_style['actions_triangle'].' text-warning'; |
|
| 50 | 50 | $msgtype = $_lang["warning"]; |
| 51 | - } else if($content["type"] == 3) { |
|
| 52 | - $icon = $_style['actions_error'] . ' text-danger'; |
|
| 51 | + } else if ($content["type"] == 3) { |
|
| 52 | + $icon = $_style['actions_error'].' text-danger'; |
|
| 53 | 53 | $msgtype = $_lang["error"]; |
| 54 | 54 | } |
| 55 | 55 | ?> |
| 56 | - <p><b><?= $content['source'] . " - " . $_lang['eventlog_viewer'] ?></b></p> |
|
| 56 | + <p><b><?= $content['source']." - ".$_lang['eventlog_viewer'] ?></b></p> |
|
| 57 | 57 | <p> |
| 58 | 58 | <i class="<?= $icon ?>"></i> <?= $msgtype ?> |
| 59 | 59 | </p> |
@@ -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 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | // Get table names (alphabetical) |
| 24 | 24 | $tbl_site_htmlsnippets = $modx->getFullTableName('site_htmlsnippets'); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $content['name'] = $_REQUEST['itemname']; |
| 48 | 48 | } else { |
| 49 | 49 | $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; |
| 50 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 50 | + $content['category'] = (int) $_REQUEST['catid']; |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | if ($modx->manager->hasFormValues()) { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | // Add lock-element JS-Script |
| 66 | 66 | $lockElementId = $id; |
| 67 | 67 | $lockElementType = 3; |
| 68 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 68 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 69 | 69 | |
| 70 | 70 | // Print RTE Javascript function |
| 71 | 71 | ?> |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>" /> |
| 137 | 137 | |
| 138 | 138 | <h1> |
| 139 | - <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
| 139 | + <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
| 140 | 140 | </h1> |
| 141 | 141 | |
| 142 | 142 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | <div class="form-control-name clearfix"> |
| 161 | 161 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 162 | 162 | <?php if ($modx->hasPermission('save_role')): ?> |
| 163 | - <label class="custom-control" title="<?= $_lang['lock_htmlsnippet'] . "\n" . $_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
| 163 | + <label class="custom-control" title="<?= $_lang['lock_htmlsnippet']."\n".$_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
| 164 | 164 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 || $content['locked'] == 'on' ? ' checked="checked"' : '') ?> /> |
| 165 | 165 | <i class="fa fa-lock"></i> |
| 166 | 166 | </label> |
@@ -184,9 +184,9 @@ discard block |
||
| 184 | 184 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 185 | 185 | <option> </option> |
| 186 | 186 | <?php |
| 187 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 187 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 188 | 188 | foreach (getCategories() as $n => $v) { |
| 189 | - echo "\t\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
| 189 | + echo "\t\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n"; |
|
| 190 | 190 | } |
| 191 | 191 | ?> |
| 192 | 192 | </select> |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | </div> |
| 201 | 201 | <?php if ($_SESSION['mgrRole'] == 1): ?> |
| 202 | 202 | <div class="form-row"> |
| 203 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label> |
|
| 203 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label> |
|
| 204 | 204 | </div> |
| 205 | 205 | <?php endif; ?> |
| 206 | 206 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister'); |
| 217 | 217 | if (is_array($evtOut)) { |
| 218 | 218 | foreach ($evtOut as $i => $editor) { |
| 219 | - echo "\t" . '<option value="' . $editor . '"' . ($which_editor == $editor ? ' selected="selected"' : '') . '>' . $editor . "</option>\n"; |
|
| 219 | + echo "\t".'<option value="'.$editor.'"'.($which_editor == $editor ? ' selected="selected"' : '').'>'.$editor."</option>\n"; |
|
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | ?> |
@@ -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('save_document')) { |
@@ -7,13 +7,13 @@ discard block |
||
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | if (isset($_REQUEST['id'])) { |
| 10 | - $id = (int)$_REQUEST['id']; |
|
| 10 | + $id = (int) $_REQUEST['id']; |
|
| 11 | 11 | } else { |
| 12 | 12 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // check permissions on the document |
| 16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 17 | 17 | $udperms = new udperms(); |
| 18 | 18 | $udperms->user = $modx->getLoginUserID(); |
| 19 | 19 | $udperms->document = $id; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | }, |
| 40 | 40 | cancel: function() { |
| 41 | 41 | documentDirty = false; |
| 42 | - <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id=' . $id . '";') ?> |
|
| 42 | + <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id='.$id.'";') ?> |
|
| 43 | 43 | } |
| 44 | 44 | }; |
| 45 | 45 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | </script> |
| 81 | 81 | |
| 82 | 82 | <h1> |
| 83 | - <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['move_resource_title']) ?> |
|
| 83 | + <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['move_resource_title']) ?> |
|
| 84 | 84 | </h1> |
| 85 | 85 | |
| 86 | 86 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -switch($modx->manager->action) {
|
|
| 6 | +switch ($modx->manager->action) {
|
|
| 7 | 7 | case 12: |
| 8 | - if(!$modx->hasPermission('edit_user')) {
|
|
| 8 | + if (!$modx->hasPermission('edit_user')) {
|
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 10 | 10 | } |
| 11 | 11 | break; |
| 12 | 12 | case 11: |
| 13 | - if(!$modx->hasPermission('new_user')) {
|
|
| 13 | + if (!$modx->hasPermission('new_user')) {
|
|
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 15 | 15 | } |
| 16 | 16 | break; |
@@ -18,20 +18,20 @@ 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->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
|
|
| 25 | -if($username = $modx->db->getValue($rs)) {
|
|
| 24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'");
|
|
| 25 | +if ($username = $modx->db->getValue($rs)) {
|
|
| 26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
| 27 | 27 | } |
| 28 | 28 | // end check for lock |
| 29 | 29 | |
| 30 | -if($modx->manager->action == '12') {
|
|
| 30 | +if ($modx->manager->action == '12') {
|
|
| 31 | 31 | // get user attribute |
| 32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'");
|
| 33 | 33 | $userdata = $modx->db->getRow($rs); |
| 34 | - if(!$userdata) {
|
|
| 34 | + if (!$userdata) {
|
|
| 35 | 35 | $modx->webAlertAndQuit("No user returned!");
|
| 36 | 36 | } |
| 37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | // get user settings |
| 40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'");
|
| 41 | 41 | $usersettings = array(); |
| 42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 43 | 43 | // manually extract so that user display settings are not overwritten |
| 44 | - foreach($usersettings as $k => $v) {
|
|
| 45 | - if($k != 'manager_language' && $k != 'manager_theme') {
|
|
| 44 | + foreach ($usersettings as $k => $v) {
|
|
| 45 | + if ($k != 'manager_language' && $k != 'manager_theme') {
|
|
| 46 | 46 | ${$k} = $v;
|
| 47 | 47 | } |
| 48 | 48 | } |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | // get user name |
| 51 | 51 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'");
|
| 52 | 52 | $usernamedata = $modx->db->getRow($rs); |
| 53 | - if(!$usernamedata) {
|
|
| 53 | + if (!$usernamedata) {
|
|
| 54 | 54 | $modx->webAlertAndQuit("No user returned while getting username!");
|
| 55 | 55 | } |
| 56 | 56 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
| 65 | -foreach($userdata as $key => $val) {
|
|
| 65 | +foreach ($userdata as $key => $val) {
|
|
| 66 | 66 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
| 67 | 67 | }; |
| 68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
| 69 | 69 | |
| 70 | 70 | // restore saved form |
| 71 | 71 | $formRestored = false; |
| 72 | -if($modx->manager->hasFormValues()) {
|
|
| 72 | +if ($modx->manager->hasFormValues()) {
|
|
| 73 | 73 | $modx->manager->loadFormValues(); |
| 74 | 74 | // restore post values |
| 75 | 75 | $userdata = array_merge($userdata, $_POST); |
@@ -84,13 +84,13 @@ discard block |
||
| 84 | 84 | // include the country list language file |
| 85 | 85 | $_country_lang = array(); |
| 86 | 86 | include_once "lang/country/english_country.inc.php"; |
| 87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
|
|
| 88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 87 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
|
|
| 88 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
| 89 | 89 | } |
| 90 | 90 | asort($_country_lang); |
| 91 | 91 | |
| 92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
| 93 | -if($which_browser == 'default') {
|
|
| 93 | +if ($which_browser == 'default') {
|
|
| 94 | 94 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
| 95 | 95 | } |
| 96 | 96 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | document.userform.save.click(); |
| 183 | 183 | }, |
| 184 | 184 | delete: function() {
|
| 185 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
|
|
| 185 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
|
|
| 186 | 186 | alert("<?php echo $_lang['alert_delete_self']; ?>");
|
| 187 | 187 | <?php } else { ?>
|
| 188 | 188 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) {
|
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array(
|
| 206 | 206 | "id" => $user |
| 207 | 207 | )); |
| 208 | - if(is_array($evtOut)) {
|
|
| 208 | + if (is_array($evtOut)) {
|
|
| 209 | 209 | echo implode("", $evtOut);
|
| 210 | 210 | } |
| 211 | 211 | ?> |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
| 215 | 215 | |
| 216 | 216 | <h1> |
| 217 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?>
|
|
| 217 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?>
|
|
| 218 | 218 | </h1> |
| 219 | 219 | |
| 220 | 220 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -232,13 +232,13 @@ discard block |
||
| 232 | 232 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
| 233 | 233 | <tr> |
| 234 | 234 | <td colspan="3"><span id="blocked" class="warning"> |
| 235 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
|
|
| 235 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?>
|
|
| 236 | 236 | <?php echo $_lang['user_is_blocked']; ?> |
| 237 | 237 | <?php } ?> |
| 238 | 238 | </span> |
| 239 | 239 | <br /></td> |
| 240 | 240 | </tr> |
| 241 | - <?php if(!empty($userdata['id'])) { ?>
|
|
| 241 | + <?php if (!empty($userdata['id'])) { ?>
|
|
| 242 | 242 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
| 243 | 243 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
| 244 | 244 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
| 252 | 252 | </tr> |
| 253 | 253 | <tr> |
| 254 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
| 254 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
| 255 | 255 | <td> </td> |
| 256 | 256 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> |
| 257 | 257 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -305,8 +305,8 @@ discard block |
||
| 305 | 305 | ?> |
| 306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
| 307 | 307 | <?php |
| 308 | - while($row = $modx->db->getRow($rs)) {
|
|
| 309 | - if($modx->manager->action == '11') {
|
|
| 308 | + while ($row = $modx->db->getRow($rs)) {
|
|
| 309 | + if ($modx->manager->action == '11') {
|
|
| 310 | 310 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
| 311 | 311 | } else {
|
| 312 | 312 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -360,8 +360,8 @@ discard block |
||
| 360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
| 361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
| 362 | 362 | <?php |
| 363 | - foreach($_country_lang as $key => $country) {
|
|
| 364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 363 | + foreach ($_country_lang as $key => $country) {
|
|
| 364 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
| 365 | 365 | } |
| 366 | 366 | ?> |
| 367 | 367 | </select></td> |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | <td> </td> |
| 388 | 388 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> |
| 389 | 389 | </tr> |
| 390 | - <?php if($modx->manager->action == '12') { ?>
|
|
| 390 | + <?php if ($modx->manager->action == '12') { ?>
|
|
| 391 | 391 | <tr> |
| 392 | 392 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
| 393 | 393 | <td> </td> |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | </tr> |
| 425 | 425 | <?php } ?> |
| 426 | 426 | </table> |
| 427 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?>
|
|
| 427 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?>
|
|
| 428 | 428 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
| 429 | 429 | <?php } ?> |
| 430 | 430 | </div> |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | <?php |
| 442 | 442 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
| 443 | 443 | $dir = dir("includes/lang");
|
| 444 | - while($file = $dir->read()) {
|
|
| 445 | - if(strpos($file, ".inc.php") > 0) {
|
|
| 444 | + while ($file = $dir->read()) {
|
|
| 445 | + if (strpos($file, ".inc.php") > 0) {
|
|
| 446 | 446 | $endpos = strpos($file, "."); |
| 447 | 447 | $languagename = substr($file, 0, $endpos); |
| 448 | 448 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -529,17 +529,17 @@ discard block |
||
| 529 | 529 | <option value=""></option> |
| 530 | 530 | <?php |
| 531 | 531 | $dir = dir("media/style/");
|
| 532 | - while($file = $dir->read()) {
|
|
| 533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
|
|
| 532 | + while ($file = $dir->read()) {
|
|
| 533 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') {
|
|
| 534 | 534 | $themename = $file; |
| 535 | - if($themename === 'common') {
|
|
| 535 | + if ($themename === 'common') {
|
|
| 536 | 536 | continue; |
| 537 | 537 | } |
| 538 | - $attr = 'value="' . $themename . '" '; |
|
| 539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
|
|
| 538 | + $attr = 'value="'.$themename.'" '; |
|
| 539 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) {
|
|
| 540 | 540 | $attr .= 'selected="selected" '; |
| 541 | 541 | } |
| 542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n";
|
|
| 542 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n";
|
|
| 543 | 543 | } |
| 544 | 544 | } |
| 545 | 545 | $dir->close(); |
@@ -556,12 +556,12 @@ discard block |
||
| 556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
| 557 | 557 | <?php |
| 558 | 558 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
| 560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
|
|
| 559 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
| 560 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) {
|
|
| 561 | 561 | $dir = str_replace('\\', '/', $dir);
|
| 562 | 562 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
| 563 | 563 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 564 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
|
|
| 564 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
|
|
| 565 | 565 | } |
| 566 | 566 | ?> |
| 567 | 567 | </select></td> |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | </tr> |
| 589 | 589 | <tr> |
| 590 | 590 | <td> </td> |
| 591 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
| 591 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
| 592 | 592 | </tr> |
| 593 | 593 | <tr> |
| 594 | 594 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | </tr> |
| 601 | 601 | <tr> |
| 602 | 602 | <td> </td> |
| 603 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
| 603 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
| 604 | 604 | </tr> |
| 605 | 605 | <tr> |
| 606 | 606 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | </tr> |
| 613 | 613 | <tr> |
| 614 | 614 | <td> </td> |
| 615 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
| 615 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
| 616 | 616 | </tr> |
| 617 | 617 | <tr> |
| 618 | 618 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -624,7 +624,7 @@ discard block |
||
| 624 | 624 | </tr> |
| 625 | 625 | <tr> |
| 626 | 626 | <td> </td> |
| 627 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
| 627 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
| 628 | 628 | </tr> |
| 629 | 629 | <tr class='row2'> |
| 630 | 630 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -643,11 +643,11 @@ discard block |
||
| 643 | 643 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
| 644 | 644 | // invoke OnRichTextEditorRegister event |
| 645 | 645 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister");
|
| 646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
| 647 | - if(is_array($evtOut)) {
|
|
| 648 | - for($i = 0; $i < count($evtOut); $i++) {
|
|
| 646 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
| 647 | + if (is_array($evtOut)) {
|
|
| 648 | + for ($i = 0; $i < count($evtOut); $i++) {
|
|
| 649 | 649 | $editor = $evtOut[$i]; |
| 650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
| 650 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
| 651 | 651 | } |
| 652 | 652 | } |
| 653 | 653 | ?> |
@@ -685,7 +685,7 @@ discard block |
||
| 685 | 685 | <?php |
| 686 | 686 | // invoke OnInterfaceSettingsRender event |
| 687 | 687 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender");
|
| 688 | - if(is_array($evtOut)) {
|
|
| 688 | + if (is_array($evtOut)) {
|
|
| 689 | 689 | echo implode("", $evtOut);
|
| 690 | 690 | } |
| 691 | 691 | ?> |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | function BrowseServer() {
|
| 713 | 713 | var w = screen.width * 0.7; |
| 714 | 714 | var h = screen.height * 0.7; |
| 715 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
|
|
| 715 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
|
|
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | function SetUrl(url, width, height, alt) {
|
@@ -735,17 +735,17 @@ discard block |
||
| 735 | 735 | </tr> |
| 736 | 736 | </table> |
| 737 | 737 | </div> |
| 738 | - <?php if($use_udperms == 1) {
|
|
| 738 | + <?php if ($use_udperms == 1) {
|
|
| 739 | 739 | |
| 740 | 740 | $groupsarray = array(); |
| 741 | 741 | |
| 742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited
|
|
| 742 | + if ($modx->manager->action == '12') { // only do this bit if the user is being edited
|
|
| 743 | 743 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'");
|
| 744 | 744 | $groupsarray = $modx->db->getColumn('user_group', $rs);
|
| 745 | 745 | } |
| 746 | 746 | // retain selected doc groups between post |
| 747 | - if(is_array($_POST['user_groups'])) {
|
|
| 748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 747 | + if (is_array($_POST['user_groups'])) {
|
|
| 748 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 749 | 749 | } |
| 750 | 750 | ?> |
| 751 | 751 | <div class="tab-page" id="tabAccess"> |
@@ -754,8 +754,8 @@ discard block |
||
| 754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
| 755 | 755 | <?php |
| 756 | 756 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name');
|
| 757 | - while($row = $modx->db->getRow($rs)) {
|
|
| 758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
| 757 | + while ($row = $modx->db->getRow($rs)) {
|
|
| 758 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
| 759 | 759 | } |
| 760 | 760 | } |
| 761 | 761 | ?> |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | $evtOut = $modx->invokeEvent("OnUserFormRender", array(
|
| 769 | 769 | "id" => $user |
| 770 | 770 | )); |
| 771 | - if(is_array($evtOut)) {
|
|
| 771 | + if (is_array($evtOut)) {
|
|
| 772 | 772 | echo implode("", $evtOut);
|
| 773 | 773 | } |
| 774 | 774 | ?> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -switch($modx->manager->action) {
|
|
| 6 | +switch ($modx->manager->action) {
|
|
| 7 | 7 | case 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->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
|
|
| 26 | -if($username = $modx->db->getValue($rs)) {
|
|
| 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)) {
|
|
| 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)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
| 43 | 43 | extract($usersettings, EXTR_OVERWRITE); |
| 44 | 44 | |
| 45 | 45 | // get user name |
| 46 | 46 | $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
|
| 47 | 47 | $usernamedata = $modx->db->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->manager->hasFormValues()) {
|
|
| 67 | +if ($modx->manager->hasFormValues()) {
|
|
| 68 | 68 | $modx->manager->loadFormValues(); |
| 69 | 69 | // restore post values |
| 70 | 70 | $userdata = array_merge($userdata, $_POST); |
@@ -78,8 +78,8 @@ 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->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
|
|
| 82 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 81 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) {
|
|
| 82 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
| 83 | 83 | } else {
|
| 84 | 84 | include_once "lang/country/english_country.inc.php"; |
| 85 | 85 | } |
@@ -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 | <?php echo $_style['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->manager->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
| 229 | 229 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
| 230 | 230 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
| 238 | 238 | </tr> |
| 239 | 239 | <tr> |
| 240 | - <th><?php echo $modx->manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
| 240 | + <th><?php echo $modx->manager->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
| 241 | 241 | <td> </td> |
| 242 | 242 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "87" ? " checked disabled" : ""; ?>> |
| 243 | 243 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -324,8 +324,8 @@ discard block |
||
| 324 | 324 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
| 325 | 325 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
| 326 | 326 | <?php |
| 327 | - foreach($_country_lang as $key => $country) {
|
|
| 328 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 327 | + foreach ($_country_lang as $key => $country) {
|
|
| 328 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
| 329 | 329 | } |
| 330 | 330 | ?> |
| 331 | 331 | </select></td> |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | <td> </td> |
| 352 | 352 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> |
| 353 | 353 | </tr> |
| 354 | - <?php if($modx->manager->action == '88') { ?>
|
|
| 354 | + <?php if ($modx->manager->action == '88') { ?>
|
|
| 355 | 355 | <tr> |
| 356 | 356 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
| 357 | 357 | <td> </td> |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | function BrowseServer() {
|
| 473 | 473 | var w = screen.width * 0.7; |
| 474 | 474 | var h = screen.height * 0.7; |
| 475 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h);
|
|
| 475 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h);
|
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | function SetUrl(url, width, height, alt) {
|
@@ -491,22 +491,22 @@ discard block |
||
| 491 | 491 | <td class='comment'><?php echo $_lang["user_photo_message"] ?></td> |
| 492 | 492 | </tr> |
| 493 | 493 | <tr> |
| 494 | - <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> |
|
| 494 | + <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> |
|
| 495 | 495 | </tr> |
| 496 | 496 | </table> |
| 497 | 497 | </div> |
| 498 | 498 | <?php |
| 499 | - if($use_udperms == 1) {
|
|
| 499 | + if ($use_udperms == 1) {
|
|
| 500 | 500 | |
| 501 | 501 | $groupsarray = array(); |
| 502 | 502 | |
| 503 | - if($modx->manager->action == '88') { // only do this bit if the user is being edited
|
|
| 503 | + if ($modx->manager->action == '88') { // only do this bit if the user is being edited
|
|
| 504 | 504 | $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
|
| 505 | 505 | $groupsarray = $modx->db->getColumn('webgroup', $rs);
|
| 506 | 506 | } |
| 507 | 507 | // retain selected user groups between post |
| 508 | - if(is_array($_POST['user_groups'])) {
|
|
| 509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 508 | + if (is_array($_POST['user_groups'])) {
|
|
| 509 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 510 | 510 | } |
| 511 | 511 | ?> |
| 512 | 512 | <div class="tab-page" id="tabPermissions"> |
@@ -515,8 +515,8 @@ discard block |
||
| 515 | 515 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
| 516 | 516 | <?php |
| 517 | 517 | $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
|
| 518 | - while($row = $modx->db->getRow($rs)) {
|
|
| 519 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
| 518 | + while ($row = $modx->db->getRow($rs)) {
|
|
| 519 | + echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />'; |
|
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | ?> |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
|
| 527 | 527 | "id" => $user |
| 528 | 528 | )); |
| 529 | - if(is_array($evtOut)) {
|
|
| 529 | + if (is_array($evtOut)) {
|
|
| 530 | 530 | echo implode("", $evtOut);
|
| 531 | 531 | } |
| 532 | 532 | ?> |
@@ -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->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->db->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 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -switch($modx->manager->action) { |
|
| 6 | +switch ($modx->manager->action) { |
|
| 7 | 7 | case 16: |
| 8 | - if(!$modx->hasPermission('edit_template')) { |
|
| 8 | + if (!$modx->hasPermission('edit_template')) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 10 | 10 | } |
| 11 | 11 | break; |
| 12 | 12 | case 19: |
| 13 | - if(!$modx->hasPermission('new_template')) { |
|
| 13 | + if (!$modx->hasPermission('new_template')) { |
|
| 14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 15 | 15 | } |
| 16 | 16 | break; |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked |
| 26 | -if($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
| 26 | +if ($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
| 27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
| 28 | 28 | } |
| 29 | 29 | // end check for lock |
@@ -32,23 +32,23 @@ discard block |
||
| 32 | 32 | $modx->lockElement(1, $id); |
| 33 | 33 | |
| 34 | 34 | $content = array(); |
| 35 | -if(!empty($id)) { |
|
| 35 | +if (!empty($id)) { |
|
| 36 | 36 | $rs = $modx->db->select('*', $tbl_site_templates, "id='{$id}'"); |
| 37 | 37 | $content = $modx->db->getRow($rs); |
| 38 | - if(!$content) { |
|
| 38 | + if (!$content) { |
|
| 39 | 39 | $modx->webAlertAndQuit("No database record has been found for this template."); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $_SESSION['itemname'] = $content['templatename']; |
| 43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 43 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 44 | 44 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 45 | 45 | } |
| 46 | 46 | } else { |
| 47 | 47 | $_SESSION['itemname'] = $_lang["new_template"]; |
| 48 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 48 | + $content['category'] = (int) $_REQUEST['catid']; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if($modx->manager->hasFormValues()) { |
|
| 51 | +if ($modx->manager->hasFormValues()) { |
|
| 52 | 52 | $modx->manager->loadFormValues(); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // Add lock-element JS-Script |
| 59 | 59 | $lockElementId = $id; |
| 60 | 60 | $lockElementType = 1; |
| 61 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 61 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 62 | 62 | ?> |
| 63 | 63 | <script type="text/javascript"> |
| 64 | 64 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | <?php |
| 101 | 101 | // invoke OnTempFormPrerender event |
| 102 | 102 | $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
| 103 | - if(is_array($evtOut)) { |
|
| 103 | + if (is_array($evtOut)) { |
|
| 104 | 104 | echo implode("", $evtOut); |
| 105 | 105 | } |
| 106 | 106 | ?> |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
| 110 | 110 | |
| 111 | 111 | <h1> |
| 112 | - <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
| 112 | + <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
| 113 | 113 | </h1> |
| 114 | 114 | |
| 115 | 115 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | <div class="row form-row"> |
| 133 | 133 | <label class="col-md-3 col-lg-2"> |
| 134 | 134 | <?= $_lang['template_name'] ?> |
| 135 | - <?php if($id == $modx->config['default_template']) { |
|
| 136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
| 135 | + <?php if ($id == $modx->config['default_template']) { |
|
| 136 | + echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>'; |
|
| 137 | 137 | } ?> |
| 138 | 138 | </label> |
| 139 | 139 | <div class="col-md-9 col-lg-10"> |
| 140 | 140 | <div class="form-control-name clearfix"> |
| 141 | 141 | <input name="templatename" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;"> |
| 142 | - <?php if($modx->hasPermission('save_role')): ?> |
|
| 143 | - <label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip> |
|
| 142 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
| 143 | + <label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip> |
|
| 144 | 144 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 145 | 145 | <i class="fa fa-lock"></i> |
| 146 | 146 | </label> |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 163 | 163 | <option> </option> |
| 164 | 164 | <?php |
| 165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 166 | - foreach(getCategories() as $n => $v) { |
|
| 167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($v["category"]) . "</option>"; |
|
| 165 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 166 | + foreach (getCategories() as $n => $v) { |
|
| 167 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->htmlspecialchars($v["category"])."</option>"; |
|
| 168 | 168 | } |
| 169 | 169 | ?> |
| 170 | 170 | </select> |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | </div> |
| 178 | 178 | </div> |
| 179 | 179 | </div> |
| 180 | - <?php if($modx->hasPermission('save_role')): ?> |
|
| 180 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
| 181 | 181 | <div class="form-group"> |
| 182 | 182 | <label> |
| 183 | 183 | <input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label> |
@@ -198,30 +198,30 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | <?php |
| 200 | 200 | $selectedTvs = array(); |
| 201 | - if(!isset($_POST['assignedTv'])) { |
|
| 201 | + if (!isset($_POST['assignedTv'])) { |
|
| 202 | 202 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
| 203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
| 205 | 205 | ); |
| 206 | - while($row = $modx->db->getRow($rs)) { |
|
| 206 | + while ($row = $modx->db->getRow($rs)) { |
|
| 207 | 207 | $selectedTvs[$row['tvid']] = $row; |
| 208 | 208 | } |
| 209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $unselectedTvs = array(); |
| 213 | 213 | $rs = $modx->db->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
| 214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
| 215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getFullTableName('site_tmplvars'), $modx->getFullTableName('site_tmplvar_templates'), $modx->getFullTableName('categories')), "", "category, tvcaption"); |
| 216 | - while($row = $modx->db->getRow($rs)) { |
|
| 216 | + while ($row = $modx->db->getRow($rs)) { |
|
| 217 | 217 | $unselectedTvs[$row['tvid']] = $row; |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // Catch checkboxes if form not validated |
| 221 | - if(isset($_POST['assignedTv'])) { |
|
| 221 | + if (isset($_POST['assignedTv'])) { |
|
| 222 | 222 | $selectedTvs = array(); |
| 223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
| 224 | - if(isset($unselectedTvs[$tvid])) { |
|
| 223 | + foreach ($_POST['assignedTv'] as $tvid) { |
|
| 224 | + if (isset($unselectedTvs[$tvid])) { |
|
| 225 | 225 | $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
| 226 | 226 | } |
| 227 | 227 | }; |
@@ -238,20 +238,20 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | <div class="container container-body"> |
| 240 | 240 | <?php |
| 241 | - if($total > 0) { |
|
| 242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
| 241 | + if ($total > 0) { |
|
| 242 | + echo '<p>'.$_lang['template_tv_msg'].'</p>'; |
|
| 243 | 243 | } |
| 244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 244 | + if ($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
| 245 | 245 | echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | // Selected TVs |
| 249 | 249 | $tvList = ''; |
| 250 | - if($total > 0) { |
|
| 250 | + if ($total > 0) { |
|
| 251 | 251 | $tvList .= '<ul>'; |
| 252 | - foreach($selectedTvs as $row) { |
|
| 253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 252 | + foreach ($selectedTvs as $row) { |
|
| 253 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
| 254 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
| 255 | 255 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
| 256 | 256 | } |
| 257 | 257 | $tvList .= '</ul>'; |
@@ -262,22 +262,22 @@ discard block |
||
| 262 | 262 | echo $tvList; |
| 263 | 263 | |
| 264 | 264 | // Unselected TVs |
| 265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
| 265 | + $tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>'; |
|
| 266 | 266 | $preCat = ''; |
| 267 | 267 | $insideUl = 0; |
| 268 | - while($row = array_shift($unselectedTvs)) { |
|
| 269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
| 268 | + while ($row = array_shift($unselectedTvs)) { |
|
| 269 | + if (isset($selectedTvs[$row['tvid']])) { |
|
| 270 | 270 | continue; |
| 271 | 271 | } // Skip selected |
| 272 | 272 | $row['category'] = stripslashes($row['category']); //pixelchutes |
| 273 | - if($preCat !== $row['category']) { |
|
| 273 | + if ($preCat !== $row['category']) { |
|
| 274 | 274 | $tvList .= $insideUl ? '</ul>' : ''; |
| 275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
| 275 | + $tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
| 276 | 276 | $insideUl = 1; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
| 280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
| 279 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
| 280 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
| 281 | 281 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->manager->action, $id, $_lang['edit']); |
| 282 | 282 | $tvList .= '</li>'; |
| 283 | 283 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | <?php |
| 295 | 295 | // invoke OnTempFormRender event |
| 296 | 296 | $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
| 297 | - if(is_array($evtOut)) { |
|
| 297 | + if (is_array($evtOut)) { |
|
| 298 | 298 | echo implode("", $evtOut); |
| 299 | 299 | } |
| 300 | 300 | ?> |
@@ -1,19 +1,19 @@ 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('edit_document') || !$modx->hasPermission('save_document')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
| 9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
| 10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
| 11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
| 12 | 12 | $ressourcelist = ''; |
| 13 | 13 | $updateMsg = ''; |
| 14 | 14 | |
| 15 | 15 | // check permissions on the document |
| 16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 17 | 17 | $udperms = new udperms(); |
| 18 | 18 | $udperms->user = $modx->getLoginUserID(); |
| 19 | 19 | $udperms->document = $id; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | if (isset($_POST['listSubmitted'])) { |
| 27 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
| 27 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
| 28 | 28 | if (strlen($items) > 0) { |
| 29 | 29 | $items = explode(';', $items); |
| 30 | 30 | foreach ($items as $key => $value) { |
@@ -44,15 +44,15 @@ discard block |
||
| 44 | 44 | $tblsc = $modx->getFullTableName('site_content'); |
| 45 | 45 | $tbldg = $modx->getFullTableName('document_groups'); |
| 46 | 46 | |
| 47 | - $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
| 47 | + $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.''); |
|
| 48 | 48 | $pagetitle = $modx->db->getValue($rs); |
| 49 | 49 | |
| 50 | 50 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 51 | 51 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
| 52 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 53 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 52 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 53 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 54 | 54 | |
| 55 | - $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
| 55 | + $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
| 56 | 56 | |
| 57 | 57 | if ($modx->db->getRecordCount($rs)) { |
| 58 | 58 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -61,12 +61,12 @@ discard block |
||
| 61 | 61 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
| 62 | 62 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
| 63 | 63 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
| 64 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
| 65 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
| 64 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
| 65 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
| 66 | 66 | } |
| 67 | 67 | $ressourcelist .= '</ul></div>'; |
| 68 | 68 | } else { |
| 69 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
| 69 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | </script> |
| 150 | 150 | |
| 151 | 151 | <h1> |
| 152 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
| 152 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
| 153 | 153 | </h1> |
| 154 | 154 | |
| 155 | 155 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -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->getFullTableName('active_users'); |
@@ -24,41 +24,41 @@ discard block |
||
| 24 | 24 | $modx->manager->initPageViewState(); |
| 25 | 25 | |
| 26 | 26 | // check to see the editor isn't locked |
| 27 | -$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
| 28 | -if($username = $modx->db->getValue($rs)) { |
|
| 27 | +$rs = $modx->db->select('username', $tbl_active_users, "action=108 AND id='{$id}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
| 28 | +if ($username = $modx->db->getValue($rs)) { |
|
| 29 | 29 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $username, 'module')); |
| 30 | 30 | } |
| 31 | 31 | // end check for lock |
| 32 | 32 | |
| 33 | 33 | // take action |
| 34 | -switch($_REQUEST['op']) { |
|
| 34 | +switch ($_REQUEST['op']) { |
|
| 35 | 35 | case 'add': |
| 36 | 36 | // convert ids to numbers |
| 37 | 37 | $opids = array_filter(array_map('intval', explode(',', $_REQUEST['newids']))); |
| 38 | 38 | |
| 39 | - if(count($opids) > 0) { |
|
| 39 | + if (count($opids) > 0) { |
|
| 40 | 40 | // 1-snips, 2-tpls, 3-tvs, 4-chunks, 5-plugins, 6-docs |
| 41 | 41 | $rt = strtolower($_REQUEST["rt"]); |
| 42 | - if($rt == 'chunk') { |
|
| 42 | + if ($rt == 'chunk') { |
|
| 43 | 43 | $type = 10; |
| 44 | 44 | } |
| 45 | - if($rt == 'doc') { |
|
| 45 | + if ($rt == 'doc') { |
|
| 46 | 46 | $type = 20; |
| 47 | 47 | } |
| 48 | - if($rt == 'plug') { |
|
| 48 | + if ($rt == 'plug') { |
|
| 49 | 49 | $type = 30; |
| 50 | 50 | } |
| 51 | - if($rt == 'snip') { |
|
| 51 | + if ($rt == 'snip') { |
|
| 52 | 52 | $type = 40; |
| 53 | 53 | } |
| 54 | - if($rt == 'tpl') { |
|
| 54 | + if ($rt == 'tpl') { |
|
| 55 | 55 | $type = 50; |
| 56 | 56 | } |
| 57 | - if($rt == 'tv') { |
|
| 57 | + if ($rt == 'tv') { |
|
| 58 | 58 | $type = 60; |
| 59 | 59 | } |
| 60 | - $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (" . implode(',', $opids) . ") AND type='{$type}'"); |
|
| 61 | - foreach($opids as $opid) { |
|
| 60 | + $modx->db->delete($tbl_site_module_depobj, "module='{$id}' AND resource IN (".implode(',', $opids).") AND type='{$type}'"); |
|
| 61 | + foreach ($opids as $opid) { |
|
| 62 | 62 | $modx->db->insert(array( |
| 63 | 63 | 'module' => $id, |
| 64 | 64 | 'resource' => $opid, |
@@ -72,15 +72,15 @@ discard block |
||
| 72 | 72 | $opids = array_filter(array_map('intval', $_REQUEST['depid'])); |
| 73 | 73 | |
| 74 | 74 | // get resources that needs to be removed |
| 75 | - $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (" . implode(",", $opids) . ")"); |
|
| 75 | + $ds = $modx->db->select('*', $tbl_site_module_depobj, "id IN (".implode(",", $opids).")"); |
|
| 76 | 76 | // loop through resources and look for plugins and snippets |
| 77 | 77 | $plids = array(); |
| 78 | 78 | $snid = array(); |
| 79 | - while($row = $modx->db->getRow($ds)) { |
|
| 80 | - if($row['type'] == '30') { |
|
| 79 | + while ($row = $modx->db->getRow($ds)) { |
|
| 80 | + if ($row['type'] == '30') { |
|
| 81 | 81 | $plids[$i] = $row['resource']; |
| 82 | 82 | } |
| 83 | - if($row['type'] == '40') { |
|
| 83 | + if ($row['type'] == '40') { |
|
| 84 | 84 | $snids[$i] = $row['resource']; |
| 85 | 85 | } |
| 86 | 86 | } |
@@ -88,28 +88,28 @@ discard block |
||
| 88 | 88 | $ds = $modx->db->select('guid', $tbl_site_modules, "id='{$id}'"); |
| 89 | 89 | $guid = $modx->db->getValue($ds); |
| 90 | 90 | // reset moduleguid for deleted resources |
| 91 | - if(($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | - if($cp) { |
|
| 93 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $plids) . ") AND moduleguid='{$guid}'"); |
|
| 91 | + if (($cp = count($plids)) || ($cs = count($snids))) { |
|
| 92 | + if ($cp) { |
|
| 93 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $plids).") AND moduleguid='{$guid}'"); |
|
| 94 | 94 | } |
| 95 | - if($cs) { |
|
| 96 | - $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (" . implode(',', $snids) . ") AND moduleguid='{$guid}'"); |
|
| 95 | + if ($cs) { |
|
| 96 | + $modx->db->update(array('moduleguid' => ''), $tbl_site_plugins, "id IN (".implode(',', $snids).") AND moduleguid='{$guid}'"); |
|
| 97 | 97 | } |
| 98 | 98 | // reset cache |
| 99 | 99 | $modx->clearCache('full'); |
| 100 | 100 | } |
| 101 | - $modx->db->delete($tbl_site_module_depobj, "id IN (" . implode(',', $opids) . ")"); |
|
| 101 | + $modx->db->delete($tbl_site_module_depobj, "id IN (".implode(',', $opids).")"); |
|
| 102 | 102 | break; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // load record |
| 106 | 106 | $rs = $modx->db->select('*', $tbl_site_modules, "id = '{$id}'"); |
| 107 | 107 | $content = $modx->db->getRow($rs); |
| 108 | -if(!$content) { |
|
| 108 | +if (!$content) { |
|
| 109 | 109 | $modx->webAlertAndQuit("Module not found for id '{$id}'."); |
| 110 | 110 | } |
| 111 | 111 | $_SESSION['itemname'] = $content['name']; |
| 112 | -if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 112 | +if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
| 113 | 113 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | <input type="hidden" name="id" value="<?php echo $content['id']; ?>" /> |
| 189 | 189 | |
| 190 | 190 | <h1> |
| 191 | - <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['module_resource_title']) ?> |
|
| 191 | + <i class="fa fa-cogs"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['module_resource_title']) ?> |
|
| 192 | 192 | </h1> |
| 193 | 193 | |
| 194 | 194 | <?php echo $_style['actionbuttons']['dynamic']['close'] ?> |
| 195 | 195 | |
| 196 | 196 | <div class="section"> |
| 197 | - <div class="sectionHeader"><?php echo $content["name"] . " - " . $_lang['module_resource_title']; ?></div> |
|
| 197 | + <div class="sectionHeader"><?php echo $content["name"]." - ".$_lang['module_resource_title']; ?></div> |
|
| 198 | 198 | <div class="sectionBody"> |
| 199 | 199 | <p><?php echo $_lang['module_resource_msg']; ?></p> |
| 200 | 200 | <br /> |
@@ -218,14 +218,14 @@ discard block |
||
| 218 | 218 | LEFT JOIN {$tbl_site_snippets} AS ss ON ss.id = smd.resource AND smd.type = '40' |
| 219 | 219 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = '50' |
| 220 | 220 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = '60'", "smd.module={$id}", "smd.type,name"); |
| 221 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 221 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
| 222 | 222 | $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items |
| 223 | 223 | $grd->noRecordMsg = $_lang["no_records_found"]; |
| 224 | 224 | $grd->cssClass = "grid"; |
| 225 | 225 | $grd->columnHeaderClass = "gridHeader"; |
| 226 | 226 | $grd->itemClass = "gridItem"; |
| 227 | 227 | $grd->altItemClass = "gridAltItem"; |
| 228 | - $grd->columns = $_lang["element_name"] . " ," . $_lang["type"]; |
|
| 228 | + $grd->columns = $_lang["element_name"]." ,".$_lang["type"]; |
|
| 229 | 229 | $grd->colTypes = "template:<input type='checkbox' name='depid[]' value='[+id+]'> [+value+]"; |
| 230 | 230 | $grd->fields = "name,type"; |
| 231 | 231 | echo $grd->render(); |