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/redchamps/module-core/Block/Adminhtml/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/redchamps/module-core/Block/Adminhtml/Version.php
<?php
/**
 * Created by RedChamps.
 * User: rav
 * Date: 2018-12-20
 * Time: 14:41
 */
namespace RedChamps\Core\Block\Adminhtml;

use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Magento\Framework\Module\ModuleListInterface;
use RedChamps\Core\Model\Processor as Processor;

/*
 * Package: Core
 * Class: Version
 * Company: RedChamps
 * author: rav([email protected])
 * */
class Version extends Field
{
    /**
     * @var Processor
     */
    protected $processor;

    protected $messageManager;

    protected $moduleList;

    /**
     * @param ModuleListInterface $moduleList
     * @param Context $context
     * @param array $data
     */
    public function __construct(
        ModuleListInterface $moduleList,
        Processor $processor,
        Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
        $this->processor = $processor;
        $this->moduleList = $moduleList;
    }

    /**
     * Return heading block html
     * @param AbstractElement $element
     * @return string
     */
    public function render(AbstractElement $element)
    {
        $extensionName = $element->getLegend()->getText();
        $extensionDetails = $this->processor->getExtensionVersion($extensionName);
        $html = "";
        if (isset($extensionDetails['update_needed']) && $extensionDetails['update_needed']) {
            $css = "padding:22px 12px 20px 34px;position: relative;margin:0 0 10px 0;background-color:#e9fbdb";
            $html .= "<div
                        class='rc-update-notification'
                        style='{$css}'
                        >"
                        . __("New version")
                        . ' '
                        . __($extensionDetails['status_message'])
                        . ' '
                        . __($extensionDetails['notification_msg'])
                . '</div>';
        }

        return $html;
    }
}

Spamworldpro Mini