diff -r 000000000000 -r 4eba9c11703f web/Zend/View/Helper/FormButton.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/View/Helper/FormButton.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,105 @@ +_getInfo($name, $value, $attribs); + extract($info); // name, id, value, attribs, options, listsep, disable, escape + + // Get content + $content = ''; + if (isset($attribs['content'])) { + $content = $attribs['content']; + unset($attribs['content']); + } else { + $content = $value; + } + + // Ensure type is sane + $type = 'button'; + if (isset($attribs['type'])) { + $attribs['type'] = strtolower($attribs['type']); + if (in_array($attribs['type'], array('submit', 'reset', 'button'))) { + $type = $attribs['type']; + } + unset($attribs['type']); + } + + // build the element + if ($disable) { + $attribs['disabled'] = 'disabled'; + } + + $content = ($escape) ? $this->view->escape($content) : $content; + + $xhtml = 'view->escape($value) . '"'; + } + + // add attributes and close start tag + $xhtml .= $this->_htmlAttribs($attribs) . '>'; + + // add content and end tag + $xhtml .= $content . ''; + + return $xhtml; + } +}