From 56ffe0b93735c0e0ce8d6065ca7b537491c8d4ea Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Sat, 30 Aug 2014 06:31:14 +0000 Subject: [PATCH] Enhanced Theme: Restored displaying domain name in header, can control visibility and style using Default Settings. --- .../default_settings/default_setting_edit.php | 2 + resources/functions.php | 25 +++++++++++ themes/enhanced/app_defaults.php | 34 +++++++++++++-- themes/enhanced/template.php | 42 +++++++++++++++---- 4 files changed, 91 insertions(+), 12 deletions(-) diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index 64b480d7e2..8db6f6b740 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -416,6 +416,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { elseif ( $category == "theme" && $subcategory == "background_color" && $name == "array" || $category == "theme" && $subcategory == "login_background_color" && $name == "text" || + $category == "theme" && $subcategory == "domain_color" && $name == "text" || + $category == "theme" && $subcategory == "domain_background_color" && $name == "text" || $category == "theme" && $subcategory == "footer_color" && $name == "text" || $category == "theme" && $subcategory == "footer_background_color" && $name == "text" || $category == "theme" && $subcategory == "message_default_background_color" && $name == "text" || diff --git a/resources/functions.php b/resources/functions.php index d3a66476a5..5397c30889 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1070,4 +1070,29 @@ function number_pad($number,$n) { } } +//function to convert hexidecimal color value to rgb value + if (!function_exists('hex2rgb')) { + function hex2rgb($hex, $delim = '') { + $hex = str_replace("#", "", $hex); + + if (strlen($hex) == 3) { + $r = hexdec(substr($hex,0,1).substr($hex,0,1)); + $g = hexdec(substr($hex,1,1).substr($hex,1,1)); + $b = hexdec(substr($hex,2,1).substr($hex,2,1)); + } + else { + $r = hexdec(substr($hex,0,2)); + $g = hexdec(substr($hex,2,2)); + $b = hexdec(substr($hex,4,2)); + } + $rgb = array($r, $g, $b); + + if ($delim != '') { + return implode($delim, $rgb); // return rgb delimited string + } + else { + return $rgb; // return array of rgb values + } + } + } ?> diff --git a/themes/enhanced/app_defaults.php b/themes/enhanced/app_defaults.php index 6704495ff2..5821812682 100644 --- a/themes/enhanced/app_defaults.php +++ b/themes/enhanced/app_defaults.php @@ -40,21 +40,49 @@ if ($domains_processed == 1) { $array[$x]['default_setting_name'] = 'text'; $array[$x]['default_setting_value'] = '#ffffff'; $array[$x]['default_setting_enabled'] = 'true'; - $array[$x]['default_setting_description'] = 'Set a background color (HTML compatible) for the login box.'; + $array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the login box.'; + $x++; + $array[$x]['default_setting_category'] = 'theme'; + $array[$x]['default_setting_subcategory'] = 'domain_visible'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = 'true'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Set the visibility of the name of the domain currently being managed.'; + $x++; + $array[$x]['default_setting_category'] = 'theme'; + $array[$x]['default_setting_subcategory'] = 'domain_color'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = '#000000'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Set the text color for domain name.'; + $x++; + $array[$x]['default_setting_category'] = 'theme'; + $array[$x]['default_setting_subcategory'] = 'domain_background_color'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = '#000000'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Set the background color (hexidecimal) for the domain name.'; + $x++; + $array[$x]['default_setting_category'] = 'theme'; + $array[$x]['default_setting_subcategory'] = 'domain_background_opacity'; + $array[$x]['default_setting_name'] = 'text'; + $array[$x]['default_setting_value'] = '0.1'; + $array[$x]['default_setting_enabled'] = 'true'; + $array[$x]['default_setting_description'] = 'Set the background opacity of the domain name.'; $x++; $array[$x]['default_setting_category'] = 'theme'; $array[$x]['default_setting_subcategory'] = 'footer_background_color'; $array[$x]['default_setting_name'] = 'text'; $array[$x]['default_setting_value'] = '#000000'; $array[$x]['default_setting_enabled'] = 'true'; - $array[$x]['default_setting_description'] = 'Set a background color (HTML compatible) for the footer bar.'; + $array[$x]['default_setting_description'] = 'Set the background color (HTML compatible) for the footer bar.'; $x++; $array[$x]['default_setting_category'] = 'theme'; $array[$x]['default_setting_subcategory'] = 'footer_color'; $array[$x]['default_setting_name'] = 'text'; $array[$x]['default_setting_value'] = '#ffffff'; $array[$x]['default_setting_enabled'] = 'true'; - $array[$x]['default_setting_description'] = 'Set a foreground color (HTML compatible) for the footer bar.'; + $array[$x]['default_setting_description'] = 'Set the foreground color (HTML compatible) for the footer bar.'; $x++; $array[$x]['default_setting_category'] = 'theme'; $array[$x]['default_setting_subcategory'] = 'footer_opacity'; diff --git a/themes/enhanced/template.php b/themes/enhanced/template.php index d485082cac..1a03836e0a 100644 --- a/themes/enhanced/template.php +++ b/themes/enhanced/template.php @@ -825,12 +825,17 @@ legend { color: ; } + #header_icons { + display: inline-block; + margin-top: 10px; + } + #logout_icon { filter: alpha(opacity=80); opacity: 0.8; -moz-opacity: 0.8; -khtml-opacity: 0.8; - margin-left: 17px; + margin-left: 6px; } #logout_icon:hover { @@ -846,7 +851,7 @@ legend { opacity: 0.8; -moz-opacity: 0.8; -khtml-opacity: 0.8; - margin-left: 17px; + padding-left: 10px; } #domain_selector_icon:hover { @@ -857,6 +862,24 @@ legend { cursor: pointer; } + #domain_selector_domain { + display: ; + white-space: nowrap; + margin-top: 10px; + padding: 3px 7px 1px 7px; + margin-top: -1px; + background-color: rgba(, ); + -webkit-border-radius: 1px; + -moz-border-radius: 1px; + border-radius: 1px; + font-size: 10px; + color: ; + } + + #domain_selector_domain:hover { + cursor: pointer; + } + #domains_container { z-index: 99990; position: absolute; @@ -965,6 +988,7 @@ legend {