$form['registration_cancellation'
]['user_password_strength'
] =
[ '#type' => 'checkbox',
'#title' =>
$this->
t('Enable password strength indicator'
),
'#default_value' =>
$config->
get('password_strength'
),
];
$form['registration_cancellation'
]['user_cancel_method'
] =
[ '#type' => 'radios',
'#title' =>
$this->
t('When cancelling a user account'
),
'#default_value' =>
$config->
get('cancel_method'
),
'#description' =>
$this->
t('Users with the %select-cancel-method or %administer-users <a href=":permissions-url">permissions</a> can override this default method.',
['%select-cancel-method' =>
$this->
t('Select method for cancelling account'
), '%administer-users' =>
$this->
t('Administer users'
), ':permissions-url' => Url::
fromRoute('user.admin_permissions'
)->
toString()]),
];
$form['registration_cancellation'
]['user_cancel_method'
] +=
user_cancel_methods();
foreach (Element::
children($form['registration_cancellation'
]['user_cancel_method'
]) as $key) { // All account cancellation methods that specify #access cannot be
// configured as default method.
// @see hook_user_cancel_methods_alter()
if (isset($form['registration_cancellation'
]['user_cancel_method'
][$key]['#access'
])) { $form['registration_cancellation'
]['user_cancel_method'
][$key]['#access'
] = FALSE;
} } // Default notifications address.
$form['mail_notification_address'
] =
[