51 $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
54 if ($isAdmin || $userTsConfig[
'options.'][
'clearCache.'][
'pages'] ??
false) {
55 $this->cacheActions[] = [
57 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle',
58 'description' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushPageCachesDescription',
59 'href' => (string)$uriBuilder->buildUriFromRoute(
'tce_db', [
'cacheCmd' =>
'pages']),
60 'iconIdentifier' =>
'actions-system-cache-clear-impact-low'
62 $this->optionValues[] =
'pages';
68 if (($userTsConfig[
'options.'][
'clearCache.'][
'all'] ??
false)
69 || ($isAdmin && (bool)($userTsConfig[
'options.'][
'clearCache.'][
'all'] ??
true))
71 $this->cacheActions[] = [
73 'title' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushAllCachesTitle2',
74 'description' =>
'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:flushAllCachesDescription2',
75 'href' => (string)$uriBuilder->buildUriFromRoute(
'tce_db', [
'cacheCmd' =>
'all']),
76 'iconIdentifier' =>
'actions-system-cache-clear-impact-high'
78 $this->optionValues[] =
'all';
82 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'additionalBackendItems'][
'cacheActions'] ?? [] as $cacheAction) {
83 $hookObject = GeneralUtility::makeInstance($cacheAction);
85 throw new \UnexpectedValueException($cacheAction .
' must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
87 $hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
99 if ($backendUser->isAdmin()) {
102 foreach ($this->optionValues as $value) {
103 if ($backendUser->getTSConfig()[
'options.'][
'clearCache.'][$value] ??
false) {
121 $cacheAction = end($this->cacheActions);
122 $view->assignMultiple([
123 'link' => $cacheAction[
'href'],
124 'title' => $cacheAction[
'title'],
125 'iconIdentifier' => $cacheAction[
'iconIdentifier'],
127 return $view->render();
138 $view->assign(
'cacheActions', $this->cacheActions);
139 return $view->render();
159 return count($this->cacheActions) > 1;
187 return GeneralUtility::makeInstance(PageRenderer::class);
198 $view = GeneralUtility::makeInstance(StandaloneView::class);
199 $view->setLayoutRootPaths([
'EXT:backend/Resources/Private/Layouts']);
200 $view->setPartialRootPaths([
'EXT:backend/Resources/Private/Partials/ToolbarItems']);
201 $view->setTemplateRootPaths([
'EXT:backend/Resources/Private/Templates/ToolbarItems']);
203 $view->setTemplate($filename);
205 $view->getRequest()->setControllerExtensionName(
'Backend');