Skip to content
Snippets Groups Projects
Commit f6c89e88 authored by Minakshi Phaltankar's avatar Minakshi Phaltankar Committed by Lachlan Ennis
Browse files

Issue #2798991 by minakshiPh, naveenvalecha, shruti1803, rasikap, keshav.k,...

Issue #2798991 by minakshiPh, naveenvalecha, shruti1803, rasikap, keshav.k, Yogesh Pawar: Fix coding standards & replace the deprecated methods
parent 173a3fe0
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ class CaptchaExamplesForm extends FormBase { ...@@ -35,7 +35,7 @@ class CaptchaExamplesForm extends FormBase {
else { else {
// Generate a list with examples of the available CAPTCHA types. // Generate a list with examples of the available CAPTCHA types.
$form['info'] = [ $form['info'] = [
'#markup' => t('This page gives an overview of all available challenge types, generated with their current settings.'), '#markup' => $this->t('This page gives an overview of all available challenge types, generated with their current settings.'),
]; ];
foreach (\Drupal::moduleHandler() foreach (\Drupal::moduleHandler()
->getImplementations('captcha') as $mkey => $module) { ->getImplementations('captcha') as $mkey => $module) {
...@@ -45,13 +45,13 @@ class CaptchaExamplesForm extends FormBase { ...@@ -45,13 +45,13 @@ class CaptchaExamplesForm extends FormBase {
foreach ($challenges as $ckey => $challenge) { foreach ($challenges as $ckey => $challenge) {
$form["captcha_{$mkey}_{$ckey}"] = [ $form["captcha_{$mkey}_{$ckey}"] = [
'#type' => 'details', '#type' => 'details',
'#title' => t('Challenge %challenge by module %module', [ '#title' => $this->t('Challenge %challenge by module %module', [
'%challenge' => $challenge, '%challenge' => $challenge,
'%module' => $module, '%module' => $module,
]), ]),
'challenge' => _captcha_generate_example_challenge($module, $challenge), 'challenge' => _captcha_generate_example_challenge($module, $challenge),
'more_examples' => [ 'more_examples' => [
'#markup' => Link::fromTextAndUrl(t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [ '#markup' => Link::fromTextAndUrl($this->t('10 more examples of this challenge.'), Url::fromRoute('captcha_examples', [
'module' => $module, 'module' => $module,
'challenge' => $challenge, 'challenge' => $challenge,
]))->toString(), ]))->toString(),
......
...@@ -48,8 +48,8 @@ class CaptchaPointForm extends EntityForm { ...@@ -48,8 +48,8 @@ class CaptchaPointForm extends EntityForm {
// Select widget for CAPTCHA type. // Select widget for CAPTCHA type.
$form['captchaType'] = [ $form['captchaType'] = [
'#type' => 'select', '#type' => 'select',
'#title' => t('Challenge type'), '#title' => $this->t('Challenge type'),
'#description' => t('The CAPTCHA type to use for this form.'), '#description' => $this->t('The CAPTCHA type to use for this form.'),
'#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings') '#default_value' => ($captcha_point->getCaptchaType() ?: $this->config('captcha.settings')
->get('default_challenge')), ->get('default_challenge')),
'#options' => _captcha_available_challenge_types(), '#options' => _captcha_available_challenge_types(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment