";
-echo __('Search').' '.html_print_input_text(
+// Table for filter bar.
+$filterTable = new stdClass();
+$filterTable->class = 'fixed_filter_bar';
+$filterTable->data = [];
+$filterTable->cellstyle[0][0] = 'flex: 0 1 20%;';
+$filterTable->data[0][0] = ''.__('Search').'';
+$filterTable->data[0][0] .= html_print_input_text(
'search_string',
$search_string,
'',
@@ -61,28 +65,36 @@ echo __('Search').' '.html_print_input_text(
255,
true
);
-html_print_input_hidden('search', 1);
-// Search string filter form.
-if (($policy_page !== false) || (isset($agent) === true)) {
- echo ' | ';
-echo "";
-html_print_submit_button(
+$filterTable->cellstyle[0][2] = 'flex: 0 1 60%; justify-content: flex-end;';
+$filterTable->data[0][2] .= html_print_submit_button(
__('Filter'),
'filter',
false,
[
- 'icon' => 'search',
- 'mode' => 'secondary mini',
- ]
+ 'icon' => 'search',
+ 'class' => 'float-right',
+ 'mode' => 'secondary mini',
+ ],
+ true
);
-echo ' | ';
-echo " | ";
-echo '';
+
+// Print filter table.
+html_print_table($filterTable);
// Check if there is at least one server of each type available to assign that
// kind of modules. If not, do not show server type in combo.
$network_available = db_get_sql(
@@ -122,7 +134,7 @@ if ($develop_bypass || is_metaconsole()) {
$plugin_available = 1;
// FIXME when prediction predictions server modules can be configured.
// on metaconsole.
- $prediction_available = is_metaconsole() ? 0 : 1;
+ $prediction_available = (is_metaconsole() === true) ? 0 : 1;
}
$modules = [];
@@ -147,11 +159,10 @@ if (is_metaconsole() === true || $web_available >= '1') {
$modules['webserver'] = __('Create a new web Server module');
}
-if (enterprise_installed()) {
+if (enterprise_installed() === true) {
set_enterprise_module_types($modules);
}
-$sec2 = get_parameter('sec2', '');
if (strstr($sec2, 'enterprise/godmode/policies/policies') !== false) {
// It is unset because the policies haven't a table tmodule_synth and the
// some part of code to apply this kind of modules in policy agents.
@@ -159,16 +170,13 @@ if (strstr($sec2, 'enterprise/godmode/policies/policies') !== false) {
// the modules to show in syntetic module policy form must be the policy
// modules from the same policy.
unset($modules['predictionserver']);
- if (enterprise_installed()) {
+ if (enterprise_installed() === true) {
unset($modules['webux']);
}
}
-$show_creation = false;
-$checked = get_parameter('checked');
-
-if (($policy_page) || (isset($agent))) {
- if ($policy_page) {
+if (($policy_page === true) || (isset($agent) === true)) {
+ if ($policy_page === true) {
$show_creation = is_management_allowed();
} else {
if (isset($all_groups) === false) {
@@ -178,79 +186,64 @@ if (($policy_page) || (isset($agent))) {
);
}
- if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
- $show_creation = true;
- }
- }
-
- if ($show_creation === true) {
- // Create module/type combo.
- echo '
';
- echo '';
+ $show_creation = check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true;
}
+} else {
+ $show_creation = false;
}
-echo '