You are here

public function RuleDeleteForm::submit in JS injector 8

File

lib/Drupal/js_injector/Form/RuleDeleteForm.php, line 46
Contains \Drupal\js_injector\Form\RuleDeleteForm.

Class

RuleDeleteForm
Provides a deletion confirmation form for js_injector rule entity.

Namespace

Drupal\js_injector\Form

Code

public function submit(array $form, array &$form_state) {

  // Clean up the JavaScript file.
  file_unmanaged_delete(_js_injector_rule_uri($this->entity
    ->id()));
  $this->entity
    ->delete();
  watchdog('user', 'Rule %name has been deleted.', array(
    '%name' => $this->entity
      ->label(),
  ));
  drupal_set_message(t('Rule %name has been deleted.', array(
    '%name' => $this->entity
      ->label(),
  )));
  $form_state['redirect'] = 'admin/config/development/js-injector';
}