TYPO3
7.6
|
Static Public Member Functions | |
static | getIcon ($table, $row=array(), $shaded=false) |
static | skinImg ($backPath, $src, $wHattribs= '', $outputMode=0) |
static | makeIcon ($iconfile, $mode, $user, $protectSection, $absFile, $iconFileName_stateTagged) |
static | imagecopyresized (&$destinationImage, $sourceImage, $destinationX, $destinationY, $sourceX, $sourceY, $destinationWidth, $destinationHeight, $sourceWidth, $sourceHeight) |
static | imagecreatefrom ($file) |
static | imagemake ($im, $path) |
static | getSpriteIcon ($iconName, array $options=array(), array $overlays=array()) |
static | getSpriteIconForFile ($fileExtension, array $options=null) |
static | mapFileExtensionToSpriteIconClass ($fileExtension) |
static | mapFileExtensionToSpriteIconName ($fileExtension) |
static | getSpriteIconForRecord ($table, array $row, array $options=null) |
static | getSpriteIconForResource (\TYPO3\CMS\Core\Resource\ResourceInterface $resource, array $options=array(), array $overlays=null) |
static | mapRecordTypeToSpriteIconClass ($table, array $row) |
static | mapRecordTypeToSpriteIconName ($table, array $row) |
static | getSpriteIconClasses ($iconName) |
Static Public Attributes | |
static | $fileSpriteIconNames |
Static Protected Member Functions | |
static | buildSpriteHtmlIconTag (array $tagAttributes, $innerHtml=null, $tagName=null) |
Static Protected Attributes | |
static | $spriteIconCache = array() |
Contains class for icon generation in the backend This library has functions that returns - and if necessary creates - the icon for an element in TYPO3
Expects global vars:
Notes: These functions are strongly related to the interface of TYPO3. Static class, functions called without making a class instance.
Definition at line 38 of file IconUtility.php.
|
staticprotected |
low level function that generates the HTML tag for the sprite icon is usually called by the three API classes (getSpriteIcon, getSpriteIconForFile, getSpriteIconForRecord) it does not care about classes or anything else, but just plainly builds the HTML tag
array | $tagAttributes | An associative array of additional tagAttributes for the HTML tag |
string | $innerHtml | The content within the tag, a " " by default |
string | $tagName | The name of the HTML element that should be used (span by default) |
Definition at line 908 of file IconUtility.php.
References GeneralUtility\logDeprecatedFunction().
|
static |
Creates the icon for input table/row Returns filename for the image icon, relative to PATH_typo3
string | $table | The table name |
array | $row | The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!) |
bool | $shaded | If set, the icon will be grayed/shaded |
Definition at line 133 of file IconUtility.php.
References $GLOBALS, Enumeration\cast(), VersionState\DELETE_PLACEHOLDER, elseif, GeneralUtility\logDeprecatedFunction(), VersionState\MOVE_PLACEHOLDER, VersionState\MOVE_POINTER, and VersionState\NEW_PLACEHOLDER.
|
static |
This generic method is used throughout the TYPO3 Backend to show icons in any variation which are not bound to any resource object (see getSpriteIconForResource) or database record (see getSpriteIconForRecord)
Generates a HTML tag with proper CSS classes. The TYPO3 skin has defined these CSS classes already to have a pre-defined background image, and the correct background-position to show the necessary icon.
If no options or overlays are given, the icon will be cached in $spriteIconCache.
string | $iconName | The name of the icon to fetch |
array | $options | An associative array with additional options and attributes for the tag. by default, the key is the name of the attribute, and the value is the parameter string that is set. However, there are some additional special reserved keywords that can be used as keys: "html" (which is the HTML that will be inside the icon HTML tag), "tagName" (which is an alternative tagName than "span"), and "class" (additional class names that will be merged with the sprite icon CSS classes) |
array | $overlays | An associative array with the icon-name as key, and the options for this overlay as an array again (see the parameter $options again) |
Definition at line 586 of file IconUtility.php.
References $GLOBALS, and GeneralUtility\logDeprecatedFunction().
|
static |
generic method to create the final CSS classes based on the sprite icon name with the base class and splits the name into parts is usually called by the methods that are responsible for fetching the names out of the file name, or the record type
string | $iconName | Iconname like 'actions-document-new' |
Definition at line 880 of file IconUtility.php.
References GeneralUtility\logDeprecatedFunction().
Referenced by IconUtilityTest\getSpriteIconClassesWithEmptyStringReturnsT3Icon(), IconUtilityTest\getSpriteIconClassesWithFourPartsReturnsT3IconAndCombinedParts(), IconUtilityTest\getSpriteIconClassesWithOnePartReturnsT3Icon(), IconUtilityTest\getSpriteIconClassesWithThreePartsReturnsT3IconAndCombinedParts(), and IconUtilityTest\getSpriteIconClassesWithTwoPartsReturnsT3IconAndCombinedParts().
|
static |
This method is used throughout the TYPO3 Backend to show icons for a file type
Generates a HTML tag with proper CSS classes. The TYPO3 skin has defined these CSS classes already to have a pre-defined background image, and the correct background-position to show the necessary icon.
string | $fileExtension | The name of the icon to fetch, can be a file extension, full file path or one of the special keywords "folder" or "mount |
array | $options | not used anymore |
Definition at line 642 of file IconUtility.php.
References GeneralUtility\deprecationLog(), GeneralUtility\logDeprecatedFunction(), and GeneralUtility\makeInstance().
|
static |
This method is used throughout the TYPO3 Backend to show icons for a DB record
Generates a HTML tag with proper CSS classes. The TYPO3 skin has defined these CSS classes already to have a pre-defined background image, and the correct background-position to show the necessary icon.
string | $table | The TCA table name |
array | $row | The DB record of the TCA table |
array | $options | not used anymore |
Definition at line 716 of file IconUtility.php.
References GeneralUtility\deprecationLog(), GeneralUtility\logDeprecatedFunction(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.
|
static |
This method is used throughout the TYPO3 Backend to show icons for files and folders
The method takes care of the translation of file extension to proper icon and for folders it will return the icon depending on the role of the folder.
If the given resource is a folder there are some additional options that can be used:
There is a hook in place to manipulate the icon name and overlays.
\TYPO3\CMS\Core\Resource\ResourceInterface | $resource | |
array | $options | An associative array with additional options and attributes for the tag. See self::getSpriteIcon() |
array | $overlays | not used anymore |
\UnexpectedValueException |
Definition at line 746 of file IconUtility.php.
References GeneralUtility\deprecationLog(), GeneralUtility\logDeprecatedFunction(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.
|
static |
The necessity of using this function for combining two images if GD is version 2 is that GD2 cannot manage to combine two indexed-color images without totally spoiling everything. In class this was solved by combining the images onto a first created true color image. However it has turned out that this method will not work if the indexed png-files contains transparency. So I had to turn my attention to ImageMagick - my 'enemy of death'. And so it happened - ImageMagick is now used to combine my two indexed-color images with transparency. And that works. Of course it works only if ImageMagick is able to create valid png-images - which you cannot be sure of with older versions (still 5+) The only drawback is (apparently) that IM creates true-color png's. The transparency of these will not be shown by MSIE on windows at this time (although it's straight 0%/100% transparency!) and the file size may be larger.
resource | $destinationImage | Destination image |
resource | $sourceImage | Source image |
int | $destinationX | Destination x-coordinate |
int | $destinationY | Destination y-coordinate |
int | $sourceX | Source x-coordinate |
int | $sourceY | Source y-coordinate |
int | $destinationWidth | Destination width |
int | $destinationHeight | Destination height |
int | $sourceWidth | Source width |
int | $sourceHeight | Source height |
Definition at line 502 of file IconUtility.php.
|
static |
Create new image pointer from input file (either gif/png, in case the wrong format it is converted by ::readPngGif())
string | $file | Absolute filename of the image file from which to start the icon creation. |
Definition at line 515 of file IconUtility.php.
References $GLOBALS, and GraphicalFunctions\readPngGif().
|
static |
Write the icon in $im pointer to $path
resource | $im | Pointer to GDlib image resource |
string | $path | Absolute path to the filename in which to write the icon. |
Definition at line 533 of file IconUtility.php.
References $GLOBALS, and GeneralUtility\fixPermissions().
Referenced by IconUtilityTest\imagemakeFixesPermissionsOnNewFiles().
|
static |
Creates the icon file for the function getIcon()
string | $iconfile | Original unprocessed Icon file, relative path to PATH_typo3 |
string | $mode | Mode string, eg. "deleted" or "futuretiming" determining how the icon will look |
int | $user | The number of the fe_group record uid if applicable |
bool | $protectSection | Flag determines if the protected-section icon should be applied. |
string | $absFile | Absolute path to file from which to create the icon. |
string | $iconFileName_stateTagged | The filename that this icon should have had, basically [icon base name]_[flags].[extension] - used for part of temporary filename |
Definition at line 372 of file IconUtility.php.
References $GLOBALS, GraphicalFunctions\gifCompress(), GeneralUtility\mkdir(), and GeneralUtility\shortMD5().
|
static |
Generates the spriteicon css classes name for a given path or fileExtension usually called from getSpriteIconForFile or ExtJs Provider
string | $fileExtension | FileExtension can be jpg, gif etc, but also be 'mount' or 'folder', but can also be a full path which will be resolved then |
Definition at line 661 of file IconUtility.php.
|
static |
Generates the spriteicon name for a given path or fileExtension usually called from mapFileExtensionToSpriteIconClass and tceforms
string | $fileExtension | FileExtension can be jpg, gif etc, but also be 'mount' or 'folder', but can also be a full path which will be resolved then |
Definition at line 674 of file IconUtility.php.
References $GLOBALS, GeneralUtility\getIndpEnv(), and GeneralUtility\resolveBackPath().
|
static |
this helper functions looks up the column that is used for the type of the chosen TCA table. And then fetches the corresponding class based on the chosen iconsprite class in this TCA The TCA looks up
see ext:core/Configuration/TCA/pages.php for an example with the TCA table "pages"
string | $table | The TCA table |
array | $row | The selected record |
Definition at line 776 of file IconUtility.php.
References GeneralUtility\logDeprecatedFunction().
|
static |
this helper functions looks up the column that is used for the type of the chosen TCA table. And then fetches the corresponding iconname based on the chosen iconsprite class in this TCA The TCA looks up
see ext:core/Configuration/TCA/pages.php for an example with the TCA table "pages"
string | $table | The TCA table |
array | $row | The selected record |
Definition at line 800 of file IconUtility.php.
References $GLOBALS, and GeneralUtility\callUserFunction().
|
static |
Returns the src=... for the input $src value OR any alternative found in $TBE_STYLES['skinImg'] Used for skinning the TYPO3 backend with an alternative set of icons
string | $backPath | Current backpath to PATH_typo3 folder |
string | $src | Icon file name relative to PATH_typo3 folder |
string | $wHattribs | Default width/height, defined like 'width="12" height="14"' |
int | $outputMode | Mode: 0 (zero) is default and returns src/width/height. 1 returns value of src+backpath, 2 returns value of w/h. |
Definition at line 288 of file IconUtility.php.
References $GLOBALS, elseif, and GeneralUtility\logDeprecatedFunction().
|
static |
Definition at line 43 of file IconUtility.php.
|
staticprotected |
Definition at line 121 of file IconUtility.php.