);
$GLOBALS['Smarty'] -> assign('LSform_object',$LSform_object);
- if (is_array($GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout'])) {
- $GLOBALS['Smarty'] -> assign('LSform_layout',$GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout']);
+ $layout_config=LSconfig :: get("LSobjects.".$LSform_object['type'].".LSform.layout");
+ if (is_array($layout_config)) {
+ $GLOBALS['Smarty'] -> assign('LSform_layout',$layout_config);
$GLOBALS['Smarty'] -> assign('LSform_layout_nofield_label',_('No field.'));
}
}
$GLOBALS['Smarty'] -> assign('LSform_fields',$fields);
- if (is_array($GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout'])) {
- $GLOBALS['Smarty'] -> assign('LSform_layout',$GLOBALS['LSobjects'][$LSform_object['type']]['LSform']['layout']);
+ $layout_config=LSconfig :: get("LSobjects.".$LSform_object['type'].".LSform.layout");
+ if (is_array($layout_config)) {
+ $GLOBALS['Smarty'] -> assign('LSform_layout',$layout_config);
$GLOBALS['Smarty'] -> assign('LSform_layout_nofield_label',_('No field.'));
}
}
LSsession :: addCssFile('theme.css',LS_LIB_DIR.'jscalendar/skins/aqua/');
LSsession :: addJSscript('calendar.js',LS_LIB_DIR.'jscalendar/');
LSsession :: addJSscript('calendar-en.js',LS_LIB_DIR.'jscalendar/lang/');
- $codeLang = strtolower($GLOBALS['LSconfig']['lang'][0].$GLOBALS['LSconfig']['lang'][1]);
+ $codeLang = LSsession :: getLang(true);
LSsession :: addJSscript('calendar-'.$codeLang.'.js',LS_LIB_DIR.'jscalendar/lang/');
LSsession :: addJSscript('LSformElement_date_field.js');
LSsession :: addJSscript('LSformElement_date.js');
* )
*/
public static function getEntry($object_type,$dn) {
- if(isset($GLOBALS['LSobjects'][$object_type])){
- $obj_conf=$GLOBALS['LSobjects'][$object_type];
+ $obj_conf=LSconfig :: get('LSobjects.'.$object_type);
+ if(is_array($obj_conf)){
$entry = self :: $cnx -> getEntry($dn);
if (Net_LDAP2::isError($entry)) {
//$newentry = new Net_LDAP2_Entry(&self :: $cnx);
*/
function LSldapObject() {
$this -> type_name = get_class($this);
- if(is_array($GLOBALS['LSobjects'][$this -> type_name])) {
- $this -> config = $GLOBALS['LSobjects'][$this -> type_name];
+ $config = LSconfig :: get('LSobjects.'.$this -> type_name);
+ if(is_array($config)) {
+ $this -> config = $config;
}
else {
LSerror :: addErrorCode('LSldapObject_01');
*/
function getPatternFilter($pattern=null,$approx=null) {
if ($pattern!=NULL) {
- if (is_array($GLOBALS['LSobjects'][$this -> getType()]['LSsearch']['attrs'])) {
- $attrs=$GLOBALS['LSobjects'][$this -> getType()]['LSsearch']['attrs'];
+ if (is_array($this -> config['LSsearch']['attrs'])) {
+ $attrs=$this -> config['LSsearch']['attrs'];
}
else {
- $attrs=array($GLOBALS['LSobjects'][$this -> getType()]['rdn']);
+ $attrs=array($this -> config['rdn']);
}
$pfilter='(|';
if ($approx) {
if (is_array(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'])) {
foreach(LSsession :: $ldapServer['subDn']['LSobject'][$this -> getType()]['LSobjects'] as $type) {
if (LSsession :: loadLSobject($type)) {
- if (isset($GLOBALS['LSobjects'][$type]['container_auto_create'])&&isset($GLOBALS['LSobjects'][$type]['container_dn'])) {
- $dn = $GLOBALS['LSobjects'][$type]['container_dn'].','.$this -> getDn();
- if(!LSldap :: getNewEntry($dn,$GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],$GLOBALS['LSobjects'][$type]['container_auto_create']['attrs'],true)) {
+ $conf_type=LSconfig :: get("LSobjects.$type");
+ if (isset($conf_type['container_auto_create'])&&isset($conf_type['container_dn'])) {
+ $dn = $conf_type['container_dn'].','.$this -> getDn();
+ if(!LSldap :: getNewEntry($dn,$conf_type['container_auto_create']['objectclass'],$conf_type['container_auto_create']['attrs'],true)) {
LSdebug("Impossible de créer l'entrée fille : ".print_r(
array(
'dn' => $dn,
- 'objectClass' => $GLOBALS['LSobjects'][$type]['container_auto_create']['objectclass'],
- 'attrs' => $GLOBALS['LSobjects'][$type]['container_auto_create']['attrs']
+ 'objectClass' => $conf_type['container_auto_create']['objectclass'],
+ 'attrs' => $conf_type['container_auto_create']['attrs']
)
,true));
$error=1;
}
return $list;
}
+
+ /**
+ * Retourne la langue courante de la session
+ *
+ * @param[in] boolean Si true, le code langue retourné sera court
+ *
+ * @retval string La langue de la session
+ **/
+ public static function getLang($short=false) {
+ if ($short) {
+ return strtolower(self :: $lang[0].self :: $lang[1]);
+ }
+ return self :: $lang;
+ }
/**
* Vérifie si une locale est disponible
* Définition du serveur Ldap de la session
*
* Définition du serveur Ldap de la session à partir de son ID dans
- * le tableau $GLOBALS['LSconfig']['ldap_servers'].
+ * le tableau LSconfig :: get('ldap_servers').
*
* @param[in] integer Index du serveur Ldap
*
$approx = false;
$selectedTopDn = LSsession :: getTopDn();
$orderby = false;
- $_REQUEST['orderby']=$GLOBALS['LSobjects'][$LSobject]['orderby'];
+ $_REQUEST['orderby']=LSconfig :: get("LSobjects.$LSobject.orderby");
$ordersense = 'ASC';
$subDnLdapServer = LSsession :: getSubDnLdapServer();
$doSubDn = (($subDnLdapServer)&&(!LSsession :: isSubDnLSobject($LSobject)));
$recur = false;
$approx = false;
$orderby = false;
- $_REQUEST['orderby']=$GLOBALS['LSobjects'][$LSobject]['orderby'];
+ $_REQUEST['orderby']=LSconfig :: get("LSobjects.$LSobject.orderby");
$ordersense = 'ASC';
$subDnLdapServer = LSsession :: getSubDnLdapServer();
$doSubDn = (($subDnLdapServer)&&(!LSsession :: isSubDnLSobject($LSobject)));