Toolbar::shuffleButtons

  1. Bitrix24 API (v. 23.675.0)
  2. ui
  3. Toolbar
  4. shuffleButtons
  • Модуль: ui
  • Путь к файлу: ~/bitrix/modules/ui/lib/toolbar/toolbar.php
  • Класс: BitrixUIToolbarToolbar
  • Вызов: Toolbar::shuffleButtons
public function shuffleButtons(Closure $closure, $buttonLocation)
{
	$buttonList = null;
	switch ($buttonLocation)
	{
		case ButtonLocation::RIGHT:
			$buttonList = $this->buttons;
			break;
		case ButtonLocation::AFTER_FILTER:
			$buttonList = $this->filterButtons;
			break;
	}

	if ($buttonList)
	{
		$buttonList = $closure($buttonList);
		if (!is_array($buttonList))
		{
			throw new ArgumentTypeException('buttonList', 'array');
		}

		switch ($buttonLocation)
		{
			case ButtonLocation::RIGHT:
				$this->buttons = $buttonList;
				break;
			case ButtonLocation::AFTER_FILTER:
				$this->filterButtons = $buttonList;
				break;
		}
	}
}

Добавить комментарий