예제 #1
0
 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;
 }
예제 #2
0
 public function __construct(CnrTabs $container, $title, $icon = '')
 {
     $this->container = $container;
     $this->title = $title;
     $this->icon = $icon;
     parent::__construct($container, CnrTabs::CNR_TAB);
 }
예제 #3
0
 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);
 }
예제 #4
0
 protected function hasComponent(AbsCmp $component, $position)
 {
     return $this->isProperPosition($position) && in_array($component->getHashId(), $this->components[$position]);
 }