diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 697f8fa2130..ea675ed9001 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -5,6 +5,7 @@ * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2021 Alexandre Spangaro + * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -199,6 +200,13 @@ if ($action == 'update') { } else { dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity); } + + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BTNACTION'), array())))); + if ($val == '') { + dolibarr_del_const($db, 'THEME_ELDY_BTNACTION', $conf->entity); + } else { + dolibarr_set_const($db, 'THEME_ELDY_BTNACTION', $val, 'chaine', 0, '', $conf->entity); + } } if ($mode == 'dashboard') { diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index accbd84ba8c..9ee6afa182e 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2010-2017 Regis Houssin * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2021 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -859,15 +860,15 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) // Use Checked if ($foruserprofile) { /* Must first change option to choose color of highlight instead of yes or no. - print ''; - print ''.$langs->trans("HighlightLinesOnMouseHover").''; - print 'global->THEME_ELDY_USE_HOVER?" checked":"").'>'; - print ' '.$langs->trans("UsePersonalValue").''; - print ''; - print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; - print ''; - print ''; - */ + print ''; + print ''.$langs->trans("HighlightLinesOnMouseHover").''; + print 'global->THEME_ELDY_USE_HOVER?" checked":"").'>'; + print ' '.$langs->trans("UsePersonalValue").''; + print ''; + print '   ('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''; + print ''; + */ } else { $default = (empty($colorbacklinepairchecked) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($colorbacklinepairchecked))); @@ -905,6 +906,52 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) print ''; } + // Btn action + if ($foruserprofile) { + /* + print ''; + print ''.$langs->trans("TopMenuBackgroundColor").''; + print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_BTNACTION:$langs->trans("Default")).''; + print 'conf->THEME_ELDY_BTNACTION)?" checked":""); + print (empty($dolibarr_main_demo) && $edit)?'':' disabled="disabled"'; // Disabled for demo + print '> '.$langs->trans("UsePersonalValue").''; + print ''; + if ($edit) + { + print $formother->selectColor(colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION,array()),''),'THEME_ELDY_BTNACTION','',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION,array()),''); + if ($color) print ''; + else print ''; + } + if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '';*/ + } else { + $default = (empty($butactionbg) ? $langs->trans("Unknown") : colorArrayToHex(colorStringToArray($butactionbg))); + + print ''; + print ''.$langs->trans("BtnActionColor").''; + print ''; + if ($edit) { + print $formother->selectColor(colorArrayToHex(colorStringToArray((!empty($conf->global->THEME_ELDY_BTNACTION) ? $conf->global->THEME_ELDY_BTNACTION : ''), array()), ''), 'THEME_ELDY_BTNACTION', '', 1, '', '', 'colorbtnaction').' '; + } else { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_BTNACTION, array()), ''); + if ($color) { + print ''; + } else { + //print ''; + //print ''.$langs->trans("Default").''; + print $langs->trans("Default"); + } + } + print '   '.$langs->trans("Default").': '.$default.' '; + print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis")); + print ''; + print ''; + } + // Use MAIN_OPTIMIZEFORTEXTBROWSER if ($foruserprofile && !empty($fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) { //$default=yn($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1bf5233f660..99f87413d06 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1917,6 +1917,7 @@ ConfFileMustContainCustom=Installing or building an external module from applica HighlightLinesOnMouseHover=Highlight table lines when mouse move passes over HighlightLinesColor=Highlight color of the line when the mouse passes over (use 'ffffff' for no highlight) HighlightLinesChecked=Highlight color of the line when it is checked (use 'ffffff' for no highlight) +BtnActionColor=Color of the action button TextTitleColor=Text color of Page title LinkColor=Color of links PressF5AfterChangingThis=Press CTRL+F5 on keyboard or clear your browser cache after changing this value to have it effective diff --git a/htdocs/theme/eldy/btn.inc.php b/htdocs/theme/eldy/btn.inc.php index af8f26b9a24..1b92ef80f04 100644 --- a/htdocs/theme/eldy/btn.inc.php +++ b/htdocs/theme/eldy/btn.inc.php @@ -5,17 +5,12 @@ if (!defined('ISLOADEDBYSTEELSHEET')) { /*