function superfish_array_filter in Superfish 7
Same name and namespace in other branches
- 8 superfish.module \superfish_array_filter()
- 6 superfish.module \superfish_array_filter()
Helper function to clean up arrays.
3 calls to superfish_array_filter()
- superfish_block_validate in ./
superfish.module - Validation function for the block configuration form.
- superfish_block_view in ./
superfish.module - Implements hook_block_view().
- theme_superfish_build in ./
superfish.module - Helper function that builds the nested lists of a Superfish menu.
File
- ./
superfish.module, line 2001 - Enables the use of jQuery Superfish plugin for Drupal menus.
Code
function superfish_array_filter($haystack) {
foreach ($haystack as $key => $value) {
if (is_array($value)) {
$haystack[$key] = superfish_array_filter($haystack[$key]);
}
elseif (empty($value) && is_bool($value) !== TRUE) {
if ($haystack[$key] != '0') {
unset($haystack[$key]);
}
}
}
return $haystack;
}