/** * Prepare button and grid * * @return \Magento\Catalog\Block\Adminhtml\Product */ protected function _prepareLayout() { $addButtonProps = ['id' => 'add_new', 'label' => __('Add New'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button\\SplitButton', 'options' => $this->_getAddButtonOptions()]; $this->buttonList->add('add_new', $addButtonProps); $this->setChild('grid', $this->getLayout()->createBlock('Emizentech\\Banner\\Block\\Adminhtml\\Banner\\Grid', 'emizentech.banner.grid')); return parent::_prepareLayout(); }
/** * @return $this */ protected function _prepareLayout() { if (!$this->getLayout()->getChildName($this->getNameInLayout(), 'grid')) { $this->setChild('grid', $this->getLayout()->createBlock($this->_blockGroup . '\\Block\\Role\\Grid', $this->_controller . '.grid')->setSaveParametersInSession(true)); } return \Magento\Backend\Block\Widget\Container::_prepareLayout(); }
/** * Create form block * * @return $this */ protected function _prepareLayout() { if ($this->_blockGroup && $this->_controller && $this->_mode && !$this->_layout->getChildName($this->_nameInLayout, 'form')) { $this->addChild('form', $this->_buildFormClassName()); } return parent::_prepareLayout(); }
/** * Prepare URL rewrite editing layout * * @return $this */ protected function _prepareLayout() { $this->setTemplate('edit.phtml'); $this->_addBackButton(); $this->_prepareLayoutFeatures(); return parent::_prepareLayout(); }
/** * Prepare button and grid * * @return \Magento\Catalog\Block\Adminhtml\Product */ protected function _prepareLayout() { $addButtonProps = array('id' => 'add_new_product', 'label' => __('Add Product'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button\\SplitButton', 'options' => $this->_getAddProductButtonOptions()); $this->buttonList->add('add_new', $addButtonProps); $this->setChild('grid', $this->getLayout()->createBlock('Magento\\Catalog\\Block\\Adminhtml\\Product\\Grid', 'product.grid')); return parent::_prepareLayout(); }
/** * Create buttons * TODO: implement ACL restrictions * @return \Magento\RecurringPayment\Block\Adminhtml\Payment\View */ protected function _prepareLayout() { $this->buttonList->add('back', array('label' => __('Back'), 'onclick' => "setLocation('{$this->getUrl('*/*/')}')", 'class' => 'back')); $payment = $this->_coreRegistry->registry('current_recurring_payment'); $confirmationMessage = __('Are you sure you want to do this?'); // cancel if ($payment->canCancel()) { $url = $this->getUrl('*/*/updateState', array('payment' => $payment->getId(), 'action' => 'cancel')); $this->buttonList->add('cancel', array('label' => __('Cancel'), 'onclick' => "confirmSetLocation('{$confirmationMessage}', '{$url}')", 'class' => 'delete')); } // suspend if ($payment->canSuspend()) { $url = $this->getUrl('*/*/updateState', array('payment' => $payment->getId(), 'action' => 'suspend')); $this->buttonList->add('suspend', array('label' => __('Suspend'), 'onclick' => "confirmSetLocation('{$confirmationMessage}', '{$url}')", 'class' => 'delete')); } // activate if ($payment->canActivate()) { $url = $this->getUrl('*/*/updateState', array('payment' => $payment->getId(), 'action' => 'activate')); $this->buttonList->add('activate', array('label' => __('Activate'), 'onclick' => "confirmSetLocation('{$confirmationMessage}', '{$url}')", 'class' => 'add')); } // get update if ($payment->canFetchUpdate()) { $url = $this->getUrl('*/*/updatePayment', array('payment' => $payment->getId())); $this->buttonList->add('update', array('label' => __('Get Update'), 'onclick' => "confirmSetLocation('{$confirmationMessage}', '{$url}')", 'class' => 'add')); } return parent::_prepareLayout(); }
/** * {@inheritdoc} */ protected function _prepareLayout() { // check if grid was created through the layout if (false === $this->getChildBlock('grid')) { $this->setChild('grid', $this->getLayout()->createBlock(str_replace('_', '\\', $this->_blockGroup) . '\\Block\\' . str_replace(' ', '\\', ucwords(str_replace('_', ' ', $this->_controller))) . '\\Grid', $this->_controller . '.grid')->setSaveParametersInSession(true)); } return parent::_prepareLayout(); }
/** * Add elements in layout * * @return void */ protected function _prepareLayout() { $this->addButton('back_button', array('label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*') . '\')', 'class' => 'back')); parent::_prepareLayout(); }
protected function _prepareLayout() { return parent::_prepareLayout(); }
/** * Prepare button and grid * * @return \Magento\Catalog\Block\Adminhtml\Product */ protected function _prepareLayout() { $addButtonProps = ['id' => 'add_new_product', 'label' => __('Add Product'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button\\SplitButton', 'options' => $this->_getAddProductButtonOptions()]; $this->buttonList->add('add_new', $addButtonProps); return parent::_prepareLayout(); }
/** * {@inheritdoc} */ protected function _prepareLayout() { $blockName = $this->_blockGroup . '\\Block\\' . str_replace(' ', '\\', ucwords(str_replace('\\', ' ', $this->_controller))) . '\\View\\Plane'; $this->setChild('plane', $this->getLayout()->createBlock($blockName)); return parent::_prepareLayout(); }