Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Delete.php
Go to the documentation of this file.
1 <?php
7 
13 class Delete extends \Magento\Backend\Block\Widget\Form\Container
14 {
20  protected function _construct()
21  {
22  $this->_objectId = 'item_id';
23  $this->_mode = 'delete';
24  $this->_blockGroup = 'Magento_Backend';
25  $this->_controller = 'system_store';
26 
27  parent::_construct();
28 
29  $this->buttonList->remove('save');
30  $this->buttonList->remove('reset');
31 
32  $this->buttonList->update('delete', 'region', 'toolbar');
33  $this->buttonList->update('delete', 'onclick', null);
34  $this->buttonList->update(
35  'delete',
36  'data_attribute',
37  ['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]
38  );
39 
40  $this->buttonList->add(
41  'cancel',
42  ['label' => __('Cancel'), 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')'],
43  2,
44  100,
45  'toolbar'
46  );
47  }
48 
54  public function getHeaderText()
55  {
56  return __(
57  "Delete %1 '%2'",
58  $this->getStoreTypeTitle(),
59  $this->escapeHtml($this->getChildBlock('form')->getDataObject()->getName())
60  );
61  }
62 
69  public function setStoreTypeTitle($title)
70  {
71  $this->buttonList->update('delete', 'label', __('Delete %1', $title));
72  return $this->setData('store_type_title', $title);
73  }
74 
81  public function setBackUrl($url)
82  {
83  $this->setData('back_url', $url);
84  $this->buttonList->update('cancel', 'onclick', "setLocation('" . $url . "')");
85  $this->buttonList->update('back', 'onclick', "setLocation('" . $url . "')");
86  return $this;
87  }
88 }
__()
Definition: __.php:13
jquery extjs ext tree mage adminhtml form
Definition: tree.phtml:41