‪TYPO3CMS  ‪main
LiveSearchToolbarItem.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
20 use Psr\Http\Message\ServerRequestInterface;
26 
31 {
32  private ServerRequestInterface ‪$request;
33 
34  public function ‪__construct(
35  private readonly ‪ModuleProvider $moduleProvider,
36  private readonly ‪BackendViewFactory $backendViewFactory,
37  ) {}
38 
39  public function ‪setRequest(ServerRequestInterface ‪$request): void
40  {
41  $this->request = ‪$request;
42  }
43 
48  public function ‪checkAccess(): bool
49  {
50  return $this->moduleProvider->accessGranted('web_list', $this->‪getBackendUser());
51  }
52 
56  public function ‪getItem(): string
57  {
58  $view = $this->backendViewFactory->create($this->request);
59  return $view->render('ToolbarItems/LiveSearchToolbarItem');
60  }
61 
65  public function ‪getAdditionalAttributes(): array
66  {
67  return ['class' => 't3js-toolbar-item-search'];
68  }
69 
73  public function ‪hasDropDown(): bool
74  {
75  return false;
76  }
77 
81  public function ‪getDropDown(): string
82  {
83  return '';
84  }
85 
89  public function ‪getIndex(): int
90  {
91  return 80;
92  }
93 
95  {
96  return ‪$GLOBALS['BE_USER'];
97  }
98 }
‪TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface
Definition: ToolbarItemInterface.php:22
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem
Definition: LiveSearchToolbarItem.php:31
‪TYPO3\CMS\Backend\View\BackendViewFactory
Definition: BackendViewFactory.php:35
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\__construct
‪__construct(private readonly ModuleProvider $moduleProvider, private readonly BackendViewFactory $backendViewFactory,)
Definition: LiveSearchToolbarItem.php:34
‪TYPO3\CMS\Backend\Module\ModuleProvider
Definition: ModuleProvider.php:29
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\getIndex
‪getIndex()
Definition: LiveSearchToolbarItem.php:89
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\getDropDown
‪getDropDown()
Definition: LiveSearchToolbarItem.php:81
‪TYPO3\CMS\Backend\Backend\ToolbarItems
Definition: ClearCacheToolbarItem.php:18
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\$request
‪ServerRequestInterface $request
Definition: LiveSearchToolbarItem.php:32
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\getAdditionalAttributes
‪getAdditionalAttributes()
Definition: LiveSearchToolbarItem.php:65
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\getBackendUser
‪getBackendUser()
Definition: LiveSearchToolbarItem.php:94
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Backend\Toolbar\RequestAwareToolbarItemInterface
Definition: RequestAwareToolbarItemInterface.php:27
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\checkAccess
‪checkAccess()
Definition: LiveSearchToolbarItem.php:48
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\getItem
‪getItem()
Definition: LiveSearchToolbarItem.php:56
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\setRequest
‪setRequest(ServerRequestInterface $request)
Definition: LiveSearchToolbarItem.php:39
‪TYPO3\CMS\Backend\Backend\ToolbarItems\LiveSearchToolbarItem\hasDropDown
‪hasDropDown()
Definition: LiveSearchToolbarItem.php:73