*/ class LSformElement_boolean extends LSformElement { /** * Retourne les infos d'affichage de l'élément * * Cette méthode retourne les informations d'affichage de l'élement * * @retval array */ function getDisplay(){ $return = $this -> getLabelInfos(); // value if (!$this -> isFreeze()) { $return['html'] = "\n"; $GLOBALS['LSsession'] -> addJSscript('LSformElement_boolean.js'); } else { $return['html'] = "\n"; } return $return; } /** * Retourne le code HTML d'un champ vide * * @retval string Code HTML d'un champ vide. */ function getEmptyField() { return " "._('Oui')." "._('Non'); } /** * Determine si la valeur passé en paramètre correspond a True ou non * * - true = si $data[] contient un champ à 1 * - false = sinon * * @param[in] $data La valeur de l'attribut * * @retval boolean True ou False */ function isTrue($data) { if(!is_array($data)) { $data=array($data); } if($data[0]=='yes') { return true; } return; } /** * Determine si la valeur passé en paramètre correspond a False ou non * * @param[in] $data La valeur de l'attribut * * @retval boolean True ou False */ function isFalse($data) { if(!is_array($data)) { $data=array($data); } if($data[0]=='no') { return true; } return; } } ?>