![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/app/code/Xtento/StockImport/Block/Adminhtml/Log/ |
<?php /** * Product: Xtento_StockImport * ID: u66QkJ5rBwmimhUzUElhIKqqWRvsbhC3WLqSMk5AjmQ= * Last Modified: 2019-02-05T17:10:52+00:00 * File: app/code/Xtento/StockImport/Block/Adminhtml/Log/Grid.php * Copyright: Copyright (c) XTENTO GmbH & Co. KG <[email protected]> / All rights reserved. */ namespace Xtento\StockImport\Block\Adminhtml\Log; class Grid extends \Magento\Backend\Block\Widget\Grid { /** * @return void * @SuppressWarnings(PHPMD.NPathComplexity) */ protected function _construct() { parent::_construct(); if ($this->getRequest()->getParam('ajax_enabled', 0) == 1) { $this->setData('use_ajax', true); $this->setData('grid_url', $this->getUrl('*/log/grid', ['_current' => 1])); } else { $this->setData('use_ajax', false); } } protected function getFormMessages() { $formMessages = [ [ 'type' => 'notice', 'message' => __('All imports are logged here. Use this to easily find failed imports.') ] ]; return $formMessages; } protected function _toHtml() { if ($this->getRequest()->getParam('ajax')) { return parent::_toHtml(); } return $this->_getFormMessages() . parent::_toHtml(); } protected function _getFormMessages() { $html = '<div id="messages"><div class="messages">'; foreach ($this->getFormMessages() as $formMessage) { $html .= '<div class="message message-' . $formMessage['type'] . ' ' . $formMessage['type'] . '"><div>' . $formMessage['message'] . '</div></div>'; } $html .= '</div></div>'; return $html; } }