2 namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
56 $this->
getPageRenderer()->loadRequireJsModule(
'TYPO3/CMS/Backend/Toolbar/ClearCacheMenu');
59 if ($backendUser->isAdmin() || $backendUser->getTSConfigVal(
'options.clearCache.pages')) {
60 $this->cacheActions[] = array(
62 'title' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushPageCachesTitle',
true),
63 'description' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushPageCachesDescription',
true),
64 'href' => BackendUtility::getModuleUrl(
'tce_db', [
'vC' => $backendUser->veriCode(),
'cacheCmd' =>
'pages',
'ajaxCall' => 1]),
65 'icon' => $this->iconFactory->getIcon(
'actions-system-cache-clear-impact-low',
Icon::SIZE_SMALL)->render()
67 $this->optionValues[] =
'pages';
71 if ($backendUser->isAdmin() || $backendUser->getTSConfigVal(
'options.clearCache.all')) {
72 $this->cacheActions[] = array(
74 'title' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesTitle',
true),
75 'description' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushGeneralCachesDescription',
true),
76 'href' => BackendUtility::getModuleUrl(
'tce_db', [
'vC' => $backendUser->veriCode(),
'cacheCmd' =>
'all',
'ajaxCall' => 1]),
77 'icon' => $this->iconFactory->getIcon(
'actions-system-cache-clear-impact-medium',
Icon::SIZE_SMALL)->render()
79 $this->optionValues[] =
'all';
87 || ((bool)
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'clearCacheSystem'] ===
true && $backendUser->isAdmin())) {
88 $this->cacheActions[] = array(
90 'title' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushSystemCachesTitle',
true),
91 'description' => $languageService->sL(
'LLL:EXT:lang/locallang_core.xlf:flushSystemCachesDescription',
true),
92 'href' => BackendUtility::getModuleUrl(
'tce_db', [
'vC' => $backendUser->veriCode(),
'cacheCmd' =>
'system',
'ajaxCall' => 1]),
93 'icon' => $this->iconFactory->getIcon(
'actions-system-cache-clear-impact-high',
Icon::SIZE_SMALL)->render()
95 $this->optionValues[] =
'system';
99 if (is_array(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'additionalBackendItems'][
'cacheActions'])) {
100 foreach (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
'additionalBackendItems'][
'cacheActions'] as $cacheAction) {
103 throw new \UnexpectedValueException(
'$hookObject must implement interface ' . ClearCacheActionsHookInterface::class, 1228262000);
105 $hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
118 if ($backendUser->isAdmin()) {
121 if (is_array($this->optionValues)) {
122 foreach ($this->optionValues as $value) {
123 if ($backendUser->getTSConfigVal(
'options.clearCache.' . $value)) {
138 $title = $this->
getLanguageService()->sL(
'LLL:EXT:lang/locallang_core.xlf:rm.clearCache_clearCache',
true);
139 return '<span title="' . $title .
'">'
140 . $this->iconFactory->getIcon(
'apps-toolbar-menu-cache',
Icon::SIZE_SMALL)->render(
'inline')
152 $result[] =
'<ul class="dropdown-list">';
153 foreach ($this->cacheActions as $cacheAction) {
154 $title = $cacheAction[
'description'] ?: $cacheAction[
'title'];
156 $result[] =
'<a class="dropdown-list-link" href="' . htmlspecialchars($cacheAction[
'href']) .
'" title="' . htmlspecialchars($title) .
'">';
157 $result[] = $cacheAction[
'icon'] .
' ' . htmlspecialchars($cacheAction[
'title']);
162 return implode(LF, $result);