Ejemplo n.º 1
0
 /**
  * @return $this
  */
 protected function _prepareLayout()
 {
     $this->buttonList->add('back', ['label' => __('Back'), 'onclick' => 'window.location.href=\'' . $this->getUrl('tax/*/') . '\'', 'class' => 'back']);
     $this->buttonList->add('reset', ['label' => __('Reset'), 'onclick' => 'window.location.reload()', 'class' => 'reset']);
     $rate = intval($this->getRequest()->getParam('rate'));
     if ($rate) {
         $this->buttonList->add('delete', ['label' => __('Delete Rate'), 'onclick' => 'deleteConfirm(\'' . __('Are you sure you want to do this?') . '\', \'' . $this->getUrl('tax/*/delete', ['rate' => $rate]) . '\')', 'class' => 'delete']);
     }
     $this->buttonList->add('save', ['label' => __('Save Rate'), 'class' => 'save primary save-rate', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'save', 'target' => '#rate-form']]]]);
     $this->toolbar->pushButtons($this, $this->buttonList);
     return parent::_prepareLayout();
 }
Ejemplo n.º 2
0
 /**
  * Prepare layout
  *
  * @return $this
  * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  */
 protected function _prepareLayout()
 {
     $this->buttonList->add('back', ['label' => __('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('adminhtml/*') . "'", 'class' => 'back']);
     $this->buttonList->add('reset', ['label' => __('Reset'), 'onclick' => 'window.location.href = window.location.href']);
     if ($this->getEditMode()) {
         $this->buttonList->add('delete', ['label' => __('Delete Template'), 'data_attribute' => ['role' => 'template-delete'], 'class' => 'delete']);
     }
     if (!$this->isTextType()) {
         $this->buttonList->add('to_plain', ['label' => __('Convert to Plain Text'), 'data_attribute' => ['role' => 'template-strip'], 'id' => 'convert_button']);
         $this->buttonList->add('to_html', ['label' => __('Return Html Version'), 'data_attribute' => ['role' => 'template-unstrip'], 'id' => 'convert_button_back', 'style' => 'display:none']);
     }
     $this->buttonList->add('preview', ['label' => __('Preview Template'), 'data_attribute' => ['role' => 'template-preview']]);
     $this->buttonList->add('save', ['label' => __('Save Template'), 'data_attribute' => ['role' => 'template-save'], 'class' => 'save primary save-template']);
     $this->buttonList->add('load', ['label' => __('Load Template'), 'data_attribute' => ['role' => 'template-load'], 'type' => 'button', 'class' => 'save'], 0, 0, null);
     $this->toolbar->pushButtons($this, $this->buttonList);
     $this->addChild('form', 'Magento\\Email\\Block\\Adminhtml\\Template\\Edit\\Form');
     return parent::_prepareLayout();
 }
Ejemplo n.º 3
0
 /**
  * @return $this
  */
 protected function _prepareLayout()
 {
     $this->buttonList->add('add', ['label' => __('Add New Tax Rate'), 'onclick' => 'window.location.href=\'' . $this->getUrl('tax/rate/add') . '\'', 'class' => 'add primary add-tax-rate']);
     $this->toolbar->pushButtons($this, $this->buttonList);
     return parent::_prepareLayout();
 }
Ejemplo n.º 4
0
 /**
  * Preparing child blocks for each added button
  *
  * @return $this
  */
 protected function _prepareLayout()
 {
     $this->toolbar->pushButtons($this, $this->buttonList);
     return parent::_prepareLayout();
 }
Ejemplo n.º 5
0
 /**
  * Create add button and grid blocks
  *
  * @return \Magento\Framework\View\Element\AbstractBlock
  */
 protected function _prepareLayout()
 {
     $this->buttonList->add('add', array('label' => __('Add New Template'), 'onclick' => "window.location='" . $this->getCreateUrl() . "'", 'class' => 'add primary add-template'));
     $this->toolbar->pushButtons($this, $this->buttonList);
     return parent::_prepareLayout();
 }