Browse Source

More work on admin UI colors

tags/3.1.0
Mike Koch 2 years ago
parent
commit
daca2e6273
3 changed files with 91 additions and 55 deletions
  1. 6
    21
      admin/admin_settings.php
  2. 84
    33
      install/mods-for-hesk/sql/installSql.php
  3. 1
    1
      language/en/text.php

+ 6
- 21
admin/admin_settings.php View File

@@ -4016,23 +4016,6 @@ $modsForHesk_settings = mfh_getSettings();
</div>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="form-group">
<label for="admin-navbar-brand-text-color"
class="col-sm-7 col-xs-12 control-label"><?php echo $hesklang['text_hover_color']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
data-placement="top"
title="<?php echo $hesklang['text_hover_color']; ?>"
data-content="<?php echo $hesklang['text_hover_color_help']; ?>"></i>
</label>

<div class="col-sm-5 col-xs-12">
<input type="text" id="admin-navbar-brand-text-color" name="admin-navbar-brand-text-color"
class="form-control"
value="<?php echo $modsForHesk_settings['admin_navbar_brand_text_hover_color']; ?>">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-xs-12">
@@ -4052,10 +4035,12 @@ $modsForHesk_settings = mfh_getSettings();
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-xs-12">
<div class="form-group">
<label for="admin-navbar-brand-background-hover-color"
class="col-sm-7 col-xs-12 control-label"><?php echo $hesklang['background_hover_color']; ?>
<label for="admin-sidebar-font-weight"
class="col-sm-7 col-xs-12 control-label"><?php echo 'FONT WEIGHT'; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
data-placement="top"
title="<?php echo $hesklang['background_hover_color']; ?>"
@@ -4063,9 +4048,9 @@ $modsForHesk_settings = mfh_getSettings();
</label>

<div class="col-sm-5 col-xs-12">
<input type="text" id="admin-navbar-brand-background-hover-color" name="admin-navbar-brand-background-hover-color"
<input type="text" id="admin-navbar-background-hover-color" name="admin-navbar-background-hover-color"
class="form-control"
value="<?php echo $modsForHesk_settings['admin_navbar_brand_background_hover_color']; ?>">
value="<?php echo $modsForHesk_settings['admin_navbar_background_hover_color']; ?>">
</div>
</div>
</div>

+ 84
- 33
install/mods-for-hesk/sql/installSql.php View File

@@ -1024,53 +1024,104 @@ function execute310Scripts() {
$theme = $theme_preset_row['Value'];
}

