Source
foreach ($field->getViewCollection() as ['label' => $label, 'view' => $view, 'class' => $class]) {
<?php declare(strict_types = 0);
/*
** 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 CWidgetFieldsGroupView extends CDiv {
protected array $fields = [];
protected array $label_class_list = [];
protected string $label;
protected ?CTag $field_hint = null;
public function __construct(string $label, array $fields = []) {
parent::__construct();
$this->label = $label;
foreach ($fields as $field) {
$this->addItem($field);
}
$this->addClass(CFormGrid::ZBX_STYLE_FIELDS_GROUP);
}
public function getFields(): array {
return $this->fields;
}
public function addField(?CWidgetFieldView $field): self {
return $this->addItem($field);
}
public function addItem($value): self {
if ($value === null) {
return $this;
}
if (is_string($value)) {
$value = $this->encode($value, $this->getEncStrategy());
}
$this->fields[] = $value;
return $this;
}
public function getLabel(): CLabel {
$focusable_element_id = null;