diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4a85cd8ddab..52f360d57a5 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1602,7 +1602,13 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead // Login name with photo and tooltip $mode=-1; $toprightmenu.='
'; - $toprightmenu.=$user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin'); + + if(empty($conf->global->MAIN_TOP_MENU_DROPDOWN)){ + $toprightmenu.=$user->getNomUrl($mode, '', 1, 0, 11, 0, ($user->firstname ? 'firstname' : -1), 'atoplogin'); + } + else{ + $toprightmenu.= top_menu_user($user, $langs); + } $toprightmenu.='
'; $toprightmenu.=''."\n"; @@ -1714,6 +1720,68 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead } + +function top_menu_user(user $user, $langs){ + + $userImage = $userDropDownImage = ''; + if (! empty($user->photo)) + { + $userImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'photouserphoto userphoto', 'small', 0, 1); + $userDropDownImage = Form::showphoto('userphoto', $user, 0, 0, 0, 'dropdown-user-image', 'small', 0, 1); + } + + + $btnUser = ' + + '; + + + return $btnUser; +} + /** * Show left menu bar * diff --git a/htdocs/theme/eldy/_dropdown.css.php b/htdocs/theme/eldy/_dropdown.css.php new file mode 100644 index 00000000000..c6ad165fc00 --- /dev/null +++ b/htdocs/theme/eldy/_dropdown.css.php @@ -0,0 +1,101 @@ + +/*