$light_theme = preg_match('/.*-light/g', $theme);
$navbar = array(
'background' => '',
'text' => '',
'text_hover' => '',
'text' => '#fff',
'text_hover' => '#fff',
'background_hover' => ''
);
$navbar_brand = array(
'background' => '',
'text' => '',
'text_hover' => '',
'text' => '#fff',
'text_hover' => '#fff',
'background_hover' => ''
);
$sidebar = array(
'background' => '',
'text' => '',
'text_hover' => '',
'background_hover' => ''
'background' => $light_theme ? '#f9fafc' : '#222d32',
'text' => $light_theme ? '#444' : '#b8c7ce',
'text_hover' => $light_theme ? '#444' : '#b8c7ce',
'background_hover' => $light_theme ? '#f4f4f5' : '#1e282c',
'font_weight' => $light_theme ? '600' : 'normal'
);
$sidebar_header = array(
'background' => '',
'text' => '',
'text_hover' => '',
'background_hover' => ''
'background' => $light_theme ? '#f9fafc' : '#1a2226',
'text' => $light_theme ? '#848484' : '#4b646f',
'text_hover' => $light_theme ? '#848484' : '#4b646f',
'background_hover' => $light_theme ? '#f9fafc': '#1a2226'
);
if ($theme == 'skin-blue') {
$navbar['background'] = '';
$navbar['text'] = '';
$navbar['text_hover'] = '';
$navbar['background_hover'] = '';

$navbar_brand['background'] = '';
$navbar_brand['text'] = '';
$navbar_brand['text_hover'] = '';
$navbar_brand['background_hover'] = '';

$sidebar['background'] = '';
$sidebar['text'] = '';
$sidebar['text_hover'] = '';
$sidebar['background_hover'] = '';

$sidebar_header['background'] = '';
$sidebar_header['text'] = '';
$sidebar_header['text_hover'] = '';
$sidebar_header['background_hover'] = '';
} elseif ($theme = 'skin-blue-light') {
if (preg_match('/skin-blue.*/g', $theme)) {
$navbar['background'] = '#3c8dbc';
$navbar['background_hover'] = '#367fa9';

$navbar_brand['background'] = $light_theme ? '#3c8dbc' : '#367fa9';
$navbar_brand['background_hover'] = $light_theme ? '#3b8ab8' : '#367fa9';
} elseif (preg_match('/skin-yellow.*/g', $theme)) {
$navbar['background'] = '#f39c12';
$navbar['background_hover'] = '#da8c10';

$navbar_brand['background'] = $light_theme ? '#f39c12' : '#e08e0b';
$navbar_brand['background_hover'] = $light_theme ? '#f39a0d' : '#db8b0b';
} elseif (preg_match('/skin-green.*/g', $theme)) {
$navbar['background'] = '#00a65a';
$navbar['background_hover'] = '#009551';

$navbar_brand['background'] = $light_theme ? '#00a65a' : '#008d4c';
$navbar_brand['background_hover'] = $light_theme ? '#00a157' : '#008749';
} elseif (preg_match('/skin-purple.*/g', $theme)) {
$navbar['background'] = '#605ca8';
$navbar['background_hover'] = '#565397';

$navbar_brand['background'] = $light_theme ? '#605ca8' : '#555299';
$navbar_brand['background_hover'] = $light_theme ? '#5d59a6' : '#545096';
} elseif (preg_match('/skin-red.*/g', $theme)) {
$navbar['background'] = '#dd4b39';
$navbar['background_hover'] = '#c64333';

$navbar_brand['background'] = $light_theme ? '#dd4b39' : '#d73925';
$navbar_brand['background_hover'] = $light_theme ? '#dc4735' : '#d33724';
} else {
$navbar['background'] = '#fff';
$navbar['background_hover'] = '#eee';

$navbar_brand['background'] = '#fff';
$navbar_brand['background_hover'] = '#fcfcfc';
}

executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_background_color', '{$navbar['background']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_background_color_hover', '{$navbar['background_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_text', '{$navbar['text']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_text_hover', '{$navbar['text_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_brand_background', '{$navbar_brand['background']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_brand_background_hover', '{$navbar_brand['background_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_brand_text', '{$navbar_brand['text']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_navbar_brand_text_hover', '{$navbar_brand['text_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_background', '{$sidebar['background']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_background_hover', '{$sidebar['background_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_text', '{$sidebar['text']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_text_hover', '{$sidebar['text_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_font_weight', '{$sidebar['font_weight']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_header_background', '{$sidebar_header['background']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_header_background_hover', '{$sidebar_header['background_hover']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_text', '{$sidebar_header['text']}')");
executeQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings` (`Key`, `Value`)
VALUES ('admin_sidebar_text_hover', '{$sidebar_header['text_hover']}')");

updateVersion('3.1.0');
}

+ 1
- 1
language/en/text.php View File

@@ -2134,7 +2134,7 @@ $hesklang['category_display_border_help'] = 'Choose to decide whether or not to
This is ignored if foreground color is set to automatic.</b>';
$hesklang['login_page'] = 'Login Page'; // Header on admin settings page
$hesklang['login_background'] = 'Login Background';
$hesklang['solid_color'] = 'Solid Color';
$hesklang['solid_color'] = 'Solid color';
$hesklang['login_background_color'] = 'Login Background Color'; // Input field information for screen-readers. Does not appear on-screen
$hesklang['login_background_image'] = 'Login Background Image'; // Input field information for screen-readers. Does not appear on-screen
$hesklang['login_box_header'] = 'Login Box Header';

Loading…
Cancel
Save