protected function _construct() { $this->_blockGroup = 'Sugarcode_Test'; $this->_controller = 'adminhtml_lists'; $this->_headerText = __('Test Grid'); $this->_addButtonLabel = __('Add New Info'); parent::_construct(); }
/** * Block construction * * @return void */ protected function _construct() { parent::_construct(); $this->_headerText = __('Media Storage'); $this->buttonList->remove('back'); $this->buttonList->remove('edit'); $this->buttonList->add('newfolder', ['class' => 'save', 'label' => __('Create Folder'), 'type' => 'button', 'onclick' => 'MediabrowserInstance.newFolder();']); $this->buttonList->add('delete_folder', ['class' => 'delete no-display', 'label' => __('Delete Folder'), 'type' => 'button', 'onclick' => 'MediabrowserInstance.deleteFolder();', 'id' => 'button_delete_folder']); $this->buttonList->add('delete_files', ['class' => 'delete no-display', 'label' => __('Delete File'), 'type' => 'button', 'onclick' => 'MediabrowserInstance.deleteFiles();', 'id' => 'button_delete_files']); $this->buttonList->add('insert_files', ['class' => 'save no-display', 'label' => __('Insert File'), 'type' => 'button', 'onclick' => 'MediabrowserInstance.insert();', 'id' => 'button_insert_files']); }
/** * Block construction * * @return void */ protected function _construct() { parent::_construct(); $this->_headerText = __('Media Storage'); $this->buttonList->remove('back'); $this->buttonList->remove('edit'); $this->buttonList->add('new_folder', ['class' => 'save', 'label' => __('Create Folder...'), 'type' => 'button'], 0, 0, 'header'); $this->buttonList->add('delete_folder', ['class' => 'delete no-display', 'label' => __('Delete Folder'), 'type' => 'button'], 0, 0, 'header'); $this->buttonList->add('delete_files', ['class' => 'delete no-display', 'label' => __('Delete File'), 'type' => 'button'], 0, 0, 'header'); $this->buttonList->add('insert_files', ['class' => 'save no-display primary', 'label' => __('Insert File'), 'type' => 'button'], 0, 0, 'header'); }
/** * @return void */ protected function _construct() { parent::_construct(); $this->addButton('back', ['label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getBackUrl() . '\')', 'class' => 'back'], -1); $this->addButton('reset', ['label' => __('Reset'), 'onclick' => 'setLocation(window.location.href)', 'class' => 'reset'], -1); $objId = $this->getRequest()->getParam($this->_objectId); if (!empty($objId)) { $this->addButton('delete', ['label' => __('Delete'), 'class' => 'delete', 'onclick' => 'deleteConfirm(\'' . __('Are you sure you want to do this?') . '\', \'' . $this->getDeleteUrl() . '\')']); } $this->addButton('save', ['label' => __('Save'), 'class' => 'save primary', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'save', 'target' => '#edit_form']]]], 1); }
/** * Add control buttons * * @return void */ protected function _construct() { parent::_construct(); $this->_txn = $this->_coreRegistry->registry('current_transaction'); if (!$this->_txn) { return; } $backUrl = $this->_txn->getOrderUrl() ? $this->_txn->getOrderUrl() : $this->getUrl('sales/*/'); $this->buttonList->add('back', ['label' => __('Back'), 'onclick' => "setLocation('{$backUrl}')", 'class' => 'back']); if ($this->_authorization->isAllowed('Magento_Sales::transactions_fetch') && $this->_txn->getOrderPaymentObject()->getMethodInstance()->canFetchTransactionInfo()) { $fetchUrl = $this->getUrl('sales/*/fetch', ['_current' => true]); $this->buttonList->add('fetch', ['label' => __('Fetch'), 'onclick' => "setLocation('{$fetchUrl}')", 'class' => 'button']); } }
public function _construct() { $this->_blockGroup = 'Dotdigitalgroup_Email'; $this->_controller = 'adminhtml_dashboard'; $this->_headerText = __('Dashboard'); parent::_construct(); /** * Contact sync. */ $this->buttonList->add('contact_sync', ['label' => __('Run Contact Sync'), 'onclick' => 'setLocation(\'' . $this->getContactSyncLink() . '\')', 'class' => 'primary']); /** * Importer sync. */ $this->buttonList->add('importer_sync', ['label' => __('Run Importer Sync'), 'onclick' => 'setLocation(\'' . $this->getImporterLink() . '\')', 'class' => 'primary']); }
/** * Initialize object state with incoming parameters * * @return void */ protected function _construct() { parent::_construct(); if ($this->hasData(self::PARAM_BLOCK_GROUP)) { $this->_blockGroup = $this->_getData(self::PARAM_BLOCK_GROUP); } if ($this->hasData(self::PARAM_BUTTON_NEW)) { $this->_addButtonLabel = $this->_getData(self::PARAM_BUTTON_NEW); } else { // legacy logic to support all descendants if ($this->_addButtonLabel === null) { $this->_addButtonLabel = __('Add New'); } $this->_addNewButton(); } if ($this->hasData(self::PARAM_BUTTON_BACK)) { $this->_backButtonLabel = $this->_getData(self::PARAM_BUTTON_BACK); } else { // legacy logic if ($this->_backButtonLabel === null) { $this->_backButtonLabel = __('Back'); } } }
/** * Add back button * * @return void */ protected function _construct() { parent::_construct(); $this->buttonList->add('back', ['label' => __('Back'), 'onclick' => "setLocation('" . $this->_urlBuilder->getUrl('avatax/log') . "')", 'class' => 'back']); }
/** * Class constructor * * @return void */ protected function _construct() { $this->addData([\Magento\Backend\Block\Widget\Container::PARAM_CONTROLLER => 'adminhtml_studio', \Magento\Backend\Block\Widget\Grid\Container::PARAM_BLOCK_GROUP => 'Dotdigitalgroup_Email', \Magento\Backend\Block\Widget\Container::PARAM_HEADER_TEXT => __('Automation Studio')]); parent::_construct(); }
/** * @return void */ protected function _construct() { parent::_construct(); $this->buttonList->add('back', array('label' => __('Back'), 'onclick' => 'window.location.href=\'' . $this->getUrl('*/*/') . '\'', 'class' => 'back')); $this->buttonList->add('edit', array('label' => __('Edit'), 'class' => 'edit', 'onclick' => 'window.location.href=\'' . $this->getEditUrl() . '\'')); }