mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-10-12 02:01:37 +00:00
29 lines
738 B
PHP
29 lines
738 B
PHP
<?php
|
|
|
|
namespace BookStack\View\ViewBlocks;
|
|
|
|
use BookStack\Entities\Models\Page;
|
|
use BookStack\Entities\Tools\PageContent;
|
|
use BookStack\View\ViewBlock;
|
|
use Illuminate\Http\Request;
|
|
|
|
class PagesShowPageNav extends ViewBlock
|
|
{
|
|
protected string $id = 'builtin_pages-show-page-nav';
|
|
protected string $view = 'pages.parts.show-sidebar-section-page-nav';
|
|
protected string $labelTranslationKey = 'entities.pages_navigation';
|
|
|
|
public function withData(array $viewData): array
|
|
{
|
|
/** @var Page $page */
|
|
$page = $viewData['page'];
|
|
|
|
$pageContent = new PageContent($page);
|
|
$pageNav = $pageContent->getNavigation($page->html);
|
|
|
|
return [
|
|
'pageNav' => $pageNav,
|
|
];
|
|
}
|
|
}
|