00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Widget_Button extends Mage_Adminhtml_Block_Widget
00035 {
00036 public function __construct()
00037 {
00038 parent::__construct();
00039 }
00040
00041 public function getType()
00042 {
00043 return ($type=$this->getData('type')) ? $type : 'button';
00044 }
00045
00046 public function getOnClick()
00047 {
00048 if (!$this->getData('on_click')) {
00049 return $this->getData('onclick');
00050 }
00051 return $this->getData('on_click');
00052 }
00053
00054 protected function _toHtml()
00055 {
00056 $html = $this->getBeforeHtml().'<button '
00057 . ($this->getId()?' id="'.$this->getId() . '"':'')
00058 . ($this->getName()?' name="'.$this->getName() . '"':'')
00059 . ' type="'.$this->getType() . '"'
00060 . ' class="scalable '.$this->getClass().'"'
00061 . ' onclick="'.$this->getOnClick().'"'
00062 . ' style="'.$this->getStyle() .'"'
00063 . ($this->getValue()?' value="'.$this->getValue() . '"':'')
00064 . ($this->getDisabled() ? 'disabled="disabled"' : '')
00065 . '><span>' .$this->getLabel().'</span></button>'.$this->getAfterHtml();
00066
00067 return $html;
00068 }
00069 }