diff --git a/pandora_console/godmode/servers/discovery.php b/pandora_console/godmode/servers/discovery.php index 5ae4f2fcfd..3df3342f52 100755 --- a/pandora_console/godmode/servers/discovery.php +++ b/pandora_console/godmode/servers/discovery.php @@ -55,17 +55,19 @@ function get_wiz_class($str) default: // Main, show header. - ui_print_page_header( + ui_print_standard_header( __('Discovery'), '', false, '', true, - '', - false, - '', - GENERIC_SIZE_TEXT, - '' + [], + [ + [ + 'link' => '', + 'label' => __('Discovery'), + ], + ] ); return null; } diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php index d931f5268b..43fad7d3be 100644 --- a/pandora_console/godmode/servers/plugin.php +++ b/pandora_console/godmode/servers/plugin.php @@ -454,22 +454,6 @@ if (empty($create) === false || empty($view) === false) { $data[0] = html_print_textarea('form_description', 4, 50, $form_description, '', true, 'w100p'); $table->colspan['plugin_desc_inputs'][0] = 3; $table->data['plugin_desc_inputs'] = $data; - /* - if (is_metaconsole() === true) { - $table->head[0] = __('General'); - $table->head_colspan[0] = 4; - $table->headstyle[0] = 'text-align: center'; - html_print_table($table); - } else { - echo '
'.__('General').''; - html_print_table($table); - echo '
'; - } - - html_print_table($table); - - $table->data = []; - */ // Command title. $commandTitleContent = []; @@ -528,20 +512,6 @@ if (empty($create) === false || empty($view) === false) { $data[0] = html_print_div(['id' => 'command_preview', 'class' => 'mono'], true); $table->data['plugin_preview_inputs'] = $data; $table->colspan['plugin_preview_inputs'][0] = 2; - /* - $table->width = '100%'; - $table->class = 'databox filters'; - if (is_metaconsole() === true) { - $table->head[0] = __('Command'); - $table->head_colspan[0] = 4; - $table->headstyle[0] = 'text-align: center'; - html_print_table($table); - } else { - echo '
'.__('Command').''; - html_print_table($table); - echo '
'; - } - */ // Parameters macros title. $macrosTitleContent = []; @@ -696,11 +666,27 @@ if (empty($create) === false || empty($view) === false) { echo ''; if ($create != '') { - echo ""; + $button = html_print_submit_button( + __('Create'), + 'crtbutton', + false, + [ 'icon' => 'wand' ], + true + ); } else { - echo ""; + $button = html_print_submit_button( + __('Update'), + 'uptbutton', + false, + [ 'icon' => 'upd' ], + true + ); } + html_print_action_buttons( + $button + ); + echo ''; if (defined('METACONSOLE')) { diff --git a/pandora_console/godmode/servers/plugin_registration.php b/pandora_console/godmode/servers/plugin_registration.php index 7e669579c9..296a29a510 100644 --- a/pandora_console/godmode/servers/plugin_registration.php +++ b/pandora_console/godmode/servers/plugin_registration.php @@ -60,12 +60,23 @@ if (is_metaconsole() === true) { return; } } else { - ui_print_page_header( + ui_print_standard_header( __('PLUGIN REGISTRATION'), 'images/gm_servers.png', false, '', - true + true, + [], + [ + [ + 'link' => '', + 'label' => __('Servers'), + ], + [ + 'link' => '', + 'label' => __('Register plugin'), + ], + ] ); $management_allowed = is_management_allowed(); diff --git a/pandora_console/include/class/ConfigPEN.class.php b/pandora_console/include/class/ConfigPEN.class.php index 6f6b93cd5a..facc82d757 100644 --- a/pandora_console/include/class/ConfigPEN.class.php +++ b/pandora_console/include/class/ConfigPEN.class.php @@ -603,14 +603,14 @@ class ConfigPEN extends HTML ], ]; - $this->tableId = 'keystore'; + $tableId = 'keystore'; // Load datatables user interface. $output .= ui_print_datatable( [ - 'id' => $this->tableId, + 'id' => $tableId, 'return' => true, 'class' => 'info_table', - 'style' => 'width: 100%', + 'style' => 'width: 99%', 'columns' => $columns, 'column_names' => $column_names, 'ajax_url' => $this->ajaxController, @@ -621,6 +621,7 @@ class ConfigPEN extends HTML 'direction' => 'asc', ], 'search_button_class' => 'sub filter float-right', + 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar', 'form' => [ 'inputs' => [ [ @@ -643,15 +644,18 @@ class ConfigPEN extends HTML $output .= ''; $output .= ''; - // Create button. - $output .= parent::printInput( - [ - 'type' => 'submit', - 'name' => 'create', - 'label' => __('Register manufacturer'), - 'attributes' => 'class="sub next"', - 'return' => true, - ] + $output .= html_print_action_buttons( + parent::printInput( + [ + 'type' => 'submit', + 'name' => 'create', + 'label' => __('Register manufacturer'), + 'attributes' => ['icon' => 'next'], + 'return' => true, + ] + ), + ['type' => 'form_action'], + true ); ob_start(); diff --git a/pandora_console/include/class/HTML.class.php b/pandora_console/include/class/HTML.class.php index 5c5ecbc288..a8f7c54985 100644 --- a/pandora_console/include/class/HTML.class.php +++ b/pandora_console/include/class/HTML.class.php @@ -398,7 +398,7 @@ class HTML * * @return void */ - public static function printGoBackButton($url=null) + public static function printGoBackButton($url=null, $return=false) { if (isset($url) === false) { $url = ui_get_full_url( @@ -428,7 +428,11 @@ class HTML ], ]; - self::printForm($form); + if ($return === true) { + return self::printForm($form, $return); + } + + self::printForm($form, $return); } diff --git a/pandora_console/include/class/ModuleTemplates.class.php b/pandora_console/include/class/ModuleTemplates.class.php index c1371afa81..fb1a496246 100644 --- a/pandora_console/include/class/ModuleTemplates.class.php +++ b/pandora_console/include/class/ModuleTemplates.class.php @@ -836,7 +836,15 @@ class ModuleTemplates extends HTML ] ); - ui_pagination($countModuleTemplates, $this->baseUrl, $this->offset); + $tablePagination = ui_pagination( + $countModuleTemplates, + $this->baseUrl, + $this->offset, + 0, + true, + 'offset', + false + ); // Create the table with Module Block list. $table = new StdClasS(); $table->class = 'databox data '; @@ -874,13 +882,13 @@ class ModuleTemplates extends HTML $table->cellclass[][3] = 'table_action_buttons'; $data[3] = html_print_input_image( 'delete_profile', - 'images/cross.png', + 'images/delete.svg', $row['id_np'], - '', + 'width:40px', true, [ 'onclick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;', - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); $data[3] .= html_print_input_image( @@ -891,23 +899,40 @@ class ModuleTemplates extends HTML true, [ 'title' => 'Export tdaso CSV', - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); - $data[3] = ''.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).''; - $data[3] .= ''.html_print_image('images/csv.png', true, ['title' => __('Export to CSV'), 'class' => 'invert_filter']).''; + $data[3] = ''; + $data[3] .= html_print_image( + 'images/delete.svg', + true, + [ + 'title' => __('Delete'), + 'class' => 'invert_filter main_menu_icon', + ] + ); + $data[3] .= ''; + $data[3] .= ''; + $data[3] .= html_print_image( + 'images/csv.png', + true, + [ + 'title' => __('Export to CSV'), + 'class' => 'invert_filter main_menu_icon', + ] + ); + $data[3] .= ''; array_push($table->data, $data); } html_print_table($table); - $output = '
'; - $form = [ 'method' => 'POST', 'action' => $this->baseUrl, 'id' => 'main_management_form', + 'class' => 'flex_center', ]; $inputs[] = [ @@ -934,22 +959,29 @@ class ModuleTemplates extends HTML 'label' => __('Delete selected'), 'name' => 'erase', 'type' => 'button', - 'attributes' => ['icon' => 'cancel'], + 'attributes' => [ + 'icon' => 'delete', + 'mode' => 'secondary', + ], 'return' => true, ], ]; - $output .= $this->printForm( + html_print_action_buttons( + $this->printForm( + [ + 'form' => $form, + 'inputs' => $inputs, + ], + true + ), [ - 'form' => $form, - 'inputs' => $inputs, - ], - true + 'type' => 'data_table', + 'class' => 'fixed_action_buttons', + 'right_content' => $tablePagination, + ] ); - $output .= '
'; - - echo $output; } @@ -1056,42 +1088,38 @@ class ModuleTemplates extends HTML ], ]; - $availableButtons = []; + // Required for PEN field. + ui_require_jquery_file('tag-editor'); + ui_require_css_file('jquery.tag-editor'); - $availableButtons[] = [ - 'arguments' => [ + $buttons = $this->printInput( + [ 'name' => 'action_button', 'label' => $formButtonLabel, 'type' => 'submit', - 'attributes' => [ 'icon' => $formButtonClass ], + 'attributes' => [ + 'icon' => $formButtonClass, + 'form' => 'module_template_form', + ], 'return' => true, - ], - ]; + 'width' => 'initial', + ] + ); if ($createNewTemplate === false) { - $availableButtons[] = [ - 'arguments' => [ + $buttons .= $this->printInput( + [ 'name' => 'add_components_button', 'label' => __('Add components'), 'type' => 'button', 'attributes' => [ 'icon' => 'cog' ], 'script' => 'showAddComponent();', 'return' => true, - ], - ]; + 'width' => 'initial', + ] + ); } - $inputs[] = [ - 'class' => 'action_button_list', - 'direct' => false, - 'wrapper' => 'div', - 'block_content' => $availableButtons, - ]; - - // Required for PEN field. - ui_require_jquery_file('tag-editor'); - ui_require_css_file('jquery.tag-editor'); - if ($createNewTemplate === false) { // Get the data. $sql = sprintf( @@ -1142,13 +1170,13 @@ class ModuleTemplates extends HTML $blockTitle .= '
'; $blockTitle .= html_print_input_image( 'del_block_'.$id_group.'_', - 'images/cross.png', + 'images/delete.svg', 1, - false, + 'width: 40px', true, [ 'title' => __('Delete this block'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'if(confirm(\''.__('Do you want delete this block?').'\')){deleteModuleTemplate(\'block\',\''.$blockComponentList.'\')};return false;', ] ); @@ -1196,7 +1224,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('Network module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1207,7 +1235,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('WMI module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1218,7 +1246,7 @@ class ModuleTemplates extends HTML true, [ 'title' => __('Plug-in module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', ] ); break; @@ -1239,13 +1267,13 @@ class ModuleTemplates extends HTML $data[3] = mb_strimwidth(io_safe_output($module['description']), 0, 150, '...'); $data[4] = html_print_input_image( 'del_module_'.$module['component_id'].'_', - 'images/cross.png', + 'images/delete.svg', 1, - '', + 'width:40px;', true, [ 'title' => __('Delete this module'), - 'class' => 'invert_filter', + 'class' => 'invert_filter main_menu_icon', 'onclick' => 'if(confirm(\''.__('Do you want delete this module?').'\')){deleteModuleTemplate(\'module\','.$module['component_id'].')};return false;', ] ); @@ -1277,7 +1305,9 @@ class ModuleTemplates extends HTML echo ''; } - $this->printGoBackButton($this->baseUrl); + $buttons .= $this->printGoBackButton($this->baseUrl, true); + + html_print_action_buttons($buttons); } @@ -1459,30 +1489,31 @@ class ModuleTemplates extends HTML var listValidPens = $("#hidden-valid-pen").val(); try { - listValidPens = listValidPens.split(','); + if(listValidPens != undefined) { + listValidPens = listValidPens.split(','); + //Adding tagEditor for PEN management. + $("#text-pen").tagEditor({ + beforeTagSave: function(field, editor, tags, tag, val) { + if (listValidPens.indexOf(val) == -1) { + return false; + } + }, + autocomplete: { + source: penRefs); ?> + + } + }); + } } catch (e) { console.error(e); return; } - //Adding tagEditor for PEN management. - $("#text-pen").tagEditor({ - beforeTagSave: function(field, editor, tags, tag, val) { - if (listValidPens.indexOf(val) == -1) { - return false; - } - }, - autocomplete: { - source: penRefs); ?> - - } - }); //Values for add. $("#add-modules-components").change(function() { var valores = $("#add-modules-components") .val() .join(","); - //$("#hidden-add-modules-components-values").val(valores); }); });