$config['ehorus_custom_field'], 'display_on_front' => 1, ]; $result = (bool) db_process_sql_insert('tagent_custom_fields', $values); $custom_field_exists = $custom_field_created = $result; } // Enable table. $table_enable = new StdClass(); $table_enable->data = []; $table_enable->width = '100%'; $table_enable->id = 'ehorus-enable-setup'; $table_enable->class = 'databox filters'; $table_enable->size['name'] = '30%'; $table_enable->style['name'] = 'font-weight: bold'; // Enable eHorus. $row = []; $row['name'] = __('Enable eHorus'); $row['control'] = html_print_checkbox_switch('ehorus_enabled', 1, $config['ehorus_enabled'], true); $table_enable->data['ehorus_enabled'] = $row; // Remote config table. $table_remote = new StdClass(); $table_remote->data = []; $table_remote->width = '100%'; $table_remote->styleTable = 'margin-bottom: 10px;'; $table_remote->id = 'ehorus-remote-setup'; $table_remote->class = 'databox filters filter-table-adv'; $table_remote->size['ehorus_hostname'] = '50%'; $table_remote->size['ehorus_port'] = '50%'; // Enable eHorus user configuration. $row = []; $row['ehorus_user_level_conf'] = html_print_label_input_block( __('eHorus configuration at user level'), html_print_checkbox_switch( 'ehorus_user_level_conf', 1, $config['ehorus_user_level_conf'], true ) ); $table_remote->data['ehorus_user_level_conf'] = $row; // User. $row = []; $row['ehorus_user'] = html_print_label_input_block( __('User'), html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true), ['div_class' => 'ehorus-remote-setup-ehorus_user'] ); // Pass. $row['ehorus_pass'] = html_print_label_input_block( __('Password'), html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true), ['div_class' => 'ehorus-remote-setup-ehorus_user'] ); $table_remote->data['ehorus_pass'] = $row; // Directory hostname. $row = []; $row['ehorus_hostname'] = html_print_label_input_block( __('API Hostname'), html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true) ); // Directory port. $row['ehorus_port'] = html_print_label_input_block( __('API Port'), html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true) ); $table_remote->data['ehorus_port'] = $row; // Request timeout. $row = []; $row['ehorus_req_timeout'] = html_print_label_input_block( __('Request timeout'), html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true) ); $table_remote->data['ehorus_req_timeout'] = $row; // Test. $row = []; $test_start = ' '.html_print_image('images/spinner.gif', true).''; $test_start .= ' '.html_print_image('images/status_sets/default/severity_normal.png', true).''; $test_start .= ' '.html_print_image('images/status_sets/default/severity_critical.png', true).''; $test_start .= ' '; $row['ehorus_test'] = html_print_label_input_block( __('Test'), html_print_button( __('Start'), 'test-ehorus', false, '', [ 'icon' => 'cog', 'mode' => 'secondary mini', 'style' => 'width: 115px;', ], true ).$test_start ); $table_remote->data['ehorus_test'] = $row; // Print. echo '