mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Vastly improved design and cleaned text input
This commit is contained in:
@ -53,10 +53,10 @@ class BookRepo
|
||||
$book->delete();
|
||||
}
|
||||
|
||||
public function getTree($book)
|
||||
public function getTree($book, $currentPageId = false)
|
||||
{
|
||||
$tree = $book->toArray();
|
||||
$tree['pages'] = $this->pageRepo->getTreeByBookId($book->id);
|
||||
$tree['pages'] = $this->pageRepo->getTreeByBookId($book->id, $currentPageId);
|
||||
$tree['hasChildren'] = count($tree['pages']) > 0;
|
||||
return $tree;
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class PageRepo
|
||||
$cPage['current'] = ($currentPageId !== false && $cPage['id'] === $currentPageId);
|
||||
$cPage['pages'] = [];
|
||||
foreach($page->children as $key => $childPage) {
|
||||
$cPage['pages'][$key] = $this->toArrayTree($childPage);
|
||||
$cPage['pages'][$key] = $this->toArrayTree($childPage, $currentPageId);
|
||||
}
|
||||
$cPage['hasChildren'] = count($cPage['pages']) > 0;
|
||||
return $cPage;
|
||||
|
Reference in New Issue
Block a user