1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Widget_Button extends Mage_Adminhtml_Block_Widget
35: {
36: public function __construct()
37: {
38: parent::__construct();
39: }
40:
41: public function getType()
42: {
43: return ($type=$this->getData('type')) ? $type : 'button';
44: }
45:
46: public function getOnClick()
47: {
48: if (!$this->getData('on_click')) {
49: return $this->getData('onclick');
50: }
51: return $this->getData('on_click');
52: }
53:
54: protected function _toHtml()
55: {
56: $html = $this->getBeforeHtml().'<button '
57: . ($this->getId()?' id="'.$this->getId() . '"':'')
58: . ($this->getElementName()?' name="'.$this->getElementName() . '"':'')
59: . ' title="'
60: . Mage::helper('core')->quoteEscape($this->getTitle() ? $this->getTitle() : $this->getLabel())
61: . '"'
62: . ' type="'.$this->getType() . '"'
63: . ' class="scalable ' . $this->getClass() . ($this->getDisabled() ? ' disabled' : '') . '"'
64: . ' onclick="'.$this->getOnClick().'"'
65: . ' style="'.$this->getStyle() .'"'
66: . ($this->getValue()?' value="'.$this->getValue() . '"':'')
67: . ($this->getDisabled() ? ' disabled="disabled"' : '')
68: . '><span><span><span>' .$this->getLabel().'</span></span></span></button>'.$this->getAfterHtml();
69:
70: return $html;
71: }
72: }
73: