function lightning_core_form_user_form_alter in Lightning Core 8.4
Same name and namespace in other branches
- 8.5 lightning_core.module \lightning_core_form_user_form_alter()
- 8 lightning_core.module \lightning_core_form_user_form_alter()
- 8.2 lightning_core.module \lightning_core_form_user_form_alter()
- 8.3 lightning_core.module \lightning_core_form_user_form_alter()
Implements hook_form_FORM_ID_alter().
File
- ./
lightning_core.module, line 201 - Contains core functionality for the Lightning distribution.
Code
function lightning_core_form_user_form_alter(array &$form) {
if (isset($form['account']['roles'])) {
/** @var \Drupal\user\RoleInterface $role */
foreach (Role::loadMultiple() as $id => $role) {
if ($role instanceof EntityDescriptionInterface) {
$form['account']['roles']['#legend'][$id] = $role
->getDescription();
}
}
}
}