From ab1d2f38f6a8c9937325767d3bc73cc17897c707 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 7 Feb 2023 15:39:53 +0100 Subject: [PATCH] Changed function name --- .../agentes/module_manager_editor_common.php | 10 ++-- .../godmode/users/user_management.php | 8 +-- pandora_console/include/functions_html.php | 54 ++++++------------- 3 files changed, 26 insertions(+), 46 deletions(-) diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php index 1af7a2ea4a..c04fc5d7a7 100644 --- a/pandora_console/godmode/agentes/module_manager_editor_common.php +++ b/pandora_console/godmode/agentes/module_manager_editor_common.php @@ -719,7 +719,7 @@ $table_advanced->cellclass = []; $table_advanced->colspan = []; $table_advanced->rowspan = []; -$table_advanced->data['title_1'] = html_print_full_subtitle_table(__('Identification and Categorization')); +$table_advanced->data['title_1'] = html_print_subtitle_table(__('Identification and Categorization')); $table_advanced->rowclass['captions_custom_category'] = 'field_half_width pdd_t_10px'; $table_advanced->rowclass['custom_id_category'] = 'field_half_width'; $table_advanced->data['captions_custom_category'][0] = __('Custom ID'); @@ -1044,7 +1044,7 @@ $table_advanced->data['textarea_crit_warn_instructions'][1] = html_print_textare $largeClassDisabledBecauseInPolicy ); -$table_advanced->data['title_2'] = html_print_full_subtitle_table(__('Execution interval')); +$table_advanced->data['title_2'] = html_print_subtitle_table(__('Execution interval')); $table_advanced->data['caption_execution_interval'][0] = __('Interval'); $table_advanced->data['execution_interval'][0] = ''.$outputExecutionInterval.''; @@ -1080,7 +1080,7 @@ if (isset($id_agente) === true && (int) $moduletype === MODULE_DATA) { $table_advanced->rowclass['cron_section'] = 'table_section full_section'; $table_advanced->data['cron_section'] = html_print_table($tableCron, true); -$table_advanced->data['title_3'] = html_print_full_subtitle_table(__('Thresholds and state changes')); +$table_advanced->data['title_3'] = html_print_subtitle_table(__('Thresholds and state changes')); $table_advanced->rowclass['caption_min_max_values'] = 'w50p pdd_t_10px'; $table_advanced->rowclass['min_max_values'] = 'w50p'; @@ -1302,7 +1302,7 @@ $table_advanced->data['ff_keep_counters'][0] = html_print_checkbox_switch( $disabledBecauseInPolicy ); -$table_advanced->data['title_4'] = html_print_full_subtitle_table(__('Data and their processing')); +$table_advanced->data['title_4'] = html_print_subtitle_table(__('Data and their processing')); $table_advanced->rowclass['caption_process_unit'] = 'w50p'; $table_advanced->rowclass['process_unit'] = 'w50p'; @@ -1332,7 +1332,7 @@ $table_advanced->data['process_unit'][1] = html_print_extended_select_for_post_p $disabledBecauseInPolicy ); -$table_advanced->data['title_5'] = html_print_full_subtitle_table(__('Notifications and alerts')); +$table_advanced->data['title_5'] = html_print_subtitle_table(__('Notifications and alerts')); $table_advanced->data['caption_export_target'][0] = __('Export target'); if ($__code_from === 'policies') { diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 5119c5ced4..5d66113d4e 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -138,7 +138,7 @@ $userManagementTable->colspan = []; $userManagementTable->rowspan = []; // Title for Profile information. -$userManagementTable->data['title_profile_information'] = html_print_full_subtitle_table(__('Profile information')); +$userManagementTable->data['title_profile_information'] = html_print_subtitle_table(__('Profile information')); // Id user. if ($new_user === true) { @@ -388,7 +388,7 @@ $userManagementTable->data['fields_userSessionTime'][0] .= ui_print_input_placeh ); // Title for Autorefresh. -$userManagementTable->data['title_autorefresh'] = html_print_full_subtitle_table(__('Autorefresh')); +$userManagementTable->data['title_autorefresh'] = html_print_subtitle_table(__('Autorefresh')); // Autorefresh selects. $select_out = html_print_select( @@ -543,7 +543,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh ); // Title for Language and Appearance. -$userManagementTable->data['title_lookAndFeel'] = html_print_full_subtitle_table(__('Language and Appearance')); +$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance')); // Language and color scheme. $userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width'; $userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width'; @@ -643,7 +643,7 @@ $userManagementTable->data['fields_timezone'][1] = html_print_div( ); // Title for Language and Appearance. -$userManagementTable->data['title_additionalSettings'] = html_print_full_subtitle_table(__('Additional settings')); +$userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings')); $userManagementTable->rowclass['captions_addSettings'] = 'field_half_width'; $userManagementTable->rowclass['fields_addSettings'] = 'field_half_width'; diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 33981b7523..c857caeb34 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -6564,41 +6564,7 @@ function html_print_extended_select_for_downtime_cron( /** - * Prints a subtitle for a form or table. - * - * @param string $caption Caption of title. - * @param array $options Available options. - * - `id`: string - * - `style`: string - * - `class`: string. `section_table_title` by default. - * - `wrapper`: string. Must be a valid tag. - * - `wrapper_attributes`: string. Valid attributes for a wrapper. - * @param boolean $return If true, returns a string with formed subtitle. - * - * @return string. - */ -function html_print_subtitle_table(string $caption, array $options=[], bool $return=false) -{ - if (isset($options['wrapper']) === true) { - $startWrapper = '<'.$options['wrapper'].' '.($options['wrapper_attributes'] ?? '').'>'; - $endWrapper = ''; - $caption = $startWrapper.$caption.$endWrapper; - } - - return html_print_div( - [ - 'id' => ($options['id'] ?? ''), - 'class' => ($options['class'] ?? 'section_table_title'), - 'style' => ($options['style'] ?? ''), - 'content' => $caption, - ], - $return - ); -} - - -/** - * Same behaviour like html_print_subtitle_table, in this case, return all formed subtitle with the new Pandora's style. + * Return formed subtitle with the new Pandora's style. * * @param string $caption Caption of title. * @param array $options Available options. @@ -6610,11 +6576,25 @@ function html_print_subtitle_table(string $caption, array $options=[], bool $ret * * @return array. */ -function html_print_full_subtitle_table(string $caption, array $options=[]) +function html_print_subtitle_table(string $caption, array $options=[]) { + if (isset($options['wrapper']) === true) { + $startWrapper = '<'.$options['wrapper'].' '.($options['wrapper_attributes'] ?? '').'>'; + $endWrapper = ''; + $caption = $startWrapper.$caption.$endWrapper; + } + $output = []; $output[0] = html_print_div([ 'class' => 'section_table_title_line' ], true); - $output[1] = html_print_subtitle_table($caption, $options, true); + $output[1] = html_print_div( + [ + 'id' => ($options['id'] ?? ''), + 'class' => ($options['class'] ?? 'section_table_title'), + 'style' => ($options['style'] ?? ''), + 'content' => $caption, + ], + true + ); return $output; }