request = $request; } /** * Checks whether the user has access to this toolbar item. * Live search depends on the records module and only available when that module is allowed. */ public function checkAccess(): bool { return $this->moduleProvider->accessGranted('records', $this->getBackendUser()); } /** * Render search field. */ public function getItem(): string { $view = $this->backendViewFactory->create($this->request); return $view->render('ToolbarItems/LiveSearchToolbarItem'); } /** * This item needs additional attributes. */ public function getAdditionalAttributes(): array { return ['class' => 't3js-toolbar-item-search']; } /** * This item has no drop-down. */ public function hasDropDown(): bool { return false; } /** * No drop-down here. */ public function getDropDown(): string { return ''; } /** * Position relative to others, live search should be very right. */ public function getIndex(): int { return 10; } protected function getBackendUser(): BackendUserAuthentication { return $GLOBALS['BE_USER']; } }