}
$hostsComboBox = new CTweenBox($hostGroupForm, 'hosts', $this->data['hosts'], 25);
foreach ($this->data['db_hosts'] as $host) {
    if (!isset($this->data['hosts'][$host['hostid']])) {
        $hostsComboBox->addItem($host['hostid'], $host['name']);
    }
}
foreach ($this->data['r_hosts'] as $host) {
    if ($host['flags'] == ZBX_FLAG_DISCOVERY_NORMAL) {
        $hostsComboBox->addItem($host['hostid'], $host['name']);
    } else {
        $hostsComboBox->addItem($host['hostid'], $host['name'], true, false);
    }
}
$hostGroupFormList->addRow(_('Hosts'), $hostsComboBox->get(_('Hosts in'), array(_('Other hosts | Group') . SPACE, $groupsComboBox)));
// append tabs to form
$hostGroupTab = new CTabView();
$hostGroupTab->addTab('hostgroupTab', _('Host group'), $hostGroupFormList);
$hostGroupForm->addItem($hostGroupTab);
// append buttons to form
if ($this->data['groupid'] == 0) {
    $hostGroupForm->addItem(makeFormFooter(new CSubmit('add', _('Add')), new CButtonCancel()));
} else {
    $deleteButton = new CButtonDelete(_('Delete selected group?'), url_param('form') . url_param('groupid'));
    if (!isset($this->data['deletableHostGroups'][$this->data['groupid']])) {
        $deleteButton->attr('disabled', 'disabled');
    }
    $hostGroupForm->addItem(makeFormFooter(new CSubmit('update', _('Update')), array(new CSubmit('clone', _('Clone')), $deleteButton, new CButtonCancel())));
}
$hostGroupWidget->addItem($hostGroupForm);
return $hostGroupWidget;