Beispiel #1
0
 /**
  * Get edit button
  *
  * @param \Magento\DesignEditor\Block\Adminhtml\Theme $themeBlock
  * @return void
  */
 protected function _addEditButtonHtml($themeBlock)
 {
     $themeId = $themeBlock->getTheme()->getId();
     /** @var $assignButton \Magento\Backend\Block\Widget\Button */
     $assignButton = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Button');
     $assignButton->setData(array('label' => __('Edit'), 'data_attribute' => array('mage-init' => array('button' => array('event' => 'themeEdit', 'target' => 'body', 'eventData' => array('theme_id' => $themeId)))), 'class' => 'action-edit'));
     $themeBlock->addButton($assignButton);
 }
 /**
  * Get remove button
  *
  * @param \Magento\DesignEditor\Block\Adminhtml\Theme $themeBlock
  * @return string
  */
 protected function _addRemoveButtonHtml($themeBlock)
 {
     $themeId = $themeBlock->getTheme()->getId();
     $themeTitle = $themeBlock->getTheme()->getThemeTitle();
     /** @var $removeButton \Magento\Backend\Block\Widget\Button */
     $removeButton = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Button');
     $removeButton->setData(['label' => __('Remove'), 'data_attribute' => ['mage-init' => ['button' => ['event' => 'delete', 'target' => 'body', 'eventData' => ['url' => $this->getUrl('*/system_design_theme/delete/', ['id' => $themeId, 'back' => true]), 'confirm' => ['message' => __('Are you sure you want to delete this theme?')], 'title' => __('Delete %1 Theme', $themeTitle)]]]], 'class' => 'action-delete', 'target' => '_blank']);
     $themeBlock->addButton($removeButton);
     return $this;
 }
 /**
  * Get edit button
  *
  * @param \Magento\DesignEditor\Block\Adminhtml\Theme $themeBlock
  * @return $this
  */
 protected function _addEditButtonHtml($themeBlock)
 {
     /** @var $editButton \Magento\Backend\Block\Widget\Button */
     $editButton = $this->getLayout()->createBlock('Magento\\DesignEditor\\Block\\Adminhtml\\Theme\\Button');
     $editButton->setData(['title' => __('Edit'), 'label' => __('Edit'), 'class' => 'action-edit primary', 'href' => $this->_getEditUrl($themeBlock->getTheme()->getId()), 'target' => 'edittheme']);
     $themeBlock->addButton($editButton);
     return $this;
 }