Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/ui/lib/toolbar/ |
Upload File : |
<?php namespace Bitrix\UI\Toolbar; use Bitrix\Main\ArgumentException; final class Manager { /** @var Manager */ private static $instance; /** @var Toolbar[] */ protected $toolbars = []; private function __construct() {} private function __clone() {} /** * Returns Singleton of Manager * @return Manager */ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new Manager; } return self::$instance; } /** * @param $id * * @return Toolbar|null */ public function getToolbarById($id) { if (isset($this->toolbars[$id])) { return $this->toolbars[$id]; } return null; } public function createToolbar($id, $options) { if (empty($id)) { throw new ArgumentException("id is required", 'id'); } $toolbar = new Toolbar($id, $options); $this->toolbars[$id] = $toolbar; return $toolbar; } }