width = '90%'; $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->size = array (); $table->size[0] = '20%'; $table->data = array (); $table->data[0][0] = __('Name'); $table->data[0][1] = print_input_text ('name', $name, '', 35, 255, true); $table->data[1][0] = __('Group'); $groups = get_user_groups (); $own_info = get_user_info ($config['id_user']); // Only display group "All" if user is administrator or has "PM" privileges if ($own_info['is_admin'] || check_acl ($config['id_user'], 0, "PM")) $display_all_group = true; else $display_all_group = false; $table->data[1][1] = print_select_groups(false, "LW", $display_all_group, 'group', $group, '', '', 0, true); $table->data[2][0] = __('Command'); $table->data[2][1] = print_select_from_sql ('SELECT id, name FROM talert_commands', 'id_command', $id_command, '', __('None'), 0, true); $table->data[2][1] .= ' '; if (check_acl ($config['id_user'], 0, "PM")){ $table->data[2][1] .= print_image ('images/add.png', true); $table->data[2][1] .= ''; $table->data[2][1] .= __('Create Command'); $table->data[2][1] .= ''; } $table->data[3][0] = __('Threshold'); $table->data[3][1] = print_input_text ('action_threshold', $action_threshold, '', 5, 7, true); $table->data[3][1] .= ' '.__('seconds') . ui_print_help_icon ('action_threshold', true); $table->data[4][0] = __('Field 1'); $table->data[4][1] = print_input_text ('field1', $field1, '', 35, 255, true) . ui_print_help_icon ('alert_macros', true); $table->data[5][0] = __('Field 2'); $table->data[5][1] = print_input_text ('field2', $field2, '', 80, 255, true); $table->data[6][0] = __('Field 3'); $table->data[6][1] = print_textarea ('field3', 10, 30, $field3, '', true); $table->data[7][0] = __('Command preview'); $table->data[7][1] = print_textarea ('command_preview', 10, 30, '', 'disabled="disabled"', true); echo '
'; print_table ($table); echo '
'; if ($id) { print_input_hidden ('id', $id); print_input_hidden ('update_action', 1); print_submit_button (__('Update'), 'create', false, 'class="sub upd"'); } else { print_input_hidden ('create_action', 1); print_submit_button (__('Create'), 'create', false, 'class="sub wand"'); } echo '
'; echo '
'; ui_require_javascript_file ('pandora_alerts'); ?>