@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
|
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | // context menu |
| 28 | -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
|
| 28 | +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; |
|
| 29 | 29 | $cm = new ContextMenu("cntxm", 150);
|
| 30 | 30 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
|
| 31 | 31 | if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
|
@@ -108,24 +108,24 @@ discard block |
||
| 108 | 108 | <div class="table-responsive"> |
| 109 | 109 | <?php |
| 110 | 110 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
| 111 | - $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
|
|
| 112 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
|
| 113 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
|
| 114 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
|
| 115 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 111 | + $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"'.$_lang['yes'].'","-") as disabled, IF(sm.icon<>"",sm.icon,"'.$_style['icons_modules'].'") as icon
|
|
| 112 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm
|
|
| 113 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
|
|
| 114 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
|
|
| 115 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 116 | 116 | ORDER BY sm.name'); |
| 117 | 117 | if ($modx->hasPermission('edit_module')) {
|
| 118 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 118 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 119 | 119 | } elseif ($modx->hasPermission('exec_module')) {
|
| 120 | - $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 120 | + $title = "<a href='index.php?a=112&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 121 | 121 | } else {
|
| 122 | 122 | $title = '[+value+]'; |
| 123 | 123 | } |
| 124 | 124 | } else {
|
| 125 | 125 | $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
|
| 126 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
| 126 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
| 127 | 127 | } |
| 128 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
| 128 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
| 129 | 129 | $grd = new DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items
|
| 130 | 130 | $grd->noRecordMsg = $_lang["no_records_found"]; |
| 131 | 131 | $grd->cssClass = "table data"; |
@@ -133,10 +133,10 @@ discard block |
||
| 133 | 133 | $grd->itemClass = "tableItem"; |
| 134 | 134 | $grd->altItemClass = "tableAltItem"; |
| 135 | 135 | $grd->fields = "icon,name,description,locked,disabled"; |
| 136 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; |
|
| 136 | + $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"]; |
|
| 137 | 137 | $grd->colWidths = "34,,,60,60"; |
| 138 | 138 | $grd->colAligns = "center,,,center,center"; |
| 139 | - $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
|
| 139 | + $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='[+value+]'></i></a>||template:".$title; |
|
| 140 | 140 | if ($listmode == '1') {
|
| 141 | 141 | $grd->pageSize = 0; |
| 142 | 142 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
|
|
| 5 | +if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | $modx->manager->initPageViewState(); |
| 11 | 11 | |
| 12 | 12 | // get and save search string |
| 13 | -if ($_REQUEST['op'] == 'reset') {
|
|
| 13 | +if ($_REQUEST['op'] == 'reset') { |
|
| 14 | 14 | $query = ''; |
| 15 | 15 | $_PAGE['vs']['search'] = ''; |
| 16 | -} else {
|
|
| 16 | +} else { |
|
| 17 | 17 | $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 18 | 18 | $sqlQuery = $modx->db->escape($query); |
| 19 | 19 | $_PAGE['vs']['search'] = $query; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
| 29 | 29 | $cm = new ContextMenu("cntxm", 150);
|
| 30 | 30 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
|
| 31 | -if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
|
|
| 31 | +if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
|
| 32 | 32 | $cm->addSeparator(); |
| 33 | 33 | } |
| 34 | 34 | $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0));
|
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | <div class="tab-page"> |
| 108 | 108 | <div class="table-responsive"> |
| 109 | 109 | <?php |
| 110 | - if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
|
| 110 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
| 111 | 111 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
|
| 112 | 112 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
| 113 | 113 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
| 114 | 114 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
| 115 | 115 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
| 116 | 116 | ORDER BY sm.name'); |
| 117 | - if ($modx->hasPermission('edit_module')) {
|
|
| 117 | + if ($modx->hasPermission('edit_module')) { |
|
| 118 | 118 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 119 | - } elseif ($modx->hasPermission('exec_module')) {
|
|
| 119 | + } elseif ($modx->hasPermission('exec_module')) { |
|
| 120 | 120 | $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 121 | - } else {
|
|
| 121 | + } else { |
|
| 122 | 122 | $title = '[+value+]'; |
| 123 | 123 | } |
| 124 | - } else {
|
|
| 124 | + } else { |
|
| 125 | 125 | $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
|
| 126 | 126 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 127 | 127 | } |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | $grd->colWidths = "34,,,60,60"; |
| 138 | 138 | $grd->colAligns = "center,,,center,center"; |
| 139 | 139 | $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
| 140 | - if ($listmode == '1') {
|
|
| 140 | + if ($listmode == '1') { |
|
| 141 | 141 | $grd->pageSize = 0; |
| 142 | 142 | } |
| 143 | - if ($_REQUEST['op'] == 'reset') {
|
|
| 143 | + if ($_REQUEST['op'] == 'reset') { |
|
| 144 | 144 | $grd->pageNumber = 1; |
| 145 | 145 | } |
| 146 | 146 | // render grid |
@@ -4,18 +4,18 @@ |
||
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | switch ((int) $modx->manager->action) { |
| 7 | - case 35: |
|
| 8 | - if (!$modx->hasPermission('edit_role')) { |
|
| 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: |
|
| 9 | 18 | $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; |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | $tbl_user_roles = $modx->getFullTableName('user_roles'); |
| 24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | // Add lock-element JS-Script |
| 47 | 47 | $lockElementId = $role; |
| 48 | 48 | $lockElementType = 8; |
| 49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 50 | 50 | ?> |
| 51 | 51 | <script type="text/javascript"> |
| 52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
| 83 | 83 | |
| 84 | 84 | <h1> |
| 85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
| 85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
| 86 | 86 | </h1> |
| 87 | 87 | |
| 88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('logs')) {
|
@@ -12,14 +12,14 @@ discard block |
||
| 12 | 12 | $collation = $modx->db->getRow($res, 'num'); |
| 13 | 13 | |
| 14 | 14 | $serverArr = array( |
| 15 | - $_lang['modx_version'] => $modx->getVersionData('version') . ' ' . $newversiontext,
|
|
| 15 | + $_lang['modx_version'] => $modx->getVersionData('version').' '.$newversiontext,
|
|
| 16 | 16 | $_lang['release_date'] => $modx->getVersionData('release_date'),
|
| 17 | 17 | 'PHP Version' => phpversion(), |
| 18 | - 'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">' . $_lang['view'] . '</a>', |
|
| 18 | + 'phpInfo()' => '<a class="text-underline" href="javascript:;" onclick="viewPHPInfo();return false;">'.$_lang['view'].'</a>', |
|
| 19 | 19 | $_lang['access_permissions'] => ($use_udperms == 1 ? $_lang['enabled'] : $_lang['disabled']), |
| 20 | 20 | $_lang['servertime'] => strftime('%H:%M:%S', time()),
|
| 21 | 21 | $_lang['localtime'] => strftime('%H:%M:%S', time() + $server_offset_time),
|
| 22 | - $_lang['serveroffset'] => $server_offset_time / (60 * 60) . ' h', |
|
| 22 | + $_lang['serveroffset'] => $server_offset_time / (60 * 60).' h', |
|
| 23 | 23 | $_lang['database_name'] => trim($dbase, '`'), |
| 24 | 24 | $_lang['database_server'] => $database_server, |
| 25 | 25 | $_lang['database_version'] => $modx->db->getVersion(), |
@@ -95,33 +95,33 @@ discard block |
||
| 95 | 95 | </thead> |
| 96 | 96 | <tbody> |
| 97 | 97 | <?php |
| 98 | - $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; |
|
| 98 | + $sql = "SHOW TABLE STATUS FROM $dbase LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%';"; |
|
| 99 | 99 | $rs = $modx->db->query($sql); |
| 100 | 100 | $i = 0; |
| 101 | 101 | while ($log_status = $modx->db->getRow($rs)) {
|
| 102 | 102 | ?> |
| 103 | 103 | <tr> |
| 104 | 104 | <td class="text-primary"><b><?= $log_status['Name'] ?></b></td> |
| 105 | - <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $log_status['Comment'] . '"></i>' : '') ?></td> |
|
| 105 | + <td class="text-xs-center"><?= (!empty($log_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$log_status['Comment'].'"></i>' : '') ?></td> |
|
| 106 | 106 | <td class="text-xs-right"><?= $log_status['Rows'] ?></td> |
| 107 | 107 | |
| 108 | 108 | <?php |
| 109 | 109 | $truncateable = array( |
| 110 | - $modx->db->config['table_prefix'] . 'event_log', |
|
| 111 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
| 110 | + $modx->db->config['table_prefix'].'event_log', |
|
| 111 | + $modx->db->config['table_prefix'].'manager_log', |
|
| 112 | 112 | ); |
| 113 | 113 | if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
|
| 114 | 114 | echo "<td class=\"text-xs-right\">"; |
| 115 | - echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>"; |
|
| 115 | + echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=".$log_status['Name']."' title='".$_lang['truncate_table']."'>".$modx->nicesize($log_status['Data_length'] + $log_status['Data_free'])."</a>"; |
|
| 116 | 116 | echo "</td>"; |
| 117 | 117 | } else {
|
| 118 | - echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
|
| 118 | + echo "<td class=\"text-xs-right\">".$modx->nicesize($log_status['Data_length'] + $log_status['Data_free'])."</td>"; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | if ($modx->hasPermission('settings')) {
|
| 122 | - echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>"; |
|
| 122 | + echo "<td class=\"text-xs-right\">".($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=".$log_status['Name']."' title='".$_lang['optimize_table']."' ><span>".$modx->nicesize($log_status['Data_free'])."</span></a>" : "-")."</td>"; |
|
| 123 | 123 | } else {
|
| 124 | - echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
|
| 124 | + echo "<td class=\"text-xs-right\">".($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-")."</td>"; |
|
| 125 | 125 | } ?> |
| 126 | 126 | <td class="text-xs-right"><?= $modx->nicesize($log_status['Data_length'] - $log_status['Data_free']) ?></td> |
| 127 | 127 | <td class="text-xs-right"><?= $modx->nicesize($log_status['Index_length']) ?></td> |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | <tr class="unstyled"> |
| 136 | 136 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
| 137 | 137 | <td colspan="3"> </td> |
| 138 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">" . $modx->nicesize($totaloverhead) . "</b><br />(" . number_format($totaloverhead) . " B)" : "-" ?></td>
|
|
| 138 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? "<b class=\"text-danger\">".$modx->nicesize($totaloverhead)."</b><br />(".number_format($totaloverhead)." B)" : "-" ?></td>
|
|
| 139 | 139 | <td colspan="2"> </td> |
| 140 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td>
|
|
| 140 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td>
|
|
| 141 | 141 | </tr> |
| 142 | 142 | </tbody> |
| 143 | 143 | </table> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if (!$modx->hasPermission('logs')) {
|
|
| 5 | +if (!$modx->hasPermission('logs')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | <table class="table data table-sm nowrap"> |
| 56 | 56 | <tbody> |
| 57 | 57 | <?php |
| 58 | - foreach ($serverArr as $key => $value) {
|
|
| 58 | + foreach ($serverArr as $key => $value) { |
|
| 59 | 59 | ?> |
| 60 | 60 | <tr> |
| 61 | 61 | <td width="1%"><?= $key ?></td> |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; |
| 99 | 99 | $rs = $modx->db->query($sql); |
| 100 | 100 | $i = 0; |
| 101 | - while ($log_status = $modx->db->getRow($rs)) {
|
|
| 101 | + while ($log_status = $modx->db->getRow($rs)) { |
|
| 102 | 102 | ?> |
| 103 | 103 | <tr> |
| 104 | 104 | <td class="text-primary"><b><?= $log_status['Name'] ?></b></td> |
@@ -110,17 +110,17 @@ discard block |
||
| 110 | 110 | $modx->db->config['table_prefix'] . 'event_log', |
| 111 | 111 | $modx->db->config['table_prefix'] . 'manager_log', |
| 112 | 112 | ); |
| 113 | - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
|
|
| 113 | + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
| 114 | 114 | echo "<td class=\"text-xs-right\">"; |
| 115 | 115 | echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>"; |
| 116 | 116 | echo "</td>"; |
| 117 | - } else {
|
|
| 117 | + } else { |
|
| 118 | 118 | echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - if ($modx->hasPermission('settings')) {
|
|
| 121 | + if ($modx->hasPermission('settings')) { |
|
| 122 | 122 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>"; |
| 123 | - } else {
|
|
| 123 | + } else { |
|
| 124 | 124 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
| 125 | 125 | } ?> |
| 126 | 126 | <td class="text-xs-right"><?= $modx->nicesize($log_status['Data_length'] - $log_status['Data_free']) ?></td> |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | </table> |
| 144 | 144 | </div> |
| 145 | 145 | </div> |
| 146 | - <?php if ($totaloverhead > 0) {
|
|
| 146 | + <?php if ($totaloverhead > 0) { |
|
| 147 | 147 | ?> |
| 148 | 148 | <br> |
| 149 | 149 | <p class="alert alert-danger"><?= $_lang['database_overhead'] ?></p> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('export_static')) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | <div class="container container-body"> |
| 37 | 37 | <?php |
| 38 | 38 | if (isset($_POST['export'])) { |
| 39 | - $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); |
|
| 39 | + $rs = include_once(MODX_MANAGER_PATH.'processors/export_site.processor.php'); |
|
| 40 | 40 | echo $rs; |
| 41 | 41 | } else { |
| 42 | 42 | ?> |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | /********************/ |
| 7 | -$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
| 8 | -$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
| 9 | -$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
| 10 | -$add_path = $sd . $sb . $pg; |
|
| 7 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
| 8 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
| 9 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
| 10 | +$add_path = $sd.$sb.$pg; |
|
| 11 | 11 | /*******************/ |
| 12 | 12 | |
| 13 | 13 | // check permissions |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 25 | 25 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
| 26 | 26 | // check user has permissions for parent |
| 27 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
| 27 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
| 28 | 28 | $udperms = new udperms(); |
| 29 | 29 | $udperms->user = $modx->getLoginUserID(); |
| 30 | 30 | $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 41 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 42 | 42 | |
| 43 | 43 | // Get table names (alphabetical) |
| 44 | 44 | $tbl_categories = $modx->getFullTableName('categories'); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | if ($modx->manager->action == 27) { |
| 57 | 57 | //editing an existing document |
| 58 | 58 | // check permissions on the document |
| 59 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
| 59 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
| 60 | 60 | $udperms = new udperms(); |
| 61 | 61 | $udperms->user = $modx->getLoginUserID(); |
| 62 | 62 | $udperms->document = $id; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $modx->config['auto_menuindex'] = 1; |
| 137 | 137 | } |
| 138 | 138 | if ($modx->config['auto_menuindex']) { |
| 139 | - $pid = (int)$_REQUEST['pid']; |
|
| 139 | + $pid = (int) $_REQUEST['pid']; |
|
| 140 | 140 | $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
| 141 | 141 | $content['menuindex'] = $modx->db->getValue($rs); |
| 142 | 142 | } else { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // Add lock-element JS-Script |
| 152 | 152 | $lockElementId = $id; |
| 153 | 153 | $lockElementType = 7; |
| 154 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 154 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 155 | 155 | ?> |
| 156 | 156 | <script type="text/javascript"> |
| 157 | 157 | /* <![CDATA[ */ |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | }, |
| 182 | 182 | cancel: function() { |
| 183 | 183 | documentDirty = false; |
| 184 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
| 184 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
| 185 | 185 | }, |
| 186 | 186 | duplicate: function() { |
| 187 | 187 | if(confirm("<?= $_lang['confirm_resource_duplicate']?>") === true) { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | }, |
| 191 | 191 | view: function() { |
| 192 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin'); |
|
| 192 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin'); |
|
| 193 | 193 | } |
| 194 | 194 | }; |
| 195 | 195 | |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | |
| 578 | 578 | <h1> |
| 579 | 579 | <i class="fa fa-pencil-square-o"></i><?php if (isset($_REQUEST['id'])) { |
| 580 | - echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>'; |
|
| 580 | + echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').'<small>('.$_REQUEST['id'].')</small>'; |
|
| 581 | 581 | } else { |
| 582 | 582 | if ($modx->manager->action == '4') { |
| 583 | 583 | echo $_lang['add_resource']; |
@@ -614,15 +614,15 @@ discard block |
||
| 614 | 614 | $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
| 615 | 615 | while ($row = $modx->db->getRow($rs)) { |
| 616 | 616 | $out .= '<li class="breadcrumbs__li"> |
| 617 | - <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a> |
|
| 617 | + <a href="index.php?a=27&id=' . $row['id'].'" class="breadcrumbs__a">'.htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']).'</a> |
|
| 618 | 618 | <span class="breadcrumbs__sep">></span> |
| 619 | 619 | </li>'; |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
| 625 | - echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
| 624 | + $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">'.$title.'</li>'; |
|
| 625 | + echo '<ul class="breadcrumbs">'.$out.'</ul>'; |
|
| 626 | 626 | } |
| 627 | 627 | ?> |
| 628 | 628 | |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | |
| 752 | 752 | $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
| 753 | 753 | |
| 754 | - echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
| 754 | + echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
|
| 755 | 755 | $currentCategory = $thisCategory; |
| 756 | 756 | } |
| 757 | 757 | if ($thisCategory != '') { |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
| 901 | 901 | $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
| 902 | 902 | } else { |
| 903 | - 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 | + echo "\t".'<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>'."\n"; |
|
| 904 | 904 | } ?> |
| 905 | 905 | </div> |
| 906 | 906 | </td> |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | |
| 917 | 917 | if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { |
| 918 | 918 | $template = $default_template; |
| 919 | - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; |
|
| 919 | + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int) $modx->config['group_tvs']; |
|
| 920 | 920 | if (isset($_REQUEST['newtemplate'])) { |
| 921 | 921 | $template = $_REQUEST['newtemplate']; |
| 922 | 922 | } else { |
@@ -944,17 +944,17 @@ discard block |
||
| 944 | 944 | ); |
| 945 | 945 | $sort = 'tvtpl.rank,tv.rank, tv.id'; |
| 946 | 946 | if ($group_tvs) { |
| 947 | - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
| 947 | + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"'.$_lang['no_category'].'") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
| 948 | 948 | $from .= ' |
| 949 | - LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; |
|
| 950 | - $sort = 'cat.rank,cat.id,' . $sort; |
|
| 949 | + LEFT JOIN ' . $tbl_categories.' AS cat ON cat.id=tv.category'; |
|
| 950 | + $sort = 'cat.rank,cat.id,'.$sort; |
|
| 951 | 951 | } |
| 952 | 952 | $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); |
| 953 | 953 | $rs = $modx->db->select($field, $from, $where, $sort); |
| 954 | 954 | if ($modx->db->getRecordCount($rs)) { |
| 955 | 955 | $tvsArray = $modx->db->makeArray($rs, 'name'); |
| 956 | - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); |
|
| 957 | - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); |
|
| 956 | + require_once(MODX_MANAGER_PATH.'includes/tmplvars.inc.php'); |
|
| 957 | + require_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); |
|
| 958 | 958 | |
| 959 | 959 | $templateVariablesOutput = ''; |
| 960 | 960 | $templateVariablesGeneral = ''; |
@@ -968,8 +968,8 @@ discard block |
||
| 968 | 968 | if ($group_tvs == 1 || $group_tvs == 3) { |
| 969 | 969 | if ($i === 0) { |
| 970 | 970 | $templateVariablesOutput .= ' |
| 971 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
| 972 | - <div class="tab-header">' . $row['category'] . '</div> |
|
| 971 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
| 972 | + <div class="tab-header">' . $row['category'].'</div> |
|
| 973 | 973 | <div class="tab-body tmplvars"> |
| 974 | 974 | <table>' . "\n"; |
| 975 | 975 | } else { |
@@ -978,17 +978,17 @@ discard block |
||
| 978 | 978 | </div> |
| 979 | 979 | </div> |
| 980 | 980 | |
| 981 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
| 982 | - <div class="tab-header">' . $row['category'] . '</div> |
|
| 981 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
| 982 | + <div class="tab-header">' . $row['category'].'</div> |
|
| 983 | 983 | <div class="tab-body tmplvars"> |
| 984 | 984 | <table>'; |
| 985 | 985 | } |
| 986 | 986 | } elseif ($group_tvs == 2 || $group_tvs == 4) { |
| 987 | 987 | if ($i === 0) { |
| 988 | 988 | $templateVariablesOutput .= ' |
| 989 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 990 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 991 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 989 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 990 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 991 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 992 | 992 | |
| 993 | 993 | <div class="tab-body tmplvars"> |
| 994 | 994 | <table>'; |
@@ -998,9 +998,9 @@ discard block |
||
| 998 | 998 | </div> |
| 999 | 999 | </div> |
| 1000 | 1000 | |
| 1001 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 1002 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 1003 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 1001 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 1002 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 1003 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1004 | 1004 | |
| 1005 | 1005 | <div class="tab-body tmplvars"> |
| 1006 | 1006 | <table>'; |
@@ -1008,18 +1008,18 @@ discard block |
||
| 1008 | 1008 | } elseif ($group_tvs == 5) { |
| 1009 | 1009 | if ($i === 0) { |
| 1010 | 1010 | $templateVariablesOutput .= ' |
| 1011 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 1012 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 1013 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 1011 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 1012 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 1013 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1014 | 1014 | <table>'; |
| 1015 | 1015 | } else { |
| 1016 | 1016 | $templateVariablesOutput .= ' |
| 1017 | 1017 | </table> |
| 1018 | 1018 | </div> |
| 1019 | 1019 | |
| 1020 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
| 1021 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
| 1022 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
| 1020 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
| 1021 | + <h2 class="tab">' . $row['category'].'</h2> |
|
| 1022 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
| 1023 | 1023 | |
| 1024 | 1024 | <table>'; |
| 1025 | 1025 | } |
@@ -1039,8 +1039,8 @@ discard block |
||
| 1039 | 1039 | $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; |
| 1040 | 1040 | }; |
| 1041 | 1041 | // Add richtext editor to the list |
| 1042 | - $richtexteditorIds[$editor][] = "tv" . $row['id']; |
|
| 1043 | - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; |
|
| 1042 | + $richtexteditorIds[$editor][] = "tv".$row['id']; |
|
| 1043 | + $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions; |
|
| 1044 | 1044 | } |
| 1045 | 1045 | |
| 1046 | 1046 | $templateVariablesTmp = ''; |
@@ -1057,24 +1057,24 @@ discard block |
||
| 1057 | 1057 | } |
| 1058 | 1058 | |
| 1059 | 1059 | // post back value |
| 1060 | - if (array_key_exists('tv' . $row['id'], $_POST)) { |
|
| 1061 | - if (is_array($_POST['tv' . $row['id']])) { |
|
| 1062 | - $tvPBV = implode('||', $_POST['tv' . $row['id']]); |
|
| 1060 | + if (array_key_exists('tv'.$row['id'], $_POST)) { |
|
| 1061 | + if (is_array($_POST['tv'.$row['id']])) { |
|
| 1062 | + $tvPBV = implode('||', $_POST['tv'.$row['id']]); |
|
| 1063 | 1063 | } else { |
| 1064 | - $tvPBV = $_POST['tv' . $row['id']]; |
|
| 1064 | + $tvPBV = $_POST['tv'.$row['id']]; |
|
| 1065 | 1065 | } |
| 1066 | 1066 | } else { |
| 1067 | 1067 | $tvPBV = $row['value']; |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | - $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">' . $row['description'] . '</span>' : ''; |
|
| 1071 | - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">(' . $_lang['tmplvars_inherited'] . ')</span>' : ''; |
|
| 1072 | - $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*' . $row['name'] . '*]</small>' : ''; |
|
| 1070 | + $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">'.$row['description'].'</span>' : ''; |
|
| 1071 | + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">('.$_lang['tmplvars_inherited'].')</span>' : ''; |
|
| 1072 | + $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*'.$row['name'].'*]</small>' : ''; |
|
| 1073 | 1073 | |
| 1074 | 1074 | $templateVariablesTmp .= ' |
| 1075 | 1075 | <tr> |
| 1076 | - <td><span class="warning">' . $row['caption'] . $tvName . '</span>' . $tvDescription . $tvInherited . '</td> |
|
| 1077 | - <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '') . '">' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '</div></td> |
|
| 1076 | + <td><span class="warning">' . $row['caption'].$tvName.'</span>'.$tvDescription.$tvInherited.'</td> |
|
| 1077 | + <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '').'">'.renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray).'</div></td> |
|
| 1078 | 1078 | </tr>'; |
| 1079 | 1079 | |
| 1080 | 1080 | if ($group_tvs && $row['category_id'] == 0) { |
@@ -1088,38 +1088,38 @@ discard block |
||
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | if ($templateVariablesGeneral) { |
| 1091 | - echo '<table id="tabTV_0" class="tmplvars"><tbody>' . $templateVariablesGeneral . '</tbody></table>'; |
|
| 1091 | + echo '<table id="tabTV_0" class="tmplvars"><tbody>'.$templateVariablesGeneral.'</tbody></table>'; |
|
| 1092 | 1092 | } |
| 1093 | 1093 | |
| 1094 | 1094 | $templateVariables .= ' |
| 1095 | 1095 | <!-- Template Variables -->' . "\n"; |
| 1096 | 1096 | if (!$group_tvs) { |
| 1097 | 1097 | $templateVariables .= ' |
| 1098 | - <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
| 1098 | + <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
| 1099 | 1099 | <div class="sectionBody tmplvars"> |
| 1100 | 1100 | <table>'; |
| 1101 | 1101 | } elseif ($group_tvs == 2) { |
| 1102 | 1102 | $templateVariables .= ' |
| 1103 | 1103 | <div class="tab-section"> |
| 1104 | - <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
| 1104 | + <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
| 1105 | 1105 | <div class="tab-pane" id="paneTemplateVariables"> |
| 1106 | 1106 | <script type="text/javascript"> |
| 1107 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
| 1107 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
| 1108 | 1108 | </script>'; |
| 1109 | 1109 | } elseif ($group_tvs == 3) { |
| 1110 | 1110 | $templateVariables .= ' |
| 1111 | 1111 | <div id="templateVariables" class="tab-page tmplvars"> |
| 1112 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
| 1112 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
| 1113 | 1113 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>'; |
| 1114 | 1114 | } elseif ($group_tvs == 4) { |
| 1115 | 1115 | $templateVariables .= ' |
| 1116 | 1116 | <div id="templateVariables" class="tab-page tmplvars"> |
| 1117 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
| 1117 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
| 1118 | 1118 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script> |
| 1119 | 1119 | |
| 1120 | 1120 | <div class="tab-pane" id="paneTemplateVariables"> |
| 1121 | 1121 | <script type="text/javascript"> |
| 1122 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
| 1122 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
| 1123 | 1123 | </script>'; |
| 1124 | 1124 | } |
| 1125 | 1125 | $templateVariables .= $templateVariablesOutput; |
@@ -1239,7 +1239,7 @@ discard block |
||
| 1239 | 1239 | $custom_contenttype = (isset($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
| 1240 | 1240 | $ct = explode(",", $custom_contenttype); |
| 1241 | 1241 | for ($i = 0; $i < count($ct); $i++) { |
| 1242 | - echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
| 1242 | + echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n"; |
|
| 1243 | 1243 | } ?> |
| 1244 | 1244 | </select> |
| 1245 | 1245 | </td> |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | // Load up, the permissions from the parent (if new document) or existing document |
| 1375 | 1375 | $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
| 1376 | 1376 | while ($currentgroup = $modx->db->getRow($rs)) { |
| 1377 | - $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
| 1377 | + $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id']; |
|
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | 1380 | // Load up the current permissions and names |
@@ -1413,8 +1413,8 @@ discard block |
||
| 1413 | 1413 | while ($row = $modx->db->getRow($rs)) { |
| 1414 | 1414 | |
| 1415 | 1415 | // Create an inputValue pair (group ID and group link (if it exists)) |
| 1416 | - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1417 | - $inputId = 'group-' . $row['id']; |
|
| 1416 | + $inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new'); |
|
| 1417 | + $inputId = 'group-'.$row['id']; |
|
| 1418 | 1418 | |
| 1419 | 1419 | $checked = in_array($inputValue, $groupsarray); |
| 1420 | 1420 | if ($checked) { |
@@ -1438,11 +1438,11 @@ discard block |
||
| 1438 | 1438 | // Create attribute string list |
| 1439 | 1439 | $inputString = array(); |
| 1440 | 1440 | foreach ($inputAttributes as $k => $v) { |
| 1441 | - $inputString[] = $k . '="' . $v . '"'; |
|
| 1441 | + $inputString[] = $k.'="'.$v.'"'; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | // Make the <input> HTML |
| 1445 | - $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
| 1445 | + $inputHTML = '<input '.implode(' ', $inputString).' />'; |
|
| 1446 | 1446 | |
| 1447 | 1447 | // does user have this permission? |
| 1448 | 1448 | $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
@@ -1458,7 +1458,7 @@ discard block |
||
| 1458 | 1458 | } else { |
| 1459 | 1459 | ++$permissions_no; |
| 1460 | 1460 | } |
| 1461 | - $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
| 1461 | + $permissions[] = "\t\t".'<li>'.$inputHTML.'<label for="'.$inputId.'">'.$row['name'].'</label></li>'; |
|
| 1462 | 1462 | } |
| 1463 | 1463 | // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
| 1464 | 1464 | if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
@@ -1469,7 +1469,7 @@ discard block |
||
| 1469 | 1469 | if (!empty($permissions)) { |
| 1470 | 1470 | // Add the "All Document Groups" item if we have rights in both contexts |
| 1471 | 1471 | if ($isManager && $isWeb) { |
| 1472 | - 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>'); |
|
| 1472 | + 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>'); |
|
| 1473 | 1473 | } |
| 1474 | 1474 | // Output the permissions list... |
| 1475 | 1475 | ?> |
@@ -1502,7 +1502,7 @@ discard block |
||
| 1502 | 1502 | </script> |
| 1503 | 1503 | <p><?= $_lang['access_permissions_docs_message'] ?></p> |
| 1504 | 1504 | <ul> |
| 1505 | - <?= implode("\n", $permissions) . "\n" ?> |
|
| 1505 | + <?= implode("\n", $permissions)."\n" ?> |
|
| 1506 | 1506 | </ul> |
| 1507 | 1507 | </div><!--div class="tab-page" id="tabAccess"--> |
| 1508 | 1508 | <?php |
@@ -478,7 +478,8 @@ discard block |
||
| 478 | 478 | return s; |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | - <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific?> |
|
| 481 | + <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { |
|
| 482 | +// Web Link specific?> |
|
| 482 | 483 | var lastImageCtrl; |
| 483 | 484 | var lastFileCtrl; |
| 484 | 485 | |
@@ -695,7 +696,8 @@ discard block |
||
| 695 | 696 | </td> |
| 696 | 697 | </tr> |
| 697 | 698 | |
| 698 | - <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific?> |
|
| 699 | + <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { |
|
| 700 | +// Web Link specific?> |
|
| 699 | 701 | |
| 700 | 702 | <tr> |
| 701 | 703 | <td><span class="warning"><?= $_lang['weblink'] ?></span> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 22 | 22 | |
| 23 | 23 | // Get table Names (alphabetical) |
| 24 | 24 | $tbl_site_module_depobj = $modx->getFullTableName('site_module_depobj'); |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $rs = $modx->db->select('*', $tbl_site_snippets, "id='{$id}'"); |
| 40 | 40 | $content = $modx->db->getRow($rs); |
| 41 | 41 | if (!$content) { |
| 42 | - header("Location: " . MODX_SITE_URL . "index.php?id=" . $site_start); |
|
| 42 | + header("Location: ".MODX_SITE_URL."index.php?id=".$site_start); |
|
| 43 | 43 | } |
| 44 | 44 | $_SESSION['itemname'] = $content['name']; |
| 45 | 45 | if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $content['name'] = $_REQUEST['itemname']; |
| 51 | 51 | } else { |
| 52 | 52 | $_SESSION['itemname'] = $_lang["new_snippet"]; |
| 53 | - $content['category'] = (int)$_REQUEST['catid']; |
|
| 53 | + $content['category'] = (int) $_REQUEST['catid']; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ($modx->manager->hasFormValues()) { |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // Add lock-element JS-Script |
| 63 | 63 | $lockElementId = $id; |
| 64 | 64 | $lockElementType = 4; |
| 65 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
| 65 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
| 66 | 66 | ?> |
| 67 | 67 | <script type="text/javascript"> |
| 68 | 68 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | <input type="hidden" name="mode" value="<?= $modx->manager->action ?>"> |
| 432 | 432 | |
| 433 | 433 | <h1 class="pagetitle"> |
| 434 | - <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i> |
|
| 434 | + <i class="fa fa-code"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_snippet']) ?><i class="fa fa-question-circle help"></i> |
|
| 435 | 435 | </h1> |
| 436 | 436 | |
| 437 | 437 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | <div class="form-control-name clearfix"> |
| 458 | 458 | <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
| 459 | 459 | <?php if ($modx->hasPermission('save_role')): ?> |
| 460 | - <label class="custom-control" title="<?= $_lang['lock_snippet'] . "\n" . $_lang['lock_snippet_msg'] ?>" tooltip> |
|
| 460 | + <label class="custom-control" title="<?= $_lang['lock_snippet']."\n".$_lang['lock_snippet_msg'] ?>" tooltip> |
|
| 461 | 461 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
| 462 | 462 | <i class="fa fa-lock"></i> |
| 463 | 463 | </label> |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
| 482 | 482 | <option> </option> |
| 483 | 483 | <?php |
| 484 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 484 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 485 | 485 | foreach (getCategories() as $n => $v) { |
| 486 | - echo '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . '</option>'; |
|
| 486 | + echo '<option value="'.$v['id'].'"'.($content['category'] == $v['id'] ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category']).'</option>'; |
|
| 487 | 487 | } |
| 488 | 488 | ?> |
| 489 | 489 | </select> |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | <div class="form-group"> |
| 501 | 501 | <?php if ($_SESSION['mgrRole'] == 1): ?> |
| 502 | 502 | <div class="form-row"> |
| 503 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label> |
|
| 503 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label> |
|
| 504 | 504 | </div> |
| 505 | 505 | <?php endif; ?> |
| 506 | 506 | <div class="form-row"> |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | <span><?= $_lang['snippet_code'] ?></span> |
| 518 | 518 | </div> |
| 519 | 519 | <div class="section-editor clearfix"> |
| 520 | - <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php" . "\n" . trim($modx->htmlspecialchars($content['snippet'])) . "\n") ?></textarea> |
|
| 520 | + <textarea dir="ltr" name="post" class="phptextarea" rows="20" wrap="soft" onchange="documentDirty=true;"><?= (isset($content['post']) ? trim($modx->htmlspecialchars($content['post'])) : "<?php"."\n".trim($modx->htmlspecialchars($content['snippet']))."\n") ?></textarea> |
|
| 521 | 521 | </div> |
| 522 | 522 | <!-- PHP text editor end --> |
| 523 | 523 | </div> |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | INNER JOIN {$tbl_site_module_depobj} AS smd ON smd.module=sm.id AND smd.type=40 |
| 553 | 553 | INNER JOIN {$tbl_site_snippets} AS ss ON ss.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams=1", 'sm.name'); |
| 554 | 554 | while ($row = $modx->db->getRow($ds)) { |
| 555 | - echo "<option value='" . $row['guid'] . "'" . ($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "") . ">" . $modx->htmlspecialchars($row['name']) . "</option>"; |
|
| 555 | + echo "<option value='".$row['guid']."'".($content['moduleguid'] == $row['guid'] ? " selected='selected'" : "").">".$modx->htmlspecialchars($row['name'])."</option>"; |
|
| 556 | 556 | } |
| 557 | 557 | ?> |
| 558 | 558 | </select> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('view_eventlog')) {
|
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | <div class="form-group" id="lyr1"> |
| 18 | 18 | <b><?= $_lang["publish_events"] ?></b> |
| 19 | 19 | <?php |
| 20 | - $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
|
| 20 | + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC');
|
|
| 21 | 21 | $limit = $modx->db->getRecordCount($rs); |
| 22 | 22 | if ($limit < 1) {
|
| 23 | 23 | ?> |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | <div class="form-group" id="lyr2"> |
| 56 | 56 | <b><?= $_lang["unpublish_events"] ?></b> |
| 57 | 57 | <?php |
| 58 | - $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
|
| 58 | + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC');
|
|
| 59 | 59 | $limit = $modx->db->getRecordCount($rs); |
| 60 | 60 | if ($limit < 1) {
|
| 61 | 61 | ?> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if (!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | <?php |
| 20 | 20 | $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
| 21 | 21 | $limit = $modx->db->getRecordCount($rs); |
| 22 | - if ($limit < 1) {
|
|
| 22 | + if ($limit < 1) { |
|
| 23 | 23 | ?> |
| 24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
| 25 | 25 | <?php |
| 26 | - } else {
|
|
| 26 | + } else { |
|
| 27 | 27 | ?> |
| 28 | 28 | <div class="table-responsive"> |
| 29 | 29 | <table class="grid sortabletable" id="table-1"> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | </thead> |
| 37 | 37 | <tbody> |
| 38 | 38 | <?php |
| 39 | - while ($row = $modx->db->getRow($rs)) {
|
|
| 39 | + while ($row = $modx->db->getRow($rs)) { |
|
| 40 | 40 | ?> |
| 41 | 41 | <tr> |
| 42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | <?php |
| 58 | 58 | $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
| 59 | 59 | $limit = $modx->db->getRecordCount($rs); |
| 60 | - if ($limit < 1) {
|
|
| 60 | + if ($limit < 1) { |
|
| 61 | 61 | ?> |
| 62 | 62 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
| 63 | 63 | <?php |
| 64 | - } else {
|
|
| 64 | + } else { |
|
| 65 | 65 | ?> |
| 66 | 66 | <div class="table-responsive"> |
| 67 | 67 | <table class="grid sortabletable" id="table-2"> |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | </thead> |
| 75 | 75 | <tbody> |
| 76 | 76 | <?php |
| 77 | - while ($row = $modx->db->getRow($rs)) {
|
|
| 77 | + while ($row = $modx->db->getRow($rs)) { |
|
| 78 | 78 | ?> |
| 79 | 79 | <tr> |
| 80 | 80 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -95,11 +95,11 @@ discard block |
||
| 95 | 95 | <?php |
| 96 | 96 | $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
| 97 | 97 | $limit = $modx->db->getRecordCount($rs); |
| 98 | - if ($limit < 1) {
|
|
| 98 | + if ($limit < 1) { |
|
| 99 | 99 | ?> |
| 100 | 100 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
| 101 | 101 | <?php |
| 102 | - } else {
|
|
| 102 | + } else { |
|
| 103 | 103 | ?> |
| 104 | 104 | <div class="table-responsive"> |
| 105 | 105 | <table class="grid sortabletable" id="table-3"> |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | </thead> |
| 114 | 114 | <tbody> |
| 115 | 115 | <?php |
| 116 | - while ($row = $modx->db->getRow($rs)) {
|
|
| 116 | + while ($row = $modx->db->getRow($rs)) { |
|
| 117 | 117 | ?> |
| 118 | 118 | <tr> |
| 119 | 119 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
|
| 4 | 4 | } |
| 5 | 5 | |
@@ -17,15 +17,15 @@ 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'); |
|
| 20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
| 21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
| 22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
| 23 | 23 | |
| 24 | 24 | $msg = array(); |
| 25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']);
|
| 26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
| 26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
| 27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages);
|
| 28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
| 28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
| 29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
| 30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages);
|
| 31 | 31 | $ph['MessageInfo'] = implode("\n", $msg);
|
@@ -80,7 +80,7 @@ discard block |
||
| 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'); |
|
| 83 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
| 84 | 84 | if ($config_check_results != $_lang['configcheck_ok']) {
|
| 85 | 85 | $ph['config_check_results'] = $config_check_results; |
| 86 | 86 | $ph['config_display'] = 'block'; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | </tr> |
| 148 | 148 | </table>'; |
| 149 | 149 | |
| 150 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
| 150 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
| 151 | 151 | |
| 152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
| 153 | 153 | 'username' => $modx->getLoginUserName(), |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | if ($modx->db->getRecordCount($rs) < 1) {
|
| 166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
| 167 | 167 | } else {
|
| 168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 168 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
| 169 | 169 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
| 170 | 170 | $ph['now'] = strftime('%H:%M:%S', $now);
|
| 171 | 171 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | foreach ($userList as $params) {
|
| 212 | 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);
|
|
| 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 | 214 | } |
| 215 | 215 | |
| 216 | 216 | $html .= ' |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $ph['OnlineInfo'] = $html; |
| 223 | 223 | |
| 224 | 224 | // include rss feeds for important forum topics |
| 225 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
| 225 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
| 226 | 226 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
| 227 | 227 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
| 228 | 228 | |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | -usort($widgets, function ($a, $b) {
|
|
| 394 | +usort($widgets, function($a, $b){
|
|
| 395 | 395 | return $a['menuindex'] - $b['menuindex']; |
| 396 | 396 | }); |
| 397 | 397 | |
@@ -406,7 +406,7 @@ discard block |
||
| 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']; |
@@ -425,15 +425,15 @@ discard block |
||
| 425 | 425 | $chunk = $modx->getChunk($target); |
| 426 | 426 | if ($chunk !== false && !empty($chunk)) {
|
| 427 | 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 |
|
| 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 | 433 | |
| 434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
| 434 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
| 435 | 435 | } else {
|
| 436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
| 436 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.');
|
| 4 | 4 | } |
| 5 | 5 | |
| 6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
| 7 | 7 | |
| 8 | -if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) {
|
|
| 8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
| 9 | 9 | // seems to be a new install - send the user to the configuration page |
| 10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>');
|
| 11 | 11 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | $_SESSION['nrnewmessages'] = 0; |
| 17 | 17 | |
| 18 | 18 | // setup message info |
| 19 | -if ($modx->hasPermission('messages')) {
|
|
| 19 | +if ($modx->hasPermission('messages')) { |
|
| 20 | 20 | include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
| 21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
| 22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
@@ -32,46 +32,46 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | // setup icons |
| 35 | -if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) {
|
|
| 35 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
| 36 | 36 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
| 37 | 37 | $ph['SecurityIcon'] = wrapIcon($icon, 75); |
| 38 | 38 | } |
| 39 | -if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) {
|
|
| 39 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
| 40 | 40 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
| 41 | 41 | $ph['WebUserIcon'] = wrapIcon($icon, 99); |
| 42 | 42 | } |
| 43 | -if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) {
|
|
| 43 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
| 44 | 44 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
| 45 | 45 | $ph['ModulesIcon'] = wrapIcon($icon, 106); |
| 46 | 46 | } |
| 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')) {
|
|
| 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 | 48 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
| 49 | 49 | $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
| 50 | 50 | } |
| 51 | -if ($modx->hasPermission('bk_manager')) {
|
|
| 51 | +if ($modx->hasPermission('bk_manager')) { |
|
| 52 | 52 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
| 53 | 53 | $ph['BackupIcon'] = wrapIcon($icon, 93); |
| 54 | 54 | } |
| 55 | -if ($modx->hasPermission('help')) {
|
|
| 55 | +if ($modx->hasPermission('help')) { |
|
| 56 | 56 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
| 57 | 57 | $ph['HelpIcon'] = wrapIcon($icon, 9); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | -if ($modx->hasPermission('new_document')) {
|
|
| 60 | +if ($modx->hasPermission('new_document')) { |
|
| 61 | 61 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
| 62 | 62 | $ph['ResourceIcon'] = wrapIcon($icon, 4); |
| 63 | 63 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
| 64 | 64 | $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
| 65 | 65 | } |
| 66 | -if ($modx->hasPermission('assets_images')) {
|
|
| 66 | +if ($modx->hasPermission('assets_images')) { |
|
| 67 | 67 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
| 68 | 68 | $ph['ImagesIcon'] = wrapIcon($icon, 72); |
| 69 | 69 | } |
| 70 | -if ($modx->hasPermission('assets_files')) {
|
|
| 70 | +if ($modx->hasPermission('assets_files')) { |
|
| 71 | 71 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
| 72 | 72 | $ph['FilesIcon'] = wrapIcon($icon, 72); |
| 73 | 73 | } |
| 74 | -if ($modx->hasPermission('change_password')) {
|
|
| 74 | +if ($modx->hasPermission('change_password')) { |
|
| 75 | 75 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
| 76 | 76 | $ph['PasswordIcon'] = wrapIcon($icon, 28); |
| 77 | 77 | } |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
| 80 | 80 | |
| 81 | 81 | // do some config checks |
| 82 | -if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) {
|
|
| 82 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
| 83 | 83 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
| 84 | - if ($config_check_results != $_lang['configcheck_ok']) {
|
|
| 84 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
| 85 | 85 | $ph['config_check_results'] = $config_check_results; |
| 86 | 86 | $ph['config_display'] = 'block'; |
| 87 | - } else {
|
|
| 87 | + } else { |
|
| 88 | 88 | $ph['config_display'] = 'none'; |
| 89 | 89 | } |
| 90 | -} else {
|
|
| 90 | +} else { |
|
| 91 | 91 | $ph['config_display'] = 'none'; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Check logout-reminder |
| 95 | -if (isset($_SESSION['show_logout_reminder'])) {
|
|
| 96 | - switch ($_SESSION['show_logout_reminder']['type']) {
|
|
| 95 | +if (isset($_SESSION['show_logout_reminder'])) { |
|
| 96 | + switch ($_SESSION['show_logout_reminder']['type']) { |
|
| 97 | 97 | case 'logout_reminder': |
| 98 | 98 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
| 99 | 99 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']);
|
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | $ph['show_logout_reminder'] = 'block'; |
| 103 | 103 | unset($_SESSION['show_logout_reminder']); |
| 104 | -} else {
|
|
| 104 | +} else { |
|
| 105 | 105 | $ph['show_logout_reminder'] = 'none'; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -162,9 +162,9 @@ discard block |
||
| 162 | 162 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
| 163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC');
|
| 164 | 164 | |
| 165 | -if ($modx->db->getRecordCount($rs) < 1) {
|
|
| 165 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
| 166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
| 167 | -} else {
|
|
| 167 | +} else { |
|
| 168 | 168 | include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
| 169 | 169 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
| 170 | 170 | $ph['now'] = strftime('%H:%M:%S', $now);
|
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $userList = array(); |
| 191 | 191 | $userCount = array(); |
| 192 | 192 | // Create userlist with session-count first before output |
| 193 | - while ($activeusers = $modx->db->getRow($rs)) {
|
|
| 193 | + while ($activeusers = $modx->db->getRow($rs)) { |
|
| 194 | 194 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
| 195 | 195 | |
| 196 | 196 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | $currentaction |
| 209 | 209 | ); |
| 210 | 210 | } |
| 211 | - foreach ($userList as $params) {
|
|
| 211 | + foreach ($userList as $params) { |
|
| 212 | 212 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
| 213 | 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 | 214 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | |
| 254 | 254 | // invoke event OnManagerWelcomePrerender |
| 255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender');
|
| 256 | -if (is_array($evtOut)) {
|
|
| 256 | +if (is_array($evtOut)) { |
|
| 257 | 257 | $output = implode('', $evtOut);
|
| 258 | 258 | $ph['OnManagerWelcomePrerender'] = $output; |
| 259 | 259 | } |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
| 359 | 359 | 'hide'=>'0' |
| 360 | 360 | ); |
| 361 | -if ($modx->config['rss_url_news']) {
|
|
| 361 | +if ($modx->config['rss_url_news']) { |
|
| 362 | 362 | $widgets['news'] = array( |
| 363 | 363 | 'menuindex' => '40', |
| 364 | 364 | 'id' => 'news', |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | 'hide'=>'0' |
| 370 | 370 | ); |
| 371 | 371 | } |
| 372 | -if ($modx->config['rss_url_security']) {
|
|
| 372 | +if ($modx->config['rss_url_security']) { |
|
| 373 | 373 | $widgets['security'] = array( |
| 374 | 374 | 'menuindex' => '50', |
| 375 | 375 | 'id' => 'security', |
@@ -383,29 +383,29 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | // invoke OnManagerWelcomeHome event |
| 385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets));
|
| 386 | -if (is_array($sitewidgets)) {
|
|
| 386 | +if (is_array($sitewidgets)) { |
|
| 387 | 387 | $newwidgets = array(); |
| 388 | - foreach ($sitewidgets as $widget) {
|
|
| 388 | + foreach ($sitewidgets as $widget) { |
|
| 389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
| 390 | 390 | } |
| 391 | 391 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | -usort($widgets, function ($a, $b) {
|
|
| 394 | +usort($widgets, function ($a, $b){ |
|
| 395 | 395 | return $a['menuindex'] - $b['menuindex']; |
| 396 | 396 | }); |
| 397 | 397 | |
| 398 | 398 | $tpl = getTplWidget(); |
| 399 | 399 | $output = ''; |
| 400 | -foreach ($widgets as $widget) {
|
|
| 401 | - if ($widget['hide'] != '1') {
|
|
| 400 | +foreach ($widgets as $widget) { |
|
| 401 | + if ($widget['hide'] != '1') { |
|
| 402 | 402 | $output .= $modx->parseText($tpl, $widget); |
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | $ph['widgets'] = $output; |
| 406 | 406 | |
| 407 | 407 | // load template |
| 408 | -if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) {
|
|
| 408 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
| 409 | 409 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
| 410 | 410 | } |
| 411 | 411 | |
@@ -413,26 +413,27 @@ discard block |
||
| 413 | 413 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target);
|
| 414 | 414 | $target = $modx->mergeSettingsContent($target); |
| 415 | 415 | |
| 416 | -if (substr($target, 0, 1) === '@') {
|
|
| 417 | - if (substr($target, 0, 6) === '@CHUNK') {
|
|
| 416 | +if (substr($target, 0, 1) === '@') { |
|
| 417 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
| 418 | 418 | $content = $modx->getChunk(trim(substr($target, 7))); |
| 419 | - } elseif (substr($target, 0, 5) === '@FILE') {
|
|
| 419 | + } elseif (substr($target, 0, 5) === '@FILE') { |
|
| 420 | 420 | $content = file_get_contents(trim(substr($target, 6))); |
| 421 | - } else {
|
|
| 421 | + } else { |
|
| 422 | 422 | $content = ''; |
| 423 | 423 | } |
| 424 | -} else {
|
|
| 424 | +} else { |
|
| 425 | 425 | $chunk = $modx->getChunk($target); |
| 426 | - if ($chunk !== false && !empty($chunk)) {
|
|
| 426 | + if ($chunk !== false && !empty($chunk)) { |
|
| 427 | 427 | $content = $chunk; |
| 428 | - } elseif (is_file(MODX_BASE_PATH . $target)) {
|
|
| 428 | + } elseif (is_file(MODX_BASE_PATH . $target)) { |
|
| 429 | 429 | $content = file_get_contents(MODX_BASE_PATH . $target); |
| 430 | - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) {
|
|
| 430 | + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
| 431 | 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 |
|
| 432 | + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
| 433 | +// ClipperCMS compatible |
|
| 433 | 434 | |
| 434 | 435 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
| 435 | - } else {
|
|
| 436 | + } else { |
|
| 436 | 437 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
| 437 | 438 | } |
| 438 | 439 | } |
@@ -441,7 +442,7 @@ discard block |
||
| 441 | 442 | $content = $modx->mergeConditionalTagsContent($content); |
| 442 | 443 | $content = $modx->mergeSettingsContent($content); |
| 443 | 444 | $content = $modx->parseText($content, $ph); |
| 444 | -if (strpos($content, '[+') !== false) {
|
|
| 445 | +if (strpos($content, '[+') !== false) { |
|
| 445 | 446 | $modx->toPlaceholders($ph); |
| 446 | 447 | $content = $modx->mergePlaceholderContent($content); |
| 447 | 448 | } |
@@ -450,7 +451,7 @@ discard block |
||
| 450 | 451 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
| 451 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
| 452 | 453 | |
| 453 | -if ($js = $modx->getRegisteredClientScripts()) {
|
|
| 454 | +if ($js = $modx->getRegisteredClientScripts()) { |
|
| 454 | 455 | $content .= $js; |
| 455 | 456 | } |
| 456 | 457 | |
@@ -460,8 +461,9 @@ discard block |
||
| 460 | 461 | // <a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a> |
| 461 | 462 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
| 462 | 463 | //</span> |
| 463 | -function getTplWidget() |
|
| 464 | -{ // recent document info
|
|
| 464 | +function getTplWidget() |
|
| 465 | +{ |
|
| 466 | +// recent document info |
|
| 465 | 467 | return ' |
| 466 | 468 | <div class="[+cols+]" id="[+id+]"> |
| 467 | 469 | <div class="card"[+cardAttr+]> |
@@ -472,8 +474,9 @@ discard block |
||
| 472 | 474 | '; |
| 473 | 475 | } |
| 474 | 476 | |
| 475 | -function getRecentInfo() |
|
| 476 | -{ // recent document info
|
|
| 477 | +function getRecentInfo() |
|
| 478 | +{ |
|
| 479 | +// recent document info |
|
| 477 | 480 | $modx = evolutionCMS(); |
| 478 | 481 | |
| 479 | 482 | $modx->addSnippet('recentInfoList', 'getRecentInfoList');
|
@@ -499,13 +502,13 @@ discard block |
||
| 499 | 502 | return $html; |
| 500 | 503 | } |
| 501 | 504 | |
| 502 | -function getRecentInfoList() |
|
| 503 | -{
|
|
| 505 | +function getRecentInfoList() |
|
| 506 | +{ |
|
| 504 | 507 | $modx = evolutionCMS(); |
| 505 | 508 | |
| 506 | 509 | $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10);
|
| 507 | 510 | |
| 508 | - if ($modx->db->getRecordCount($rs) < 1) {
|
|
| 511 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
| 509 | 512 | return '<tr><td>[%no_activity_message%]</td></tr>'; |
| 510 | 513 | } |
| 511 | 514 | |
@@ -515,22 +518,22 @@ discard block |
||
| 515 | 518 | $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
| 516 | 519 | |
| 517 | 520 | $output = array(); |
| 518 | - while ($ph = $modx->db->getRow($rs)) {
|
|
| 521 | + while ($ph = $modx->db->getRow($rs)) { |
|
| 519 | 522 | $docid = $ph['id']; |
| 520 | 523 | $_ = $modx->getUserInfo($ph['editedby']); |
| 521 | 524 | $ph['username'] = $_['username']; |
| 522 | 525 | |
| 523 | - if ($ph['deleted'] == 1) {
|
|
| 526 | + if ($ph['deleted'] == 1) { |
|
| 524 | 527 | $ph['status'] = 'deleted text-danger'; |
| 525 | - } elseif ($ph['published'] == 0) {
|
|
| 528 | + } elseif ($ph['published'] == 0) { |
|
| 526 | 529 | $ph['status'] = 'unpublished font-italic text-muted'; |
| 527 | - } else {
|
|
| 530 | + } else { |
|
| 528 | 531 | $ph['status'] = 'published'; |
| 529 | 532 | } |
| 530 | 533 | |
| 531 | - if ($modx->hasPermission('edit_document')) {
|
|
| 534 | + if ($modx->hasPermission('edit_document')) { |
|
| 532 | 535 | $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']);
|
| 533 | - } else {
|
|
| 536 | + } else { |
|
| 534 | 537 | $ph['edit_btn'] = ''; |
| 535 | 538 | } |
| 536 | 539 | |
@@ -543,40 +546,40 @@ discard block |
||
| 543 | 546 | $preview_disabled |
| 544 | 547 | ), $btntpl['preview_btn']); |
| 545 | 548 | |
| 546 | - if ($modx->hasPermission('delete_document')) {
|
|
| 547 | - if ($ph['deleted'] == 0) {
|
|
| 549 | + if ($modx->hasPermission('delete_document')) { |
|
| 550 | + if ($ph['deleted'] == 0) { |
|
| 548 | 551 | $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
| 549 | - } else {
|
|
| 552 | + } else { |
|
| 550 | 553 | $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
| 551 | 554 | } |
| 552 | 555 | $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn);
|
| 553 | - } else {
|
|
| 556 | + } else { |
|
| 554 | 557 | $ph['delete_btn'] = ''; |
| 555 | 558 | } |
| 556 | 559 | |
| 557 | - if ($ph['deleted'] == 1 && $ph['published'] == 0) {
|
|
| 560 | + if ($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
| 558 | 561 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
| 559 | - } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) {
|
|
| 562 | + } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
| 560 | 563 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
| 561 | - } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) {
|
|
| 564 | + } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
| 562 | 565 | $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
| 563 | - } else {
|
|
| 566 | + } else { |
|
| 564 | 567 | $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
| 565 | 568 | } |
| 566 | 569 | $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn);
|
| 567 | 570 | |
| 568 | 571 | $ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>');
|
| 569 | 572 | |
| 570 | - if ($ph['longtitle'] == '') {
|
|
| 573 | + if ($ph['longtitle'] == '') { |
|
| 571 | 574 | $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
| 572 | 575 | } |
| 573 | - if ($ph['description'] == '') {
|
|
| 576 | + if ($ph['description'] == '') { |
|
| 574 | 577 | $ph['description'] = '(<i>[%not_set%]</i>)'; |
| 575 | 578 | } |
| 576 | - if ($ph['introtext'] == '') {
|
|
| 579 | + if ($ph['introtext'] == '') { |
|
| 577 | 580 | $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
| 578 | 581 | } |
| 579 | - if ($ph['alias'] == '') {
|
|
| 582 | + if ($ph['alias'] == '') { |
|
| 580 | 583 | $ph['alias'] = '(<i>[%not_set%]</i>)'; |
| 581 | 584 | } |
| 582 | 585 | |
@@ -585,8 +588,8 @@ discard block |
||
| 585 | 588 | return implode("\n", $output);
|
| 586 | 589 | } |
| 587 | 590 | |
| 588 | -function getRecentInfoRowTpl() |
|
| 589 | -{
|
|
| 591 | +function getRecentInfoRowTpl() |
|
| 592 | +{ |
|
| 590 | 593 | $tpl = ' |
| 591 | 594 | <tr> |
| 592 | 595 | <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td> |
@@ -615,13 +618,13 @@ discard block |
||
| 615 | 618 | } |
| 616 | 619 | |
| 617 | 620 | // setup icons |
| 618 | -function wrapIcon($i, $action) |
|
| 619 | -{
|
|
| 621 | +function wrapIcon($i, $action) |
|
| 622 | +{ |
|
| 620 | 623 | return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i);
|
| 621 | 624 | } |
| 622 | 625 | |
| 623 | -function getStartUpScript() |
|
| 624 | -{
|
|
| 626 | +function getStartUpScript() |
|
| 627 | +{ |
|
| 625 | 628 | $script = ' |
| 626 | 629 | <script type="text/javascript"> |
| 627 | 630 | function hideConfigCheckWarning(key) {
|
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | exit(); |
| 4 | 4 | } |
| 5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | <?php |
| 42 | 42 | $rs = $modx->db->select('*', $modx->getFullTableName('site_templates')); |
| 43 | 43 | $option[] = '<option value="">No selected</option>'; |
| 44 | - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; |
|
| 44 | + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : ''; |
|
| 45 | 45 | $selected = $templateid === 0 ? ' selected="selected"' : ''; |
| 46 | - $option[] = '<option value="0"' . $selected . '>(blank)</option>'; |
|
| 46 | + $option[] = '<option value="0"'.$selected.'>(blank)</option>'; |
|
| 47 | 47 | while ($row = $modx->db->getRow($rs)) { |
| 48 | 48 | $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); |
| 49 | 49 | $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); |
| 87 | 87 | $searchlongtitle = $modx->db->escape(trim($_REQUEST['searchfields'])); |
| 88 | 88 | $search_alias = $modx->db->escape(trim($_REQUEST['searchfields'])); |
| 89 | - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; |
|
| 89 | + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : ''; |
|
| 90 | 90 | $searchcontent = $modx->db->escape($_REQUEST['content']); |
| 91 | 91 | |
| 92 | 92 | $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; |
@@ -100,12 +100,12 @@ discard block |
||
| 100 | 100 | $friendly_url_suffix = $modx->config['friendly_url_suffix']; |
| 101 | 101 | $base_url = $modx->config['base_url']; |
| 102 | 102 | $site_url = $modx->config['site_url']; |
| 103 | - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); |
|
| 103 | + $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url); |
|
| 104 | 104 | if ($url[0] === '/') { |
| 105 | - $url = preg_replace('@^' . $base_url . '@', '', $url); |
|
| 105 | + $url = preg_replace('@^'.$base_url.'@', '', $url); |
|
| 106 | 106 | } |
| 107 | 107 | if (substr($url, 0, 4) === 'http') { |
| 108 | - $url = preg_replace('@^' . $site_url . '@', '', $url); |
|
| 108 | + $url = preg_replace('@^'.$site_url.'@', '', $url); |
|
| 109 | 109 | } |
| 110 | 110 | $idFromAlias = $modx->getIdFromAlias($url); |
| 111 | 111 | } |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
| 119 | 119 | $articul_result = $modx->db->query($articul_query); |
| 120 | 120 | $articul_id_array = $modx->db->makeArray($articul_result); |
| 121 | - if (count($articul_id_array)>0) { |
|
| 121 | + if (count($articul_id_array) > 0) { |
|
| 122 | 122 | $articul_id = ''; |
| 123 | 123 | $i = 1; |
| 124 | 124 | foreach ($articul_id_array as $articul) { |
| 125 | - $articul_id.=$articul['contentid']; |
|
| 125 | + $articul_id .= $articul['contentid']; |
|
| 126 | 126 | if ($i !== count($articul_id_array)) { |
| 127 | - $articul_id.=','; |
|
| 127 | + $articul_id .= ','; |
|
| 128 | 128 | } |
| 129 | 129 | $i++; |
| 130 | 130 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if (ctype_digit($searchfields)) { |
| 138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
| 139 | 139 | if (strlen($searchfields) > 3) { |
| 140 | - $sqladd .= $articul_id_query;//search by TV |
|
| 140 | + $sqladd .= $articul_id_query; //search by TV |
|
| 141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
| 157 | 157 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
| 158 | 158 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
| 159 | - $sqladd .= $articul_id_query;//search by TV |
|
| 159 | + $sqladd .= $articul_id_query; //search by TV |
|
| 160 | 160 | $sqladd .= ")"; |
| 161 | 161 | } |
| 162 | 162 | } elseif ($idFromAlias) { |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 181 | 181 | $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
| 182 | 182 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
| 183 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
| 184 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 183 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
| 184 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | if ($sqladd) { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $where = $sqladd; |
| 192 | 192 | |
| 193 | 193 | if ($where) { |
| 194 | - $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
| 194 | + $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
| 195 | 195 | $limit = $modx->db->getRecordCount($rs); |
| 196 | 196 | } else { |
| 197 | 197 | $limit = 0; |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | if ($limit < 1) { |
| 208 | 208 | echo $_lang['search_empty']; |
| 209 | 209 | } else { |
| 210 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); ?> |
|
| 210 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); ?> |
|
| 211 | 211 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
| 212 | 212 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
| 213 | 213 | <thead> |
@@ -265,14 +265,14 @@ discard block |
||
| 265 | 265 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
| 266 | 266 | ?> |
| 267 | 267 | <td<?= $tdClass ?>> |
| 268 | - <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a> |
|
| 268 | + <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a> |
|
| 269 | 269 | </td> |
| 270 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
| 270 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
| 271 | 271 | <?php |
| 272 | 272 | } else { |
| 273 | 273 | ?> |
| 274 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
| 275 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
| 274 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
| 275 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
| 276 | 276 | <?php |
| 277 | 277 | } ?> |
| 278 | 278 | </tr> |
@@ -289,115 +289,115 @@ discard block |
||
| 289 | 289 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
| 290 | 290 | $docscounts = $modx->db->getRecordCount($rs); |
| 291 | 291 | if ($docscounts > 0) { |
| 292 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
| 292 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
| 293 | 293 | while ($row = $modx->db->getRow($rs)) { |
| 294 | - $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 294 | + $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | //templates |
| 300 | 300 | if ($modx->hasPermission('edit_template')) { |
| 301 | - $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
| 302 | - OR `templatename` like '%" . $searchfields . "%' |
|
| 303 | - OR `description` like '%" . $searchfields . "%' |
|
| 304 | - OR `content` like '%" . $searchfields . "%'"); |
|
| 301 | + $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
| 302 | + OR `templatename` like '%" . $searchfields."%' |
|
| 303 | + OR `description` like '%" . $searchfields."%' |
|
| 304 | + OR `content` like '%" . $searchfields."%'"); |
|
| 305 | 305 | $templatecounts = $modx->db->getRecordCount($rs); |
| 306 | 306 | if ($templatecounts > 0) { |
| 307 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
| 307 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
| 308 | 308 | while ($row = $modx->db->getRow($rs)) { |
| 309 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 309 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 310 | 310 | } |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | //tvs |
| 315 | 315 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
| 316 | - $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
| 317 | - OR `name` like '%" . $searchfields . "%' |
|
| 318 | - OR `description` like '%" . $searchfields . "%' |
|
| 319 | - OR `type` like '%" . $searchfields . "%' |
|
| 320 | - OR `elements` like '%" . $searchfields . "%' |
|
| 321 | - OR `display` like '%" . $searchfields . "%' |
|
| 322 | - OR `display_params` like '%" . $searchfields . "%' |
|
| 323 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
| 316 | + $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
| 317 | + OR `name` like '%" . $searchfields."%' |
|
| 318 | + OR `description` like '%" . $searchfields."%' |
|
| 319 | + OR `type` like '%" . $searchfields."%' |
|
| 320 | + OR `elements` like '%" . $searchfields."%' |
|
| 321 | + OR `display` like '%" . $searchfields."%' |
|
| 322 | + OR `display_params` like '%" . $searchfields."%' |
|
| 323 | + OR `default_text` like '%" . $searchfields."%'"); |
|
| 324 | 324 | $tvscounts = $modx->db->getRecordCount($rs); |
| 325 | 325 | if ($tvscounts > 0) { |
| 326 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
| 326 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
| 327 | 327 | while ($row = $modx->db->getRow($rs)) { |
| 328 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 328 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | //Chunks |
| 334 | 334 | if ($modx->hasPermission('edit_chunk')) { |
| 335 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
| 336 | - OR `name` like '%" . $searchfields . "%' |
|
| 337 | - OR `description` like '%" . $searchfields . "%' |
|
| 338 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
| 335 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
| 336 | + OR `name` like '%" . $searchfields."%' |
|
| 337 | + OR `description` like '%" . $searchfields."%' |
|
| 338 | + OR `snippet` like '%" . $searchfields."%'"); |
|
| 339 | 339 | $chunkscounts = $modx->db->getRecordCount($rs); |
| 340 | 340 | if ($chunkscounts > 0) { |
| 341 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
| 341 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
| 342 | 342 | while ($row = $modx->db->getRow($rs)) { |
| 343 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 343 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | //Snippets |
| 349 | 349 | if ($modx->hasPermission('edit_snippet')) { |
| 350 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
| 351 | - OR `name` like '%" . $searchfields . "%' |
|
| 352 | - OR `description` like '%" . $searchfields . "%' |
|
| 353 | - OR `snippet` like '%" . $searchfields . "%' |
|
| 354 | - OR `properties` like '%" . $searchfields . "%' |
|
| 355 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
| 350 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
| 351 | + OR `name` like '%" . $searchfields."%' |
|
| 352 | + OR `description` like '%" . $searchfields."%' |
|
| 353 | + OR `snippet` like '%" . $searchfields."%' |
|
| 354 | + OR `properties` like '%" . $searchfields."%' |
|
| 355 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
| 356 | 356 | $snippetscounts = $modx->db->getRecordCount($rs); |
| 357 | 357 | if ($snippetscounts > 0) { |
| 358 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
| 358 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
| 359 | 359 | while ($row = $modx->db->getRow($rs)) { |
| 360 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 360 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 361 | 361 | } |
| 362 | 362 | } |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | //plugins |
| 366 | 366 | if ($modx->hasPermission('edit_plugin')) { |
| 367 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
| 368 | - OR `name` like '%" . $searchfields . "%' |
|
| 369 | - OR `description` like '%" . $searchfields . "%' |
|
| 370 | - OR `plugincode` like '%" . $searchfields . "%' |
|
| 371 | - OR `properties` like '%" . $searchfields . "%' |
|
| 372 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
| 367 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
| 368 | + OR `name` like '%" . $searchfields."%' |
|
| 369 | + OR `description` like '%" . $searchfields."%' |
|
| 370 | + OR `plugincode` like '%" . $searchfields."%' |
|
| 371 | + OR `properties` like '%" . $searchfields."%' |
|
| 372 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
| 373 | 373 | $pluginscounts = $modx->db->getRecordCount($rs); |
| 374 | 374 | if ($pluginscounts > 0) { |
| 375 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
| 375 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
| 376 | 376 | while ($row = $modx->db->getRow($rs)) { |
| 377 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 377 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 378 | 378 | } |
| 379 | 379 | } |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | //modules |
| 383 | 383 | if ($modx->hasPermission('edit_module')) { |
| 384 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
| 385 | - OR `name` like '%" . $searchfields . "%' |
|
| 386 | - OR `description` like '%" . $searchfields . "%' |
|
| 387 | - OR `modulecode` like '%" . $searchfields . "%' |
|
| 388 | - OR `properties` like '%" . $searchfields . "%' |
|
| 389 | - OR `guid` like '%" . $searchfields . "%' |
|
| 390 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
| 384 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
| 385 | + OR `name` like '%" . $searchfields."%' |
|
| 386 | + OR `description` like '%" . $searchfields."%' |
|
| 387 | + OR `modulecode` like '%" . $searchfields."%' |
|
| 388 | + OR `properties` like '%" . $searchfields."%' |
|
| 389 | + OR `guid` like '%" . $searchfields."%' |
|
| 390 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
| 391 | 391 | $modulescounts = $modx->db->getRecordCount($rs); |
| 392 | 392 | if ($modulescounts > 0) { |
| 393 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
| 393 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
| 394 | 394 | while ($row = $modx->db->getRow($rs)) { |
| 395 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
| 395 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
| 400 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
| 401 | 401 | } ?> |
| 402 | 402 | </div> |
| 403 | 403 | </div> |
@@ -411,13 +411,13 @@ discard block |
||
| 411 | 411 | */ |
| 412 | 412 | function highlightingCoincidence($text, $search) |
| 413 | 413 | { |
| 414 | - $regexp = '!(' . str_replace(array( |
|
| 414 | + $regexp = '!('.str_replace(array( |
|
| 415 | 415 | '(', |
| 416 | 416 | ')' |
| 417 | 417 | ), array( |
| 418 | 418 | '\(', |
| 419 | 419 | '\)' |
| 420 | - ), trim($search)) . ')!isu'; |
|
| 420 | + ), trim($search)).')!isu'; |
|
| 421 | 421 | return preg_replace($regexp, '<span class="text-danger">$1</span>', $text); |
| 422 | 422 | } |
| 423 | 423 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $class .= ' deleted'; |
| 441 | 441 | } |
| 442 | 442 | if ($class) { |
| 443 | - $class = ' class="' . trim($class) . '"'; |
|
| 443 | + $class = ' class="'.trim($class).'"'; |
|
| 444 | 444 | } |
| 445 | 445 | return $class; |
| 446 | 446 | } |