You are here

function _phrase_captcha_enabled_word_challenges in CAPTCHA Pack 8

Same name and namespace in other branches
  1. 5 text_captcha/phrase_captcha/phrase_captcha.module \_phrase_captcha_enabled_word_challenges()
  2. 6 text_captcha/phrase_captcha/phrase_captcha.inc \_phrase_captcha_enabled_word_challenges()
  3. 7 text_captcha/phrase_captcha/phrase_captcha.module \_phrase_captcha_enabled_word_challenges()

Return enabled challenges.

2 calls to _phrase_captcha_enabled_word_challenges()
PhraseCaptchaSettingsForm::buildForm in text_captcha/modules/phrase_captcha/src/Form/PhraseCaptchaSettingsForm.php
Form constructor.
phrase_captcha_captcha in text_captcha/modules/phrase_captcha/phrase_captcha.module
Implements hook_captcha().

File

text_captcha/modules/phrase_captcha/phrase_captcha.module, line 176
Implementation of a phrase based CAPTCHA, for use with the CAPTCHA module.

Code

function _phrase_captcha_enabled_word_challenges() {
  $word_challenges = \Drupal::config('phrase_captcha.settings')
    ->get('phrase_captcha_word_selection_challenges');
  if ($word_challenges) {
    return array_keys(array_filter($word_challenges));
  }
  else {
    return array_keys(_phrase_captcha_available_word_challenges());
  }
}