320 |
jpm |
1 |
<?php
|
|
|
2 |
/* vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +----------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.0 |
|
|
|
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 |
// +----------------------------------------------------------------------+
|
|
|
19 |
//
|
443 |
ddelon |
20 |
// $Id: image.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
|
320 |
jpm |
21 |
require_once("HTML/QuickForm/input.php");
|
|
|
22 |
|
|
|
23 |
/**
|
|
|
24 |
* HTML class for a image type element
|
|
|
25 |
*
|
|
|
26 |
* @author Adam Daniel <adaniel1@eesus.jnj.com>
|
|
|
27 |
* @author Bertrand Mansion <bmansion@mamasam.com>
|
|
|
28 |
* @version 1.0
|
|
|
29 |
* @since PHP4.04pl1
|
|
|
30 |
* @access public
|
|
|
31 |
*/
|
|
|
32 |
class HTML_QuickForm_image extends HTML_QuickForm_input
|
|
|
33 |
{
|
|
|
34 |
// {{{ constructor
|
|
|
35 |
|
|
|
36 |
/**
|
|
|
37 |
* Class constructor
|
|
|
38 |
*
|
|
|
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
|
|
|
43 |
* @since 1.0
|
|
|
44 |
* @access public
|
|
|
45 |
* @return void
|
|
|
46 |
*/
|
|
|
47 |
function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
|
|
|
48 |
{
|
|
|
49 |
HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
|
|
|
50 |
$this->setType('image');
|
|
|
51 |
$this->setSource($src);
|
|
|
52 |
} // end class constructor
|
|
|
53 |
|
|
|
54 |
// }}}
|
|
|
55 |
// {{{ setSource()
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
* Sets source for image element
|
|
|
59 |
*
|
|
|
60 |
* @param string $src source for image element
|
|
|
61 |
* @since 1.0
|
|
|
62 |
* @access public
|
|
|
63 |
* @return void
|
|
|
64 |
*/
|
|
|
65 |
function setSource($src)
|
|
|
66 |
{
|
|
|
67 |
$this->updateAttributes(array('src' => $src));
|
|
|
68 |
} // end func setSource
|
|
|
69 |
|
|
|
70 |
// }}}
|
|
|
71 |
// {{{ setBorder()
|
|
|
72 |
|
|
|
73 |
/**
|
|
|
74 |
* Sets border size for image element
|
|
|
75 |
*
|
|
|
76 |
* @param string $border border for image element
|
|
|
77 |
* @since 1.0
|
|
|
78 |
* @access public
|
|
|
79 |
* @return void
|
|
|
80 |
*/
|
|
|
81 |
function setBorder($border)
|
|
|
82 |
{
|
|
|
83 |
$this->updateAttributes(array('border' => $border));
|
|
|
84 |
} // end func setBorder
|
|
|
85 |
|
|
|
86 |
// }}}
|
|
|
87 |
// {{{ setAlign()
|
|
|
88 |
|
|
|
89 |
/**
|
|
|
90 |
* Sets alignment for image element
|
|
|
91 |
*
|
|
|
92 |
* @param string $align alignment for image element
|
|
|
93 |
* @since 1.0
|
|
|
94 |
* @access public
|
|
|
95 |
* @return void
|
|
|
96 |
*/
|
|
|
97 |
function setAlign($align)
|
|
|
98 |
{
|
|
|
99 |
$this->updateAttributes(array('align' => $align));
|
|
|
100 |
} // end func setAlign
|
|
|
101 |
|
|
|
102 |
// }}}
|
|
|
103 |
// {{{ freeze()
|
|
|
104 |
|
|
|
105 |
/**
|
|
|
106 |
* Freeze the element so that only its value is returned
|
|
|
107 |
*
|
|
|
108 |
* @access public
|
|
|
109 |
* @return void
|
|
|
110 |
*/
|
|
|
111 |
function freeze()
|
|
|
112 |
{
|
|
|
113 |
return false;
|
|
|
114 |
} //end func freeze
|
|
|
115 |
|
|
|
116 |
// }}}
|
|
|
117 |
|
|
|
118 |
} // end class HTML_QuickForm_image
|
|
|
119 |
?>
|