1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
search.php
См. документацию.
1<?php
2namespace Bitrix\Catalog\Product;
3
4use Bitrix\Catalog,
5 Bitrix\Iblock;
6
13class Search
14{
15 protected static $catalogList = array();
16
23 public static function onBeforeIndex($fields)
24 {
25 if (!isset($fields['MODULE_ID']) || $fields['MODULE_ID'] != 'iblock')
26 return $fields;
27 if (empty($fields['PARAM2']))
28 return $fields;
29
30 if (!isset(self::$catalogList[$fields['PARAM2']]))
31 {
32 self::$catalogList[$fields['PARAM2']] = false;
34 'select' => array('IBLOCK_ID'),
35 'filter' => array('=IBLOCK_ID' => $fields['PARAM2'])
36 ))->fetch();
37 if (!empty($catalog))
38 self::$catalogList[$fields['PARAM2']] = $catalog['IBLOCK_ID'];
39 unset($catalog);
40 }
41
42 if (!empty(self::$catalogList[$fields['PARAM2']]) && isset($fields['ITEM_ID']))
43 {
44 $fields['PARAMS']['iblock_section'] = array();
45 if (mb_strpos($fields['ITEM_ID'], 'S') === false)
46 {
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)
50 ));
51 while ($section = $sections->fetch())
52 {
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'];
57 unset($chain, $nav);
58 }
59 unset($section, $sections);
60 }
61 else
62 {
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'];
67 unset($chain, $nav);
68 }
69 if (!empty($fields['PARAMS']['iblock_section']))
70 $fields['PARAMS']['iblock_section'] = array_values($fields['PARAMS']['iblock_section']);
71 }
72 return $fields;
73 }
74}
static $catalogList
Определения search.php:15
static onBeforeIndex($fields)
Определения search.php:23
static getList(array $parameters=array())
Определения datamanager.php:431
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$catalog
Определения iblock_catalog_edit.php:135
Определения content.php:3
$fields
Определения yandex_run.php:501