request = $request; } /** * Checks whether the user has access to this toolbar item. */ public function checkAccess(): bool { return $this->bookmarkService->isEnabled(); } /** * Render bookmark icon. */ public function getItem(): string { $view = $this->backendViewFactory->create($this->request); return $view->render('ToolbarItems/BookmarkToolbarItemItem'); } /** * This item has a drop-down. */ public function hasDropDown(): bool { return true; } /** * Render drop-down content. * The dropdown contains a custom element that fetches data via AJAX. */ public function getDropDown(): string { $view = $this->backendViewFactory->create($this->request); return $view->render('ToolbarItems/BookmarkToolbarItemDropDown'); } /** * This toolbar item needs no additional attributes. */ public function getAdditionalAttributes(): array { return []; } /** * Position relative to others. */ public function getIndex(): int { return 40; } }