1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| <div id="navigation" class="navigation">
<div class="accordion" id="accordionPanelsStayOpen">
<?php
foreach ($params['FilterList'] as $Title=>$Active){
if($Active== 1){
// Creat Titles
if($Title == 'genre'){ $List = $genres;$Show='True';}
elseif($Title == 'support'){ $List = $supports;$Show='False';}
$List != ''? $result_array = array_key_first($List):$result_array = [];
if( $result_array !=NULL ): //Ne pas afficher si le contenu est vide
?>
<form id="form-check-label" method='get' action='#'>
<div class="accordion-item">
<h2 class="accordion-header" id="panelsStayOpen-heading<?php echo $Title?>">
<button class="accordion-button <?php echo $Show == 'True'?'':'collapsed'?>" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-collapse<?php echo $Title?>" aria-expanded="<?php echo $Show?>" aria-controls="panelsStayOpen-collapse<?php echo $Title?>">
<?php echo Text::_('MOD_MBFILTERS_FIELD_'.strtoupper($Title).'_LABEL')?>
</button>
</h2>
<div id="panelsStayOpen-collapse<?php echo $Title?>" class="accordion-collapse collapse<?php echo $Show == 'True'?' show':''?>" aria-labelledby="panelsStayOpen-heading<?php echo $Title?>">
<div class="accordion-body">
<div>
<?php
if (isset($List)) :
foreach ($List as $detail=>$number) :
if($detail != ''): //sauf les infos vides
if(isset($filters)):in_array($detail ,$filters)?$checked = 'checked':$checked =false;endif;
?>
<li>
<label class="checkbox">
<input type="hidden" name="option" value="com_microbib" >
<input type="hidden" name="view" value="Books" >
<input class="form-check-input" id="form-check-input" onChange="ajax_products_filter('<?php echo $detail?>')" type="checkbox" name="filter[<?php echo $Title?>]" value="<?php echo $detail?>" <?php echo $checked?>>
<?php echo $detail ?><span class="badge badge-info"><?php echo $number ?></span>
</label>
</li>
<?php endif;
endforeach;?>
</div>
<?php else:?>
<div class="row-fluid"><?php echo Text::_('COM_NGLIBRARY_NAVIGATIONS_NOCAT'); ?></div>
<?php endif; ?>
</div>
</div>
</div>
</form>
<?php endif; }
} ?>
</div>
</div>
<script>
function ajax_products_filter(data){
document.getElementById("form-check-input").value;
$("#form-check-label").submit();
}
</script> |