@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | foreach ($_ as $collation=>$selected) { |
51 | 51 | $collation = htmlentities($collation); |
52 | 52 | // if(substr($collation,0,4)!=='utf8') continue; |
53 | - if (strpos($collation, 'sjis')===0) { |
|
53 | + if (strpos($collation, 'sjis') === 0) { |
|
54 | 54 | continue; |
55 | 55 | } |
56 | - if ($collation=='recommend') { |
|
56 | + if ($collation == 'recommend') { |
|
57 | 57 | $output .= '<optgroup label="recommend">'; |
58 | - } elseif ($collation=='unrecommend') { |
|
58 | + } elseif ($collation == 'unrecommend') { |
|
59 | 59 | $output .= '</optgroup><optgroup label="unrecommend">'; |
60 | 60 | } else { |
61 | 61 | $output .= sprintf('<option value="%s" %s>%s</option>', $collation, $selected, $collation); |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | echo $output; |
68 | 68 | exit; |
69 | 69 | |
70 | -function sortItem($array=array(), $order='utf8mb4,utf8') |
|
70 | +function sortItem($array = array(), $order = 'utf8mb4,utf8') |
|
71 | 71 | { |
72 | 72 | $rs = array('recommend'=>''); |
73 | 73 | $order = explode(',', $order); |
74 | 74 | foreach ($order as $v) { |
75 | 75 | foreach ($array as $name=>$sel) { |
76 | - if (strpos($name, $v)!==false) { |
|
76 | + if (strpos($name, $v) !== false) { |
|
77 | 77 | $rs[$name] = $array[$name]; |
78 | 78 | unset($array[$name]); |
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
82 | - $rs['unrecommend']=''; |
|
82 | + $rs['unrecommend'] = ''; |
|
83 | 83 | return $rs + $array; |
84 | 84 | } |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | include_once($autoloader); |
51 | 51 | } |
52 | 52 | |
53 | -if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
53 | +if (!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
54 | 54 | |
55 | -$base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
|
56 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
57 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
58 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
55 | +$base_path = str_replace('\\', '/', dirname(__FILE__)).'/'; |
|
56 | +if (is_file($base_path.'assets/cache/siteManager.php')) |
|
57 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
58 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
59 | 59 | define('MGR_DIR', 'manager'); |
60 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
61 | - include_once($base_path . 'assets/cache/siteHostnames.php'); |
|
62 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
60 | +if (is_file($base_path.'assets/cache/siteHostnames.php')) |
|
61 | + include_once($base_path.'assets/cache/siteHostnames.php'); |
|
62 | +if (!defined('MODX_SITE_HOSTNAMES')) |
|
63 | 63 | define('MODX_SITE_HOSTNAMES', ''); |
64 | 64 | |
65 | 65 | // get start time |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | // set some settings, and address some IE issues |
72 | 72 | @ini_set('url_rewriter.tags', ''); |
73 | 73 | @ini_set('session.use_trans_sid', 0); |
74 | -@ini_set('session.use_only_cookies',1); |
|
74 | +@ini_set('session.use_only_cookies', 1); |
|
75 | 75 | session_cache_limiter(''); |
76 | 76 | header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE. |
77 | 77 | header('Cache-Control: private, must-revalidate'); |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | |
85 | 85 | define('IN_PARSER_MODE', true); |
86 | -if ( ! defined('IN_MANAGER_MODE')) { |
|
86 | +if (!defined('IN_MANAGER_MODE')) { |
|
87 | 87 | define('IN_MANAGER_MODE', false); |
88 | 88 | } |
89 | 89 | if (!defined('MODX_API_MODE')) { |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | // get the required includes |
94 | -if(!isset($database_user) || $database_user=="") { |
|
94 | +if (!isset($database_user) || $database_user == "") { |
|
95 | 95 | $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
96 | 96 | // Be sure config.inc.php is there and that it contains some important values |
97 | - if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
97 | + if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
98 | 98 | readfile('install/not_installed.tpl'); |
99 | 99 | exit; |
100 | 100 | } |
@@ -125,13 +125,13 @@ discard block |
||
125 | 125 | $modx->stopOnNotice = false; |
126 | 126 | |
127 | 127 | // Don't show PHP errors to the public |
128 | -if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { |
|
129 | - @ini_set("display_errors","0"); |
|
128 | +if (!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) { |
|
129 | + @ini_set("display_errors", "0"); |
|
130 | 130 | } |
131 | 131 | |
132 | -if(MODX_CLI){ |
|
132 | +if (MODX_CLI) { |
|
133 | 133 | @set_time_limit(0); |
134 | - @ini_set('max_execution_time',0); |
|
134 | + @ini_set('max_execution_time', 0); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | // execute the parser if index.php was not included |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $_ = crc32(__FILE__); |
12 | 12 | $_ = sprintf('%u', $_); |
13 | 13 | |
14 | - return 'evo' . base_convert($_, 10, 36); |
|
14 | + return 'evo'.base_convert($_, 10, 36); |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | function startCMSSession() |
21 | 21 | { |
22 | 22 | global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; |
23 | - if(MODX_CLI) return; |
|
23 | + if (MODX_CLI) return; |
|
24 | 24 | |
25 | 25 | session_name($site_sessionname); |
26 | 26 | removeInvalidCmsSessionIds($site_sessionname); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | session_start(); |
33 | 33 | $key = "modx.mgr.session.cookie.lifetime"; |
34 | 34 | if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
35 | - $cookieLifetime = (int)$_SESSION[$key]; |
|
35 | + $cookieLifetime = (int) $_SESSION[$key]; |
|
36 | 36 | if ($cookieLifetime) { |
37 | 37 | $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
38 | 38 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function removeInvalidCmsSessionIds($session_name) |
63 | 63 | { |
64 | - if(MODX_CLI) return; |
|
64 | + if (MODX_CLI) return; |
|
65 | 65 | // session ids is invalid iff it is empty string |
66 | 66 | // storage priorioty can see in PHP source ext/session/session.c |
67 | 67 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -18,9 +18,9 @@ |
||
18 | 18 | exit('send some data'); |
19 | 19 | } //?? |
20 | 20 | |
21 | -$indent = (int)$_REQUEST['indent']; |
|
22 | -$parent = (int)$_REQUEST['parent']; |
|
23 | -$expandAll = (int)$_REQUEST['expandAll']; |
|
21 | +$indent = (int) $_REQUEST['indent']; |
|
22 | +$parent = (int) $_REQUEST['parent']; |
|
23 | +$expandAll = (int) $_REQUEST['expandAll']; |
|
24 | 24 | $output = ''; |
25 | 25 | $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; |
26 | 26 |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | case 'publishedon': |
39 | 39 | case 'pub_date': |
40 | 40 | case 'unpub_date': |
41 | - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); |
|
41 | + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']); |
|
42 | 42 | break; |
43 | 43 | default: |
44 | - $sortby = 'sc.' . $_SESSION['tree_sortby']; |
|
44 | + $sortby = 'sc.'.$_SESSION['tree_sortby']; |
|
45 | 45 | }; |
46 | 46 | |
47 | - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); |
|
47 | + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); |
|
48 | 48 | |
49 | 49 | // Folder sorting gets special setup ;) Add menuindex and pagetitle |
50 | 50 | if ($_SESSION['tree_sortby'] == 'isfolder') { |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
59 | 59 | $showProtected = false; |
60 | 60 | if (isset ($modx->config['tree_show_protected'])) { |
61 | - $showProtected = (boolean)$modx->config['tree_show_protected']; |
|
61 | + $showProtected = (boolean) $modx->config['tree_show_protected']; |
|
62 | 62 | } |
63 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
63 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
64 | 64 | if ($showProtected == false) { |
65 | - $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
65 | + $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
66 | 66 | } else { |
67 | 67 | $access = ''; |
68 | 68 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
101 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
101 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
102 | 102 | |
103 | 103 | // Prepare displaying user-locks |
104 | 104 | $lockedByUser = ''; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'element_type' => $_lang["lock_element_type_7"], |
110 | 110 | 'lasthit_df' => $rowLock['lasthit_df'] |
111 | 111 | )); |
112 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
112 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
113 | 113 | } else { |
114 | 114 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
115 | 115 | 'element_type' => $_lang["lock_element_type_7"], |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | 'lasthit_df' => $rowLock['lasthit_df'] |
118 | 118 | )); |
119 | 119 | if ($modx->hasPermission('remove_locks')) { |
120 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
120 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
121 | 121 | } else { |
122 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
122 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -128,22 +128,22 @@ discard block |
||
128 | 128 | |
129 | 129 | $title = ''; |
130 | 130 | if (isDateNode($nodeNameSource)) { |
131 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
131 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
132 | 132 | } |
133 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
134 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
135 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
136 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
137 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
138 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
139 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
140 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
141 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
142 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
143 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
133 | + $title .= $_lang['id'].': '.$row['id']; |
|
134 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
135 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
136 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
137 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
138 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
139 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
140 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
141 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
142 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
143 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
145 | 145 | $title = $modx->htmlspecialchars($title); |
146 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
146 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
147 | 147 | |
148 | 148 | $data = array( |
149 | 149 | 'id' => $row['id'], |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | if ($ph['contextmenu']) { |
230 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
230 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | if ($_SESSION['tree_show_only_folders']) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | if ($ph['contextmenu']) { |
288 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
288 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | $node .= $modx->parseText($tpl, $ph); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | if ($ph['contextmenu']) { |
326 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
326 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | $node .= $modx->parseText($tpl, $ph); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | if ($ph['contextmenu']) { |
377 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
377 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | $node .= $modx->parseText($tpl, $ph); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($ph['contextmenu']) { |
419 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
419 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | $node .= $modx->parseText($tpl, $ph); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $nodetitle .= $modx->config['friendly_url_suffix']; |
494 | 494 | } |
495 | 495 | } |
496 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
496 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
497 | 497 | break; |
498 | 498 | case 'pagetitle': |
499 | 499 | $nodetitle = $row['pagetitle']; |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | { |
554 | 554 | global $modx; |
555 | 555 | |
556 | - return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
556 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | /** |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | - include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
4 | +if (is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | + include_once $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
6 | 6 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 7 | if (isset($dbase)) { |
8 | 8 | if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | $ph['moduleName'] = $moduleName; |
20 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
21 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
20 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
21 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
22 | 22 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
23 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
25 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
23 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
25 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
26 | 26 | $ph['install_language'] = $install_language; |
27 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
28 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
27 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
28 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
29 | 29 | |
30 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
30 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
31 | 31 | $content = parse($tpl, $ph); |
32 | -echo parse($content, $_lang,'[%','%]'); |
|
32 | +echo parse($content, $_lang, '[%', '%]'); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | case 'new' : |
279 | 279 | |
280 | 280 | // invoke OnBeforeDocFormSave event |
281 | - switch($modx->config['docid_incrmnt_method']) |
|
281 | + switch ($modx->config['docid_incrmnt_method']) |
|
282 | 282 | { |
283 | 283 | case '1': |
284 | 284 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | if (!$was_published && $published) { |
490 | 490 | $publishedon = $currentdate; |
491 | 491 | $publishedby = $modx->getLoginUserID(); |
492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
492 | + }elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
493 | 493 | $publishedon = $pub_date; |
494 | 494 | $publishedby = $modx->getLoginUserID(); |
495 | 495 | }elseif ($was_published && !$published) { |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | } |
502 | 502 | |
503 | 503 | // invoke OnBeforeDocFormSave event |
504 | - $modx->invokeEvent("OnBeforeDocFormSave", array ( |
|
504 | + $modx->invokeEvent("OnBeforeDocFormSave", array( |
|
505 | 505 | "mode" => "upd", |
506 | 506 | "id" => $id |
507 | 507 | )); |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | . "menuindex={$menuindex}, " |
527 | 527 | . "searchable={$searchable}, " |
528 | 528 | . "cacheable={$cacheable}, " |
529 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
529 | + . "editedby=".$modx->getLoginUserID().", " |
|
530 | 530 | . "editedon={$currentdate}, " |
531 | 531 | . "publishedon={$publishedon}, " |
532 | 532 | . "publishedby={$publishedby}, " |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | // update template variables |
542 | 542 | $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); |
543 | - $tvIds = array (); |
|
543 | + $tvIds = array(); |
|
544 | 544 | while ($row = $modx->db->getRow($rs)) { |
545 | 545 | $tvIds[$row['tmplvarid']] = $row['id']; |
546 | 546 | } |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | 'groups.id, groups.document_group', |
594 | 594 | "{$tbl_document_groups} AS groups |
595 | 595 | LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", |
596 | - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
596 | + "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
597 | 597 | ); |
598 | 598 | $old_groups = array(); |
599 | 599 | while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | unset($old_groups[$group]); |
606 | 606 | continue; |
607 | 607 | } elseif ($link_id == 'new') { |
608 | - $insertions[] = '('.(int)$group.','.$id.')'; |
|
608 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
609 | 609 | } |
610 | 610 | } |
611 | 611 | if (!empty($insertions)) { |
@@ -637,17 +637,17 @@ discard block |
||
637 | 637 | |
638 | 638 | |
639 | 639 | // invoke OnDocFormSave event |
640 | - $modx->invokeEvent("OnDocFormSave", array ( |
|
640 | + $modx->invokeEvent("OnDocFormSave", array( |
|
641 | 641 | "mode" => "upd", |
642 | 642 | "id" => $id |
643 | 643 | )); |
644 | 644 | |
645 | 645 | // secure web documents - flag as private |
646 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
646 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
647 | 647 | secureWebDocument($id); |
648 | 648 | |
649 | 649 | // secure manager documents - flag as private |
650 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
650 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
651 | 651 | secureMgrDocument($id); |
652 | 652 | |
653 | 653 | // Set the item name for logger |
@@ -673,13 +673,13 @@ discard block |
||
673 | 673 | // document |
674 | 674 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
675 | 675 | } |
676 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; |
|
676 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
677 | 677 | } else { |
678 | 678 | $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
679 | 679 | } |
680 | 680 | } |
681 | 681 | if (headers_sent()) { |
682 | - $header = str_replace('Location: ','',$header); |
|
682 | + $header = str_replace('Location: ', '', $header); |
|
683 | 683 | echo "<script>document.location.href='$header';</script>\n"; |
684 | 684 | } else { |
685 | 685 | header($header); |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |