diff --git a/trunk/includes/class/class.LSsession.php b/trunk/includes/class/class.LSsession.php index a72c3b98..edb95e46 100644 --- a/trunk/includes/class/class.LSsession.php +++ b/trunk/includes/class/class.LSsession.php @@ -1554,6 +1554,26 @@ class LSsession { function getEmailSender() { return $this -> ldapServer['emailSender']; } + + /** + * Ajout d'une information d'aide + * + * @param[in] $group string Le nom du groupe d'infos dans lequels ajouter + * celle-ci + * @param[in] $infos array Tableau array(name => value) des infos + * + * @retval void + */ + function addHelpInfos($group,$infos) { + if (is_array($infos)) { + if (is_array($this -> _JSconfigParams['helpInfos'][$group])) { + $this -> _JSconfigParams['helpInfos'][$group] = array_merge_recursive($this -> _JSconfigParams['helpInfos'][$group],$infos); + } + else { + $this -> _JSconfigParams['helpInfos'][$group] = $infos; + } + } + } } ?> diff --git a/trunk/includes/js/LSdefault.js b/trunk/includes/js/LSdefault.js index baba7a08..20e90c85 100644 --- a/trunk/includes/js/LSdefault.js +++ b/trunk/includes/js/LSdefault.js @@ -178,6 +178,31 @@ var LSdefault = new Class({ return this.LSjsConfig[name]; } return new Hash(); + }, + + addHelpInfo: function(el,group,name) { + if ($type(this.LSjsConfig['helpInfos'])) { + if ($type(el)=='element') { + if ($type(this.LSjsConfig['helpInfos'][group])) { + if ($type(this.LSjsConfig['helpInfos'][group][name])) { + varLSform.addTip(el); + el.store('tip:title',this.LSjsConfig['helpInfos'][group][name]); + } + } + } + } + }, + + setHelpInfo: function(el,group,name) { + if ($type(this.LSjsConfig['helpInfos'])) { + if ($type(el)=='element') { + if ($type(this.LSjsConfig['helpInfos'][group])) { + if ($type(this.LSjsConfig['helpInfos'][group][name])) { + el.store('tip:title',this.LSjsConfig['helpInfos'][group][name]); + } + } + } + } } }); diff --git a/trunk/includes/js/LSform.js b/trunk/includes/js/LSform.js index a1a95cce..495fe32a 100644 --- a/trunk/includes/js/LSform.js +++ b/trunk/includes/js/LSform.js @@ -223,7 +223,16 @@ var LSform = new Class({ } } } + }, + + addTip: function(el) { + this.LStips.attach(el); + }, + + removeTip: function(el) { + this.LStips.detach(el); } + }); window.addEvent(window.ie ? 'load' : 'domready', function() { varLSform = new LSform();