@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 2 | +if(IN_MANAGER_MODE!="true") { |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | +} |
|
| 3 | 5 | $logo= '<img src="media/style/default/images/misc/login-logo.png" height="54" width="358" border="0">'; |
| 4 | 6 | $downloadLinks = array( |
| 5 | 7 | 0=>array('title'=>$_lang["information"],'link'=>'https://evo.im/'), |
@@ -16,12 +18,15 @@ discard block |
||
| 16 | 18 | 1=>array('title'=>$_lang["extras"],'link'=>'https://www.transifex.com/evolutioncms/extras/'), |
| 17 | 19 | ); |
| 18 | 20 | |
| 19 | -function createList($sectionHeader, $linkArr) { |
|
| 21 | +function createList($sectionHeader, $linkArr) |
|
| 22 | +{ |
|
| 20 | 23 | $output = '<div class="sectionHeader">'.$sectionHeader.'</div><div class="sectionBody">'."\n"; |
| 21 | 24 | $output .= '<table width="500" border="0" cellspacing="0" cellpadding="0">'."\n"; |
| 22 | 25 | $links = ''; |
| 23 | 26 | foreach($linkArr as $row) { |
| 24 | - if (!is_array($row['link'])) $row['link'] = array($row['link']); |
|
| 27 | + if (!is_array($row['link'])) { |
|
| 28 | + $row['link'] = array($row['link']); |
|
| 29 | + } |
|
| 25 | 30 | foreach ($row['link'] as $link) { |
| 26 | 31 | $links .= $links != '' ? '<br/>' : ''; |
| 27 | 32 | $links .= '<a href="' . $link . '" target="_blank">' . $link . '</a>'; |
@@ -293,7 +293,8 @@ |
||
| 293 | 293 | </form> |
| 294 | 294 | |
| 295 | 295 | <?php |
| 296 | -function render_form($name, $label, $status = '') { |
|
| 296 | +function render_form($name, $label, $status = '') |
|
| 297 | +{ |
|
| 297 | 298 | global $modx, $roledata; |
| 298 | 299 | |
| 299 | 300 | $tpl = '<label class="d-block" for="[+name+]check"> |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(IN_MANAGER_MODE != "true") { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('settings')) {
|
|
| 5 | +if(!$modx->hasPermission('settings')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // check to see the edit settings page isn't locked |
| 12 | 12 | $rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
|
| 13 | -if($username = $modx->db->getValue($rs)) {
|
|
| 13 | +if($username = $modx->db->getValue($rs)) { |
|
| 14 | 14 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
| 15 | 15 | } |
| 16 | 16 | // end check for lock |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $settings = array(); |
| 21 | 21 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
| 22 | 22 | $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]system_settings');
|
| 23 | -while($row = $modx->db->getRow($rs)) {
|
|
| 23 | +while($row = $modx->db->getRow($rs)) { |
|
| 24 | 24 | $settings[$row['setting_name']] = $row['setting_value']; |
| 25 | 25 | } |
| 26 | 26 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
|
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | // load languages and keys |
| 32 | 32 | $lang_keys = array(); |
| 33 | 33 | $dir = dir('includes/lang');
|
| 34 | -while($file = $dir->read()) {
|
|
| 35 | - if(strpos($file, '.inc.php') > 0) {
|
|
| 34 | +while($file = $dir->read()) { |
|
| 35 | + if(strpos($file, '.inc.php') > 0) { |
|
| 36 | 36 | $endpos = strpos($file, '.'); |
| 37 | 37 | $languagename = substr($file, 0, $endpos); |
| 38 | 38 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -131,6 +131,6 @@ discard block |
||
| 131 | 131 | }); |
| 132 | 132 | </script> |
| 133 | 133 | <?php |
| 134 | -if(is_numeric($_GET['tab'])) {
|
|
| 134 | +if(is_numeric($_GET['tab'])) { |
|
| 135 | 135 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
| 136 | 136 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (IN_MANAGER_MODE != "true") {
|
|
| 2 | +if (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 | - } else if ($modx->hasPermission('exec_module')) {
|
|
| 119 | + } else if ($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 |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(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 | |
@@ -11,13 +11,15 @@ discard block |
||
| 11 | 11 | 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
| 12 | 12 | ); |
| 13 | 13 | |
| 14 | -function parsePh($tpl, $ph) {
|
|
| 14 | +function parsePh($tpl, $ph) |
|
| 15 | +{ |
|
| 15 | 16 | global $modx, $_lang; |
| 16 | 17 | $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
| 17 | 18 | return $modx->parseText($tpl, $ph); |
| 18 | 19 | } |
| 19 | 20 | |
| 20 | -function renderViewSwitchButtons($cssId) {
|
|
| 21 | +function renderViewSwitchButtons($cssId) |
|
| 22 | +{ |
|
| 21 | 23 | global $modx, $_lang, $tpl; |
| 22 | 24 | |
| 23 | 25 | return parsePh($tpl['viewForm'], array( |
@@ -25,20 +27,21 @@ discard block |
||
| 25 | 27 | )); |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | -function createResourceList($resourceTable, $resources) {
|
|
| 30 | +function createResourceList($resourceTable, $resources) |
|
| 31 | +{ |
|
| 29 | 32 | global $modx, $_lang, $_style, $modx_textdir, $tpl; |
| 30 | 33 | |
| 31 | 34 | $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
| 32 | 35 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
| 33 | 36 | |
| 34 | - if(!$items) {
|
|
| 37 | + if(!$items) { |
|
| 35 | 38 | return $_lang['no_results']; |
| 36 | 39 | } |
| 37 | 40 | |
| 38 | 41 | // Prepare elements- and categories-list |
| 39 | 42 | $elements = array(); |
| 40 | 43 | $categories = array(); |
| 41 | - foreach($items as $row) {
|
|
| 44 | + foreach($items as $row) { |
|
| 42 | 45 | $catid = $row['catid'] ? $row['catid'] : 0; |
| 43 | 46 | $categories[$catid] = array('name' => stripslashes($row['category']));
|
| 44 | 47 | $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
@@ -46,7 +49,7 @@ discard block |
||
| 46 | 49 | |
| 47 | 50 | // Now render categories / panel-collapse |
| 48 | 51 | $panelGroup = ''; |
| 49 | - foreach($elements as $catid => $elList) {
|
|
| 52 | + foreach($elements as $catid => $elList) { |
|
| 50 | 53 | // Add panel-heading / category-collapse to output |
| 51 | 54 | $panelGroup .= parsePh($tpl['panelHeading'], array( |
| 52 | 55 | 'tab' => $resourceTable, |
@@ -57,7 +60,7 @@ discard block |
||
| 57 | 60 | |
| 58 | 61 | // Prepare content for panel-collapse |
| 59 | 62 | $panelCollapse = ''; |
| 60 | - foreach($elList as $el) {
|
|
| 63 | + foreach($elList as $el) { |
|
| 61 | 64 | $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
| 62 | 65 | } |
| 63 | 66 | |
@@ -75,14 +78,15 @@ discard block |
||
| 75 | 78 | )); |
| 76 | 79 | } |
| 77 | 80 | |
| 78 | -function createCombinedView($resources) {
|
|
| 81 | +function createCombinedView($resources) |
|
| 82 | +{ |
|
| 79 | 83 | global $modx, $_lang, $_style, $modx_textdir; |
| 80 | 84 | |
| 81 | 85 | $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
| 82 | 86 | $types = isset($resources->types) ? $resources->types : false; |
| 83 | 87 | $categories = isset($resources->categories) ? $resources->categories : false; |
| 84 | 88 | |
| 85 | - if(!$itemsPerCategory) {
|
|
| 89 | + if(!$itemsPerCategory) { |
|
| 86 | 90 | return $_lang['no_results']; |
| 87 | 91 | } |
| 88 | 92 | |
@@ -95,10 +99,10 @@ discard block |
||
| 95 | 99 | |
| 96 | 100 | // Easily loop through $itemsPerCategory-Array |
| 97 | 101 | $panelGroup = ''; |
| 98 | - foreach($categories as $catid => $category) {
|
|
| 102 | + foreach($categories as $catid => $category) { |
|
| 99 | 103 | // Prepare collapse content / elements-list |
| 100 | 104 | $panelCollapse = ''; |
| 101 | - foreach($itemsPerCategory[$catid] as $el) {
|
|
| 105 | + foreach($itemsPerCategory[$catid] as $el) { |
|
| 102 | 106 | $resourceTable = $el['type']; |
| 103 | 107 | $ph = prepareElementRowPh($el, $resourceTable, $resources); |
| 104 | 108 | $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
@@ -126,7 +130,8 @@ discard block |
||
| 126 | 130 | )); |
| 127 | 131 | } |
| 128 | 132 | |
| 129 | -function prepareElementRowPh($row, $resourceTable, $resources) {
|
|
| 133 | +function prepareElementRowPh($row, $resourceTable, $resources) |
|
| 134 | +{ |
|
| 130 | 135 | global $modx, $modx_textdir, $_style, $_lang; |
| 131 | 136 | |
| 132 | 137 | $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
@@ -134,32 +139,32 @@ discard block |
||
| 134 | 139 | $class = ''; |
| 135 | 140 | $_lang["confirm_delete"] = $_lang["delete"]; |
| 136 | 141 | |
| 137 | - if($resourceTable == 'site_templates') {
|
|
| 142 | + if($resourceTable == 'site_templates') { |
|
| 138 | 143 | $class = $row['selectable'] ? '' : 'disabledPlugin'; |
| 139 | 144 | $lockElementType = 1; |
| 140 | 145 | $_lang["confirm_delete"] = $_lang["confirm_delete_template"]; |
| 141 | 146 | } |
| 142 | - if($resourceTable == 'site_tmplvars') {
|
|
| 147 | + if($resourceTable == 'site_tmplvars') { |
|
| 143 | 148 | $class = $row['reltpl'] ? '' : 'disabledPlugin'; |
| 144 | 149 | $lockElementType = 2; |
| 145 | 150 | $_lang["confirm_delete"] = $_lang["confirm_delete_tmplvars"]; |
| 146 | 151 | } |
| 147 | - if($resourceTable == 'site_htmlsnippets') {
|
|
| 152 | + if($resourceTable == 'site_htmlsnippets') { |
|
| 148 | 153 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
| 149 | 154 | $lockElementType = 3; |
| 150 | 155 | $_lang["confirm_delete"] = $_lang["confirm_delete_htmlsnippet"]; |
| 151 | 156 | } |
| 152 | - if($resourceTable == 'site_snippets') {
|
|
| 157 | + if($resourceTable == 'site_snippets') { |
|
| 153 | 158 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
| 154 | 159 | $lockElementType = 4; |
| 155 | 160 | $_lang["confirm_delete"] = $_lang["confirm_delete_snippet"]; |
| 156 | 161 | } |
| 157 | - if($resourceTable == 'site_plugins') {
|
|
| 162 | + if($resourceTable == 'site_plugins') { |
|
| 158 | 163 | $class = $row['disabled'] ? 'disabledPlugin' : ''; |
| 159 | 164 | $lockElementType = 5; |
| 160 | 165 | $_lang["confirm_delete"] = $_lang["confirm_delete_plugin"]; |
| 161 | 166 | } |
| 162 | - if($resourceTable == 'site_modules') {
|
|
| 167 | + if($resourceTable == 'site_modules') { |
|
| 163 | 168 | $class = $row['disabled'] ? '' : 'disabledPlugin'; |
| 164 | 169 | $_lang["confirm_delete"] = $_lang["confirm_delete_module"]; |
| 165 | 170 | } |
@@ -167,56 +172,56 @@ discard block |
||
| 167 | 172 | // Prepare displaying user-locks |
| 168 | 173 | $lockedByUser = ''; |
| 169 | 174 | $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
| 170 | - if($rowLock && $modx->hasPermission('display_locks')) {
|
|
| 171 | - if($rowLock['sid'] == $modx->sid) {
|
|
| 175 | + if($rowLock && $modx->hasPermission('display_locks')) { |
|
| 176 | + if($rowLock['sid'] == $modx->sid) { |
|
| 172 | 177 | $title = $modx->parseText($_lang["lock_element_editing"], array( |
| 173 | 178 | 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
| 174 | 179 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 175 | 180 | )); |
| 176 | 181 | $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
| 177 | - } else {
|
|
| 182 | + } else { |
|
| 178 | 183 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
| 179 | 184 | 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
| 180 | 185 | 'username' => $rowLock['username'], |
| 181 | 186 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 182 | 187 | )); |
| 183 | - if($modx->hasPermission('remove_locks')) {
|
|
| 188 | + if($modx->hasPermission('remove_locks')) { |
|
| 184 | 189 | $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>';
|
| 185 | - } else {
|
|
| 190 | + } else { |
|
| 186 | 191 | $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
| 187 | 192 | } |
| 188 | 193 | } |
| 189 | 194 | } |
| 190 | - if($lockedByUser) {
|
|
| 195 | + if($lockedByUser) { |
|
| 191 | 196 | $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | // Caption |
| 195 | - if($resourceTable == 'site_tmplvars') {
|
|
| 200 | + if($resourceTable == 'site_tmplvars') { |
|
| 196 | 201 | $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption'];
|
| 197 | - } else {
|
|
| 202 | + } else { |
|
| 198 | 203 | $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
| 199 | 204 | } |
| 200 | 205 | |
| 201 | 206 | // Special marks |
| 202 | 207 | $tplInfo = array(); |
| 203 | - if($row['locked']) {
|
|
| 208 | + if($row['locked']) { |
|
| 204 | 209 | $tplInfo[] = $_lang['locked']; |
| 205 | 210 | } |
| 206 | - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') {
|
|
| 211 | + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
| 207 | 212 | $tplInfo[] = $_lang['defaulttemplate_title']; |
| 208 | 213 | } |
| 209 | 214 | $marks = !empty($tplInfo) ? ' <em>(' . join(', ', $tplInfo) . ')</em>' : '';
|
| 210 | 215 | |
| 211 | 216 | /* row buttons */ |
| 212 | 217 | $buttons = ''; |
| 213 | - if($modx->hasPermission($types['actions']['edit'][1])) {
|
|
| 218 | + if($modx->hasPermission($types['actions']['edit'][1])) { |
|
| 214 | 219 | $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
| 215 | 220 | } |
| 216 | - if($modx->hasPermission($types['actions']['duplicate'][1])) {
|
|
| 221 | + if($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
| 217 | 222 | $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
| 218 | 223 | } |
| 219 | - if($modx->hasPermission($types['actions']['remove'][1])) {
|
|
| 224 | + if($modx->hasPermission($types['actions']['remove'][1])) { |
|
| 220 | 225 | $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
| 221 | 226 | } |
| 222 | 227 | $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
@@ -1,19 +1,24 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 2 | +if(IN_MANAGER_MODE!="true") { |
|
| 3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 4 | +} |
|
| 3 | 5 | |
| 4 | -class mgrResources { |
|
| 6 | +class mgrResources |
|
| 7 | +{ |
|
| 5 | 8 | var $types = array(); |
| 6 | 9 | var $items = array(); |
| 7 | 10 | var $categories = array(); |
| 8 | 11 | var $itemsPerCategory = array(); |
| 9 | 12 | |
| 10 | - function __construct() { |
|
| 13 | + function __construct() |
|
| 14 | + { |
|
| 11 | 15 | $this->setTypes(); |
| 12 | 16 | $this->queryItemsFromDB(); |
| 13 | 17 | $this->prepareCategoryArrays(); |
| 14 | 18 | } |
| 15 | 19 | |
| 16 | - function setTypes() { |
|
| 20 | + function setTypes() |
|
| 21 | + { |
|
| 17 | 22 | global $_lang; |
| 18 | 23 | $this->types['site_templates'] = array( |
| 19 | 24 | 'title'=>$_lang["manage_templates"], |
@@ -48,7 +53,8 @@ discard block |
||
| 48 | 53 | ); |
| 49 | 54 | } |
| 50 | 55 | |
| 51 | - function queryItemsFromDB() { |
|
| 56 | + function queryItemsFromDB() |
|
| 57 | + { |
|
| 52 | 58 | foreach($this->types as $resourceTable=>$type) { |
| 53 | 59 | if($this->hasAnyPermissions($type['permissions'])) { |
| 54 | 60 | $nameField = isset($type['name']) ? $type['name'] : 'name'; |
@@ -57,16 +63,19 @@ discard block |
||
| 57 | 63 | } |
| 58 | 64 | } |
| 59 | 65 | |
| 60 | - function hasAnyPermissions($permissions) { |
|
| 66 | + function hasAnyPermissions($permissions) |
|
| 67 | + { |
|
| 61 | 68 | global $modx; |
| 62 | 69 | |
| 63 | - foreach($permissions as $p) |
|
| 64 | - if($modx->hasPermission($p)) return true; |
|
| 70 | + foreach($permissions as $p) { |
|
| 71 | + if($modx->hasPermission($p)) return true; |
|
| 72 | + } |
|
| 65 | 73 | |
| 66 | 74 | return false; |
| 67 | 75 | } |
| 68 | 76 | |
| 69 | - function queryResources($resourceTable, $nameField = 'name') { |
|
| 77 | + function queryResources($resourceTable, $nameField = 'name') |
|
| 78 | + { |
|
| 70 | 79 | global $modx, $_lang; |
| 71 | 80 | |
| 72 | 81 | $pluginsql = ($resourceTable == 'site_htmlsnippets' || $resourceTable == 'site_snippets' || $resourceTable == 'site_plugins' || $resourceTable == 'site_modules') ? $resourceTable . '.disabled, ' : ''; |
@@ -77,8 +86,9 @@ discard block |
||
| 77 | 86 | $tvsql = 'site_tmplvars.caption, '; |
| 78 | 87 | $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
| 79 | 88 | $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
| 89 | + } else { |
|
| 90 | + $sttfield = ''; |
|
| 80 | 91 | } |
| 81 | - else $sttfield = ''; |
|
| 82 | 92 | |
| 83 | 93 | $selectableTemplates = $resourceTable == 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
| 84 | 94 | |
@@ -91,7 +101,9 @@ discard block |
||
| 91 | 101 | ); |
| 92 | 102 | $limit = $modx->db->getRecordCount($rs); |
| 93 | 103 | |
| 94 | - if($limit < 1) return false; |
|
| 104 | + if($limit < 1) { |
|
| 105 | + return false; |
|
| 106 | + } |
|
| 95 | 107 | |
| 96 | 108 | $result = array(); |
| 97 | 109 | while ($row = $modx->db->getRow($rs)) { |
@@ -100,7 +112,8 @@ discard block |
||
| 100 | 112 | return $result; |
| 101 | 113 | } |
| 102 | 114 | |
| 103 | - function prepareCategoryArrays() { |
|
| 115 | + function prepareCategoryArrays() |
|
| 116 | + { |
|
| 104 | 117 | foreach($this->items as $type=>$items) { |
| 105 | 118 | foreach((array)$items as $item) { |
| 106 | 119 | $catid = $item['catid'] ? $item['catid'] : 0; |
@@ -116,7 +129,7 @@ discard block |
||
| 116 | 129 | |
| 117 | 130 | // Now sort by name |
| 118 | 131 | foreach($this->itemsPerCategory as $catid=>$items) { |
| 119 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
| 132 | + usort($this->itemsPerCategory[$catid], function ($a, $b){ |
|
| 120 | 133 | return strcasecmp($a['name'], $b['name']); |
| 121 | 134 | }); |
| 122 | 135 | } |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (IN_MANAGER_MODE != "true") {
|
|
| 2 | +if (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 | ?> |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") {
|
|
| 2 | +if(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('change_password')) {
|
|
| 5 | +if(!$modx->hasPermission('change_password')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |
@@ -29,10 +29,12 @@ |
||
| 29 | 29 | |
| 30 | 30 | <div class="tab-page"> |
| 31 | 31 | <div class="container container-body"> |
| 32 | - <?php if($num_rows_pub) printf('<p>' . $_lang["refresh_published"] . '</p>', $num_rows_pub) ?> |
|
| 32 | + <?php if($num_rows_pub) { |
|
| 33 | + printf('<p>' . $_lang["refresh_published"] . '</p>', $num_rows_pub) ?> |
|
| 33 | 34 | <?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?> |
| 34 | 35 | <?php |
| 35 | 36 | $modx->clearCache('full', true); |
| 37 | +} |
|
| 36 | 38 | // invoke OnSiteRefresh event |
| 37 | 39 | $modx->invokeEvent("OnSiteRefresh"); |
| 38 | 40 | ?> |