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.
31 lines
793 B
PHP
31 lines
793 B
PHP
<?php
|
|
|
|
namespace BookStack\View\ViewBlocks;
|
|
|
|
use BookStack\Activity\ActivityQueries;
|
|
use BookStack\Entities\Models\Book;
|
|
use BookStack\View\ViewBlock;
|
|
use Illuminate\Http\Request;
|
|
|
|
class BooksShowActivity extends ViewBlock
|
|
{
|
|
protected static string $id = 'builtin_books-show-activity';
|
|
protected static string $view = 'books.parts.show-sidebar-section-activity';
|
|
protected static string $labelTranslationKey = 'entities.recent_activity';
|
|
|
|
public function __construct(
|
|
protected ActivityQueries $activityQueries,
|
|
) {
|
|
}
|
|
|
|
public function withData(array $viewData): array
|
|
{
|
|
/** @var Book $book */
|
|
$book = $viewData['book'];
|
|
|
|
return [
|
|
'activity' => $this->activityQueries->entityActivity($book, 20, 1),
|
|
];
|
|
}
|
|
}
|