Unassign task confirmation form.
Expanded class hierarchy of LocalTaskUnassignForm
class LocalTaskUnassignForm extends ContentEntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return new TranslatableMarkup('Are you sure you want to unassign from the translation task @label?', [
'@label' => $this
->getEntity()
->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
$view = Views::getView('tmgmt_local_task_overview');
$view
->initDisplay();
return $view
->getUrl();
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return t('Unassign');
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
/** @var LocalTask $entity */
$entity = $this
->getEntity();
$entity
->unassign();
$entity
->save();
$this
->messenger()
->addStatus(t('Unassigned from translation local task @label.', array(
'@label' => $entity
->label(),
)));
$view = Views::getView('tmgmt_local_task_overview');
$view
->initDisplay();
$form_state
->setRedirect($view
->getUrl()
->getRouteName());
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LocalTaskUnassignForm:: |
public | function | ||
LocalTaskUnassignForm:: |
public | function | ||
LocalTaskUnassignForm:: |
public | function | ||
LocalTaskUnassignForm:: |
public | function |