CrossdomainDeleteForm.php in Crossdomain 8
File
lib/Drupal/crossdomain/Form/CrossdomainDeleteForm.php
View source
<?php
namespace Drupal\crossdomain\Form;
use Drupal\Core\Entity\EntityConfirmFormBase;
class CrossdomainDeleteForm extends EntityConfirmFormBase {
public function getQuestion() {
return $this
->t('Are you sure you want to delete %name?', array(
'%name' => $this->entity
->label(),
));
}
public function getCancelRoute() {
return array(
'route_name' => 'crossdomain.admin_overview',
);
}
public function getConfirmText() {
return $this
->t('Delete');
}
public function submit(array $form, array &$form_state) {
$this->entity
->delete();
drupal_set_message($this
->t('%label has been deleted.', array(
'%label' => $this->entity
->label(),
)));
$form_state['redirect'] = 'admin/config/media/crossdomain';
}
}