public function DeleteMultiple::submitForm

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: An associative array containing the current state of the form.

Overrides FormInterface::submitForm

File

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

Class

DeleteMultiple
Provides a node deletion confirmation form.

Namespace

Drupal\node\Form

Code

public function submitForm(array &$form, array &$form_state) {
  if ($form_state['values']['confirm'] && !empty($this->nodes)) {
    $this->storageController
      ->delete($this->nodes);
    $this->tempStoreFactory
      ->get('node_multiple_delete_confirm')
      ->delete($GLOBALS['user']->uid);
    $count = count($this->nodes);
    watchdog('content', 'Deleted @count posts.', array(
      '@count' => $count,
    ));
    drupal_set_message(format_plural($count, 'Deleted 1 post.', 'Deleted @count posts.'));
  }
  $form_state['redirect'] = 'admin/content';
}