You are here

public function HostMultipleBanConfirm::setConfirmText in http:BL 8

1 call to HostMultipleBanConfirm::setConfirmText()
HostMultipleBanConfirm::buildForm in src/Form/HostMultipleBanConfirm.php
Form constructor.

File

src/Form/HostMultipleBanConfirm.php, line 138

Class

HostMultipleBanConfirm
Provides a multiple host blacklisting and banning confirmation form.

Namespace

Drupal\httpbl\Form

Code

public function setConfirmText($userInList = FALSE, $blacklistConfirmText = NULL) {
  global $blacklistConfirmText;
  $banningEnabled = TRUE ? \Drupal::state()
    ->get('httpbl.storage') == HTTPBL_DB_HH_DRUPAL : ($banningEnabled = FALSE);
  if ($userInList && $banningEnabled) {
    $blacklistConfirmText = t('Blacklist and Ban Hosts -- including ME!');
  }
  elseif ($banningEnabled) {
    $blacklistConfirmText = t('Blacklist and Ban');
  }
  if ($userInList && !$banningEnabled) {
    $blacklistConfirmText = t('Blacklist Hosts -- including ME!');
  }
  elseif (!$banningEnabled) {
    $blacklistConfirmText = t('Blacklist');
  }
  return $blacklistConfirmText;
}