You are here

public function ServerEnableDisableForm::getConfirmText in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_servers/src/Form/ServerEnableDisableForm.php \Drupal\ldap_servers\Form\ServerEnableDisableForm::getConfirmText()

Returns a caption for the button that confirms the action.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form confirmation text.

Overrides EntityConfirmFormBase::getConfirmText

File

ldap_servers/src/Form/ServerEnableDisableForm.php, line 47

Class

ServerEnableDisableForm
Form for disabling a server.

Namespace

Drupal\ldap_servers\Form

Code

public function getConfirmText() {
  if ($this->entity
    ->get('status') == 1) {
    return $this
      ->t('Disable');
  }
  else {
    return $this
      ->t('Enable');
  }
}