@@ -3,10 +3,12 @@ discard block |
||
3 | 3 | global $ContextMenuCnt; |
4 | 4 | $ContextMenuCnt = 0; |
5 | 5 | |
6 | -class ContextMenu { |
|
6 | +class ContextMenu |
|
7 | +{ |
|
7 | 8 | var $id; |
8 | 9 | |
9 | - function __construct($id = '', $width = 120, $visible = false) { |
|
10 | + function __construct($id = '', $width = 120, $visible = false) |
|
11 | + { |
|
10 | 12 | global $ContextMenuCnt; |
11 | 13 | $ContextMenuCnt++; |
12 | 14 | $this->html = ""; |
@@ -15,7 +17,8 @@ discard block |
||
15 | 17 | $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
16 | 18 | } |
17 | 19 | |
18 | - function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
20 | + function addItem($text, $action = "", $img = "", $disabled = 0) |
|
21 | + { |
|
19 | 22 | global $base_url, $_style; |
20 | 23 | if($disabled) { |
21 | 24 | return; |
@@ -40,13 +43,15 @@ discard block |
||
40 | 43 | $this->html .= $img . ' ' . $text . '</div>'; |
41 | 44 | } |
42 | 45 | |
43 | - function addSeparator() { |
|
46 | + function addSeparator() |
|
47 | + { |
|
44 | 48 | $this->html .= " |
45 | 49 | <div class='cntxMnuSeparator'></div> |
46 | 50 | "; |
47 | 51 | } |
48 | 52 | |
49 | - function render() { |
|
53 | + function render() |
|
54 | + { |
|
50 | 55 | global $ContextMenuScript; |
51 | 56 | |
52 | 57 | $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
@@ -54,7 +59,8 @@ discard block |
||
54 | 59 | return $html; |
55 | 60 | } |
56 | 61 | |
57 | - function getClientScriptObject() { |
|
62 | + function getClientScriptObject() |
|
63 | + { |
|
58 | 64 | return "getCntxMenu('" . $this->id . "')"; |
59 | 65 | } |
60 | 66 | } |
@@ -10,7 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | $__DataGridCnt = 0; |
12 | 12 | |
13 | -class DataGrid { |
|
13 | +class DataGrid |
|
14 | +{ |
|
14 | 15 | |
15 | 16 | var $ds; // datasource |
16 | 17 | var $id; |
@@ -52,7 +53,8 @@ discard block |
||
52 | 53 | var $selPageClass; |
53 | 54 | var $noRecordMsg = "No records found."; |
54 | 55 | |
55 | - function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) { |
|
56 | + function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) |
|
57 | + { |
|
56 | 58 | global $__DataGridCnt; |
57 | 59 | |
58 | 60 | // set id |
@@ -68,11 +70,13 @@ discard block |
||
68 | 70 | $this->pagerLocation = 'top-right'; |
69 | 71 | } |
70 | 72 | |
71 | - function setDataSource($ds) { |
|
73 | + function setDataSource($ds) |
|
74 | + { |
|
72 | 75 | $this->ds = $ds; |
73 | 76 | } |
74 | 77 | |
75 | - function render() { |
|
78 | + function render() |
|
79 | + { |
|
76 | 80 | global $modx; |
77 | 81 | $columnHeaderStyle = ($this->columnHeaderStyle) ? "style='" . $this->columnHeaderStyle . "'" : ''; |
78 | 82 | $columnHeaderClass = ($this->columnHeaderClass) ? "class='" . $this->columnHeaderClass . "'" : ""; |
@@ -107,7 +111,9 @@ discard block |
||
107 | 111 | |
108 | 112 | if($this->_isDataset && !$this->columns) { |
109 | 113 | $cols = $modx->db->numFields($this->ds); |
110 | - for($i = 0; $i < $cols; $i++) $this->columns .= ($i ? "," : "") . $modx->db->fieldName($this->ds, $i); |
|
114 | + for($i = 0; $i < $cols; $i++) { |
|
115 | + $this->columns .= ($i ? "," : "") . $modx->db->fieldName($this->ds, $i); |
|
116 | + } |
|
111 | 117 | } |
112 | 118 | |
113 | 119 | // start grid |
@@ -187,7 +193,8 @@ discard block |
||
187 | 193 | |
188 | 194 | // format column values |
189 | 195 | |
190 | - function RenderRowFnc($n, $row) { |
|
196 | + function RenderRowFnc($n, $row) |
|
197 | + { |
|
191 | 198 | if($this->_alt == 0) { |
192 | 199 | $Style = $this->_itemStyle; |
193 | 200 | $Class = $this->_itemClass; |
@@ -217,7 +224,8 @@ discard block |
||
217 | 224 | return $o; |
218 | 225 | } |
219 | 226 | |
220 | - function formatColumnValue($row, $value, $type, &$align) { |
|
227 | + function formatColumnValue($row, $value, $type, &$align) |
|
228 | + { |
|
221 | 229 | if(strpos($type, ":") !== false) { |
222 | 230 | list($type, $type_format) = explode(":", $type, 2); |
223 | 231 | } |
@@ -344,7 +344,8 @@ |
||
344 | 344 | protected function sendString($string) |
345 | 345 | { |
346 | 346 | if ($this->pop_conn) { |
347 | - if ($this->do_debug >= 2) { //Show client messages when debug >= 2 |
|
347 | + if ($this->do_debug >= 2) { |
|
348 | +//Show client messages when debug >= 2 |
|
348 | 349 | echo 'Client -> Server: ', $string; |
349 | 350 | } |
350 | 351 |
@@ -2059,7 +2059,8 @@ discard block |
||
2059 | 2059 | */ |
2060 | 2060 | public function addrFormat($addr) |
2061 | 2061 | { |
2062 | - if (empty($addr[1])) { // No name provided |
|
2062 | + if (empty($addr[1])) { |
|
2063 | +// No name provided |
|
2063 | 2064 | return $this->secureHeader($addr[0]); |
2064 | 2065 | } |
2065 | 2066 | |
@@ -3425,7 +3426,7 @@ discard block |
||
3425 | 3426 | { |
3426 | 3427 | $this->RecipientsQueue = array_filter( |
3427 | 3428 | $this->RecipientsQueue, |
3428 | - function ($params) use ($kind) { |
|
3429 | + function ($params) use ($kind){ |
|
3429 | 3430 | return $params[0] != $kind; |
3430 | 3431 | } |
3431 | 3432 | ); |
@@ -10,7 +10,8 @@ discard block |
||
10 | 10 | |
11 | 11 | $__DataSetPagerCnt = 0; |
12 | 12 | |
13 | -class DataSetPager { |
|
13 | +class DataSetPager |
|
14 | +{ |
|
14 | 15 | |
15 | 16 | var $ds; // datasource |
16 | 17 | var $pageSize; |
@@ -27,7 +28,8 @@ discard block |
||
27 | 28 | var $selPageStyle; |
28 | 29 | var $selPageClass; |
29 | 30 | |
30 | - function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
|
31 | + function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) |
|
32 | + { |
|
31 | 33 | global $_PAGE; // use view state object |
32 | 34 | |
33 | 35 | global $__DataSetPagerCnt; |
@@ -57,35 +59,42 @@ discard block |
||
57 | 59 | $this->pager = ''; |
58 | 60 | } |
59 | 61 | |
60 | - function getRenderedPager() { |
|
62 | + function getRenderedPager() |
|
63 | + { |
|
61 | 64 | return $this->pager; |
62 | 65 | } |
63 | 66 | |
64 | - function getRenderedRows() { |
|
67 | + function getRenderedRows() |
|
68 | + { |
|
65 | 69 | return $this->rows; |
66 | 70 | } |
67 | 71 | |
68 | - function setDataSource($ds) { |
|
72 | + function setDataSource($ds) |
|
73 | + { |
|
69 | 74 | $this->ds = $ds; |
70 | 75 | } |
71 | 76 | |
72 | - function setPageSize($ps) { |
|
77 | + function setPageSize($ps) |
|
78 | + { |
|
73 | 79 | $this->pageSize = $ps; |
74 | 80 | } |
75 | 81 | |
76 | - function setRenderRowFnc($fncName, $args = "") { |
|
82 | + function setRenderRowFnc($fncName, $args = "") |
|
83 | + { |
|
77 | 84 | $this->renderRowFnc = &$fncName; |
78 | 85 | $this->renderRowFncArgs = $args; // extra agruments |
79 | 86 | |
80 | 87 | |
81 | 88 | } |
82 | 89 | |
83 | - function setRenderPagerFnc($fncName, $args = "") { |
|
90 | + function setRenderPagerFnc($fncName, $args = "") |
|
91 | + { |
|
84 | 92 | $this->renderPagerFnc = $fncName; |
85 | 93 | $this->renderPagerFncArgs = $args; // extra agruments |
86 | 94 | } |
87 | 95 | |
88 | - function render() { |
|
96 | + function render() |
|
97 | + { |
|
89 | 98 | global $modx, $_PAGE; |
90 | 99 | |
91 | 100 | $isDataset = $modx->db->isResult($this->ds); |
@@ -137,8 +146,10 @@ discard block |
||
137 | 146 | $url = $_SERVER['PHP_SELF'] . '?'; |
138 | 147 | } |
139 | 148 | $i = 0; |
140 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
149 | + foreach($_GET as $n => $v) { |
|
150 | + if($n != 'dpgn' . $this->id) { |
|
141 | 151 | $i++; |
152 | + } |
|
142 | 153 | $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
143 | 154 | } |
144 | 155 | if($i >= 1) { |
@@ -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 | |
4 | 6 | // action list |
5 | 7 | $GLOBALS['action_list'] = array( |
@@ -132,11 +134,14 @@ discard block |
||
132 | 134 | '999' => 'Viewing test page', |
133 | 135 | ); |
134 | 136 | |
135 | -function getAction($actionId, $itemid='') { |
|
137 | +function getAction($actionId, $itemid='') |
|
138 | +{ |
|
136 | 139 | global $action_list; |
137 | 140 | |
138 | 141 | $ret = sprintf($action_list[$actionId], $itemid); |
139 | - if (!$ret) $ret = "Idle (unknown)"; |
|
142 | + if (!$ret) { |
|
143 | + $ret = "Idle (unknown)"; |
|
144 | + } |
|
140 | 145 | |
141 | 146 | return $ret; |
142 | 147 | } |
@@ -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 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
@@ -9,21 +9,21 @@ discard block |
||
9 | 9 | $modx_textdir = isset($modx_textdir) ? $modx_textdir : null; |
10 | 10 | $onManagerMainFrameHeaderHTMLBlock = is_array($evtOut) ? implode("\n", $evtOut) : ''; |
11 | 11 | $textdir = $modx_textdir === 'rtl' ? 'rtl' : 'ltr'; |
12 | -if (!isset($modx->config['mgr_jquery_path'])) { |
|
12 | +if (!isset($modx->config['mgr_jquery_path'])) { |
|
13 | 13 | $modx->config['mgr_jquery_path'] = 'media/script/jquery/jquery.min.js'; |
14 | 14 | } |
15 | -if (!isset($modx->config['mgr_date_picker_path'])) { |
|
15 | +if (!isset($modx->config['mgr_date_picker_path'])) { |
|
16 | 16 | $modx->config['mgr_date_picker_path'] = 'media/script/air-datepicker/datepicker.inc.php'; |
17 | 17 | } |
18 | 18 | |
19 | -if (!empty($_COOKIE['MODX_themeColor'])) { |
|
19 | +if (!empty($_COOKIE['MODX_themeColor'])) { |
|
20 | 20 | $body_class .= ' ' . $_COOKIE['MODX_themeColor']; |
21 | 21 | } |
22 | 22 | |
23 | 23 | $css = 'media/style/' . $modx->config['manager_theme'] . '/style.css?v=' . $lastInstallTime; |
24 | 24 | |
25 | -if ($modx->config['manager_theme'] == 'default') { |
|
26 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
25 | +if ($modx->config['manager_theme'] == 'default') { |
|
26 | + if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
27 | 27 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
28 | 28 | $minifier = new Formatter\CSSMinify(); |
29 | 29 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $css = $minifier->minify(); |
41 | 41 | file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
42 | 42 | } |
43 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
43 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
44 | 44 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
45 | 45 | } |
46 | 46 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | stopWorker(); |
364 | 364 | |
365 | 365 | <?php |
366 | - if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
366 | + if (isset($_REQUEST['r']) && preg_match('@^[0-9]+$@', $_REQUEST['r'])) { |
|
367 | 367 | echo 'doRefresh(' . $_REQUEST['r'] . ");\n"; |
368 | 368 | } |
369 | 369 | ?> |
@@ -1,7 +1,9 @@ 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 | -if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
6 | +if($modx->manager->action!='8' && isset($_SESSION['mgrValidated'])) { |
|
5 | 7 | |
6 | 8 | $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
7 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
@@ -33,8 +35,7 @@ discard block |
||
33 | 35 | if(substr($target,0,6)==='@CHUNK') { |
34 | 36 | $target = trim(substr($target,7)); |
35 | 37 | $lockout_tpl = $modx->getChunk($target); |
36 | - } |
|
37 | - elseif(substr($target,0,5)==='@FILE') { |
|
38 | + } elseif(substr($target,0,5)==='@FILE') { |
|
38 | 39 | $target = trim(substr($target,6)); |
39 | 40 | $lockout_tpl = file_get_contents($target); |
40 | 41 | } |
@@ -42,24 +43,20 @@ discard block |
||
42 | 43 | $chunk = $modx->getChunk($target); |
43 | 44 | if($chunk!==false && !empty($chunk)) { |
44 | 45 | $lockout_tpl = $chunk; |
45 | - } |
|
46 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
46 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
47 | 47 | $target = MODX_BASE_PATH . $target; |
48 | 48 | $lockout_tpl = file_get_contents($target); |
49 | - } |
|
50 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
49 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
51 | 50 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
52 | 51 | $lockout_tpl = file_get_contents($target); |
53 | - } |
|
54 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
52 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
55 | 53 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
56 | 54 | $login_tpl = file_get_contents($target); |
57 | - } |
|
58 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
55 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { |
|
56 | +// ClipperCMS compatible |
|
59 | 57 | $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
60 | 58 | $lockout_tpl = file_get_contents($target); |
61 | - } |
|
62 | - else { |
|
59 | + } else { |
|
63 | 60 | $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
64 | 61 | $lockout_tpl = file_get_contents($target); |
65 | 62 | } |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // DISPLAY FORM ELEMENTS |
3 | -function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) { |
|
3 | +function renderFormElement($field_type, $field_id, $default_text = '', $field_elements = '', $field_value = '', $field_style = '', $row = array(), $tvsArray = array()) |
|
4 | +{ |
|
4 | 5 | global $modx; |
5 | 6 | global $_style; |
6 | 7 | global $_lang; |
@@ -368,13 +369,16 @@ discard block |
||
368 | 369 | return $field_html; |
369 | 370 | } // end renderFormElement function |
370 | 371 | |
371 | -function ParseIntputOptions($v) { |
|
372 | +function ParseIntputOptions($v) |
|
373 | +{ |
|
372 | 374 | global $modx; |
373 | 375 | $a = array(); |
374 | 376 | if(is_array($v)) { |
375 | 377 | return $v; |
376 | 378 | } else if($modx->db->isResult($v)) { |
377 | - while($cols = $modx->db->getRow($v, 'num')) $a[] = $cols; |
|
379 | + while($cols = $modx->db->getRow($v, 'num')) { |
|
380 | + $a[] = $cols; |
|
381 | + } |
|
378 | 382 | } else { |
379 | 383 | $a = explode("||", $v); |
380 | 384 | } |