2 /*******************************************************************************
3 * Copyright (C) 2007 Easter-eggs
4 * http://ldapsaisie.labs.libre-entreprise.org
6 * Author: See AUTHORS file in top-level directory.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 ******************************************************************************/
24 * Type d'attribut HTML image
26 * @author Benjamin Renard <brenard@easter-eggs.com>
28 class LSattr_html_image extends LSattr_html {
31 * Ajoute l'attribut au formualaire passer en paramètre
33 * @param[in] &$form LSform Le formulaire
34 * @param[in] $idForm L'identifiant du formulaire
35 * @param[in] $data Valeur du champs du formulaire
37 * @retval LSformElement L'element du formulaire ajouté
39 function addToForm (&$form,$idForm,$data=NULL) {
40 $element=$form -> addElement('image', $this -> name, $this -> config['label'],$this -> config, $this);
42 LSerror :: addErrorCode('LSform_06',$this -> name);
47 LSerror :: addErrorCode('LSattr_html_03','password');
52 $element -> setValue($data[0]);
55 $element -> setValue($data);