• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/preset/selectproductpreset.php
  • Класс: BitrixSaleDiscountPresetSelectProductPreset
  • Вызов: SelectProductPreset::renderSections
protected function renderSections(State $state, $inputName, $multi = true)
{
	global $APPLICATION;

	$currentValue = array();

	$sectionIds = $state->get($inputName);
	if($sectionIds)
	{
		$sectionsIterator = SectionTable::getList(array(
			'select' => array('ID', 'NAME'),
			'filter' => array('@ID' => $sectionIds),
		));

		while($row = $sectionsIterator->fetch())
		{
			$currentValue[] = "{$row['NAME']} [{$row['ID']}]";
		}
	}

	ob_start();
	$APPLICATION->IncludeComponent(
		'bitrix:main.lookup.input',
		'iblockedit',
		array(
			'CONTROL_ID' => 'select_section',
			'INPUT_NAME' => $inputName .'[]',
			'INPUT_NAME_STRING' => 'inp_'. $inputName,
			'INPUT_VALUE_STRING' => implode("n", $currentValue),
			'START_TEXT' => Loc::getMessage('SALE_BASE_PRESET_TRY_TO_TEXT'),
			'MULTIPLE' => $multi? 'Y' : 'N',
			'MAX_WIDTH' => '200',
			'MIN_HEIGHT' => '100',
			'WITHOUT_IBLOCK' => 'Y',
			'FILTER' => 'Y',
			'TYPE' => 'SECTION',
		), null, array('HIDE_ICONS' => 'Y')
	);
	$htmlResult = ob_get_contents();
	ob_end_clean();

	return $htmlResult;
}