(new CLabel(_('Inventory mode'), 'operation_opinventory_inventory_mode'))->setId('operation-attr-inventory-label'),
<?php declare(strict_types = 0);
->setId('popup-operation')
->setName('popup_operation')
->addVar('operation[eventsource]', $data['eventsource'])
->addVar('operation[recovery]', $data['recovery']);
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$form_grid = (new CFormGrid());
$operation = $data['operation'];
$operationtype_value = $operation['opcommand']['scriptid'] != 0
? 'scriptid['.$operation['opcommand']['scriptid'].']'
: 'cmd['. $operation['operationtype'].']';
if (count($data['operation_types']) > 1) {
$select_operationtype = (new CFormField(
(new CSelect('operation[operationtype]'))
->setFocusableElementId('operationtype')
->addOptions(CSelect::createOptionsFromArray($data['operation_types']))
->setValue($operationtype_value ?? 0)
->setId('operation-type-select')
))->setId('operation-type');
$select_operationtype = (new CFormField([
new CLabel($data['operation_types']),
(new CInput('hidden', 'operation[operationtype]', $operationtype_value))
->setId('operation-type-select')
]))->setId('operation-type');
if ($data['scripts_with_warning']) {
$select_operationtype->addItem(
makeWarningIcon(_('Global script execution on Zabbix server is disabled by server configuration.'))
->addClass('js-script-warning-icon')
->addStyle('display: none;')