You are here

public function FancyFileDeleteManual::_submitForm in Fancy File Delete 2.0.x

Same name and namespace in other branches
  1. 8 src/Form/FancyFileDeleteManual.php \Drupal\fancy_file_delete\Form\FancyFileDeleteManual::_submitForm()
1 call to FancyFileDeleteManual::_submitForm()
FancyFileDeleteManual::submitForm in src/Form/FancyFileDeleteManual.php
Form submission handler.

File

src/Form/FancyFileDeleteManual.php, line 85

Class

FancyFileDeleteManual
Class FancyFileDeleteManual.

Namespace

Drupal\fancy_file_delete\Form

Code

public function _submitForm(array &$form, FormStateInterface $form_state) {
  $values = [];
  $force = $form_state
    ->getValue([
    'force',
  ]) ? TRUE : FALSE;
  $fids = preg_split("/\r?\n/", $form_state
    ->getValue([
    'delete_textarea',
  ]));
  foreach ($fids as $fid) {
    $values[] = $fid;
  }

  // Send to batch.
  \Drupal::service('fancy_file_delete.batch')
    ->setBatch($values, $force);
}