diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 5b4efadbe7f..e29f90b9f62 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2261,14 +2261,17 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead $toprightmenu .= top_menu_search(); } + // Add AI picto + $toprightmenu .= top_menu_ai(); + + // Add bookmark dropdown + $toprightmenu .= top_menu_bookmark(); + if (getDolGlobalString('MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN')) { // Add the quick add object dropdown $toprightmenu .= top_menu_quickadd(); } - // Add bookmark dropdown - $toprightmenu .= top_menu_bookmark(); - if (getDolGlobalString('MAIN_USE_TOP_MENU_IMPORT_FILE')) { // Add the import file link $toprightmenu .= top_menu_importfile(); @@ -2710,6 +2713,33 @@ function top_menu_user($hideloginname = 0, $urllogout = '') return $btnUser; } +/** + * Build the tooltip on top menu quick add. + * Called when option MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN is set + * + * @return string HTML content + */ +function top_menu_ai() +{ + global $conf, $langs; + + // Button disabled on text browser + /*if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { + return ''; + }*/ + + $html = ''; + + if (isModEnabled('ai')) { + $html .= ' +
'; + } + + return $html; +} + /** * Build the tooltip on top menu quick add. * Called when option MAIN_USE_TOP_MENU_QUICKADD_DROPDOWN is set @@ -2727,17 +2757,10 @@ function top_menu_quickadd() $html = ''; - if (isModEnabled('ai')) { - $html .= ' - '; - } - if (!empty($conf->use_javascript_ajax)) { $html .= ' '; if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) { // This may be set by some pages that use different jquery version to avoid errors diff --git a/htdocs/theme/md/dropdown.inc.php b/htdocs/theme/md/dropdown.inc.php index deaa85a8578..8776970fd8d 100644 --- a/htdocs/theme/md/dropdown.inc.php +++ b/htdocs/theme/md/dropdown.inc.php @@ -51,7 +51,7 @@ button.dropdown-item.global-search-item { display: block; } - +#topmenu-tool a, #topmenu-global-search-dropdown a.login-dropdown-a, #topmenu-quickadd-dropdown a.login-dropdown-a, #topmenu-bookmark-dropdown a.login-dropdown-a,