25 if (!isset($fields[
'MODULE_ID']) || $fields[
'MODULE_ID'] !=
'iblock')
27 if (empty($fields[
'PARAM2']))
30 if (!isset(self::$catalogList[$fields[
'PARAM2']]))
32 self::$catalogList[$fields[
'PARAM2']] =
false;
33 $catalog = Catalog\CatalogIblockTable::getList(array(
34 'select' => array(
'IBLOCK_ID'),
35 'filter' => array(
'=IBLOCK_ID' => $fields[
'PARAM2'])
38 self::$catalogList[$fields[
'PARAM2']] = $catalog[
'IBLOCK_ID'];
42 if (!empty(self::$catalogList[$fields[
'PARAM2']]) && isset($fields[
'ITEM_ID']))
44 $fields[
'PARAMS'][
'iblock_section'] = array();
45 if (mb_strpos($fields[
'ITEM_ID'],
'S') ===
false)
47 $sections = Iblock\SectionElementTable::getList(array(
48 'select' => array(
'IBLOCK_SECTION_ID'),
49 'filter' => array(
'=IBLOCK_ELEMENT_ID' => $fields[
'ITEM_ID'],
'=ADDITIONAL_PROPERTY_ID' =>
null)
51 while ($section = $sections->fetch())
54 $nav = \CIBlockSection::getNavChain($fields[
'PARAM2'], $section[
'IBLOCK_SECTION_ID'], array(
'ID'));
55 while ($chain = $nav->fetch())
56 $fields[
'PARAMS'][
'iblock_section'][$chain[
'ID']] = $chain[
'ID'];
59 unset($section, $sections);
64 $nav = \CIBlockSection::getNavChain($fields[
'PARAM2'], preg_replace(
'#[^0-9]+#',
'', $fields[
"ITEM_ID"]), array(
'ID'));
65 while ($chain = $nav->fetch())
66 $fields[
'PARAMS'][
'iblock_section'][$chain[
'ID']] = $chain[
'ID'];
69 if (!empty($fields[
'PARAMS'][
'iblock_section']))
70 $fields[
'PARAMS'][
'iblock_section'] = array_values($fields[
'PARAMS'][
'iblock_section']);