HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/firetech.komma.pro/app/KommaApp/Kms/Core/Sections/KmsSectionTab.php
<?php //namespace App\KommaApp\Kms\Core\Sections;
//
//use Illuminate\Support\MessageBag;
//
///**
// * Class KmsSectionTab
// * @package App\KommaApp\Kms\Core\Sections
// *
// * @deprecated Don't use anymore. Use SectionTab class instead
// */
//class KmsSectionTab implements SectionTabInterface
//{
//
//    protected $name;
//    protected $slug;
//
//    protected $items = [];
//    protected $subTabs = [];
//
//    public function __construct($name, $slug)
//    {
//        $this->name = $name;
//        $this->slug = $slug;
//    }
//
//    public function getName()
//    {
//        return $this->name;
//    }
//
//    public function getSlug()
//    {
//        return $this->slug;
//    }
//
//    public function addItem(&$item, $subTabSlug = null, $subSubTabSlug = null)
//    {
//        if ($subSubTabSlug) {
//            $tab = $this->getOrCreateSubTab($subTabSlug);
//
//            $subTab = $tab->getOrCreateSubTab($subSubTabSlug);
//            $subTab->addItem($item, $subTabSlug);
//            return $item;
//        }
//        if ($subTabSlug) {
//            $tab = $this->getOrCreateSubTab($subTabSlug);
//            $tab->addItem($item, $subTabSlug);
//            return $item;
//        }
//
//        return $this->items[] = $item;
//    }
//
//    public function getItems()
//    {
//        $items = [];
//        foreach ($this->items as $item) {
//            if ($item->checkIfUserIsEligible(\Auth::user()))
//                $items[] = $item;
//        }
//        return $items;
//    }
//
//    public function getTabs()
//    {
//        return $this->subTabs;
//    }
//
//    public function hasTabs()
//    {
//        return (count($this->subTabs) > 0);
//    }
//
//    public function hasErrors(MessageBag $errors)
//    {
//        // Check if items are in message bag
//        foreach ($this->getItems() as $item) {
//            if ($errors->get($item->getKey())) return true;
//        }
//
//        //Check if items in sub tabs are in message bag
//        foreach ($this->subTabs as $subTab) {
//            foreach ($subTab->getItems() as $subItem) {
//                if ($errors->get($subItem->getKey())) return true;
//            }
//        }
//
//        return false;
//    }
//
//    protected function getOrCreateSubTab($name)
//    {
//        if (!$tab = $this->getSubTabBySlug($name)) {
//            return $this->subTabs[] = new KmsSectionSubTab($name, $name);
//        }
//
//        return $tab;
//    }
//
//    protected function getSubTabBySlug($slug)
//    {
//        foreach ($this->subTabs as $tab) {
//            if ($tab->getSlug() == $slug) return $tab;
//        }
//        return null;
//    }
//
//    public function getGroup()
//    {
//
//    }
//}