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 extends Mage_Adminhtml_Block_Template
00035 {
00036     public function getId()
00037     {
00038         if ($this->getData('id')===null) {
00039             $this->setData('id', 'id_'.md5(microtime()));
00040         }
00041         return $this->getData('id');
00042     }
00043 
00044     public function getHtmlId()
00045     {
00046         return $this->getId();
00047     }
00048 
00049     public function getCurrentUrl($params=array())
00050     {
00051         return $this->getUrl('*/*/*', array('_current'=>true));
00052     }
00053 
00054     protected function _addBreadcrumb($label, $title=null, $link=null)
00055     {
00056         $this->getLayout()->getBlock('breadcrumbs')->addLink($label, $title, $link);
00057     }
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 
00068     public function getButtonHtml($label, $onclick, $class='', $id=null) {
00069         return $this->getLayout()->createBlock('adminhtml/widget_button')
00070             ->setData(array(
00071                 'label'     => $label,
00072                 'onclick'   => $onclick,
00073                 'class'     => $class,
00074                 'type'      => 'button',
00075                 'id'        => $id,
00076             ))
00077             ->toHtml();
00078     }
00079 
00080     public function getGlobalIcon()
00081     {
00082         return '<img src="'.$this->getSkinUrl('images/fam_link.gif').'" alt="'.$this->__('Global Attribute').'" title="'.$this->__('This attribute shares the same value in all the stores').'" class="attribute-global"/>';
00083     }
00084 }
00085