當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Container::_construct方法代碼示例

本文整理匯總了PHP中Magento\Backend\Block\Widget\Form\Container::_construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Container::_construct方法的具體用法?PHP Container::_construct怎麽用?PHP Container::_construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Backend\Block\Widget\Form\Container的用法示例。


在下文中一共展示了Container::_construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _construct

 /**
  * Internal constructor
  *
  * @return void
  */
 protected function _construct()
 {
     $this->_objectId = 'webhook_id';
     $this->_blockGroup = 'SweetTooth_Webhook';
     $this->_controller = 'system_webhook';
     parent::_construct();
 }
開發者ID:defyasdf,項目名稱:magento2-module-webhook,代碼行數:12,代碼來源:Edit.php

示例2: _construct

 protected function _construct()
 {
     $this->_objectId = 'api_key';
     $this->_blockGroup = 'Expressly_Expressly';
     $this->_controller = 'expressly_dashboard';
     parent::_construct();
 }
開發者ID:etwandro,項目名稱:magento2,代碼行數:7,代碼來源:Edit.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

 /**
  * 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

示例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: tien.uet.qh2011@gmail.com,  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

    /**
     * _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

示例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: _construct

 /**
  * Initialize cms page edit block
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_blockGroup = 'Ves_Setup';
     $this->_controller = 'adminhtml_export';
     $this->updateButton('save', 'label', __('Export Configuration'));
 }
開發者ID:rustamveer,項目名稱:magento2,代碼行數:12,代碼來源:Edit.php

示例9: _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', []);
     $this->buttonList->update('save', 'id', 'submit_order_top_button');
     if ($customerId === null || !$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 ($customerId === null) {
         $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() . '\')');
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:36,代碼來源:Create.php

示例10: _construct

 /**
  * @return void
  */
 protected function _construct()
 {
     $this->_objectId = 'id';
     $this->_controller = 'adminhtml';
     $this->_blockGroup = 'Magento_Customer';
     $customerId = $this->getCustomerId();
     if ($customerId && $this->_authorization->isAllowed('Magento_Sales::create')) {
         $this->buttonList->add('order', array('label' => __('Create Order'), 'onclick' => 'setLocation(\'' . $this->getCreateOrderUrl() . '\')', 'class' => 'add'), 0);
     }
     parent::_construct();
     $this->buttonList->update('save', 'label', __('Save Customer'));
     $this->buttonList->update('delete', 'label', __('Delete Customer'));
     if ($customerId && !$this->_customerAccountService->canModify($customerId)) {
         $this->buttonList->remove('save');
         $this->buttonList->remove('reset');
     }
     if (!$customerId || !$this->_customerAccountService->canDelete($customerId)) {
         $this->buttonList->remove('delete');
     }
     if ($customerId) {
         $url = $this->getUrl('customer/index/resetPassword', array('customer_id' => $customerId));
         $this->buttonList->add('reset_password', array('label' => __('Reset Password'), 'onclick' => 'setLocation(\'' . $url . '\')', 'class' => 'reset reset-password'), 0);
     }
     if ($customerId) {
         $url = $this->getUrl('customer/customer/invalidateToken', array('customer_id' => $customerId));
         $deleteConfirmMsg = __("Are you sure you want to revoke the customer\\'s tokens?");
         $this->buttonList->add('invalidate_token', array('label' => __('Force Sign-In'), 'onclick' => 'deleteConfirm(\'' . $deleteConfirmMsg . '\', \'' . $url . '\')', 'class' => 'invalidate-token'), 10);
     }
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:32,代碼來源:Edit.php

示例11: _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

示例12: _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

示例13: _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

示例14: _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

示例15: _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


注:本文中的Magento\Backend\Block\Widget\Form\Container::_construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。