You are here

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

Same name and namespace in other branches
  1. 8.3 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 50

Class

ServerEnableDisableForm
Form for disabling a server.

Namespace

Drupal\ldap_servers\Form

Code

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