本文整理汇总了PHP中Magento\Backend\Block\Widget\Form\Container类的典型用法代码示例。如果您正苦于以下问题:PHP Container类的具体用法?PHP Container怎么用?PHP Container使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Container类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _construct
protected function _construct()
{
$this->_objectId = 'api_key';
$this->_blockGroup = 'Expressly_Expressly';
$this->_controller = 'expressly_dashboard';
parent::_construct();
}
开发者ID:etwandro,项目名称:magento2,代码行数:7,代码来源:Edit.php
示例2: _construct
/**
* Prepare block
*/
public function _construct()
{
parent::_construct();
$this->_blockGroup = 'Remarkety_Mgconnector';
$this->_controller = 'adminhtml_queue';
$this->_headerText = $this->__('Queue Configuration');
}
开发者ID:remarkety,项目名称:mgconnector,代码行数:10,代码来源:Configure.php
示例3: _construct
/**
* Initialize cadou edit block
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'cadou_id';
$this->_blockGroup = 'Alin_Cadou';
$this->_controller = 'adminhtml_cadou';
parent::_construct();
if ($this->_isAllowedAction('Alin_Cadou::save')) {
$this->buttonList->update('save', 'label', __('Save'));
$this->buttonList->add('saveandcontinue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], -100);
} else {
$this->buttonList->remove('save');
}
if ($this->_isAllowedAction('Alin_Cadou::delete')) {
$this->buttonList->update('delete', 'label', __('Delete'));
} else {
$this->buttonList->remove('delete');
}
//TODO: see how to add /handle new event
if ($this->_isAllowedAction('Alin_Cadou::notify')) {
if ($this->_coreRegistry->registry('cadou')->getNotified() == false) {
$this->buttonList->add('notify', ['label' => __('Send notification'), 'class' => 'notify'], -100);
}
} else {
$this->buttonList->remove('notify');
}
}
开发者ID:alinmiron,项目名称:alin-cadou,代码行数:31,代码来源:Edit.php
示例4: _construct
/**
* _construct
* @return void
*/
protected function _construct()
{
$this->_objectId = 'banner_id';
$this->_blockGroup = 'Magestore_Bannerslider';
$this->_controller = 'adminhtml_banner';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Banner'));
$this->buttonList->update('delete', 'label', __('Delete'));
if ($this->getRequest()->getParam('current_slider_id')) {
$this->buttonList->remove('save');
$this->buttonList->remove('delete');
$this->buttonList->remove('back');
$this->buttonList->add('close_window', ['label' => __('Close Window'), 'onclick' => 'window.close();'], 10);
$this->buttonList->add('save_and_continue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'onclick' => 'customsaveAndContinueEdit()'], 10);
$this->buttonList->add('save_and_close', ['label' => __('Save and Close'), 'class' => 'save_and_close', 'onclick' => 'saveAndCloseWindow()'], 10);
$this->_formScripts[] = "\n\t\t\t\trequire(['jquery'], function(\$){\n\t\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\tvar input = \$('<input class=\"custom-button-submit\" type=\"submit\" hidden=\"true\" />');\n\t\t\t\t\t\t\$(edit_form).append(input);\n\n\t\t\t\t\t\twindow.customsaveAndContinueEdit = function (){\n\t\t\t\t\t\t\tedit_form.action = '" . $this->getSaveAndContinueUrl() . "';\n\t\t\t\t\t\t\t\$('.custom-button-submit').trigger('click');\n\n\t\t\t\t }\n\n\t\t\t \t\twindow.saveAndCloseWindow = function (){\n\t\t\t \t\t\tedit_form.action = '" . $this->getSaveAndCloseWindowUrl() . "';\n\t\t\t\t\t\t\t\$('.custom-button-submit').trigger('click');\n\t\t\t }\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t";
if ($bannerId = $this->getRequest()->getParam('banner_id')) {
$this->_formScripts[] = '
window.banner_id = ' . $bannerId . ';
';
}
} else {
$this->buttonList->add('save_and_continue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 10);
}
if ($this->getRequest()->getParam('saveandclose')) {
$this->_formScripts[] = 'window.close();';
}
}
开发者ID:OlgaBurtyka,项目名称:m2,代码行数:32,代码来源:Edit.php
示例5: _construct
protected function _construct()
{
$this->_objectId = 'slider_id';
$this->_blockGroup = 'Magestore_Bannerslider';
$this->_controller = 'adminhtml_slider';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Slider'));
$this->buttonList->update('delete', 'label', __('Delete'));
if ($this->getSlider()->getId()) {
$this->buttonList->add('create_banner', ['label' => __('Create Banner'), 'class' => 'add', 'onclick' => 'openBannerPopupWindow(\'' . $this->getCreateBannerUrl() . '\')'], 1);
}
$this->buttonList->add('save_and_continue', ['label' => __('Save and Continue Edit'), 'class' => 'save', 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 10);
/*
* Note by: Nguyen Huu Tien (Email: [email protected], Skype : zerokool12a8)
* javascript variable
* create_banner_popupwindow : window popup
* create_banner_popupwindow.banner_id : Id of banner after creating in popup
* bannerGridJsObject : grid object
* bannerGridJsObject.reloadParams['banner[]'] : An array contain Ids of banners, ex. Array [ "2", "30", "31", "32", .. ]
* edit_form: form
* edit_form.slider_banner: input for serialization
*
* See more at file magento2root/lib/web/mage/adminhtml/grid.js
*/
$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";
}
开发者ID:JakeSharp,项目名称:Bannerslider-Magento2,代码行数:26,代码来源:Edit.php
示例6: _construct
/**
* Add & remove control buttons
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'creditmemo_id';
$this->_controller = 'adminhtml_order_creditmemo';
$this->_mode = 'view';
parent::_construct();
$this->buttonList->remove('save');
$this->buttonList->remove('reset');
$this->buttonList->remove('delete');
if (!$this->getCreditmemo()) {
return;
}
if ($this->getCreditmemo()->canCancel()) {
$this->buttonList->add('cancel', ['label' => __('Cancel'), 'class' => 'delete', 'onclick' => 'setLocation(\'' . $this->getCancelUrl() . '\')']);
}
if ($this->_isAllowedAction('Magento_Sales::emails')) {
$this->addButton('send_notification', ['label' => __('Send Email'), 'class' => 'send-email', 'onclick' => 'confirmSetLocation(\'' . __('Are you sure you want to send a credit memo email to customer?') . '\', \'' . $this->getEmailUrl() . '\')']);
}
if ($this->getCreditmemo()->canRefund()) {
$this->buttonList->add('refund', ['label' => __('Refund'), 'class' => 'refund', 'onclick' => 'setLocation(\'' . $this->getRefundUrl() . '\')']);
}
if ($this->getCreditmemo()->canVoid()) {
$this->buttonList->add('void', ['label' => __('Void'), 'class' => 'void', 'onclick' => 'setLocation(\'' . $this->getVoidUrl() . '\')']);
}
if ($this->getCreditmemo()->getId()) {
$this->buttonList->add('print', ['label' => __('Print'), 'class' => 'print', 'onclick' => 'setLocation(\'' . $this->getPrintUrl() . '\')']);
}
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:33,代码来源:View.php
示例7: _construct
/**
* Constructor
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'order_id';
$this->_controller = 'order';
$this->_mode = 'create';
parent::_construct();
$this->setId('sales_order_create');
$customerId = $this->_sessionQuote->getCustomerId();
$storeId = $this->_sessionQuote->getStoreId();
$this->buttonList->update('save', 'label', __('Submit Order'));
$this->buttonList->update('save', 'onclick', 'order.submit()');
$this->buttonList->update('save', 'class', 'primary');
// Temporary solution, unset button widget. Will have to wait till jQuery migration is complete
$this->buttonList->update('save', 'data_attribute', array());
$this->buttonList->update('save', 'id', 'submit_order_top_button');
if (is_null($customerId) || !$storeId) {
$this->buttonList->update('save', 'style', 'display:none');
}
$this->buttonList->update('back', 'id', 'back_order_top_button');
$this->buttonList->update('back', 'onclick', 'setLocation(\'' . $this->getBackUrl() . '\')');
$this->buttonList->update('reset', 'id', 'reset_order_top_button');
if (is_null($customerId)) {
$this->buttonList->update('reset', 'style', 'display:none');
} else {
$this->buttonList->update('back', 'style', 'display:none');
}
$confirm = __('Are you sure you want to cancel this order?');
$this->buttonList->update('reset', 'label', __('Cancel'));
$this->buttonList->update('reset', 'class', 'cancel');
$this->buttonList->update('reset', 'onclick', 'deleteConfirm(\'' . $confirm . '\', \'' . $this->getCancelUrl() . '\')');
$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);
}
}
开发者ID:aiesh,项目名称:magento2,代码行数:40,代码来源:Create.php
示例8: addButton
/**
* {@inheritdoc}
*/
public function addButton($buttonId, $data, $level = 0, $sortOrder = 0, $region = 'toolbar')
{
if ($this->getRequest()->getParam('popup')) {
$region = 'header';
}
parent::addButton($buttonId, $data, $level, $sortOrder, $region);
}
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Edit.php
示例9: _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();
}
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:34,代码来源:Edit.php
示例10: _prepareLayout
public function _prepareLayout()
{
$this->_blockGroup = 'Remarkety_Mgconnector';
$this->_controller = 'adminhtml_queue';
$this->_headerText = __('Remarkety Configuration');
$this->_nameInLayout = 'mgconnectorconfig';
return parent::_prepareLayout();
}
开发者ID:remarkety,项目名称:mgconnector,代码行数:8,代码来源:Configuration.php
示例11: _construct
/**
* Internal constructor
*
* @return void
*/
protected function _construct()
{
parent::_construct();
$this->removeButton('back')->removeButton('reset')->removeButton('save');
$this->_objectId = 'export_id';
$this->_blockGroup = 'Magento_ImportExport';
$this->_controller = 'adminhtml_export';
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Edit.php
示例12: _construct
/**
* Initialize form
* Add standard buttons
* Add "Save and Continue" button
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'id';
$this->_controller = 'adminhtml_promo_quote';
$this->_blockGroup = 'Magento_SalesRule';
parent::_construct();
$this->buttonList->add('save_and_continue_edit', array('class' => 'save', 'label' => __('Save and Continue Edit'), 'data_attribute' => array('mage-init' => array('button' => array('event' => 'saveAndContinueEdit', 'target' => '#edit_form')))), 10);
}
开发者ID:aiesh,项目名称:magento2,代码行数:15,代码来源:Edit.php
示例13: _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();
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Create.php
示例14: _construct
/**
* Init container
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'sitemap_id';
$this->_controller = 'adminhtml';
$this->_blockGroup = 'Magento_Sitemap';
parent::_construct();
$this->buttonList->add('generate', array('label' => __('Save & Generate'), 'data_attribute' => array('mage-init' => array('button' => array('event' => 'save', 'target' => '#edit_form', 'eventData' => array('action' => array('args' => array('generate' => '1')))))), 'class' => 'add'));
}
开发者ID:aiesh,项目名称:magento2,代码行数:13,代码来源:Edit.php
示例15: getFormHtml
/**
* Return form HTML
*
* @return string
*/
public function getFormHtml()
{
$formHtml = parent::getFormHtml();
if (!$this->_storeManager->isSingleStoreMode() && $this->getWebhook()->getId()) {
$formHtml = $formHtml;
}
return $formHtml;
}
开发者ID:defyasdf,项目名称:magento2-module-webhook,代码行数:13,代码来源:Edit.php
示例16: _construct
/**
* Internal constructor
*
* @SuppressWarnings(PHPMD.CamelCaseMethodName)
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'id';
$this->_blockGroup = 'Smile_ElasticsuiteThesaurus';
$this->_controller = 'adminhtml_thesaurus';
parent::_construct();
$this->buttonList->update('save', 'label', __('Create Thesaurus'));
}
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:15,代码来源:Create.php
示例17: _construct
/**
* Initialize form
* Add standard buttons
* Add "Save and Continue" button
*
* @return void
*/
protected function _construct()
{
$this->_objectId = 'id';
$this->_controller = 'adminhtml_banners';
$this->_blockGroup = 'TanDinh_Banner';
parent::_construct();
$this->buttonList->add('save_and_continue_edit', ['class' => 'save', 'label' => __('Save and Continue Edit'), 'data_attribute' => ['mage-init' => ['button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form']]]], 10);
}
开发者ID:kietluu,项目名称:magento2-backend-training,代码行数:15,代码来源:Edit.php
示例18: _construct
/**
* {@inheritdoc}
*/
protected function _construct()
{
$this->_blockGroup = 'Mirasvit_Search';
$this->_controller = 'adminhtml_stopword';
$this->_mode = 'import';
parent::_construct();
$this->buttonList->update('save', 'label', __('Import'));
}
开发者ID:Doability,项目名称:magento2dev,代码行数:11,代码来源:Import.php
示例19: _construct
/**
* @return void
*/
protected function _construct()
{
$this->_objectId = 'order_id';
$this->_mode = 'create';
parent::_construct();
$this->buttonList->remove('save');
$this->buttonList->remove('delete');
}
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:11,代码来源:Create.php
示例20: _construct
/**
* @return void
*/
protected function _construct()
{
$this->_objectId = 'id';
$this->_blockGroup = 'Magento_Search';
$this->_controller = 'adminhtml_term';
parent::_construct();
$this->buttonList->update('save', 'label', __('Save Search'));
$this->buttonList->update('delete', 'label', __('Delete Search'));
}
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:12,代码来源:Edit.php
注:本文中的Magento\Backend\Block\Widget\Form\Container类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论