We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently a lot of code is done in display.php to sort attribute values:
# Sort attributes values foreach ($entry[0] as $attr => $values) { if ( is_array($values) && $values['count'] > 1 ) { # Find key in attributes_map $attributes_map_filter = array_filter($attributes_map, function($v) use(&$attr) { return $v['attribute'] == "$attr"; }); if( count($attributes_map_filter) < 1 ) { $k = ""; error_log("WARN: no key found for attribute $attr in \$attributes_map"); } elseif( count($attributes_map_filter) > 1 ) { $k = array_key_first($attributes_map_filter); error_log("WARN: multiple keys found for attribute $attr in \$attributes_map, using first one: $k"); } else { $k = array_key_first($attributes_map_filter); } if(isset($attributes_map[$k]['sort'])) { if($attributes_map[$k]['sort'] == "descending" ) { # descending sort arsort($values); } else { # ascending sort asort($values); } } else { # if 'sort' param unset: default to ascending sort asort($values); } } if ( isset($values['count']) ) { unset($values['count']); } $entry[0][$attr] = $values; }
This should be put in a common function (maybe in ltb-common) so we can use it easily in other pages.
The text was updated successfully, but these errors were encountered:
It makes sense to put it in ltb-common indeed.
Sorry, something went wrong.
No branches or pull requests
Currently a lot of code is done in display.php to sort attribute values:
This should be put in a common function (maybe in ltb-common) so we can use it easily in other pages.
The text was updated successfully, but these errors were encountered: