#10493 fixed pagination in collection
This commit is contained in:
parent
dfadbb0f80
commit
2f1060af56
|
@ -597,9 +597,10 @@ if ((bool) $id !== false || $new_component
|
|||
$search_id_group = (int) get_parameter('search_id_group');
|
||||
$search_string = (string) get_parameter('search_string');
|
||||
|
||||
$offset = (int) get_parameter('offset');
|
||||
$url = ui_get_url_refresh(
|
||||
[
|
||||
'offset' => false,
|
||||
'offset' => $offset,
|
||||
'search_string' => $search_string,
|
||||
'search_id_group' => $search_id_group,
|
||||
'id' => $id,
|
||||
|
@ -607,7 +608,7 @@ $url = ui_get_url_refresh(
|
|||
true,
|
||||
false
|
||||
);
|
||||
|
||||
$name_url = 'index.php?sec=templates&sec2=godmode/modules/manage_network_components';
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
@ -712,8 +713,9 @@ $total_components = network_components_get_network_components(
|
|||
'COUNT(*) AS total'
|
||||
);
|
||||
$total_components = $total_components[0]['total'];
|
||||
ui_pagination($total_components, $url);
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset;
|
||||
ui_pagination($total_components, $name_url);
|
||||
$filter['offset'] = $offset;
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
$components = network_components_get_network_components(
|
||||
false,
|
||||
|
@ -791,7 +793,7 @@ foreach ($components as $component) {
|
|||
true
|
||||
);
|
||||
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'">';
|
||||
$data[0] = '<a href="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&id='.$component['id_nc'].'&pure='.$pure.'&offset='.$offset.'">';
|
||||
$data[0] .= io_safe_output($component['name']);
|
||||
$data[0] .= '</a>';
|
||||
} else {
|
||||
|
@ -855,7 +857,7 @@ foreach ($components as $component) {
|
|||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[][6] = 'action_buttons';
|
||||
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'">'.html_print_image(
|
||||
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'&offset='.$offset.'">'.html_print_image(
|
||||
'images/copy.png',
|
||||
true,
|
||||
[
|
||||
|
@ -864,7 +866,7 @@ foreach ($components as $component) {
|
|||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
|
||||
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'&offset='.$offset_delete.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
|
@ -887,7 +889,7 @@ if (isset($data) === true) {
|
|||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$total_components,
|
||||
$url,
|
||||
$name_url,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
|
|
Loading…
Reference in New Issue