Source
$disabled_tabs = ($this->disabledTabs === null) ? '' : 'disabled: '.json_encode($this->disabledTabs).',';
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
class CTabView extends CDiv {
protected $id = 'tabs';
/**
* @var CDiv[]
*/
protected $tabs = [];
protected $headers = [];
protected $footer = null;
protected $selectedTab = null;
protected $indicators = [];
/**
* Script for tab change event.
*/
private $tab_change_js = '';
/**
* Disabled tabs IDs, tab option
*
* @var array
*/
protected $disabledTabs = [];
public function __construct($data = []) {
if (isset($data['id'])) {
$this->id = $data['id'];
}
if (isset($data['selected'])) {
$this->setSelected($data['selected']);
}
if (isset($data['disabled'])) {
$this->setDisabled($data['disabled']);
}
parent::__construct();
$this->setId(zbx_formatDomId($this->id));
$this->addClass(ZBX_STYLE_TABLE_FORMS_CONTAINER);
}
public function setSelected($selected) {
if ($selected == 0) {
CCookieHelper::unset('tab');
}
$this->selectedTab = $selected;