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-seoall/Model/Source/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-seoall/Model/Source/EncryptedMetaRobots.php
<?php
/**
 * Copyright © MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace MageWorx\SeoAll\Model\Source;

/**
 * Class EncryptedMetaRobots
 *
 * Magento use "," for compact values of multi select field to config.
 * So we should use different delimiter inside meta robots.
 */
class EncryptedMetaRobots extends MetaRobots
{
    const META_ROBOTS_VALUE_DELIMITER = '|';

    /**
     * Get options in "key-value" format
     *
     * @return array
     */
    public function toArray()
    {
        $_tmpOptions = $this->toOptionArray();
        $_options = [];
        foreach ($_tmpOptions as $option) {
            $_options[$option['value']] = $option['label'];
        }
        return $_options;
    }

    /**
     * @return array
     */
    public function toOptionArray()
    {
        return $this->getAllOptions();
    }

    /**
     * Options getter
     *
     * @return array
     */
    public function getAllOptions()
    {
        $result = [];

        foreach (parent::getAllOptions() as $option) {

            if (!$option['value']) {
                continue;
            }

            $option['value'] = \str_replace(',', self::META_ROBOTS_VALUE_DELIMITER, $option['value']);

            $result[] = $option;
        }

//        var_dump($result); exit;

        return $result;
    }
}

Spamworldpro Mini