- Ajout d'une possibilité de positionnement de LStips sur des elements :

-> LSsession : ajout de la méthode addHelpInfos()
	-> LSdefault : ajout des méthodes addHelpInfo() et setHelpInfo()
	-> LSform : ajout des méthodes addTip() et removeTip()
	-> Ceci répond globalement à la feature request #1730
This commit is contained in:
Benjamin Renard 2008-11-10 02:10:42 +00:00
parent 9ed7425d0c
commit 8ed72e7613
3 changed files with 54 additions and 0 deletions

View file

@ -1554,6 +1554,26 @@ class LSsession {
function getEmailSender() { function getEmailSender() {
return $this -> ldapServer['emailSender']; 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;
}
}
}
} }
?> ?>

View file

@ -178,6 +178,31 @@ var LSdefault = new Class({
return this.LSjsConfig[name]; return this.LSjsConfig[name];
} }
return new Hash(); 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]);
}
}
}
}
} }
}); });

View file

@ -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() { window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSform = new LSform(); varLSform = new LSform();