@@ -14,8 +14,11 @@ |
||
14 | 14 | // count duplicates |
15 | 15 | $name = $modx->getDatabase()->getValue($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "id='{$id}'")); |
16 | 16 | $count = $modx->getDatabase()->getRecordCount($modx->getDatabase()->select('name', $modx->getFullTableName('site_tmplvars'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
17 | -if($count>=1) $count = ' '.($count+1); |
|
18 | -else $count = ''; |
|
17 | +if($count>=1) { |
|
18 | + $count = ' '.($count+1); |
|
19 | +} else { |
|
20 | + $count = ''; |
|
21 | +} |
|
19 | 22 | |
20 | 23 | // duplicate TV |
21 | 24 | $newid = $modx->getDatabase()->insert( |
@@ -44,17 +44,23 @@ discard block |
||
44 | 44 | * Initialize Document Parsing |
45 | 45 | * ----------------------------- |
46 | 46 | */ |
47 | -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
47 | +if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) { |
|
48 | + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
49 | +} |
|
48 | 50 | |
49 | 51 | $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
50 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
52 | +if(is_file($base_path . 'assets/cache/siteManager.php')) { |
|
51 | 53 | include_once($base_path . 'assets/cache/siteManager.php'); |
52 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
54 | +} |
|
55 | +if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
53 | 56 | define('MGR_DIR', 'manager'); |
54 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
57 | +} |
|
58 | +if(is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
55 | 59 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
56 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
60 | +} |
|
61 | +if(!defined('MODX_SITE_HOSTNAMES')) { |
|
57 | 62 | define('MODX_SITE_HOSTNAMES', ''); |
63 | +} |
|
58 | 64 | |
59 | 65 | // get start time |
60 | 66 | $mstart = memory_get_usage(); |
@@ -126,7 +132,7 @@ discard block |
||
126 | 132 | @ini_set("display_errors","0"); |
127 | 133 | } |
128 | 134 | |
129 | -if(MODX_CLI){ |
|
135 | +if(MODX_CLI) { |
|
130 | 136 | @set_time_limit(0); |
131 | 137 | @ini_set('max_execution_time',0); |
132 | 138 | } |
@@ -199,7 +199,8 @@ discard block |
||
199 | 199 | $c = substr($modifiers, 0, 1); |
200 | 200 | $modifiers = substr($modifiers, 1); |
201 | 201 | |
202 | - if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { // :=, :!=, :<=, :>=, :!<=, :!>= |
|
202 | + if ($c === ':' && preg_match('@^(!?[<>=]{1,2})@', $modifiers, $match)) { |
|
203 | +// :=, :!=, :<=, :>=, :!<=, :!>= |
|
203 | 204 | $c = substr($modifiers, strlen($match[1]), 1); |
204 | 205 | $debuginfo = "#i=0 #c=[{$c}] #m=[{$modifiers}]"; |
205 | 206 | if ($c === '(') { |
@@ -215,7 +216,8 @@ discard block |
||
215 | 216 | $result[] = array('cmd' => trim($match[1]), 'opt' => $opt, 'debuginfo' => $debuginfo); |
216 | 217 | $cmd = ''; |
217 | 218 | } elseif (in_array($c, array('+', '-', '*', '/')) && preg_match('@^[0-9]+@', $modifiers, |
218 | - $match)) { // :+3, :-3, :*3 ... |
|
219 | + $match)) { |
|
220 | +// :+3, :-3, :*3 ... |
|
219 | 221 | $modifiers = substr($modifiers, strlen($match[0])); |
220 | 222 | $result[] = array('cmd' => 'math', 'opt' => '%s' . $c . $match[0]); |
221 | 223 | $cmd = ''; |
@@ -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->getManagerApi()->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->getDatabase()->escape($query); |
19 | 19 | $_PAGE['vs']['search'] = $query; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | // context menu |
28 | 28 | $cm = new \EvolutionCMS\Support\ContextMenu("cntxm", 150); |
29 | 29 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0)); |
30 | -if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
|
30 | +if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
|
31 | 31 | $cm->addSeparator(); |
32 | 32 | } |
33 | 33 | $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0)); |
@@ -106,21 +106,21 @@ discard block |
||
106 | 106 | <div class="tab-page"> |
107 | 107 | <div class="table-responsive"> |
108 | 108 | <?php |
109 | - if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
109 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
110 | 110 | $rs = $modx->getDatabase()->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 |
111 | 111 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
112 | 112 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
113 | 113 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
114 | 114 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
115 | 115 | ORDER BY sm.name'); |
116 | - if ($modx->hasPermission('edit_module')) { |
|
116 | + if ($modx->hasPermission('edit_module')) { |
|
117 | 117 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
118 | - } else if ($modx->hasPermission('exec_module')) { |
|
118 | + } else if ($modx->hasPermission('exec_module')) { |
|
119 | 119 | $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
120 | - } else { |
|
120 | + } else { |
|
121 | 121 | $title = '[+value+]'; |
122 | 122 | } |
123 | - } else { |
|
123 | + } else { |
|
124 | 124 | $rs = $modx->getDatabase()->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"); |
125 | 125 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
126 | 126 | } |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | $grd->colWidths = "34,,,60,60"; |
136 | 136 | $grd->colAligns = "center,,,center,center"; |
137 | 137 | $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; |
138 | - if ($listmode == '1') { |
|
138 | + if ($listmode == '1') { |
|
139 | 139 | $grd->pageSize = 0; |
140 | 140 | } |
141 | - if ($_REQUEST['op'] == 'reset') { |
|
141 | + if ($_REQUEST['op'] == 'reset') { |
|
142 | 142 | $grd->pageNumber = 1; |
143 | 143 | } |
144 | 144 | // render grid |