From d2c55330e9d312479152bf2ab94cbc4e257ba520 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Aug 2016 23:34:59 +0200 Subject: [PATCH] NEW Add option "Hide images in Top menu". --- ChangeLog | 2 +- htdocs/admin/ihm.php | 6 +++- htdocs/core/lib/usergroups.lib.php | 48 +++++++++++++++++++++++++++++- htdocs/langs/en_US/admin.lang | 3 +- htdocs/theme/eldy/style.css.php | 8 +++-- htdocs/theme/md/style.css.php | 2 +- 6 files changed, 61 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd4096f4a36..68ccd4e50df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -946,7 +946,7 @@ NEW: add hook in send mail NEW: Add hooks on list of members to allow an external module to add more fields into list view. NEW: Add hooks to allow an external module to complete list of events into calendar views. NEW: Add opportunity amount on project card. -NEW: Add option THEME_ELDY_DISABLE_IMAGE to disable images into menu eldy. +NEW: Add option THEME_TOPMENU_DISABLE_IMAGE to disable images into menu eldy. NEW: add PDF icon on linked element into project NEW: add "productpricecard" hook and uniformize code NEW: Add ref and label of project into export diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index cc1e1792f01..cb8ac8a599a 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -78,8 +78,12 @@ if ($action == 'update') $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', implode(',',colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())),'chaine',0,'',$conf->entity); + $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); + if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity); + $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity); else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', implode(',',colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())),'chaine',0,'',$conf->entity); diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 5ea489c1212..26a7455bf62 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -296,7 +296,7 @@ function entity_prepare_head($object, $aEntities) */ function show_theme($fuser,$edit=0,$foruserprofile=false) { - global $conf,$langs,$db; + global $conf,$langs,$db,$form; global $bc; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; @@ -515,6 +515,52 @@ function show_theme($fuser,$edit=0,$foruserprofile=false) print ''; } + // TopMenuBackgroundColor + if ($foruserprofile) + { + /*$var=!$var; + print ''; + print ''.$langs->trans("TopMenuBackgroundColor").''; + print ''.($conf->global->THEME_ELDY_TOPMENU_BACK1?$conf->global->THEME_ELDY_TOPMENU_BACK1:$langs->trans("Default")).''; + print 'conf->THEME_ELDY_TOPMENU_BACK1)?" 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_TOPMENU_BACK1,array()),''),'THEME_ELDY_TOPMENU_BACK1','formcolor',1).' '; + } + else + { + $color = colorArrayToHex(colorStringToArray($conf->global->THEME_ELDY_TOPMENU_BACK1,array()),''); + if ($color) print ''; + else print ''; + } + if ($edit) print '
('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print '';*/ + } + else + { + $default=$langs->trans('No'); + $var=!$var; + print ''; + print ''.$langs->trans("TopMenuDisableImages").''; + print ''; + if ($edit) + { + print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1); + } + else + { + print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE); + } + print '   ('.$langs->trans("Default").': '.$default.', '.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')'; + print ''; + } + + + + // BackgroundTableTitleColor if ($foruserprofile) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 9b62f7f4a3b..1e2e3e68291 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1548,9 +1548,10 @@ HighlightLinesColor=Highlight color of the line when the mouse passes over (keep TextTitleColor=Color of page title LinkColor=Color of links PressF5AfterChangingThis=Press F5 on keyboard after changing this value to have it effective -NotSupportedByAllThemes=Will works with eldy theme but is not supported by all themes +NotSupportedByAllThemes=Will works with core themes, may not be supported by external themes BackgroundColor=Background color TopMenuBackgroundColor=Background color for Top menu +TopMenuDisableImages=Hide images in Top menu LeftMenuBackgroundColor=Background color for Left menu BackgroundTableTitleColor=Background color for Table title line BackgroundTableLineOddColor=Background color for odd table lines diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5602b109b4f..be38ec586b4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -932,7 +932,7 @@ $heightmenu=46; /* height of top menu, part with image */ $heightmenu2=48; /* height of top menu, part with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_ELDY_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } +if (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } ?> div#id-top { @@ -940,6 +940,8 @@ div#id-top { display:none; background: rgb(); + -webkit-box-shadow: 0 0 13px rgba(0,0,0,0.2); + box-shadow: 0 0 13px rgba(0,0,0,0.2); background-image: linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); background-image: -o-linear-gradient(top, rgba(255,255,255,.1) 0%, rgba(0,0,0,.4) 100%); @@ -1354,7 +1356,7 @@ div.login_block { position: absolute; text-align: right; : 5px; - top: 2px; + top: 3px; font-weight: bold; max-width: px; @@ -2833,7 +2835,7 @@ span.boxstatstext { line-height: 18px; } span.boxstatsindicator { - font-size: 110%; + font-size: 130%; font-weight: normal; } span.dashboardlineindicator, span.dashboardlineindicatorlate { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d8855714c06..452640ddd9c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -972,7 +972,7 @@ $heightmenu=48; /* height of top menu, part with image */ $heightmenu2=48; /* height of top menu, ârt with login */ $disableimages = 0; $maxwidthloginblock = 110; -if (! empty($conf->global->THEME_MD_DISABLE_IMAGE)) { $heightmenu = 30; $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } +if (! empty($conf->global->THEME_TOPMENU_DISABLE_IMAGE)) { $heightmenu = 30; $disableimages = 1; $maxwidthloginblock = 180; $minwidthtmenu=0; } ?> div#tmenu_tooltip {