update installer to use default theme (#1626)
added support to allow install to use the theme's default settings and reduce the number of php errors during the installer due to missing settings
This commit is contained in:
parent
d663891bd8
commit
96d576fc7a
|
|
@ -32,10 +32,6 @@
|
||||||
//start a php session
|
//start a php session
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
//set theme settings
|
|
||||||
$_SESSION['theme']['footer_color'] = '#cccccc';
|
|
||||||
$_SESSION['theme']['footer_background_color'] = '#ffffff';
|
|
||||||
|
|
||||||
//initialize variables we are going to use
|
//initialize variables we are going to use
|
||||||
$event_host = '';
|
$event_host = '';
|
||||||
$event_port = '';
|
$event_port = '';
|
||||||
|
|
@ -337,6 +333,7 @@
|
||||||
else {
|
else {
|
||||||
echo "<p>Unkown install_step '$install_step'</p>\n";
|
echo "<p>Unkown install_step '$install_step'</p>\n";
|
||||||
}
|
}
|
||||||
|
echo "</div>\n";
|
||||||
|
|
||||||
//initialize some defaults so we can be 'logged in'
|
//initialize some defaults so we can be 'logged in'
|
||||||
$_SESSION['username'] = 'install_enabled';
|
$_SESSION['username'] = 'install_enabled';
|
||||||
|
|
@ -350,6 +347,10 @@
|
||||||
//set a default template
|
//set a default template
|
||||||
$default_template = 'default';
|
$default_template = 'default';
|
||||||
$_SESSION['domain']['template']['name'] = $default_template;
|
$_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);
|
||||||
$_SESSION['theme']['menu_brand_type']['text'] = "text";
|
$_SESSION['theme']['menu_brand_type']['text'] = "text";
|
||||||
|
|
||||||
//set the default template path
|
//set the default template path
|
||||||
|
|
|
||||||
|
|
@ -1381,6 +1381,7 @@ if ($domains_processed == 1) {
|
||||||
$x++;
|
$x++;
|
||||||
|
|
||||||
|
|
||||||
|
if(!$set_session_theme) {
|
||||||
//get an array of the default settings
|
//get an array of the default settings
|
||||||
$sql = "select * from v_default_settings ";
|
$sql = "select * from v_default_settings ";
|
||||||
$sql .= "where default_setting_category = 'theme' ";
|
$sql .= "where default_setting_category = 'theme' ";
|
||||||
|
|
@ -1397,6 +1398,7 @@ if ($domains_processed == 1) {
|
||||||
foreach ($default_settings as $row) {
|
foreach ($default_settings as $row) {
|
||||||
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
if (trim($row['default_setting_subcategory']) == trim($setting['default_setting_subcategory'])) {
|
||||||
$found = true;
|
$found = true;
|
||||||
|
|
||||||
//remove items from the array that were found
|
//remove items from the array that were found
|
||||||
unset($missing[$i]);
|
unset($missing[$i]);
|
||||||
}
|
}
|
||||||
|
|
@ -1439,7 +1441,25 @@ if ($domains_processed == 1) {
|
||||||
$db->exec(check_sql($sql));
|
$db->exec(check_sql($sql));
|
||||||
unset($missing);
|
unset($missing);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//populate the default settings into the session theme
|
||||||
|
$_SESSION['theme'] = Array();
|
||||||
|
foreach ($array as $index => $default_settings) {
|
||||||
|
$sub_category = $array[$index]['default_setting_subcategory'];
|
||||||
|
$name = $array[$index]['default_setting_name'];
|
||||||
|
if($array[$index]['default_setting_enabled'] == 'true'){
|
||||||
|
if($name == 'array'){
|
||||||
|
$_SESSION['theme'][$sub_category][$array[$index]['default_setting_order']] = $array[$index]['default_setting_value'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$_SESSION['theme'][$sub_category][$name] = $array[$index]['default_setting_value'];
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$_SESSION['theme'][$sub_category][$name] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//unset the array variable
|
//unset the array variable
|
||||||
unset($array);
|
unset($array);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -869,6 +869,7 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
<?php
|
<?php
|
||||||
/* then set */
|
/* then set */
|
||||||
|
$shadow_inset = $shadow_outset = '';
|
||||||
if ($_SESSION['theme']['input_shadow_inner_color_focus']['text'] != '') {
|
if ($_SESSION['theme']['input_shadow_inner_color_focus']['text'] != '') {
|
||||||
$inner_color = $_SESSION['theme']['input_shadow_inner_color_focus']['text'];
|
$inner_color = $_SESSION['theme']['input_shadow_inner_color_focus']['text'];
|
||||||
$shadow_inset = "0 0 3px ".$inner_color." inset";
|
$shadow_inset = "0 0 3px ".$inner_color." inset";
|
||||||
|
|
@ -944,6 +945,7 @@ $default_login = ($_REQUEST['login'] == 'default') ? true : false;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
<?php
|
<?php
|
||||||
/* then set */
|
/* then set */
|
||||||
|
$shadow_inset = $shadow_outset = '';
|
||||||
if ($_SESSION['theme']['login_input_shadow_inner_color_focus']['text'] != '') {
|
if ($_SESSION['theme']['login_input_shadow_inner_color_focus']['text'] != '') {
|
||||||
$inner_color = $_SESSION['theme']['login_input_shadow_inner_color_focus']['text'];
|
$inner_color = $_SESSION['theme']['login_input_shadow_inner_color_focus']['text'];
|
||||||
$shadow_inset = "0 0 3px ".$inner_color." inset";
|
$shadow_inset = "0 0 3px ".$inner_color." inset";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue