diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index bc831baeddf..fe4852d839b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -364,7 +364,8 @@ class Form
}
/**
- * Show a text and picto with tooltip on text or picto
+ * Show a text and picto with tooltip on text or picto.
+ * Can be called by an instancied $form->textwithtooltip or by a static call Form::textwithtooltip
*
* @param string $text Text to show
* @param string $htmltext HTML content of tooltip. Must be HTML/UTF8 encoded.
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index d4f27fb3145..ab1a16c9883 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1428,7 +1428,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$menumanager->showmenu('top'); // This contains a \n
print "\n";
- $form=new Form($db);
+ //$form=new Form($db);
// Define link to login card
$appli='Dolibarr';
@@ -1496,11 +1496,11 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
$text ='';
$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer.png', 'class="printer"');
$text.='';
- $toprightmenu.=$form->textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
+ $toprightmenu.=Form::textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2);
}
// Logout link
- $toprightmenu.=$form->textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2);
+ $toprightmenu.=Form::textwithtooltip('',$logouthtmltext,2,1,$logouttext,'login_block_elem',2);
$toprightmenu.='';
@@ -1509,7 +1509,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
print "\n";
print '';
- unset($form);
+ //unset($form);
}
if (empty($conf->dol_use_jmobile) && ! empty($conf->use_javascript_ajax) && ! empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT)) print "\n";