1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
sectionselectcontrol.php
См. документацию.
1<?php
2
4
7use CIBlockSection;
8
10{
11 private array $sectionTree;
12
13 abstract protected function getIblockId(): int;
14
15 protected function getSectionSelectControl(bool $withTopLevel): array
16 {
17 $dropdownSectionItems = [];
18
19 if ($withTopLevel)
20 {
21 $dropdownSectionItems[] = [
22 'NAME' => Loc::getMessage('IBLOCK_GRID_PANEL_UI_ACTIONS_ITEM_ELEMENT_GROUP_SECTION_TREE_TOP_LEVEL_NAME'),
23 'VALUE' => 0,
24 ];
25 }
26
27 if (!isset($this->sectionTree))
28 {
29 $this->sectionTree = [];
30
31 $rows = CIBlockSection::getTreeList(
32 [
33 'IBLOCK_ID' => $this->getIblockId(),
34 ],
35 [
36 'ID',
37 'NAME',
38 'DEPTH_LEVEL',
39 ]
40 );
41 while ($row = $rows->Fetch())
42 {
43 $margin = max((int)$row['DEPTH_LEVEL'], 1);
44 $this->sectionTree[] = [
45 'NAME' => str_repeat(' . ', $margin) . $row['NAME'],
46 'VALUE' => (int)$row['ID'],
47 ];
48 }
49 unset($row, $rows);
50 }
51
52 array_push($dropdownSectionItems, ...$this->sectionTree);
53
54 return [
55 'TYPE' => Types::DROPDOWN,
56 'ID' => 'section_id',
57 'NAME' => 'section_id',
58 'ITEMS' => $dropdownSectionItems,
59 ];
60 }
61}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(CSalePaySystemAction::GetParamValue('BACKGROUND', false)) $margin
Определения html.php:61
$rows
Определения options.php:264