• Модуль: fileman
  • Путь к файлу: ~/bitrix/modules/fileman/lib/block/content/sliceconverter.php
  • Класс: BitrixFilemanBlockContentSliceConverter
  • Вызов: SliceConverter::toArray
static function toArray($string)
{
	$blockContent = new BlockContent();
	$pattern = '#'
		. '([sS,n]*?)'
		. '#';

	$matches = array();
	if(preg_match_all($pattern, $string, $matches))
	{
		$matchesCount = count($matches[0]);
		for($i = 0; $i < $matchesCount; $i++)
		{
			$section = trim($matches[1][$i]);
			$place = trim($matches[2][$i]);
			$value = trim($matches[3][$i]);

			$blockContent->add($section, $place, $value);
		}
	}

	return $blockContent;
}