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_System_Store_Delete extends Mage_Adminhtml_Block_Widget_Form_Container
00036 {
00037
00038
00039
00040
00041
00042 public function __construct()
00043 {
00044 $this->_objectId = 'item_id';
00045 $this->_mode = 'delete';
00046 $this->_controller = 'system_store';
00047
00048 parent::__construct();
00049
00050 $this->_removeButton('save');
00051 $this->_removeButton('reset');
00052
00053 $this->_updateButton('delete', 'area', 'footer');
00054 $this->_updateButton('delete', 'onclick', 'editForm.submit();');
00055
00056 $this->_addButton('cancel', array(
00057 'label' => Mage::helper('adminhtml')->__('Cancel'),
00058 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')',
00059 ), 2, 100, 'footer');
00060
00061 }
00062
00063
00064
00065
00066
00067
00068 public function getHeaderText()
00069 {
00070 return Mage::helper('adminhtml')->__("Delete %s '%s'", $this->getStoreTypeTitle(),
00071 $this->htmlEscape($this->getChild('form')->getDataObject()->getName()));
00072 }
00073
00074
00075
00076
00077
00078
00079
00080 public function setStoreTypeTitle($title)
00081 {
00082 $this->_updateButton('delete', 'label', Mage::helper('adminhtml')->__('Delete %s', $title));
00083 return $this->setData('store_type_title', $title);
00084 }
00085
00086
00087
00088
00089
00090
00091
00092 public function setBackUrl($url)
00093 {
00094 $this->setData('back_url', $url);
00095 $this->_updateButton('cancel', 'onclick', "setLocation('" . $url . "')");
00096 $this->_updateButton('back', 'onclick', "setLocation('" . $url . "')");
00097 return $this;
00098 }
00099
00100 }