public function __construct(AbsCnrComponents $container, $containerPosition = AbsCnrComponents::CNR_BODY, $link, $title = '', $icon = '') { parent::__construct($container, $containerPosition); $this->title = $title; $this->icon = $icon; $this->link = $link; }
public function __construct(CnrTabs $container, $title, $icon = '') { $this->container = $container; $this->title = $title; $this->icon = $icon; parent::__construct($container, CnrTabs::CNR_TAB); }
public function attachComponent(AbsCmp $component, $position = self::CNR_BODY) { if ($position === self::CNR_BODY && !($component instanceof CmpTabForm || $component instanceof CmpTab)) { throw new \InvalidArgumentException('Component must be a tab instance'); } if ($component instanceof CmpTabForm || $component instanceof CmpTab) { if (!$this->activeTab) { $component->setActive(); $this->activeTab = $component; } $storedActive = $this->menuPage->getElementState($component->getTitle()); if ($storedActive) { $this->activeTab->setInactive(); $component->setActive(); $this->activeTab = $component; } else { $component->setInactive(); } } return parent::attachComponent($component, $position); }
protected function hasComponent(AbsCmp $component, $position) { return $this->isProperPosition($position) && in_array($component->getHashId(), $this->components[$position]); }