function superfish_array_filter in Superfish 6
Same name and namespace in other branches
- 8 superfish.module \superfish_array_filter()
- 7 superfish.module \superfish_array_filter()
Helper function to clean up arrays.
3 calls to superfish_array_filter()
- superfish_block in ./
superfish.module - Implements hook_block().
- superfish_block_validate in ./
superfish.module - Validation function for the block configuration form.
- theme_superfish_build in ./
superfish.module - Helper function that builds the nested lists of a Superfish menu.
File
- ./
superfish.module, line 1302 - 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;
}