diff --git a/doc/conf/LSattribute.docbook b/doc/conf/LSattribute.docbook index cedd41ba..0a7bb4e4 100644 --- a/doc/conf/LSattribute.docbook +++ b/doc/conf/LSattribute.docbook @@ -105,7 +105,7 @@ ldap_type - Le type LDAP de l'attribut. + Le type LDAP de l'attribut (facultatif, par défaut: &LSattr_ldap_ascii;). Voir la section concernée. @@ -122,7 +122,7 @@ html_type - Le type HTML de l'attribut. + Le type HTML de l'attribut (facultatif, par défaut: &LSattr_html_text;). Voir la section concernée. diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml b/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml index c58add1a..6ef6146a 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html.entities.xml @@ -28,4 +28,5 @@ LSattr_html_jsonCompositeAttribute"> LSattr_html_sambaAcctFlags"> LSattr_html_select_list"> +LSattr_html_text"> LSattr_html_textarea"> diff --git a/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap.entities.xml b/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap.entities.xml index d7b17854..13129b6e 100644 --- a/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap.entities.xml +++ b/doc/conf/LSattribute/LSattr_ldap/LSattr_ldap.entities.xml @@ -12,5 +12,6 @@ +LSattr_ldap_ascii"> LSattr_ldap_date"> LSattr_ldap_sambaAcctFlags"> diff --git a/src/includes/class/class.LSattribute.php b/src/includes/class/class.LSattribute.php index fe1186b9..0af470a9 100644 --- a/src/includes/class/class.LSattribute.php +++ b/src/includes/class/class.LSattribute.php @@ -65,16 +65,21 @@ class LSattribute extends LSlog_staticLoggerClass { $this -> name = $name; $this -> config = $config; $this -> ldapObject =& $ldapObject; - $html_type = "LSattr_html_".$config['html_type']; - $ldap_type = "LSattr_ldap_".$config['ldap_type']; - LSsession :: loadLSclass($html_type); - LSsession :: loadLSclass($ldap_type); - if((class_exists($html_type))&&(class_exists($ldap_type))) { - $this -> html = new $html_type($name,$config,$this); - $this -> ldap = new $ldap_type($name,$config,$this); + $html_type = $this -> getConfig('html_type', 'text', 'string'); + $html_class = "LSattr_html_".$html_type; + $ldap_type = $this -> getConfig('ldap_type', 'ascii', 'string'); + $ldap_class = "LSattr_ldap_".$ldap_type; + LSsession :: loadLSclass($html_class); + LSsession :: loadLSclass($ldap_class); + if (class_exists($html_class) && class_exists($ldap_class)) { + $this -> html = new $html_class($name, $config, $this); + $this -> ldap = new $ldap_class($name, $config, $this); } else { - LSerror :: addErrorCode('LSattribute_01',array('attr' => $name,'html'=>$config['html_type'],'ldap'=>$config['ldap_type'])); + LSerror :: addErrorCode( + 'LSattribute_01', + array('attr' => $name, 'html'=> $html_type, 'ldap' => $ldap_type) + ); return; } return true;