• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/prop_element_list.php
  • Класс: CIBlockPropertyElementList
  • Вызов: CIBlockPropertyElementList::GetPropertyFieldHtmlMulty
static function GetPropertyFieldHtmlMulty($arProperty, $value, $strHTMLControlName)
{
	$max_n = 0;
	$values = array();
	if(is_array($value))
	{
		foreach($value as $property_value_id => $arValue)
		{
			if (is_array($arValue))
				$values[$property_value_id] = $arValue["VALUE"];
			else
				$values[$property_value_id] = $arValue;

			if(preg_match("/^n(\d+)$/", $property_value_id, $match))
			{
				if($match[1] > $max_n)
					$max_n = intval($match[1]);
			}
		}
	}

	$settings = CIBlockPropertyElementList::PrepareSettings($arProperty);
	if($settings["size"] > 1)
		$size = ' size="'.$settings["size"].'"';
	else
		$size = '';

	if($settings["width"] > 0)
		$width = ' style="width:'.$settings["width"].'px"';
	else
		$width = '';

	if($settings["multiple"]=="Y")
	{
		$bWasSelect = false;
		$options = CIBlockPropertyElementList::GetOptionsHtml($arProperty, $values, $bWasSelect);

		$html = '';
		$html .= '';
	}
	else
	{
		if(end($values) != "" || mb_substr(key($values), 0, 1) != "n")
			$values["n".($max_n+1)] = "";

		$name = $strHTMLControlName["VALUE"]."VALUE";

		$html = '';
		foreach($values as $property_value_id=>$value)
		{
			$html .= '';
		}
		$html .= '
'; $bWasSelect = false; $options = CIBlockPropertyElementList::GetOptionsHtml($arProperty, array($value), $bWasSelect); $html .= ''; $html .= '
'; $html .= ''; } return $html; }