本文整理匯總了PHP中Magento\Backend\Block\Widget\Form\Container::_prepareLayout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::_prepareLayout方法的具體用法?PHP Container::_prepareLayout怎麽用?PHP Container::_prepareLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Backend\Block\Widget\Form\Container
的用法示例。
在下文中一共展示了Container::_prepareLayout方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: _prepareLayout
/**
* Prepare layout
*
* @return \Magento\Framework\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
$this->_blockGroup = 'Magento_Theme';
$this->_controller = 'Adminhtml_System_Design_Theme';
$this->setId('theme_edit');
if (is_object($this->getLayout()->getBlock('page.title'))) {
$this->getLayout()->getBlock('page.title')->setPageTitle($this->getHeaderText());
}
/** @var $theme \Magento\Framework\View\Design\ThemeInterface */
$theme = $this->_getCurrentTheme();
if ($theme) {
if ($theme->isEditable()) {
$this->buttonList->add('save_and_continue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 1);
} else {
$this->buttonList->remove('save');
$this->buttonList->remove('reset');
}
if ($theme->isDeletable()) {
if ($theme->hasChildThemes()) {
$message = __('Are you sure you want to delete this theme?');
$onClick = sprintf("deleteConfirm('%s', '%s')", $message, $this->getUrl('adminhtml/*/delete', ['id' => $theme->getId()]));
$this->buttonList->update('delete', 'onclick', $onClick);
}
} else {
$this->buttonList->remove('delete');
}
}
return parent::_prepareLayout();
}
示例2: _preparelayout
/**
* Prepare layout.
* Adding save_and_continue button
*
* @return $this
*/
protected function _preparelayout()
{
$this->addButton('save_and_edit', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 100);
if (!$this->getWebhook()->getId()) {
$this->removeButton('delete');
}
return parent::_prepareLayout();
}
示例3: _prepareLayout
/**
* {@inheritdoc}
*
* @return $this
*/
protected function _prepareLayout()
{
$pageTitle = $this->getLayout()->createBlock('Magento\\Sales\\Block\\Adminhtml\\Order\\Create\\Header')->toHtml();
if (is_object($this->getLayout()->getBlock('page.title'))) {
$this->getLayout()->getBlock('page.title')->setPageTitle($pageTitle);
}
return parent::_prepareLayout();
}
示例4: _prepareLayout
public function _prepareLayout()
{
$this->_blockGroup = 'Remarkety_Mgconnector';
$this->_controller = 'adminhtml_queue';
$this->_headerText = __('Remarkety Configuration');
$this->_nameInLayout = 'mgconnectorconfig';
return parent::_prepareLayout();
}
示例5: _preparelayout
/**
* Prepare layout.
* Adding save_and_continue button
*
* @return $this
*/
protected function _preparelayout()
{
if ($this->getWidgetInstance()->isCompleteToCreate()) {
$this->buttonList->add('save_and_edit_button', array('label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 100);
} else {
$this->removeButton('save');
}
return parent::_prepareLayout();
}
示例6: _prepareLayout
/**
* Prepare the layout.
*
* @return $this
*/
protected function _prepareLayout()
{
$this->buttonList->remove('save');
$this->buttonList->remove('delete');
$this->buttonList->remove('reset');
$this->buttonList->add('send', ['label' => __('Send mail ...'), 'onclick' => "setLocation('{$this->getUrl('*/*/send', ['id' => $this->_mail->getId()])}')", 'class' => 'task']);
$this->buttonList->add('send_post', ['label' => __('Resend mail'), 'onclick' => "setLocation('{$this->getUrl('*/*/sendPost', ['id' => $this->_mail->getId()])}')", 'class' => 'task']);
return parent::_prepareLayout();
}
示例7: _prepareLayout
protected function _prepareLayout()
{
parent::_prepareLayout();
}
示例8: _prepareLayout
/**
* Prepare the layout.
*
* @return $this
*/
protected function _prepareLayout()
{
$customerId = $this->getCustomerId();
if (!$customerId || $this->_customerAccountService->canModify($customerId)) {
$this->buttonList->add('save_and_continue', array('label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 10);
}
return parent::_prepareLayout();
}
示例9: _prepareLayout
/**
* Prepare layout
*
* @return \Magento\Framework\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
$this->_formScripts[] = "\n function toggleEditor() {\n if (tinyMCE.getInstanceById('page_content') == null) {\n tinyMCE.execCommand('mceAddControl', false, 'content');\n } else {\n tinyMCE.execCommand('mceRemoveControl', false, 'content');\n }\n };\n ";
return parent::_prepareLayout();
}
示例10: _prepareLayout
protected function _prepareLayout()
{
$this->_formScripts[] = "\n require([\n 'jquery',\n 'mage/backend/form'\n ], function(\$) {\n var\n depends = {\n 0: '0000000',//sendmail\n 10: '1111111',//smtp\n 15: '1100000',//gmail\n 20: '1110000',//ses\n 30: '1100000' //mandrill\n };\n\n function toggleDepends(depend)\n {\n var prefix = 'service_',\n elements = ['user', 'password', 'email', 'host', 'port', 'secure', 'auth'];\n elements.each(function(id, index) {\n id = '#' + prefix + id;\n var el = \$(id).parents('.field');\n if (depend[index] == 1) {\n el.show();\n } else {\n el.hide();\n }\n });\n }\n\n \$('#service_type').change(function() {\n toggleDepends(depends[this.value]);\n });\n toggleDepends(depends[\$('#service_type').val()]);\n console.log('Initialize');\n });\n ";
return parent::_prepareLayout();
}
示例11: _prepareLayout
/**
* Prepare the layout.
*
* @return $this
*/
protected function _prepareLayout()
{
$customerId = $this->getCustomerId();
if (!$customerId || !$this->customerAccountManagement->isReadonly($customerId)) {
$this->buttonList->add('save_and_continue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 10);
}
return parent::_prepareLayout();
}
示例12: _prepareLayout
/**
* Prepare Layout Content
*/
protected function _prepareLayout()
{
$model = $this->coreRegistry->registry('easytab');
$values = $model->getData();
$values = isset($values['tab_id']) ? $this->jsonEncoder->encode($values) : 'false';
$this->_formScripts[] = "\n require([\n 'jquery',\n 'tabOptions'\n ], function (\$, tabOptions) {\n tabOptions.init('" . $this->getUrl("easytabs/*/loadOptions") . "', " . $values . ");\n });\n ";
return parent::_prepareLayout();
}
示例13: _prepareLayout
/**
* Initialize form
*
* @return $this
*/
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->addChild('form', 'Magento\\Paypal\\Block\\Adminhtml\\Settlement\\Details\\Form');
return $this;
}
示例14: _prepareLayout
public function _prepareLayout()
{
$this->_formScripts[] = "\n\t\t\trequire(['jquery'], function(\$){\n\t\t\t\twindow.openBannerPopupWindow = function (url) {\n\t\t\t\t\tvar left = (\$(document).width()-1000)/2, height= \$(document).height();\n\t\t\t\t\tvar create_banner_popupwindow = window.open(url, '_blank','width=1000,resizable=1,scrollbars=1,toolbar=1,'+'left='+left+',height='+height);\n\t\t\t\t\tvar windowFocusHandle = function(){\n\t\t\t\t\t\tif (create_banner_popupwindow.closed) {\n\t\t\t\t\t\t\tif (typeof bannerGridJsObject !== 'undefined' && create_banner_popupwindow.banner_id) {\n\t\t\t\t\t\t\t\tbannerGridJsObject.reloadParams['banner[]'].push(create_banner_popupwindow.banner_id + '');\n\t\t\t\t\t\t\t\t\$(edit_form.slider_banner).val(\$(edit_form.slider_banner).val() + '&' + create_banner_popupwindow.banner_id + '=' + Base64.encode('order_banner_slider=0'));\n\t\t\t\t \t\t\tbannerGridJsObject.setPage(create_banner_popupwindow.banner_id);\n\t\t\t\t \t\t}\n\t\t\t\t \t\t\$(window).off('focus',windowFocusHandle);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\$(create_banner_popupwindow).trigger('focus');\n\t\t\t\t\t\t\tcreate_banner_popupwindow.alert('" . __('You have to save banner and close this window!') . "');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\$(window).focus(windowFocusHandle);\n\t\t\t\t}\n\t\t\t});\n\t\t";
return parent::_prepareLayout();
}