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: FormFile.php 20096 2010-01-06 02:05:09Z bkarwin $ |
20 * @version $Id: FormFile.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 a "file" element |
31 * Helper to generate a "file" 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_FormFile extends Zend_View_Helper_FormElement |
39 class Zend_View_Helper_FormFile extends Zend_View_Helper_FormElement |
40 { |
40 { |
41 /** |
41 /** |
60 $disabled = ''; |
60 $disabled = ''; |
61 if ($disable) { |
61 if ($disable) { |
62 $disabled = ' disabled="disabled"'; |
62 $disabled = ' disabled="disabled"'; |
63 } |
63 } |
64 |
64 |
65 // XHTML or HTML end tag? |
|
66 $endTag = ' />'; |
|
67 if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) { |
|
68 $endTag= '>'; |
|
69 } |
|
70 |
|
71 // build the element |
65 // build the element |
72 $xhtml = '<input type="file"' |
66 $xhtml = '<input type="file"' |
73 . ' name="' . $this->view->escape($name) . '"' |
67 . ' name="' . $this->view->escape($name) . '"' |
74 . ' id="' . $this->view->escape($id) . '"' |
68 . ' id="' . $this->view->escape($id) . '"' |
75 . $disabled |
69 . $disabled |
76 . $this->_htmlAttribs($attribs) |
70 . $this->_htmlAttribs($attribs) |
77 . $endTag; |
71 . $this->getClosingBracket(); |
78 |
72 |
79 return $xhtml; |
73 return $xhtml; |
80 } |
74 } |
81 } |
75 } |