diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/View/Helper/FormImage.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/View/Helper/FormImage.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,101 @@ +_getInfo($name, $value, $attribs); + extract($info); // name, value, attribs, options, listsep, disable + + // Determine if we should use the value or the src attribute + if (isset($attribs['src'])) { + $src = ' src="' . $this->view->escape($attribs['src']) . '"'; + unset($attribs['src']); + } else { + $src = ' src="' . $this->view->escape($value) . '"'; + unset($value); + } + + // Do we have a value? + if (isset($value) && !empty($value)) { + $value = ' value="' . $this->view->escape($value) . '"'; + } else { + $value = ''; + } + + // Disabled? + $disabled = ''; + if ($disable) { + $disabled = ' disabled="disabled"'; + } + + // XHTML or HTML end tag? + $endTag = ' />'; + if (($this->view instanceof Zend_View_Abstract) && !$this->view->doctype()->isXhtml()) { + $endTag= '>'; + } + + // build the element + $xhtml = '_htmlAttribs($attribs) + . $endTag; + + return $xhtml; + } +}