TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Sprite\SpriteManager Class Reference

Static Public Member Functions

static isInitialized ()
 
static addIconSprite (array $icons, $styleSheetFile='')
 
static addSingleIcons (array $icons, $extKey='')
 
static addTcaTypeIcon ($table, $type, $iconFile)
 

Static Public Attributes

static $tempPath = 'typo3temp/sprites/'
 

Static Protected Member Functions

static getCacheIdentifier ()
 

Static Protected Attributes

static $isInitialized = false
 

Detailed Description

TYPO3 sprite manager, used in BE and in FE if a BE user is logged in.

This class builds CSS definitions of registered icons, writes TCA definitions and registers sprite icons in a cache file.

A configurable handler class does the business task.

Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 28 of file SpriteManager.php.

Member Function Documentation

◆ addIconSprite()

static TYPO3\CMS\Backend\Sprite\SpriteManager::addIconSprite ( array  $icons,
  $styleSheetFile = '' 
)
static

API for extensions to register own sprites.

Get an array of icon names and the styleSheetFile with defined sprite icons. The stylesheet filename should contain the extension name to be unique.

Naming conventions:

  • IconName: extensions-$extKey-$iconName
  • CSS class for loading the sprite: t3-icon-extensions-$extKey
  • CSS class for single icons: t3-icon-$extKey-$iconName
Parameters
array$iconsIcon names
string$styleSheetFileStylesheet filename relative to PATH_typo3. Skins do not need to supply the $styleSheetFile, if the CSS file is within the registered stylesheet folders
Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 142 of file SpriteManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

◆ addSingleIcons()

static TYPO3\CMS\Backend\Sprite\SpriteManager::addSingleIcons ( array  $icons,
  $extKey = '' 
)
static

API for extensions to register new sprite images which can be used with ::getSpriteIcon('extensions-$extKey-iconName');

Parameters
array$iconsIcons to be registered, $iconname => $iconFile, $iconFile must be relative to PATH_site
string$extKeyExtension key
Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 160 of file SpriteManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

Referenced by TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addSingleIconsWithEmptyValueSetsArrayKey(), TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addSingleIconsWithEmptyValueSetsImagePathValue(), TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addSingleIconsWithNormalValueSetsArrayKey(), and TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addSingleIconsWithNormalValueSetsImagePathValue().

◆ addTcaTypeIcon()

static TYPO3\CMS\Backend\Sprite\SpriteManager::addTcaTypeIcon (   $table,
  $type,
  $iconFile 
)
static

API to register new type icons for tables which use "typeicon_classes" Can be used to provide icons for "modules" in pages table

Parameters
string$tableTable name to which the type icon should be added
string$typeType column name of the table
string$iconFileIcon filename, relative to PATH_typo3
Returns
void
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 178 of file SpriteManager.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

Referenced by TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addTcaTypeIconWithEmptyValueSetsArrayKey(), TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addTcaTypeIconWithEmptyValueSetsEmptyArrayValue(), TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addTcaTypeIconWithTableAndTypeAndValueSetsArrayValue(), and TYPO3\CMS\Backend\Tests\Unit\Sprite\SpriteManagerTest\addTcaTypeIconWithTableAndTypeSetsArrayKey().

◆ getCacheIdentifier()

static TYPO3\CMS\Backend\Sprite\SpriteManager::getCacheIdentifier ( )
staticprotected

Get cache identifier for $GLOBALS['TBE_STYLES']['spriteIconApi']['iconsAvailable']

Returns
string

Definition at line 121 of file SpriteManager.php.

◆ isInitialized()

static TYPO3\CMS\Backend\Sprite\SpriteManager::isInitialized ( )
static

Whether the sprite manager is initialized.

Returns
bool TRUE if sprite manager is initialized
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8

Definition at line 68 of file SpriteManager.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Core\Utility\GeneralUtility\mkdir().

Member Data Documentation

◆ $isInitialized

TYPO3\CMS\Backend\Sprite\SpriteManager::$isInitialized = false
staticprotected

Is sprite manager initialized

Definition at line 38 of file SpriteManager.php.

◆ $tempPath