-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathPagesShowPageNav.php
More file actions
27 lines (21 loc) · 745 Bytes
/
Copy pathPagesShowPageNav.php
File metadata and controls
27 lines (21 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
namespace BookStack\View\ViewBlocks;
use BookStack\Entities\Models\Page;
use BookStack\Entities\Tools\PageContent;
use BookStack\View\SimpleViewBlock;
class PagesShowPageNav extends SimpleViewBlock
{
protected static string $id = 'builtin_pages-show-page-nav';
protected static string $view = 'pages.parts.show-sidebar-section-page-nav';
protected static string $labelTranslationKey = 'entities.pages_navigation';
public function getViewData(array $viewData): array
{
/** @var Page $page */
$page = $viewData['page'];
$pageContent = new PageContent($page);
$pageNav = $pageContent->getNavigation($page->html);
return [
'pageNav' => $pageNav,
];
}
}