17 class Edit extends \Magento\Backend\Block\Widget\Form\Container
45 parent::__construct($context,
$data);
55 switch ($this->_coreRegistry->registry(
'store_type')) {
57 $this->_objectId =
'website_id';
58 $saveLabel =
__(
'Save Web Site');
59 $deleteLabel =
__(
'Delete Web Site');
60 $deleteUrl = $this->
getUrl(
62 [
'item_id' => $this->_coreRegistry->registry(
'store_data')->getId()]
66 $this->_objectId =
'group_id';
67 $saveLabel =
__(
'Save Store');
68 $deleteLabel =
__(
'Delete Store');
69 $deleteUrl = $this->
getUrl(
71 [
'item_id' => $this->_coreRegistry->registry(
'store_data')->getId()]
75 $this->_objectId =
'store_id';
76 $saveLabel =
__(
'Save Store View');
77 $deleteLabel =
__(
'Delete Store View');
78 $deleteUrl = $this->
getUrl(
80 [
'item_id' => $this->_coreRegistry->registry(
'store_data')->getId()]
88 $this->_blockGroup =
'Magento_Backend';
89 $this->_controller =
'system_store';
93 $this->buttonList->update(
'save',
'label', $saveLabel);
94 $this->buttonList->update(
'delete',
'label', $deleteLabel);
95 $this->buttonList->update(
'delete',
'onclick',
'setLocation(\'' . $deleteUrl .
'\');
'); 97 if (!$this->_coreRegistry->registry('store_data
')) { 101 if (!$this->_coreRegistry->registry('store_data
')->isCanDelete()) { 102 $this->buttonList->remove('delete'); 104 if ($this->_coreRegistry->registry('store_data
')->isReadOnly()) { 105 $this->buttonList->remove('save
'); 106 $this->buttonList->remove('reset
'); 115 public function getHeaderText() 117 switch ($this->_coreRegistry->registry('store_type
')) { 119 $editLabel = __('Edit Web Site
'); 120 $addLabel = __('New Web Site
'); 124 $addLabel = __('New
Store'); 128 $addLabel = __('New
Store View
'); 132 return $this->_coreRegistry->registry('store_action
') == 'add
' ? $addLabel : $editLabel; 140 protected function _buildFormClassName() 142 return parent::_buildFormClassName() . '\\
' . ucwords($this->_coreRegistry->registry('store_type
')); 151 public function getStoreData() 153 return $this->serializer->serialize($this->_coreRegistry->registry('store_data
')->getData());
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[], SerializerInterface $serializer=null)
getUrl($route='', $params=[])