From 8c93facb3a7ec0fb0e7f305716a707c03a554369 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Dec 2005 20:53:18 +0000 Subject: [PATCH] =?UTF-8?q?Modif=20pour=20mieux=20g=E9rer=20l'activation?= =?UTF-8?q?=20ou=20d=E9sactivation=20de=20code=20javascript.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/html.form.class.php | 35 ++++++++++++++++++++++++++++++++++- htdocs/main.inc.php | 2 +- htdocs/user/perms.php | 1 + 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index c9b3fa791e7..af67f6a3850 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -50,7 +50,6 @@ class Form \brief Constructeur \param DB handler d'accès base de donnée */ - function Form($DB) { $this->db = $DB; @@ -58,6 +57,40 @@ class Form return 1; } + /** + \brief Retourne propriétés pour affichae d'un tooltip + \param htmltooltip Contenu html du tooltip + \return string Chaine des propriétés de declenchement du tooltip + */ + function tooltip_properties($htmltooltip='Text for tooltip') + { + global $conf; + $s =''; + if ($conf->use_javascript) + { + $s.=' onmouseover="showtip(\''.$htmltooltip.'\')"'; + $s.=' onMouseout="hidetip()"'; + } + return $s; + } + + /** + \brief Efface champ alt et title pour permettre utiliser dans un tooltip + \param string Chaine a nettoyer + \return string Chaine nettoyé + */ + function tooltip_sanitize($string) + { + global $conf; + if ($conf->use_javascript) + { + // Supprime alt et title de text pour eviter conflit avec tooltip + $string=eregi_replace('alt="[^"]+"','',$string); + $string=eregi_replace('title="[^"]+"','',$string); + } + return $string; + } + /** * \brief Retourne la liste déroulante des départements/province/cantons tout pays confondu ou pour un pays donné. * \remarks Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d6689c1612a..a240675cc71 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -533,7 +533,7 @@ function llxFooter($foot='') } // Juste pour éviter bug IE qui réorganise mal div précédents si celui-ci absent - print "\n".'
nbsp;
'."\n"; + print "\n".'
 
'."\n"; print "\n"; print "\n"; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index f15eca3c9e1..53c4c92572c 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -313,4 +313,5 @@ if ($_GET["id"]) $db->close(); llxFooter('$Date$ - $Revision$'); + ?>