Function add message by field.

Paramètres

array|null $request: Query.

array|null $data: Request data.

string $field: Email or username field.

Return value

array Message array element containing 'text' and 'type' data.

1 call to SpambotUserspamForm::sfsRequestDataMessage()
SpambotUserspamForm::checkSubmit dans src/Form/SpambotUserspamForm.php
Function provide functional for "Check" button.

Fichier

src/Form/SpambotUserspamForm.php, line 429

Classe

SpambotUserspamForm
Settings form to save the configuration for Spambot.

Namespace

Drupal\spambot\Form

Code

public function sfsRequestDataMessage($request, $data, $field) {
    return [
        'text' => $this->t('This account\'s @field address matches %num times: <a href=":href" target="_blank">@field</a>.', [
            '@field' => $field,
            ':href' => "https://www.stopforumspam.com/search?q={$request[$field]}",
            '@field' => $request[$field],
            '%num' => $data[$field]['frequency'],
        ]),
        'type' => 'warning',
    ];
}