equal
deleted
inserted
replaced
13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_View |
16 * @package Zend_View |
17 * @subpackage Helper |
17 * @subpackage Helper |
18 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: FormImage.php 20096 2010-01-06 02:05:09Z bkarwin $ |
20 * @version $Id: FormImage.php 24750 2012-05-05 01:24:21Z adamlundrigan $ |
21 */ |
21 */ |
22 |
22 |
23 |
23 |
24 /** |
24 /** |
25 * Abstract class for extension |
25 * Abstract class for extension |
31 * Helper to generate an "image" element |
31 * Helper to generate an "image" element |
32 * |
32 * |
33 * @category Zend |
33 * @category Zend |
34 * @package Zend_View |
34 * @package Zend_View |
35 * @subpackage Helper |
35 * @subpackage Helper |
36 * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) |
36 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
38 */ |
38 */ |
39 class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement |
39 class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement |
40 { |
40 { |
41 /** |
41 /** |
78 $disabled = ''; |
78 $disabled = ''; |
79 if ($disable) { |
79 if ($disable) { |
80 $disabled = ' disabled="disabled"'; |
80 $disabled = ' disabled="disabled"'; |
81 } |
81 } |
82 |
82 |
83 // XHTML or HTML end tag? |
|
84 $endTag = ' />'; |
|
85 if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) { |
|
86 $endTag= '>'; |
|
87 } |
|
88 |
|
89 // build the element |
83 // build the element |
90 $xhtml = '<input type="image"' |
84 $xhtml = '<input type="image"' |
91 . ' name="' . $this->view->escape($name) . '"' |
85 . ' name="' . $this->view->escape($name) . '"' |
92 . ' id="' . $this->view->escape($id) . '"' |
86 . ' id="' . $this->view->escape($id) . '"' |
93 . $src |
87 . $src |
94 . $value |
88 . $value |
95 . $disabled |
89 . $disabled |
96 . $this->_htmlAttribs($attribs) |
90 . $this->_htmlAttribs($attribs) |
97 . $endTag; |
91 . $this->getClosingBracket(); |
98 |
92 |
99 return $xhtml; |
93 return $xhtml; |
100 } |
94 } |
101 } |
95 } |