NexusLeads Webshell
NexusLeads


Server : LiteSpeed
System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : alsaif ( 1057)
PHP Version : 7.4.33
Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/alsaif/public_html/plugins/system/acf/ACF/Helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/alsaif/public_html/plugins/system/acf/ACF/Helpers/Yoo.php
<?php

/**
 * @author          Tassos Marinos <info@tassos.gr>
 * @link            http://www.tassos.gr
 * @copyright       Copyright © 2021 Tassos Marinos All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
 */

namespace ACF\Helpers;

defined('_JEXEC') or die;

use NRFramework\Functions;
use YOOtheme\Builder\Joomla\Fields\FieldsHelper;
use YOOtheme\Application as YooApplication;
use YOOtheme\Event;

class Yoo
{
    public static function initFieldParser()
    {
        // Ensure YOOtheme Pro is ready
        if (!class_exists(YooApplication::class, false))
        {
            return;
        }

        Event::on('source.com_fields.field', function($config, $field, $source, $context) {
            // If it's not an ACF Field, return current config
            if (substr($field->type, 0, 3) !== 'acf')
            {
                return $config;
            }

            // Get the helper class of the field
            $helperClass = '\ACF\Helpers\Fields\\' . ucfirst(substr($field->type, 3));

            // If it does not exist, return current config
            if (!class_exists($helperClass))
            {
                return $config;
            }

            // If the method does not have a resolve method, return current config
            if (!method_exists($helperClass, 'yooResolve'))
            {
                return $config;
            }

            $payload = [
                'extensions' => [
                    'call' => [
                        'func' => $helperClass . '::yooResolve',
                        'args' => ['context' => $context, 'field_id' => $field->id]
                    ]
                ],
            ] + $config;

            // Get and set the type
            $type = method_exists($helperClass, 'getYooType') ? $helperClass::getYooType($field, $source) : '';
            if (!empty($type))
            {
                $payload['type'] = $type;
            }

            return $payload;
        });
    }

    public static function getSubfield($id, $context)
    {
        static $fields = [];

        if (!isset($fields[$context]))
		{
            $fields[$context] = [];
			
            foreach (FieldsHelper::getFields($context, null, true) as $field)
			{
                $fields[$context][$field->id] = $field;
            }
        }

        return !empty($fields[$context][$id]) ? $fields[$context][$id] : null;
    }
}

NexusLeads