@@ -1,17 +1,17 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 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('import_static')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | // Files to upload |
| 10 | 10 | $allowedfiles = array( |
| 11 | - 'html', |
|
| 12 | - 'htm', |
|
| 13 | - 'shtml', |
|
| 14 | - 'xml' |
|
| 11 | + 'html', |
|
| 12 | + 'htm', |
|
| 13 | + 'shtml', |
|
| 14 | + 'xml' |
|
| 15 | 15 | ); |
| 16 | 16 | ?> |
| 17 | 17 | <script language="javascript"> |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | <div class="tab-page"> |
| 44 | 44 | <div class="container container-body"> |
| 45 | 45 | <?php |
| 46 | - if(!isset($_POST['import'])) { |
|
| 47 | - echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>"; |
|
| 48 | - ?> |
|
| 46 | + if(!isset($_POST['import'])) { |
|
| 47 | + echo "<div class=\"element-edit-message\">" . $_lang['import_site_message'] . "</div>"; |
|
| 48 | + ?> |
|
| 49 | 49 | <form action="index.php" method="post" name="importFrm"> |
| 50 | 50 | <input type="hidden" name="import" value="import" /> |
| 51 | 51 | <input type="hidden" name="a" value="95" /> |
@@ -85,18 +85,18 @@ discard block |
||
| 85 | 85 | <a href="javascript:;" class="btn btn-primary" onclick="window.importFrm.submit();"><i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang["import_site_start"] ?></a> |
| 86 | 86 | </form> |
| 87 | 87 | <?php |
| 88 | - } else { |
|
| 89 | - run(); |
|
| 90 | - $modx->clearCache('full'); |
|
| 91 | - ?> |
|
| 88 | + } else { |
|
| 89 | + run(); |
|
| 90 | + $modx->clearCache('full'); |
|
| 91 | + ?> |
|
| 92 | 92 | <a href="javascript:;" class="btn btn-primary" onclick="window.location.href='index.php?a=2';"><i class="<?= $_style["actions_close"] ?>"></i> <?= $_lang["close"] ?></a> |
| 93 | 93 | <script type="text/javascript"> |
| 94 | 94 | top.mainMenu.reloadtree(); |
| 95 | 95 | parent.tree.ca = 'open'; |
| 96 | 96 | </script> |
| 97 | 97 | <?php |
| 98 | - } |
|
| 99 | - ?> |
|
| 98 | + } |
|
| 99 | + ?> |
|
| 100 | 100 | </div> |
| 101 | 101 | </div> |
| 102 | 102 | |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | $field['menuindex'] = 1; |
| 217 | 217 | $find = false; |
| 218 | 218 | foreach (array( |
| 219 | - 'index.html', |
|
| 220 | - 'index.htm' |
|
| 221 | - ) as $filename) { |
|
| 219 | + 'index.html', |
|
| 220 | + 'index.htm' |
|
| 221 | + ) as $filename) { |
|
| 222 | 222 | $filepath = $filedir . $alias . '/' . $filename; |
| 223 | 223 | if ($find === false && file_exists($filepath)) { |
| 224 | 224 | $file = getFileContent($filepath); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 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 | /********************/ |
@@ -12,29 +12,29 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | // check permissions |
| 14 | 14 | switch($modx->manager->action) { |
| 15 | - case 27: |
|
| 16 | - if(!$modx->hasPermission('edit_document')) { |
|
| 17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 18 | - } |
|
| 19 | - break; |
|
| 20 | - case 85: |
|
| 21 | - case 72: |
|
| 22 | - case 4: |
|
| 23 | - if(!$modx->hasPermission('new_document')) { |
|
| 24 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 25 | - } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
| 26 | - // check user has permissions for parent |
|
| 27 | - $udperms = new EvolutionCMS\Legacy\Permissions(); |
|
| 28 | - $udperms->user = $modx->getLoginUserID(); |
|
| 29 | - $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
|
| 30 | - $udperms->role = $_SESSION['mgrRole']; |
|
| 31 | - if(!$udperms->checkPermissions()) { |
|
| 32 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 33 | - } |
|
| 34 | - } |
|
| 35 | - break; |
|
| 36 | - default: |
|
| 37 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + case 27: |
|
| 16 | + if(!$modx->hasPermission('edit_document')) { |
|
| 17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 18 | + } |
|
| 19 | + break; |
|
| 20 | + case 85: |
|
| 21 | + case 72: |
|
| 22 | + case 4: |
|
| 23 | + if(!$modx->hasPermission('new_document')) { |
|
| 24 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 25 | + } elseif(isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
|
| 26 | + // check user has permissions for parent |
|
| 27 | + $udperms = new EvolutionCMS\Legacy\Permissions(); |
|
| 28 | + $udperms->user = $modx->getLoginUserID(); |
|
| 29 | + $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
|
| 30 | + $udperms->role = $_SESSION['mgrRole']; |
|
| 31 | + if(!$udperms->checkPermissions()) { |
|
| 32 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 33 | + } |
|
| 34 | + } |
|
| 35 | + break; |
|
| 36 | + default: |
|
| 37 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -53,21 +53,21 @@ discard block |
||
| 53 | 53 | $tbl_site_tmplvars = $modx->getFullTableName('site_tmplvars'); |
| 54 | 54 | |
| 55 | 55 | if($modx->manager->action == 27) { |
| 56 | - //editing an existing document |
|
| 57 | - // check permissions on the document |
|
| 58 | - $udperms = new EvolutionCMS\Legacy\Permissions(); |
|
| 59 | - $udperms->user = $modx->getLoginUserID(); |
|
| 60 | - $udperms->document = $id; |
|
| 61 | - $udperms->role = $_SESSION['mgrRole']; |
|
| 62 | - |
|
| 63 | - if(!$udperms->checkPermissions()) { |
|
| 64 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 65 | - } |
|
| 56 | + //editing an existing document |
|
| 57 | + // check permissions on the document |
|
| 58 | + $udperms = new EvolutionCMS\Legacy\Permissions(); |
|
| 59 | + $udperms->user = $modx->getLoginUserID(); |
|
| 60 | + $udperms->document = $id; |
|
| 61 | + $udperms->role = $_SESSION['mgrRole']; |
|
| 62 | + |
|
| 63 | + if(!$udperms->checkPermissions()) { |
|
| 64 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 65 | + } |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // check to see if resource isn't locked |
| 69 | 69 | if($lockedEl = $modx->elementIsLocked(7, $id)) { |
| 70 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); |
|
| 70 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['resource'])); |
|
| 71 | 71 | } |
| 72 | 72 | // end check for lock |
| 73 | 73 | |
@@ -76,74 +76,74 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // get document groups for current user |
| 78 | 78 | if($_SESSION['mgrDocgroups']) { |
| 79 | - $docgrp = implode(',', $_SESSION['mgrDocgroups']); |
|
| 79 | + $docgrp = implode(',', $_SESSION['mgrDocgroups']); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | if(!empty ($id)) { |
| 83 | - $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); |
|
| 84 | - if($docgrp) { |
|
| 85 | - $access .= " OR dg.document_group IN ({$docgrp})"; |
|
| 86 | - } |
|
| 87 | - $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); |
|
| 88 | - $content = array(); |
|
| 89 | - $content = $modx->db->getRow($rs); |
|
| 90 | - $modx->documentObject = &$content; |
|
| 91 | - if(!$content) { |
|
| 92 | - $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 93 | - } |
|
| 94 | - $_SESSION['itemname'] = $content['pagetitle']; |
|
| 83 | + $access = sprintf("1='%s' OR sc.privatemgr=0", $_SESSION['mgrRole']); |
|
| 84 | + if($docgrp) { |
|
| 85 | + $access .= " OR dg.document_group IN ({$docgrp})"; |
|
| 86 | + } |
|
| 87 | + $rs = $modx->db->select('sc.*', "{$tbl_site_content} AS sc LEFT JOIN {$tbl_document_groups} AS dg ON dg.document=sc.id", "sc.id='{$id}' AND ({$access})"); |
|
| 88 | + $content = array(); |
|
| 89 | + $content = $modx->db->getRow($rs); |
|
| 90 | + $modx->documentObject = &$content; |
|
| 91 | + if(!$content) { |
|
| 92 | + $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
|
| 93 | + } |
|
| 94 | + $_SESSION['itemname'] = $content['pagetitle']; |
|
| 95 | 95 | } else { |
| 96 | - $content = array(); |
|
| 96 | + $content = array(); |
|
| 97 | 97 | |
| 98 | - if(isset($_REQUEST['newtemplate'])) { |
|
| 99 | - $content['template'] = $_REQUEST['newtemplate']; |
|
| 100 | - } else { |
|
| 101 | - $content['template'] = getDefaultTemplate(); |
|
| 102 | - } |
|
| 98 | + if(isset($_REQUEST['newtemplate'])) { |
|
| 99 | + $content['template'] = $_REQUEST['newtemplate']; |
|
| 100 | + } else { |
|
| 101 | + $content['template'] = getDefaultTemplate(); |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - $_SESSION['itemname'] = $_lang["new_resource"]; |
|
| 104 | + $_SESSION['itemname'] = $_lang["new_resource"]; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // restore saved form |
| 108 | 108 | $formRestored = $modx->manager->loadFormValues(); |
| 109 | 109 | if(isset($_REQUEST['newtemplate'])) { |
| 110 | - $formRestored = true; |
|
| 110 | + $formRestored = true; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | // retain form values if template was changed |
| 114 | 114 | // edited to convert pub_date and unpub_date |
| 115 | 115 | // sottwell 02-09-2006 |
| 116 | 116 | if($formRestored == true) { |
| 117 | - $content = array_merge($content, $_POST); |
|
| 118 | - $content['content'] = $_POST['ta']; |
|
| 119 | - if(empty ($content['pub_date'])) { |
|
| 120 | - unset ($content['pub_date']); |
|
| 121 | - } else { |
|
| 122 | - $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); |
|
| 123 | - } |
|
| 124 | - if(empty ($content['unpub_date'])) { |
|
| 125 | - unset ($content['unpub_date']); |
|
| 126 | - } else { |
|
| 127 | - $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); |
|
| 128 | - } |
|
| 117 | + $content = array_merge($content, $_POST); |
|
| 118 | + $content['content'] = $_POST['ta']; |
|
| 119 | + if(empty ($content['pub_date'])) { |
|
| 120 | + unset ($content['pub_date']); |
|
| 121 | + } else { |
|
| 122 | + $content['pub_date'] = $modx->toTimeStamp($content['pub_date']); |
|
| 123 | + } |
|
| 124 | + if(empty ($content['unpub_date'])) { |
|
| 125 | + unset ($content['unpub_date']); |
|
| 126 | + } else { |
|
| 127 | + $content['unpub_date'] = $modx->toTimeStamp($content['unpub_date']); |
|
| 128 | + } |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | // increase menu index if this is a new document |
| 132 | 132 | if(!isset ($_REQUEST['id'])) { |
| 133 | - if(!isset ($modx->config['auto_menuindex'])) { |
|
| 134 | - $modx->config['auto_menuindex'] = 1; |
|
| 135 | - } |
|
| 136 | - if($modx->config['auto_menuindex']) { |
|
| 137 | - $pid = (int)$_REQUEST['pid']; |
|
| 138 | - $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
|
| 139 | - $content['menuindex'] = $modx->db->getValue($rs); |
|
| 140 | - } else { |
|
| 141 | - $content['menuindex'] = 0; |
|
| 142 | - } |
|
| 133 | + if(!isset ($modx->config['auto_menuindex'])) { |
|
| 134 | + $modx->config['auto_menuindex'] = 1; |
|
| 135 | + } |
|
| 136 | + if($modx->config['auto_menuindex']) { |
|
| 137 | + $pid = (int)$_REQUEST['pid']; |
|
| 138 | + $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
|
| 139 | + $content['menuindex'] = $modx->db->getValue($rs); |
|
| 140 | + } else { |
|
| 141 | + $content['menuindex'] = 0; |
|
| 142 | + } |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | if(isset ($_POST['which_editor'])) { |
| 146 | - $modx->config['which_editor'] = $_POST['which_editor']; |
|
| 146 | + $modx->config['which_editor'] = $_POST['which_editor']; |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | // Add lock-element JS-Script |
@@ -543,23 +543,23 @@ discard block |
||
| 543 | 543 | |
| 544 | 544 | <form name="mutate" id="mutate" class="content" method="post" enctype="multipart/form-data" action="index.php" onsubmit="documentDirty=false;"> |
| 545 | 545 | <?php |
| 546 | - // invoke OnDocFormPrerender event |
|
| 547 | - $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( |
|
| 548 | - 'id' => $id, |
|
| 549 | - 'template' => $content['template'] |
|
| 550 | - )); |
|
| 551 | - |
|
| 552 | - if(is_array($evtOut)) { |
|
| 553 | - echo implode('', $evtOut); |
|
| 554 | - } |
|
| 546 | + // invoke OnDocFormPrerender event |
|
| 547 | + $evtOut = $modx->invokeEvent('OnDocFormPrerender', array( |
|
| 548 | + 'id' => $id, |
|
| 549 | + 'template' => $content['template'] |
|
| 550 | + )); |
|
| 551 | + |
|
| 552 | + if(is_array($evtOut)) { |
|
| 553 | + echo implode('', $evtOut); |
|
| 554 | + } |
|
| 555 | 555 | |
| 556 | - /*************************/ |
|
| 557 | - $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; |
|
| 558 | - $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; |
|
| 559 | - $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; |
|
| 560 | - /*************************/ |
|
| 556 | + /*************************/ |
|
| 557 | + $dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : ''; |
|
| 558 | + $sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : 'createdon'; |
|
| 559 | + $page = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : ''; |
|
| 560 | + /*************************/ |
|
| 561 | 561 | |
| 562 | - ?> |
|
| 562 | + ?> |
|
| 563 | 563 | <input type="hidden" name="a" value="5" /> |
| 564 | 564 | <input type="hidden" name="id" value="<?= $content['id'] ?>" /> |
| 565 | 565 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>" /> |
@@ -574,54 +574,54 @@ discard block |
||
| 574 | 574 | |
| 575 | 575 | <h1> |
| 576 | 576 | <i class="fa fa-pencil-square-o"></i><?php if(isset($_REQUEST['id'])) { |
| 577 | - echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>'; |
|
| 578 | - } else { |
|
| 579 | - if ($modx->manager->action == '4') { |
|
| 577 | + echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>'; |
|
| 578 | + } else { |
|
| 579 | + if ($modx->manager->action == '4') { |
|
| 580 | 580 | echo $_lang['add_resource']; |
| 581 | 581 | } else if ($modx->manager->action == '72') { |
| 582 | 582 | echo $_lang['add_weblink']; |
| 583 | 583 | } else { |
| 584 | 584 | echo $_lang['create_resource_title']; |
| 585 | 585 | } |
| 586 | - } ?> |
|
| 586 | + } ?> |
|
| 587 | 587 | </h1> |
| 588 | 588 | |
| 589 | 589 | <?= $_style['actionbuttons']['dynamic']['document'] ?> |
| 590 | 590 | |
| 591 | 591 | <?php |
| 592 | - // breadcrumbs |
|
| 593 | - if($modx->config['use_breadcrumbs']) { |
|
| 594 | - $temp = array(); |
|
| 595 | - $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; |
|
| 596 | - |
|
| 597 | - if(isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
| 598 | - $bID = (int) $_REQUEST['id']; |
|
| 599 | - $temp = $modx->getParentIds($bID); |
|
| 600 | - } else if(isset($_REQUEST['pid'])) { |
|
| 601 | - $bID = (int) $_REQUEST['pid']; |
|
| 602 | - $temp = $modx->getParentIds($bID); |
|
| 603 | - array_unshift($temp, $bID); |
|
| 604 | - } |
|
| 592 | + // breadcrumbs |
|
| 593 | + if($modx->config['use_breadcrumbs']) { |
|
| 594 | + $temp = array(); |
|
| 595 | + $title = isset($content['pagetitle']) ? $content['pagetitle'] : $_lang['create_resource_title']; |
|
| 596 | + |
|
| 597 | + if(isset($_REQUEST['id']) && $content['parent'] != 0) { |
|
| 598 | + $bID = (int) $_REQUEST['id']; |
|
| 599 | + $temp = $modx->getParentIds($bID); |
|
| 600 | + } else if(isset($_REQUEST['pid'])) { |
|
| 601 | + $bID = (int) $_REQUEST['pid']; |
|
| 602 | + $temp = $modx->getParentIds($bID); |
|
| 603 | + array_unshift($temp, $bID); |
|
| 604 | + } |
|
| 605 | 605 | |
| 606 | - if($temp) { |
|
| 607 | - $parents = implode(',', $temp); |
|
| 606 | + if($temp) { |
|
| 607 | + $parents = implode(',', $temp); |
|
| 608 | 608 | |
| 609 | - if(!empty($parents)) { |
|
| 610 | - $where = "FIND_IN_SET(id,'{$parents}') DESC"; |
|
| 611 | - $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
|
| 612 | - while($row = $modx->db->getRow($rs)) { |
|
| 613 | - $out .= '<li class="breadcrumbs__li"> |
|
| 609 | + if(!empty($parents)) { |
|
| 610 | + $where = "FIND_IN_SET(id,'{$parents}') DESC"; |
|
| 611 | + $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
|
| 612 | + while($row = $modx->db->getRow($rs)) { |
|
| 613 | + $out .= '<li class="breadcrumbs__li"> |
|
| 614 | 614 | <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a> |
| 615 | 615 | <span class="breadcrumbs__sep">></span> |
| 616 | 616 | </li>'; |
| 617 | - } |
|
| 618 | - } |
|
| 619 | - } |
|
| 617 | + } |
|
| 618 | + } |
|
| 619 | + } |
|
| 620 | 620 | |
| 621 | - $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
| 622 | - echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
| 623 | - } |
|
| 624 | - ?> |
|
| 621 | + $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
| 622 | + echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
| 623 | + } |
|
| 624 | + ?> |
|
| 625 | 625 | |
| 626 | 626 | <!-- start main wrapper --> |
| 627 | 627 | <div class="sectionBody"> |
@@ -633,13 +633,13 @@ discard block |
||
| 633 | 633 | |
| 634 | 634 | <!-- General --> |
| 635 | 635 | <?php |
| 636 | - $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( |
|
| 637 | - 'id' => $id |
|
| 638 | - )); |
|
| 639 | - if(is_array($evtOut)) { |
|
| 640 | - echo implode('', $evtOut); |
|
| 641 | - } else { |
|
| 642 | - ?> |
|
| 636 | + $evtOut = $modx->invokeEvent('OnDocFormTemplateRender', array( |
|
| 637 | + 'id' => $id |
|
| 638 | + )); |
|
| 639 | + if(is_array($evtOut)) { |
|
| 640 | + echo implode('', $evtOut); |
|
| 641 | + } else { |
|
| 642 | + ?> |
|
| 643 | 643 | <div class="tab-page" id="tabGeneral"> |
| 644 | 644 | <h2 class="tab"><?= $_lang['settings_general'] ?></h2> |
| 645 | 645 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById("tabGeneral"));</script> |
@@ -724,36 +724,36 @@ discard block |
||
| 724 | 724 | <select id="template" name="template" class="inputBox" onchange="templateWarning();"> |
| 725 | 725 | <option value="0">(blank)</option> |
| 726 | 726 | <?php |
| 727 | - $field = "t.templatename, t.selectable, t.id, c.category"; |
|
| 728 | - $from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id"; |
|
| 729 | - $rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC'); |
|
| 730 | - $currentCategory = ''; |
|
| 731 | - while($row = $modx->db->getRow($rs)) { |
|
| 732 | - if($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
| 733 | - continue; |
|
| 734 | - }; |
|
| 735 | - // Skip if not selectable but show if selected! |
|
| 736 | - $thisCategory = $row['category']; |
|
| 737 | - if($thisCategory == null) { |
|
| 738 | - $thisCategory = $_lang["no_category"]; |
|
| 739 | - } |
|
| 740 | - if($thisCategory != $currentCategory) { |
|
| 741 | - if($closeOptGroup) { |
|
| 742 | - echo "\t\t\t\t\t</optgroup>\n"; |
|
| 743 | - } |
|
| 744 | - echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
|
| 745 | - $closeOptGroup = true; |
|
| 746 | - } |
|
| 727 | + $field = "t.templatename, t.selectable, t.id, c.category"; |
|
| 728 | + $from = "{$tbl_site_templates} AS t LEFT JOIN {$tbl_categories} AS c ON t.category = c.id"; |
|
| 729 | + $rs = $modx->db->select($field, $from, '', 'c.category, t.templatename ASC'); |
|
| 730 | + $currentCategory = ''; |
|
| 731 | + while($row = $modx->db->getRow($rs)) { |
|
| 732 | + if($row['selectable'] != 1 && $row['id'] != $content['template']) { |
|
| 733 | + continue; |
|
| 734 | + }; |
|
| 735 | + // Skip if not selectable but show if selected! |
|
| 736 | + $thisCategory = $row['category']; |
|
| 737 | + if($thisCategory == null) { |
|
| 738 | + $thisCategory = $_lang["no_category"]; |
|
| 739 | + } |
|
| 740 | + if($thisCategory != $currentCategory) { |
|
| 741 | + if($closeOptGroup) { |
|
| 742 | + echo "\t\t\t\t\t</optgroup>\n"; |
|
| 743 | + } |
|
| 744 | + echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
|
| 745 | + $closeOptGroup = true; |
|
| 746 | + } |
|
| 747 | 747 | |
| 748 | - $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
|
| 748 | + $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
|
| 749 | 749 | |
| 750 | - echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
| 751 | - $currentCategory = $thisCategory; |
|
| 752 | - } |
|
| 753 | - if($thisCategory != '') { |
|
| 754 | - echo "\t\t\t\t\t</optgroup>\n"; |
|
| 755 | - } |
|
| 756 | - ?> |
|
| 750 | + echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
| 751 | + $currentCategory = $thisCategory; |
|
| 752 | + } |
|
| 753 | + if($thisCategory != '') { |
|
| 754 | + echo "\t\t\t\t\t</optgroup>\n"; |
|
| 755 | + } |
|
| 756 | + ?> |
|
| 757 | 757 | </select> |
| 758 | 758 | </td> |
| 759 | 759 | </tr> |
@@ -793,37 +793,37 @@ discard block |
||
| 793 | 793 | </td> |
| 794 | 794 | <td valign="top"> |
| 795 | 795 | <?php |
| 796 | - $parentlookup = false; |
|
| 797 | - if(isset ($_REQUEST['id'])) { |
|
| 798 | - if($content['parent'] == 0) { |
|
| 799 | - $parentname = $site_name; |
|
| 800 | - } else { |
|
| 801 | - $parentlookup = $content['parent']; |
|
| 802 | - } |
|
| 803 | - } elseif(isset ($_REQUEST['pid'])) { |
|
| 804 | - if($_REQUEST['pid'] == 0) { |
|
| 805 | - $parentname = $site_name; |
|
| 806 | - } else { |
|
| 807 | - $parentlookup = $_REQUEST['pid']; |
|
| 808 | - } |
|
| 809 | - } elseif(isset($_POST['parent'])) { |
|
| 810 | - if($_POST['parent'] == 0) { |
|
| 811 | - $parentname = $site_name; |
|
| 812 | - } else { |
|
| 813 | - $parentlookup = $_POST['parent']; |
|
| 814 | - } |
|
| 815 | - } else { |
|
| 816 | - $parentname = $site_name; |
|
| 817 | - $content['parent'] = 0; |
|
| 818 | - } |
|
| 819 | - if($parentlookup !== false && is_numeric($parentlookup)) { |
|
| 820 | - $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); |
|
| 821 | - $parentname = $modx->db->getValue($rs); |
|
| 822 | - if(!$parentname) { |
|
| 823 | - $modx->webAlertAndQuit($_lang["error_no_parent"]); |
|
| 824 | - } |
|
| 825 | - } |
|
| 826 | - ?> |
|
| 796 | + $parentlookup = false; |
|
| 797 | + if(isset ($_REQUEST['id'])) { |
|
| 798 | + if($content['parent'] == 0) { |
|
| 799 | + $parentname = $site_name; |
|
| 800 | + } else { |
|
| 801 | + $parentlookup = $content['parent']; |
|
| 802 | + } |
|
| 803 | + } elseif(isset ($_REQUEST['pid'])) { |
|
| 804 | + if($_REQUEST['pid'] == 0) { |
|
| 805 | + $parentname = $site_name; |
|
| 806 | + } else { |
|
| 807 | + $parentlookup = $_REQUEST['pid']; |
|
| 808 | + } |
|
| 809 | + } elseif(isset($_POST['parent'])) { |
|
| 810 | + if($_POST['parent'] == 0) { |
|
| 811 | + $parentname = $site_name; |
|
| 812 | + } else { |
|
| 813 | + $parentlookup = $_POST['parent']; |
|
| 814 | + } |
|
| 815 | + } else { |
|
| 816 | + $parentname = $site_name; |
|
| 817 | + $content['parent'] = 0; |
|
| 818 | + } |
|
| 819 | + if($parentlookup !== false && is_numeric($parentlookup)) { |
|
| 820 | + $rs = $modx->db->select('pagetitle', $tbl_site_content, "id='{$parentlookup}'"); |
|
| 821 | + $parentname = $modx->db->getValue($rs); |
|
| 822 | + if(!$parentname) { |
|
| 823 | + $modx->webAlertAndQuit($_lang["error_no_parent"]); |
|
| 824 | + } |
|
| 825 | + } |
|
| 826 | + ?> |
|
| 827 | 827 | <i id="plock" class="<?= $_style["actions_folder"] ?>" onclick="enableParentSelection(!allowParentSelection);"></i> |
| 828 | 828 | <b><span id="parentName"><?= (isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']) ?> (<?= $parentname ?>)</span></b> |
| 829 | 829 | <input type="hidden" name="parent" value="<?= (isset($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent']) ?>" onchange="documentDirty=true;" /> |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | </tr> |
| 832 | 832 | <tr></tr> |
| 833 | 833 | <?php |
| 834 | - /* |
|
| 834 | + /* |
|
| 835 | 835 | if($content['type'] == 'reference' || $modx->manager->action == '72') { |
| 836 | 836 | ?> |
| 837 | 837 | <tr> |
@@ -859,7 +859,7 @@ discard block |
||
| 859 | 859 | </tr> |
| 860 | 860 | <?php |
| 861 | 861 | }*/ |
| 862 | - ?> |
|
| 862 | + ?> |
|
| 863 | 863 | |
| 864 | 864 | <?php if($content['type'] == 'document' || $modx->manager->action == '4') { ?> |
| 865 | 865 | <tr> |
@@ -872,36 +872,36 @@ discard block |
||
| 872 | 872 | <select id="which_editor" class="form-control form-control-sm" size="1" name="which_editor" onchange="changeRTE();"> |
| 873 | 873 | <option value="none"><?= $_lang['none'] ?></option> |
| 874 | 874 | <?php |
| 875 | - // invoke OnRichTextEditorRegister event |
|
| 876 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
| 877 | - if(is_array($evtOut)) { |
|
| 878 | - for($i = 0; $i < count($evtOut); $i++) { |
|
| 879 | - $editor = $evtOut[$i]; |
|
| 880 | - echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n"; |
|
| 881 | - } |
|
| 882 | - } |
|
| 883 | - ?> |
|
| 875 | + // invoke OnRichTextEditorRegister event |
|
| 876 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
| 877 | + if(is_array($evtOut)) { |
|
| 878 | + for($i = 0; $i < count($evtOut); $i++) { |
|
| 879 | + $editor = $evtOut[$i]; |
|
| 880 | + echo "\t\t\t", '<option value="', $editor, '"', ($modx->config['which_editor'] == $editor ? ' selected="selected"' : ''), '>', $editor, "</option>\n"; |
|
| 881 | + } |
|
| 882 | + } |
|
| 883 | + ?> |
|
| 884 | 884 | </select> |
| 885 | 885 | </label> |
| 886 | 886 | </div> |
| 887 | 887 | <div id="content_body"> |
| 888 | 888 | <?php |
| 889 | - if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { |
|
| 890 | - $htmlContent = $content['content']; |
|
| 891 | - ?> |
|
| 889 | + if(($content['richtext'] == 1 || $modx->manager->action == '4') && $use_editor == 1) { |
|
| 890 | + $htmlContent = $content['content']; |
|
| 891 | + ?> |
|
| 892 | 892 | <div class="section-editor clearfix"> |
| 893 | 893 | <textarea id="ta" name="ta" onchange="documentDirty=true;"><?= $modx->htmlspecialchars($htmlContent) ?></textarea> |
| 894 | 894 | </div> |
| 895 | 895 | <?php |
| 896 | - // Richtext-[*content*] |
|
| 897 | - $richtexteditorIds = array(); |
|
| 898 | - $richtexteditorOptions = array(); |
|
| 899 | - $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
|
| 900 | - $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
|
| 901 | - } else { |
|
| 902 | - echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n"; |
|
| 903 | - } |
|
| 904 | - ?> |
|
| 896 | + // Richtext-[*content*] |
|
| 897 | + $richtexteditorIds = array(); |
|
| 898 | + $richtexteditorOptions = array(); |
|
| 899 | + $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
|
| 900 | + $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
|
| 901 | + } else { |
|
| 902 | + echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n"; |
|
| 903 | + } |
|
| 904 | + ?> |
|
| 905 | 905 | </div> |
| 906 | 906 | </td> |
| 907 | 907 | </tr> |
@@ -1207,8 +1207,8 @@ discard block |
||
| 1207 | 1207 | |
| 1208 | 1208 | <?php |
| 1209 | 1209 | |
| 1210 | - if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
| 1211 | - ?> |
|
| 1210 | + if($_SESSION['mgrRole'] == 1 || $modx->manager->action != '27' || $_SESSION['mgrInternalKey'] == $content['createdby'] || $modx->hasPermission('change_resourcetype')) { |
|
| 1211 | + ?> |
|
| 1212 | 1212 | <tr> |
| 1213 | 1213 | <td> |
| 1214 | 1214 | <span class="warning"><?= $_lang['resource_type'] ?></span> |
@@ -1230,15 +1230,15 @@ discard block |
||
| 1230 | 1230 | <td> |
| 1231 | 1231 | <select name="contentType" class="inputBox" onchange="documentDirty=true;"> |
| 1232 | 1232 | <?php |
| 1233 | - if(!$content['contentType']) { |
|
| 1234 | - $content['contentType'] = 'text/html'; |
|
| 1235 | - } |
|
| 1236 | - $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
|
| 1237 | - $ct = explode(",", $custom_contenttype); |
|
| 1238 | - for($i = 0; $i < count($ct); $i++) { |
|
| 1239 | - echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
| 1240 | - } |
|
| 1241 | - ?> |
|
| 1233 | + if(!$content['contentType']) { |
|
| 1234 | + $content['contentType'] = 'text/html'; |
|
| 1235 | + } |
|
| 1236 | + $custom_contenttype = (isset ($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
|
| 1237 | + $ct = explode(",", $custom_contenttype); |
|
| 1238 | + for($i = 0; $i < count($ct); $i++) { |
|
| 1239 | + echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
| 1240 | + } |
|
| 1241 | + ?> |
|
| 1242 | 1242 | </select> |
| 1243 | 1243 | </td> |
| 1244 | 1244 | </tr> |
@@ -1261,23 +1261,23 @@ discard block |
||
| 1261 | 1261 | </td> |
| 1262 | 1262 | </tr> |
| 1263 | 1263 | <?php |
| 1264 | - } else { |
|
| 1265 | - if($content['type'] != 'reference' && $modx->manager->action != '72') { |
|
| 1266 | - // non-admin managers creating or editing a document resource |
|
| 1267 | - ?> |
|
| 1264 | + } else { |
|
| 1265 | + if($content['type'] != 'reference' && $modx->manager->action != '72') { |
|
| 1266 | + // non-admin managers creating or editing a document resource |
|
| 1267 | + ?> |
|
| 1268 | 1268 | <input type="hidden" name="contentType" value="<?= (isset($content['contentType']) ? $content['contentType'] : "text/html") ?>" /> |
| 1269 | 1269 | <input type="hidden" name="type" value="document" /> |
| 1270 | 1270 | <input type="hidden" name="content_dispo" value="<?= (isset($content['content_dispo']) ? $content['content_dispo'] : '0') ?>" /> |
| 1271 | 1271 | <?php |
| 1272 | - } else { |
|
| 1273 | - // non-admin managers creating or editing a reference (weblink) resource |
|
| 1274 | - ?> |
|
| 1272 | + } else { |
|
| 1273 | + // non-admin managers creating or editing a reference (weblink) resource |
|
| 1274 | + ?> |
|
| 1275 | 1275 | <input type="hidden" name="type" value="reference" /> |
| 1276 | 1276 | <input type="hidden" name="contentType" value="text/html" /> |
| 1277 | 1277 | <?php |
| 1278 | - } |
|
| 1279 | - }//if mgrRole |
|
| 1280 | - ?> |
|
| 1278 | + } |
|
| 1279 | + }//if mgrRole |
|
| 1280 | + ?> |
|
| 1281 | 1281 | |
| 1282 | 1282 | <tr> |
| 1283 | 1283 | <td> |
@@ -1360,112 +1360,112 @@ discard block |
||
| 1360 | 1360 | ?> |
| 1361 | 1361 | |
| 1362 | 1362 | <?php |
| 1363 | - /******************************* |
|
| 1363 | + /******************************* |
|
| 1364 | 1364 | * Document Access Permissions */ |
| 1365 | - if($use_udperms == 1) { |
|
| 1366 | - $groupsarray = array(); |
|
| 1367 | - $sql = ''; |
|
| 1368 | - |
|
| 1369 | - $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); |
|
| 1370 | - if($documentId > 0) { |
|
| 1371 | - // Load up, the permissions from the parent (if new document) or existing document |
|
| 1372 | - $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
|
| 1373 | - while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
| 1374 | - |
|
| 1375 | - // Load up the current permissions and names |
|
| 1376 | - $vs = array( |
|
| 1377 | - $tbl_document_group_names, |
|
| 1378 | - $tbl_document_groups, |
|
| 1379 | - $documentId |
|
| 1380 | - ); |
|
| 1381 | - $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); |
|
| 1382 | - $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); |
|
| 1383 | - } else { |
|
| 1384 | - // Just load up the names, we're starting clean |
|
| 1385 | - $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); |
|
| 1386 | - } |
|
| 1365 | + if($use_udperms == 1) { |
|
| 1366 | + $groupsarray = array(); |
|
| 1367 | + $sql = ''; |
|
| 1368 | + |
|
| 1369 | + $documentId = ($modx->manager->action == '27' ? $id : (!empty($_REQUEST['pid']) ? $_REQUEST['pid'] : $content['parent'])); |
|
| 1370 | + if($documentId > 0) { |
|
| 1371 | + // Load up, the permissions from the parent (if new document) or existing document |
|
| 1372 | + $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
|
| 1373 | + while($currentgroup = $modx->db->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
| 1374 | + |
|
| 1375 | + // Load up the current permissions and names |
|
| 1376 | + $vs = array( |
|
| 1377 | + $tbl_document_group_names, |
|
| 1378 | + $tbl_document_groups, |
|
| 1379 | + $documentId |
|
| 1380 | + ); |
|
| 1381 | + $from = vsprintf("%s AS dgn LEFT JOIN %s AS groups ON groups.document_group=dgn.id AND groups.document='%s'", $vs); |
|
| 1382 | + $rs = $modx->db->select('dgn.*, groups.id AS link_id', $from, '', 'name'); |
|
| 1383 | + } else { |
|
| 1384 | + // Just load up the names, we're starting clean |
|
| 1385 | + $rs = $modx->db->select('*, NULL AS link_id', $tbl_document_group_names, '', 'name'); |
|
| 1386 | + } |
|
| 1387 | 1387 | |
| 1388 | - // retain selected doc groups between post |
|
| 1389 | - if(isset($_POST['docgroups'])) { |
|
| 1390 | - $groupsarray = array_merge($groupsarray, $_POST['docgroups']); |
|
| 1391 | - } |
|
| 1388 | + // retain selected doc groups between post |
|
| 1389 | + if(isset($_POST['docgroups'])) { |
|
| 1390 | + $groupsarray = array_merge($groupsarray, $_POST['docgroups']); |
|
| 1391 | + } |
|
| 1392 | 1392 | |
| 1393 | - $isManager = $modx->hasPermission('access_permissions'); |
|
| 1394 | - $isWeb = $modx->hasPermission('web_access_permissions'); |
|
| 1395 | - |
|
| 1396 | - // Setup Basic attributes for each Input box |
|
| 1397 | - $inputAttributes = array( |
|
| 1398 | - 'type' => 'checkbox', |
|
| 1399 | - 'class' => 'checkbox', |
|
| 1400 | - 'name' => 'docgroups[]', |
|
| 1401 | - 'onclick' => 'makePublic(false);', |
|
| 1402 | - ); |
|
| 1403 | - $permissions = array(); // New Permissions array list (this contains the HTML) |
|
| 1404 | - $permissions_yes = 0; // count permissions the current mgr user has |
|
| 1405 | - $permissions_no = 0; // count permissions the current mgr user doesn't have |
|
| 1406 | - |
|
| 1407 | - // Loop through the permissions list |
|
| 1408 | - while($row = $modx->db->getRow($rs)) { |
|
| 1409 | - |
|
| 1410 | - // Create an inputValue pair (group ID and group link (if it exists)) |
|
| 1411 | - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1412 | - $inputId = 'group-' . $row['id']; |
|
| 1413 | - |
|
| 1414 | - $checked = in_array($inputValue, $groupsarray); |
|
| 1415 | - if($checked) { |
|
| 1416 | - $notPublic = true; |
|
| 1417 | - } // Mark as private access (either web or manager) |
|
| 1418 | - |
|
| 1419 | - // Skip the access permission if the user doesn't have access... |
|
| 1420 | - if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
| 1421 | - continue; |
|
| 1422 | - } |
|
| 1423 | - |
|
| 1424 | - // Setup attributes for this Input box |
|
| 1425 | - $inputAttributes['id'] = $inputId; |
|
| 1426 | - $inputAttributes['value'] = $inputValue; |
|
| 1427 | - if($checked) { |
|
| 1428 | - $inputAttributes['checked'] = 'checked'; |
|
| 1429 | - } else { |
|
| 1430 | - unset($inputAttributes['checked']); |
|
| 1431 | - } |
|
| 1432 | - |
|
| 1433 | - // Create attribute string list |
|
| 1434 | - $inputString = array(); |
|
| 1435 | - foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; |
|
| 1436 | - |
|
| 1437 | - // Make the <input> HTML |
|
| 1438 | - $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
| 1439 | - |
|
| 1440 | - // does user have this permission? |
|
| 1441 | - $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
|
| 1442 | - $vs = array( |
|
| 1443 | - $row['id'], |
|
| 1444 | - $_SESSION['mgrInternalKey'] |
|
| 1445 | - ); |
|
| 1446 | - $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); |
|
| 1447 | - $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); |
|
| 1448 | - $count = $modx->db->getValue($rsp); |
|
| 1449 | - if($count > 0) { |
|
| 1450 | - ++$permissions_yes; |
|
| 1451 | - } else { |
|
| 1452 | - ++$permissions_no; |
|
| 1453 | - } |
|
| 1454 | - $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
| 1455 | - } |
|
| 1456 | - // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
|
| 1457 | - if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
| 1458 | - $permissions = array(); |
|
| 1459 | - } |
|
| 1393 | + $isManager = $modx->hasPermission('access_permissions'); |
|
| 1394 | + $isWeb = $modx->hasPermission('web_access_permissions'); |
|
| 1395 | + |
|
| 1396 | + // Setup Basic attributes for each Input box |
|
| 1397 | + $inputAttributes = array( |
|
| 1398 | + 'type' => 'checkbox', |
|
| 1399 | + 'class' => 'checkbox', |
|
| 1400 | + 'name' => 'docgroups[]', |
|
| 1401 | + 'onclick' => 'makePublic(false);', |
|
| 1402 | + ); |
|
| 1403 | + $permissions = array(); // New Permissions array list (this contains the HTML) |
|
| 1404 | + $permissions_yes = 0; // count permissions the current mgr user has |
|
| 1405 | + $permissions_no = 0; // count permissions the current mgr user doesn't have |
|
| 1406 | + |
|
| 1407 | + // Loop through the permissions list |
|
| 1408 | + while($row = $modx->db->getRow($rs)) { |
|
| 1409 | + |
|
| 1410 | + // Create an inputValue pair (group ID and group link (if it exists)) |
|
| 1411 | + $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1412 | + $inputId = 'group-' . $row['id']; |
|
| 1413 | + |
|
| 1414 | + $checked = in_array($inputValue, $groupsarray); |
|
| 1415 | + if($checked) { |
|
| 1416 | + $notPublic = true; |
|
| 1417 | + } // Mark as private access (either web or manager) |
|
| 1418 | + |
|
| 1419 | + // Skip the access permission if the user doesn't have access... |
|
| 1420 | + if((!$isManager && $row['private_memgroup'] == '1') || (!$isWeb && $row['private_webgroup'] == '1')) { |
|
| 1421 | + continue; |
|
| 1422 | + } |
|
| 1423 | + |
|
| 1424 | + // Setup attributes for this Input box |
|
| 1425 | + $inputAttributes['id'] = $inputId; |
|
| 1426 | + $inputAttributes['value'] = $inputValue; |
|
| 1427 | + if($checked) { |
|
| 1428 | + $inputAttributes['checked'] = 'checked'; |
|
| 1429 | + } else { |
|
| 1430 | + unset($inputAttributes['checked']); |
|
| 1431 | + } |
|
| 1460 | 1432 | |
| 1461 | - // See if the Access Permissions section is worth displaying... |
|
| 1462 | - if(!empty($permissions)) { |
|
| 1463 | - // Add the "All Document Groups" item if we have rights in both contexts |
|
| 1464 | - if($isManager && $isWeb) { |
|
| 1465 | - array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>'); |
|
| 1466 | - } |
|
| 1467 | - // Output the permissions list... |
|
| 1468 | - ?> |
|
| 1433 | + // Create attribute string list |
|
| 1434 | + $inputString = array(); |
|
| 1435 | + foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"'; |
|
| 1436 | + |
|
| 1437 | + // Make the <input> HTML |
|
| 1438 | + $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
| 1439 | + |
|
| 1440 | + // does user have this permission? |
|
| 1441 | + $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
|
| 1442 | + $vs = array( |
|
| 1443 | + $row['id'], |
|
| 1444 | + $_SESSION['mgrInternalKey'] |
|
| 1445 | + ); |
|
| 1446 | + $where = vsprintf("mga.membergroup=mg.user_group AND mga.documentgroup=%s AND mg.member=%s", $vs); |
|
| 1447 | + $rsp = $modx->db->select('COUNT(mg.id)', $from, $where); |
|
| 1448 | + $count = $modx->db->getValue($rsp); |
|
| 1449 | + if($count > 0) { |
|
| 1450 | + ++$permissions_yes; |
|
| 1451 | + } else { |
|
| 1452 | + ++$permissions_no; |
|
| 1453 | + } |
|
| 1454 | + $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
| 1455 | + } |
|
| 1456 | + // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
|
| 1457 | + if($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
|
| 1458 | + $permissions = array(); |
|
| 1459 | + } |
|
| 1460 | + |
|
| 1461 | + // See if the Access Permissions section is worth displaying... |
|
| 1462 | + if(!empty($permissions)) { |
|
| 1463 | + // Add the "All Document Groups" item if we have rights in both contexts |
|
| 1464 | + if($isManager && $isWeb) { |
|
| 1465 | + array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>'); |
|
| 1466 | + } |
|
| 1467 | + // Output the permissions list... |
|
| 1468 | + ?> |
|
| 1469 | 1469 | <!-- Access Permissions --> |
| 1470 | 1470 | <div class="tab-page" id="tabAccess"> |
| 1471 | 1471 | <h2 class="tab" id="tab_access_header"><?= $_lang['access_permissions'] ?></h2> |
@@ -1499,31 +1499,31 @@ discard block |
||
| 1499 | 1499 | </ul> |
| 1500 | 1500 | </div><!--div class="tab-page" id="tabAccess"--> |
| 1501 | 1501 | <?php |
| 1502 | - } // !empty($permissions) |
|
| 1503 | - elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
| 1504 | - ?> |
|
| 1502 | + } // !empty($permissions) |
|
| 1503 | + elseif($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0) && ($_SESSION['mgrPermissions']['access_permissions'] == 1 || $_SESSION['mgrPermissions']['web_access_permissions'] == 1)) { |
|
| 1504 | + ?> |
|
| 1505 | 1505 | <p><?= $_lang["access_permissions_docs_collision"] ?></p> |
| 1506 | 1506 | <?php |
| 1507 | 1507 | |
| 1508 | - } |
|
| 1509 | - } |
|
| 1510 | - /* End Document Access Permissions * |
|
| 1508 | + } |
|
| 1509 | + } |
|
| 1510 | + /* End Document Access Permissions * |
|
| 1511 | 1511 | ***********************************/ |
| 1512 | - ?> |
|
| 1512 | + ?> |
|
| 1513 | 1513 | |
| 1514 | 1514 | <input type="submit" name="save" style="display:none" /> |
| 1515 | 1515 | <?php |
| 1516 | 1516 | |
| 1517 | - // invoke OnDocFormRender event |
|
| 1518 | - $evtOut = $modx->invokeEvent('OnDocFormRender', array( |
|
| 1519 | - 'id' => $id, |
|
| 1520 | - 'template' => $content['template'] |
|
| 1521 | - )); |
|
| 1517 | + // invoke OnDocFormRender event |
|
| 1518 | + $evtOut = $modx->invokeEvent('OnDocFormRender', array( |
|
| 1519 | + 'id' => $id, |
|
| 1520 | + 'template' => $content['template'] |
|
| 1521 | + )); |
|
| 1522 | 1522 | |
| 1523 | - if(is_array($evtOut)) { |
|
| 1524 | - echo implode('', $evtOut); |
|
| 1525 | - } |
|
| 1526 | - ?> |
|
| 1523 | + if(is_array($evtOut)) { |
|
| 1524 | + echo implode('', $evtOut); |
|
| 1525 | + } |
|
| 1526 | + ?> |
|
| 1527 | 1527 | </div><!--div class="tab-pane" id="documentPane"--> |
| 1528 | 1528 | </div><!--div class="sectionBody"--> |
| 1529 | 1529 | </fieldset> |
@@ -1534,19 +1534,19 @@ discard block |
||
| 1534 | 1534 | </script> |
| 1535 | 1535 | <?php |
| 1536 | 1536 | if(($content['richtext'] == 1 || $modx->manager->action == '4' || $modx->manager->action == '72') && $use_editor == 1) { |
| 1537 | - if(is_array($richtexteditorIds)) { |
|
| 1538 | - foreach($richtexteditorIds as $editor => $elements) { |
|
| 1539 | - // invoke OnRichTextEditorInit event |
|
| 1540 | - $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( |
|
| 1541 | - 'editor' => $editor, |
|
| 1542 | - 'elements' => $elements, |
|
| 1543 | - 'options' => $richtexteditorOptions[$editor] |
|
| 1544 | - )); |
|
| 1545 | - if(is_array($evtOut)) { |
|
| 1546 | - echo implode('', $evtOut); |
|
| 1547 | - } |
|
| 1548 | - } |
|
| 1549 | - } |
|
| 1537 | + if(is_array($richtexteditorIds)) { |
|
| 1538 | + foreach($richtexteditorIds as $editor => $elements) { |
|
| 1539 | + // invoke OnRichTextEditorInit event |
|
| 1540 | + $evtOut = $modx->invokeEvent('OnRichTextEditorInit', array( |
|
| 1541 | + 'editor' => $editor, |
|
| 1542 | + 'elements' => $elements, |
|
| 1543 | + 'options' => $richtexteditorOptions[$editor] |
|
| 1544 | + )); |
|
| 1545 | + if(is_array($evtOut)) { |
|
| 1546 | + echo implode('', $evtOut); |
|
| 1547 | + } |
|
| 1548 | + } |
|
| 1549 | + } |
|
| 1550 | 1550 | } |
| 1551 | 1551 | |
| 1552 | 1552 | if(!function_exists('getDefaultTemplate')) { |
@@ -4,24 +4,24 @@ discard block |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | if(!$modx->hasPermission('category_manager')) { |
| 7 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $_module_params = array( |
| 11 | - 'module_version' => '1.0.0', |
|
| 12 | - 'module_params' => '', |
|
| 13 | - 'module_id' => $_GET['id'], |
|
| 14 | - 'package_name' => 'Module_Categories_Manager', |
|
| 15 | - 'native_language' => 'de', |
|
| 16 | - 'name' => 'Categories Manager', |
|
| 17 | - 'dirname' => $site_manager_url, |
|
| 18 | - 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
| 19 | - 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
| 20 | - 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
| 21 | - 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
| 22 | - 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
| 23 | - 'request_key' => 'module_categories_manager', |
|
| 24 | - 'messages' => array() |
|
| 11 | + 'module_version' => '1.0.0', |
|
| 12 | + 'module_params' => '', |
|
| 13 | + 'module_id' => $_GET['id'], |
|
| 14 | + 'package_name' => 'Module_Categories_Manager', |
|
| 15 | + 'native_language' => 'de', |
|
| 16 | + 'name' => 'Categories Manager', |
|
| 17 | + 'dirname' => $site_manager_url, |
|
| 18 | + 'url' => 'index.php?a=120&id=' . $_GET['id'], |
|
| 19 | + 'path' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR, |
|
| 20 | + 'inc_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'inc' . DIRECTORY_SEPARATOR, |
|
| 21 | + 'languages_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'lang' . DIRECTORY_SEPARATOR, |
|
| 22 | + 'views_dir' => realpath( dirname(__FILE__) ) . DIRECTORY_SEPARATOR . 'category_mgr' . DIRECTORY_SEPARATOR . 'skin' . DIRECTORY_SEPARATOR, |
|
| 23 | + 'request_key' => 'module_categories_manager', |
|
| 24 | + 'messages' => array() |
|
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | $cm = new EvolutionCMS\Legacy\ModuleCategoriesManager(); |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | // assign module_params to internal params |
| 30 | 30 | foreach( $_module_params as $param => $value ) |
| 31 | 31 | { |
| 32 | - $cm->set( $param, $value ); |
|
| 32 | + $cm->set( $param, $value ); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | // catch the request actions |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | if( !$categories = $cm->getCategories() ) |
| 39 | 39 | { |
| 40 | - setcookie('webfxtab_manage-categories-pane', 0 ); |
|
| 41 | - $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
| 40 | + setcookie('webfxtab_manage-categories-pane', 0 ); |
|
| 41 | + $cm->addMessage( $cm->txt('Currently no categories available... JUST ADD A NEW ONE!'), 'global' ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $cm->renderView('main', $categories ); |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 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 | $tpl = array( |
| 7 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
| 7 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
| 8 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
| 9 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
| 10 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
| 11 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | 14 | if(!function_exists('parsePh')) {
|
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | } |
| 5 | 5 | $logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
| 6 | 6 | $downloadLinks = array( |
| 7 | - 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
| 8 | - 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 9 | - 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 10 | - 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
| 11 | - 'http://extras.evolution-cms.com/', |
|
| 12 | - 'https://github.com/extras-evolution' |
|
| 13 | - )), |
|
| 7 | + 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
|
| 8 | + 1=>array('title'=>$_lang["download"],'link'=>'https://github.com/evolution-cms/evolution/releases'), |
|
| 9 | + 2=>array('title'=>$_lang["previous_releases"],'link'=>'https://modx.com/download/evolution/previous-releases.html'), |
|
| 10 | + 3=>array('title'=>$_lang["extras"],'link'=>array( |
|
| 11 | + 'http://extras.evolution-cms.com/', |
|
| 12 | + 'https://github.com/extras-evolution' |
|
| 13 | + )), |
|
| 14 | 14 | ); |
| 15 | 15 | |
| 16 | 16 | $translationLinks = array( |
| 17 | - 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 18 | - 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 17 | + 0=>array('title'=>'Evolution CMS','link'=>'https://www.transifex.com/evolutioncms/evolution/'), |
|
| 18 | + 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
|
| 19 | 19 | ); |
| 20 | 20 | |
| 21 | 21 | if(!function_exists('createList')) { |
@@ -1,20 +1,20 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
|
| 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 | switch($modx->manager->action) {
|
| 6 | - case 107: |
|
| 7 | - if(!$modx->hasPermission('new_module')) {
|
|
| 8 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 9 | - } |
|
| 10 | - break; |
|
| 11 | - case 108: |
|
| 12 | - if(!$modx->hasPermission('edit_module')) {
|
|
| 13 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 14 | - } |
|
| 15 | - break; |
|
| 16 | - default: |
|
| 17 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + case 107: |
|
| 7 | + if(!$modx->hasPermission('new_module')) {
|
|
| 8 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 9 | + } |
|
| 10 | + break; |
|
| 11 | + case 108: |
|
| 12 | + if(!$modx->hasPermission('edit_module')) {
|
|
| 13 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 14 | + } |
|
| 15 | + break; |
|
| 16 | + default: |
|
| 17 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 18 | 18 | } |
| 19 | 19 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
| 20 | 20 | // Get table names (alphabetical) |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // check to see the module editor isn't locked |
| 50 | 50 | if($lockedEl = $modx->elementIsLocked(6, $id)) {
|
| 51 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
| 51 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module'])); |
|
| 52 | 52 | } |
| 53 | 53 | // end check for lock |
| 54 | 54 | |
@@ -56,22 +56,22 @@ discard block |
||
| 56 | 56 | $modx->lockElement(6, $id); |
| 57 | 57 | |
| 58 | 58 | if(isset($_GET['id'])) {
|
| 59 | - $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
|
|
| 60 | - $content = $modx->db->getRow($rs); |
|
| 61 | - if(!$content) {
|
|
| 62 | - $modx->webAlertAndQuit("Module not found for id '{$id}'.");
|
|
| 63 | - } |
|
| 64 | - $content['properties'] = str_replace("&", "&", $content['properties']);
|
|
| 65 | - $_SESSION['itemname'] = $content['name']; |
|
| 66 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 67 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 68 | - } |
|
| 59 | + $rs = $modx->db->select('*', $tbl_site_modules, "id='{$id}'");
|
|
| 60 | + $content = $modx->db->getRow($rs); |
|
| 61 | + if(!$content) {
|
|
| 62 | + $modx->webAlertAndQuit("Module not found for id '{$id}'.");
|
|
| 63 | + } |
|
| 64 | + $content['properties'] = str_replace("&", "&", $content['properties']);
|
|
| 65 | + $_SESSION['itemname'] = $content['name']; |
|
| 66 | + if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
|
|
| 67 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 68 | + } |
|
| 69 | 69 | } else {
|
| 70 | - $_SESSION['itemname'] = $_lang["new_module"]; |
|
| 71 | - $content['wrap'] = '1'; |
|
| 70 | + $_SESSION['itemname'] = $_lang["new_module"]; |
|
| 71 | + $content['wrap'] = '1'; |
|
| 72 | 72 | } |
| 73 | 73 | if($modx->manager->hasFormValues()) {
|
| 74 | - $modx->manager->loadFormValues(); |
|
| 74 | + $modx->manager->loadFormValues(); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Add lock-element JS-Script |
@@ -442,18 +442,18 @@ discard block |
||
| 442 | 442 | |
| 443 | 443 | <form name="mutate" id="mutate" class="module" method="post" action="index.php?a=109"> |
| 444 | 444 | <?php |
| 445 | - // invoke OnModFormPrerender event |
|
| 446 | - $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
|
|
| 447 | - if(is_array($evtOut)) {
|
|
| 448 | - echo implode('', $evtOut);
|
|
| 449 | - } |
|
| 445 | + // invoke OnModFormPrerender event |
|
| 446 | + $evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
|
|
| 447 | + if(is_array($evtOut)) {
|
|
| 448 | + echo implode('', $evtOut);
|
|
| 449 | + } |
|
| 450 | 450 | |
| 451 | - // Prepare internal params & info-tab via parseDocBlock |
|
| 452 | - $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
| 453 | - $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
| 454 | - $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
| 455 | - $internal = array(); |
|
| 456 | - ?> |
|
| 451 | + // Prepare internal params & info-tab via parseDocBlock |
|
| 452 | + $modulecode = isset($content['modulecode']) ? $modx->db->escape($content['modulecode']) : ''; |
|
| 453 | + $docBlock = $modx->parseDocBlockFromString($modulecode); |
|
| 454 | + $docBlockList = $modx->convertDocBlockIntoList($docBlock); |
|
| 455 | + $internal = array(); |
|
| 456 | + ?> |
|
| 457 | 457 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
| 458 | 458 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
| 459 | 459 | |
@@ -506,11 +506,11 @@ discard block |
||
| 506 | 506 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 507 | 507 | <option> </option> |
| 508 | 508 | <?php |
| 509 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 510 | - foreach(getCategories() as $n => $v) {
|
|
| 511 | - echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
| 512 | - } |
|
| 513 | - ?> |
|
| 509 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 510 | + foreach(getCategories() as $n => $v) {
|
|
| 511 | + echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n"; |
|
| 512 | + } |
|
| 513 | + ?> |
|
| 514 | 514 | </select> |
| 515 | 515 | </div> |
| 516 | 516 | </div> |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | <i class="<?= $_style["actions_save"] ?>"></i> <?= $_lang['manage_depends'] ?></a> |
| 618 | 618 | </div> |
| 619 | 619 | <?php |
| 620 | - $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name,
|
|
| 620 | + $ds = $modx->db->select("smd.id, COALESCE(ss.name,st.templatename,sv.name,sc.name,sp.name,sd.pagetitle) AS name,
|
|
| 621 | 621 | CASE smd.type |
| 622 | 622 | WHEN 10 THEN 'Chunk' |
| 623 | 623 | WHEN 20 THEN 'Document' |
@@ -633,17 +633,17 @@ discard block |
||
| 633 | 633 | LEFT JOIN {$tbl_site_templates} AS st ON st.id = smd.resource AND smd.type = 50
|
| 634 | 634 | LEFT JOIN {$tbl_site_tmplvars} AS sv ON sv.id = smd.resource AND smd.type = 60", "smd.module='{$id}'", 'smd.type,name');
|
| 635 | 635 | |
| 636 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 637 | - $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
|
|
| 638 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
| 639 | - $grd->cssClass = 'grid'; |
|
| 640 | - $grd->columnHeaderClass = 'gridHeader'; |
|
| 641 | - $grd->itemClass = 'gridItem'; |
|
| 642 | - $grd->altItemClass = 'gridAltItem'; |
|
| 643 | - $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
| 644 | - $grd->fields = "name,type"; |
|
| 645 | - echo $grd->render(); |
|
| 646 | - ?> |
|
| 636 | + include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 637 | + $grd = new DataGrid('', $ds, 0); // set page size to 0 t show all items
|
|
| 638 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
| 639 | + $grd->cssClass = 'grid'; |
|
| 640 | + $grd->columnHeaderClass = 'gridHeader'; |
|
| 641 | + $grd->itemClass = 'gridItem'; |
|
| 642 | + $grd->altItemClass = 'gridAltItem'; |
|
| 643 | + $grd->columns = $_lang['element_name'] . " ," . $_lang['type']; |
|
| 644 | + $grd->fields = "name,type"; |
|
| 645 | + echo $grd->render(); |
|
| 646 | + ?> |
|
| 647 | 647 | </div> |
| 648 | 648 | </div> |
| 649 | 649 | <?php endif; ?> |
@@ -655,12 +655,12 @@ discard block |
||
| 655 | 655 | <div class="container container-body"> |
| 656 | 656 | <?php if($use_udperms == 1) : ?> |
| 657 | 657 | <?php |
| 658 | - // fetch user access permissions for the module |
|
| 659 | - $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
|
|
| 660 | - $groupsarray = $modx->db->getColumn('usergroup', $rs);
|
|
| 658 | + // fetch user access permissions for the module |
|
| 659 | + $rs = $modx->db->select('usergroup', $tbl_site_module_access, "module='{$id}'");
|
|
| 660 | + $groupsarray = $modx->db->getColumn('usergroup', $rs);
|
|
| 661 | 661 | |
| 662 | - if($modx->hasPermission('access_permissions')) {
|
|
| 663 | - ?> |
|
| 662 | + if($modx->hasPermission('access_permissions')) {
|
|
| 663 | + ?> |
|
| 664 | 664 | <!-- User Group Access Permissions --> |
| 665 | 665 | <script type="text/javascript"> |
| 666 | 666 | function makePublic(b) {
|
@@ -684,28 +684,28 @@ discard block |
||
| 684 | 684 | </script> |
| 685 | 685 | <p><?= $_lang['module_group_access_msg'] ?></p> |
| 686 | 686 | <?php |
| 687 | - } |
|
| 688 | - $chk = ''; |
|
| 689 | - $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
|
|
| 690 | - while($row = $modx->db->getRow($rs)) {
|
|
| 691 | - $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
| 692 | - $checked = in_array($row['id'], $groupsarray); |
|
| 693 | - if($modx->hasPermission('access_permissions')) {
|
|
| 694 | - if($checked) {
|
|
| 695 | - $notPublic = true; |
|
| 696 | - } |
|
| 697 | - $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
| 698 | - } else {
|
|
| 699 | - if($checked) {
|
|
| 700 | - $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
| 701 | - } |
|
| 702 | - } |
|
| 703 | - } |
|
| 704 | - if($modx->hasPermission('access_permissions')) {
|
|
| 705 | - $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; |
|
| 706 | - } |
|
| 707 | - echo $chks; |
|
| 708 | - ?> |
|
| 687 | + } |
|
| 688 | + $chk = ''; |
|
| 689 | + $rs = $modx->db->select('name, id', $tbl_membergroup_names, '', 'name');
|
|
| 690 | + while($row = $modx->db->getRow($rs)) {
|
|
| 691 | + $groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array(); |
|
| 692 | + $checked = in_array($row['id'], $groupsarray); |
|
| 693 | + if($modx->hasPermission('access_permissions')) {
|
|
| 694 | + if($checked) {
|
|
| 695 | + $notPublic = true; |
|
| 696 | + } |
|
| 697 | + $chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n"; |
|
| 698 | + } else {
|
|
| 699 | + if($checked) {
|
|
| 700 | + $chks = '<input type="hidden" name="usrgroups[]" value="' . $row['id'] . '" />' . "\n" . $chks; |
|
| 701 | + } |
|
| 702 | + } |
|
| 703 | + } |
|
| 704 | + if($modx->hasPermission('access_permissions')) {
|
|
| 705 | + $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; |
|
| 706 | + } |
|
| 707 | + echo $chks; |
|
| 708 | + ?> |
|
| 709 | 709 | <?php endif; ?> |
| 710 | 710 | </div> |
| 711 | 711 | </div> |
@@ -721,11 +721,11 @@ discard block |
||
| 721 | 721 | |
| 722 | 722 | <input type="submit" name="save" style="display:none;"> |
| 723 | 723 | <?php |
| 724 | - // invoke OnModFormRender event |
|
| 725 | - $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
|
|
| 726 | - if(is_array($evtOut)) {
|
|
| 727 | - echo implode('', $evtOut);
|
|
| 728 | - } |
|
| 729 | - ?> |
|
| 724 | + // invoke OnModFormRender event |
|
| 725 | + $evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
|
|
| 726 | + if(is_array($evtOut)) {
|
|
| 727 | + echo implode('', $evtOut);
|
|
| 728 | + } |
|
| 729 | + ?> |
|
| 730 | 730 | </form> |
| 731 | 731 | <script type="text/javascript">setTimeout('showParameters();', 10);</script>
|
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
| 3 | - die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
|
|
| 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 | 8 | if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
| 9 | - // seems to be a new install - send the user to the configuration page |
|
| 10 | - exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
|
| 9 | + // seems to be a new install - send the user to the configuration page |
|
| 10 | + exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | // set placeholders |
@@ -17,92 +17,92 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | 19 | if($modx->hasPermission('messages')) {
|
| 20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 21 | - $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
| 22 | - $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
| 23 | - |
|
| 24 | - $msg = array(); |
|
| 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>)' : ''; |
|
| 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'; |
|
| 29 | - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
| 30 | - $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
|
| 31 | - $ph['MessageInfo'] = implode("\n", $msg);
|
|
| 20 | + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
| 21 | + $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
| 22 | + $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
| 23 | + |
|
| 24 | + $msg = array(); |
|
| 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>)' : ''; |
|
| 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'; |
|
| 29 | + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
| 30 | + $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
|
| 31 | + $ph['MessageInfo'] = implode("\n", $msg);
|
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // setup icons |
| 35 | 35 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
| 36 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
| 37 | - $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
| 36 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
| 37 | + $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
| 38 | 38 | } |
| 39 | 39 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
| 40 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
| 41 | - $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
| 40 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
| 41 | + $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
| 42 | 42 | } |
| 43 | 43 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
| 44 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
| 45 | - $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
| 44 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
| 45 | + $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
| 46 | 46 | } |
| 47 | 47 | 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 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
| 49 | - $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
| 48 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
| 49 | + $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
| 50 | 50 | } |
| 51 | 51 | if($modx->hasPermission('bk_manager')) {
|
| 52 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
| 53 | - $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
| 52 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
| 53 | + $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
| 54 | 54 | } |
| 55 | 55 | if($modx->hasPermission('help')) {
|
| 56 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
| 57 | - $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
| 56 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
| 57 | + $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if($modx->hasPermission('new_document')) {
|
| 61 | - $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
| 62 | - $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
| 63 | - $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
| 64 | - $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
| 61 | + $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
| 62 | + $ph['ResourceIcon'] = wrapIcon($icon, 4); |
|
| 63 | + $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
| 64 | + $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
|
| 65 | 65 | } |
| 66 | 66 | if($modx->hasPermission('assets_images')) {
|
| 67 | - $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
| 68 | - $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
| 67 | + $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
| 68 | + $ph['ImagesIcon'] = wrapIcon($icon, 72); |
|
| 69 | 69 | } |
| 70 | 70 | if($modx->hasPermission('assets_files')) {
|
| 71 | - $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
| 72 | - $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
| 71 | + $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
| 72 | + $ph['FilesIcon'] = wrapIcon($icon, 72); |
|
| 73 | 73 | } |
| 74 | 74 | if($modx->hasPermission('change_password')) {
|
| 75 | - $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
| 76 | - $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
| 75 | + $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
| 76 | + $ph['PasswordIcon'] = wrapIcon($icon, 28); |
|
| 77 | 77 | } |
| 78 | 78 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
| 79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
| 80 | 80 | |
| 81 | 81 | // do some config checks |
| 82 | 82 | if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
| 83 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 84 | - if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 85 | - $ph['config_check_results'] = $config_check_results; |
|
| 86 | - $ph['config_display'] = 'block'; |
|
| 87 | - } else {
|
|
| 88 | - $ph['config_display'] = 'none'; |
|
| 89 | - } |
|
| 83 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
| 84 | + if($config_check_results != $_lang['configcheck_ok']) {
|
|
| 85 | + $ph['config_check_results'] = $config_check_results; |
|
| 86 | + $ph['config_display'] = 'block'; |
|
| 87 | + } else {
|
|
| 88 | + $ph['config_display'] = 'none'; |
|
| 89 | + } |
|
| 90 | 90 | } else {
|
| 91 | - $ph['config_display'] = 'none'; |
|
| 91 | + $ph['config_display'] = 'none'; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Check logout-reminder |
| 95 | 95 | if(isset($_SESSION['show_logout_reminder'])) {
|
| 96 | - switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 97 | - case 'logout_reminder': |
|
| 98 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
| 99 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
|
| 100 | - break; |
|
| 101 | - } |
|
| 102 | - $ph['show_logout_reminder'] = 'block'; |
|
| 103 | - unset($_SESSION['show_logout_reminder']); |
|
| 96 | + switch($_SESSION['show_logout_reminder']['type']) {
|
|
| 97 | + case 'logout_reminder': |
|
| 98 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
| 99 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
|
| 100 | + break; |
|
| 101 | + } |
|
| 102 | + $ph['show_logout_reminder'] = 'block'; |
|
| 103 | + unset($_SESSION['show_logout_reminder']); |
|
| 104 | 104 | } else {
|
| 105 | - $ph['show_logout_reminder'] = 'none'; |
|
| 105 | + $ph['show_logout_reminder'] = 'none'; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // Check multiple sessions |
@@ -150,11 +150,11 @@ discard block |
||
| 150 | 150 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
| 151 | 151 | |
| 152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
| 153 | - 'username' => $modx->getLoginUserName(), |
|
| 154 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
| 155 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
| 156 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
| 157 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
| 153 | + 'username' => $modx->getLoginUserName(), |
|
| 154 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
| 155 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
| 156 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
| 157 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
| 158 | 158 | )); |
| 159 | 159 | |
| 160 | 160 | $from = array(); |
@@ -163,13 +163,13 @@ discard block |
||
| 163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 164 | 164 | |
| 165 | 165 | if($modx->db->getRecordCount($rs) < 1) {
|
| 166 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
| 166 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
| 167 | 167 | } else {
|
| 168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 169 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
| 170 | - $ph['now'] = strftime('%H:%M:%S', $now);
|
|
| 171 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
| 172 | - $html = ' |
|
| 168 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 169 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
| 170 | + $ph['now'] = strftime('%H:%M:%S', $now);
|
|
| 171 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
| 172 | + $html = ' |
|
| 173 | 173 | <div class="card-body"> |
| 174 | 174 | [%onlineusers_message%] |
| 175 | 175 | <b>[+now+]</b>): |
@@ -187,33 +187,33 @@ discard block |
||
| 187 | 187 | </thead> |
| 188 | 188 | <tbody>'; |
| 189 | 189 | |
| 190 | - $userList = array(); |
|
| 191 | - $userCount = array(); |
|
| 192 | - // Create userlist with session-count first before output |
|
| 193 | - while($activeusers = $modx->db->getRow($rs)) {
|
|
| 194 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
| 195 | - |
|
| 196 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
| 197 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
| 198 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
| 199 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
| 200 | - $userList[] = array( |
|
| 201 | - $idle, |
|
| 202 | - '', |
|
| 203 | - $activeusers['username'], |
|
| 204 | - $webicon, |
|
| 205 | - abs($activeusers['internalKey']), |
|
| 206 | - $ip, |
|
| 207 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
|
|
| 208 | - $currentaction |
|
| 209 | - ); |
|
| 210 | - } |
|
| 211 | - foreach($userList as $params) {
|
|
| 212 | - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
| 213 | - $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 | - } |
|
| 215 | - |
|
| 216 | - $html .= ' |
|
| 190 | + $userList = array(); |
|
| 191 | + $userCount = array(); |
|
| 192 | + // Create userlist with session-count first before output |
|
| 193 | + while($activeusers = $modx->db->getRow($rs)) {
|
|
| 194 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
| 195 | + |
|
| 196 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
| 197 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
| 198 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
| 199 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
| 200 | + $userList[] = array( |
|
| 201 | + $idle, |
|
| 202 | + '', |
|
| 203 | + $activeusers['username'], |
|
| 204 | + $webicon, |
|
| 205 | + abs($activeusers['internalKey']), |
|
| 206 | + $ip, |
|
| 207 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time),
|
|
| 208 | + $currentaction |
|
| 209 | + ); |
|
| 210 | + } |
|
| 211 | + foreach($userList as $params) {
|
|
| 212 | + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
| 213 | + $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 | + } |
|
| 215 | + |
|
| 216 | + $html .= ' |
|
| 217 | 217 | </tbody> |
| 218 | 218 | </table> |
| 219 | 219 | </div> |
@@ -254,17 +254,17 @@ discard block |
||
| 254 | 254 | // invoke event OnManagerWelcomePrerender |
| 255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 256 | 256 | if(is_array($evtOut)) {
|
| 257 | - $output = implode('', $evtOut);
|
|
| 258 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
| 257 | + $output = implode('', $evtOut);
|
|
| 258 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | $widgets['welcome'] = array( |
| 262 | - 'menuindex' => '10', |
|
| 263 | - 'id' => 'welcome', |
|
| 264 | - 'cols' => 'col-lg-6', |
|
| 265 | - 'icon' => 'fa-home', |
|
| 266 | - 'title' => '[%welcome_title%]', |
|
| 267 | - 'body' => ' |
|
| 262 | + 'menuindex' => '10', |
|
| 263 | + 'id' => 'welcome', |
|
| 264 | + 'cols' => 'col-lg-6', |
|
| 265 | + 'icon' => 'fa-home', |
|
| 266 | + 'title' => '[%welcome_title%]', |
|
| 267 | + 'body' => ' |
|
| 268 | 268 | <div class="wm_buttons card-body"> |
| 269 | 269 | <!--@IF:[[#hasPermission?key=new_document]]--> |
| 270 | 270 | <span class="wm_button"> |
@@ -338,25 +338,25 @@ discard block |
||
| 338 | 338 | </table> |
| 339 | 339 | </div> |
| 340 | 340 | ', |
| 341 | - 'hide'=>'0' |
|
| 341 | + 'hide'=>'0' |
|
| 342 | 342 | ); |
| 343 | 343 | $widgets['onlineinfo'] = array( |
| 344 | - 'menuindex' => '20', |
|
| 345 | - 'id' => 'onlineinfo', |
|
| 346 | - 'cols' => 'col-lg-6', |
|
| 347 | - 'icon' => 'fa-user', |
|
| 348 | - 'title' => '[%onlineusers_title%]', |
|
| 349 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
| 350 | - 'hide'=>'0' |
|
| 344 | + 'menuindex' => '20', |
|
| 345 | + 'id' => 'onlineinfo', |
|
| 346 | + 'cols' => 'col-lg-6', |
|
| 347 | + 'icon' => 'fa-user', |
|
| 348 | + 'title' => '[%onlineusers_title%]', |
|
| 349 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
| 350 | + 'hide'=>'0' |
|
| 351 | 351 | ); |
| 352 | 352 | $widgets['recentinfo'] = array( |
| 353 | - 'menuindex' => '30', |
|
| 354 | - 'id' => 'modxrecent_widget', |
|
| 355 | - 'cols' => 'col-sm-12', |
|
| 356 | - 'icon' => 'fa-pencil-square-o', |
|
| 357 | - 'title' => '[%activity_title%]', |
|
| 358 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
| 359 | - 'hide'=>'0' |
|
| 353 | + 'menuindex' => '30', |
|
| 354 | + 'id' => 'modxrecent_widget', |
|
| 355 | + 'cols' => 'col-sm-12', |
|
| 356 | + 'icon' => 'fa-pencil-square-o', |
|
| 357 | + 'title' => '[%activity_title%]', |
|
| 358 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
| 359 | + 'hide'=>'0' |
|
| 360 | 360 | ); |
| 361 | 361 | if ($modx->config['rss_url_news']) {
|
| 362 | 362 | $widgets['news'] = array( |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | // invoke OnManagerWelcomeHome event |
| 385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 386 | 386 | if(is_array($sitewidgets)) {
|
| 387 | - $newwidgets = array(); |
|
| 387 | + $newwidgets = array(); |
|
| 388 | 388 | foreach($sitewidgets as $widget){
|
| 389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 390 | 390 | } |
@@ -392,21 +392,21 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | usort($widgets, function ($a, $b) {
|
| 395 | - return $a['menuindex'] - $b['menuindex']; |
|
| 395 | + return $a['menuindex'] - $b['menuindex']; |
|
| 396 | 396 | }); |
| 397 | 397 | |
| 398 | 398 | $tpl = getTplWidget(); |
| 399 | 399 | $output = ''; |
| 400 | 400 | foreach($widgets as $widget) {
|
| 401 | - if ($widget['hide'] != '1'){
|
|
| 402 | - $output .= $modx->parseText($tpl, $widget); |
|
| 403 | - } |
|
| 401 | + if ($widget['hide'] != '1'){
|
|
| 402 | + $output .= $modx->parseText($tpl, $widget); |
|
| 403 | + } |
|
| 404 | 404 | } |
| 405 | 405 | $ph['widgets'] = $output; |
| 406 | 406 | |
| 407 | 407 | // load template |
| 408 | 408 | if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
| 409 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 409 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $target = $modx->config['manager_welcome_tpl']; |
@@ -414,27 +414,27 @@ discard block |
||
| 414 | 414 | $target = $modx->mergeSettingsContent($target); |
| 415 | 415 | |
| 416 | 416 | if(substr($target, 0, 1) === '@') {
|
| 417 | - if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 418 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
| 419 | - } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 420 | - $content = file_get_contents(trim(substr($target, 6))); |
|
| 421 | - } else {
|
|
| 422 | - $content = ''; |
|
| 423 | - } |
|
| 417 | + if(substr($target, 0, 6) === '@CHUNK') {
|
|
| 418 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
| 419 | + } elseif(substr($target, 0, 5) === '@FILE') {
|
|
| 420 | + $content = file_get_contents(trim(substr($target, 6))); |
|
| 421 | + } else {
|
|
| 422 | + $content = ''; |
|
| 423 | + } |
|
| 424 | 424 | } else {
|
| 425 | - $chunk = $modx->getChunk($target); |
|
| 426 | - if($chunk !== false && !empty($chunk)) {
|
|
| 427 | - $content = $chunk; |
|
| 428 | - } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 429 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 430 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 431 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 432 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 433 | - {
|
|
| 434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 435 | - } else {
|
|
| 436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 437 | - } |
|
| 425 | + $chunk = $modx->getChunk($target); |
|
| 426 | + if($chunk !== false && !empty($chunk)) {
|
|
| 427 | + $content = $chunk; |
|
| 428 | + } elseif(is_file(MODX_BASE_PATH . $target)) {
|
|
| 429 | + $content = file_get_contents(MODX_BASE_PATH . $target); |
|
| 430 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 431 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
| 432 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
| 433 | + {
|
|
| 434 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 435 | + } else {
|
|
| 436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 437 | + } |
|
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | // merge placeholders |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | $content = $modx->mergeSettingsContent($content); |
| 443 | 443 | $content = $modx->parseText($content, $ph); |
| 444 | 444 | if(strpos($content, '[+') !== false) {
|
| 445 | - $modx->toPlaceholders($ph); |
|
| 446 | - $content = $modx->mergePlaceholderContent($content); |
|
| 445 | + $modx->toPlaceholders($ph); |
|
| 446 | + $content = $modx->mergePlaceholderContent($content); |
|
| 447 | 447 | } |
| 448 | 448 | $content = $modx->parseDocumentSource($content); |
| 449 | 449 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 452 | 452 | |
| 453 | 453 | if($js = $modx->getRegisteredClientScripts()) {
|
| 454 | - $content .= $js; |
|
| 454 | + $content .= $js; |
|
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | echo $content; |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
| 3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 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 | switch((int) $modx->manager->action) { |
| 7 | - case 35: |
|
| 8 | - if(!$modx->hasPermission('edit_role')) { |
|
| 9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | - } |
|
| 11 | - break; |
|
| 12 | - case 38: |
|
| 13 | - if(!$modx->hasPermission('new_role')) { |
|
| 14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | - } |
|
| 16 | - break; |
|
| 17 | - default: |
|
| 18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | + case 35: |
|
| 8 | + if(!$modx->hasPermission('edit_role')) { |
|
| 9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 10 | + } |
|
| 11 | + break; |
|
| 12 | + case 38: |
|
| 13 | + if(!$modx->hasPermission('new_role')) { |
|
| 14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 15 | + } |
|
| 16 | + break; |
|
| 17 | + default: |
|
| 18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // check to see the snippet editor isn't locked |
| 26 | 26 | if($lockedEl = $modx->elementIsLocked(8, $role)) { |
| 27 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
| 27 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['role'])); |
|
| 28 | 28 | } |
| 29 | 29 | // end check for lock |
| 30 | 30 | |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | $modx->lockElement(8, $role); |
| 33 | 33 | |
| 34 | 34 | if($modx->manager->action == '35') { |
| 35 | - $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
| 36 | - $roledata = $modx->db->getRow($rs); |
|
| 37 | - if(!$roledata) { |
|
| 38 | - $modx->webAlertAndQuit("No role returned!"); |
|
| 39 | - } |
|
| 40 | - $_SESSION['itemname'] = $roledata['name']; |
|
| 35 | + $rs = $modx->db->select('*', $tbl_user_roles, "id='{$role}'"); |
|
| 36 | + $roledata = $modx->db->getRow($rs); |
|
| 37 | + if(!$roledata) { |
|
| 38 | + $modx->webAlertAndQuit("No role returned!"); |
|
| 39 | + } |
|
| 40 | + $_SESSION['itemname'] = $roledata['name']; |
|
| 41 | 41 | } else { |
| 42 | - $roledata = 0; |
|
| 43 | - $_SESSION['itemname'] = $_lang["new_role"]; |
|
| 42 | + $roledata = 0; |
|
| 43 | + $_SESSION['itemname'] = $_lang["new_role"]; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Add lock-element JS-Script |
@@ -107,63 +107,63 @@ discard block |
||
| 107 | 107 | <div class="form-group"> |
| 108 | 108 | <h3><?= $_lang['page_data_general'] ?></h3> |
| 109 | 109 | <?php |
| 110 | - echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
| 111 | - echo render_form('home', $_lang['role_home'], 'disabled'); |
|
| 112 | - echo render_form('messages', $_lang['role_messages']); |
|
| 113 | - echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
| 114 | - echo render_form('help', $_lang['role_help']); |
|
| 115 | - echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
| 116 | - echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
| 117 | - echo render_form('about', $_lang['role_about'], 'disabled'); |
|
| 118 | - echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
| 119 | - echo render_form('change_password', $_lang['role_change_password']); |
|
| 120 | - echo render_form('save_password', $_lang['role_save_password']); |
|
| 121 | - ?> |
|
| 110 | + echo render_form('frames', $_lang['role_frames'], 'disabled'); |
|
| 111 | + echo render_form('home', $_lang['role_home'], 'disabled'); |
|
| 112 | + echo render_form('messages', $_lang['role_messages']); |
|
| 113 | + echo render_form('logout', $_lang['role_logout'], 'disabled'); |
|
| 114 | + echo render_form('help', $_lang['role_help']); |
|
| 115 | + echo render_form('action_ok', $_lang['role_actionok'], 'disabled'); |
|
| 116 | + echo render_form('error_dialog', $_lang['role_errors'], 'disabled'); |
|
| 117 | + echo render_form('about', $_lang['role_about'], 'disabled'); |
|
| 118 | + echo render_form('credits', $_lang['role_credits'], 'disabled'); |
|
| 119 | + echo render_form('change_password', $_lang['role_change_password']); |
|
| 120 | + echo render_form('save_password', $_lang['role_save_password']); |
|
| 121 | + ?> |
|
| 122 | 122 | </div> |
| 123 | 123 | </div> |
| 124 | 124 | <div class="col-sm-6 col-lg-3"> |
| 125 | 125 | <div class="form-group"> |
| 126 | 126 | <h3><?= $_lang['role_content_management'] ?></h3> |
| 127 | 127 | <?php |
| 128 | - echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
| 129 | - echo render_form('new_document', $_lang['role_create_doc']); |
|
| 130 | - echo render_form('edit_document', $_lang['role_edit_doc']); |
|
| 131 | - echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
| 132 | - echo render_form('save_document', $_lang['role_save_doc']); |
|
| 133 | - echo render_form('publish_document', $_lang['role_publish_doc']); |
|
| 134 | - echo render_form('delete_document', $_lang['role_delete_doc']); |
|
| 135 | - echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
| 136 | - echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
| 137 | - echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
| 138 | - ?> |
|
| 128 | + echo render_form('view_document', $_lang['role_view_docdata'], 'disabled'); |
|
| 129 | + echo render_form('new_document', $_lang['role_create_doc']); |
|
| 130 | + echo render_form('edit_document', $_lang['role_edit_doc']); |
|
| 131 | + echo render_form('change_resourcetype', $_lang['role_change_resourcetype']); |
|
| 132 | + echo render_form('save_document', $_lang['role_save_doc']); |
|
| 133 | + echo render_form('publish_document', $_lang['role_publish_doc']); |
|
| 134 | + echo render_form('delete_document', $_lang['role_delete_doc']); |
|
| 135 | + echo render_form('empty_trash', $_lang['role_empty_trash']); |
|
| 136 | + echo render_form('empty_cache', $_lang['role_cache_refresh']); |
|
| 137 | + echo render_form('view_unpublished', $_lang['role_view_unpublished']); |
|
| 138 | + ?> |
|
| 139 | 139 | </div> |
| 140 | 140 | </div> |
| 141 | 141 | <div class="col-sm-6 col-lg-3 form-group"> |
| 142 | 142 | <div class="form-group"> |
| 143 | 143 | <h3><?= $_lang['role_file_management'] ?></h3> |
| 144 | 144 | <?php |
| 145 | - echo render_form('file_manager', $_lang['role_file_manager']); |
|
| 146 | - echo render_form('assets_files', $_lang['role_assets_files']); |
|
| 147 | - echo render_form('assets_images', $_lang['role_assets_images']); |
|
| 148 | - ?> |
|
| 145 | + echo render_form('file_manager', $_lang['role_file_manager']); |
|
| 146 | + echo render_form('assets_files', $_lang['role_assets_files']); |
|
| 147 | + echo render_form('assets_images', $_lang['role_assets_images']); |
|
| 148 | + ?> |
|
| 149 | 149 | </div> |
| 150 | 150 | <div class="form-group"> |
| 151 | 151 | <h3><?= $_lang['category_management'] ?></h3> |
| 152 | 152 | <?php |
| 153 | - echo render_form('category_manager', $_lang['role_category_manager']); |
|
| 154 | - ?> |
|
| 153 | + echo render_form('category_manager', $_lang['role_category_manager']); |
|
| 154 | + ?> |
|
| 155 | 155 | </div> |
| 156 | 156 | </div> |
| 157 | 157 | <div class="col-sm-6 col-lg-3"> |
| 158 | 158 | <div class="form-group"> |
| 159 | 159 | <h3><?= $_lang['role_module_management'] ?></h3> |
| 160 | 160 | <?php |
| 161 | - echo render_form('new_module', $_lang['role_new_module']); |
|
| 162 | - echo render_form('edit_module', $_lang['role_edit_module']); |
|
| 163 | - echo render_form('save_module', $_lang['role_save_module']); |
|
| 164 | - echo render_form('delete_module', $_lang['role_delete_module']); |
|
| 165 | - echo render_form('exec_module', $_lang['role_run_module']); |
|
| 166 | - ?> |
|
| 161 | + echo render_form('new_module', $_lang['role_new_module']); |
|
| 162 | + echo render_form('edit_module', $_lang['role_edit_module']); |
|
| 163 | + echo render_form('save_module', $_lang['role_save_module']); |
|
| 164 | + echo render_form('delete_module', $_lang['role_delete_module']); |
|
| 165 | + echo render_form('exec_module', $_lang['role_run_module']); |
|
| 166 | + ?> |
|
| 167 | 167 | </div> |
| 168 | 168 | </div> |
| 169 | 169 | </div> |
@@ -173,44 +173,44 @@ discard block |
||
| 173 | 173 | <div class="form-group"> |
| 174 | 174 | <h3><?= $_lang['role_template_management'] ?></h3> |
| 175 | 175 | <?php |
| 176 | - echo render_form('new_template', $_lang['role_create_template']); |
|
| 177 | - echo render_form('edit_template', $_lang['role_edit_template']); |
|
| 178 | - echo render_form('save_template', $_lang['role_save_template']); |
|
| 179 | - echo render_form('delete_template', $_lang['role_delete_template']); |
|
| 180 | - ?> |
|
| 176 | + echo render_form('new_template', $_lang['role_create_template']); |
|
| 177 | + echo render_form('edit_template', $_lang['role_edit_template']); |
|
| 178 | + echo render_form('save_template', $_lang['role_save_template']); |
|
| 179 | + echo render_form('delete_template', $_lang['role_delete_template']); |
|
| 180 | + ?> |
|
| 181 | 181 | </div> |
| 182 | 182 | </div> |
| 183 | 183 | <div class="col-sm-6 col-lg-3"> |
| 184 | 184 | <div class="form-group"> |
| 185 | 185 | <h3><?= $_lang['role_snippet_management'] ?></h3> |
| 186 | 186 | <?php |
| 187 | - echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
| 188 | - echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
| 189 | - echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
| 190 | - echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
| 191 | - ?> |
|
| 187 | + echo render_form('new_snippet', $_lang['role_create_snippet']); |
|
| 188 | + echo render_form('edit_snippet', $_lang['role_edit_snippet']); |
|
| 189 | + echo render_form('save_snippet', $_lang['role_save_snippet']); |
|
| 190 | + echo render_form('delete_snippet', $_lang['role_delete_snippet']); |
|
| 191 | + ?> |
|
| 192 | 192 | </div> |
| 193 | 193 | </div> |
| 194 | 194 | <div class="col-sm-6 col-lg-3"> |
| 195 | 195 | <div class="form-group"> |
| 196 | 196 | <h3><?= $_lang['role_chunk_management'] ?></h3> |
| 197 | 197 | <?php |
| 198 | - echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
| 199 | - echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
| 200 | - echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
| 201 | - echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
| 202 | - ?> |
|
| 198 | + echo render_form('new_chunk', $_lang['role_create_chunk']); |
|
| 199 | + echo render_form('edit_chunk', $_lang['role_edit_chunk']); |
|
| 200 | + echo render_form('save_chunk', $_lang['role_save_chunk']); |
|
| 201 | + echo render_form('delete_chunk', $_lang['role_delete_chunk']); |
|
| 202 | + ?> |
|
| 203 | 203 | </div> |
| 204 | 204 | </div> |
| 205 | 205 | <div class="col-sm-6 col-lg-3"> |
| 206 | 206 | <div class="form-group"> |
| 207 | 207 | <h3><?= $_lang['role_plugin_management'] ?></h3> |
| 208 | 208 | <?php |
| 209 | - echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
| 210 | - echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
| 211 | - echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
| 212 | - echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
| 213 | - ?> |
|
| 209 | + echo render_form('new_plugin', $_lang['role_create_plugin']); |
|
| 210 | + echo render_form('edit_plugin', $_lang['role_edit_plugin']); |
|
| 211 | + echo render_form('save_plugin', $_lang['role_save_plugin']); |
|
| 212 | + echo render_form('delete_plugin', $_lang['role_delete_plugin']); |
|
| 213 | + ?> |
|
| 214 | 214 | </div> |
| 215 | 215 | </div> |
| 216 | 216 | </div> |
@@ -220,42 +220,42 @@ discard block |
||
| 220 | 220 | <div class="form-group"> |
| 221 | 221 | <h3><?= $_lang['role_user_management'] ?></h3> |
| 222 | 222 | <?php |
| 223 | - echo render_form('new_user', $_lang['role_new_user']); |
|
| 224 | - echo render_form('edit_user', $_lang['role_edit_user']); |
|
| 225 | - echo render_form('save_user', $_lang['role_save_user']); |
|
| 226 | - echo render_form('delete_user', $_lang['role_delete_user']); |
|
| 227 | - ?> |
|
| 223 | + echo render_form('new_user', $_lang['role_new_user']); |
|
| 224 | + echo render_form('edit_user', $_lang['role_edit_user']); |
|
| 225 | + echo render_form('save_user', $_lang['role_save_user']); |
|
| 226 | + echo render_form('delete_user', $_lang['role_delete_user']); |
|
| 227 | + ?> |
|
| 228 | 228 | </div> |
| 229 | 229 | </div> |
| 230 | 230 | <div class="col-sm-6 col-lg-3"> |
| 231 | 231 | <div class="form-group"> |
| 232 | 232 | <h3><?= $_lang['role_web_user_management'] ?></h3> |
| 233 | 233 | <?php |
| 234 | - echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
| 235 | - echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
| 236 | - echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
| 237 | - echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
| 238 | - ?> |
|
| 234 | + echo render_form('new_web_user', $_lang['role_new_web_user']); |
|
| 235 | + echo render_form('edit_web_user', $_lang['role_edit_web_user']); |
|
| 236 | + echo render_form('save_web_user', $_lang['role_save_web_user']); |
|
| 237 | + echo render_form('delete_web_user', $_lang['role_delete_web_user']); |
|
| 238 | + ?> |
|
| 239 | 239 | </div> |
| 240 | 240 | </div> |
| 241 | 241 | <div class="col-sm-6 col-lg-3"> |
| 242 | 242 | <div class="form-group"> |
| 243 | 243 | <h3><?= $_lang['role_udperms'] ?></h3> |
| 244 | 244 | <?php |
| 245 | - echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
| 246 | - echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
| 247 | - ?> |
|
| 245 | + echo render_form('access_permissions', $_lang['role_access_persmissions']); |
|
| 246 | + echo render_form('web_access_permissions', $_lang['role_web_access_persmissions']); |
|
| 247 | + ?> |
|
| 248 | 248 | </div> |
| 249 | 249 | </div> |
| 250 | 250 | <div class="col-sm-6 col-lg-3"> |
| 251 | 251 | <div class="form-group"> |
| 252 | 252 | <h3><?= $_lang['role_role_management'] ?></h3> |
| 253 | 253 | <?php |
| 254 | - echo render_form('new_role', $_lang['role_new_role']); |
|
| 255 | - echo render_form('edit_role', $_lang['role_edit_role']); |
|
| 256 | - echo render_form('save_role', $_lang['role_save_role']); |
|
| 257 | - echo render_form('delete_role', $_lang['role_delete_role']); |
|
| 258 | - ?> |
|
| 254 | + echo render_form('new_role', $_lang['role_new_role']); |
|
| 255 | + echo render_form('edit_role', $_lang['role_edit_role']); |
|
| 256 | + echo render_form('save_role', $_lang['role_save_role']); |
|
| 257 | + echo render_form('delete_role', $_lang['role_delete_role']); |
|
| 258 | + ?> |
|
| 259 | 259 | </div> |
| 260 | 260 | </div> |
| 261 | 261 | </div> |
@@ -265,23 +265,23 @@ discard block |
||
| 265 | 265 | <div class="form-group"> |
| 266 | 266 | <h3><?= $_lang['role_eventlog_management'] ?></h3> |
| 267 | 267 | <?php |
| 268 | - echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
| 269 | - echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
| 270 | - ?> |
|
| 268 | + echo render_form('view_eventlog', $_lang['role_view_eventlog']); |
|
| 269 | + echo render_form('delete_eventlog', $_lang['role_delete_eventlog']); |
|
| 270 | + ?> |
|
| 271 | 271 | </div> |
| 272 | 272 | </div> |
| 273 | 273 | <div class="col-sm-6 col-lg-3"> |
| 274 | 274 | <div class="form-group"> |
| 275 | 275 | <h3><?= $_lang['role_config_management'] ?></h3> |
| 276 | 276 | <?php |
| 277 | - echo render_form('logs', $_lang['role_view_logs']); |
|
| 278 | - echo render_form('settings', $_lang['role_edit_settings']); |
|
| 279 | - echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
| 280 | - echo render_form('import_static', $_lang['role_import_static']); |
|
| 281 | - echo render_form('export_static', $_lang['role_export_static']); |
|
| 282 | - echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
| 283 | - echo render_form('display_locks', $_lang['role_display_locks']); |
|
| 284 | - ?> |
|
| 277 | + echo render_form('logs', $_lang['role_view_logs']); |
|
| 278 | + echo render_form('settings', $_lang['role_edit_settings']); |
|
| 279 | + echo render_form('bk_manager', $_lang['role_bk_manager']); |
|
| 280 | + echo render_form('import_static', $_lang['role_import_static']); |
|
| 281 | + echo render_form('export_static', $_lang['role_export_static']); |
|
| 282 | + echo render_form('remove_locks', $_lang['role_remove_locks']); |
|
| 283 | + echo render_form('display_locks', $_lang['role_display_locks']); |
|
| 284 | + ?> |
|
| 285 | 285 | </div> |
| 286 | 286 | </div> |
| 287 | 287 | </div> |
@@ -3,51 +3,51 @@ discard block |
||
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if(!$modx->hasPermission('exec_module')) { |
| 6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
| 10 | 10 | if($id==0) { |
| 11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // check if user has access permission, except admins |
| 15 | 15 | if($_SESSION['mgrRole']!=1){ |
| 16 | - $rs = $modx->db->select( |
|
| 17 | - 'sma.usergroup,mg.member', |
|
| 18 | - $modx->getFullTableName("site_module_access")." sma |
|
| 16 | + $rs = $modx->db->select( |
|
| 17 | + 'sma.usergroup,mg.member', |
|
| 18 | + $modx->getFullTableName("site_module_access")." sma |
|
| 19 | 19 | LEFT JOIN ".$modx->getFullTableName("member_groups")." mg ON mg.user_group = sma.usergroup AND member='".$modx->getLoginUserID()."'", |
| 20 | - "sma.module = '{$id}'" |
|
| 21 | - ); |
|
| 22 | - //initialize permission to -1, if it stays -1 no permissions |
|
| 23 | - //attached so permission granted |
|
| 24 | - $permissionAccessInt = -1; |
|
| 20 | + "sma.module = '{$id}'" |
|
| 21 | + ); |
|
| 22 | + //initialize permission to -1, if it stays -1 no permissions |
|
| 23 | + //attached so permission granted |
|
| 24 | + $permissionAccessInt = -1; |
|
| 25 | 25 | |
| 26 | - while ($row = $modx->db->getRow($rs)) { |
|
| 27 | - if($row["usergroup"] && $row["member"]) { |
|
| 28 | - //if there are permissions and this member has permission, ofcourse |
|
| 29 | - //this is granted |
|
| 30 | - $permissionAccessInt = 1; |
|
| 31 | - } elseif ($permissionAccessInt==-1) { |
|
| 32 | - //if there are permissions but this member has no permission and the |
|
| 33 | - //variable was still in init state we set permission to 0; no permissions |
|
| 34 | - $permissionAccessInt = 0; |
|
| 35 | - } |
|
| 36 | - } |
|
| 26 | + while ($row = $modx->db->getRow($rs)) { |
|
| 27 | + if($row["usergroup"] && $row["member"]) { |
|
| 28 | + //if there are permissions and this member has permission, ofcourse |
|
| 29 | + //this is granted |
|
| 30 | + $permissionAccessInt = 1; |
|
| 31 | + } elseif ($permissionAccessInt==-1) { |
|
| 32 | + //if there are permissions but this member has no permission and the |
|
| 33 | + //variable was still in init state we set permission to 0; no permissions |
|
| 34 | + $permissionAccessInt = 0; |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | |
| 38 | - if($permissionAccessInt==0) { |
|
| 39 | - $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
| 40 | - } |
|
| 38 | + if($permissionAccessInt==0) { |
|
| 39 | + $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | // get module data |
| 44 | 44 | $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'"); |
| 45 | 45 | $content = $modx->db->getRow($rs); |
| 46 | 46 | if(!$content) { |
| 47 | - $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
| 47 | + $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
|
| 48 | 48 | } |
| 49 | 49 | if($content['disabled']) { |
| 50 | - $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
| 50 | + $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Set the item name for logger |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $output = evalModule($content["modulecode"],$parameter); |
| 64 | 64 | if (strpos(trim($output),'<')===0 && strpos(trim($output),'<?xml')!==0) { |
| 65 | - echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller |
|
| 65 | + echo "<style>@supports (-webkit-overflow-scrolling: touch) {body,html {-webkit-overflow-scrolling: touch;overflow:auto!important;height:100%!important}}</style>"; // for iframe scroller |
|
| 66 | 66 | } |
| 67 | 67 | echo $output; |
| 68 | 68 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |