From b3f3392ff2fa4556a641e078098b53ade7d62c7c Mon Sep 17 00:00:00 2001 From: TheWitness Date: Sun, 1 Oct 2023 11:59:28 -0400 Subject: [PATCH] Light PSR on CDEF and VDEF pages --- cdef.php | 8 ++++---- vdef.php | 39 ++++++++++++++++++++++++++++----------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/cdef.php b/cdef.php index 58091e0c02..67500866ea 100644 --- a/cdef.php +++ b/cdef.php @@ -278,7 +278,7 @@ function form_actions() {

" . __n('Click \'Continue\' to delete the following CDEF.', 'Click \'Continue\' to delete all following CDEFs.', cacti_sizeof($cdef_array)) . "

- \n"; + "; $save_html = " "; } elseif (get_nfilter_request_var('drp_action') == '2') { /* duplicate */ @@ -290,7 +290,7 @@ function form_actions() { form_text_box('title_format', ' (1)', '', '255', '30', 'text'); print "

- \n"; + "; $save_html = " "; } @@ -801,7 +801,7 @@ function cdef() { if (get_request_var('rows') == $key) { print ' selected'; - } print '>' . html_escape($value) . "\n"; + } print '>' . html_escape($value) . ""; } } ?> @@ -968,7 +968,7 @@ function clearFilter() { form_end_row(); } } else { - print "" . __('No CDEFs') . "\n"; + print "" . __('No CDEFs') . ""; } html_end_box(false); diff --git a/vdef.php b/vdef.php index 4ea337159e..7114f556e5 100644 --- a/vdef.php +++ b/vdef.php @@ -269,7 +269,7 @@ function vdef_form_actions() {

" . __n('Click \'Continue\' to delete the following VDEF.', 'Click \'Continue\' to delete following VDEFs.', cacti_sizeof($vdef_array)) . "

    $vdef_list
- \n"; + "; $save_html = " "; } elseif (get_nfilter_request_var('drp_action') === '2') { // duplicate @@ -281,7 +281,7 @@ function vdef_form_actions() { form_text_box('title_format', ' (1)', '', '255', '30', 'text'); print "

- \n"; + "; $save_html = " "; } @@ -299,7 +299,7 @@ function vdef_form_actions() { $save_html - \n"; + "; html_end_box(); @@ -752,7 +752,7 @@ function vdef_filter() { if (get_request_var('rows') == $key) { print ' selected'; - } print '>' . $value . "\n"; + } print '>' . $value . ""; } } ?> @@ -924,16 +924,33 @@ function vdef($refresh = true) { html_start_box('', '100%', '', '3', 'center', ''); $display_text = array( - 'name' => array('display' => __('VDEF Name'), 'align' => 'left', 'sort' => 'ASC', 'tip' => __esc('The name of this VDEF.') ), - 'nosort' => array('display' => __('Deletable'), 'align' => 'right', 'tip' => __esc('VDEFs that are in use cannot be Deleted. In use is defined as being referenced by a Graph or a Graph Template.') ), - 'graphs' => array('display' => __('Graphs Using'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __esc('The number of Graphs using this VDEF.') ), - 'templates' => array('display' => __('Templates Using'), 'align' => 'right', 'sort' => 'DESC', 'tip' => __esc('The number of Graphs Templates using this VDEF.') ) + 'name' => array( + 'display' => __('VDEF Name'), + 'align' => 'left', + 'sort' => 'ASC', + 'tip' => __esc('The name of this VDEF.') + ), + 'nosort' => array( + 'display' => __('Deletable'), + 'align' => 'right', + 'tip' => __esc('VDEFs that are in use cannot be Deleted. In use is defined as being referenced by a Graph or a Graph Template.') + ), + 'graphs' => array( + 'display' => __('Graphs Using'), + 'align' => 'right', + 'sort' => 'DESC', + 'tip' => __esc('The number of Graphs using this VDEF.') + ), + 'templates' => array( + 'display' => __('Templates Using'), + 'align' => 'right', + 'sort' => 'DESC', + 'tip' => __esc('The number of Graphs Templates using this VDEF.') + ) ); html_header_sort_checkbox($display_text, get_request_var('sort_column'), get_request_var('sort_direction'), false); - $i = 0; - if (cacti_sizeof($vdefs)) { foreach ($vdefs as $vdef) { if ($vdef['graphs'] == 0 && $vdef['templates'] == 0) { @@ -951,7 +968,7 @@ function vdef($refresh = true) { form_end_row(); } } else { - print "" . __('No VDEFs') . "\n"; + print "" . __('No VDEFs') . ""; } html_end_box(false);