Spamworldpro Mini Shell
Spamworldpro


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/magento/module-admin-adobe-ims/Plugin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/vendor/magento/module-admin-adobe-ims/Plugin/AddAdobeImsLayoutHandlePlugin.php
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

namespace Magento\AdminAdobeIms\Plugin;

use Magento\Framework\View\Result\Layout;
use Magento\AdminAdobeIms\Service\ImsConfig;

/**
 * Plugin to add Adobe ims layout handle when module is active
 */
class AddAdobeImsLayoutHandlePlugin
{
    /** @var ImsConfig */
    private ImsConfig $adminImsConfig;

    /**
     * @param ImsConfig $adminImsConfig
     */
    public function __construct(
        ImsConfig $adminImsConfig
    ) {
        $this->adminImsConfig = $adminImsConfig;
    }

    /**
     * Add our admin hand only when on the login page and module is active
     *
     * @param Layout $subject
     * @param Layout $result
     * @return Layout
     */
    public function afterAddDefaultHandle(Layout $subject, Layout $result): Layout
    {
        if ($subject->getDefaultLayoutHandle() !== 'adminhtml_auth_login') {
            return $result;
        }

        if ($this->adminImsConfig->enabled() !== true) {
            return $result;
        }

        $result->addHandle('adobe_ims_login');
        return $result;
    }
}

Spamworldpro Mini