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
00035 class Mage_Adminhtml_Block_Widget_View_Container extends Mage_Adminhtml_Block_Widget_Container
00036 {
00037 protected $_objectId = 'id';
00038
00039 public function __construct()
00040 {
00041 parent::__construct();
00042
00043 $this->setTemplate('widget/view/container.phtml');
00044
00045 $this->_addButton('back', array(
00046 'label' => Mage::helper('adminhtml')->__('Back'),
00047 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/') . '\'',
00048 'class' => 'back',
00049 ));
00050
00051 $this->_addButton('edit', array(
00052 'label' => Mage::helper('adminhtml')->__('Edit'),
00053 'class' => 'edit',
00054 'onclick' => 'window.location.href=\'' . $this->getEditUrl() . '\'',
00055 ));
00056
00057 }
00058
00059 protected function _prepareLayout()
00060 {
00061 $this->setChild('plane', $this->getLayout()->createBlock('adminhtml/' . $this->_controller . '_view_plane'));
00062 return parent::_prepareLayout();
00063 }
00064
00065 public function getEditUrl()
00066 {
00067 return $this->getUrl('*/*/edit', array($this->_objectId => $this->getRequest()->getParam($this->_objectId)));
00068 }
00069
00070 public function getViewHtml()
00071 {
00072 return $this->getChildHtml('plane');
00073 }
00074
00075 }