2 /* vim: set expandtab tabstop=4 shiftwidth=4: */
3 // +----------------------------------------------------------------------+
5 // +----------------------------------------------------------------------+
6 // | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group |
7 // +----------------------------------------------------------------------+
8 // | This source file is subject to version 2.0 of the PHP license, |
9 // | that is bundled with this package in the file LICENSE, and is |
10 // | available at through the world-wide-web at |
11 // | http://www.php.net/license/2_02.txt. |
12 // | If you did not receive a copy of the PHP license and are unable to |
13 // | obtain it through the world-wide-web, please send a note to |
14 // | license@php.net so we can mail you a copy immediately. |
15 // +----------------------------------------------------------------------+
16 // | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
17 // | Bertrand Mansion <bmansion@mamasam.com> |
18 // +----------------------------------------------------------------------+
21 require_once("HTML/QuickForm/input.php");
24 * HTML class for a image type element
26 * @author Adam Daniel <adaniel1@eesus.jnj.com>
27 * @author Bertrand Mansion <bmansion@mamasam.com>
32 class HTML_QuickForm_image
extends HTML_QuickForm_input
39 * @param string $elementName (optional)Element name attribute
40 * @param string $src (optional)Image source
41 * @param mixed $attributes (optional)Either a typical HTML attribute string
42 * or an associative array
47 function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
49 HTML_QuickForm_input
::HTML_QuickForm_input($elementName, null, $attributes);
50 $this->setType('image');
51 $this->setSource($src);
52 } // end class constructor
58 * Sets source for image element
60 * @param string $src source for image element
65 function setSource($src)
67 $this->updateAttributes(array('src' => $src));
68 } // end func setSource
74 * Sets border size for image element
76 * @param string $border border for image element
81 function setBorder($border)
83 $this->updateAttributes(array('border' => $border));
84 } // end func setBorder
90 * Sets alignment for image element
92 * @param string $align alignment for image element
97 function setAlign($align)
99 $this->updateAttributes(array('align' => $align));
100 } // end func setAlign
106 * Freeze the element so that only its value is returned
118 } // end class HTML_QuickForm_image