Project

General

Profile

Actions

Task #56211

closed

General getSpriteIcon method for files and folders is missing

Added by Frans Saris almost 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend User Interface
Target version:
-
Start date:
2014-02-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

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()


Related issues 1 (0 open1 closed)

Blocks TYPO3 Core - Bug #56251: Icon in folder/file info pop-up is wrongClosed2014-02-24

Actions
Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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.

Actions #5

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

Actions #6

Updated by Frans Saris over 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF