|
@@ 72-87 (lines=16) @@
|
| 69 |
|
$successMessage = $this->getMessage($model, $message, 'success'); |
| 70 |
|
$redirection = $this->redirectToList($model); |
| 71 |
|
|
| 72 |
|
return $this->showConfirmationForm(function () use ($model, $hard, $redirection, $onSuccess) { |
| 73 |
|
if ($hard) { |
| 74 |
|
$model->wipe(); |
| 75 |
|
} else { |
| 76 |
|
$model->delete(); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
if ($onSuccess) { |
| 80 |
|
$response = $onSuccess(); |
| 81 |
|
if ($response instanceof Response) { |
| 82 |
|
return $response; |
| 83 |
|
} |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
return $redirection; |
| 87 |
|
}, $this->getMessage($model, $message, 'confirm'), $successMessage, $action); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
protected function restore(PermissionModel $model, Player $me, $onSuccess) |
|
@@ 104-115 (lines=12) @@
|
| 101 |
|
|
| 102 |
|
$successMessage = $this->getMessage($model, 'restore', 'success'); |
| 103 |
|
|
| 104 |
|
return $this->showConfirmationForm(function () use ($model, $successMessage, $onSuccess) { |
| 105 |
|
$model->restore(); |
| 106 |
|
|
| 107 |
|
if ($onSuccess) { |
| 108 |
|
$response = $onSuccess(); |
| 109 |
|
if ($response instanceof Response) { |
| 110 |
|
return $response; |
| 111 |
|
} |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
return $this->redirectTo($model); |
| 115 |
|
}, $this->getMessage($model, 'restore', 'confirm'), $successMessage, 'Restore'); |
| 116 |
|
} |
| 117 |
|
|
| 118 |
|
/** |