From 1cdb8dab9a1b4ba71f46254e1e75681eeb352056 Mon Sep 17 00:00:00 2001 From: cigamit Date: Sat, 30 May 2015 21:49:03 -0500 Subject: [PATCH] Major confirmation form standardization and QA phase III HTML5 requires sane forms. Let's make all forms sane then. --- aggregate_graphs.php | 6 ++-- automation_graph_rules.php | 2 ++ automation_networks.php | 6 ++-- automation_snmp.php | 2 ++ automation_tree_rules.php | 4 ++- cdef.php | 2 ++ color_templates.php | 1 + data_input.php | 6 ++-- data_queries.php | 6 ++-- data_sources.php | 6 ++-- data_templates.php | 6 ++-- gprint_presets.php | 2 ++ graph_templates.php | 6 ++-- graphs.php | 6 ++-- host.php | 6 ++-- host_templates.php | 6 ++-- include/layout.js | 6 ++++ lib/clog_webapi.php | 57 ++++++++++++++++++++------------------ lib/html.php | 1 + lib/html_reports.php | 2 ++ lib/html_utility.php | 2 +- managers.php | 13 +++++++-- rra.php | 2 ++ tree.php | 2 ++ user_admin.php | 6 ++-- user_domains.php | 6 ++-- user_group_admin.php | 6 ++-- 27 files changed, 118 insertions(+), 58 deletions(-) diff --git a/aggregate_graphs.php b/aggregate_graphs.php index c5fbf4d25f..4a77692bd6 100644 --- a/aggregate_graphs.php +++ b/aggregate_graphs.php @@ -330,10 +330,10 @@ function form_actions() { /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); - html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($graph_array) && sizeof($graph_array)) { if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -472,6 +472,8 @@ function form_actions() { html_end_box(false); + print "
\n"; + bottom_footer(); } diff --git a/automation_graph_rules.php b/automation_graph_rules.php index e1675d7f42..fda1a0475e 100644 --- a/automation_graph_rules.php +++ b/automation_graph_rules.php @@ -303,6 +303,8 @@ function automation_graph_rules_form_actions() { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/automation_networks.php b/automation_networks.php index f36daf46da..e92f798d26 100644 --- a/automation_networks.php +++ b/automation_networks.php @@ -275,10 +275,10 @@ function form_actions() { top_header(); - html_start_box('' . $network_actions{$_POST['drp_action']} . '', '60%', $colors['header_panel'], '3', 'center', ''); - print "
\n"; + html_start_box('' . $network_actions{$_POST['drp_action']} . '', '60%', $colors['header_panel'], '3', 'center', ''); + if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -335,6 +335,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/automation_snmp.php b/automation_snmp.php index c5b1a2d836..213d5449d7 100644 --- a/automation_snmp.php +++ b/automation_snmp.php @@ -247,6 +247,8 @@ function goTo(location) { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/automation_tree_rules.php b/automation_tree_rules.php index ab732fdd3a..e744973e13 100644 --- a/automation_tree_rules.php +++ b/automation_tree_rules.php @@ -309,6 +309,8 @@ function automation_tree_rules_form_actions() { html_end_box(); + print "\n"; + bottom_footer(); } @@ -553,8 +555,8 @@ function automation_tree_rules_edit() { if (isset($_REQUEST['tree_item_id'])) {$rule['tree_item_id'] = $_REQUEST['tree_item_id'];} print "
"; + html_start_box("Tree Rule Selection $header_label", '100%', '', '3', 'center', ''); - #print '
'; print_r($_POST); print_r($_GET); print_r($_REQUEST); print '
'; if (!empty($_GET['id'])) { /* display whole rule */ diff --git a/cdef.php b/cdef.php index 86277f1d66..2c64582bb0 100644 --- a/cdef.php +++ b/cdef.php @@ -240,6 +240,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/color_templates.php b/color_templates.php index d1eedd509c..fa7e8de22a 100644 --- a/color_templates.php +++ b/color_templates.php @@ -204,6 +204,7 @@ function aggregate_color_form_actions() { top_header(); print "
\n"; + html_start_box('' . $aggregate_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); if (isset($color_array) && sizeof($color_array)) { diff --git a/data_input.php b/data_input.php index 65d3355fc7..8b5b5a535b 100644 --- a/data_input.php +++ b/data_input.php @@ -192,10 +192,10 @@ function form_actions() { top_header(); - html_start_box('' . $di_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "\n"; + html_start_box('' . $di_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($di_array) && sizeof($di_array)) { if ($_POST['drp_action'] == '1') { /* delete */ $graphs = array(); @@ -225,6 +225,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/data_queries.php b/data_queries.php index ebf9859277..dcd34e4d6f 100644 --- a/data_queries.php +++ b/data_queries.php @@ -243,10 +243,10 @@ function form_actions() { top_header(); - html_start_box('' . $dq_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $dq_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($dq_array) && sizeof($dq_array)) { if ($_POST['drp_action'] == '1') { /* delete */ $graphs = array(); @@ -276,6 +276,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/data_sources.php b/data_sources.php index 4a0bc57c3e..dd450b911b 100644 --- a/data_sources.php +++ b/data_sources.php @@ -450,10 +450,10 @@ function form_actions() { top_header(); - html_start_box('' . $ds_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $ds_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($ds_array) && sizeof($ds_array)) { if ($_POST['drp_action'] == '1') { /* delete */ $graphs = array(); @@ -591,6 +591,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/data_templates.php b/data_templates.php index f07b4e932f..4eda29474a 100644 --- a/data_templates.php +++ b/data_templates.php @@ -314,10 +314,10 @@ function form_actions() { top_header(); - html_start_box('' . $ds_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $ds_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($ds_array) && sizeof($ds_array)) { if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -357,6 +357,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/gprint_presets.php b/gprint_presets.php index 2becaa0f46..a5513e5ec5 100644 --- a/gprint_presets.php +++ b/gprint_presets.php @@ -160,6 +160,8 @@ function form_actions() { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/graph_templates.php b/graph_templates.php index c8ade8a1bc..fe16e3a98b 100644 --- a/graph_templates.php +++ b/graph_templates.php @@ -226,10 +226,10 @@ function form_actions() { top_header(); - html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($graph_array) && sizeof($graph_array)) { if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -269,6 +269,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/graphs.php b/graphs.php index ba965d84b6..ca5bc33382 100644 --- a/graphs.php +++ b/graphs.php @@ -569,10 +569,10 @@ function form_actions() { /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); - html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $graph_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($graph_array) && sizeof($graph_array)) { if ($_POST['drp_action'] == '1') { /* delete */ $graphs = array(); @@ -872,6 +872,8 @@ function changeTotalsType() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/host.php b/host.php index f04631a3ba..6a72b58095 100644 --- a/host.php +++ b/host.php @@ -437,10 +437,10 @@ function form_actions() { /* add a list of tree names to the actions dropdown */ add_tree_names_to_actions_array(); - html_start_box('' . $device_actions[get_request_var_post('drp_action')] . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $device_actions[get_request_var_post('drp_action')] . '', '60%', '', '3', 'center', ''); + if (isset($host_array) && sizeof($host_array)) { if ($_POST['drp_action'] == '2') { /* Enable Devices */ print " @@ -596,6 +596,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/host_templates.php b/host_templates.php index f201a744a4..c83b739355 100644 --- a/host_templates.php +++ b/host_templates.php @@ -165,10 +165,10 @@ function form_actions() { top_header(); - html_start_box('' . $host_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $host_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($host_array) && sizeof($host_array)) { if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -211,6 +211,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/include/layout.js b/include/layout.js index 534ae8298b..c3e3a93c25 100644 --- a/include/layout.js +++ b/include/layout.js @@ -563,9 +563,15 @@ function loadPage(href) { function loadPageNoHeader(href) { $.get(href, function(data) { $('#main').html(data); + applySkin(); + window.scrollTo(0, 0); + + return false; }); + + return false; } function ajaxAnchors() { diff --git a/lib/clog_webapi.php b/lib/clog_webapi.php index 6ec25e77bf..7712416b24 100644 --- a/lib/clog_webapi.php +++ b/lib/clog_webapi.php @@ -109,38 +109,41 @@ function clog_view_logfile() { general_header(); if ((isset($_REQUEST['purge'])) && (clog_admin())) { + print "
\n"; + html_start_box('Purge', '50%', '', '3', 'center', ''); - print " - - -

Click 'Continue' to purge the Cacti log file.


Note: If logging is set to Cacti and Syslog, the log information will remain in Syslog.

- - - - -   - - - - \n"; + print " + +

Click 'Continue' to purge the Cacti log file.


Note: If logging is set to Cacti and Syslog, the log information will remain in Syslog.

+ + + + +   + + + + \n"; html_end_box(); + print "
\n"; + return; } diff --git a/lib/html.php b/lib/html.php index e8ff2af42c..f85766ea47 100644 --- a/lib/html.php +++ b/lib/html.php @@ -993,6 +993,7 @@ function loadActionsPage() { $.post(strURL, variables).done(function(data) { $('#main').html(data); applySkin(); + window.scrollTo(0, 0); }); return false; } diff --git a/lib/html_reports.php b/lib/html_reports.php index 13fd1248b9..f4d5b3b5f7 100644 --- a/lib/html_reports.php +++ b/lib/html_reports.php @@ -744,6 +744,8 @@ function goTo(location) { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/lib/html_utility.php b/lib/html_utility.php index 87843541a3..33952c97f2 100644 --- a/lib/html_utility.php +++ b/lib/html_utility.php @@ -145,7 +145,7 @@ function form_alternate_row($row_id = '', $light = false, $disabled = false) { @arg $width - the width of the table element @arg $style - the style to apply to the table element */ function form_selectable_cell($contents, $id, $width='', $style='') { - print "\t" . $contents . "\n"; + print "\t" . $contents . "\n"; } /* form_checkbox_cell - format's a tables checkbox form element so that the cacti js actions work on it diff --git a/managers.php b/managers.php index 450b13fbb1..8e1eef941b 100644 --- a/managers.php +++ b/managers.php @@ -922,9 +922,11 @@ function form_actions(){ } top_header(); - html_start_box('' . $manager_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + print "
\n"; + html_start_box('' . $manager_actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (sizeof($selected_items)) { print " @@ -951,9 +953,10 @@ function form_actions(){ html_end_box(); + print "
\n"; + bottom_footer(); }else { - $selected_items = array(); $list = ''; @@ -972,9 +975,11 @@ function form_actions(){ } top_header(); - html_start_box('' . $manager_notification_actions[ $_POST['drp_action'] ] . '', '60%', '', '3', 'center', ''); + print "
\n"; + html_start_box('' . $manager_notification_actions[ $_POST['drp_action'] ] . '', '60%', '', '3', 'center', ''); + if (sizeof($selected_items)) { $msg = ($_POST['drp_action'] == 1) ? "Click 'Continue' to forward the following Notification Objects to this Noticification Receiver." @@ -1006,6 +1011,8 @@ function form_actions(){ html_end_box(); + print "
\n"; + bottom_footer(); } } diff --git a/rra.php b/rra.php index 8239798377..2170d0cc23 100644 --- a/rra.php +++ b/rra.php @@ -178,6 +178,8 @@ function form_actions() { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/tree.php b/tree.php index 4f87d6918e..d8c8e831d7 100644 --- a/tree.php +++ b/tree.php @@ -410,6 +410,8 @@ function form_actions() { html_end_box(); + print "\n"; + bottom_footer(); } diff --git a/user_admin.php b/user_admin.php index f9dd1cedaf..8302db87cb 100644 --- a/user_admin.php +++ b/user_admin.php @@ -308,10 +308,10 @@ function form_actions() { top_header(); - html_start_box('' . $user_actions[get_request_var_post('drp_action')] . '', '40%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $user_actions[get_request_var_post('drp_action')] . '', '40%', '', '3', 'center', ''); + if (isset($user_array) && sizeof($user_array)) { if ((get_request_var_post('drp_action') == '1') && (sizeof($user_array))) { /* delete */ print " @@ -430,6 +430,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/user_domains.php b/user_domains.php index d111a8f1d6..3522c99901 100644 --- a/user_domains.php +++ b/user_domains.php @@ -227,10 +227,10 @@ function form_actions() { top_header(); - html_start_box('' . $actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $actions{$_POST['drp_action']} . '', '60%', '', '3', 'center', ''); + if (isset($d_array) && sizeof($d_array)) { if ($_POST['drp_action'] == '1') { /* delete */ print " @@ -285,6 +285,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); } diff --git a/user_group_admin.php b/user_group_admin.php index 0bbe35609b..9bdc8e364a 100644 --- a/user_group_admin.php +++ b/user_group_admin.php @@ -386,10 +386,10 @@ function form_actions() { top_header(); - html_start_box('' . $group_actions[get_request_var_post('drp_action')] . '', '60%', '', '3', 'center', ''); - print "
\n"; + html_start_box('' . $group_actions[get_request_var_post('drp_action')] . '', '60%', '', '3', 'center', ''); + if (isset($group_array) && sizeof($group_array)) { if ((get_request_var_post('drp_action') == '1') && (sizeof($group_array))) { /* delete */ print " @@ -445,6 +445,8 @@ function form_actions() { html_end_box(); + print "
\n"; + bottom_footer(); }