Subversion Repositories Applications.papyrus

Rev

Rev 320 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 320 Rev 443
1
<?php
1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
2
/* vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +----------------------------------------------------------------------+
3
// +----------------------------------------------------------------------+
4
// | PHP version 4.0                                                      |
4
// | PHP version 4.0                                                      |
5
// +----------------------------------------------------------------------+
5
// +----------------------------------------------------------------------+
6
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
6
// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group             |
7
// +----------------------------------------------------------------------+
7
// +----------------------------------------------------------------------+
8
// | This source file is subject to version 2.0 of the PHP license,       |
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        |
9
// | that is bundled with this package in the file LICENSE, and is        |
10
// | available at through the world-wide-web at                           |
10
// | available at through the world-wide-web at                           |
11
// | http://www.php.net/license/2_02.txt.                                 |
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   |
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          |
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.               |
14
// | license@php.net so we can mail you a copy immediately.               |
15
// +----------------------------------------------------------------------+
15
// +----------------------------------------------------------------------+
16
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com>                        |
16
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com>                        |
17
// |          Bertrand Mansion <bmansion@mamasam.com>                     |
17
// |          Bertrand Mansion <bmansion@mamasam.com>                     |
18
// +----------------------------------------------------------------------+
18
// +----------------------------------------------------------------------+
19
//
19
//
20
// $Id: image.php,v 1.1 2005-03-30 08:50:33 jpm Exp $
20
// $Id: image.php,v 1.2 2005-09-20 17:01:22 ddelon Exp $
21
require_once("HTML/QuickForm/input.php");
21
require_once("HTML/QuickForm/input.php");
22
 
22
 
23
/**
23
/**
24
 * HTML class for a image type element
24
 * HTML class for a image type element
25
 * 
25
 * 
26
 * @author       Adam Daniel <adaniel1@eesus.jnj.com>
26
 * @author       Adam Daniel <adaniel1@eesus.jnj.com>
27
 * @author       Bertrand Mansion <bmansion@mamasam.com>
27
 * @author       Bertrand Mansion <bmansion@mamasam.com>
28
 * @version      1.0
28
 * @version      1.0
29
 * @since        PHP4.04pl1
29
 * @since        PHP4.04pl1
30
 * @access       public
30
 * @access       public
31
 */
31
 */
32
class HTML_QuickForm_image extends HTML_QuickForm_input
32
class HTML_QuickForm_image extends HTML_QuickForm_input
33
{
33
{
34
    // {{{ constructor
34
    // {{{ constructor
35
 
35
 
36
    /**
36
    /**
37
     * Class constructor
37
     * Class constructor
38
     * 
38
     * 
39
     * @param     string    $elementName    (optional)Element name attribute
39
     * @param     string    $elementName    (optional)Element name attribute
40
     * @param     string    $src            (optional)Image source
40
     * @param     string    $src            (optional)Image source
41
     * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
41
     * @param     mixed     $attributes     (optional)Either a typical HTML attribute string 
42
     *                                      or an associative array
42
     *                                      or an associative array
43
     * @since     1.0
43
     * @since     1.0
44
     * @access    public
44
     * @access    public
45
     * @return    void
45
     * @return    void
46
     */
46
     */
47
    function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
47
    function HTML_QuickForm_image($elementName=null, $src='', $attributes=null)
48
    {
48
    {
49
        HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
49
        HTML_QuickForm_input::HTML_QuickForm_input($elementName, null, $attributes);
50
        $this->setType('image');
50
        $this->setType('image');
51
        $this->setSource($src);
51
        $this->setSource($src);
52
    } // end class constructor
52
    } // end class constructor
53
 
53
 
54
    // }}}
54
    // }}}
55
    // {{{ setSource()
55
    // {{{ setSource()
56
 
56
 
57
    /**
57
    /**
58
     * Sets source for image element
58
     * Sets source for image element
59
     * 
59
     * 
60
     * @param     string    $src  source for image element
60
     * @param     string    $src  source for image element
61
     * @since     1.0
61
     * @since     1.0
62
     * @access    public
62
     * @access    public
63
     * @return    void
63
     * @return    void
64
     */
64
     */
65
    function setSource($src)
65
    function setSource($src)
66
    {
66
    {
67
        $this->updateAttributes(array('src' => $src));
67
        $this->updateAttributes(array('src' => $src));
68
    } // end func setSource
68
    } // end func setSource
69
 
69
 
70
    // }}}
70
    // }}}
71
    // {{{ setBorder()
71
    // {{{ setBorder()
72
 
72
 
73
    /**
73
    /**
74
     * Sets border size for image element
74
     * Sets border size for image element
75
     * 
75
     * 
76
     * @param     string    $border  border for image element
76
     * @param     string    $border  border for image element
77
     * @since     1.0
77
     * @since     1.0
78
     * @access    public
78
     * @access    public
79
     * @return    void
79
     * @return    void
80
     */
80
     */
81
    function setBorder($border)
81
    function setBorder($border)
82
    {
82
    {
83
        $this->updateAttributes(array('border' => $border));
83
        $this->updateAttributes(array('border' => $border));
84
    } // end func setBorder
84
    } // end func setBorder
85
 
85
 
86
    // }}}
86
    // }}}
87
    // {{{ setAlign()
87
    // {{{ setAlign()
88
 
88
 
89
    /**
89
    /**
90
     * Sets alignment for image element
90
     * Sets alignment for image element
91
     * 
91
     * 
92
     * @param     string    $align  alignment for image element
92
     * @param     string    $align  alignment for image element
93
     * @since     1.0
93
     * @since     1.0
94
     * @access    public
94
     * @access    public
95
     * @return    void
95
     * @return    void
96
     */
96
     */
97
    function setAlign($align)
97
    function setAlign($align)
98
    {
98
    {
99
        $this->updateAttributes(array('align' => $align));
99
        $this->updateAttributes(array('align' => $align));
100
    } // end func setAlign
100
    } // end func setAlign
101
 
101
 
102
    // }}}
102
    // }}}
103
    // {{{ freeze()
103
    // {{{ freeze()
104
 
104
 
105
    /**
105
    /**
106
     * Freeze the element so that only its value is returned
106
     * Freeze the element so that only its value is returned
107
     * 
107
     * 
108
     * @access    public
108
     * @access    public
109
     * @return    void
109
     * @return    void
110
     */
110
     */
111
    function freeze()
111
    function freeze()
112
    {
112
    {
113
        return false;
113
        return false;
114
    } //end func freeze
114
    } //end func freeze
115
 
115
 
116
    // }}}
116
    // }}}
117
 
117
 
118
} // end class HTML_QuickForm_image
118
} // end class HTML_QuickForm_image
119
?>
119
?>