Skip to content

Commit

Permalink
Manage specific -1 value in datatables_page_length_choices
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Nov 7, 2024
1 parent 58cc4a4 commit ac0ef1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion htdocs/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ function sha256($string)
$smarty->assign('custom_css',$custom_css);
$smarty->assign('attributes_map',$attributes_map);
$smarty->assign('date_specifiers',$date_specifiers);
if (is_array($datatables_page_length_choices)) $datatables_page_length_choices = implode(', ', $datatables_page_length_choices);
if (is_array($datatables_page_length_choices)) {
if ( $all = array_search('-1', $datatables_page_length_choices)) {
$datatables_page_length_choices[$all] = '{"value":"-1","label":"'.$messages["pager_all"].'"}';
}
$datatables_page_length_choices = implode(', ', $datatables_page_length_choices);
}
$smarty->assign('datatables_page_length_choices', $datatables_page_length_choices);
$smarty->assign('datatables_page_length_default', $datatables_page_length_default);
$smarty->assign('datatables_auto_print', $datatables_auto_print);
Expand Down
2 changes: 1 addition & 1 deletion templates/footer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{/literal}
{if $datatables_page_length_choices}
pageLength: {
menu: [ {$datatables_page_length_choices} ]
menu: [ {$datatables_page_length_choices nofilter} ]
}
{/if}
{literal}
Expand Down

0 comments on commit ac0ef1c

Please sign in to comment.