function social_group_preprocess_fieldset in Open Social 10.3.x
Same name and namespace in other branches
- 10.0.x modules/social_features/social_group/social_group.module \social_group_preprocess_fieldset()
- 10.1.x modules/social_features/social_group/social_group.module \social_group_preprocess_fieldset()
- 10.2.x modules/social_features/social_group/social_group.module \social_group_preprocess_fieldset()
Implements template_preprocess_form_element().
File
- modules/
social_features/ social_group/ social_group.module, line 2606 - The Social group module.
Code
function social_group_preprocess_fieldset(&$variables) {
// Make sure our flexible group visibility field renders a tooltip, since
// this field is rendered as fieldset with legend and radios as children
// we need to do it in this preprocess.
$element = $variables['element'];
if (!empty($element['#field_name']) && $element['#field_name'] === 'field_content_visibility') {
$description = '';
foreach ($element['#options'] as $key => $label) {
$description .= social_group_allowed_visibility_description($key);
}
// Render a specific tooltip based on a field name and description.
// This is done in the fieldset, next to the <legend>.
$variables['popover'] = social_group_render_tooltip('field_content_visibility', t('Visibility'), $description);
}
}