403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/userfield/fieldset/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/modules/yandex.market/lib/ui/userfield/fieldset/helper.php
<?php

namespace Yandex\Market\Ui\UserField\Fieldset;

use Yandex\Market\Data\TextString;

class Helper
{
	public static function makeChildAttributes($userField, $type = 'row__child')
	{
		$attributes = [];

		if (static::hasParentFieldset($userField))
		{
			$attributes['class'] = static::getParentFieldsetName($userField, $type);
			$attributes['data-name'] = static::makeRelativeName($userField, $userField['FIELD_NAME']);
		}

		return $attributes;
	}

	public static function hasParentFieldset($userField)
	{
		return !empty($userField['SETTINGS']['PARENT_FIELDSET_BASE']);
	}

	public static function getParentFieldsetName($userField, $type)
	{
		$parentName = $userField['SETTINGS']['PARENT_FIELDSET_BASE'];

		return $parentName . '-' . $type;
	}

	public static function makeRelativeName($userField, $inputName)
	{
		if (empty($userField['SETTINGS']['PARENT_FIELDSET_NAME'])) { return $inputName; }

		$parentName = $userField['SETTINGS']['PARENT_FIELDSET_NAME'];
		$parentName = preg_replace('/\[]$/', '', $parentName);

		if (TextString::getPosition($inputName, $parentName) === 0)
		{
			$result = TextString::getSubstring(
				$inputName,
				TextString::getLength($parentName)
			);
			$result = preg_replace('/^\[\d+]/', '', $result); // remove collection index

			if (preg_match('/^\[([^]]+)]$/', $result, $simplifyMatches)) // remove root quotes
			{
				$result = $simplifyMatches[1];
			}
		}
		else
		{
			$result = $inputName;
		}

		return $result;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit