Task #56211
closedGeneral getSpriteIcon method for files and folders is missing
100%
Description
There is a general function to create a icon for a record. But there is no general function for creating a icon for a resource (file/folder).
With the introduction of FAL a the files and folders are object and so there is more info then just a name/extension to determine the right icon.
And with file_metadata you have the possibility to even add more info to a file (access rights etc) so it would be a nice addition if extensions could hook into the icon rendering and add overlays when needed.
My suggestion is to create a general function to create the icons for resources and implement a hook there so extensions can change the icon when needed and/or add overlays.
something like IconUtility::getSpriteIconForResource()
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27790
Updated by Gerrit Code Review almost 11 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27790
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27790
Updated by Frans Saris over 10 years ago
Some test procedures:
Cherry-pick the change and look if all icons still are shown in back-end. (file module, element browser, RTE element browsers).
Then add following to some ext_localconf.php of the AdditionalConfiguration.php
class IconOverlayTest implements \TYPO3\CMS\Backend\Utility\IconUtilityOverrideResourceIconHookInterface { /** * @param \TYPO3\CMS\Core\Resource\ResourceInterface $resource * @param $iconName * @param array $options * @param array $overlays */ public function overrideResourceIcon(\TYPO3\CMS\Core\Resource\ResourceInterface $resource, &$iconName, array &$options, array &$overlays) { // if (!$resource->getStorage()->isPublic()) { $overlays['status-overlay-access-restricted'] = array(); // } } } // Resource Icon hook $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon']['FalSecuredownload'] = 'IconOverlayTest';
After clearing all cache all file icons in backend should have the "access-restricted" overlay.
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27790
Updated by Frans Saris over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e997f2a6dc3d6b81bcc204ec13f3a4a2379986d5.