Skip to content

Commit

Permalink
small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Aug 23, 2023
1 parent 4d2dd73 commit b5c3274
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion contao/dca/tl_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
1 change: 1 addition & 0 deletions contao/languages/de/tl_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!'];
1 change: 1 addition & 0 deletions contao/languages/en/tl_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -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!'];
7 changes: 7 additions & 0 deletions public/link-off.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion public/link.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion public/repeat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion public/search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/search_16px.svg

This file was deleted.

3 changes: 2 additions & 1 deletion src/DataContainer/FolderDataContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down

0 comments on commit b5c3274

Please sign in to comment.