13 private $beforeTitleHtml;
14 private $afterTitleHtml;
15 private $underTitleHtml;
16 private string $rightCustomHtml;
17 private $titleMinWidth;
18 private $titleMaxWidth;
19 private $favoriteStar =
true;
24 private $afterTitleButtons = [];
28 private $buttons = [];
29 private $filterButtons = [];
41 $this->options = $options;
43 if (isset($this->options[
'filter']))
45 $this->
addFilter($this->options[
'filter']);
66 if (is_array($button))
68 $button =
new Button($button);
71 if (!($button instanceof
Button))
78 $this->filterButtons[] = $button;
82 $this->afterTitleButtons[] = $button;
86 $this->buttons[] = $button;
92 foreach ($this->buttons as $i => $button)
96 unset($this->buttons[$i]);
100 foreach ($this->filterButtons as $i => $button)
104 unset($this->filterButtons[$i]);
112 switch ($buttonLocation)
115 $buttonList = $this->buttons;
118 $buttonList = $this->filterButtons;
124 $buttonList = $closure($buttonList);
125 if (!is_array($buttonList))
130 switch ($buttonLocation)
133 $this->buttons = $buttonList;
136 $this->filterButtons = $buttonList;
144 return (
bool)$this->favoriteStar;
149 $this->favoriteStar =
true;
156 $this->favoriteStar =
false;
164 $GLOBALS[
'APPLICATION']->includeComponent(
'bitrix:main.ui.filter',
'', $filterOptions);
165 $this->filter = ob_get_clean();
170 $this->filter = $filter;
175 return $this->filter;
180 $this->beforeTitleHtml = $html;
185 return $this->beforeTitleHtml;
190 $this->afterTitleHtml = $html;
195 return $this->afterTitleHtml;
200 $this->underTitleHtml = $html;
205 return $this->underTitleHtml;
210 $this->rightCustomHtml = $html;
215 return $this->rightCustomHtml ??
'';
223 return array_merge($this->afterTitleButtons, $this->filterButtons, $this->buttons);
228 return implode(array_map(
function(
Button $button) {
230 }, $this->afterTitleButtons));
235 return implode(array_map(
function(
Button $button) {
242 return implode(array_map(
function(
Button $button) {
244 }, $this->filterButtons));
258 $shouldAddThemeModifier = (bool)array_intersect($button->
getClassList(), [
259 'ui-btn-light-border',
264 if ($shouldAddThemeModifier)
269 return $button->
render(
false);
274 if (is_int($width) && $width > 0)
276 $this->titleMinWidth = $width;
282 return $this->titleMinWidth;
287 if (is_int($width) && $width > 0)
289 $this->titleMaxWidth = $width;
295 return $this->titleMaxWidth;