⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.101
Server IP:
178.33.27.10
Server:
Linux cpanel.dev-unit.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
Server Software:
Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips
PHP Version:
8.2.25
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
id
/
ebook.dev-unit.com
/
Modules
/
Admin
/
Ui
/
View File Name :
CiTabManager.php
<?php namespace Modules\Admin\Ui; class CiTabManager { /** * The array of all CiTabs. * * @var array */ private $tabs = []; /** * The array of all ci tabs extenders. * * @var array */ private $extends = []; /** * Register a new CiTabs. * * @param string $name * @param string $tabs * @return void */ public function register($name, $tabs) { $this->tabs[$name] = $tabs; } /** * Add a new CiTabs extender. * * @param string $name * @param string $extender * @return void */ public function extend($name, $extender) { $this->extends[$name][] = $extender; } /** * Get ci tabs for the given name. * * @param string $name * @return \Modules\Admin\Ui\CiTabs */ public function get($name) { if (! array_key_exists($name, $this->tabs)) { return; } return tap(resolve($this->tabs[$name]), function (CiTabs $tabs) use ($name) { $tabs->make(); $this->extendTabs($tabs, array_get($this->extends, $name, [])); }); } /** * Extend the given ci tabs using the given extenders. * * @param \Modules\Admin\Ui\CiTabs $tabs * @param array $extenders * @return void */ private function extendTabs(CiTabs $tabs, array $extenders) { foreach ($extenders as $extender) { resolve($extender)->extend($tabs); } } }