*/ class LSformElement_select_object extends LSformElement { /** * Retourn les infos d'affichage de l'élément * * Cette méthode retourne les informations d'affichage de l'élement * * @retval array */ function getDisplay($refresh=NULL){ $GLOBALS['LSsession'] -> addCssFile('LSformElement_select_object.css'); if ($refresh) { $this -> values = $this -> attr_html -> getValuesFromSession(); } $return = $this -> getLabelInfos(); // value $params=array(); if (!$this -> isFreeze()) { $params['attr_name'] = $this -> name; $params['object_type'] = $this -> selectableObject; $params['addBtn'] = _('Modifier'); $params['deleteBtns'] = _('Supprimer'); $params['multiple'] = ($this -> params['multiple'])?1:0; $params['noValueLabel'] = _('Aucune valeur definie'); } $ul_id="LSformElement_select_object_".$this -> name; $params['freeze'] = $this -> isFreeze(); $GLOBALS['LSsession'] -> addJSconfigParam($ul_id,$params); $return['html']="\n"; if (!$this -> isFreeze()) { $GLOBALS['LSsession'] -> addJSscript('LSformElement_select_object_field.js'); $GLOBALS['LSsession'] -> addJSscript('LSformElement_select_object.js'); $GLOBALS['LSsession'] -> addJSscript('LSform.js'); $GLOBALS['LSsession'] -> addJSscript('LSselect.js'); $GLOBALS['LSsession'] -> addCssFile('LSselect.css'); $GLOBALS['LSsession'] -> addJSscript('LSsmoothbox.js'); $GLOBALS['LSsession'] -> addCssFile('LSsmoothbox.css'); $GLOBALS['LSsession'] -> addJSscript('LSconfirmBox.js'); $GLOBALS['LSsession'] -> addCssFile('LSconfirmBox.css'); } return $return; } /** * Défini le type d'objet sélectionnable * * @param[in] $object string Le type d'object * * @retval void **/ function setSelectableObject($object) { $this -> selectableObject = $object; } /** * Exporte les valeurs de l'élément * * @retval Array Les valeurs de l'élement */ function exportValues(){ $retval=array(); if (is_array($this -> values)) { foreach($this -> values as $val => $name) { $retval[] = $val; } } return $retval; } } ?>