From b5c3274112f12e656b37b35f8a01535c546a4b4a Mon Sep 17 00:00:00 2001 From: fritzmg Date: Wed, 23 Aug 2023 14:36:59 +0100 Subject: [PATCH] small improvements --- contao/dca/tl_files.php | 2 +- contao/languages/de/tl_files.php | 1 + contao/languages/en/tl_files.php | 1 + public/link-off.svg | 7 +++++++ public/link.svg | 7 ++++++- public/refresh.svg | 5 +++++ public/repeat.svg | 6 +++++- public/search.svg | 6 +++++- public/search_16px.svg | 1 - src/DataContainer/FolderDataContainer.php | 3 ++- .../DataContainer/ShowReferencesButtonCallback.php | 5 +++-- 11 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 public/link-off.svg create mode 100644 public/refresh.svg delete mode 100644 public/search_16px.svg diff --git a/contao/dca/tl_files.php b/contao/dca/tl_files.php index 497bde3..8ba6941 100644 --- a/contao/dca/tl_files.php +++ b/contao/dca/tl_files.php @@ -18,6 +18,6 @@ $GLOBALS['TL_DCA']['tl_files']['list']['global_operations'] = array_merge([ 'unused' => [ 'href' => 'unused=1', - 'icon' => 'bundles/contaofileusage/search_16px.svg', + 'icon' => 'bundles/contaofileusage/search.svg', ], ], $GLOBALS['TL_DCA']['tl_files']['list']['global_operations']); diff --git a/contao/languages/de/tl_files.php b/contao/languages/de/tl_files.php index 3d3cd1b..591e152 100644 --- a/contao/languages/de/tl_files.php +++ b/contao/languages/de/tl_files.php @@ -11,3 +11,4 @@ */ $GLOBALS['TL_LANG']['tl_files']['unused'] = 'Unbenutzte Dateien'; +$GLOBALS['TL_LANG']['tl_files']['refresh_unused'] = ['Unbenutzte Dateien aktualisieren', 'Sucht nach Dateireferenzen. Vorsicht, hohe Auslastung!']; diff --git a/contao/languages/en/tl_files.php b/contao/languages/en/tl_files.php index 06d9c67..28ed8b0 100644 --- a/contao/languages/en/tl_files.php +++ b/contao/languages/en/tl_files.php @@ -11,3 +11,4 @@ */ $GLOBALS['TL_LANG']['tl_files']['unused'] = 'Unused files'; +$GLOBALS['TL_LANG']['tl_files']['refresh_unused'] = ['Refresh unused files', 'Searches for file references. Careful, high workload!']; diff --git a/public/link-off.svg b/public/link-off.svg new file mode 100644 index 0000000..0bec6c0 --- /dev/null +++ b/public/link-off.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/public/link.svg b/public/link.svg index e7e587b..f7fd9ab 100644 --- a/public/link.svg +++ b/public/link.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/public/refresh.svg b/public/refresh.svg new file mode 100644 index 0000000..4834c42 --- /dev/null +++ b/public/refresh.svg @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/public/repeat.svg b/public/repeat.svg index d676825..4c8560b 100644 --- a/public/repeat.svg +++ b/public/repeat.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/public/search.svg b/public/search.svg index fc34a67..fd099fc 100644 --- a/public/search.svg +++ b/public/search.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/public/search_16px.svg b/public/search_16px.svg deleted file mode 100644 index b31415a..0000000 --- a/public/search_16px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/DataContainer/FolderDataContainer.php b/src/DataContainer/FolderDataContainer.php index e7dcb01..d981c36 100644 --- a/src/DataContainer/FolderDataContainer.php +++ b/src/DataContainer/FolderDataContainer.php @@ -107,7 +107,8 @@ protected function generateTree($path, $intMargin, $mount = false, $blnProtected } $GLOBALS['TL_DCA']['tl_files']['list']['global_operations']['unused']['href'] .= '&refresh=1'; - $GLOBALS['TL_DCA']['tl_files']['list']['global_operations']['unused']['icon'] = 'bundles/contaofileusage/repeat.svg'; + $GLOBALS['TL_DCA']['tl_files']['list']['global_operations']['unused']['icon'] = 'bundles/contaofileusage/refresh.svg'; + $GLOBALS['TL_DCA']['tl_files']['list']['global_operations']['unused']['label'] = $GLOBALS['TL_LANG']['tl_files']['refresh_unused']; self::$breadcrumbSet = true; } diff --git a/src/EventListener/DataContainer/ShowReferencesButtonCallback.php b/src/EventListener/DataContainer/ShowReferencesButtonCallback.php index 68ddf77..5a0545d 100644 --- a/src/EventListener/DataContainer/ShowReferencesButtonCallback.php +++ b/src/EventListener/DataContainer/ShowReferencesButtonCallback.php @@ -64,14 +64,15 @@ public function __invoke(array $record): string $results = $cacheItem->get(); if (!$results->count()) { - $attributes = ' style="opacity:0.5"'; + $attributes = ' style="opacity:0.33"'; + $image = 'bundles/contaofileusage/link-off.svg'; $title = $this->translator->trans('button_no_file_usage', ['%filename%' => basename($file->path)], 'ContaoFileUsage'); } else { $title = $this->translator->trans('button_show_file_usage', ['%filename%' => basename($file->path)], 'ContaoFileUsage'); } } else { $image = 'bundles/contaofileusage/search.svg'; - $attributes = ' style="opacity:0.5"'; + $attributes = ' style="opacity:0.66"'; $title = $this->translator->trans('button_search_file_usage', ['%filename%' => basename($file->path)], 'ContaoFileUsage'); }