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/mageworx/module-xmlsitemap/Controller/Adminhtml/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-xmlsitemap/Controller/Adminhtml/Sitemap.php
<?php
/**
 * Copyright © MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace MageWorx\XmlSitemap\Controller\Adminhtml;

use Magento\Backend\App\Action;
use Magento\Backend\App\Action\Context;
use Magento\Backend\Model\View\Result\Page;
use MageWorx\XmlSitemap\Model\SitemapFactory as SitemapFactory;
use Magento\Framework\Registry;
use MageWorx\XmlSitemap\Model\Spi\SitemapResourceInterface;

abstract class Sitemap extends Action
{
    /**
     * Authorization level of a basic admin session
     *
     * @see _isAllowed()
     */
    const ADMIN_RESOURCE = 'MageWorx_XmlSitemap::sitemap';

    /**
     * Sitemap factory
     *
     * @var sitemapFactory
     */
    protected $sitemapFactory;

    /**
     * Core registry
     *
     * @var Registry
     */
    protected $coreRegistry;

    /**
     * @var SitemapResourceInterface
     */
    protected $sitemapResource;

    /**
     * Sitemap constructor.
     *
     * @param Context $context
     * @param Registry $registry
     * @param SitemapFactory $sitemapFactory
     * @param SitemapResourceInterface $sitemapResource
     */
    public function __construct(
        Context $context,
        Registry $registry,
        SitemapFactory $sitemapFactory,
        SitemapResourceInterface $sitemapResource
    ) {
        $this->coreRegistry    = $registry;
        $this->sitemapFactory  = $sitemapFactory;
        $this->sitemapResource = $sitemapResource;
        parent::__construct($context);
    }

    /**
     * @param int|null $sitemapId
     * @return \MageWorx\XmlSitemap\Model\Sitemap
     */
    protected function initSitemap($sitemapId = null)
    {
        $sitemapId = ($sitemapId === null) ? $this->getRequest()->getParam('sitemap_id') : $sitemapId;

        $sitemap = $this->sitemapFactory->create();
        if ($sitemapId) {
            $this->sitemapResource->load($sitemap, $sitemapId);
        }

        //graceful set to true for the split sitemap generation
        $this->coreRegistry->register('mageworx_xmlsitemap_sitemap', $sitemap, true);

        return $sitemap;
    }

    /**
     * @param Page $resultPage
     * @return Page
     */
    protected function initPage($resultPage)
    {
        $resultPage->setActiveMenu('MageWorx_XmlSitemap::sitemap')
                   ->addBreadcrumb(__('XML Sitemap by MageWorx'), __('XML Sitemap by MageWorx'));

        return $resultPage;
    }
}

Spamworldpro Mini