2008-02-05 17:11:21 +01:00
|
|
|
var LSform = new Class({
|
|
|
|
initialize: function(){
|
2008-07-15 18:24:35 +02:00
|
|
|
this._modules=[];
|
2008-10-15 19:40:04 +02:00
|
|
|
this._elements=[];
|
|
|
|
|
|
|
|
this.objecttype = $('LSform_objecttype').value,
|
|
|
|
this.objectdn = $('LSform_objectdn').value,
|
|
|
|
this.idform = $('LSform_idform').value,
|
|
|
|
|
|
|
|
this.initializeLSform();
|
2008-07-15 18:24:35 +02:00
|
|
|
},
|
|
|
|
|
2008-10-15 19:40:04 +02:00
|
|
|
initializeLSform: function(el) {
|
|
|
|
this.LStips = new Tips('.LStips');
|
2008-07-15 18:24:35 +02:00
|
|
|
if (typeof(el) == 'undefined') {
|
|
|
|
el = document;
|
|
|
|
}
|
2008-10-15 19:40:04 +02:00
|
|
|
el.getElements('ul.LSform').each(function(ul) {
|
|
|
|
this._elements[ul.id] = new LSformElement(this,ul.id,ul);
|
2008-02-08 18:39:24 +01:00
|
|
|
}, this);
|
2008-02-26 18:40:05 +01:00
|
|
|
},
|
|
|
|
|
2008-07-15 18:24:35 +02:00
|
|
|
addModule: function(name,obj) {
|
|
|
|
this._modules[name]=obj;
|
|
|
|
},
|
|
|
|
|
2008-10-15 19:40:04 +02:00
|
|
|
initializeModule: function(fieldType,li) {
|
|
|
|
if ($type(this._modules[fieldType])) {
|
|
|
|
try {
|
|
|
|
this._modules[fieldType].reinitialize(li);
|
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
LSdebug('Pas de reinitialise pour ' + fieldType);
|
2008-07-15 18:24:35 +02:00
|
|
|
}
|
2008-02-08 18:39:24 +01:00
|
|
|
}
|
|
|
|
}
|
2008-02-05 17:11:21 +01:00
|
|
|
});
|
|
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
2008-02-08 18:39:24 +01:00
|
|
|
varLSform = new LSform();
|
2008-02-05 17:11:21 +01:00
|
|
|
});
|