You are here

public function WebformConfigEntityDeleteFormBase::getWarning in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Form/WebformConfigEntityDeleteFormBase.php \Drupal\webform\Form\WebformConfigEntityDeleteFormBase::getWarning()

Returns warning message to display.

Return value

array A renderable array containing a warning message.

Overrides WebformDeleteFormInterface::getWarning

1 call to WebformConfigEntityDeleteFormBase::getWarning()
WebformConfigEntityDeleteFormBase::buildForm in src/Form/WebformConfigEntityDeleteFormBase.php
Form constructor.

File

src/Form/WebformConfigEntityDeleteFormBase.php, line 57

Class

WebformConfigEntityDeleteFormBase
Provides a generic base class for a webform entity deletion form.

Namespace

Drupal\webform\Form

Code

public function getWarning() {
  $t_args = [
    '@entity-type' => $this
      ->getEntity()
      ->getEntityType()
      ->getSingularLabel(),
    '%label' => $this
      ->getEntity()
      ->label(),
  ];
  return [
    '#type' => 'webform_message',
    '#message_type' => 'warning',
    '#message_message' => $this
      ->t('Are you sure you want to delete the %label @entity-type?', $t_args) . '<br/>' . '<strong>' . $this
      ->t('This action cannot be undone.') . '</strong>',
  ];
}