diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 6638a4c1a04..e27d9513637 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -964,4 +964,5 @@ SelectAThirdPartyFirst=Select a third party first...
YouAreCurrentlyInSandboxMode=You are currently in the %s "sandbox" mode
Inventory=Inventory
AnalyticCode=Analytic code
-TMenuMRP=MRP
\ No newline at end of file
+TMenuMRP=MRP
+ShowMoreInfos=Show More Infos
\ No newline at end of file
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 109d0f5f1fe..7bd083cd682 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1582,7 +1582,10 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
}
}
- print '
'."\n";
+ $loginBlockMoreClass = '';
+ if(!empty($conf->global->MAIN_TOP_MENU_DROPDOWN)){ $loginBlockMoreClass = 'usedropdown'; }
+
+ print '
'."\n";
// Add login user link
$toprightmenu.='
';
@@ -1590,7 +1593,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";
@@ -1683,8 +1692,9 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
}
}
+
// Logout link
- $toprightmenu.=@Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem', 2);
+ $toprightmenu.=@Form::textwithtooltip('', $logouthtmltext, 2, 1, $logouttext, 'login_block_elem logout-btn', 2);
$toprightmenu.='
';
@@ -1702,6 +1712,141 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
}
+
+function top_menu_user(user $user, $langs){
+ global $langs, $conf, $db, $hookmanager, $user;
+ global $dolibarr_main_authentication, $dolibarr_main_demo;
+ global $menumanager;
+
+ $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);
+ }
+
+ $dropdownBody = '';
+
+
+ $dropdownBody.= '';
+ $dropdownBody.= '';
+
+ // Execute hook
+ $parameters=array('user'=>$user, 'langs' => $langs);
+ $result=$hookmanager->executeHooks('printTopRightMenuLoginDropdownBody', $parameters); // Note that $action and $object may have been modified by some hooks
+ if (is_numeric($result))
+ {
+ if ($result == 0){
+ $dropdownBody.= $hookmanager->resPrint; // add
+ }
+ else{
+ $dropdownBody = $hookmanager->resPrint; // replace
+ }
+ }
+
+
+
+ $logoutLink ='';
+ $profilLink ='';
+
+
+ $profilName = $user->getFullName($langs).' ('.$user->login.')';
+
+ if($user->admin){
+ $profilName = '
'.$profilName;
+ }
+
+ $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..b92fd40c597
--- /dev/null
+++ b/htdocs/theme/eldy/dropdown.css.php
@@ -0,0 +1,169 @@
+
+/*