$profileLinksComboBox = new CComboBox('iconmap[mappings][' . $i . '][inventory_link]', $mapping['inventory_link'], null, $this->data['inventoryList']);
    $expressionTextBox = [(new CTextBox('iconmap[mappings][' . $i . '][expression]', $mapping['expression']))->setWidth(ZBX_TEXTAREA_SMALL_WIDTH)->setAttribute('maxlength', 64)];
    if (isset($mapping['iconmappingid'])) {
        $expressionTextBox[] = new CVar('iconmap[mappings][' . $i . '][iconmappingid]', $mapping['iconmappingid']);
    }
    $iconsComboBox = new CComboBox('iconmap[mappings][' . $i . '][iconid]', $mapping['iconid'], null, $this->data['iconList']);
    $iconsComboBox->addClass('mappingIcon');
    $iconPreviewImage = (new CImg('imgstore.php?iconid=' . $mapping['iconid'] . '&width=' . ZBX_ICON_PREVIEW_WIDTH . '&height=' . ZBX_ICON_PREVIEW_HEIGHT, _('Preview'), null, null))->addClass('preview')->addClass(ZBX_STYLE_CURSOR_POINTER)->setAttribute('data-image-full', 'imgstore.php?iconid=' . $mapping['iconid']);
    $iconMapTable->addRow((new CRow([(new CCol((new CDiv())->addClass(ZBX_STYLE_DRAG_ICON)))->addClass(ZBX_STYLE_TD_DRAG_ICON), $numSpan, $profileLinksComboBox, $expressionTextBox, $iconsComboBox, $iconPreviewImage, (new CCol((new CButton('remove', _('Remove')))->addClass(ZBX_STYLE_BTN_LINK)->addClass('removeMapping')))->addClass(ZBX_STYLE_NOWRAP)]))->addClass('sortable')->setId('iconmapidRow_' . $i));
    $i++;
}
// add row button
$iconMapTable->addRow((new CRow([(new CCol((new CButton('addMapping', _('Add')))->addClass(ZBX_STYLE_BTN_LINK)))->setColSpan(7)]))->setId('iconMapListFooter'));
// <default icon row>
$iconsComboBox = new CComboBox('iconmap[default_iconid]', $this->data['iconmap']['default_iconid'], null, $this->data['iconList']);
$iconsComboBox->addClass('mappingIcon');
$iconPreviewImage = (new CImg('imgstore.php?iconid=' . $this->data['iconmap']['default_iconid'] . '&width=' . ZBX_ICON_PREVIEW_WIDTH . '&height=' . ZBX_ICON_PREVIEW_HEIGHT, _('Preview'), null, null))->addClass(ZBX_STYLE_CURSOR_POINTER)->addClass('preview')->setAttribute('data-image-full', 'imgstore.php?iconid=' . $this->data['iconmap']['default_iconid']);
$iconMapTable->addRow([(new CCol(_('Default')))->setColSpan(4), $iconsComboBox, $iconPreviewImage]);
// </default icon row>
$iconMapTab->addRow(_('Mappings'), (new CDiv($iconMapTable))->addClass(ZBX_STYLE_TABLE_FORMS_SEPARATOR)->setAttribute('style', 'min-width: ' . ZBX_TEXTAREA_BIG_WIDTH . 'px;'));
$iconMapView = new CTabView();
$iconMapView->addTab('iconmap', _('Icon map'), $iconMapTab);
// footer
if (isset($this->data['iconmapid'])) {
    $iconMapView->setFooter(makeFormFooter(new CSubmit('update', _('Update')), [new CSubmit('clone', _('Clone')), new CButtonDelete(_('Delete icon map?'), url_param('form') . url_param('iconmapid')), new CButtonCancel()]));
} else {
    $iconMapView->setFooter(makeFormFooter(new CSubmit('add', _('Add')), [new CButtonCancel()]));
}
$iconMapForm->addItem($iconMapView);
$widget->addItem($iconMapForm);
return $widget;
$divTabs->addTab('templateTab', _('Templates'), $tmplList);
/*
 * IPMI
 */
$ipmiList = new CFormList('ipmilist');
// normal hosts
if (!$isDiscovered) {
    $cmbIPMIAuthtype = new CComboBox('ipmi_authtype', $ipmi_authtype);
    $cmbIPMIAuthtype->addItems(ipmiAuthTypes());
    $cmbIPMIAuthtype->addClass('openView');
    $cmbIPMIAuthtype->setAttribute('size', 7);
    $cmbIPMIAuthtype->addStyle('width: 170px;');
    $ipmiList->addRow(_('Authentication algorithm'), $cmbIPMIAuthtype);
    $cmbIPMIPrivilege = new CComboBox('ipmi_privilege', $ipmi_privilege);
    $cmbIPMIPrivilege->addItems(ipmiPrivileges());
    $cmbIPMIPrivilege->addClass('openView');
    $cmbIPMIPrivilege->setAttribute('size', 5);
    $cmbIPMIPrivilege->addStyle('width: 170px;');
    $ipmiList->addRow(_('Privilege level'), $cmbIPMIPrivilege);
} else {
    $cmbIPMIAuthtype = new CTextBox('ipmi_authtype_name', ipmiAuthTypes($dbHost['ipmi_authtype']), ZBX_TEXTBOX_SMALL_SIZE, true);
    $ipmiList->addRow(_('Authentication algorithm'), $cmbIPMIAuthtype);
    $cmbIPMIPrivilege = new CTextBox('ipmi_privilege_name', ipmiPrivileges($dbHost['ipmi_privilege']), ZBX_TEXTBOX_SMALL_SIZE, true);
    $ipmiList->addRow(_('Privilege level'), $cmbIPMIPrivilege);
}
$ipmiList->addRow(_('Username'), new CTextBox('ipmi_username', $ipmi_username, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$ipmiList->addRow(_('Password'), new CTextBox('ipmi_password', $ipmi_password, ZBX_TEXTBOX_SMALL_SIZE, $isDiscovered));
$divTabs->addTab('ipmiTab', _('IPMI'), $ipmiList);
/*
 * Macros
 */