X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/9e033709a78824decbf959ea25ce8672b026da09..refs/pull/2716/head:/app/Http/Controllers/RecycleBinController.php diff --git a/app/Http/Controllers/RecycleBinController.php b/app/Http/Controllers/RecycleBinController.php index 64459da23..a644a2889 100644 --- a/app/Http/Controllers/RecycleBinController.php +++ b/app/Http/Controllers/RecycleBinController.php @@ -1,7 +1,8 @@ middleware(function ($request, $next) { $this->checkPermission('settings-manage'); $this->checkPermission('restrictions-manage-all'); return $next($request); }); - parent::__construct(); } @@ -31,6 +30,7 @@ class RecycleBinController extends Controller { $deletions = Deletion::query()->with(['deletable', 'deleter'])->paginate(10); + $this->setPageTitle(trans('settings.recycle_bin')); return view('settings.recycle-bin.index', [ 'deletions' => $deletions, ]); @@ -57,6 +57,7 @@ class RecycleBinController extends Controller { /** @var Deletion $deletion */ $deletion = Deletion::query()->findOrFail($id); + $this->logActivity(ActivityType::RECYCLE_BIN_RESTORE, $deletion); $restoreCount = (new TrashCan())->restoreFromDeletion($deletion); $this->showSuccessNotification(trans('settings.recycle_bin_restore_notification', ['count' => $restoreCount])); @@ -84,6 +85,7 @@ class RecycleBinController extends Controller { /** @var Deletion $deletion */ $deletion = Deletion::query()->findOrFail($id); + $this->logActivity(ActivityType::RECYCLE_BIN_DESTROY, $deletion); $deleteCount = (new TrashCan())->destroyFromDeletion($deletion); $this->showSuccessNotification(trans('settings.recycle_bin_destroy_notification', ['count' => $deleteCount])); @@ -96,8 +98,9 @@ class RecycleBinController extends Controller */ public function empty() { - $deleteCount = (new TrashCan())->destroyFromAllDeletions(); + $deleteCount = (new TrashCan())->empty(); + $this->logActivity(ActivityType::RECYCLE_BIN_EMPTY); $this->showSuccessNotification(trans('settings.recycle_bin_destroy_notification', ['count' => $deleteCount])); return redirect($this->recycleBinBaseUrl); }