0) { $event_response = db_get_row('tevent_response', 'id', $event_response_id); } else { $event_response = []; $event_response['name'] = ''; $event_response['description'] = ''; $event_response['id_group'] = 0; $event_response['type'] = ''; $event_response['target'] = ''; $event_response['id'] = 0; $event_response['new_window'] = 1; $event_response['modal_width'] = 0; $event_response['modal_height'] = 0; $event_response['params'] = ''; $event_response['server_to_exec'] = ''; $event_response['command_timeout'] = 90; } $table = new stdClass(); $table->width = '100%'; $table->class = 'databox filters'; if (is_metaconsole()) { $table->head[0] = __('Edit event responses'); $table->head_colspan[0] = 5; $table->headstyle[0] = 'text-align: center'; } $table->size = []; $table->style[0] = 'font-weight: bold;'; $table->style[2] = 'font-weight: bold;'; $table->data = []; $data = []; $data[0] = __('Name'); $data[1] = html_print_input_text( 'name', $event_response['name'], '', 50, 255, true ); $data[1] .= html_print_input_hidden('id_response', $event_response['id'], true); $data[2] = __('Group'); $data[3] = html_print_select_groups(false, 'PM', true, 'id_group', $event_response['id_group'], '', '', '', true); $table->data[0] = $data; $data = []; $table->colspan[1][1] = 3; $data[0] = __('Description'); $data[1] = html_print_textarea( 'description', 5, 40, $event_response['description'], 'class="'.$class_description.'"', true ); $table->data[1] = $data; $data = []; $data[0] = __('Location').ui_print_help_tip(__('For Command type Modal Window mode is enforced'), true); $locations = [ __('Modal window'), __('New window'), ]; $data[1] = html_print_select($locations, 'new_window', $event_response['new_window'], '', '', '', true); $data[2] = ''.__('Size').''; if ($event_response['modal_width'] == 0) { $event_response['modal_width'] = 620; } if ($event_response['modal_height'] == 0) { $event_response['modal_height'] = 500; } $data[3] = ''.__('Width').' (px) '; $data[3] .= ''.html_print_input_text('modal_width', $event_response['modal_width'], '', 4, 5, true).''; $data[3] .= ''.__('Height').' (px) '; $data[3] .= ''.html_print_input_text('modal_height', $event_response['modal_height'], '', 4, 5, true).''; $table->data[2] = $data; $data = []; $data[0] = __('Parameters'); $data[1] = html_print_input_text( 'params', $event_response['params'], '', 50, 255, true ); $types = [ 'url' => __('URL'), 'command' => __('Command'), ]; $data[2] = __('Type'); $data[3] = html_print_select($types, 'type', $event_response['type'], '', '', '', true); $table->data[3] = $data; $data = []; $data[0] = ''.__('Command').' '.ui_print_help_icon('response_macros', true); $data[1] = html_print_textarea( 'target', 3, 1, $event_response['target'], 'style="min-height:initial;"', true ); $servers_to_exec = []; $servers_to_exec[0] = __('Local console'); if (enterprise_installed()) { enterprise_include_once('include/functions_satellite.php'); $rows = get_proxy_servers(); foreach ($rows as $row) { if ($row['server_type'] != 13) { $s_type = ' (Standard)'; } else { $s_type = ' (Satellite)'; } $servers_to_exec[$row['id_server']] = $row['name'].$s_type; } } $data[2] = '
'; $data[3] = ' '; $table->data[4] = $data; $data = []; $data[0] = '