3namespace Bitrix\UI\Toolbar;
5use Bitrix\Main\ArgumentTypeException;
6use Bitrix\Main\UI\Filter\Theme;
7use Bitrix\UI\Buttons\AirButtonStyle;
8use Bitrix\UI\Buttons\BaseButton;
9use Bitrix\UI\Buttons\Button;
10use Bitrix\UI\Buttons\Color;
11use Bitrix\UI\Buttons\Size;
12use Bitrix\UI\Buttons\Icon;
18 private ?
string $title =
null;
19 private bool $isMultiLineTitleEnabled =
false;
20 private ?
string $beforeTitleBoxHtml =
null;
21 private $beforeTitleHtml;
22 private $afterTitleHtml;
23 private $underTitleHtml;
24 private string $rightCustomHtml;
25 private array $rightCustomHtmlOptions = [];
26 private $titleMinWidth;
27 private $titleMaxWidth;
28 private bool $isTitleNoShrink =
false;
29 private $titleVisibility =
true;
30 private $favoriteStar =
true;
31 private bool $editableTitle =
false;
32 private string $defaultEditableTitle;
34 private ?
array $copyLinkButtonParams =
null;
35 private $enabled =
true;
40 private $afterTitleButtons = [];
44 private $buttons = [];
45 private $filterButtons = [];
57 $this->options = $options;
59 if (isset($this->options[
'filter']))
61 $this->
addFilter($this->options[
'filter']);
67 return $this->enabled;
72 $this->enabled =
true;
77 $this->enabled =
false;
82 $this->
title = $title;
85 public function getTitle($propertyName =
false, $stripTags =
false): string
87 if ($this->
title !==
null)
92 $title =
$GLOBALS[
'APPLICATION']->getTitle($propertyName, $stripTags);
94 return is_string($title) ? $title :
'';
99 $this->titleVisibility =
false;
104 return $this->titleVisibility;
109 $this->defaultEditableTitle = $defaultTitle ??
'';
110 $this->editableTitle =
true;
116 ? $this->defaultEditableTitle
131 return $this->editableTitle;
151 if (is_array($button))
153 $button =
new Button($button);
158 $button->setAirDesign(
true);
159 $button->setNoCaps(
true);
160 if ($button->getIcon() && $button->hasCollapsedIcon() ===
false)
163 $button->setIcon($button->getIcon());
166 if ($button->getStyle() ===
null && $button->getColor() !==
null)
172 $button->setSize(Size::SMALL);
178 && $button->getIcon() ===
null
185 if (!($button instanceof
Button))
192 $this->filterButtons[] = $button;
196 $this->afterTitleButtons[] = $button;
200 $this->buttons[] = $button;
206 foreach ($this->buttons as
$i => $button)
210 unset($this->buttons[
$i]);
214 foreach ($this->filterButtons as
$i => $button)
218 unset($this->filterButtons[
$i]);
222 foreach ($this->afterTitleButtons as
$i => $button)
226 unset($this->afterTitleButtons[
$i]);
234 switch ($buttonLocation)
237 $buttonList = $this->buttons;
240 $buttonList = $this->filterButtons;
246 $buttonList = $closure($buttonList);
247 if (!is_array($buttonList))
252 switch ($buttonLocation)
255 $this->buttons = $buttonList;
258 $this->filterButtons = $buttonList;
266 return (
bool)$this->favoriteStar;
271 $this->favoriteStar =
true;
278 $this->favoriteStar =
false;
289 $updatedFilterOptions = [
291 'THEME' => Theme::AIR,
294 if (isset($updatedFilterOptions[
'CONFIG']) ===
false)
296 $updatedFilterOptions[
'CONFIG'] = [];
299 $updatedFilterOptions[
'CONFIG'][
'AUTOFOCUS'] =
false;
301 $GLOBALS[
'APPLICATION']->includeComponent(
'bitrix:main.ui.filter',
'', $updatedFilterOptions);
308 $this->filter = ob_get_clean();
313 $this->filter = $filter;
323 $this->beforeTitleBoxHtml = $html;
328 return $this->beforeTitleBoxHtml;
333 $this->beforeTitleHtml = $html;
338 return $this->beforeTitleHtml;
343 $this->afterTitleHtml = $html;
348 return $this->afterTitleHtml;
353 $this->underTitleHtml = $html;
358 return $this->underTitleHtml;
363 $this->rightCustomHtml = $html;
364 $this->rightCustomHtmlOptions = $options;
369 return $this->rightCustomHtml ??
'';
374 return $this->rightCustomHtmlOptions ?? [];
386 $this->copyLinkButtonParams =
$params;
387 $this->copyLinkButtonParams[
'active'] =
true;
391 $this->copyLinkButtonParams =
null;
400 return $this->copyLinkButtonParams;
408 return array_merge($this->afterTitleButtons, $this->filterButtons, $this->buttons);
413 return implode(array_map(
function(
Button $button) {
415 }, $this->afterTitleButtons));
420 return implode(array_map(
function(
Button $button) {
427 return implode(array_map(
function(
Button $button) {
429 }, $this->filterButtons));
443 $shouldAddThemeModifier = (bool)array_intersect($button->
getClassList(), [
444 'ui-btn-light-border',
449 if ($shouldAddThemeModifier)
454 return $button->
render(
false);
461 $this->titleMinWidth =
$width;
467 return $this->titleMinWidth;
474 $this->titleMaxWidth =
$width;
485 return $this->isTitleNoShrink;
490 return $this->titleMaxWidth;
505 return $this->isMultiLineTitleEnabled;
528 return $map[$color] ??
null;
533 return defined(
'AIR_SITE_TEMPLATE');
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
$GLOBALS['_____370096793']