• Модуль: ui
  • Путь к файлу: ~/bitrix/modules/ui/lib/toolbar/toolbar.php
  • Класс: BitrixUIToolbarToolbar
  • Вызов: Toolbar::addButton
public function addButton($button, $location = ButtonLocation::RIGHT)
{
	if (is_array($button))
	{
		$button = new Button($button);
	}

	if (!($button instanceof Button))
	{
		throw new ArgumentTypeException("button", Button::class);
	}

	if ($location === ButtonLocation::AFTER_FILTER)
	{
		$this->filterButtons[] = $button;
	}
	elseif($location === ButtonLocation::AFTER_TITLE)
	{
		$this->afterTitleButtons[] = $button;
	}
	else
	{
		$this->buttons[] = $button;
	}
}