X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/2a2cc858f0f95c606f2ad2542f915d3bd761775f..refs/pull/1695/head:/app/Http/Controllers/BookshelfController.php diff --git a/app/Http/Controllers/BookshelfController.php b/app/Http/Controllers/BookshelfController.php index c369ce655..bef96dd01 100644 --- a/app/Http/Controllers/BookshelfController.php +++ b/app/Http/Controllers/BookshelfController.php @@ -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);