Compare commits

..

3 Commits

Author SHA1 Message Date
jorge e51f837ba8 Merge branch 'main' into js-03_fix01 2023-01-28 15:54:32 +01:00
jorge c2c7a7bb0f initilized array so no error in loop 2023-01-28 15:44:41 +01:00
jorge bce9973189 removed checked from php loop 2023-01-26 16:37:42 +01:00
1 changed files with 3 additions and 2 deletions

View File

@ -46,8 +46,9 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
// check for values in url and get value if available // check for values in url and get value if available
if( isset($_GET[ $fieldname ]) ) { if( isset($_GET[ $fieldname ]) ) {
$filteredvalues['value'] = explode(',', $_GET[ $fieldname ]); $filteredvalues['value'] = explode(',', $_GET[ $fieldname ]);
} else {
$filteredvalues['value'] = [];
}; };
//end check for values in url //end check for values in url
@ -60,7 +61,7 @@ if( ! function_exists( 'ofisuport_ajuts_filters_form') ) {
<?php foreach( $fields['choices'] as $choicevalue => $choicelabel ) { ?> <?php foreach( $fields['choices'] as $choicevalue => $choicelabel ) { ?>
<div class="filter" data-filter="<?php echo $fields['name'];?>"> <div class="filter" data-filter="<?php echo $fields['name'];?>">
<input class="ofisuport-filter" type="checkbox" name="<?php echo $fields['name'];?>" <?php if( in_array($choicevalue,$filteredvalues['value']) ) { echo 'checked';}; ?> value="<?php echo $choicevalue ?>" /> <input class="ofisuport-filter" type="checkbox" name="<?php echo $fields['name'];?>" <?php if( in_array( $choicevalue, $filteredvalues['value']) ) { echo 'checked'; } ?> value="<?php echo $choicevalue; ?>" />
<label for="<?php echo $choicevalue; ?>"><?php echo $choicelabel;?></label> <label for="<?php echo $choicevalue; ?>"><?php echo $choicelabel;?></label>
</div> </div>