);
    $arItemsBySectionID = CCache::GroupArrayBy(
        $arItems,
        [
            "MULTI" => "Y",
            "GROUP" => ["IBLOCK_SECTION_ID"]
        ]
    );

    if ($arSections)
    {
        $aMenuLinksExt = [];
        aspro::getSectionChilds(
            false,
            $arSections,
            $arSectionsByParentSectionID,
            $arItemsBySectionID,
            $aMenuLinksExt
        );
    } else
    {
        foreach ($arItems as $arItem)
        {
            $aMenuLinksExt[] = [
                $arItem["NAME"],
                $arItem["DETAIL_PAGE_URL"],
                [],
                [
                    "FROM_IBLOCK" => 1,
                    "DEPTH_LEVEL" => 1
                ]
Exemple #2
0
						<?if($arItem["DESCRIPTION"]):?>
							<?php 
echo $arItem["DESCRIPTION"];
?>
						<?else:?>
							<?php 
echo $FileName;
?>
						<?endif;?>
					</a>
					<?php 
echo GetMessage('CT_NAME_SIZE');
?>
:
					<?php 
echo aspro::filesize_format($arItem["FILE_SIZE"]);
?>
				</div>
			<?endforeach;?>
		</div>
	</div>
<?endif;?>	

<?// gallery?>
<?if($arResult["GALLERY"]):?>
	<div class="wraps">
		<h4><?php 
echo GetMessage("T_GALLERY");
?>
</h4>
		<div class="row galery">
<?
// get section names elements
foreach($arResult["ITEMS"] as $arItem){
	$arSectionsIDs[] = $arItem["IBLOCK_SECTION_ID"];
}
if($arSectionsIDs){
	$arSectionsIDs = array_unique($arSectionsIDs);
	$arSectionsTmp = aspro::cacheSection(false, array("IBLOCK_ID" => $arParams["IBLOCK_ID"], "ID" => $arSectionsIDs), false, array("ID", "NAME"));
	foreach($arSectionsTmp as $arSection){
		$arSections[$arSection["ID"]] = $arSection;
	}
}

foreach($arResult["ITEMS"] as $i => $arItem){
	$arItem['SECTION_NAME'] = $arSections[$arItem["IBLOCK_SECTION_ID"]]["NAME"];
	$arResult["ITEMS"][$i] = $arItem;
}
?>
<?$arResult = aspro::getChilds($arResult);?>
	
	if(!empty($arResult["PROPERTIES"]["PHOTOS"]["VALUE"])){
		foreach($arResult["PROPERTIES"]["PHOTOS"]["VALUE"] as $img){
			$arResult["GALLERY"][] = array(
				"DETAIL" => CFile::GetFileArray($img),
				"PREVIEW" => CFile::ResizeImageGet($img, array('width' => 310, 'height' => 255), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true),
				"THUMB" => CFile::ResizeImageGet($img , array('width' => 86, 'height' => 66), BX_RESIZE_IMAGE_PROPORTIONAL_ALT, true),
				"TITLE" => CFile::GetFileArray($img),
			);
		}
	}
}
$arSection = aspro::cacheSection(false, array("ID" => $arResult["IBLOCK_SECTION_ID"]), false, array("ID", "NAME"), true);
$arResult['SECTION_NAME'] = $arSection["NAME"];

if($arResult["DISPLAY_PROPERTIES"]){
	$arResult["CHARACTERISTICS"] = array();
	foreach($arResult["DISPLAY_PROPERTIES"] as $arProp){
		if(!in_array($arProp["CODE"], array('PERIOD', 'PHOTOS', 'DOCUMENTS', 'LINK_GOODS', 'LINK_STAFF', 'LINK_REVIEWS', 'LINK_PROJECTS', 'LINK_SERVICES', 'FORM_ORDER', 'FORM_QUESTION', 'PHOTOPOS'))){
			if(strlen($arProp["VALUE"]) || $arProp["VALUE"]){
				$arResult["CHARACTERISTICS"][] = $arProp;
			}
		}
	}
}

if(!empty($arResult["PROPERTIES"]["LINK_PROJECTS"]["VALUE"])){
	$arResult["PROJECTS"] =aspro:: getIBItems( $arResult["PROPERTIES"]["LINK_PROJECTS"]["VALUE"], "Y");
}

?>