Files
BookStack/app/View/ViewBlocks/PagesShowActions.php
T
Dan Brown 01b29515c8 Layouts: Updated view block ids/labels to be static
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.
2026-08-16 10:41:43 +01:00

27 lines
715 B
PHP

<?php
namespace BookStack\View\ViewBlocks;
use BookStack\Activity\Tools\UserEntityWatchOptions;
use BookStack\Entities\Models\Page;
use BookStack\View\ViewBlock;
use Illuminate\Http\Request;
class PagesShowActions extends ViewBlock
{
protected static string $id = 'builtin_pages-show-actions';
protected static string $view = 'pages.parts.show-sidebar-section-actions';
protected static string $labelTranslationKey = 'common.actions';
public function withData(array $viewData): array
{
/** @var Page $page */
$page = $viewData['page'];
return [
'page' => $page,
'watchOptions' => new UserEntityWatchOptions(user(), $page),
];
}
}