本文整理汇总了PHP中Magento\Backend\Block\Widget::_prepareLayout方法的典型用法代码示例。如果您正苦于以下问题:PHP Widget::_prepareLayout方法的具体用法?PHP Widget::_prepareLayout怎么用?PHP Widget::_prepareLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Backend\Block\Widget
的用法示例。
在下文中一共展示了Widget::_prepareLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _prepareLayout
/**
* Preparing global layout
*
* You can redefine this method in child classes for changing layout
*
* @return $this
*/
protected function _prepareLayout()
{
\Magento\Framework\Data\Form::setElementRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Element', $this->getNameInLayout() . '_element'));
\Magento\Framework\Data\Form::setFieldsetRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Fieldset', $this->getNameInLayout() . '_fieldset'));
\Magento\Framework\Data\Form::setFieldsetElementRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Fieldset\\Element', $this->getNameInLayout() . '_fieldset_element'));
return parent::_prepareLayout();
}
示例2: _prepareLayout
/**
* Prepare layout
*
* @return $this
*/
protected function _prepareLayout()
{
$this->setData('opened', true);
$this->addChild('add_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Create New Option'), 'class' => 'add', 'id' => 'add_new_option', 'on_click' => 'bOption.add()']);
$this->setChild('options_box', $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Adminhtml\\Catalog\\Product\\Edit\\Tab\\Bundle\\Option', 'adminhtml.catalog.product.edit.tab.bundle.option'));
return parent::_prepareLayout();
}
示例3: _prepareLayout
/**
* @return AbstractBlock
*/
protected function _prepareLayout()
{
$this->addChild('uploader', 'Magento\\Backend\\Block\\Media\\Uploader');
$this->getUploader()->getConfig()->setUrl($this->_urlBuilder->addSessionParam()->getUrl('catalog/product_gallery/upload'))->setFileField('image')->setFilters(['images' => ['label' => __('Images (.gif, .jpg, .png)'), 'files' => ['*.gif', '*.jpg', '*.jpeg', '*.png']]]);
$this->_eventManager->dispatch('catalog_product_gallery_prepare_layout', ['block' => $this]);
return parent::_prepareLayout();
}
示例4: _prepareLayout
/**
* @return Widget
*/
protected function _prepareLayout()
{
$this->addChild('add_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Add New Option'), 'class' => 'add', 'id' => 'add_new_defined_option'));
$this->addChild('options_box', 'Magento\\Catalog\\Block\\Adminhtml\\Product\\Edit\\Tab\\Options\\Option');
$this->addChild('import_button', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Import Options'), 'class' => 'add', 'id' => 'import_new_defined_option'));
return parent::_prepareLayout();
}
示例5: _prepareLayout
/**
* {@inheritdoc}
*/
protected function _prepareLayout()
{
$this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('adminhtml/*/') . '\')', 'class' => 'back']);
if ($this->getDesignChangeId()) {
$this->getToolbar()->addChild('delete_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Delete'), 'onclick' => 'deleteConfirm(\'' . __('Are you sure?') . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'delete']);
}
$this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Save'), 'class' => 'save primary', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'save', 'target' => '#design-edit-form']]]]);
return parent::_prepareLayout();
}
示例6: _prepareLayout
/**
* Prepare layout object
*
* @return \Magento\Framework\View\Element\AbstractBlock
*/
protected function _prepareLayout()
{
/** @var $section \Magento\Backend\Model\Config\Structure\Element\Section */
$section = $this->_configStructure->getElement($this->getRequest()->getParam('section'));
$this->_formBlockName = $section->getFrontendModel();
if (empty($this->_formBlockName)) {
$this->_formBlockName = self::DEFAULT_SECTION_BLOCK;
}
$this->setTitle($section->getLabel());
$this->setHeaderCss($section->getHeaderCss());
$this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', array('id' => 'save', 'label' => __('Save Config'), 'class' => 'save primary', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#config-edit-form')))));
$block = $this->getLayout()->createBlock($this->_formBlockName);
$this->setChild('form', $block);
return parent::_prepareLayout();
}
示例7: _prepareLayout
/**
* Preparing block layout
*
* @return $this
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
protected function _prepareLayout()
{
// Load Wysiwyg on demand and Prepare layout
// $block = $this->getLayout()->getBlock('head');
// if ($this->_wysiwygConfig->isEnabled() && $block) {
// $block->setCanLoadTinyMce(true);
// }
$this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'action-back']);
$this->getToolbar()->addChild('reset_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Reset'), 'onclick' => 'window.location.href = window.location.href', 'class' => 'reset']);
if (!$this->isTextType()) {
$this->getToolbar()->addChild('to_plain_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Convert to Plain Text'), 'data_attribute' => ['role' => 'template-strip'], 'id' => 'convert_button', 'class' => 'convert']);
$this->getToolbar()->addChild('to_html_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Return HTML Version'), 'data_attribute' => ['role' => 'template-unstrip'], 'id' => 'convert_button_back', 'style' => 'display:none', 'class' => 'return']);
}
$this->getToolbar()->addChild('preview_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Preview Template'), 'data_attribute' => ['role' => 'template-preview'], 'class' => 'preview']);
if ($this->getEditMode()) {
$this->getToolbar()->addChild('delete_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Delete Template'), 'data_attribute' => ['role' => 'template-delete'], 'class' => 'delete']);
$this->getToolbar()->addChild('save_as_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Save As'), 'data_attribute' => ['role' => 'template-save-as'], 'class' => 'save-as']);
}
$this->getToolbar()->addChild('save_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Save Template'), 'data_attribute' => ['role' => 'template-save'], 'class' => 'save primary']);
return parent::_prepareLayout();
}
示例8: _prepareLayout
/**
* Create search grid
*
* @return $this
*/
protected function _prepareLayout()
{
$this->setChild('grid', $this->getLayout()->createBlock('Magento\\Bundle\\Block\\Adminhtml\\Catalog\\Product\\Edit\\Tab\\Bundle\\Option\\Search\\Grid', 'adminhtml.catalog.product.edit.tab.bundle.option.search.grid'));
return parent::_prepareLayout();
}
示例9: _prepareLayout
/**
* Prepare Layout data
*
* @return $this
*/
protected function _prepareLayout()
{
$this->addChild('create_empty', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Create Empty'), 'class' => 'add', 'onclick' => 'superProduct.createEmptyProduct()'));
$this->addChild('super_settings', 'Magento\\ConfigurableProduct\\Block\\Adminhtml\\Product\\Edit\\Tab\\Super\\Settings');
$this->addChild('generate', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Generate Variations'), 'class' => 'generate', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'generate', 'target' => '#product-variations-matrix', 'eventData' => array('url' => $this->getUrl('catalog/product_generateVariations/index', array('_current' => true))))), 'action' => 'generate')));
$this->addChild('add_attribute', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Create New Variation Set'), 'class' => 'new-variation-set', 'data_attribute' => array('mage-init' => array('configurableAttribute' => array('url' => $this->getUrl('catalog/product_attribute/new', array('store' => $this->getProduct()->getStoreId(), 'product_tab' => 'variations', 'popup' => 1, '_query' => array('attribute' => array('is_global' => 1, 'frontend_input' => 'select', 'is_configurable' => 1)))))))));
$this->addChild('add_option', 'Magento\\Backend\\Block\\Widget\\Button', array('label' => __('Add Option'), 'class' => 'action- scalable add', 'data_attribute' => array('mage-init' => array('button' => array('event' => 'add-option')), 'action' => 'add-option')));
return parent::_prepareLayout();
}
示例10: _prepareLayout
/**
* Prepares layout and set element renderer
*
* @return $this
*/
protected function _prepareLayout()
{
$this->pageConfig->addPageAsset('jquery/fileUploader/css/jquery.fileupload-ui.css');
return parent::_prepareLayout();
}
示例11: _prepareLayout
/**
* @return $this
*/
protected function _prepareLayout()
{
$this->setData('opened', $this->isDownloadable());
return parent::_prepareLayout();
}
示例12: _prepareLayout
/**
* @return $this
*/
protected function _prepareLayout()
{
$this->setChild('option_price_type', $this->getLayout()->addBlock('Magento\\Framework\\View\\Element\\Html\\Select', $this->getNameInLayout() . '.option_price_type', $this->getNameInLayout())->setData(['id' => 'product_option_<%- data.option_id %>_price_type', 'class' => 'select product-option-price-type']));
$this->getChildBlock('option_price_type')->setName('product[options][<%- data.option_id %>][price_type]')->setOptions($this->_optionPrice->toOptionArray());
return parent::_prepareLayout();
}
示例13: _prepareLayout
/**
* @return $this
*/
protected function _prepareLayout()
{
$this->_prepareData();
return parent::_prepareLayout();
}
示例14: _prepareLayout
/**
* Prepares layout and set element renderer
*
* @return $this
*/
protected function _prepareLayout()
{
$head = $this->getLayout()->getBlock('head');
if ($head) {
$head->addChild('jquery-fileUploader-css-jquery-fileupload-ui-css', 'Magento\\Theme\\Block\\Html\\Head\\Css', array('file' => 'jquery/fileUploader/css/jquery.fileupload-ui.css'));
}
return parent::_prepareLayout();
}
示例15: _prepareLayout
/**
* Add elements in layout
*
* @return $this
*/
protected function _prepareLayout()
{
if (!$this->getRequest()->getParam('popup')) {
if ($this->getToolbar()) {
$this->getToolbar()->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Back'), 'title' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/', ['store' => $this->getRequest()->getParam('store', 0)]) . '\')', 'class' => 'action-back']);
}
} else {
$this->addChild('back_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Close Window'), 'onclick' => 'window.close()', 'class' => 'cancel']);
}
if (!$this->getProduct()->isReadonly()) {
$this->addChild('reset_button', 'Magento\\Backend\\Block\\Widget\\Button', ['label' => __('Reset'), 'onclick' => 'setLocation(\'' . $this->getUrl('catalog/*/*', ['_current' => true]) . '\')']);
}
if (!$this->getProduct()->isReadonly() && $this->getToolbar()) {
$this->getToolbar()->addChild('save-split-button', 'Magento\\Backend\\Block\\Widget\\Button\\SplitButton', ['id' => 'save-split-button', 'label' => __('Save'), 'class_name' => 'Magento\\Backend\\Block\\Widget\\Button\\SplitButton', 'button_class' => 'widget-button-save', 'options' => $this->_getSaveSplitButtonOptions()]);
}
return parent::_prepareLayout();
}