public function toString($destroy = true) { $this->addItem($this->formList); return parent::toString($destroy); }
public function toString($destroy = true) { if (count($this->tabs) == 1) { $this->setAttribute('class', 'min-width ui-tabs ui-widget ui-widget-content ui-corner-all widget'); $header = reset($this->headers); $header = new CDiv($header); $header->addClass('ui-corner-all ui-widget-header header'); $header->setAttribute('id', 'tab_' . key($this->headers)); $this->addItem($header); $tab = reset($this->tabs); $tab->addClass('ui-tabs ui-tabs-panel ui-widget ui-widget-content ui-corner-all widget'); $this->addItem($tab); } else { $headersList = new CList(); foreach ($this->headers as $id => $header) { $tabLink = new CLink($header, '#' . $id, null, null, false); $tabLink->setAttribute('id', 'tab_' . $id); $headersList->addItem($tabLink); } $this->addItem($headersList); $this->addItem($this->tabs); $options = array(); if (!is_null($this->selectedTab)) { $options['selected'] = $this->selectedTab; } if ($this->rememberTab) { $options['cookie'] = array(); } zbx_add_post_js('jQuery("#' . $this->id . '").tabs(' . zbx_jsvalue($options, true) . ').show();'); } return parent::toString($destroy); }
public function toString($destroy = true) { // No header if we have only one Tab if (count($this->tabs) == 1) { $tab = reset($this->tabs); $this->addItem($tab); } else { $headersList = (new CList())->addClass(ZBX_STYLE_TABS_NAV); foreach ($this->headers as $id => $header) { $tabLink = (new CLink($header, '#' . $id))->setId('tab_' . $id); $headersList->addItem($tabLink); } $this->addItem($headersList); $this->addItem($this->tabs); if ($this->selectedTab === null) { $activeTab = get_cookie('tab', 0); $createEvent = ''; } else { $activeTab = $this->selectedTab; $createEvent = 'create: function() { jQuery.cookie("tab", ' . $this->selectedTab . '); },'; } $disabledTabs = $this->disabledTabs === null ? '' : 'disabled: ' . CJs::encodeJson($this->disabledTabs) . ','; zbx_add_post_js(' jQuery("#' . $this->id . '").tabs({ ' . $createEvent . ' ' . $disabledTabs . ' active: ' . $activeTab . ', activate: function(event, ui) { jQuery.cookie("tab", ui.newTab.index().toString()); } }) .css("visibility", "visible");'); } $this->addItem($this->footer); return parent::toString($destroy); }
public function toString($destroy = true) { $this->get(); return parent::toString($destroy); }
public function toString($destroy = true) { if (count($this->tabs) == 1) { $this->setAttribute('class', 'min-width ui-tabs ui-widget ui-widget-content ui-corner-all widget'); $header = reset($this->headers); $header = new CDiv($header); $header->addClass('ui-corner-all ui-widget-header header'); $header->setAttribute('id', 'tab_' . key($this->headers)); $this->addItem($header); $tab = reset($this->tabs); $tab->addClass('ui-tabs ui-tabs-panel ui-widget ui-widget-content ui-corner-all widget'); $this->addItem($tab); } else { $headersList = new CList(); foreach ($this->headers as $id => $header) { $tabLink = new CLink($header, '#' . $id, null, null, false); $tabLink->setAttribute('id', 'tab_' . $id); $headersList->addItem($tabLink); } $this->addItem($headersList); $this->addItem($this->tabs); if ($this->selectedTab === null) { $activeTab = get_cookie('tab', 0); $createEvent = ''; } else { $activeTab = $this->selectedTab; $createEvent = 'create: function() { jQuery.cookie("tab", ' . $this->selectedTab . '); },'; } $disabledTabs = $this->disabledTabs === null ? '' : 'disabled: ' . CJs::encodeJson($this->disabledTabs) . ','; zbx_add_post_js(' jQuery("#' . $this->id . '").tabs({ ' . $createEvent . ' ' . $disabledTabs . ' active: ' . $activeTab . ', activate: function(event, ui) { jQuery.cookie("tab", ui.newTab.index().toString()); } }) .css("visibility", "visible");'); } return parent::toString($destroy); }