![]() 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/old/vendor/extmag/shiplab/Ui/Component/Action/ |
<?php /** * Copyright © Extmag. All rights reserved. */ namespace Extmag\Shiplab\Ui\Component\Action; use Extmag\Shiplab\Helper\Manager; use Extmag\Shiplab\Model\Source\CarrierCodes; use Magento\Framework\View\Element\UiComponent\ContextInterface; use Magento\Ui\Component\Action; class CreateLabelOrderGrid extends Action { /** * @var Manager */ protected $manager; /** * @var CarrierCodes */ protected $carrierCodes; /** * @param ContextInterface $context * @param Manager $manager * @param CarrierCodes $carrierCodes * @param array $components * @param array $data * @param null $actions */ public function __construct( ContextInterface $context, Manager $manager, CarrierCodes $carrierCodes, array $components = [], array $data = [], $actions = null ) { parent::__construct($context, $components, $data, $actions); $this->manager = $manager; $this->carrierCodes = $carrierCodes; } /** * @return void */ public function prepare() { parent::prepare(); $config = $this->getConfiguration(); foreach ($this->carrierCodes->toArray() as $code => $name) { if ($this->manager->getStoreConfig('shiplab_carriers/' . $code . '/enabled') == 1) { $config['actions'][] = [ 'type' => 'extmag_label_create_' . $code, 'label' => $name, 'url' => $this->context->getUrl( 'extmag_shiplab/label/massCreate/carrier_code/' . $code . '/order_sub_type/order' ), ]; } } $this->setData('config', $config); } }