'header' => $data['title'],
$options = $data['options'];
$header_form = ($data['popup_type'] === 'help_items') ? (new CForm()): new CDiv();
$header_form->setId('generic-popup-form');
if (array_key_exists('groups', $data['filter'])) {
$multiselect_options = $data['filter']['groups'];
$multiselect_options['popup']['parameters']['dstfrm'] = $header_form->getId();
$hostgroup_ms = (new CMultiSelect($multiselect_options))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH);
$controls[] = (new CFormList())->addRow(new CLabel(_('Host group'), 'popup_host_group_ms'), $hostgroup_ms);
$script_inline .= $hostgroup_ms->getPostJS(). 'popup_generic.initGroupsFilter();';
if (array_key_exists('templategroups', $data['filter'])) {
$multiselect_options = $data['filter']['templategroups'];
$multiselect_options['popup']['parameters']['dstfrm'] = $header_form->getId();
$templategroup_ms = (new CMultiSelect($multiselect_options))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH);
$controls[] = (new CFormList())
->addRow(new CLabel(_('Template group'), 'popup_template_group_ms'), $templategroup_ms);
$script_inline .= $templategroup_ms->getPostJS(). 'popup_generic.initTemplategroupsFilter();';
if (array_key_exists('hosts', $data['filter'])) {
$multiselect_options = $data['filter']['hosts'];
$multiselect_options['popup']['parameters']['dstfrm'] = $header_form->getId();
$host_ms = (new CMultiSelect($multiselect_options))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH);
if ($multiselect_options['readonly']) {
$host_ms->setTitle(_('You cannot switch hosts for current selection.'));
$controls[] = (new CFormList())->addRow(new CLabel(_('Host'), 'popup_host_ms'), $host_ms);
$script_inline .= $host_ms->getPostJS(). 'popup_generic.initHostsFilter();';
if (array_key_exists('templates', $data['filter'])) {
$multiselect_options = $data['filter']['templates'];
$multiselect_options['popup']['parameters']['dstfrm'] = $header_form->getId();
$template_ms = (new CMultiSelect($multiselect_options))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH);
if ($multiselect_options['disabled']) {
$template_ms->setTitle(_('You cannot switch templates for current selection.'));
$controls[] = (new CFormList())->addRow(new CLabel(_('Template'), 'popup_template_ms'), $template_ms);
$script_inline .= $template_ms->getPostJS(). 'popup_generic.initTemplatesFilter();';
if ($data['popup_type'] === 'help_items') {