<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** @var array $arParams */
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var CBitrixComponent $component */
$this->setFrameMode(true);

if($arResult["ITEMS"]):?>

<section class="product-faq product-container">
	<h2 class="product-faq__title product-title-block underline">Вопросы и ответы</h2>
    <div class="accordion" data-accordion="parent" data-single="data-single">
        <?foreach($arResult["ITEMS"] as $i=>$arItem):?>
		<?
		$this->AddEditAction($arItem['ID'], $arItem['EDIT_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_EDIT"));
		$this->AddDeleteAction($arItem['ID'], $arItem['DELETE_LINK'], CIBlock::GetArrayByID($arItem["IBLOCK_ID"], "ELEMENT_DELETE"), array("CONFIRM" => GetMessage('CT_BNL_ELEMENT_DELETE_CONFIRM')));
		?>
		<div class="accordion__element" data-accordion="element" id="<?=$this->GetEditAreaId($arItem['ID']);?>">
			<button class="accordion__button" type="button" data-accordion="button"><span class="accordion__button-count"><?php echo ++$i?></span><?php echo $arItem["NAME"]?></button>
		    <div class="accordion__content" data-accordion="content">
		      <div class="accordion__wrapper">
		        <?php echo $arItem["PREVIEW_TEXT"]?>
		      </div>
		    </div>
		</div>
        <?endforeach; ?>
    </div>
</section>

<?endif;
?>

