]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/BookshelfController.php
Add git to the apt-get install packages.
[bookstack] / app / Http / Controllers / BookshelfController.php
index 32d08dc77da28d6cfb99f385b90a0d44673bd137..bef96dd01a6e41c62ec67e97d04437baf760ced4 100644 (file)
@@ -40,9 +40,9 @@ class BookshelfController extends Controller
      */
     public function index()
     {
-        $view = setting()->getUser($this->currentUser, 'bookshelves_view_type', config('app.views.bookshelves', 'grid'));
-        $sort = setting()->getUser($this->currentUser, 'bookshelves_sort', 'name');
-        $order = setting()->getUser($this->currentUser, 'bookshelves_sort_order', 'asc');
+        $view = setting()->getForCurrentUser('bookshelves_view_type', config('app.views.bookshelves', 'grid'));
+        $sort = setting()->getForCurrentUser('bookshelves_sort', 'name');
+        $order = setting()->getForCurrentUser('bookshelves_sort_order', 'asc');
         $sortOptions = [
             'name' => trans('common.sort_name'),
             'created_at' => trans('common.sort_created_at'),
@@ -54,7 +54,7 @@ class BookshelfController extends Controller
             $shelf->books = $this->entityRepo->getBookshelfChildren($shelf);
         }
 
-        $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
+        $recents = $this->isSignedIn() ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
         $popular = $this->entityRepo->getPopular('bookshelf', 4, 0);
         $new = $this->entityRepo->getRecentlyCreated('bookshelf', 4, 0);
 
@@ -177,7 +177,7 @@ class BookshelfController extends Controller
             'image' => $this->imageRepo->getImageValidationRules(),
         ]);
 
-         $shelf = $this->entityRepo->updateFromInput('bookshelf', $shelf, $request->all());
+         $shelf = $this->entityRepo->updateFromInput($shelf, $request->all());
          $this->shelfUpdateActions($shelf, $request);
 
          Activity::add($shelf, 'bookshelf_update');
@@ -212,7 +212,7 @@ class BookshelfController extends Controller
     {
         $shelf = $this->entityRepo->getEntityBySlug('bookshelf', $slug); /** @var $shelf Bookshelf */
         $this->checkOwnablePermission('bookshelf-delete', $shelf);
-        Activity::addMessage('bookshelf_delete', 0, $shelf->name);
+        Activity::addMessage('bookshelf_delete', $shelf->name);
 
         if ($shelf->cover) {
             $this->imageRepo->destroyImage($shelf->cover);
@@ -254,7 +254,7 @@ class BookshelfController extends Controller
         $this->checkOwnablePermission('restrictions-manage', $shelf);
 
         $this->entityRepo->updateEntityPermissionsFromRequest($request, $shelf);
-        session()->flash('success', trans('entities.shelves_permissions_updated'));
+        $this->showSuccessNotification( trans('entities.shelves_permissions_updated'));
         return redirect($shelf->getUrl());
     }
 
@@ -270,7 +270,7 @@ class BookshelfController extends Controller
         $this->checkOwnablePermission('restrictions-manage', $shelf);
 
         $updateCount = $this->entityRepo->copyBookshelfPermissions($shelf);
-        session()->flash('success', trans('entities.shelves_copy_permission_success', ['count' => $updateCount]));
+        $this->showSuccessNotification( trans('entities.shelves_copy_permission_success', ['count' => $updateCount]));
         return redirect($shelf->getUrl());
     }