$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'; $table_remote->size['name'] = '30%'; $table_remote->style['name'] = 'font-weight: bold'; // Enable eHorus user configuration. $row = []; $row['name'] = ('eHorus configuration at user level'); $row['control'] = 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['name'] = __('User'); $row['control'] = html_print_input_text('ehorus_user', $config['ehorus_user'], '', 30, 100, true); $table_remote->data['ehorus_user'] = $row; // Pass. $row = []; $row['name'] = __('Password'); $row['control'] = html_print_input_password('ehorus_pass', io_output_password($config['ehorus_pass']), '', 30, 100, true); $row['control'] .= ui_print_reveal_password('ehorus_pass', true); $table_remote->data['ehorus_pass'] = $row; // Directory hostname. $row = []; $row['name'] = __('API Hostname'); $row['control'] = html_print_input_text('ehorus_hostname', $config['ehorus_hostname'], '', 30, 100, true); $table_remote->data['ehorus_hostname'] = $row; // Directory port. $row = []; $row['name'] = __('API Port'); $row['control'] = html_print_input_text('ehorus_port', $config['ehorus_port'], '', 6, 100, true); $table_remote->data['ehorus_port'] = $row; // Request timeout. $row = []; $row['name'] = __('Request timeout'); $row['control'] = html_print_input_text('ehorus_req_timeout', $config['ehorus_req_timeout'], '', 3, 10, true); $table_remote->data['ehorus_req_timeout'] = $row; // Test. $row = []; $row['name'] = __('Test'); $row['control'] = html_print_button(__('Start'), 'test-ehorus', false, '', 'class="sub next"', true); $row['control'] .= '
'; $row['control'] .= ' '; $row['control'] .= ' '; $row['control'] .= ' '; $table_remote->data['ehorus_test'] = $row; // Print. echo '