@@ -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 |
@@ -50,17 +50,23 @@ 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'])) { |
|
54 | + $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
|
55 | +} |
|
54 | 56 | |
55 | 57 | $base_path = str_replace('\\','/',dirname(__FILE__)) . '/'; |
56 | -if(is_file($base_path . 'assets/cache/siteManager.php')) |
|
58 | +if(is_file($base_path . 'assets/cache/siteManager.php')) { |
|
57 | 59 | include_once($base_path . 'assets/cache/siteManager.php'); |
58 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
|
60 | +} |
|
61 | +if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
59 | 62 | define('MGR_DIR', 'manager'); |
60 | -if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
|
63 | +} |
|
64 | +if(is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
61 | 65 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
62 | -if(!defined('MODX_SITE_HOSTNAMES')) |
|
66 | +} |
|
67 | +if(!defined('MODX_SITE_HOSTNAMES')) { |
|
63 | 68 | define('MODX_SITE_HOSTNAMES', ''); |
69 | +} |
|
64 | 70 | |
65 | 71 | // get start time |
66 | 72 | $mstart = memory_get_usage(); |
@@ -129,7 +135,7 @@ discard block |
||
129 | 135 | @ini_set("display_errors","0"); |
130 | 136 | } |
131 | 137 | |
132 | -if(MODX_CLI){ |
|
138 | +if(MODX_CLI) { |
|
133 | 139 | @set_time_limit(0); |
134 | 140 | @ini_set('max_execution_time',0); |
135 | 141 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $autoloader = __DIR__.'/vendor/autoload.php'; |
49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
50 | - include_once($autoloader); |
|
50 | + include_once($autoloader); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | if(is_file($base_path . 'assets/cache/siteManager.php')) |
57 | 57 | include_once($base_path . 'assets/cache/siteManager.php'); |
58 | 58 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
59 | - define('MGR_DIR', 'manager'); |
|
59 | + define('MGR_DIR', 'manager'); |
|
60 | 60 | if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
61 | 61 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
62 | 62 | if(!defined('MODX_SITE_HOSTNAMES')) |
63 | - define('MODX_SITE_HOSTNAMES', ''); |
|
63 | + define('MODX_SITE_HOSTNAMES', ''); |
|
64 | 64 | |
65 | 65 | // get start time |
66 | 66 | $mstart = memory_get_usage(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | define('IN_PARSER_MODE', true); |
86 | 86 | if ( ! defined('IN_MANAGER_MODE')) { |
87 | - define('IN_MANAGER_MODE', false); |
|
87 | + define('IN_MANAGER_MODE', false); |
|
88 | 88 | } |
89 | 89 | if (!defined('MODX_API_MODE')) { |
90 | 90 | define('MODX_API_MODE', false); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | |
93 | 93 | // get the required includes |
94 | 94 | if(!isset($database_user) || $database_user=="") { |
95 | - $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
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) { |
|
98 | - readfile('install/not_installed.tpl'); |
|
99 | - exit; |
|
100 | - } |
|
95 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
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) { |
|
98 | + readfile('install/not_installed.tpl'); |
|
99 | + exit; |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // start session |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | // initiate a new document parser |
107 | 107 | if (isset($coreClass) && class_exists($coreClass)) { |
108 | - $modx = new $coreClass; |
|
108 | + $modx = new $coreClass; |
|
109 | 109 | } |
110 | 110 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
111 | - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | - $modx = DocumentParser::getInstance(); |
|
111 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | + $modx = DocumentParser::getInstance(); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // set some parser options |
@@ -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 |
@@ -144,33 +144,33 @@ discard block |
||
144 | 144 | $algorithm = 'UNCRYPT'; |
145 | 145 | } |
146 | 146 | |
147 | - $salt = md5($password . $seed); |
|
147 | + $salt = md5($password.$seed); |
|
148 | 148 | |
149 | 149 | switch ($algorithm) { |
150 | 150 | case 'BLOWFISH_Y': |
151 | - $salt = '$2y$07$' . substr($salt, 0, 22); |
|
151 | + $salt = '$2y$07$'.substr($salt, 0, 22); |
|
152 | 152 | break; |
153 | 153 | case 'BLOWFISH_A': |
154 | - $salt = '$2a$07$' . substr($salt, 0, 22); |
|
154 | + $salt = '$2a$07$'.substr($salt, 0, 22); |
|
155 | 155 | break; |
156 | 156 | case 'SHA512': |
157 | - $salt = '$6$' . substr($salt, 0, 16); |
|
157 | + $salt = '$6$'.substr($salt, 0, 16); |
|
158 | 158 | break; |
159 | 159 | case 'SHA256': |
160 | - $salt = '$5$' . substr($salt, 0, 16); |
|
160 | + $salt = '$5$'.substr($salt, 0, 16); |
|
161 | 161 | break; |
162 | 162 | case 'MD5': |
163 | - $salt = '$1$' . substr($salt, 0, 8); |
|
163 | + $salt = '$1$'.substr($salt, 0, 8); |
|
164 | 164 | break; |
165 | 165 | } |
166 | 166 | |
167 | 167 | if ($algorithm !== 'UNCRYPT') { |
168 | - $password = sha1($password) . crypt($password, $salt); |
|
168 | + $password = sha1($password).crypt($password, $salt); |
|
169 | 169 | } else { |
170 | - $password = sha1($salt . $password); |
|
170 | + $password = sha1($salt.$password); |
|
171 | 171 | } |
172 | 172 | |
173 | - $result = strtolower($algorithm) . '>' . md5($salt . $password) . substr(md5($salt), 0, 8); |
|
173 | + $result = strtolower($algorithm).'>'.md5($salt.$password).substr(md5($salt), 0, 8); |
|
174 | 174 | |
175 | 175 | return $result; |
176 | 176 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | $check_files = explode("\n", $check_files); |
253 | 253 | foreach ($check_files as $file) { |
254 | 254 | $file = trim($file); |
255 | - $file = MODX_BASE_PATH . $file; |
|
255 | + $file = MODX_BASE_PATH.$file; |
|
256 | 256 | if (!is_file($file)) { |
257 | 257 | continue; |
258 | 258 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $checksum = unserialize($checksum); |
276 | 276 | foreach ($check_files as $file) { |
277 | 277 | $file = trim($file); |
278 | - $filePath = MODX_BASE_PATH . $file; |
|
278 | + $filePath = MODX_BASE_PATH.$file; |
|
279 | 279 | if (!is_file($filePath)) { |
280 | 280 | continue; |
281 | 281 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | { |
295 | 295 | $modx = evolutionCMS(); |
296 | 296 | $tbl_system_settings = $modx->getFullTableName('system_settings'); |
297 | - $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','" . $modx->db->escape($checksum) . "')"; |
|
297 | + $sql = "REPLACE INTO {$tbl_system_settings} (setting_name, setting_value) VALUES ('sys_files_checksum','".$modx->db->escape($checksum)."')"; |
|
298 | 298 | $modx->db->query($sql); |
299 | 299 | } |
300 | 300 | |
@@ -371,10 +371,10 @@ discard block |
||
371 | 371 | foreach ($settings as $key => $val) { |
372 | 372 | $f = array(); |
373 | 373 | $f['user'] = $_SESSION['mgrInternalKey']; |
374 | - $f['setting_name'] = '_LAST_' . $key; |
|
374 | + $f['setting_name'] = '_LAST_'.$key; |
|
375 | 375 | $f['setting_value'] = $val; |
376 | 376 | $f = $modx->db->escape($f); |
377 | - $f = "(`" . implode("`, `", array_keys($f)) . "`) VALUES('" . implode("', '", array_values($f)) . "')"; |
|
377 | + $f = "(`".implode("`, `", array_keys($f))."`) VALUES('".implode("', '", array_values($f))."')"; |
|
378 | 378 | $f .= " ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)"; |
379 | 379 | $modx->db->insert($f, $modx->getFullTableName('user_settings')); |
380 | 380 | } |
@@ -116,7 +116,8 @@ discard block |
||
116 | 116 | * @return string |
117 | 117 | */ |
118 | 118 | public function getHashType($db_value = '') |
119 | - { // md5 | v1 | phpass |
|
119 | + { |
|
120 | +// md5 | v1 | phpass |
|
120 | 121 | $c = substr($db_value, 0, 1); |
121 | 122 | if ($c === '$') { |
122 | 123 | return 'phpass'; |
@@ -135,7 +136,8 @@ discard block |
||
135 | 136 | * @return string |
136 | 137 | */ |
137 | 138 | public function genV1Hash($password, $seed = '1') |
138 | - { // $seed is user_id basically |
|
139 | + { |
|
140 | +// $seed is user_id basically |
|
139 | 141 | $modx = evolutionCMS(); |
140 | 142 | |
141 | 143 | if (isset($modx->config['pwd_hash_algo']) && !empty($modx->config['pwd_hash_algo'])) { |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class DATEPICKER { |
4 | - function __construct() { |
|
5 | - } |
|
4 | + function __construct() { |
|
5 | + } |
|
6 | 6 | |
7 | - function getDP() { |
|
8 | - $modx = evolutionCMS(); global $_lang; |
|
7 | + function getDP() { |
|
8 | + $modx = evolutionCMS(); global $_lang; |
|
9 | 9 | |
10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | - } |
|
10 | + $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | + } |
|
13 | 13 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER{ |
|
4 | + function __construct(){ |
|
5 | 5 | } |
6 | 6 | |
7 | - function getDP() { |
|
7 | + function getDP(){ |
|
8 | 8 | $modx = evolutionCMS(); global $_lang; |
9 | 9 | |
10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
10 | + $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
|
11 | 11 | return $modx->parseText($tpl, $_lang, '[%', '%]'); |
12 | 12 | } |
13 | 13 | } |
@@ -1,10 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER |
|
4 | +{ |
|
5 | + function __construct() |
|
6 | + { |
|
5 | 7 | } |
6 | 8 | |
7 | - function getDP() { |
|
9 | + function getDP() |
|
10 | + { |
|
8 | 11 | $modx = evolutionCMS(); global $_lang; |
9 | 12 | |
10 | 13 | $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | -class DATEPICKER { |
|
3 | - function __construct() { |
|
2 | +class DATEPICKER{ |
|
3 | + function __construct(){ |
|
4 | 4 | } |
5 | - function getDP() { |
|
5 | + function getDP(){ |
|
6 | 6 | $modx = evolutionCMS(); global$_lang; |
7 | 7 | |
8 | 8 | $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
9 | - return $modx->parseText($tpl,$_lang,'[%','%]'); |
|
9 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
10 | 10 | } |
11 | 11 | } |
@@ -1,8 +1,11 @@ |
||
1 | 1 | <?php |
2 | -class DATEPICKER { |
|
3 | - function __construct() { |
|
2 | +class DATEPICKER |
|
3 | +{ |
|
4 | + function __construct() |
|
5 | + { |
|
4 | 6 | } |
5 | - function getDP() { |
|
7 | + function getDP() |
|
8 | + { |
|
6 | 9 | $modx = evolutionCMS(); global$_lang; |
7 | 10 | |
8 | 11 | $tpl = file_get_contents(dirname(__FILE__).'/datepicker.tpl'); |
@@ -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, '[%', '%]'); |
@@ -1,20 +1,22 @@ |
||
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 |
|
4 | +if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
5 | +// Include the file so we can test its validity |
|
5 | 6 | include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
6 | 7 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 8 | if (isset($dbase)) { |
8 | - if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
|
9 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
10 | - elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
|
11 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
12 | - else |
|
13 | - $upgradeable = 1; |
|
9 | + if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) { |
|
10 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
11 | + } elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) { |
|
12 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
13 | + } else { |
|
14 | + $upgradeable = 1; |
|
15 | + } |
|
16 | + } else { |
|
17 | + $upgradeable = 2; |
|
18 | + } |
|
14 | 19 | } |
15 | - else |
|
16 | - $upgradeable = 2; |
|
17 | -} |
|
18 | 20 | |
19 | 21 | $ph['moduleName'] = $moduleName; |
20 | 22 | $ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
@@ -492,7 +492,7 @@ |
||
492 | 492 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
493 | 493 | $publishedon = $pub_date; |
494 | 494 | $publishedby = $modx->getLoginUserID(); |
495 | - }elseif ($was_published && !$published) { |
|
495 | + }elseif ($was_published && !$published) { |
|
496 | 496 | $publishedon = 0; |
497 | 497 | $publishedby = 0; |
498 | 498 | } else { |
@@ -280,19 +280,19 @@ |
||
280 | 280 | // invoke OnBeforeDocFormSave event |
281 | 281 | switch($modx->config['docid_incrmnt_method']) |
282 | 282 | { |
283 | - case '1': |
|
284 | - $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
285 | - $where = "T1.id IS NULL"; |
|
286 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
287 | - $id = $modx->db->getValue($rs); |
|
283 | + case '1': |
|
284 | + $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
285 | + $where = "T1.id IS NULL"; |
|
286 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
287 | + $id = $modx->db->getValue($rs); |
|
288 | + break; |
|
289 | + case '2': |
|
290 | + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
291 | + $id = $modx->db->getValue($rs); |
|
288 | 292 | break; |
289 | - case '2': |
|
290 | - $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
291 | - $id = $modx->db->getValue($rs); |
|
292 | - break; |
|
293 | 293 | |
294 | - default: |
|
295 | - $id = ''; |
|
294 | + default: |
|
295 | + $id = ''; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | $modx->invokeEvent("OnBeforeDocFormSave", array( |
@@ -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); |
@@ -134,8 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | //end webber |
136 | 136 | } |
137 | -} |
|
138 | -elseif ($alias) { |
|
137 | +} elseif ($alias) { |
|
139 | 138 | $alias = $modx->stripAlias($alias); |
140 | 139 | } |
141 | 140 | |
@@ -149,8 +148,7 @@ discard block |
||
149 | 148 | |
150 | 149 | if ($pub_date < $currentdate) { |
151 | 150 | $published = 1; |
152 | - } |
|
153 | - elseif ($pub_date > $currentdate) { |
|
151 | + } elseif ($pub_date > $currentdate) { |
|
154 | 152 | $published = 0; |
155 | 153 | } |
156 | 154 | } |
@@ -278,8 +276,7 @@ discard block |
||
278 | 276 | case 'new' : |
279 | 277 | |
280 | 278 | // invoke OnBeforeDocFormSave event |
281 | - switch($modx->config['docid_incrmnt_method']) |
|
282 | - { |
|
279 | + switch($modx->config['docid_incrmnt_method']) { |
|
283 | 280 | case '1': |
284 | 281 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
285 | 282 | $where = "T1.id IS NULL"; |
@@ -347,8 +344,9 @@ discard block |
||
347 | 344 | "alias_visible" => $aliasvisible |
348 | 345 | ); |
349 | 346 | |
350 | - if ($id != '') |
|
351 | - $dbInsert["id"] = $id; |
|
347 | + if ($id != '') { |
|
348 | + $dbInsert["id"] = $id; |
|
349 | + } |
|
352 | 350 | |
353 | 351 | $key = $modx->db->insert($dbInsert, $tbl_site_content); |
354 | 352 | |
@@ -424,11 +422,13 @@ discard block |
||
424 | 422 | // redirect/stay options |
425 | 423 | if ($_POST['stay'] != '') { |
426 | 424 | // weblink |
427 | - if ($_POST['mode'] == "72") |
|
428 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
425 | + if ($_POST['mode'] == "72") { |
|
426 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
427 | + } |
|
429 | 428 | // document |
430 | - if ($_POST['mode'] == "4") |
|
431 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
429 | + if ($_POST['mode'] == "4") { |
|
430 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
431 | + } |
|
432 | 432 | $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
433 | 433 | } else { |
434 | 434 | $header = "Location: index.php?a=3&id=$key&r=1"; |
@@ -489,10 +489,10 @@ 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 | - }elseif ($was_published && !$published) { |
|
495 | + } elseif ($was_published && !$published) { |
|
496 | 496 | $publishedon = 0; |
497 | 497 | $publishedby = 0; |
498 | 498 | } else { |
@@ -548,7 +548,9 @@ discard block |
||
548 | 548 | $tvChanges = array(); |
549 | 549 | foreach ($tmplvars as $field => $value) { |
550 | 550 | if (!is_array($value)) { |
551 | - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; |
|
551 | + if (isset($tvIds[$value])) { |
|
552 | + $tvDeletions[] = $tvIds[$value]; |
|
553 | + } |
|
552 | 554 | } else { |
553 | 555 | $tvId = $value[0]; |
554 | 556 | $tvVal = $value[1]; |
@@ -596,7 +598,9 @@ discard block |
||
596 | 598 | "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
597 | 599 | ); |
598 | 600 | $old_groups = array(); |
599 | - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
|
601 | + while ($row = $modx->db->getRow($rs)) { |
|
602 | + $old_groups[$row['document_group']] = $row['id']; |
|
603 | + } |
|
600 | 604 | |
601 | 605 | // update the permissions in the database |
602 | 606 | $insertions = $deletions = array(); |
@@ -658,9 +662,9 @@ discard block |
||
658 | 662 | $modx->clearCache('full'); |
659 | 663 | } |
660 | 664 | |
661 | - if ($_POST['refresh_preview'] == '1') |
|
662 | - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
663 | - else { |
|
665 | + if ($_POST['refresh_preview'] == '1') { |
|
666 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
667 | + } else { |
|
664 | 668 | if ($_POST['stay'] != '2' && $id > 0) { |
665 | 669 | $modx->unlockElement(7, $id); |
666 | 670 | } |
@@ -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 | ?> |