From b1c5d870e04d4f18f5c7f65325916b6c26c5f2ad Mon Sep 17 00:00:00 2001 From: Mafoo Date: Wed, 2 Aug 2017 17:45:35 +0100 Subject: [PATCH] BugFix - GUI install (#2779) Fixes to remove some errors in the GUI installer --- core/install/install.php | 24 +++++++++++++++---- .../page_parts/install_config_detail.php | 2 +- resources/require.php | 1 + 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/core/install/install.php b/core/install/install.php index 629198fc88..154af7d839 100644 --- a/core/install/install.php +++ b/core/install/install.php @@ -355,10 +355,26 @@ //set a default template $default_template = 'default'; $_SESSION['domain']['template']['name'] = $default_template; - $set_session_theme = 1; - $domains_processed = 1; - include "themes/$default_template/app_defaults.php"; - unset($set_session_theme, $domains_processed); + $x = 0; + include "themes/$default_template/app_config.php"; + $_SESSION['theme'] = Array(); + foreach ($apps as $app_id => $data) { + foreach ($apps[$app_id]['default_settings'] as $index => $default_setting) { + $sub_category = $default_setting['default_setting_subcategory']; + $name = $default_setting['default_setting_name']; + if($default_setting['default_setting_enabled'] == 'true'){ + if($name == 'array'){ + $_SESSION['theme'][$sub_category][(isset($default_setting['default_setting_order']) ? $default_setting['default_setting_order'] : null)] = $default_setting['default_setting_value']; + } + else { + $_SESSION['theme'][$sub_category][$name] = $default_setting['default_setting_value']; + } + }else{ + $_SESSION['theme'][$sub_category][$name] = ''; + } + } + } + unset($apps, $x); $_SESSION['theme']['menu_brand_type']['text'] = "text"; //set the default template path diff --git a/core/install/resources/page_parts/install_config_detail.php b/core/install/resources/page_parts/install_config_detail.php index ceb3e45494..9eaeaca07e 100644 --- a/core/install/resources/page_parts/install_config_detail.php +++ b/core/install/resources/page_parts/install_config_detail.php @@ -99,7 +99,7 @@ if ($dir_name != "." && $dir_name != ".." && $dir_name != ".svn" && $dir_name != ".git" && $dir_name != "flags" && is_readable($theme_dir.'/'.$dir_name)) { $dir_label = str_replace('_', ' ', $dir_name); $dir_label = str_replace('-', ' ', $dir_label); - if ($dir_name == 'enhanced') { + if ($dir_name == 'default') { echo " \n"; } else { diff --git a/resources/require.php b/resources/require.php index 01deec4052..de5ecb373e 100644 --- a/resources/require.php +++ b/resources/require.php @@ -28,6 +28,7 @@ include "root.php"; //find and include the config.php file + $config_exists = false; if (file_exists("/etc/fusionpbx/config.php")) { $config_exists = true; include "/etc/fusionpbx/config.php";