function mefibs_set_form_id_recursive in MEFIBS - More exposed forms in blocks 8
Same name and namespace in other branches
- 7 mefibs.module \mefibs_set_form_id_recursive()
Recursivly prefix the #id attribute of all elements in a form.
Parameters
array $form: Form API array.
string $prefix: The string to use as a prefix.
1 call to mefibs_set_form_id_recursive()
- MefibsDisplayExtender::renderExposedForm in lib/
Drupal/ mefibs/ Plugin/ views/ display_extender/ MefibsDisplayExtender.php - Render a mefibs form.
File
- ./
mefibs.module, line 295 - Primarily Drupal hooks and global API functions to manipulate views and to provide an additional block with an exposed filter form.
Code
function mefibs_set_form_id_recursive(&$form, $prefix) {
foreach (element_children($form) as $element) {
if ($element == 'mefibs_form') {
continue;
}
$form[$element]['#id'] = drupal_html_id($prefix . '-' . $form[$element]['#id']);
if (count(element_children($form[$element]))) {
mefibs_set_form_id_recursive($form[$element], $prefix);
}
}
}