public function DeleteMultiple::buildForm

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfirmFormBase::buildForm

File

drupal/core/modules/node/lib/Drupal/node/Form/DeleteMultiple.php, line 97
Contains \Drupal\node\Form\DeleteMultiple.

Class

DeleteMultiple
Provides a node deletion confirmation form.

Namespace

Drupal\node\Form

Code

public function buildForm(array $form, array &$form_state) {
  $this->nodes = $this->tempStoreFactory
    ->get('node_multiple_delete_confirm')
    ->get($GLOBALS['user']->uid);
  if (empty($this->nodes)) {
    drupal_goto($this
      ->getCancelPath());
  }
  $form['nodes'] = array(
    '#theme' => 'item_list',
    '#items' => array_map(function ($node) {
      return String::checkPlain($node
        ->label());
    }, $this->nodes),
  );
  return parent::buildForm($form, $form_state);
}