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/app/code/Soon/Social/Helper/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Soon/Social/Helper/Data.php
<?php
/**
 * This file is part of Soon_Social for Magento2.
 *
 * @license All rights reserved
 * @author Christophe SOON <[email protected]>
 * @category Soon
 * @package Soon_Social
 * @copyright Copyright (c) 2015 Agence Soon (http://www.agence-soon.fr)
 */

namespace Soon\Social\Helper;

use Magento\Customer\Model\Session;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\Message\ManagerInterface;
use Magento\Framework\Url;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;
use Monolog\Logger;

/**
 * Class Data
 * @package Soon\Social\Helper
 */
class Data extends AbstractHelper
{
    /**
     * @var ScopeConfigInterface
     */
    protected $_configInterface;

    /**
     * @var Logger
     */
    protected $_logger;

    /**
     * Data constructor.
     * @param Context $context
     * @param Session $session
     * @param Url $url
     * @param ManagerInterface $messageManager
     * @param StoreManagerInterface $storeManager
     */
    public function __construct(
        Context $context,
        Session $session,
        Url $url,
        ManagerInterface $messageManager,
        StoreManagerInterface $storeManager
    ) {
        parent::__construct($context);
        $this->_configInterface = $context->getScopeConfig();
        $this->_logger = new Logger('main');
    }

    /**
     * Get social platform product page link activation status
     *
     * @param string $platform
     * @param string $scopeType
     * @return bool
     */
    public function getPlatformProductPageActivation(
        $platform,
        $scopeType = ScopeInterface::SCOPE_STORE
    ) {
        return $this->_configInterface->isSetFlag(
            sprintf(
                Config::XML_PATH_DISPLAY_ON_PRODUCT_PAGE,
                $platform
            ),
            $scopeType
        );
    }

    /**
     * Retrieve Soon_Social store config
     *
     * @param $configPath
     * @param string $scopeType
     * @return string
     */
    public function getStoreConfig($configPath, $scopeType = ScopeInterface::SCOPE_STORE)
    {
        return $this->_configInterface->getValue(
            sprintf(
                Config::XML_PATH_SOCIAL.'/%s',
                $configPath
            ),
            $scopeType
        );
    }

    /**
     * @return bool
     */
    public function isFacebookLoginEnable()
    {
        return $this->_configInterface->getValue(
            Config::XML_PATH_IS_FACEBOOK_LOGIN_ENABLED,
            ScopeInterface::SCOPE_STORE
        );
    }

    /**
     * @return bool
     */
    public function isGoogleLoginEnable()
    {
        return $this->_configInterface->getValue(
            Config::XML_PATH_IS_GOOGLE_LOGIN_ENABLED,
            ScopeInterface::SCOPE_STORE
        );
    }
}

Spamworldpro Mini