Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
menuaction.php
1<?php
2
4
7
13abstract class MenuAction implements Action
14{
20 protected ?string $className;
26 protected ?string $title;
27
31 final public static function getId(): ?string
32 {
33 return null;
34 }
35
39 final public function processRequest(HttpRequest $request): ?Result
40 {
41 return null;
42 }
43
49 abstract protected function getText(): string;
50
54 abstract protected function getMenu(): array;
55
59 public function getControl(array $rawFields): array
60 {
61 $result = [
62 'TEXT' => $this->getText(),
63 'MENU' => [],
64 ];
65
66 if (isset($this->className))
67 {
68 $result['ICONCLASS'] = $this->className;
69 }
70
71 if (isset($this->title))
72 {
73 $result['TITLE'] = $this->title;
74 }
75
76 foreach ($this->getMenu() as $subAction)
77 {
78 if ($subAction instanceof Action)
79 {
80 $control = $subAction->getControl($rawFields);
81 if (isset($control))
82 {
83 $result['MENU'][] = $control;
84 }
85 }
86 }
87
88 return $result;
89 }
90}
processRequest(HttpRequest $request)