mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-10-12 02:01:37 +00:00
So that their metadata can be read without having to create instances and fullfill dependancy injection just to list. Also added title to interface prefs page.
26 lines
630 B
PHP
26 lines
630 B
PHP
<?php
|
|
|
|
namespace BookStack\View\ViewBlocks;
|
|
|
|
use BookStack\Entities\Models\Book;
|
|
use BookStack\View\ViewBlock;
|
|
use Illuminate\Http\Request;
|
|
|
|
class PagesShowBookTree extends ViewBlock
|
|
{
|
|
protected static string $id = 'builtin_pages-show-book-tree';
|
|
protected static string $view = 'entities.book-tree';
|
|
protected static string $labelTranslationKey = 'entities.books_navigation';
|
|
|
|
public function withData(array $viewData): array
|
|
{
|
|
/** @var Book $book */
|
|
$book = $viewData['book'];
|
|
|
|
return [
|
|
'book' => $book,
|
|
'bookTree' => $viewData['bookTree'],
|
|
];
|
|
}
|
|
}
|