@@ -1,22 +1,22 @@ 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 | -switch($modx->getManagerApi()->action) {
|
|
| 5 | +switch ($modx->getManagerApi()->action) {
|
|
| 6 | 6 | case 107: |
| 7 | - if(!$modx->hasPermission('new_module')) {
|
|
| 7 | + if (!$modx->hasPermission('new_module')) {
|
|
| 8 | 8 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 9 | 9 | } |
| 10 | 10 | break; |
| 11 | 11 | case 108: |
| 12 | - if(!$modx->hasPermission('edit_module')) {
|
|
| 12 | + if (!$modx->hasPermission('edit_module')) {
|
|
| 13 | 13 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 14 | 14 | } |
| 15 | 15 | break; |
| 16 | 16 | default: |
| 17 | 17 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 18 | 18 | } |
| 19 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 19 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 20 | 20 | // Get table names (alphabetical) |
| 21 | 21 | $tbl_membergroup_names = $modx->getFullTableName('membergroup_names');
|
| 22 | 22 | $tbl_site_content = $modx->getFullTableName('site_content');
|
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | // check to see the module editor isn't locked |
| 34 | -if($lockedEl = $modx->elementIsLocked(6, $id)) {
|
|
| 34 | +if ($lockedEl = $modx->elementIsLocked(6, $id)) {
|
|
| 35 | 35 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
| 36 | 36 | } |
| 37 | 37 | // end check for lock |
@@ -39,29 +39,29 @@ discard block |
||
| 39 | 39 | // Lock snippet for other users to edit |
| 40 | 40 | $modx->lockElement(6, $id); |
| 41 | 41 | |
| 42 | -if(isset($_GET['id'])) {
|
|
| 42 | +if (isset($_GET['id'])) {
|
|
| 43 | 43 | $rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
|
| 44 | 44 | $content = $modx->getDatabase()->getRow($rs); |
| 45 | - if(!$content) {
|
|
| 45 | + if (!$content) {
|
|
| 46 | 46 | $modx->webAlertAndQuit("Module not found for id '{$id}'.");
|
| 47 | 47 | } |
| 48 | 48 | $content['properties'] = str_replace("&", "&", $content['properties']);
|
| 49 | 49 | $_SESSION['itemname'] = $content['name']; |
| 50 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 50 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 51 | 51 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 52 | 52 | } |
| 53 | 53 | } else {
|
| 54 | 54 | $_SESSION['itemname'] = $_lang["new_module"]; |
| 55 | 55 | $content['wrap'] = '1'; |
| 56 | 56 | } |
| 57 | -if($modx->getManagerApi()->hasFormValues()) {
|
|
| 57 | +if ($modx->getManagerApi()->hasFormValues()) {
|
|
| 58 | 58 | $modx->getManagerApi()->loadFormValues(); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Add lock-element JS-Script |
| 62 | 62 | $lockElementId = $id; |
| 63 | 63 | $lockElementType = 6; |
| 64 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 64 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 65 | 65 | ?> |
| 66 | 66 | <script type="text/javascript"> |
| 67 | 67 | function loadDependencies() {
|
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | function BrowseServer() {
|
| 409 | 409 | var w = screen.width * 0.7; |
| 410 | 410 | var h = screen.height * 0.7; |
| 411 | - OpenServerBrowser("<?= MODX_MANAGER_URL;?>media/browser/<?= $which_browser;?>/browser.php?Type=images", w, h);
|
|
| 411 | + OpenServerBrowser("<?= MODX_MANAGER_URL; ?>media/browser/<?= $which_browser; ?>/browser.php?Type=images", w, h);
|
|
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | function SetUrl(url, width, height, alt) {
|
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | <?php |
| 429 | 429 | // invoke OnModFormPrerender event |
| 430 | 430 | $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
|
| 431 | - if(is_array($evtOut)) {
|
|
| 431 | + if (is_array($evtOut)) {
|
|
| 432 | 432 | echo implode('', $evtOut);
|
| 433 | 433 | } |
| 434 | 434 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
| 443 | 443 | |
| 444 | 444 | <h1> |
| 445 | - <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
|
|
| 445 | + <i class="<?= ($content['icon'] != '' ? $content['icon'] : $_style['icons_module']) ?>"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_module']) ?><i class="fa fa-question-circle help"></i>
|
|
| 446 | 446 | </h1> |
| 447 | 447 | |
| 448 | 448 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -467,8 +467,8 @@ discard block |
||
| 467 | 467 | <div class="col-md-9 col-lg-10"> |
| 468 | 468 | <div class="form-control-name clearfix"> |
| 469 | 469 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 470 | - <?php if($modx->hasPermission('save_role')): ?>
|
|
| 471 | - <label class="custom-control" title="<?= $_lang['lock_module'] . "\n" . $_lang['lock_module_msg'] ?>" tooltip> |
|
| 470 | + <?php if ($modx->hasPermission('save_role')): ?>
|
|
| 471 | + <label class="custom-control" title="<?= $_lang['lock_module']."\n".$_lang['lock_module_msg'] ?>" tooltip> |
|
| 472 | 472 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 473 | 473 | <i class="fa fa-lock"></i> |
| 474 | 474 | </label> |
@@ -490,9 +490,9 @@ discard block |
||
| 490 | 490 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 491 | 491 | <option> </option> |
| 492 | 492 | <?php |
| 493 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 494 | - foreach(getCategories() as $n => $v) {
|
|
| 495 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
| 493 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 494 | + foreach (getCategories() as $n => $v) {
|
|
| 495 | + echo "\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category'])."</option>\n"; |
|
| 496 | 496 | } |
| 497 | 497 | ?> |
| 498 | 498 | </select> |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | <div class="form-group"> |
| 525 | 525 | <div class="form-row"> |
| 526 | 526 | <label for="disabled"><input name="disabled" id="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> |
| 527 | - <?= ($content['disabled'] == 1 ? '<span class="text-danger">' . $_lang['module_disabled'] . '</span>' : $_lang['module_disabled']) ?></label> |
|
| 527 | + <?= ($content['disabled'] == 1 ? '<span class="text-danger">'.$_lang['module_disabled'].'</span>' : $_lang['module_disabled']) ?></label> |
|
| 528 | 528 | </div> |
| 529 | 529 | <div class="form-row"> |
| 530 | 530 | <label for="parse_docblock"> |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | </div> |
| 590 | 590 | <!-- HTML text editor end --> |
| 591 | 591 | </div> |
| 592 | - <?php if($modx->getManagerApi()->action == '108'): ?> |
|
| 592 | + <?php if ($modx->getManagerApi()->action == '108'): ?> |
|
| 593 | 593 | <!-- Dependencies --> |
| 594 | 594 | <div class="tab-page" id="tabDepend"> |
| 595 | 595 | <h2 class="tab"><?= $_lang['settings_dependencies'] ?></h2> |
@@ -617,14 +617,14 @@ discard block |
||
| 617 | 617 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
|
| 618 | 618 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
|
| 619 | 619 | |
| 620 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 620 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
| 621 | 621 | $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
|
| 622 | 622 | $grd->noRecordMsg = $_lang['no_records_found']; |
| 623 | 623 | $grd->cssClass = 'grid'; |
| 624 | 624 | $grd->columnHeaderClass = 'gridHeader'; |
| 625 | 625 | $grd->itemClass = 'gridItem'; |
| 626 | 626 | $grd->altItemClass = 'gridAltItem'; |
| 627 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
| 627 | + $grd->columns = $_lang['element_name']." ,".$_lang['type']; |
|
| 628 | 628 | $grd->fields = "name,type"; |
| 629 | 629 | echo $grd->render(); |
| 630 | 630 | ?> |
@@ -637,13 +637,13 @@ discard block |
||
| 637 | 637 | <h2 class="tab"><?= $_lang['access_permissions'] ?></h2> |
| 638 | 638 | <script type="text/javascript">tp.addTabPage(document.getElementById("tabPermissions"));</script>
|
| 639 | 639 | <div class="container container-body"> |
| 640 | - <?php if($use_udperms == 1) : ?> |
|
| 640 | + <?php if ($use_udperms == 1) : ?> |
|
| 641 | 641 | <?php |
| 642 | 642 | // fetch user access permissions for the module |
| 643 | 643 | $rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
|
| 644 | 644 | $groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
|
| 645 | 645 | |
| 646 | - if($modx->hasPermission('access_permissions')) {
|
|
| 646 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 647 | 647 | ?> |
| 648 | 648 | <!-- User Group Access Permissions --> |
| 649 | 649 | <script type="text/javascript"> |
@@ -671,22 +671,22 @@ discard block |
||
| 671 | 671 | } |
| 672 | 672 | $chk = ''; |
| 673 | 673 | $rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
|
| 674 | - while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 674 | + while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 675 | 675 | $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
| 676 | 676 | $checked = in_array($row['id'], $groupsarray); |
| 677 | - if($modx->hasPermission('access_permissions')) {
|
|
| 678 | - if($checked) {
|
|
| 677 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 678 | + if ($checked) {
|
|
| 679 | 679 | $notPublic = true; |
| 680 | 680 | } |
| 681 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
| 681 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="'.$row['id'].'"'.($checked ? ' checked="checked"' : '').' onclick="makePublic(false)" /> '.$row['name']."</label><br />\n"; |
|
| 682 | 682 | } else {
|
| 683 | - if($checked) {
|
|
| 684 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
| 683 | + if ($checked) {
|
|
| 684 | + $chks = '<input type="hidden" name="usrgroups[]" value="'.$row['id'].'" />'."\n".$chks; |
|
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | } |
| 688 | - if($modx->hasPermission('access_permissions')) {
|
|
| 689 | - $chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks; |
|
| 688 | + if ($modx->hasPermission('access_permissions')) {
|
|
| 689 | + $chks = '<label><input type="checkbox" name="chkallgroups"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true)" /><span class="warning"> '.$_lang['all_usr_groups'].'</span></label><br />'."\n".$chks; |
|
| 690 | 690 | } |
| 691 | 691 | echo $chks; |
| 692 | 692 | ?> |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | <?php |
| 708 | 708 | // invoke OnModFormRender event |
| 709 | 709 | $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
|
| 710 | - if(is_array($evtOut)) {
|
|
| 710 | + if (is_array($evtOut)) {
|
|
| 711 | 711 | echo implode('', $evtOut);
|
| 712 | 712 | } |
| 713 | 713 | ?> |
@@ -1,14 +1,14 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('settings')) {
|
|
| 5 | +if (!$modx->hasPermission('settings')) {
|
|
| 6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // check to see the edit settings page isn't locked |
| 10 | -$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
|
|
| 11 | -if($username = $modx->getDatabase()->getValue($rs)) {
|
|
| 10 | +$rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'");
|
|
| 11 | +if ($username = $modx->getDatabase()->getValue($rs)) {
|
|
| 12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
| 13 | 13 | } |
| 14 | 14 | // end check for lock |
@@ -16,21 +16,21 @@ discard block |
||
| 16 | 16 | // reload system settings from the database. |
| 17 | 17 | // this will prevent user-defined settings from being saved as system setting |
| 18 | 18 | $settings = array(); |
| 19 | -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
|
| 19 | +include_once(MODX_MANAGER_PATH.'includes/default_config.php'); |
|
| 20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]system_settings');
|
| 21 | -while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 21 | +while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
| 23 | 23 | } |
| 24 | -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
|
|
| 25 | -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']);
|
|
| 24 | +$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']);
|
|
| 25 | +$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']);
|
|
| 26 | 26 | |
| 27 | 27 | extract($settings, EXTR_OVERWRITE); |
| 28 | 28 | |
| 29 | 29 | // load languages and keys |
| 30 | 30 | $lang_keys = array(); |
| 31 | 31 | $dir = dir('includes/lang');
|
| 32 | -while($file = $dir->read()) {
|
|
| 33 | - if(strpos($file, '.inc.php') > 0) {
|
|
| 32 | +while ($file = $dir->read()) {
|
|
| 33 | + if (strpos($file, '.inc.php') > 0) {
|
|
| 34 | 34 | $endpos = strpos($file, '.'); |
| 35 | 35 | $languagename = substr($file, 0, $endpos); |
| 36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
| 68 | 68 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" />
|
| 69 | 69 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
| 70 | - <?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
|
|
| 70 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?>
|
|
| 71 | 71 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
| 72 | 72 | <?php } ?> |
| 73 | 73 | <div class="tab-pane" id="settingsPane"> |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | </script> |
| 77 | 77 | |
| 78 | 78 | <?php |
| 79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
| 80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
| 81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
| 82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
| 83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
| 84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
| 85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
| 79 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
| 80 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
| 81 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
| 82 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
| 83 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
| 84 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
| 85 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
| 86 | 86 | ?> |
| 87 | 87 | </div> |
| 88 | 88 | </div> |
@@ -129,6 +129,6 @@ discard block |
||
| 129 | 129 | }); |
| 130 | 130 | </script> |
| 131 | 131 | <?php |
| 132 | -if(is_numeric($_GET['tab'])) {
|
|
| 133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
| 132 | +if (is_numeric($_GET['tab'])) {
|
|
| 133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
| 134 | 134 | } |
@@ -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->getDatabase()->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->getDatabase()->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->getDatabase()->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,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('access_permissions')) { |
|
| 5 | +if (!$modx->hasPermission('access_permissions')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -17,23 +17,23 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // find all document groups, for the select :) |
| 19 | 19 | $rs = $modx->getDatabase()->select('*', $tbl_documentgroup_names, '', 'name'); |
| 20 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 20 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 21 | 21 | $docgroupselector = '[no groups to add]'; |
| 22 | 22 | } else { |
| 23 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
| 24 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 25 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 23 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
| 24 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 25 | + $docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
| 26 | 26 | } |
| 27 | 27 | $docgroupselector .= "</select>\n"; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $rs = $modx->getDatabase()->select('*', $tbl_membergroup_names, '', 'name'); |
| 31 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 31 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 32 | 32 | $usrgroupselector = '[no user groups]'; |
| 33 | 33 | } else { |
| 34 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
| 35 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 36 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
| 34 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
| 35 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 36 | + $usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
| 37 | 37 | } |
| 38 | 38 | $usrgroupselector .= "</select>\n"; |
| 39 | 39 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | <div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div> |
| 70 | 70 | </div> |
| 71 | 71 | |
| 72 | -<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div> |
|
| 72 | +<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div> |
|
| 73 | 73 | |
| 74 | 74 | <div class="tab-pane" id="uapPane"> |
| 75 | 75 | <script type="text/javascript"> |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | </form> |
| 97 | 97 | </div> |
| 98 | 98 | <?php |
| 99 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
| 100 | - LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id |
|
| 101 | - LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
|
| 102 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 99 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names.' AS groupnames |
|
| 100 | + LEFT JOIN ' . $tbl_member_groups.' AS groups ON groups.user_group = groupnames.id |
|
| 101 | + LEFT JOIN ' . $tbl_manager_users.' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
|
| 102 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 103 | 103 | ?> |
| 104 | 104 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 105 | 105 | <?php |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | <div class="form-group"> |
| 109 | 109 | <?php |
| 110 | 110 | $pid = ''; |
| 111 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 112 | - if($pid != $row['id']) { |
|
| 113 | - if($pid != '') { |
|
| 111 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 112 | + if ($pid != $row['id']) { |
|
| 113 | + if ($pid != '') { |
|
| 114 | 114 | echo '</div><div class="form-group">'; |
| 115 | 115 | } |
| 116 | 116 | ?> |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | <?= $_lang['access_permissions_users_in_group'] ?> |
| 130 | 130 | <?php |
| 131 | 131 | } |
| 132 | - if(!$row['user_id']) { |
|
| 132 | + if (!$row['user_id']) { |
|
| 133 | 133 | ?> |
| 134 | 134 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
| 135 | 135 | <?php |
@@ -167,10 +167,10 @@ discard block |
||
| 167 | 167 | </form> |
| 168 | 168 | </div> |
| 169 | 169 | <?php |
| 170 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
| 171 | - LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id |
|
| 172 | - LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
|
| 173 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 170 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names.' AS dgnames |
|
| 171 | + LEFT JOIN ' . $tbl_document_groups.' AS dg ON dg.document_group = dgnames.id |
|
| 172 | + LEFT JOIN ' . $tbl_site_content.' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
|
| 173 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 174 | 174 | ?> |
| 175 | 175 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 176 | 176 | <?php |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | <div class="form-group"> |
| 180 | 180 | <?php |
| 181 | 181 | $pid = ''; |
| 182 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 183 | - if($pid != $row['id']) { |
|
| 184 | - if($pid != '') { |
|
| 182 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 183 | + if ($pid != $row['id']) { |
|
| 184 | + if ($pid != '') { |
|
| 185 | 185 | echo '</div><div class="form-group">'; |
| 186 | 186 | } |
| 187 | 187 | ?> |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | <?= $_lang['access_permissions_resources_in_group'] ?> |
| 201 | 201 | <?php |
| 202 | 202 | } |
| 203 | - if(!$row['doc_id']) { |
|
| 203 | + if (!$row['doc_id']) { |
|
| 204 | 204 | ?> |
| 205 | 205 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
| 206 | 206 | <?php |
@@ -226,10 +226,10 @@ discard block |
||
| 226 | 226 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
| 227 | 227 | <?php |
| 228 | 228 | // User/Document Group Links |
| 229 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
| 230 | - LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id |
|
| 231 | - LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
|
| 232 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 229 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names.' AS groupnames |
|
| 230 | + LEFT JOIN ' . $tbl_membergroup_access.' AS groupacc ON groupacc.membergroup = groupnames.id |
|
| 231 | + LEFT JOIN ' . $tbl_documentgroup_names.' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
|
| 232 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
| 233 | 233 | ?> |
| 234 | 234 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
| 235 | 235 | <?php |
@@ -251,23 +251,23 @@ discard block |
||
| 251 | 251 | <ul> |
| 252 | 252 | <?php |
| 253 | 253 | $pid = ''; |
| 254 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 255 | - if($row['id'] != $pid) { |
|
| 256 | - if($pid != '') { |
|
| 254 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 255 | + if ($row['id'] != $pid) { |
|
| 256 | + if ($pid != '') { |
|
| 257 | 257 | echo '</ul></li>'; |
| 258 | 258 | } // close previous one |
| 259 | 259 | ?> |
| 260 | 260 | <li><b><?= $row['name'] ?></b></li> |
| 261 | 261 | <?php |
| 262 | - if(!$row['dg_id']) { |
|
| 263 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
| 262 | + if (!$row['dg_id']) { |
|
| 263 | + echo '<i>'.$_lang['no_groups_found'].'</i></li>'; |
|
| 264 | 264 | $pid = ''; |
| 265 | 265 | continue; |
| 266 | 266 | } else { |
| 267 | 267 | echo '<ul>'; |
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | - if(!$row['dg_id']) { |
|
| 270 | + if (!$row['dg_id']) { |
|
| 271 | 271 | continue; |
| 272 | 272 | } |
| 273 | 273 | ?> |
@@ -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_plugin')) { |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | $updateMsg = ''; |
| 12 | 12 | |
| 13 | 13 | if (isset($_POST['listSubmitted'])) { |
| 14 | - $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>'; |
|
| 14 | + $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>'; |
|
| 15 | 15 | $tbl = $modx->getFullTableName('site_plugin_events'); |
| 16 | 16 | |
| 17 | 17 | foreach ($_POST as $listName => $listValue) { |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | -$rs = $modx->getDatabase()->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames') . " sysevt |
|
| 38 | - INNER JOIN " . $modx->getFullTableName('site_plugin_events') . " pe ON pe.evtid = sysevt.id |
|
| 39 | - INNER JOIN " . $modx->getFullTableName('site_plugins') . " plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority'); |
|
| 37 | +$rs = $modx->getDatabase()->select("sysevt.name as evtname, sysevt.id as evtid, pe.pluginid, plugs.name, pe.priority, plugs.disabled", $modx->getFullTableName('system_eventnames')." sysevt |
|
| 38 | + INNER JOIN " . $modx->getFullTableName('site_plugin_events')." pe ON pe.evtid = sysevt.id |
|
| 39 | + INNER JOIN " . $modx->getFullTableName('site_plugins')." plugs ON plugs.id = pe.pluginid", '', 'sysevt.name,pe.priority'); |
|
| 40 | 40 | |
| 41 | 41 | $insideUl = 0; |
| 42 | 42 | $preEvt = ''; |
@@ -47,17 +47,17 @@ discard block |
||
| 47 | 47 | if ($preEvt !== $plugins['evtid']) { |
| 48 | 48 | $sortables[] = $plugins['evtid']; |
| 49 | 49 | $sortableList .= $insideUl ? '</ul></div>' : ''; |
| 50 | - $sortableList .= '<div class="form-group clearfix"><strong>' . $plugins['evtname'] . '</strong><ul id="' . $plugins['evtid'] . '" class="sortableList">'; |
|
| 50 | + $sortableList .= '<div class="form-group clearfix"><strong>'.$plugins['evtname'].'</strong><ul id="'.$plugins['evtid'].'" class="sortableList">'; |
|
| 51 | 51 | $insideUl = 1; |
| 52 | 52 | } |
| 53 | - $sortableList .= '<li id="item_' . $plugins['pluginid'] . '"' . ($plugins['disabled'] ? ' class="disabledPlugin"' : '') . '><i class="fa fa-plug"></i> ' . $plugins['name'] . ($plugins['disabled'] ? ' (hide)' : '') . '</li>'; |
|
| 53 | + $sortableList .= '<li id="item_'.$plugins['pluginid'].'"'.($plugins['disabled'] ? ' class="disabledPlugin"' : '').'><i class="fa fa-plug"></i> '.$plugins['name'].($plugins['disabled'] ? ' (hide)' : '').'</li>'; |
|
| 54 | 54 | $preEvt = $plugins['evtid']; |
| 55 | 55 | } |
| 56 | 56 | if ($insideUl) { |
| 57 | 57 | $sortableList .= '</ul></div>'; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -require_once(MODX_MANAGER_PATH . 'includes/header.inc.php'); |
|
| 60 | +require_once(MODX_MANAGER_PATH.'includes/header.inc.php'); |
|
| 61 | 61 | ?> |
| 62 | 62 | |
| 63 | 63 | <script type="text/javascript"> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if (!$modx->hasPermission('view_eventlog')) {
|
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | <div class="form-group" id="lyr1"> |
| 18 | 18 | <b><?= $_lang["publish_events"] ?></b> |
| 19 | 19 | <?php |
| 20 | - $rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
|
| 20 | + $rs = $modx->getDatabase()->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC');
|
|
| 21 | 21 | $limit = $modx->getDatabase()->getRecordCount($rs); |
| 22 | - if($limit < 1) {
|
|
| 22 | + if ($limit < 1) {
|
|
| 23 | 23 | ?> |
| 24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
| 25 | 25 | <?php |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | </thead> |
| 37 | 37 | <tbody> |
| 38 | 38 | <?php |
| 39 | - while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 39 | + while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 40 | 40 | ?> |
| 41 | 41 | <tr> |
| 42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | <div class="form-group" id="lyr2"> |
| 57 | 57 | <b><?= $_lang["unpublish_events"] ?></b> |
| 58 | 58 | <?php |
| 59 | - $rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
|
| 59 | + $rs = $modx->getDatabase()->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC');
|
|
| 60 | 60 | $limit = $modx->getDatabase()->getRecordCount($rs); |
| 61 | - if($limit < 1) {
|
|
| 61 | + if ($limit < 1) {
|
|
| 62 | 62 | ?> |
| 63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
| 64 | 64 | <?php |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | </thead> |
| 76 | 76 | <tbody> |
| 77 | 77 | <?php |
| 78 | - while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 78 | + while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 79 | 79 | ?> |
| 80 | 80 | <tr> |
| 81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | <?php |
| 98 | 98 | $rs = $modx->getDatabase()->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
| 99 | 99 | $limit = $modx->getDatabase()->getRecordCount($rs); |
| 100 | - if($limit < 1) {
|
|
| 100 | + if ($limit < 1) {
|
|
| 101 | 101 | ?> |
| 102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
| 103 | 103 | <?php |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </thead> |
| 116 | 116 | <tbody> |
| 117 | 117 | <?php |
| 118 | - while($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 118 | + while ($row = $modx->getDatabase()->getRow($rs)) {
|
|
| 119 | 119 | ?> |
| 120 | 120 | <tr> |
| 121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -1,11 +1,11 @@ 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 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
| 7 | 7 | |
| 8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 9 | 9 | // seems to be a new install - send the user to the configuration page |
| 10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
| 11 | 11 | } |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | $_SESSION['nrnewmessages'] = 0; |
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | -if($modx->hasPermission('messages')) {
|
|
| 20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 19 | +if ($modx->hasPermission('messages')) {
|
|
| 20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
| 21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
| 22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
| 23 | 23 | |
| 24 | 24 | $msg = array(); |
| 25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
|
| 26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
| 26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
| 27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
|
| 28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
| 28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
| 29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
| 30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
| 31 | 31 | $ph['MessageInfo'] = implode("\n", $msg);
|
@@ -33,56 +33,56 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon');
|
| 35 | 35 | // setup icons |
| 36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 36 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
| 38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
| 38 | + $ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75); |
|
| 39 | 39 | } |
| 40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 40 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
| 42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
| 42 | + $ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99); |
|
| 43 | 43 | } |
| 44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 44 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
| 46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
| 46 | + $ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106); |
|
| 47 | 47 | } |
| 48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
|
| 48 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
|
|
| 49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
| 50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
| 50 | + $ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76); |
|
| 51 | 51 | } |
| 52 | -if($modx->hasPermission('bk_manager')) {
|
|
| 52 | +if ($modx->hasPermission('bk_manager')) {
|
|
| 53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
| 54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
| 54 | + $ph['BackupIcon'] = sprintf($iconTpl, $icon, 93); |
|
| 55 | 55 | } |
| 56 | -if($modx->hasPermission('help')) {
|
|
| 56 | +if ($modx->hasPermission('help')) {
|
|
| 57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
| 58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
| 58 | + $ph['HelpIcon'] = sprintf($iconTpl, $icon, 9); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | -if($modx->hasPermission('new_document')) {
|
|
| 61 | +if ($modx->hasPermission('new_document')) {
|
|
| 62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
| 63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
| 63 | + $ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4); |
|
| 64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
| 65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 65 | + $ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 66 | 66 | } |
| 67 | -if($modx->hasPermission('assets_images')) {
|
|
| 67 | +if ($modx->hasPermission('assets_images')) {
|
|
| 68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
| 69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 69 | + $ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 70 | 70 | } |
| 71 | -if($modx->hasPermission('assets_files')) {
|
|
| 71 | +if ($modx->hasPermission('assets_files')) {
|
|
| 72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
| 73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
| 73 | + $ph['FilesIcon'] = sprintf($iconTpl, $icon, 72); |
|
| 74 | 74 | } |
| 75 | -if($modx->hasPermission('change_password')) {
|
|
| 75 | +if ($modx->hasPermission('change_password')) {
|
|
| 76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
| 77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
| 77 | + $ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28); |
|
| 78 | 78 | } |
| 79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
| 80 | -$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
|
| 80 | +$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8); |
|
| 81 | 81 | |
| 82 | 82 | // do some config checks |
| 83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 85 | - if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 83 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 84 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
| 85 | + if ($config_check_results != $_lang['configcheck_ok']) {
|
|
| 86 | 86 | $ph['config_check_results'] = $config_check_results; |
| 87 | 87 | $ph['config_display'] = 'block'; |
| 88 | 88 | } else {
|
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Check logout-reminder |
| 96 | -if(isset($_SESSION['show_logout_reminder'])) {
|
|
| 97 | - switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 96 | +if (isset($_SESSION['show_logout_reminder'])) {
|
|
| 97 | + switch ($_SESSION['show_logout_reminder']['type']) {
|
|
| 98 | 98 | case 'logout_reminder': |
| 99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
| 100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | </tr> |
| 149 | 149 | </table>'; |
| 150 | 150 | |
| 151 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
| 151 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
| 152 | 152 | |
| 153 | 153 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
| 154 | 154 | 'username' => $modx->getLoginUserName(), |
@@ -163,10 +163,10 @@ discard block |
||
| 163 | 163 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
| 164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 165 | 165 | |
| 166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) {
|
|
| 166 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) {
|
|
| 167 | 167 | $html = '<p>[%no_active_users_found%]</p>'; |
| 168 | 168 | } else {
|
| 169 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 169 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
| 170 | 170 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
| 171 | 171 | $ph['now'] = strftime('%H:%M:%S', $now);
|
| 172 | 172 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $userList = array(); |
| 192 | 192 | $userCount = array(); |
| 193 | 193 | // Create userlist with session-count first before output |
| 194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) {
|
|
| 194 | + while ($activeusers = $modx->getDatabase()->getRow($rs)) {
|
|
| 195 | 195 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
| 196 | 196 | |
| 197 | 197 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -209,9 +209,9 @@ discard block |
||
| 209 | 209 | $currentaction |
| 210 | 210 | ); |
| 211 | 211 | } |
| 212 | - foreach($userList as $params) {
|
|
| 212 | + foreach ($userList as $params) {
|
|
| 213 | 213 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
| 214 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 214 | + $html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params);
|
|
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $html .= ' |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $ph['OnlineInfo'] = $html; |
| 224 | 224 | |
| 225 | 225 | // include rss feeds for important forum topics |
| 226 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
| 226 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
| 227 | 227 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
| 228 | 228 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
| 229 | 229 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | // invoke event OnManagerWelcomePrerender |
| 256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 257 | -if(is_array($evtOut)) {
|
|
| 257 | +if (is_array($evtOut)) {
|
|
| 258 | 258 | $output = implode('', $evtOut);
|
| 259 | 259 | $ph['OnManagerWelcomePrerender'] = $output; |
| 260 | 260 | } |
@@ -384,57 +384,57 @@ discard block |
||
| 384 | 384 | |
| 385 | 385 | // invoke OnManagerWelcomeHome event |
| 386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 387 | -if(is_array($sitewidgets)) {
|
|
| 387 | +if (is_array($sitewidgets)) {
|
|
| 388 | 388 | $newwidgets = array(); |
| 389 | - foreach($sitewidgets as $widget){
|
|
| 389 | + foreach ($sitewidgets as $widget) {
|
|
| 390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 391 | 391 | } |
| 392 | 392 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | -usort($widgets, function ($a, $b) {
|
|
| 395 | +usort($widgets, function($a, $b){
|
|
| 396 | 396 | return $a['menuindex'] - $b['menuindex']; |
| 397 | 397 | }); |
| 398 | 398 | |
| 399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget');
|
| 400 | 400 | $output = ''; |
| 401 | -foreach($widgets as $widget) {
|
|
| 402 | - if ($widget['hide'] != '1'){
|
|
| 401 | +foreach ($widgets as $widget) {
|
|
| 402 | + if ($widget['hide'] != '1') {
|
|
| 403 | 403 | $output .= $modx->parseText($tpl, $widget); |
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | $ph['widgets'] = $output; |
| 407 | 407 | |
| 408 | 408 | // load template |
| 409 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 410 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 409 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 410 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | $target = $modx->config['manager_welcome_tpl']; |
| 414 | 414 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
|
| 415 | 415 | $target = $modx->mergeSettingsContent($target); |
| 416 | 416 | |
| 417 | -if(substr($target, 0, 1) === '@') {
|
|
| 418 | - if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 417 | +if (substr($target, 0, 1) === '@') {
|
|
| 418 | + if (substr($target, 0, 6) === '@CHUNK') {
|
|
| 419 | 419 | $content = $modx->getChunk(trim(substr($target, 7))); |
| 420 | - } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 420 | + } elseif (substr($target, 0, 5) === '@FILE') {
|
|
| 421 | 421 | $content = file_get_contents(trim(substr($target, 6))); |
| 422 | 422 | } else {
|
| 423 | 423 | $content = ''; |
| 424 | 424 | } |
| 425 | 425 | } else {
|
| 426 | 426 | $chunk = $modx->getChunk($target); |
| 427 | - if($chunk !== false && !empty($chunk)) {
|
|
| 427 | + if ($chunk !== false && !empty($chunk)) {
|
|
| 428 | 428 | $content = $chunk; |
| 429 | - } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 430 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 432 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 429 | + } elseif (is_file(MODX_BASE_PATH.$target)) {
|
|
| 430 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
| 431 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) {
|
|
| 432 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
| 433 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible |
|
| 434 | 434 | {
|
| 435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 435 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
| 436 | 436 | } else {
|
| 437 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 437 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | $content = $modx->mergeConditionalTagsContent($content); |
| 443 | 443 | $content = $modx->mergeSettingsContent($content); |
| 444 | 444 | $content = $modx->parseText($content, $ph); |
| 445 | -if(strpos($content, '[+') !== false) {
|
|
| 445 | +if (strpos($content, '[+') !== false) {
|
|
| 446 | 446 | $modx->toPlaceholders($ph); |
| 447 | 447 | $content = $modx->mergePlaceholderContent($content); |
| 448 | 448 | } |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
| 452 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 453 | 453 | |
| 454 | -if($js = $modx->getRegisteredClientScripts()) {
|
|
| 454 | +if ($js = $modx->getRegisteredClientScripts()) {
|
|
| 455 | 455 | $content .= $js; |
| 456 | 456 | } |
| 457 | 457 | |
@@ -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 | exit(); |
| 4 | 4 | } |
| 5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | <?php |
| 42 | 42 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_templates')); |
| 43 | 43 | $option[] = '<option value="">No selected</option>'; |
| 44 | - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; |
|
| 44 | + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : ''; |
|
| 45 | 45 | $selected = $templateid === 0 ? ' selected="selected"' : ''; |
| 46 | - $option[] = '<option value="0"' . $selected . '>(blank)</option>'; |
|
| 46 | + $option[] = '<option value="0"'.$selected.'>(blank)</option>'; |
|
| 47 | 47 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 48 | 48 | $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); |
| 49 | 49 | $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); |
| 87 | 87 | $searchlongtitle = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
| 88 | 88 | $search_alias = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
| 89 | - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; |
|
| 89 | + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : ''; |
|
| 90 | 90 | $searchcontent = $modx->getDatabase()->escape($_REQUEST['content']); |
| 91 | 91 | |
| 92 | 92 | $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; |
@@ -100,12 +100,12 @@ discard block |
||
| 100 | 100 | $friendly_url_suffix = $modx->config['friendly_url_suffix']; |
| 101 | 101 | $base_url = $modx->config['base_url']; |
| 102 | 102 | $site_url = $modx->config['site_url']; |
| 103 | - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); |
|
| 103 | + $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url); |
|
| 104 | 104 | if ($url[0] === '/') { |
| 105 | - $url = preg_replace('@^' . $base_url . '@', '', $url); |
|
| 105 | + $url = preg_replace('@^'.$base_url.'@', '', $url); |
|
| 106 | 106 | } |
| 107 | 107 | if (substr($url, 0, 4) === 'http') { |
| 108 | - $url = preg_replace('@^' . $site_url . '@', '', $url); |
|
| 108 | + $url = preg_replace('@^'.$site_url.'@', '', $url); |
|
| 109 | 109 | } |
| 110 | 110 | $idFromAlias = $modx->getIdFromAlias($url); |
| 111 | 111 | } |
@@ -118,18 +118,18 @@ discard block |
||
| 118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
| 119 | 119 | $articul_result = $modx->getDatabase()->query($articul_query); |
| 120 | 120 | $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
| 121 | - if(count($articul_id_array)>0){ |
|
| 121 | + if (count($articul_id_array) > 0) { |
|
| 122 | 122 | $articul_id = ''; |
| 123 | 123 | $i = 1; |
| 124 | - foreach( $articul_id_array as $articul ) { |
|
| 125 | - $articul_id.=$articul['contentid']; |
|
| 126 | - if($i !== count($articul_id_array)){ |
|
| 127 | - $articul_id.=','; |
|
| 124 | + foreach ($articul_id_array as $articul) { |
|
| 125 | + $articul_id .= $articul['contentid']; |
|
| 126 | + if ($i !== count($articul_id_array)) { |
|
| 127 | + $articul_id .= ','; |
|
| 128 | 128 | } |
| 129 | 129 | $i++; |
| 130 | 130 | } |
| 131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
| 132 | - }else{ |
|
| 132 | + } else { |
|
| 133 | 133 | $articul_id_query = ''; |
| 134 | 134 | } |
| 135 | 135 | /*end search by TV*/ |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (ctype_digit($searchfields)) { |
| 138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
| 139 | 139 | if (strlen($searchfields) > 3) { |
| 140 | - $sqladd .= $articul_id_query;//search by TV |
|
| 140 | + $sqladd .= $articul_id_query; //search by TV |
|
| 141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
| 158 | 158 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
| 159 | 159 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
| 160 | - $sqladd .= $articul_id_query;//search by TV |
|
| 160 | + $sqladd .= $articul_id_query; //search by TV |
|
| 161 | 161 | $sqladd .= ")"; |
| 162 | 162 | } |
| 163 | 163 | } else if ($idFromAlias) { |
@@ -181,8 +181,8 @@ discard block |
||
| 181 | 181 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 182 | 182 | $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
| 183 | 183 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
| 184 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
| 185 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 184 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
| 185 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | if ($sqladd) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $where = $sqladd; |
| 193 | 193 | |
| 194 | 194 | if ($where) { |
| 195 | - $rs = $modx->getDatabase()->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
| 195 | + $rs = $modx->getDatabase()->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
| 196 | 196 | $limit = $modx->getDatabase()->getRecordCount($rs); |
| 197 | 197 | } else { |
| 198 | 198 | $limit = 0; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | if ($limit < 1) { |
| 212 | 212 | echo $_lang['search_empty']; |
| 213 | 213 | } else { |
| 214 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); |
|
| 214 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); |
|
| 215 | 215 | ?> |
| 216 | 216 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
| 217 | 217 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
@@ -271,14 +271,14 @@ discard block |
||
| 271 | 271 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
| 272 | 272 | ?> |
| 273 | 273 | <td<?= $tdClass ?>> |
| 274 | - <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a> |
|
| 274 | + <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a> |
|
| 275 | 275 | </td> |
| 276 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
| 276 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
| 277 | 277 | <?php |
| 278 | 278 | } else { |
| 279 | 279 | ?> |
| 280 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
| 281 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
| 280 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
| 281 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
| 282 | 282 | <?php |
| 283 | 283 | } |
| 284 | 284 | ?> |
@@ -298,115 +298,115 @@ discard block |
||
| 298 | 298 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
| 299 | 299 | $docscounts = $modx->getDatabase()->getRecordCount($rs); |
| 300 | 300 | if ($docscounts > 0) { |
| 301 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
| 301 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
| 302 | 302 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 303 | - $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 303 | + $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | //templates |
| 309 | 309 | if ($modx->hasPermission('edit_template')) { |
| 310 | - $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
| 311 | - OR `templatename` like '%" . $searchfields . "%' |
|
| 312 | - OR `description` like '%" . $searchfields . "%' |
|
| 313 | - OR `content` like '%" . $searchfields . "%'"); |
|
| 310 | + $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
| 311 | + OR `templatename` like '%" . $searchfields."%' |
|
| 312 | + OR `description` like '%" . $searchfields."%' |
|
| 313 | + OR `content` like '%" . $searchfields."%'"); |
|
| 314 | 314 | $templatecounts = $modx->getDatabase()->getRecordCount($rs); |
| 315 | 315 | if ($templatecounts > 0) { |
| 316 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
| 316 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
| 317 | 317 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 318 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 318 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | //tvs |
| 324 | 324 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
| 325 | - $rs = $modx->getDatabase()->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
| 326 | - OR `name` like '%" . $searchfields . "%' |
|
| 327 | - OR `description` like '%" . $searchfields . "%' |
|
| 328 | - OR `type` like '%" . $searchfields . "%' |
|
| 329 | - OR `elements` like '%" . $searchfields . "%' |
|
| 330 | - OR `display` like '%" . $searchfields . "%' |
|
| 331 | - OR `display_params` like '%" . $searchfields . "%' |
|
| 332 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
| 325 | + $rs = $modx->getDatabase()->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
| 326 | + OR `name` like '%" . $searchfields."%' |
|
| 327 | + OR `description` like '%" . $searchfields."%' |
|
| 328 | + OR `type` like '%" . $searchfields."%' |
|
| 329 | + OR `elements` like '%" . $searchfields."%' |
|
| 330 | + OR `display` like '%" . $searchfields."%' |
|
| 331 | + OR `display_params` like '%" . $searchfields."%' |
|
| 332 | + OR `default_text` like '%" . $searchfields."%'"); |
|
| 333 | 333 | $tvscounts = $modx->getDatabase()->getRecordCount($rs); |
| 334 | 334 | if ($tvscounts > 0) { |
| 335 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
| 335 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
| 336 | 336 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 337 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 337 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | //Chunks |
| 343 | 343 | if ($modx->hasPermission('edit_chunk')) { |
| 344 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
| 345 | - OR `name` like '%" . $searchfields . "%' |
|
| 346 | - OR `description` like '%" . $searchfields . "%' |
|
| 347 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
| 344 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
| 345 | + OR `name` like '%" . $searchfields."%' |
|
| 346 | + OR `description` like '%" . $searchfields."%' |
|
| 347 | + OR `snippet` like '%" . $searchfields."%'"); |
|
| 348 | 348 | $chunkscounts = $modx->getDatabase()->getRecordCount($rs); |
| 349 | 349 | if ($chunkscounts > 0) { |
| 350 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
| 350 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
| 351 | 351 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 352 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 352 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 353 | 353 | } |
| 354 | 354 | } |
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | //Snippets |
| 358 | 358 | if ($modx->hasPermission('edit_snippet')) { |
| 359 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
| 360 | - OR `name` like '%" . $searchfields . "%' |
|
| 361 | - OR `description` like '%" . $searchfields . "%' |
|
| 362 | - OR `snippet` like '%" . $searchfields . "%' |
|
| 363 | - OR `properties` like '%" . $searchfields . "%' |
|
| 364 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
| 359 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
| 360 | + OR `name` like '%" . $searchfields."%' |
|
| 361 | + OR `description` like '%" . $searchfields."%' |
|
| 362 | + OR `snippet` like '%" . $searchfields."%' |
|
| 363 | + OR `properties` like '%" . $searchfields."%' |
|
| 364 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
| 365 | 365 | $snippetscounts = $modx->getDatabase()->getRecordCount($rs); |
| 366 | 366 | if ($snippetscounts > 0) { |
| 367 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
| 367 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
| 368 | 368 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 369 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 369 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 370 | 370 | } |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | //plugins |
| 375 | 375 | if ($modx->hasPermission('edit_plugin')) { |
| 376 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
| 377 | - OR `name` like '%" . $searchfields . "%' |
|
| 378 | - OR `description` like '%" . $searchfields . "%' |
|
| 379 | - OR `plugincode` like '%" . $searchfields . "%' |
|
| 380 | - OR `properties` like '%" . $searchfields . "%' |
|
| 381 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
| 376 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
| 377 | + OR `name` like '%" . $searchfields."%' |
|
| 378 | + OR `description` like '%" . $searchfields."%' |
|
| 379 | + OR `plugincode` like '%" . $searchfields."%' |
|
| 380 | + OR `properties` like '%" . $searchfields."%' |
|
| 381 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
| 382 | 382 | $pluginscounts = $modx->getDatabase()->getRecordCount($rs); |
| 383 | 383 | if ($pluginscounts > 0) { |
| 384 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
| 384 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
| 385 | 385 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 386 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 386 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 387 | 387 | } |
| 388 | 388 | } |
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | //modules |
| 392 | 392 | if ($modx->hasPermission('edit_module')) { |
| 393 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
| 394 | - OR `name` like '%" . $searchfields . "%' |
|
| 395 | - OR `description` like '%" . $searchfields . "%' |
|
| 396 | - OR `modulecode` like '%" . $searchfields . "%' |
|
| 397 | - OR `properties` like '%" . $searchfields . "%' |
|
| 398 | - OR `guid` like '%" . $searchfields . "%' |
|
| 399 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
| 393 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
| 394 | + OR `name` like '%" . $searchfields."%' |
|
| 395 | + OR `description` like '%" . $searchfields."%' |
|
| 396 | + OR `modulecode` like '%" . $searchfields."%' |
|
| 397 | + OR `properties` like '%" . $searchfields."%' |
|
| 398 | + OR `guid` like '%" . $searchfields."%' |
|
| 399 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
| 400 | 400 | $modulescounts = $modx->getDatabase()->getRecordCount($rs); |
| 401 | 401 | if ($modulescounts > 0) { |
| 402 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
| 402 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
| 403 | 403 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 404 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 404 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
| 409 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | ?> |
@@ -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->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->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->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->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->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); |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | // include the country list language file |
| 89 | 89 | $_country_lang = array(); |
| 90 | 90 | include_once "lang/country/english_country.inc.php"; |
| 91 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
| 92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
| 91 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
| 92 | + include_once "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 | <?php echo $_style['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 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->getPhpCompat()->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> |
| 248 | 248 | <input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
| 256 | 256 | </tr> |
| 257 | 257 | <tr> |
| 258 | - <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
| 258 | + <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
| 259 | 259 | <td> </td> |
| 260 | 260 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "11" ? " checked disabled" : ""; ?>> |
| 261 | 261 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -309,8 +309,8 @@ discard block |
||
| 309 | 309 | ?> |
| 310 | 310 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
| 311 | 311 | <?php |
| 312 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 313 | - if($modx->getManagerApi()->action == '11') { |
|
| 312 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 313 | + if ($modx->getManagerApi()->action == '11') { |
|
| 314 | 314 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
| 315 | 315 | } else { |
| 316 | 316 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -364,8 +364,8 @@ discard block |
||
| 364 | 364 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
| 365 | 365 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
| 366 | 366 | <?php |
| 367 | - foreach($_country_lang as $key => $country) { |
|
| 368 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
| 367 | + foreach ($_country_lang as $key => $country) { |
|
| 368 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
| 369 | 369 | } |
| 370 | 370 | ?> |
| 371 | 371 | </select></td> |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | <td> </td> |
| 392 | 392 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars($userdata['comment']); ?></textarea></td> |
| 393 | 393 | </tr> |
| 394 | - <?php if($modx->getManagerApi()->action == '12') { ?> |
|
| 394 | + <?php if ($modx->getManagerApi()->action == '12') { ?> |
|
| 395 | 395 | <tr> |
| 396 | 396 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
| 397 | 397 | <td> </td> |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | </tr> |
| 429 | 429 | <?php } ?> |
| 430 | 430 | </table> |
| 431 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 431 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
| 432 | 432 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
| 433 | 433 | <?php } ?> |
| 434 | 434 | </div> |
@@ -445,8 +445,8 @@ discard block |
||
| 445 | 445 | <?php |
| 446 | 446 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
| 447 | 447 | $dir = dir("includes/lang"); |
| 448 | - while($file = $dir->read()) { |
|
| 449 | - if(strpos($file, ".inc.php") > 0) { |
|
| 448 | + while ($file = $dir->read()) { |
|
| 449 | + if (strpos($file, ".inc.php") > 0) { |
|
| 450 | 450 | $endpos = strpos($file, "."); |
| 451 | 451 | $languagename = substr($file, 0, $endpos); |
| 452 | 452 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -533,17 +533,17 @@ discard block |
||
| 533 | 533 | <option value=""></option> |
| 534 | 534 | <?php |
| 535 | 535 | $dir = dir("media/style/"); |
| 536 | - while($file = $dir->read()) { |
|
| 537 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 536 | + while ($file = $dir->read()) { |
|
| 537 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
| 538 | 538 | $themename = $file; |
| 539 | - if($themename === 'common') { |
|
| 539 | + if ($themename === 'common') { |
|
| 540 | 540 | continue; |
| 541 | 541 | } |
| 542 | - $attr = 'value="' . $themename . '" '; |
|
| 543 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 542 | + $attr = 'value="'.$themename.'" '; |
|
| 543 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
| 544 | 544 | $attr .= 'selected="selected" '; |
| 545 | 545 | } |
| 546 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
| 546 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
| 547 | 547 | } |
| 548 | 548 | } |
| 549 | 549 | $dir->close(); |
@@ -584,12 +584,12 @@ discard block |
||
| 584 | 584 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
| 585 | 585 | <?php |
| 586 | 586 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 587 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
| 588 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 587 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
| 588 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
| 589 | 589 | $dir = str_replace('\\', '/', $dir); |
| 590 | 590 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
| 591 | 591 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
| 592 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
| 592 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
| 593 | 593 | } |
| 594 | 594 | ?> |
| 595 | 595 | </select></td> |
@@ -616,7 +616,7 @@ discard block |
||
| 616 | 616 | </tr> |
| 617 | 617 | <tr> |
| 618 | 618 | <td> </td> |
| 619 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
| 619 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
| 620 | 620 | </tr> |
| 621 | 621 | <tr> |
| 622 | 622 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | </tr> |
| 629 | 629 | <tr> |
| 630 | 630 | <td> </td> |
| 631 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
| 631 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
| 632 | 632 | </tr> |
| 633 | 633 | <tr> |
| 634 | 634 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -640,7 +640,7 @@ discard block |
||
| 640 | 640 | </tr> |
| 641 | 641 | <tr> |
| 642 | 642 | <td> </td> |
| 643 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
| 643 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
| 644 | 644 | </tr> |
| 645 | 645 | <tr> |
| 646 | 646 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | </tr> |
| 653 | 653 | <tr> |
| 654 | 654 | <td> </td> |
| 655 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
| 655 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
| 656 | 656 | </tr> |
| 657 | 657 | <tr class='row2'> |
| 658 | 658 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -671,11 +671,11 @@ discard block |
||
| 671 | 671 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
| 672 | 672 | // invoke OnRichTextEditorRegister event |
| 673 | 673 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
| 674 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
| 675 | - if(is_array($evtOut)) { |
|
| 676 | - for($i = 0; $i < count($evtOut); $i++) { |
|
| 674 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
| 675 | + if (is_array($evtOut)) { |
|
| 676 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
| 677 | 677 | $editor = $evtOut[$i]; |
| 678 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
| 678 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | ?> |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | <?php |
| 714 | 714 | // invoke OnInterfaceSettingsRender event |
| 715 | 715 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
| 716 | - if(is_array($evtOut)) { |
|
| 716 | + if (is_array($evtOut)) { |
|
| 717 | 717 | echo implode("", $evtOut); |
| 718 | 718 | } |
| 719 | 719 | ?> |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | function BrowseServer() { |
| 741 | 741 | var w = screen.width * 0.7; |
| 742 | 742 | var h = screen.height * 0.7; |
| 743 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
| 743 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | function SetUrl(url, width, height, alt) { |
@@ -763,17 +763,17 @@ discard block |
||
| 763 | 763 | </tr> |
| 764 | 764 | </table> |
| 765 | 765 | </div> |
| 766 | - <?php if($use_udperms == 1) { |
|
| 766 | + <?php if ($use_udperms == 1) { |
|
| 767 | 767 | |
| 768 | 768 | $groupsarray = array(); |
| 769 | 769 | |
| 770 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
| 770 | + if ($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
| 771 | 771 | $rs = $modx->getDatabase()->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
| 772 | 772 | $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
| 773 | 773 | } |
| 774 | 774 | // retain selected doc groups between post |
| 775 | - if(is_array($_POST['user_groups'])) { |
|
| 776 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 775 | + if (is_array($_POST['user_groups'])) { |
|
| 776 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
| 777 | 777 | } |
| 778 | 778 | ?> |
| 779 | 779 | <div class="tab-page" id="tabAccess"> |
@@ -782,8 +782,8 @@ discard block |
||
| 782 | 782 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
| 783 | 783 | <?php |
| 784 | 784 | $rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
| 785 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
| 786 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
| 785 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
| 786 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
| 787 | 787 | } |
| 788 | 788 | } |
| 789 | 789 | ?> |
@@ -796,7 +796,7 @@ discard block |
||
| 796 | 796 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
| 797 | 797 | "id" => $user |
| 798 | 798 | )); |
| 799 | - if(is_array($evtOut)) { |
|
| 799 | + if (is_array($evtOut)) { |
|
| 800 | 800 | echo implode("", $evtOut); |
| 801 | 801 | } |
| 802 | 802 | ?> |