Loading modules/image_captcha/config/install/image_captcha.settings.yml +1 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,4 @@ image_captcha_bilinear_interpolation: 0 image_captcha_dot_noise: 0 image_captcha_line_noise: 0 image_captcha_noise_level: 5 image_captcha_text_refresh: 'Reload Captcha' modules/image_captcha/config/schema/image_captcha.settings.yml +3 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,6 @@ image_captcha.settings: image_captcha_noise_level: type: integer label: 'Noise level' image_captcha_text_refresh: type: label label: 'String with allowed characters' modules/image_captcha/image_captcha.module +2 −2 Original line number Diff line number Diff line Loading @@ -379,9 +379,9 @@ function image_captcha_after_build_process($element) { $is_image_captcha = TRUE; } } $config = \Drupal::config('image_captcha.settings'); if ($is_image_captcha && isset($element['captcha_widgets']['captcha_image'])) { $uri = Link::fromTextAndUrl(t('Get new captcha!'), $uri = Link::fromTextAndUrl($config->get('image_captcha_text_refresh'), new Url('image_captcha.refresh', ['form_id' => $form_id], ['attributes' => ['class' => ['reload-captcha']]] Loading modules/image_captcha/src/Form/ImageCaptchaSettingsForm.php +14 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,20 @@ class ImageCaptchaSettingsForm extends ConfigFormBase { '#default_value' => (int) $config->get('image_captcha_noise_level'), ]; $form['image_captcha_text_settings'] = [ '#type' => 'details', '#title' => $this->t('Text Content'), '#description' => $this->t('Customize image CAPTCHA text content.'), ]; $form['image_captcha_text_settings']['image_captcha_text_refresh'] = [ '#type' => 'textfield', '#title' => $this->t('Refresh button text.'), '#description' => $this->t('Customize the refresh button text.'), '#default_value' => $config->get('image_captcha_text_refresh'), '#size' => 15, '#required' => TRUE, ]; // Enter the characters shown in the image. return parent::buildForm($form, $form_state); } Loading Loading
modules/image_captcha/config/install/image_captcha.settings.yml +1 −0 Original line number Diff line number Diff line Loading @@ -14,3 +14,4 @@ image_captcha_bilinear_interpolation: 0 image_captcha_dot_noise: 0 image_captcha_line_noise: 0 image_captcha_noise_level: 5 image_captcha_text_refresh: 'Reload Captcha'
modules/image_captcha/config/schema/image_captcha.settings.yml +3 −0 Original line number Diff line number Diff line Loading @@ -65,3 +65,6 @@ image_captcha.settings: image_captcha_noise_level: type: integer label: 'Noise level' image_captcha_text_refresh: type: label label: 'String with allowed characters'
modules/image_captcha/image_captcha.module +2 −2 Original line number Diff line number Diff line Loading @@ -379,9 +379,9 @@ function image_captcha_after_build_process($element) { $is_image_captcha = TRUE; } } $config = \Drupal::config('image_captcha.settings'); if ($is_image_captcha && isset($element['captcha_widgets']['captcha_image'])) { $uri = Link::fromTextAndUrl(t('Get new captcha!'), $uri = Link::fromTextAndUrl($config->get('image_captcha_text_refresh'), new Url('image_captcha.refresh', ['form_id' => $form_id], ['attributes' => ['class' => ['reload-captcha']]] Loading
modules/image_captcha/src/Form/ImageCaptchaSettingsForm.php +14 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,20 @@ class ImageCaptchaSettingsForm extends ConfigFormBase { '#default_value' => (int) $config->get('image_captcha_noise_level'), ]; $form['image_captcha_text_settings'] = [ '#type' => 'details', '#title' => $this->t('Text Content'), '#description' => $this->t('Customize image CAPTCHA text content.'), ]; $form['image_captcha_text_settings']['image_captcha_text_refresh'] = [ '#type' => 'textfield', '#title' => $this->t('Refresh button text.'), '#description' => $this->t('Customize the refresh button text.'), '#default_value' => $config->get('image_captcha_text_refresh'), '#size' => 15, '#required' => TRUE, ]; // Enter the characters shown in the image. return parent::buildForm($form, $form_state); } Loading