$widget = (new CWidget())->setTitle(_('Host groups'));
->setName('hostgroupForm')
->setAttribute('aria-labeledby', ZBX_STYLE_PAGE_TITLE)
->addVar('groupid', $data['groupid'])
->addVar('form', $data['form']);
$form_list = (new CFormList('hostgroupFormList'))
(new CLabel(_('Group name'), 'name'))->setAsteriskMark(),
(new CTextBox('name', $data['name'], $data['groupid'] && $data['group']['flags'] == ZBX_FLAG_DISCOVERY_CREATED))
->setAttribute('autofocus', 'autofocus')
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
if ($data['groupid'] != 0 && CWebUser::getType() == USER_TYPE_SUPER_ADMIN) {
(new CCheckBox('subgroups'))
->setLabel(_('Apply permissions and tag filters to all subgroups'))
->setChecked($data['subgroups'])
$tab = (new CTabView())->addTab('hostgroupTab', _('Host group'), $form_list);
if ($data['groupid'] == 0) {
$tab->setFooter(makeFormFooter(
new CSubmit('add', _('Add')),
$tab->setFooter(makeFormFooter(
new CSubmit('update', _('Update')), [
(new CSubmit('clone', _('Clone')))->setEnabled(CWebUser::getType() == USER_TYPE_SUPER_ADMIN),
(new CButtonDelete(_('Delete selected group?'), url_param('form').url_param('groupid'))),