public function __construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, \Xanka\Slider\Model\Resource\SlideshowData\CollectionFactory $slideshowDataFactory, \Xanka\Slider\Model\SlideshowFactory $slideshowFactory, array $data = []) { $this->_slideshowDataFactory = $slideshowDataFactory; $this->_slideshowFactory = $slideshowFactory; $this->_coreRegistry = $registry; parent::__construct($context, $data); }
/** * 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 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 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(); }
public function __construct() { parent::__construct(); $this->setId('ddg_rules_tabs'); $this->setDestElementId('edit_form'); $this->setTitle(__('Exclusion Rule')); }
protected function _getElementHtml($element) { $element->setData('onchange', "apiValidation(this.form, this);"); $url = $this->getUrl('*/connector/ajaxvalidation'); $element->setData('after_element_html', "\n <script>\n document.observe('dom:loaded', function(){\n apiValidation();\n\n });\n function apiValidation(form, element) {\n var api_user = \$('connector_transactional_emails_credentials_api_username');\n var api_password = \$('connector_transactional_emails_credentials_api_password');\n var reloadurl = '{$url}';\n var encoded = btoa(api_password.value);\n new Ajax.Request(reloadurl, {\n method: 'post',\n parameters: {'api_username' : api_user.value, 'api_password' : encoded},\n onComplete: function(transport) {\n Element.hide('loadingmask');\n if(transport.responseText == '\"Credentials Valid.\"'){\n api_user.setStyle({\n fontWeight: 'bold',\n color: 'green' ,\n background: 'transparent url(\"" . $this->getSkinUrl('images/success_msg_icon.gif') . "\") no-repeat right center'\n })\n }else{\n api_user.setStyle({\n fontWeight: 'bold',\n color: 'red',\n background: 'transparent url(\"" . $this->getSkinUrl('images/error_msg_icon.gif') . "\") no-repeat right center'\n });\n\n }\n }\n });\n\n return false;\n }\n\n </script>\n "); return parent::_getElementHtml($element); }
/** * @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(); }
protected function _construct() { $this->_blockGroup = 'Sugarcode_Test'; $this->_controller = 'adminhtml_lists'; $this->_headerText = __('Test Grid'); $this->_addButtonLabel = __('Add New Info'); parent::_construct(); }
public function __construct(\Magento\Backend\Block\Widget\Context $context) { parent::__construct($context); $this->_controller = 'adminhtml_rules'; $this->_blockGroup = 'dotdigitalgroup_email'; $this->_headerText = 'Email Exclusion Rule(s)'; $this->_addButtonLabel = 'Add New Rule'; }
protected function _prepareForm() { //@todo fix the form $form = ''; //new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getUrl('adminhtml/email_rules/save'), 'method' => 'post')); $form->setUseContainer(true); $this->setForm($form); return parent::_prepareForm(); }
/** * Initialize form * Add standard buttons * Add "Save and Continue" button */ public function __construct(\Magento\Framework\Registry $registry, \Magento\Backend\Block\Widget\Context $context) { $this->_registry = $registry; $this->_objectId = 'id'; $this->_blockGroup = 'ddg_automation'; $this->_controller = 'adminhtml_rules'; $data = []; parent::__construct($context, $data); $this->_addButton('save_and_continue_edit', array('class' => 'save', 'label' => __('Save and Continue Edit'), 'onclick' => 'editForm.submit($(\'edit_form\').action + \'back/edit/\')'), 10); }
/** * 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'); }
public function __construct(\Ess\M2ePro\Block\Adminhtml\Magento\Context\Widget $context, array $data = []) { $this->helperFactory = $context->getHelperFactory(); $this->modelFactory = $context->getModelFactory(); $this->activeRecordFactory = $context->getActiveRecordFactory(); $this->css = $context->getCss(); $this->jsPhp = $context->getJsPhp(); $this->js = $context->getJs(); $this->jsTranslator = $context->getJsTranslator(); $this->jsUrl = $context->getJsUrl(); parent::__construct($context, $data); }
/** * Render block html * * @return string */ protected function _toHtml() { $this->setTxnIdHtml($this->escapeHtml($this->_txn->getTxnId())); $this->setParentTxnIdUrlHtml($this->escapeHtml($this->getUrl('sales/transactions/view', ['txn_id' => $this->_txn->getParentId()]))); $this->setParentTxnIdHtml($this->escapeHtml($this->_txn->getParentTxnId())); $this->setOrderIncrementIdHtml($this->escapeHtml($this->_txn->getOrder()->getIncrementId())); $this->setTxnTypeHtml($this->escapeHtml($this->_txn->getTxnType())); $this->setOrderIdUrlHtml($this->escapeHtml($this->getUrl('sales/order/view', ['order_id' => $this->_txn->getOrderId()]))); $this->setIsClosedHtml($this->_txn->getIsClosed() ? __('Yes') : __('No')); $createdAt = strtotime($this->_txn->getCreatedAt()) ? $this->formatDate($this->_txn->getCreatedAt(), \IntlDateFormatter::MEDIUM, true) : __('N/A'); $this->setCreatedAtHtml($this->escapeHtml($createdAt)); return parent::_toHtml(); }
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']); }
/** * {@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(); }
/** * Get container buttons HTML * * Since buttons are set as children, we remove them as children after generating them * not to duplicate them in future * * @param null $area * @return string * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function getButtonsHtml($area = null) { if (null === $this->_buttonsHtml) { $this->_buttonsHtml = parent::getButtonsHtml(); $layout = $this->getLayout(); foreach ($this->getChildNames() as $name) { $alias = $layout->getElementAlias($name); if (false !== strpos($alias, '_button')) { $layout->unsetChild($this->getNameInLayout(), $alias); } } } return $this->_buttonsHtml; }
/** * 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']); }
/** * Render block html * * @return string */ protected function _toHtml() { $this->setTxnIdHtml($this->escapeHtml($this->_txn->getTxnId())); $this->setParentTxnIdUrlHtml($this->escapeHtml($this->getUrl('sales/transactions/view', array('txn_id' => $this->_txn->getParentId())))); $this->setParentTxnIdHtml($this->escapeHtml($this->_txn->getParentTxnId())); $this->setOrderIncrementIdHtml($this->escapeHtml($this->_txn->getOrder()->getIncrementId())); $this->setTxnTypeHtml($this->escapeHtml($this->_txn->getTxnType())); $this->setOrderIdUrlHtml($this->escapeHtml($this->getUrl('sales/order/view', array('order_id' => $this->_txn->getOrderId())))); $this->setIsClosedHtml($this->_txn->getIsClosed() ? __('Yes') : __('No')); $createdAt = strtotime($this->_txn->getCreatedAt()) ? $this->formatDate($this->_txn->getCreatedAt(), \Magento\Framework\Stdlib\DateTime\TimezoneInterface::FORMAT_TYPE_MEDIUM, true) : __('N/A'); $this->setCreatedAtHtml($this->escapeHtml($createdAt)); return parent::_toHtml(); }
/** * 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(); }
/** * {@inheritdoc} */ public function getHeaderCssClass() { return 'icon-head ' . parent::getHeaderCssClass(); }
protected function _prepareLayout() { return parent::_prepareLayout(); }
/** * Set title and a hack for tabs container * * @return \Magento\RecurringPayment\Block\Adminhtml\Payment\View */ protected function _beforeToHtml() { $payment = $this->_coreRegistry->registry('current_recurring_payment'); $this->_headerText = __('Recurring Payment # %1', $payment->getReferenceId()); $this->setViewHtml('<div id="' . $this->getDestElementId() . '"></div>'); return parent::_beforeToHtml(); }
/** * 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(); }
/** * 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(); }