Skip to content

Commit

Permalink
Major confirmation form standardization and QA phase III
Browse files Browse the repository at this point in the history
HTML5 requires sane forms.  Let's make all forms sane then.
  • Loading branch information
cigamit committed May 31, 2015
1 parent d4b5c8d commit 1cdb8da
Show file tree
Hide file tree
Showing 27 changed files with 118 additions and 58 deletions.
6 changes: 4 additions & 2 deletions aggregate_graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='aggregate_graphs.php' method='post'>\n";

html_start_box('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($graph_array) && sizeof($graph_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
print "<tr>
Expand Down Expand Up @@ -472,6 +472,8 @@ function form_actions() {

html_end_box(false);

print "</form>\n";

bottom_footer();
}

Expand Down
2 changes: 2 additions & 0 deletions automation_graph_rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ function automation_graph_rules_form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions automation_networks.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $network_actions{$_POST['drp_action']} . '</strong>', '60%', $colors['header_panel'], '3', 'center', '');

print "<form action='automation_networks.php' method='post'>\n";

html_start_box('<strong>' . $network_actions{$_POST['drp_action']} . '</strong>', '60%', $colors['header_panel'], '3', 'center', '');

if ($_POST['drp_action'] == '1') { /* delete */
print "<tr>
<td class='textArea'>
Expand Down Expand Up @@ -335,6 +335,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
2 changes: 2 additions & 0 deletions automation_snmp.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ function goTo(location) {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
4 changes: 3 additions & 1 deletion automation_tree_rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ function automation_tree_rules_form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down Expand Up @@ -553,8 +555,8 @@ function automation_tree_rules_edit() {
if (isset($_REQUEST['tree_item_id'])) {$rule['tree_item_id'] = $_REQUEST['tree_item_id'];}

print "<form method='post' action='automation_tree_rules.php' name='form_automation_tree_rule_edit'>";

html_start_box("<strong>Tree Rule Selection</strong> $header_label", '100%', '', '3', 'center', '');
#print '<pre>'; print_r($_POST); print_r($_GET); print_r($_REQUEST); print '</pre>';

if (!empty($_GET['id'])) {
/* display whole rule */
Expand Down
2 changes: 2 additions & 0 deletions cdef.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
1 change: 1 addition & 0 deletions color_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function aggregate_color_form_actions() {
top_header();

print "<form action='color_templates.php' method='post'>\n";

html_start_box('<strong>' . $aggregate_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($color_array) && sizeof($color_array)) {
Expand Down
6 changes: 4 additions & 2 deletions data_input.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $di_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='data_input.php' method='post'>\n";

html_start_box('<strong>' . $di_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($di_array) && sizeof($di_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
$graphs = array();
Expand Down Expand Up @@ -225,6 +225,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions data_queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $dq_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='data_queries.php' method='post'>\n";

html_start_box('<strong>' . $dq_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($dq_array) && sizeof($dq_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
$graphs = array();
Expand Down Expand Up @@ -276,6 +276,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions data_sources.php
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $ds_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='data_sources.php' method='post'>\n";

html_start_box('<strong>' . $ds_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($ds_array) && sizeof($ds_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
$graphs = array();
Expand Down Expand Up @@ -591,6 +591,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions data_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $ds_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='data_templates.php' method='post'>\n";

html_start_box('<strong>' . $ds_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($ds_array) && sizeof($ds_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
print "<tr>
Expand Down Expand Up @@ -357,6 +357,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
2 changes: 2 additions & 0 deletions gprint_presets.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions graph_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='graph_templates.php' method='post'>\n";

html_start_box('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($graph_array) && sizeof($graph_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
print "<tr>
Expand Down Expand Up @@ -269,6 +269,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions graphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='graphs.php' method='post'>\n";

html_start_box('<strong>' . $graph_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($graph_array) && sizeof($graph_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
$graphs = array();
Expand Down Expand Up @@ -872,6 +872,8 @@ function changeTotalsType() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions host.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('<strong>' . $device_actions[get_request_var_post('drp_action')] . '</strong>', '60%', '', '3', 'center', '');

print "<form action='host.php' autocomplete='off' method='post'>\n";

html_start_box('<strong>' . $device_actions[get_request_var_post('drp_action')] . '</strong>', '60%', '', '3', 'center', '');

if (isset($host_array) && sizeof($host_array)) {
if ($_POST['drp_action'] == '2') { /* Enable Devices */
print "<tr>
Expand Down Expand Up @@ -596,6 +596,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 4 additions & 2 deletions host_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ function form_actions() {

top_header();

html_start_box('<strong>' . $host_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

print "<form action='host_templates.php' autocomplete='off' method='post'>\n";

html_start_box('<strong>' . $host_actions{$_POST['drp_action']} . '</strong>', '60%', '', '3', 'center', '');

if (isset($host_array) && sizeof($host_array)) {
if ($_POST['drp_action'] == '1') { /* delete */
print "<tr>
Expand Down Expand Up @@ -211,6 +211,8 @@ function form_actions() {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
6 changes: 6 additions & 0 deletions include/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
57 changes: 30 additions & 27 deletions lib/clog_webapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,38 +109,41 @@ function clog_view_logfile() {
general_header();

if ((isset($_REQUEST['purge'])) && (clog_admin())) {
print "<form action='clog.php' autocomplete='off' method='post'>\n";

html_start_box('<strong>Purge</strong>', '50%', '', '3', 'center', '');

print "<form action='clog.php' autocomplete='off' method='post'>
<tr>
<td class='textArea'>
<p>Click 'Continue' to purge the Cacti log file.<br><br><br>Note: If logging is set to Cacti and Syslog, the log information will remain in Syslog.</p>
</td>
</tr>
<tr>
<td colspan='2' align='right' bgcolor='#eaeaea'>
<input id='cancel' type='button' value='Cancel'>&nbsp
<input id='pc' type='button' name='purge_continue' value='Continue' title='Purge cacti.log'>
<script type='text/javascript'>
$('#pc').click(function() {
strURL = location.pathname+'?purge_continue=1&header=false';
loadPageNoHeader(strURL);
});
$('#cancel').click(function() {
strURL = location.pathname+'?header=false';
loadPageNoHeader(strURL);
});
$(function() {
applySkin();
});
</script>
</td>
</tr>\n";
print "<tr>
<td class='textArea'>
<p>Click 'Continue' to purge the Cacti log file.<br><br><br>Note: If logging is set to Cacti and Syslog, the log information will remain in Syslog.</p>
</td>
</tr>
<tr>
<td colspan='2' align='right' bgcolor='#eaeaea'>
<input id='cancel' type='button' value='Cancel'>&nbsp
<input id='pc' type='button' name='purge_continue' value='Continue' title='Purge cacti.log'>
<script type='text/javascript'>
$('#pc').click(function() {
strURL = location.pathname+'?purge_continue=1&header=false';
loadPageNoHeader(strURL);
});
$('#cancel').click(function() {
strURL = location.pathname+'?header=false';
loadPageNoHeader(strURL);
});
$(function() {
applySkin();
});
</script>
</td>
</tr>\n";

html_end_box();

print "</form>\n";

return;
}

Expand Down
1 change: 1 addition & 0 deletions lib/html.php
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ function loadActionsPage() {
$.post(strURL, variables).done(function(data) {
$('#main').html(data);
applySkin();
window.scrollTo(0, 0);
});
return false;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/html_reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ function goTo(location) {

html_end_box();

print "</form>\n";

bottom_footer();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/html_utility.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<td style='width:$width;$style;'>" . $contents . "</td>\n";
print "\t<td " . ($width != '' || $style != "" ? "style='" . ($width != '' ? "width:$width;":"") . ($style != '' ? "$style;'":"'"):"") . ">" . $contents . "</td>\n";
}

/* form_checkbox_cell - format's a tables checkbox form element so that the cacti js actions work on it
Expand Down
Loading

0 comments on commit 1cdb8da

Please sign in to comment.