protected function MenuDeleteMenuForm::getDescription

Returns additional text to display as a description.

Return value

string The form description.

Overrides ConfirmFormBase::getDescription

File

drupal/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteMenuForm.php, line 42
Contains \Drupal\menu\Form\MenuDeleteMenuForm.

Class

MenuDeleteMenuForm
Defines a confirmation form for deletion of a custom menu.

Namespace

Drupal\menu\Form

Code

protected function getDescription() {
  $caption = '';
  $num_links = \Drupal::entityManager()
    ->getStorageController('menu_link')
    ->countMenuLinks($this->menu
    ->id());
  if ($num_links) {
    $caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu link in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu links in %title. They will be deleted (system-defined links will be reset).', array(
      '%title' => $this->menu
        ->label(),
    )) . '</p>';
  }
  $caption .= '<p>' . t('This action cannot be undone.') . '</p>';
  return $caption;
}