@@ -170,70 +170,70 @@ |
||
| 170 | 170 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | - if (intval($params['shareparams']) || !empty($params['dependencies'])) { |
|
| 174 | - $dependencies = explode(',', $params['dependencies']); |
|
| 175 | - foreach ($dependencies as $dependency) { |
|
| 176 | - $dependency = explode(':', $dependency); |
|
| 177 | - switch (trim($dependency[0])) { |
|
| 178 | - case 'template': |
|
| 179 | - $mdp[] = array( |
|
| 180 | - 'module' => $params['name'], |
|
| 181 | - 'table' => 'templates', |
|
| 182 | - 'column' => 'templatename', |
|
| 183 | - 'type' => 50, |
|
| 184 | - 'name' => trim($dependency[1]) |
|
| 185 | - ); |
|
| 186 | - break; |
|
| 187 | - case 'tv': |
|
| 188 | - case 'tmplvar': |
|
| 189 | - $mdp[] = array( |
|
| 190 | - 'module' => $params['name'], |
|
| 191 | - 'table' => 'tmplvars', |
|
| 192 | - 'column' => 'name', |
|
| 193 | - 'type' => 60, |
|
| 194 | - 'name' => trim($dependency[1]) |
|
| 195 | - ); |
|
| 196 | - break; |
|
| 197 | - case 'chunk': |
|
| 198 | - case 'htmlsnippet': |
|
| 199 | - $mdp[] = array( |
|
| 200 | - 'module' => $params['name'], |
|
| 201 | - 'table' => 'htmlsnippets', |
|
| 202 | - 'column' => 'name', |
|
| 203 | - 'type' => 10, |
|
| 204 | - 'name' => trim($dependency[1]) |
|
| 205 | - ); |
|
| 206 | - break; |
|
| 207 | - case 'snippet': |
|
| 208 | - $mdp[] = array( |
|
| 209 | - 'module' => $params['name'], |
|
| 210 | - 'table' => 'snippets', |
|
| 211 | - 'column' => 'name', |
|
| 212 | - 'type' => 40, |
|
| 213 | - 'name' => trim($dependency[1]) |
|
| 214 | - ); |
|
| 215 | - break; |
|
| 216 | - case 'plugin': |
|
| 217 | - $mdp[] = array( |
|
| 218 | - 'module' => $params['name'], |
|
| 219 | - 'table' => 'plugins', |
|
| 220 | - 'column' => 'name', |
|
| 221 | - 'type' => 30, |
|
| 222 | - 'name' => trim($dependency[1]) |
|
| 223 | - ); |
|
| 224 | - break; |
|
| 225 | - case 'resource': |
|
| 226 | - $mdp[] = array( |
|
| 227 | - 'module' => $params['name'], |
|
| 228 | - 'table' => 'content', |
|
| 229 | - 'column' => 'pagetitle', |
|
| 230 | - 'type' => 20, |
|
| 231 | - 'name' => trim($dependency[1]) |
|
| 232 | - ); |
|
| 233 | - break; |
|
| 234 | - } |
|
| 235 | - } |
|
| 236 | - } |
|
| 173 | + if (intval($params['shareparams']) || !empty($params['dependencies'])) { |
|
| 174 | + $dependencies = explode(',', $params['dependencies']); |
|
| 175 | + foreach ($dependencies as $dependency) { |
|
| 176 | + $dependency = explode(':', $dependency); |
|
| 177 | + switch (trim($dependency[0])) { |
|
| 178 | + case 'template': |
|
| 179 | + $mdp[] = array( |
|
| 180 | + 'module' => $params['name'], |
|
| 181 | + 'table' => 'templates', |
|
| 182 | + 'column' => 'templatename', |
|
| 183 | + 'type' => 50, |
|
| 184 | + 'name' => trim($dependency[1]) |
|
| 185 | + ); |
|
| 186 | + break; |
|
| 187 | + case 'tv': |
|
| 188 | + case 'tmplvar': |
|
| 189 | + $mdp[] = array( |
|
| 190 | + 'module' => $params['name'], |
|
| 191 | + 'table' => 'tmplvars', |
|
| 192 | + 'column' => 'name', |
|
| 193 | + 'type' => 60, |
|
| 194 | + 'name' => trim($dependency[1]) |
|
| 195 | + ); |
|
| 196 | + break; |
|
| 197 | + case 'chunk': |
|
| 198 | + case 'htmlsnippet': |
|
| 199 | + $mdp[] = array( |
|
| 200 | + 'module' => $params['name'], |
|
| 201 | + 'table' => 'htmlsnippets', |
|
| 202 | + 'column' => 'name', |
|
| 203 | + 'type' => 10, |
|
| 204 | + 'name' => trim($dependency[1]) |
|
| 205 | + ); |
|
| 206 | + break; |
|
| 207 | + case 'snippet': |
|
| 208 | + $mdp[] = array( |
|
| 209 | + 'module' => $params['name'], |
|
| 210 | + 'table' => 'snippets', |
|
| 211 | + 'column' => 'name', |
|
| 212 | + 'type' => 40, |
|
| 213 | + 'name' => trim($dependency[1]) |
|
| 214 | + ); |
|
| 215 | + break; |
|
| 216 | + case 'plugin': |
|
| 217 | + $mdp[] = array( |
|
| 218 | + 'module' => $params['name'], |
|
| 219 | + 'table' => 'plugins', |
|
| 220 | + 'column' => 'name', |
|
| 221 | + 'type' => 30, |
|
| 222 | + 'name' => trim($dependency[1]) |
|
| 223 | + ); |
|
| 224 | + break; |
|
| 225 | + case 'resource': |
|
| 226 | + $mdp[] = array( |
|
| 227 | + 'module' => $params['name'], |
|
| 228 | + 'table' => 'content', |
|
| 229 | + 'column' => 'pagetitle', |
|
| 230 | + 'type' => 20, |
|
| 231 | + 'name' => trim($dependency[1]) |
|
| 232 | + ); |
|
| 233 | + break; |
|
| 234 | + } |
|
| 235 | + } |
|
| 236 | + } |
|
| 237 | 237 | } |
| 238 | 238 | $d->close(); |
| 239 | 239 | } |
@@ -1,33 +1,32 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | //:: EVO Installer Setup file |
| 3 | 3 | //::::::::::::::::::::::::::::::::::::::::: |
| 4 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 5 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
| 4 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
| 5 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
| 6 | 6 | } |
| 7 | -if(!defined('MGR_DIR')) define('MGR_DIR', 'manager'); |
|
| 7 | +if (!defined('MGR_DIR')) define('MGR_DIR', 'manager'); |
|
| 8 | 8 | |
| 9 | 9 | require_once('../'.MGR_DIR.'/includes/version.inc.php'); |
| 10 | 10 | |
| 11 | -$chunkPath = $base_path .'install/assets/chunks'; |
|
| 12 | -$snippetPath = $base_path .'install/assets/snippets'; |
|
| 13 | -$pluginPath = $base_path .'install/assets/plugins'; |
|
| 14 | -$modulePath = $base_path .'install/assets/modules'; |
|
| 15 | -$templatePath = $base_path .'install/assets/templates'; |
|
| 16 | -$tvPath = $base_path .'install/assets/tvs'; |
|
| 11 | +$chunkPath = $base_path.'install/assets/chunks'; |
|
| 12 | +$snippetPath = $base_path.'install/assets/snippets'; |
|
| 13 | +$pluginPath = $base_path.'install/assets/plugins'; |
|
| 14 | +$modulePath = $base_path.'install/assets/modules'; |
|
| 15 | +$templatePath = $base_path.'install/assets/templates'; |
|
| 16 | +$tvPath = $base_path.'install/assets/tvs'; |
|
| 17 | 17 | |
| 18 | 18 | // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category |
| 19 | 19 | $mt = &$moduleTemplates; |
| 20 | -if(is_dir($templatePath) && is_readable($templatePath)) { |
|
| 20 | +if (is_dir($templatePath) && is_readable($templatePath)) { |
|
| 21 | 21 | $d = dir($templatePath); |
| 22 | 22 | while (false !== ($tplfile = $d->read())) |
| 23 | 23 | { |
| 24 | - if(substr($tplfile, -4) != '.tpl') continue; |
|
| 24 | + if (substr($tplfile, -4) != '.tpl') continue; |
|
| 25 | 25 | $params = parse_docblock($templatePath, $tplfile); |
| 26 | - if(is_array($params) && (count($params)>0)) |
|
| 26 | + if (is_array($params) && (count($params) > 0)) |
|
| 27 | 27 | { |
| 28 | 28 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 29 | - $mt[] = array |
|
| 30 | - ( |
|
| 29 | + $mt[] = array( |
|
| 31 | 30 | $params['name'], |
| 32 | 31 | $description, |
| 33 | 32 | // Don't think this is gonna be used ... but adding it just in case 'type' |
@@ -45,12 +44,12 @@ discard block |
||
| 45 | 44 | |
| 46 | 45 | // setup Template Variable template files |
| 47 | 46 | $mtv = &$moduleTVs; |
| 48 | -if(is_dir($tvPath) && is_readable($tvPath)) { |
|
| 47 | +if (is_dir($tvPath) && is_readable($tvPath)) { |
|
| 49 | 48 | $d = dir($tvPath); |
| 50 | 49 | while (false !== ($tplfile = $d->read())) { |
| 51 | - if(substr($tplfile, -4) != '.tpl') continue; |
|
| 50 | + if (substr($tplfile, -4) != '.tpl') continue; |
|
| 52 | 51 | $params = parse_docblock($tvPath, $tplfile); |
| 53 | - if(is_array($params) && (count($params)>0)) { |
|
| 52 | + if (is_array($params) && (count($params) > 0)) { |
|
| 54 | 53 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 55 | 54 | $mtv[] = array( |
| 56 | 55 | $params['name'], |
@@ -62,9 +61,9 @@ discard block |
||
| 62 | 61 | $params['output_widget'], |
| 63 | 62 | $params['output_widget_params'], |
| 64 | 63 | "$templatePath/{$params['filename']}", /* not currently used */ |
| 65 | - $params['template_assignments']!="*"?$params['template_assignments']:implode(",",array_map(create_function('$v','return $v[0];'),$mt)), /* comma-separated list of template names */ |
|
| 64 | + $params['template_assignments'] != "*" ? $params['template_assignments'] : implode(",", array_map(create_function('$v', 'return $v[0];'), $mt)), /* comma-separated list of template names */ |
|
| 66 | 65 | $params['modx_category'], |
| 67 | - $params['lock_tv'], /* value should be 1 or 0 */ |
|
| 66 | + $params['lock_tv'], /* value should be 1 or 0 */ |
|
| 68 | 67 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
| 69 | 68 | ); |
| 70 | 69 | } |
@@ -74,14 +73,14 @@ discard block |
||
| 74 | 73 | |
| 75 | 74 | // setup chunks template files - array : name, description, type - 0:file or 1:content, file or content |
| 76 | 75 | $mc = &$moduleChunks; |
| 77 | -if(is_dir($chunkPath) && is_readable($chunkPath)) { |
|
| 76 | +if (is_dir($chunkPath) && is_readable($chunkPath)) { |
|
| 78 | 77 | $d = dir($chunkPath); |
| 79 | 78 | while (false !== ($tplfile = $d->read())) { |
| 80 | - if(substr($tplfile, -4) != '.tpl') { |
|
| 79 | + if (substr($tplfile, -4) != '.tpl') { |
|
| 81 | 80 | continue; |
| 82 | 81 | } |
| 83 | 82 | $params = parse_docblock($chunkPath, $tplfile); |
| 84 | - if(is_array($params) && count($params) > 0) { |
|
| 83 | + if (is_array($params) && count($params) > 0) { |
|
| 85 | 84 | $mc[] = array( |
| 86 | 85 | $params['name'], |
| 87 | 86 | $params['description'], |
@@ -97,14 +96,14 @@ discard block |
||
| 97 | 96 | |
| 98 | 97 | // setup snippets template files - array : name, description, type - 0:file or 1:content, file or content,properties |
| 99 | 98 | $ms = &$moduleSnippets; |
| 100 | -if(is_dir($snippetPath) && is_readable($snippetPath)) { |
|
| 99 | +if (is_dir($snippetPath) && is_readable($snippetPath)) { |
|
| 101 | 100 | $d = dir($snippetPath); |
| 102 | 101 | while (false !== ($tplfile = $d->read())) { |
| 103 | - if(substr($tplfile, -4) != '.tpl') { |
|
| 102 | + if (substr($tplfile, -4) != '.tpl') { |
|
| 104 | 103 | continue; |
| 105 | 104 | } |
| 106 | 105 | $params = parse_docblock($snippetPath, $tplfile); |
| 107 | - if(is_array($params) && count($params) > 0) { |
|
| 106 | + if (is_array($params) && count($params) > 0) { |
|
| 108 | 107 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 109 | 108 | $ms[] = array( |
| 110 | 109 | $params['name'], |
@@ -121,14 +120,14 @@ discard block |
||
| 121 | 120 | |
| 122 | 121 | // setup plugins template files - array : name, description, type - 0:file or 1:content, file or content,properties |
| 123 | 122 | $mp = &$modulePlugins; |
| 124 | -if(is_dir($pluginPath) && is_readable($pluginPath)) { |
|
| 123 | +if (is_dir($pluginPath) && is_readable($pluginPath)) { |
|
| 125 | 124 | $d = dir($pluginPath); |
| 126 | 125 | while (false !== ($tplfile = $d->read())) { |
| 127 | - if(substr($tplfile, -4) != '.tpl') { |
|
| 126 | + if (substr($tplfile, -4) != '.tpl') { |
|
| 128 | 127 | continue; |
| 129 | 128 | } |
| 130 | 129 | $params = parse_docblock($pluginPath, $tplfile); |
| 131 | - if(is_array($params) && count($params) > 0) { |
|
| 130 | + if (is_array($params) && count($params) > 0) { |
|
| 132 | 131 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 133 | 132 | $mp[] = array( |
| 134 | 133 | $params['name'], |
@@ -150,14 +149,14 @@ discard block |
||
| 150 | 149 | // setup modules - array : name, description, type - 0:file or 1:content, file or content,properties, guid,enable_sharedparams |
| 151 | 150 | $mm = &$moduleModules; |
| 152 | 151 | $mdp = &$moduleDependencies; |
| 153 | -if(is_dir($modulePath) && is_readable($modulePath)) { |
|
| 152 | +if (is_dir($modulePath) && is_readable($modulePath)) { |
|
| 154 | 153 | $d = dir($modulePath); |
| 155 | 154 | while (false !== ($tplfile = $d->read())) { |
| 156 | - if(substr($tplfile, -4) != '.tpl') { |
|
| 155 | + if (substr($tplfile, -4) != '.tpl') { |
|
| 157 | 156 | continue; |
| 158 | 157 | } |
| 159 | 158 | $params = parse_docblock($modulePath, $tplfile); |
| 160 | - if(is_array($params) && count($params) > 0) { |
|
| 159 | + if (is_array($params) && count($params) > 0) { |
|
| 161 | 160 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
| 162 | 161 | $mm[] = array( |
| 163 | 162 | $params['name'], |
@@ -241,109 +240,109 @@ discard block |
||
| 241 | 240 | // setup callback function |
| 242 | 241 | $callBackFnc = "clean_up"; |
| 243 | 242 | |
| 244 | -function clean_up($sqlParser) { |
|
| 243 | +function clean_up($sqlParser){ |
|
| 245 | 244 | $ids = array(); |
| 246 | 245 | $mysqlVerOk = -1; |
| 247 | 246 | |
| 248 | - if(function_exists("mysqli_get_server_info")) { |
|
| 249 | - $mysqlVerOk = (version_compare(mysqli_get_server_info($sqlParser->conn),"4.0.2")>=0); |
|
| 247 | + if (function_exists("mysqli_get_server_info")) { |
|
| 248 | + $mysqlVerOk = (version_compare(mysqli_get_server_info($sqlParser->conn), "4.0.2") >= 0); |
|
| 250 | 249 | } |
| 251 | 250 | |
| 252 | 251 | // secure web documents - privateweb |
| 253 | - mysqli_query($sqlParser->conn,"UPDATE `".$sqlParser->prefix."site_content` SET privateweb = 0 WHERE privateweb = 1"); |
|
| 254 | - $sql = "SELECT DISTINCT sc.id |
|
| 252 | + mysqli_query($sqlParser->conn, "UPDATE `".$sqlParser->prefix."site_content` SET privateweb = 0 WHERE privateweb = 1"); |
|
| 253 | + $sql = "SELECT DISTINCT sc.id |
|
| 255 | 254 | FROM `".$sqlParser->prefix."site_content` sc |
| 256 | 255 | LEFT JOIN `".$sqlParser->prefix."document_groups` dg ON dg.document = sc.id |
| 257 | 256 | LEFT JOIN `".$sqlParser->prefix."webgroup_access` wga ON wga.documentgroup = dg.document_group |
| 258 | 257 | WHERE wga.id>0"; |
| 259 | - $ds = mysqli_query($sqlParser->conn,$sql); |
|
| 260 | - if(!$ds) { |
|
| 258 | + $ds = mysqli_query($sqlParser->conn, $sql); |
|
| 259 | + if (!$ds) { |
|
| 261 | 260 | echo "An error occurred while executing a query: ".mysqli_error($sqlParser->conn); |
| 262 | 261 | } |
| 263 | 262 | else { |
| 264 | - while($r = mysqli_fetch_assoc($ds)) $ids[]=$r["id"]; |
|
| 265 | - if(count($ids)>0) { |
|
| 266 | - mysqli_query($sqlParser->conn,"UPDATE `".$sqlParser->prefix."site_content` SET privateweb = 1 WHERE id IN (".implode(", ",$ids).")"); |
|
| 263 | + while ($r = mysqli_fetch_assoc($ds)) $ids[] = $r["id"]; |
|
| 264 | + if (count($ids) > 0) { |
|
| 265 | + mysqli_query($sqlParser->conn, "UPDATE `".$sqlParser->prefix."site_content` SET privateweb = 1 WHERE id IN (".implode(", ", $ids).")"); |
|
| 267 | 266 | unset($ids); |
| 268 | 267 | } |
| 269 | 268 | } |
| 270 | 269 | |
| 271 | 270 | // secure manager documents privatemgr |
| 272 | - mysqli_query($sqlParser->conn,"UPDATE `".$sqlParser->prefix."site_content` SET privatemgr = 0 WHERE privatemgr = 1"); |
|
| 273 | - $sql = "SELECT DISTINCT sc.id |
|
| 271 | + mysqli_query($sqlParser->conn, "UPDATE `".$sqlParser->prefix."site_content` SET privatemgr = 0 WHERE privatemgr = 1"); |
|
| 272 | + $sql = "SELECT DISTINCT sc.id |
|
| 274 | 273 | FROM `".$sqlParser->prefix."site_content` sc |
| 275 | 274 | LEFT JOIN `".$sqlParser->prefix."document_groups` dg ON dg.document = sc.id |
| 276 | 275 | LEFT JOIN `".$sqlParser->prefix."membergroup_access` mga ON mga.documentgroup = dg.document_group |
| 277 | 276 | WHERE mga.id>0"; |
| 278 | - $ds = mysqli_query($sqlParser->conn,$sql); |
|
| 279 | - if(!$ds) { |
|
| 277 | + $ds = mysqli_query($sqlParser->conn, $sql); |
|
| 278 | + if (!$ds) { |
|
| 280 | 279 | echo "An error occurred while executing a query: ".mysqli_error($sqlParser->conn); |
| 281 | 280 | } |
| 282 | 281 | else { |
| 283 | - while($r = mysqli_fetch_assoc($ds)) $ids[]=$r["id"]; |
|
| 284 | - if(count($ids)>0) { |
|
| 285 | - mysqli_query($sqlParser->conn,"UPDATE `".$sqlParser->prefix."site_content` SET privatemgr = 1 WHERE id IN (".implode(", ",$ids).")"); |
|
| 282 | + while ($r = mysqli_fetch_assoc($ds)) $ids[] = $r["id"]; |
|
| 283 | + if (count($ids) > 0) { |
|
| 284 | + mysqli_query($sqlParser->conn, "UPDATE `".$sqlParser->prefix."site_content` SET privatemgr = 1 WHERE id IN (".implode(", ", $ids).")"); |
|
| 286 | 285 | unset($ids); |
| 287 | 286 | } |
| 288 | 287 | } |
| 289 | 288 | } |
| 290 | 289 | |
| 291 | -function parse_docblock($element_dir, $filename) { |
|
| 290 | +function parse_docblock($element_dir, $filename){ |
|
| 292 | 291 | $params = array(); |
| 293 | - $fullpath = $element_dir . '/' . $filename; |
|
| 294 | - if(is_readable($fullpath)) { |
|
| 292 | + $fullpath = $element_dir.'/'.$filename; |
|
| 293 | + if (is_readable($fullpath)) { |
|
| 295 | 294 | $tpl = @fopen($fullpath, "r"); |
| 296 | - if($tpl) { |
|
| 295 | + if ($tpl) { |
|
| 297 | 296 | $params['filename'] = $filename; |
| 298 | 297 | $docblock_start_found = false; |
| 299 | 298 | $name_found = false; |
| 300 | 299 | $description_found = false; |
| 301 | 300 | $docblock_end_found = false; |
| 302 | 301 | |
| 303 | - while(!feof($tpl)) { |
|
| 302 | + while (!feof($tpl)) { |
|
| 304 | 303 | $line = fgets($tpl); |
| 305 | - if(!$docblock_start_found) { |
|
| 304 | + if (!$docblock_start_found) { |
|
| 306 | 305 | // find docblock start |
| 307 | - if(strpos($line, '/**') !== false) { |
|
| 306 | + if (strpos($line, '/**') !== false) { |
|
| 308 | 307 | $docblock_start_found = true; |
| 309 | 308 | } |
| 310 | 309 | continue; |
| 311 | - } elseif(!$name_found) { |
|
| 310 | + } elseif (!$name_found) { |
|
| 312 | 311 | // find name |
| 313 | 312 | $ma = null; |
| 314 | - if(preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { |
|
| 313 | + if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { |
|
| 315 | 314 | $params['name'] = trim($ma[1]); |
| 316 | 315 | $name_found = !empty($params['name']); |
| 317 | 316 | } |
| 318 | 317 | continue; |
| 319 | - } elseif(!$description_found) { |
|
| 318 | + } elseif (!$description_found) { |
|
| 320 | 319 | // find description |
| 321 | 320 | $ma = null; |
| 322 | - if(preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { |
|
| 321 | + if (preg_match("/^\s+\*\s+(.+)/", $line, $ma)) { |
|
| 323 | 322 | $params['description'] = trim($ma[1]); |
| 324 | 323 | $description_found = !empty($params['description']); |
| 325 | 324 | } |
| 326 | 325 | continue; |
| 327 | 326 | } else { |
| 328 | 327 | $ma = null; |
| 329 | - if(preg_match("/^\s+\*\s+\@([^\s]+)\s+(.+)/", $line, $ma)) { |
|
| 328 | + if (preg_match("/^\s+\*\s+\@([^\s]+)\s+(.+)/", $line, $ma)) { |
|
| 330 | 329 | $param = trim($ma[1]); |
| 331 | 330 | $val = trim($ma[2]); |
| 332 | - if(!empty($param) && !empty($val)) { |
|
| 333 | - if($param == 'internal') { |
|
| 331 | + if (!empty($param) && !empty($val)) { |
|
| 332 | + if ($param == 'internal') { |
|
| 334 | 333 | $ma = null; |
| 335 | - if(preg_match("/\@([^\s]+)\s+(.+)/", $val, $ma)) { |
|
| 334 | + if (preg_match("/\@([^\s]+)\s+(.+)/", $val, $ma)) { |
|
| 336 | 335 | $param = trim($ma[1]); |
| 337 | 336 | $val = trim($ma[2]); |
| 338 | 337 | } |
| 339 | 338 | //if($val !== '0' && (empty($param) || empty($val))) { |
| 340 | - if(empty($param)) { |
|
| 339 | + if (empty($param)) { |
|
| 341 | 340 | continue; |
| 342 | 341 | } |
| 343 | 342 | } |
| 344 | 343 | $params[$param] = $val; |
| 345 | 344 | } |
| 346 | - } elseif(preg_match("/^\s*\*\/\s*$/", $line)) { |
|
| 345 | + } elseif (preg_match("/^\s*\*\/\s*$/", $line)) { |
|
| 347 | 346 | $docblock_end_found = true; |
| 348 | 347 | break; |
| 349 | 348 | } |
@@ -7,10 +7,10 @@ |
||
| 7 | 7 | function getLangOptions($install_language='english') { |
| 8 | 8 | $langs = array(); |
| 9 | 9 | if( $handle = opendir('lang/') ) { |
| 10 | - while( false !== ( $file = readdir( $handle ) ) ) { |
|
| 11 | - if( strpos( $file, '.' ) ) $langs[] = str_replace('.inc.php', '', $file); |
|
| 12 | - } |
|
| 13 | - closedir( $handle ); |
|
| 10 | + while( false !== ( $file = readdir( $handle ) ) ) { |
|
| 11 | + if( strpos( $file, '.' ) ) $langs[] = str_replace('.inc.php', '', $file); |
|
| 12 | + } |
|
| 13 | + closedir( $handle ); |
|
| 14 | 14 | } |
| 15 | 15 | sort( $langs ); |
| 16 | 16 | $_ = array(); |
@@ -1,22 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $content = file_get_contents('actions/tpl_language.html'); |
| 3 | -$content = parse($content,array('langOptions'=>getLangOptions($install_language))); |
|
| 4 | -$content = parse($content,$_lang,'[%','%]'); |
|
| 3 | +$content = parse($content, array('langOptions'=>getLangOptions($install_language))); |
|
| 4 | +$content = parse($content, $_lang, '[%', '%]'); |
|
| 5 | 5 | echo $content; |
| 6 | 6 | |
| 7 | -function getLangOptions($install_language='english') { |
|
| 7 | +function getLangOptions($install_language = 'english'){ |
|
| 8 | 8 | $langs = array(); |
| 9 | - if( $handle = opendir('lang/') ) { |
|
| 10 | - while( false !== ( $file = readdir( $handle ) ) ) { |
|
| 11 | - if( strpos( $file, '.' ) ) $langs[] = str_replace('.inc.php', '', $file); |
|
| 9 | + if ($handle = opendir('lang/')) { |
|
| 10 | + while (false !== ($file = readdir($handle))) { |
|
| 11 | + if (strpos($file, '.')) $langs[] = str_replace('.inc.php', '', $file); |
|
| 12 | 12 | } |
| 13 | - closedir( $handle ); |
|
| 13 | + closedir($handle); |
|
| 14 | 14 | } |
| 15 | - sort( $langs ); |
|
| 15 | + sort($langs); |
|
| 16 | 16 | $_ = array(); |
| 17 | 17 | foreach ($langs as $language) { |
| 18 | - $abrv_language = explode('-',$language); |
|
| 19 | - $selected = ($language == $install_language) ? 'selected' : ''; |
|
| 18 | + $abrv_language = explode('-', $language); |
|
| 19 | + $selected = ($language == $install_language) ? 'selected' : ''; |
|
| 20 | 20 | $_[] = sprintf('<option value="%s" %s>%s</option>', $language, $selected, ucwords($abrv_language[0]))."\n"; |
| 21 | 21 | } |
| 22 | 22 | return join("\n", $_); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | <form name="install" id="install_form" action="index.php?action=options" method="post"> |
| 21 | 21 | <?php |
| 22 | 22 | if ($errors == 0) { |
| 23 | - // check if install folder is removeable |
|
| 23 | + // check if install folder is removeable |
|
| 24 | 24 | if (is_writable("../install")) { ?> |
| 25 | 25 | <span id="removeinstall" style="float:left;cursor:pointer;color:#505050;line-height:18px;" onclick="var chk=document.install.rminstaller; if(chk) chk.checked=!chk.checked;"><input type="checkbox" name="rminstaller" onclick="event.cancelBubble=true;" <?php echo (empty ($errors) ? 'checked="checked"' : '') ?> style="cursor:default;" /><?php echo $_lang['remove_install_folder_auto'] ?></span> |
| 26 | 26 | <?php |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | var chk = document.install.rminstaller; |
| 44 | 44 | if(chk && chk.checked) { |
| 45 | 45 | // remove install folder and files |
| 46 | - window.location.href = "../<?php echo MGR_DIR;?>/processors/remove_installer.processor.php?rminstall=1"; |
|
| 46 | + window.location.href = "../<?php echo MGR_DIR; ?>/processors/remove_installer.processor.php?rminstall=1"; |
|
| 47 | 47 | } |
| 48 | 48 | else { |
| 49 | - window.location.href = "../<?php echo MGR_DIR;?>/"; |
|
| 49 | + window.location.href = "../<?php echo MGR_DIR; ?>/"; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | /* ]]> */ |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_not_exist'] . "</p>"; |
| 193 | 193 | $errors += 1; |
| 194 | 194 | echo "<p>" . $_lang['table_prefix_not_exist_note'] . "</p>"; |
| 195 | - } else { |
|
| 195 | + } else { |
|
| 196 | 196 | echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
| 197 | - } |
|
| 197 | + } |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | // check mysql version |
@@ -252,16 +252,16 @@ discard block |
||
| 252 | 252 | ?> |
| 253 | 253 | <p> |
| 254 | 254 | <?php |
| 255 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
| 256 | - echo $errors > 1 ? $errors." " : ""; |
|
| 257 | - if ($errors > 1) echo $_lang['errors']; |
|
| 258 | - else echo $_lang['error']; |
|
| 259 | - if ($errors > 1) echo $_lang['please_correct_errors']; |
|
| 260 | - else echo $_lang['please_correct_error']; |
|
| 261 | - if ($errors > 1) echo $_lang['and_try_again_plural']; |
|
| 262 | - else echo $_lang['and_try_again']; |
|
| 263 | - echo $_lang['visit_forum']; |
|
| 264 | - ?> |
|
| 255 | + echo $_lang['setup_cannot_continue'] . ' '; |
|
| 256 | + echo $errors > 1 ? $errors." " : ""; |
|
| 257 | + if ($errors > 1) echo $_lang['errors']; |
|
| 258 | + else echo $_lang['error']; |
|
| 259 | + if ($errors > 1) echo $_lang['please_correct_errors']; |
|
| 260 | + else echo $_lang['please_correct_error']; |
|
| 261 | + if ($errors > 1) echo $_lang['and_try_again_plural']; |
|
| 262 | + else echo $_lang['and_try_again']; |
|
| 263 | + echo $_lang['visit_forum']; |
|
| 264 | + ?> |
|
| 265 | 265 | </p> |
| 266 | 266 | <?php |
| 267 | 267 | } |
@@ -2,65 +2,65 @@ discard block |
||
| 2 | 2 | $installMode = intval($_POST['installmode']); |
| 3 | 3 | echo "<div class=\"stepcontainer\"> |
| 4 | 4 | <ul class=\"progressbar\"> |
| 5 | - <li class=\"visited\">" . $_lang['choose_language'] . "</li> |
|
| 6 | - <li class=\"visited\">" . $_lang['installation_mode'] . "</li> |
|
| 7 | - <li class=\"visited\">" . $_lang['optional_items'] . "</li> |
|
| 8 | - <li class=\"active\">" . $_lang['preinstall_validation'] . "</li> |
|
| 9 | - <li>" . $_lang['install_results'] . "</li> |
|
| 5 | + <li class=\"visited\">" . $_lang['choose_language']."</li> |
|
| 6 | + <li class=\"visited\">" . $_lang['installation_mode']."</li> |
|
| 7 | + <li class=\"visited\">" . $_lang['optional_items']."</li> |
|
| 8 | + <li class=\"active\">" . $_lang['preinstall_validation']."</li> |
|
| 9 | + <li>" . $_lang['install_results']."</li> |
|
| 10 | 10 | </ul> |
| 11 | 11 | <div class=\"clearleft\"></div> |
| 12 | 12 | </div> |
| 13 | -<h2>" . $_lang['preinstall_validation'] . "</h2>"; |
|
| 13 | +<h2>" . $_lang['preinstall_validation']."</h2>"; |
|
| 14 | 14 | |
| 15 | -echo "<h3>" . $_lang['summary_setup_check'] . "</h3>"; |
|
| 15 | +echo "<h3>".$_lang['summary_setup_check']."</h3>"; |
|
| 16 | 16 | $errors = 0; |
| 17 | 17 | |
| 18 | 18 | // check PHP version |
| 19 | -echo "<p>" . $_lang['checking_php_version']; |
|
| 19 | +echo "<p>".$_lang['checking_php_version']; |
|
| 20 | 20 | $phpMinVersion = "5.4.0"; |
| 21 | 21 | // -1 if left is less, 0 if equal, +1 if left is higher |
| 22 | 22 | if (version_compare(phpversion(), $phpMinVersion) < 0) { |
| 23 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span>" . $_lang['you_running_php'] . phpversion() . str_replace('[+min_version+]', $phpMinVersion, $_lang["modx_requires_php"]) . "</p>"; |
|
| 23 | + echo "<span class=\"notok\">".$_lang['failed']."</span>".$_lang['you_running_php'].phpversion().str_replace('[+min_version+]', $phpMinVersion, $_lang["modx_requires_php"])."</p>"; |
|
| 24 | 24 | $errors += 1; |
| 25 | 25 | } else { |
| 26 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 26 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 27 | 27 | } |
| 28 | 28 | // check if iconv is available |
| 29 | -echo "<p>" . $_lang['checking_iconv']; |
|
| 29 | +echo "<p>".$_lang['checking_iconv']; |
|
| 30 | 30 | $iconv = (int) function_exists('iconv'); |
| 31 | -if ($iconv == '0'){ |
|
| 32 | - echo "<span class=\"notok\">" . $_lang['failed']. "</span></p><p><strong>".$_lang['checking_iconv_note']."</strong></p>"; |
|
| 31 | +if ($iconv == '0') { |
|
| 32 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p><p><strong>".$_lang['checking_iconv_note']."</strong></p>"; |
|
| 33 | 33 | $errors += 1; |
| 34 | 34 | } else { |
| 35 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 35 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 36 | 36 | } |
| 37 | 37 | // check sessions |
| 38 | -echo "<p>" . $_lang['checking_sessions']; |
|
| 38 | +echo "<p>".$_lang['checking_sessions']; |
|
| 39 | 39 | if ($_SESSION['test'] != 1) { |
| 40 | - echo "<span class=\"notok\">" . $_lang['failed']. "</span></p>"; |
|
| 40 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
| 41 | 41 | $errors += 1; |
| 42 | 42 | } else { |
| 43 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 43 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 44 | 44 | } |
| 45 | 45 | // check directories |
| 46 | 46 | // cache exists? |
| 47 | -echo "<p>" . $_lang['checking_if_cache_exist']; |
|
| 47 | +echo "<p>".$_lang['checking_if_cache_exist']; |
|
| 48 | 48 | if (!file_exists("../assets/cache") || !file_exists("../assets/cache/rss")) { |
| 49 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
| 49 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
| 50 | 50 | $errors += 1; |
| 51 | 51 | } else { |
| 52 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 52 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 53 | 53 | } |
| 54 | 54 | // cache writable? |
| 55 | -echo "<p>" . $_lang['checking_if_cache_writable']; |
|
| 55 | +echo "<p>".$_lang['checking_if_cache_writable']; |
|
| 56 | 56 | if (!is_writable("../assets/cache")) { |
| 57 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
| 57 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
| 58 | 58 | $errors += 1; |
| 59 | 59 | } else { |
| 60 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 60 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 61 | 61 | } |
| 62 | 62 | // cache files writable? |
| 63 | -echo "<p>" . $_lang['checking_if_cache_file_writable']; |
|
| 63 | +echo "<p>".$_lang['checking_if_cache_file_writable']; |
|
| 64 | 64 | if (!file_exists("../assets/cache/siteCache.idx.php")) { |
| 65 | 65 | // make an attempt to create the file |
| 66 | 66 | @ $hnd = fopen("../assets/cache/siteCache.idx.php", 'w'); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | @ fclose($hnd); |
| 69 | 69 | } |
| 70 | 70 | if (!is_writable("../assets/cache/siteCache.idx.php")) { |
| 71 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></p>"; |
|
| 71 | + echo "<span class=\"notok\">".$_lang['failed']."</span></p>"; |
|
| 72 | 72 | $errors += 1; |
| 73 | 73 | } else { |
| 74 | 74 | echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
| 141 | 141 | $database_connection_charset = $_POST['database_connection_charset']; |
| 142 | 142 | $database_connection_method = $_POST['database_connection_method']; |
| 143 | - $dbase = '`' . $_POST['database_name'] . '`'; |
|
| 143 | + $dbase = '`'.$_POST['database_name'].'`'; |
|
| 144 | 144 | $table_prefix = $_POST['tableprefix']; |
| 145 | 145 | } |
| 146 | 146 | echo "<p>".$_lang['creating_database_connection']; |
@@ -178,54 +178,54 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | // check table prefix |
| 180 | 180 | if ($conn && $installMode == 0) { |
| 181 | - echo "<p>" . $_lang['checking_table_prefix'] . $table_prefix . "`: "; |
|
| 182 | - if ($rs= mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
| 183 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_already_inuse'] . "</p>"; |
|
| 181 | + echo "<p>".$_lang['checking_table_prefix'].$table_prefix."`: "; |
|
| 182 | + if ($rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
| 183 | + echo "<span class=\"notok\">".$_lang['failed']."</span></b>".$_lang['table_prefix_already_inuse']."</p>"; |
|
| 184 | 184 | $errors += 1; |
| 185 | - echo "<p>" . $_lang['table_prefix_already_inuse_note'] . "</p>"; |
|
| 185 | + echo "<p>".$_lang['table_prefix_already_inuse_note']."</p>"; |
|
| 186 | 186 | } else { |
| 187 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 187 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 188 | 188 | } |
| 189 | 189 | } elseif ($conn && $installMode == 2) { |
| 190 | - echo "<p>" . $_lang['checking_table_prefix'] . $table_prefix . "`: "; |
|
| 191 | - if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`" . $table_prefix . "site_content`")) { |
|
| 192 | - echo "<span class=\"notok\">" . $_lang['failed'] . "</span></b>" . $_lang['table_prefix_not_exist'] . "</p>"; |
|
| 190 | + echo "<p>".$_lang['checking_table_prefix'].$table_prefix."`: "; |
|
| 191 | + if (!$rs = mysqli_query($conn, "SELECT COUNT(*) FROM $dbase.`".$table_prefix."site_content`")) { |
|
| 192 | + echo "<span class=\"notok\">".$_lang['failed']."</span></b>".$_lang['table_prefix_not_exist']."</p>"; |
|
| 193 | 193 | $errors += 1; |
| 194 | - echo "<p>" . $_lang['table_prefix_not_exist_note'] . "</p>"; |
|
| 194 | + echo "<p>".$_lang['table_prefix_not_exist_note']."</p>"; |
|
| 195 | 195 | } else { |
| 196 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 196 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 197 | 197 | } |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | // check mysql version |
| 201 | 201 | if ($conn) { |
| 202 | - echo "<p>" . $_lang['checking_mysql_version']; |
|
| 203 | - if ( version_compare(mysqli_get_server_info($conn), '5.0.51', '=') ) { |
|
| 204 | - echo "<span class=\"notok\">" . $_lang['warning'] . "</span></b> <strong>". $_lang['mysql_5051'] . "</strong></p>"; |
|
| 205 | - echo "<p><span class=\"notok\">" . $_lang['mysql_5051_warning'] . "</span></p>"; |
|
| 202 | + echo "<p>".$_lang['checking_mysql_version']; |
|
| 203 | + if (version_compare(mysqli_get_server_info($conn), '5.0.51', '=')) { |
|
| 204 | + echo "<span class=\"notok\">".$_lang['warning']."</span></b> <strong>".$_lang['mysql_5051']."</strong></p>"; |
|
| 205 | + echo "<p><span class=\"notok\">".$_lang['mysql_5051_warning']."</span></p>"; |
|
| 206 | 206 | } else { |
| 207 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span> <strong>" . $_lang['mysql_version_is'] . mysqli_get_server_info($conn) . "</strong></p>"; |
|
| 207 | + echo "<span class=\"ok\">".$_lang['ok']."</span> <strong>".$_lang['mysql_version_is'].mysqli_get_server_info($conn)."</strong></p>"; |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | // check for strict mode |
| 212 | 212 | if ($conn) { |
| 213 | - echo "<p>". $_lang['checking_mysql_strict_mode']; |
|
| 213 | + echo "<p>".$_lang['checking_mysql_strict_mode']; |
|
| 214 | 214 | $mysqlmode = mysqli_query($conn, "SELECT @@global.sql_mode"); |
| 215 | - if (mysqli_num_rows($mysqlmode) > 0){ |
|
| 215 | + if (mysqli_num_rows($mysqlmode) > 0) { |
|
| 216 | 216 | $modes = mysqli_fetch_array($mysqlmode, MYSQLI_NUM); |
| 217 | 217 | //$modes = array("STRICT_TRANS_TABLES"); // for testing |
| 218 | 218 | // print_r($modes); |
| 219 | 219 | foreach ($modes as $mode) { |
| 220 | 220 | if (stristr($mode, "STRICT_TRANS_TABLES") !== false || stristr($mode, "STRICT_ALL_TABLES") !== false) { |
| 221 | - echo "<span class=\"notok\">" . $_lang['warning'] . "</span></b> <strong> " . $_lang['strict_mode'] . "</strong></p>"; |
|
| 222 | - echo "<p><span class=\"notok\">" . $_lang['strict_mode_error'] . "</span></p>"; |
|
| 221 | + echo "<span class=\"notok\">".$_lang['warning']."</span></b> <strong> ".$_lang['strict_mode']."</strong></p>"; |
|
| 222 | + echo "<p><span class=\"notok\">".$_lang['strict_mode_error']."</span></p>"; |
|
| 223 | 223 | } else { |
| 224 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 224 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 225 | 225 | } |
| 226 | 226 | } |
| 227 | 227 | } else { |
| 228 | - echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>"; |
|
| 228 | + echo "<span class=\"ok\">".$_lang['ok']."</span></p>"; |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | // Version and strict mode check end |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | @ fclose($hnd); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | -if($installMode > 0 && $_POST['installdata'] == "1") { |
|
| 247 | +if ($installMode > 0 && $_POST['installdata'] == "1") { |
|
| 248 | 248 | echo "<p class=\"notes\"><strong>{$_lang['sample_web_site']}:</strong> {$_lang['sample_web_site_note']}</p>\n"; |
| 249 | 249 | } |
| 250 | 250 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | ?> |
| 253 | 253 | <p> |
| 254 | 254 | <?php |
| 255 | - echo $_lang['setup_cannot_continue'] . ' '; |
|
| 255 | + echo $_lang['setup_cannot_continue'].' '; |
|
| 256 | 256 | echo $errors > 1 ? $errors." " : ""; |
| 257 | 257 | if ($errors > 1) echo $_lang['errors']; |
| 258 | 258 | else echo $_lang['error']; |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | echo "<p> </p>"; |
| 270 | 270 | |
| 271 | -$nextAction= $errors > 0 ? 'summary' : 'install'; |
|
| 272 | -$nextButton= $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
| 273 | -$nextVisibility= $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
| 274 | -$agreeToggle= $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
| 271 | +$nextAction = $errors > 0 ? 'summary' : 'install'; |
|
| 272 | +$nextButton = $errors > 0 ? $_lang['retry'] : $_lang['install']; |
|
| 273 | +$nextVisibility = $errors > 0 || isset($_POST['chkagree']) ? 'visible' : 'hidden'; |
|
| 274 | +$agreeToggle = $errors > 0 ? '' : ' onclick="if(document.getElementById(\'chkagree\').checked){document.getElementById(\'nextbutton\').style.visibility=\'visible\';}else{document.getElementById(\'nextbutton\').style.visibility=\'hidden\';}"'; |
|
| 275 | 275 | ?> |
| 276 | 276 | <form name="install" id="install_form" action="index.php?action=<?php echo $nextAction ?>" method="post"> |
| 277 | 277 | <div> |
@@ -293,27 +293,27 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | <input type="hidden" value="<?php echo $_POST['installdata'] ?>" name="installdata" /> |
| 295 | 295 | <?php |
| 296 | -$templates = isset ($_POST['template']) ? $_POST['template'] : array (); |
|
| 296 | +$templates = isset ($_POST['template']) ? $_POST['template'] : array(); |
|
| 297 | 297 | foreach ($templates as $i => $template) echo "<input type=\"hidden\" name=\"template[]\" value=\"$template\" />\n"; |
| 298 | -$tvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
|
| 298 | +$tvs = isset ($_POST['tv']) ? $_POST['tv'] : array(); |
|
| 299 | 299 | foreach ($tvs as $i => $tv) echo "<input type=\"hidden\" name=\"tv[]\" value=\"$tv\" />\n"; |
| 300 | -$chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
|
| 300 | +$chunks = isset ($_POST['chunk']) ? $_POST['chunk'] : array(); |
|
| 301 | 301 | foreach ($chunks as $i => $chunk) echo "<input type=\"hidden\" name=\"chunk[]\" value=\"$chunk\" />\n"; |
| 302 | -$snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
|
| 302 | +$snippets = isset ($_POST['snippet']) ? $_POST['snippet'] : array(); |
|
| 303 | 303 | foreach ($snippets as $i => $snippet) echo "<input type=\"hidden\" name=\"snippet[]\" value=\"$snippet\" />\n"; |
| 304 | -$plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
|
| 304 | +$plugins = isset ($_POST['plugin']) ? $_POST['plugin'] : array(); |
|
| 305 | 305 | foreach ($plugins as $i => $plugin) echo "<input type=\"hidden\" name=\"plugin[]\" value=\"$plugin\" />\n"; |
| 306 | -$modules = isset ($_POST['module']) ? $_POST['module'] : array (); |
|
| 306 | +$modules = isset ($_POST['module']) ? $_POST['module'] : array(); |
|
| 307 | 307 | foreach ($modules as $i => $module) echo "<input type=\"hidden\" name=\"module[]\" value=\"$module\" />\n"; |
| 308 | 308 | ?> |
| 309 | 309 | </div> |
| 310 | 310 | |
| 311 | -<h2><?php echo $_lang['agree_to_terms'];?></h2> |
|
| 311 | +<h2><?php echo $_lang['agree_to_terms']; ?></h2> |
|
| 312 | 312 | <p> |
| 313 | -<input type="checkbox" value="1" id="chkagree" name="chkagree" style="line-height:18px" <?php echo isset($_POST['chkagree']) ? 'checked="checked" ':""; ?><?php echo $agreeToggle;?>/><label for="chkagree" style="display:inline;float:none;line-height:18px;"> <?php echo $_lang['iagree_box']?> </label> |
|
| 313 | +<input type="checkbox" value="1" id="chkagree" name="chkagree" style="line-height:18px" <?php echo isset($_POST['chkagree']) ? 'checked="checked" ' : ""; ?><?php echo $agreeToggle; ?>/><label for="chkagree" style="display:inline;float:none;line-height:18px;"> <?php echo $_lang['iagree_box']?> </label> |
|
| 314 | 314 | </p> |
| 315 | 315 | <p class="buttonlinks"> |
| 316 | 316 | <a href="javascript:document.getElementById('install_form').action='index.php?action=options&language=<?php echo $install_language?>';document.getElementById('install_form').submit();" class="prev" title="<?php echo $_lang['btnback_value']?>"><span><?php echo $_lang['btnback_value']?></span></a> |
| 317 | - <a id="nextbutton" href="javascript:document.getElementById('install_form').submit();" title="<?php echo $nextButton ?>" style="visibility:<?php echo $nextVisibility;?>"><span><?php echo $nextButton ?></span></a> |
|
| 317 | + <a id="nextbutton" href="javascript:document.getElementById('install_form').submit();" title="<?php echo $nextButton ?>" style="visibility:<?php echo $nextVisibility; ?>"><span><?php echo $nextButton ?></span></a> |
|
| 318 | 318 | </p> |
| 319 | 319 | </form> |
@@ -15,13 +15,13 @@ discard block |
||
| 15 | 15 | include($base_path.MGR_DIR.'/includes/config.inc.php'); |
| 16 | 16 | // We need to have all connection settings - but prefix may be empty so we have to ignore it |
| 17 | 17 | if ($dbase) { |
| 18 | - $database_name = trim($dbase, '`'); |
|
| 19 | - if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
|
| 20 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 21 | - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
| 22 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 23 | - else |
|
| 24 | - $upgradeable = 1; |
|
| 18 | + $database_name = trim($dbase, '`'); |
|
| 19 | + if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
|
| 20 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 21 | + elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
| 22 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 23 | + else |
|
| 24 | + $upgradeable = 1; |
|
| 25 | 25 | } |
| 26 | 26 | else $upgradable= 2; |
| 27 | 27 | } |
@@ -75,28 +75,28 @@ discard block |
||
| 75 | 75 | echo $content; |
| 76 | 76 | |
| 77 | 77 | function getLangs($install_language) { |
| 78 | - if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
|
| 79 | - elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
| 80 | - if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
| 81 | - $manager_language = $install_language; |
|
| 82 | - else |
|
| 83 | - $manager_language = "english"; |
|
| 78 | + if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
|
| 79 | + elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
| 80 | + if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
| 81 | + $manager_language = $install_language; |
|
| 82 | + else |
|
| 83 | + $manager_language = "english"; |
|
| 84 | 84 | |
| 85 | - $langs = array(); |
|
| 86 | - if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
|
| 87 | - while (false !== ($file = readdir($handle))) { |
|
| 88 | - if (strpos($file, '.inc.') !== false) |
|
| 89 | - $langs[] = $file; |
|
| 90 | - } |
|
| 91 | - closedir($handle); |
|
| 92 | - } |
|
| 93 | - sort($langs); |
|
| 85 | + $langs = array(); |
|
| 86 | + if ($handle = opendir("../".MGR_DIR."/includes/lang")) { |
|
| 87 | + while (false !== ($file = readdir($handle))) { |
|
| 88 | + if (strpos($file, '.inc.') !== false) |
|
| 89 | + $langs[] = $file; |
|
| 90 | + } |
|
| 91 | + closedir($handle); |
|
| 92 | + } |
|
| 93 | + sort($langs); |
|
| 94 | 94 | |
| 95 | - $_ = array(); |
|
| 96 | - foreach ($langs as $language) { |
|
| 97 | - $abrv_language = explode('.', $language); |
|
| 98 | - $selected = (strtolower($abrv_language[0]) == strtolower($manager_language)) ? ' selected' : ''; |
|
| 95 | + $_ = array(); |
|
| 96 | + foreach ($langs as $language) { |
|
| 97 | + $abrv_language = explode('.', $language); |
|
| 98 | + $selected = (strtolower($abrv_language[0]) == strtolower($manager_language)) ? ' selected' : ''; |
|
| 99 | 99 | $_[] = sprintf('<option value="%s" %s>%s</option>', $abrv_language[0], $selected, ucwords($abrv_language[0])); |
| 100 | - } |
|
| 101 | - return join("\n", $_); |
|
| 100 | + } |
|
| 101 | + return join("\n", $_); |
|
| 102 | 102 | } |
@@ -2,11 +2,11 @@ discard block |
||
| 2 | 2 | $installMode = intval($_POST['installmode']); |
| 3 | 3 | |
| 4 | 4 | // Determine upgradeability |
| 5 | -$upgradeable= 0; |
|
| 5 | +$upgradeable = 0; |
|
| 6 | 6 | if ($installMode == 0) { |
| 7 | - $database_name= ''; |
|
| 8 | - $database_server= 'localhost'; |
|
| 9 | - $table_prefix= 'evo_'; |
|
| 7 | + $database_name = ''; |
|
| 8 | + $database_server = 'localhost'; |
|
| 9 | + $table_prefix = 'evo_'; |
|
| 10 | 10 | } else { |
| 11 | 11 | $database_name = ''; |
| 12 | 12 | if (!is_file($base_path.MGR_DIR.'/includes/config.inc.php')) $upgradeable = 0; |
@@ -17,13 +17,13 @@ discard block |
||
| 17 | 17 | if ($dbase) { |
| 18 | 18 | $database_name = trim($dbase, '`'); |
| 19 | 19 | if (!$conn = mysqli_connect($database_server, $database_user, $database_password)) |
| 20 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 21 | - elseif (! mysqli_select_db($conn, trim($dbase, '`'))) |
|
| 22 | - $upgradeable = (isset($_POST['installmode']) && $_POST['installmode']=='new') ? 0 : 2; |
|
| 20 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] == 'new') ? 0 : 2; |
|
| 21 | + elseif (!mysqli_select_db($conn, trim($dbase, '`'))) |
|
| 22 | + $upgradeable = (isset($_POST['installmode']) && $_POST['installmode'] == 'new') ? 0 : 2; |
|
| 23 | 23 | else |
| 24 | 24 | $upgradeable = 1; |
| 25 | 25 | } |
| 26 | - else $upgradable= 2; |
|
| 26 | + else $upgradable = 2; |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | // check the database collation if not specified in the configuration |
@@ -48,36 +48,36 @@ discard block |
||
| 48 | 48 | $database_connection_method = 'SET CHARACTER SET'; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name']: $database_name; |
|
| 52 | -$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix']: $table_prefix; |
|
| 51 | +$ph['database_name'] = isset($_POST['database_name']) ? $_POST['database_name'] : $database_name; |
|
| 52 | +$ph['tableprefix'] = isset($_POST['tableprefix']) ? $_POST['tableprefix'] : $table_prefix; |
|
| 53 | 53 | $ph['selected_set_character_set'] = isset($database_connection_method) && $database_connection_method == 'SET CHARACTER SET' ? 'selected' : ''; |
| 54 | 54 | $ph['selected_set_names'] = isset($database_connection_method) && $database_connection_method == 'SET NAMES' ? 'selected' : ''; |
| 55 | 55 | $ph['show#connection_method'] = (($installMode == 0) || ($installMode == 2)) ? 'block' : 'none'; |
| 56 | -$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation']: $database_collation; |
|
| 57 | -$ph['show#AUH'] = ($installMode == 0) ? 'block':'none'; |
|
| 58 | -$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin']:'admin'; |
|
| 59 | -$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail']:""; |
|
| 60 | -$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword']:""; |
|
| 61 | -$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm']:""; |
|
| 56 | +$ph['database_collation'] = isset($_POST['database_collation']) ? $_POST['database_collation'] : $database_collation; |
|
| 57 | +$ph['show#AUH'] = ($installMode == 0) ? 'block' : 'none'; |
|
| 58 | +$ph['cmsadmin'] = isset($_POST['cmsadmin']) ? $_POST['cmsadmin'] : 'admin'; |
|
| 59 | +$ph['cmsadminemail'] = isset($_POST['cmsadminemail']) ? $_POST['cmsadminemail'] : ""; |
|
| 60 | +$ph['cmspassword'] = isset($_POST['cmspassword']) ? $_POST['cmspassword'] : ""; |
|
| 61 | +$ph['cmspasswordconfirm'] = isset($_POST['cmspasswordconfirm']) ? $_POST['cmspasswordconfirm'] : ""; |
|
| 62 | 62 | $ph['managerLangs'] = getLangs($install_language); |
| 63 | 63 | $ph['install_language'] = $install_language; |
| 64 | 64 | $ph['installMode'] = $installMode; |
| 65 | -$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked':""; |
|
| 65 | +$ph['checkedChkagree'] = isset($_POST['chkagree']) ? 'checked' : ""; |
|
| 66 | 66 | $ph['database_connection_method'] = isset($database_connection_method) ? $database_connection_method : ''; |
| 67 | -$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost']: $database_server; |
|
| 68 | -$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname']: ''; |
|
| 69 | -$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword']: ""; |
|
| 67 | +$ph['databasehost'] = isset($_POST['databasehost']) ? $_POST['databasehost'] : $database_server; |
|
| 68 | +$ph['databaseloginname'] = isset($_SESSION['databaseloginname']) ? $_SESSION['databaseloginname'] : ''; |
|
| 69 | +$ph['databaseloginpassword'] = isset($_SESSION['databaseloginpassword']) ? $_SESSION['databaseloginpassword'] : ""; |
|
| 70 | 70 | $ph['MGR_DIR'] = MGR_DIR; |
| 71 | 71 | |
| 72 | 72 | $content = file_get_contents('./actions/tpl_connection.html'); |
| 73 | -$content = parse($content, $_lang, '[%','%]'); |
|
| 73 | +$content = parse($content, $_lang, '[%', '%]'); |
|
| 74 | 74 | $content = parse($content, $ph); |
| 75 | 75 | echo $content; |
| 76 | 76 | |
| 77 | -function getLangs($install_language) { |
|
| 77 | +function getLangs($install_language){ |
|
| 78 | 78 | if (isset($_POST['managerlanguage'])) $manager_language = $_POST['managerlanguage']; |
| 79 | - elseif(isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
| 80 | - if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php",MGR_DIR,$install_language))) |
|
| 79 | + elseif (isset($_GET['managerlanguage'])) $manager_language = $_GET['managerlanguage']; |
|
| 80 | + if ($install_language != "english" && is_file(sprintf("../%s/includes/lang/%s.inc.php", MGR_DIR, $install_language))) |
|
| 81 | 81 | $manager_language = $install_language; |
| 82 | 82 | else |
| 83 | 83 | $manager_language = "english"; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | function getTemplates($presets=array()) { |
| 83 | - if(!count($presets)) return ''; |
|
| 83 | + if(!count($presets)) return ''; |
|
| 84 | 84 | $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array (); |
| 85 | 85 | $tpl = '<label><input type="checkbox" name="template[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 86 | 86 | $_ = array(); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // display chunks |
| 120 | 120 | function getChunks($presets=array()) { |
| 121 | - if(!count($presets)) return ''; |
|
| 121 | + if(!count($presets)) return ''; |
|
| 122 | 122 | $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
| 123 | 123 | $tpl = '<label><input type="checkbox" name="chunk[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 124 | 124 | $_ = array(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | // display modules |
| 139 | 139 | function getModules($presets=array()) { |
| 140 | - if(!count($presets)) return ''; |
|
| 140 | + if(!count($presets)) return ''; |
|
| 141 | 141 | $selected = isset ($_POST['module']) ? $_POST['module'] : array (); |
| 142 | 142 | $tpl = '<label><input type="checkbox" name="module[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 143 | 143 | $_ = array(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | // display plugins |
| 158 | 158 | function getPlugins($presets=array()) { |
| 159 | - if(!count($presets)) return ''; |
|
| 159 | + if(!count($presets)) return ''; |
|
| 160 | 160 | $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
| 161 | 161 | $tpl = '<label><input type="checkbox" name="plugin[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 162 | 162 | $_ = array(); |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | // display snippets |
| 181 | 181 | function getSnippets($presets=array()) { |
| 182 | - if(!count($presets)) return ''; |
|
| 182 | + if(!count($presets)) return ''; |
|
| 183 | 183 | $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
| 184 | 184 | $tpl = '<label><input type="checkbox" name="snippet[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 185 | 185 | $_ = array(); |
@@ -5,13 +5,13 @@ discard block |
||
| 5 | 5 | $database_collation = isset($_POST['database_collation']) ? $_POST['database_collation'] : 'utf8_general_ci'; |
| 6 | 6 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
| 7 | 7 | $_POST['database_connection_charset'] = $database_charset; |
| 8 | - if(empty($_SESSION['databaseloginpassword'])) |
|
| 8 | + if (empty($_SESSION['databaseloginpassword'])) |
|
| 9 | 9 | $_SESSION['databaseloginpassword'] = $_POST['databaseloginpassword']; |
| 10 | - if(empty($_SESSION['databaseloginname'])) |
|
| 10 | + if (empty($_SESSION['databaseloginname'])) |
|
| 11 | 11 | $_SESSION['databaseloginname'] = $_POST['databaseloginname']; |
| 12 | 12 | } |
| 13 | 13 | elseif ($installMode == 1) { |
| 14 | - include $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
| 14 | + include $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
| 15 | 15 | if (@ $conn = mysqli_connect($database_server, $database_user, $database_password)) { |
| 16 | 16 | if (@ mysqli_query($conn, "USE {$dbase}")) { |
| 17 | 17 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | $ph['checked'] = isset ($_POST['installdata']) && $_POST['installdata'] == "1" ? 'checked' : ''; |
| 64 | 64 | |
| 65 | 65 | # load setup information file |
| 66 | -include($base_path . 'install/setup.info.php'); |
|
| 66 | +include($base_path.'install/setup.info.php'); |
|
| 67 | 67 | $ph['templates'] = getTemplates($moduleTemplates); |
| 68 | 68 | $ph['tvs'] = getTVs($moduleTVs); |
| 69 | 69 | $ph['chunks'] = getChunks($moduleChunks); |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $ph['action'] = ($installMode == 1) ? 'mode' : 'connection'; |
| 75 | 75 | |
| 76 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_options.html'); |
|
| 77 | -$content = parse($tpl,$ph); |
|
| 78 | -echo parse($content,$_lang,'[%','%]'); |
|
| 76 | +$tpl = file_get_contents($base_path.'install/actions/tpl_options.html'); |
|
| 77 | +$content = parse($tpl, $ph); |
|
| 78 | +echo parse($content, $_lang, '[%', '%]'); |
|
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | -function getTemplates($presets=array()) { |
|
| 83 | - if(!count($presets)) return ''; |
|
| 84 | - $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array (); |
|
| 82 | +function getTemplates($presets = array()){ |
|
| 83 | + if (!count($presets)) return ''; |
|
| 84 | + $selectedTemplates = isset ($_POST['template']) ? $_POST['template'] : array(); |
|
| 85 | 85 | $tpl = '<label><input type="checkbox" name="template[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 86 | 86 | $_ = array(); |
| 87 | 87 | $i = 0; |
@@ -90,16 +90,16 @@ discard block |
||
| 90 | 90 | $ph['name'] = $preset[0]; |
| 91 | 91 | $ph['desc'] = $preset[1]; |
| 92 | 92 | $ph['class'] = !in_array('sample', $preset[6]) ? 'toggle' : 'toggle demo'; |
| 93 | - $ph['checked'] = in_array($i, $selectedTemplates) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 94 | - $_[] = parse($tpl,$ph); |
|
| 93 | + $ph['checked'] = in_array($i, $selectedTemplates) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 94 | + $_[] = parse($tpl, $ph); |
|
| 95 | 95 | $i++; |
| 96 | 96 | } |
| 97 | - if(0<count($_)) return '<h3>[%templates%]</h3>' . join("\n", $_); |
|
| 97 | + if (0 < count($_)) return '<h3>[%templates%]</h3>'.join("\n", $_); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | -function getTVs($presets=array()) { |
|
| 101 | - if(!count($presets)) return ''; |
|
| 102 | - $selectedTvs = isset ($_POST['tv']) ? $_POST['tv'] : array (); |
|
| 100 | +function getTVs($presets = array()){ |
|
| 101 | + if (!count($presets)) return ''; |
|
| 102 | + $selectedTvs = isset ($_POST['tv']) ? $_POST['tv'] : array(); |
|
| 103 | 103 | $tpl = '<label><input type="checkbox" name="tv[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+alterName+] <span class="description">([+desc+])</span></label><hr />'; |
| 104 | 104 | $_ = array(); |
| 105 | 105 | $i = 0; |
@@ -109,17 +109,17 @@ discard block |
||
| 109 | 109 | $ph['alterName'] = $preset[1]; |
| 110 | 110 | $ph['desc'] = $preset[2]; |
| 111 | 111 | $ph['class'] = !in_array('sample', $preset[12]) ? 'toggle' : 'toggle demo'; |
| 112 | - $ph['checked'] = in_array($i, $selectedTvs) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 113 | - $_[] = parse($tpl,$ph); |
|
| 112 | + $ph['checked'] = in_array($i, $selectedTvs) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 113 | + $_[] = parse($tpl, $ph); |
|
| 114 | 114 | $i++; |
| 115 | 115 | } |
| 116 | - if(0<count($_)) return '<h3>[%tvs%]</h3>' . join("\n", $_); |
|
| 116 | + if (0 < count($_)) return '<h3>[%tvs%]</h3>'.join("\n", $_); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | // display chunks |
| 120 | -function getChunks($presets=array()) { |
|
| 121 | - if(!count($presets)) return ''; |
|
| 122 | - $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array (); |
|
| 120 | +function getChunks($presets = array()){ |
|
| 121 | + if (!count($presets)) return ''; |
|
| 122 | + $selected = isset ($_POST['chunk']) ? $_POST['chunk'] : array(); |
|
| 123 | 123 | $tpl = '<label><input type="checkbox" name="chunk[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 124 | 124 | $_ = array(); |
| 125 | 125 | $i = 0; |
@@ -128,17 +128,17 @@ discard block |
||
| 128 | 128 | $ph['name'] = $preset[0]; |
| 129 | 129 | $ph['desc'] = $preset[1]; |
| 130 | 130 | $ph['class'] = !in_array('sample', $preset[5]) ? 'toggle' : 'toggle demo'; |
| 131 | - $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 132 | - $_[] = parse($tpl,$ph); |
|
| 131 | + $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 132 | + $_[] = parse($tpl, $ph); |
|
| 133 | 133 | $i++; |
| 134 | 134 | } |
| 135 | - if(0<count($_)) return '<h3>[%chunks%]</h3>' . join("\n", $_); |
|
| 135 | + if (0 < count($_)) return '<h3>[%chunks%]</h3>'.join("\n", $_); |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | // display modules |
| 139 | -function getModules($presets=array()) { |
|
| 140 | - if(!count($presets)) return ''; |
|
| 141 | - $selected = isset ($_POST['module']) ? $_POST['module'] : array (); |
|
| 139 | +function getModules($presets = array()){ |
|
| 140 | + if (!count($presets)) return ''; |
|
| 141 | + $selected = isset ($_POST['module']) ? $_POST['module'] : array(); |
|
| 142 | 142 | $tpl = '<label><input type="checkbox" name="module[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 143 | 143 | $_ = array(); |
| 144 | 144 | $i = 0; |
@@ -147,17 +147,17 @@ discard block |
||
| 147 | 147 | $ph['name'] = $preset[0]; |
| 148 | 148 | $ph['desc'] = $preset[1]; |
| 149 | 149 | $ph['class'] = !in_array('sample', $preset[7]) ? 'toggle' : 'toggle demo'; |
| 150 | - $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 151 | - $_[] = parse($tpl,$ph); |
|
| 150 | + $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
|
| 151 | + $_[] = parse($tpl, $ph); |
|
| 152 | 152 | $i++; |
| 153 | 153 | } |
| 154 | - if(0<count($_)) return '<h3>[%modules%]</h3>' . join("\n", $_); |
|
| 154 | + if (0 < count($_)) return '<h3>[%modules%]</h3>'.join("\n", $_); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // display plugins |
| 158 | -function getPlugins($presets=array()) { |
|
| 159 | - if(!count($presets)) return ''; |
|
| 160 | - $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array (); |
|
| 158 | +function getPlugins($presets = array()){ |
|
| 159 | + if (!count($presets)) return ''; |
|
| 160 | + $selected = isset ($_POST['plugin']) ? $_POST['plugin'] : array(); |
|
| 161 | 161 | $tpl = '<label><input type="checkbox" name="plugin[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 162 | 162 | $_ = array(); |
| 163 | 163 | $i = 0; |
@@ -167,20 +167,20 @@ discard block |
||
| 167 | 167 | $ph['desc'] = $preset[1]; |
| 168 | 168 | if (is_array($preset[8])) { |
| 169 | 169 | $ph['class'] = !in_array('sample', $preset[8]) ? 'toggle' : 'toggle demo'; |
| 170 | - }else{ |
|
| 170 | + } else { |
|
| 171 | 171 | $ph['class'] = 'toggle demo'; |
| 172 | 172 | } |
| 173 | 173 | $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
| 174 | - $_[] = parse($tpl,$ph); |
|
| 174 | + $_[] = parse($tpl, $ph); |
|
| 175 | 175 | $i++; |
| 176 | 176 | } |
| 177 | - if(0<count($_)) return '<h3>[%plugins%]</h3>' . join("\n", $_); |
|
| 177 | + if (0 < count($_)) return '<h3>[%plugins%]</h3>'.join("\n", $_); |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | // display snippets |
| 181 | -function getSnippets($presets=array()) { |
|
| 182 | - if(!count($presets)) return ''; |
|
| 183 | - $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array (); |
|
| 181 | +function getSnippets($presets = array()){ |
|
| 182 | + if (!count($presets)) return ''; |
|
| 183 | + $selected = isset ($_POST['snippet']) ? $_POST['snippet'] : array(); |
|
| 184 | 184 | $tpl = '<label><input type="checkbox" name="snippet[]" value="[+i+]" class="[+class+]" [+checked+] />[%install_update%] <span class="comname">[+name+]</span> - [+desc+]</label><hr />'; |
| 185 | 185 | $_ = array(); |
| 186 | 186 | $i = 0; |
@@ -190,8 +190,8 @@ discard block |
||
| 190 | 190 | $ph['desc'] = $preset[1]; |
| 191 | 191 | $ph['class'] = !in_array('sample', $preset[5]) ? 'toggle' : 'toggle demo'; |
| 192 | 192 | $ph['checked'] = in_array($i, $selected) || (!isset($_POST['options_selected'])) ? 'checked' : ''; |
| 193 | - $_[] = parse($tpl,$ph); |
|
| 193 | + $_[] = parse($tpl, $ph); |
|
| 194 | 194 | $i++; |
| 195 | 195 | } |
| 196 | - if(0<count($_)) return '<h3>[%snippets%]</h3>' . join("\n", $_); |
|
| 196 | + if (0 < count($_)) return '<h3>[%snippets%]</h3>'.join("\n", $_); |
|
| 197 | 197 | } |
@@ -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 $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 $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)) |
@@ -16,16 +16,16 @@ discard block |
||
| 16 | 16 | $upgradeable = 2; |
| 17 | 17 | } |
| 18 | 18 | $ph['moduleName'] = $moduleName; |
| 19 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
| 20 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
| 19 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
| 20 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
| 21 | 21 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
| 22 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
| 23 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
| 24 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
| 22 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
| 23 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
| 24 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
| 25 | 25 | $ph['install_language'] = $install_language; |
| 26 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
| 27 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
| 26 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
| 27 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
| 28 | 28 | |
| 29 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
| 30 | -$content = parse($tpl,$ph); |
|
| 31 | -echo parse($content,$_lang,'[%','%]'); |
|
| 29 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
| 30 | +$content = parse($tpl, $ph); |
|
| 31 | +echo parse($content, $_lang, '[%', '%]'); |
|
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | $self = 'install/connection.databasetest.php'; |
| 9 | 9 | $base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
| 10 | 10 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
| 11 | - include_once("{$base_path}assets/cache/siteManager.php"); |
|
| 11 | + include_once("{$base_path}assets/cache/siteManager.php"); |
|
| 12 | 12 | } |
| 13 | 13 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
| 14 | - define('MGR_DIR','manager'); |
|
| 14 | + define('MGR_DIR','manager'); |
|
| 15 | 15 | } |
| 16 | 16 | require_once("lang.php"); |
| 17 | 17 | |
@@ -6,12 +6,12 @@ discard block |
||
| 6 | 6 | $installMode = $_POST['installMode']; |
| 7 | 7 | |
| 8 | 8 | $self = 'install/connection.databasetest.php'; |
| 9 | -$base_path = str_replace($self,'',str_replace('\\','/', __FILE__)); |
|
| 9 | +$base_path = str_replace($self, '', str_replace('\\', '/', __FILE__)); |
|
| 10 | 10 | if (is_file("{$base_path}assets/cache/siteManager.php")) { |
| 11 | 11 | include_once("{$base_path}assets/cache/siteManager.php"); |
| 12 | 12 | } |
| 13 | -if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
| 14 | - define('MGR_DIR','manager'); |
|
| 13 | +if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
|
| 14 | + define('MGR_DIR', 'manager'); |
|
| 15 | 15 | } |
| 16 | 16 | require_once("lang.php"); |
| 17 | 17 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
| 32 | 32 | $query = "CREATE DATABASE `".$database_name."` CHARACTER SET ".$database_charset." COLLATE ".$database_collation.";"; |
| 33 | 33 | |
| 34 | - if (! mysqli_query($conn, $query)){ |
|
| 34 | + if (!mysqli_query($conn, $query)) { |
|
| 35 | 35 | $output .= '<span id="database_fail" style="color:#FF0000;">'.$_lang['status_failed_could_not_create_database'].'</span>'; |
| 36 | 36 | } |
| 37 | 37 | else { |
@@ -1,14 +1,14 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | function install_sessionCheck() |
| 3 | 3 | { |
| 4 | - global $_lang; |
|
| 4 | + global $_lang; |
|
| 5 | 5 | |
| 6 | - // session loop-back tester |
|
| 7 | - if(!isset($_GET['action']) || $_GET['action']!=='mode') |
|
| 8 | - { |
|
| 9 | - if(!isset($_SESSION['test']) || $_SESSION['test']!=1) |
|
| 10 | - { |
|
| 11 | - echo ' |
|
| 6 | + // session loop-back tester |
|
| 7 | + if(!isset($_GET['action']) || $_GET['action']!=='mode') |
|
| 8 | + { |
|
| 9 | + if(!isset($_SESSION['test']) || $_SESSION['test']!=1) |
|
| 10 | + { |
|
| 11 | + echo ' |
|
| 12 | 12 | <html> |
| 13 | 13 | <head> |
| 14 | 14 | <title>Install Problem</title> |
@@ -27,86 +27,86 @@ discard block |
||
| 27 | 27 | </div> |
| 28 | 28 | </body> |
| 29 | 29 | </html>'; |
| 30 | - exit; |
|
| 31 | - } |
|
| 32 | - } |
|
| 30 | + exit; |
|
| 31 | + } |
|
| 32 | + } |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | function parse($src,$ph,$left='[+',$right='+]') |
| 36 | 36 | { |
| 37 | - foreach($ph as $k=>$v) |
|
| 38 | - { |
|
| 39 | - $k = $left . $k . $right; |
|
| 40 | - $src = str_replace($k,$v,$src); |
|
| 41 | - } |
|
| 42 | - return $src; |
|
| 37 | + foreach($ph as $k=>$v) |
|
| 38 | + { |
|
| 39 | + $k = $left . $k . $right; |
|
| 40 | + $src = str_replace($k,$v,$src); |
|
| 41 | + } |
|
| 42 | + return $src; |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | function ph() |
| 46 | 46 | { |
| 47 | - global $_lang,$moduleName,$moduleVersion,$modx_textdir,$modx_release_date; |
|
| 47 | + global $_lang,$moduleName,$moduleVersion,$modx_textdir,$modx_release_date; |
|
| 48 | 48 | |
| 49 | - if(isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode']; |
|
| 50 | - else $installmode = get_installmode(); |
|
| 49 | + if(isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode']; |
|
| 50 | + else $installmode = get_installmode(); |
|
| 51 | 51 | |
| 52 | - $ph['pagetitle'] = $_lang['modx_install']; |
|
| 53 | - $ph['textdir'] = $modx_textdir ? ' id="rtl"':''; |
|
| 54 | - $ph['help_link'] = $installmode == 0 ? $_lang['help_link_new'] : $_lang['help_link_upd']; |
|
| 55 | - $ph['version'] = $moduleVersion; |
|
| 56 | - $ph['release_date'] = ($modx_textdir ? '‏':'') . $modx_release_date; |
|
| 57 | - $ph['footer1'] = $_lang['modx_footer1']; |
|
| 58 | - $ph['footer2'] = $_lang['modx_footer2']; |
|
| 59 | - $ph['current_year'] = date('Y'); |
|
| 60 | - return $ph; |
|
| 52 | + $ph['pagetitle'] = $_lang['modx_install']; |
|
| 53 | + $ph['textdir'] = $modx_textdir ? ' id="rtl"':''; |
|
| 54 | + $ph['help_link'] = $installmode == 0 ? $_lang['help_link_new'] : $_lang['help_link_upd']; |
|
| 55 | + $ph['version'] = $moduleVersion; |
|
| 56 | + $ph['release_date'] = ($modx_textdir ? '‏':'') . $modx_release_date; |
|
| 57 | + $ph['footer1'] = $_lang['modx_footer1']; |
|
| 58 | + $ph['footer2'] = $_lang['modx_footer2']; |
|
| 59 | + $ph['current_year'] = date('Y'); |
|
| 60 | + return $ph; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | function get_installmode() |
| 64 | 64 | { |
| 65 | - global $base_path,$database_server, $database_user, $database_password, $dbase, $table_prefix; |
|
| 65 | + global $base_path,$database_server, $database_user, $database_password, $dbase, $table_prefix; |
|
| 66 | 66 | |
| 67 | - $conf_path = "{$base_path}manager/includes/config.inc.php"; |
|
| 68 | - if (!is_file($conf_path)) $installmode = 0; |
|
| 69 | - elseif(isset($_POST['installmode'])) $installmode = $_POST['installmode']; |
|
| 70 | - else |
|
| 71 | - { |
|
| 72 | - include_once("{$base_path}manager/includes/config.inc.php"); |
|
| 67 | + $conf_path = "{$base_path}manager/includes/config.inc.php"; |
|
| 68 | + if (!is_file($conf_path)) $installmode = 0; |
|
| 69 | + elseif(isset($_POST['installmode'])) $installmode = $_POST['installmode']; |
|
| 70 | + else |
|
| 71 | + { |
|
| 72 | + include_once("{$base_path}manager/includes/config.inc.php"); |
|
| 73 | 73 | |
| 74 | - if(!isset($dbase) || empty($dbase)) $installmode = 0; |
|
| 75 | - else |
|
| 76 | - { |
|
| 77 | - $conn = mysqli_connect($database_server, $database_user, $database_password); |
|
| 78 | - if($conn) |
|
| 79 | - { |
|
| 80 | - $_SESSION['database_server'] = $database_server; |
|
| 81 | - $_SESSION['database_user'] = $database_user; |
|
| 82 | - $_SESSION['database_password'] = $database_password; |
|
| 74 | + if(!isset($dbase) || empty($dbase)) $installmode = 0; |
|
| 75 | + else |
|
| 76 | + { |
|
| 77 | + $conn = mysqli_connect($database_server, $database_user, $database_password); |
|
| 78 | + if($conn) |
|
| 79 | + { |
|
| 80 | + $_SESSION['database_server'] = $database_server; |
|
| 81 | + $_SESSION['database_user'] = $database_user; |
|
| 82 | + $_SESSION['database_password'] = $database_password; |
|
| 83 | 83 | |
| 84 | - $dbase = trim($dbase, '`'); |
|
| 85 | - $rs = mysqli_select_db($conn, $dbase); |
|
| 86 | - } |
|
| 87 | - else $rs = false; |
|
| 84 | + $dbase = trim($dbase, '`'); |
|
| 85 | + $rs = mysqli_select_db($conn, $dbase); |
|
| 86 | + } |
|
| 87 | + else $rs = false; |
|
| 88 | 88 | |
| 89 | - if($rs) |
|
| 90 | - { |
|
| 91 | - $_SESSION['dbase'] = $dbase; |
|
| 92 | - $_SESSION['table_prefix'] = $table_prefix; |
|
| 93 | - $_SESSION['database_collation'] = 'utf8_general_ci'; |
|
| 94 | - $_SESSION['database_connection_method'] = 'SET CHARACTER SET'; |
|
| 89 | + if($rs) |
|
| 90 | + { |
|
| 91 | + $_SESSION['dbase'] = $dbase; |
|
| 92 | + $_SESSION['table_prefix'] = $table_prefix; |
|
| 93 | + $_SESSION['database_collation'] = 'utf8_general_ci'; |
|
| 94 | + $_SESSION['database_connection_method'] = 'SET CHARACTER SET'; |
|
| 95 | 95 | |
| 96 | - $tbl_system_settings = "`{$dbase}`.`{$table_prefix}system_settings`"; |
|
| 97 | - $rs = mysqli_query($conn, "SELECT setting_value FROM {$tbl_system_settings} WHERE setting_name='settings_version'"); |
|
| 98 | - if($rs) |
|
| 99 | - { |
|
| 100 | - $row = mysqli_fetch_assoc($rs); |
|
| 101 | - $settings_version = $row['setting_value']; |
|
| 102 | - } |
|
| 103 | - else $settings_version = ''; |
|
| 96 | + $tbl_system_settings = "`{$dbase}`.`{$table_prefix}system_settings`"; |
|
| 97 | + $rs = mysqli_query($conn, "SELECT setting_value FROM {$tbl_system_settings} WHERE setting_name='settings_version'"); |
|
| 98 | + if($rs) |
|
| 99 | + { |
|
| 100 | + $row = mysqli_fetch_assoc($rs); |
|
| 101 | + $settings_version = $row['setting_value']; |
|
| 102 | + } |
|
| 103 | + else $settings_version = ''; |
|
| 104 | 104 | |
| 105 | - if (empty($settings_version)) $installmode = 0; |
|
| 106 | - else $installmode = 1; |
|
| 107 | - } |
|
| 108 | - else $installmode = 1; |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - return $installmode; |
|
| 105 | + if (empty($settings_version)) $installmode = 0; |
|
| 106 | + else $installmode = 1; |
|
| 107 | + } |
|
| 108 | + else $installmode = 1; |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + return $installmode; |
|
| 112 | 112 | } |
@@ -4,9 +4,9 @@ discard block |
||
| 4 | 4 | global $_lang; |
| 5 | 5 | |
| 6 | 6 | // session loop-back tester |
| 7 | - if(!isset($_GET['action']) || $_GET['action']!=='mode') |
|
| 7 | + if (!isset($_GET['action']) || $_GET['action'] !== 'mode') |
|
| 8 | 8 | { |
| 9 | - if(!isset($_SESSION['test']) || $_SESSION['test']!=1) |
|
| 9 | + if (!isset($_SESSION['test']) || $_SESSION['test'] != 1) |
|
| 10 | 10 | { |
| 11 | 11 | echo ' |
| 12 | 12 | <html> |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | </head> |
| 23 | 23 | <body> |
| 24 | 24 | <div class="install"> |
| 25 | - <p>' . $_lang["session_problem"] . '</p> |
|
| 26 | - <p><a href="./">' .$_lang["session_problem_try_again"] . '</a></p> |
|
| 25 | + <p>' . $_lang["session_problem"].'</p> |
|
| 26 | + <p><a href="./">' .$_lang["session_problem_try_again"].'</a></p> |
|
| 27 | 27 | </div> |
| 28 | 28 | </body> |
| 29 | 29 | </html>'; |
@@ -32,28 +32,28 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -function parse($src,$ph,$left='[+',$right='+]') |
|
| 35 | +function parse($src, $ph, $left = '[+', $right = '+]') |
|
| 36 | 36 | { |
| 37 | - foreach($ph as $k=>$v) |
|
| 37 | + foreach ($ph as $k=>$v) |
|
| 38 | 38 | { |
| 39 | - $k = $left . $k . $right; |
|
| 40 | - $src = str_replace($k,$v,$src); |
|
| 39 | + $k = $left.$k.$right; |
|
| 40 | + $src = str_replace($k, $v, $src); |
|
| 41 | 41 | } |
| 42 | 42 | return $src; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | function ph() |
| 46 | 46 | { |
| 47 | - global $_lang,$moduleName,$moduleVersion,$modx_textdir,$modx_release_date; |
|
| 47 | + global $_lang, $moduleName, $moduleVersion, $modx_textdir, $modx_release_date; |
|
| 48 | 48 | |
| 49 | - if(isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode']; |
|
| 49 | + if (isset($_SESSION['installmode'])) $installmode = $_SESSION['installmode']; |
|
| 50 | 50 | else $installmode = get_installmode(); |
| 51 | 51 | |
| 52 | 52 | $ph['pagetitle'] = $_lang['modx_install']; |
| 53 | - $ph['textdir'] = $modx_textdir ? ' id="rtl"':''; |
|
| 53 | + $ph['textdir'] = $modx_textdir ? ' id="rtl"' : ''; |
|
| 54 | 54 | $ph['help_link'] = $installmode == 0 ? $_lang['help_link_new'] : $_lang['help_link_upd']; |
| 55 | 55 | $ph['version'] = $moduleVersion; |
| 56 | - $ph['release_date'] = ($modx_textdir ? '‏':'') . $modx_release_date; |
|
| 56 | + $ph['release_date'] = ($modx_textdir ? '‏' : '').$modx_release_date; |
|
| 57 | 57 | $ph['footer1'] = $_lang['modx_footer1']; |
| 58 | 58 | $ph['footer2'] = $_lang['modx_footer2']; |
| 59 | 59 | $ph['current_year'] = date('Y'); |
@@ -62,20 +62,20 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | function get_installmode() |
| 64 | 64 | { |
| 65 | - global $base_path,$database_server, $database_user, $database_password, $dbase, $table_prefix; |
|
| 65 | + global $base_path, $database_server, $database_user, $database_password, $dbase, $table_prefix; |
|
| 66 | 66 | |
| 67 | 67 | $conf_path = "{$base_path}manager/includes/config.inc.php"; |
| 68 | 68 | if (!is_file($conf_path)) $installmode = 0; |
| 69 | - elseif(isset($_POST['installmode'])) $installmode = $_POST['installmode']; |
|
| 69 | + elseif (isset($_POST['installmode'])) $installmode = $_POST['installmode']; |
|
| 70 | 70 | else |
| 71 | 71 | { |
| 72 | 72 | include_once("{$base_path}manager/includes/config.inc.php"); |
| 73 | 73 | |
| 74 | - if(!isset($dbase) || empty($dbase)) $installmode = 0; |
|
| 74 | + if (!isset($dbase) || empty($dbase)) $installmode = 0; |
|
| 75 | 75 | else |
| 76 | 76 | { |
| 77 | 77 | $conn = mysqli_connect($database_server, $database_user, $database_password); |
| 78 | - if($conn) |
|
| 78 | + if ($conn) |
|
| 79 | 79 | { |
| 80 | 80 | $_SESSION['database_server'] = $database_server; |
| 81 | 81 | $_SESSION['database_user'] = $database_user; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | else $rs = false; |
| 88 | 88 | |
| 89 | - if($rs) |
|
| 89 | + if ($rs) |
|
| 90 | 90 | { |
| 91 | 91 | $_SESSION['dbase'] = $dbase; |
| 92 | 92 | $_SESSION['table_prefix'] = $table_prefix; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | $tbl_system_settings = "`{$dbase}`.`{$table_prefix}system_settings`"; |
| 97 | 97 | $rs = mysqli_query($conn, "SELECT setting_value FROM {$tbl_system_settings} WHERE setting_name='settings_version'"); |
| 98 | - if($rs) |
|
| 98 | + if ($rs) |
|
| 99 | 99 | { |
| 100 | 100 | $row = mysqli_fetch_assoc($rs); |
| 101 | 101 | $settings_version = $row['setting_value']; |