mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Make IP filter permanent and added a remove button
Former-commit-id: f36766f60881edd7825c7aa992c832f8b74cda38
This commit is contained in:
parent
c09f89dffe
commit
2e65301ace
@ -47,7 +47,7 @@ if (!$is_period) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$top = (int) get_parameter('top', 10);
|
$top = (int) get_parameter('top', 10);
|
||||||
$main_value = get_parameter('main_value', '');
|
$main_value = ((bool) get_parameter('remove_filter', 0)) ? '' : get_parameter('main_value', '');
|
||||||
$style_end = ($is_period) ? 'display: none;' : '';
|
$style_end = ($is_period) ? 'display: none;' : '';
|
||||||
$style_period = ($is_period) ? '' : 'display: none;';
|
$style_period = ($is_period) ? '' : 'display: none;';
|
||||||
|
|
||||||
@ -130,6 +130,10 @@ $table->data['1']['2'] .= html_print_submit_button(
|
|||||||
);
|
);
|
||||||
|
|
||||||
echo '<form method="post">';
|
echo '<form method="post">';
|
||||||
|
if (!empty($main_value)) {
|
||||||
|
html_print_input_hidden('main_value', $main_value);
|
||||||
|
}
|
||||||
|
|
||||||
html_print_table($table);
|
html_print_table($table);
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
@ -169,8 +173,6 @@ $hidden_main_link = [
|
|||||||
'top' => $top,
|
'top' => $top,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (get_parameter('export_csv')) {
|
if (get_parameter('export_csv')) {
|
||||||
// Clean the buffer.
|
// Clean the buffer.
|
||||||
while (ob_get_level()) {
|
while (ob_get_level()) {
|
||||||
@ -201,6 +203,20 @@ if (get_parameter('export_csv')) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Print the filter remove link.
|
||||||
|
if (!empty($main_value)) {
|
||||||
|
echo html_print_link_with_params(
|
||||||
|
__('Filtered by IP %s. Click here to remove the filter.', $main_value),
|
||||||
|
array_merge(
|
||||||
|
$hidden_main_link,
|
||||||
|
[
|
||||||
|
'main_value' => $main_value,
|
||||||
|
'remove_filter' => 1,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Print the data and build the chart.
|
// Print the data and build the chart.
|
||||||
$table->data = [];
|
$table->data = [];
|
||||||
$chart_data = [];
|
$chart_data = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user