$GLOBALS["arrFilterSearch"] = array(
"LOGIC" => "OR",
"PARAMS" => array(
"!SECTION_ID" => array_merge($GLOBALS["arProfile"]["UF_NEWS_SECTION"], $GLOBALS["arProfile"]["UF_VIDEO_SECTION"])
)
);
Ну так вы же добавите (уже добавили) его в индекс и тогда будет что фильтровать.
function BeforeIndexHandler($arFields)
{
if($arFields["MODULE_ID"] == "iblock")
{
if(array_key_exists("BODY", $arFields) && substr($arFields["ITEM_ID"], 0, 1) != "S")
{
$arFields["BODY"] = "";
if (CModule::IncludeModule('iblock'))
{
$rs = CIBlockElement::GetByID(intval($arFields['ITEM_ID']));
if ($ar = $rs->Fetch())
{
$arFields["SECTION_ID"] = $ar["IBLOCK_SECTION_ID"];
}
}
}
/*if (substr($arFields["ITEM_ID"], 0, 1) == "S")
{
$arFields['TITLE'] = "";
$arFields["BODY"] = "";
$arFields['TAGS'] = "";
}*/
//die(print_r($arFields));
}
return $arFields;
}
$arResult["SEARCH"] => array(
0 => array (
.......
"CUSTOM_KEY" => "CUSTOM_VALUE"
)
)
public static function beforeIndexHandler($arFields) {
if ($arFields["MODULE_ID"] == "iblock" && $arFields["PARAM2"] == IB_NEWS_EVENTS && substr($arFields["ITEM_ID"], 0, 1) != "S") {
$arFields["CUSTOM_KEY"] = "CUSTOM_VALUE";
}
return $arFields;
}