$arFields['BODY'] .= PHP_EOL.$arFile['DESCRIPTION'];
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('search', 'BeforeIndex', array('MySearch', 'BeforeIndex'));
class MySearch {
public static function BeforeIndex($arFields) {
if(intval($arFields['PARAM2']) == 34 && intval($arFields['ITEM_ID']) > 0 && isset($arFields['BODY'])) {
\Bitrix\Main\Loader::includeModule('iblock');
$dbRes = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $arFields['PARAM2'], 'ID' => $arFields['ITEM_ID']), false, false, array('PROPERTY_DOCUMENTS'));
while($arRes = $dbRes->Fetch()) {
$arFile = CFile::GetFileArray($arRes['PROPERTY_FILE_VALUE']);
$arFields['BODY'] .= PHP_EOL.$arFile['ORIGINAL_NAME'];
}
return $arFields;
}
}
}
$templateData = array(
'DOCUMENTS' => $arResult['DISPLAY_PROPERTIES']['DOCUMENTS']['VALUE']
);
<?if($templateData['DOCUMENTS']):?>
<?$counter_doc = 0;?>
<?foreach($templateData['DOCUMENTS'] as $docID):?>
<?if($counter_doc >= 3){break;}?>
<?$arItem = CPriority::get_file_info($docID);?>
<? print_r($arItem) ?>
<div class="item-wrap col-xs-12">
<?
$fileName = substr($arItem['ORIGINAL_NAME'], 0, strrpos($arItem['ORIGINAL_NAME'], '.'));
$fileTitle = (strlen($arItem['DESCRIPTION']) ? $arItem['DESCRIPTION'] : $fileName);
?>
<div class="blocks clearfix <?=$arItem["TYPE"];?>">
<div class="inner-wrapper">
<div class="title">
<a href="<?=$arItem['SRC']?>" class="dark-color text" target="_blank"><?=$fileTitle?></a>
</div>
<div class="filesize font_xs"><?=CPriority::filesize_format($arItem['FILE_SIZE']);?></div>
</div>
</div>
</div>
<?$counter_doc++?>
<?endforeach;?>
<?endif;?>
$('body').click(function(){
$('.wrap').removeClass('menu-active');
});
$(window).click(function(){
$('.wrap').removeClass('menu-active');
});
Одно из основных правил при работе с Git — никогда не делайте push в репозтирий, у которого есть рабочая копия.