<? 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="specialist">
        <?php if($arParams['BLOCK_TITLE']):?>
            <h2 class="title-block underline"><?php echo $arParams['BLOCK_TITLE']?></h2>
        <?php endif?>

            <div class="specialist__list">
            <? foreach ($arResult["ITEMS"] as $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="specialist__item  <?php if($arItem["PREVIEW_TEXT"]):?>specialist__item--text <?php endif?>" id="<?= $this->GetEditAreaId($arItem['ID']); ?>">
                    <?php if($arItem["PREVIEW_TEXT"]):?>
                        <?php echo $arItem["PREVIEW_TEXT"]?>
                    <?php else:?>
                        <a><img
                                    class="preview_picture"
                                    border="0"
                                    src="<?= $arItem["PREVIEW_PICTURE"]["SRC"] ?>"
                                    width="<?= $arItem["PREVIEW_PICTURE"]["WIDTH"] ?>"
                                    height="<?= $arItem["PREVIEW_PICTURE"]["HEIGHT"] ?>"
                                    alt="<?= $arItem["PREVIEW_PICTURE"]["ALT"] ?>"
                                    title="<?= $arItem["PREVIEW_PICTURE"]["TITLE"] ?>"
                            /></a>
                            <div class="specialist__info">
                                <p class="specialist__name"><?php echo $arItem['NAME']?></p>
                                <?php

                                if($arItem['PROPERTIES']['POSITION']['VALUE']):?>
                                    <p class="specialist__position"><?php echo $arItem['PROPERTIES']['POSITION']['VALUE']?></p>
                                <?php endif?>
                            </div>
                        <?php endif?>
                </div>
            <? endforeach; ?>
        </div>
    </section>
<?php endif;