You are here

public function SpambotUserspamForm::sfsRequestDataMessage in Spambot 8

Function add message by field.

Parameters

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 in src/Form/SpambotUserspamForm.php
Function provide functional for "Check" button.

File

src/Form/SpambotUserspamForm.php, line 429

Class

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' => "http://www.stopforumspam.com/search?q={$request[$field]}",
      '@field' => $request[$field],
      '%num' => $data[$field]['frequency'],
    ]),
    'type' => 'warning',
  ];
}