CSImageUtils
in package
Tags
Table of Contents
- DEFAULT_MASTER_GEOMETRY = '1280x1280'
- Default master image geometry
- FLAT_OPTION_ICON_COLOR = 'FlatIconsColor'
- Flat icon options
- FLAT_OPTION_ICONS = 'FlatIcons'
- FLAT_OPTION_TOOLBAR_ICON_COLOR = 'FlatToolbarIconsColor'
- FLAT_OPTION_TREE_ICON_COLOR = 'FlatTreeIconsColor'
- ICONCCOLOR_ORIGINAL = 'original'
- Icon colors
- ICONCTX_FLAT = 'flat'
- ICONCTX_GUI = 'gui'
- ICONCTX_NONE = ''
- Icon contexts
- ICONCTX_PORTAL = 'portal'
- ICONCTX_STUDIO = 'studio'
- ICONCTX_SUITES = 'suites'
- ICONLIB_CONTENTSERV = 'contentserv'
- Standard icon libraries
- ICONLIB_EXPERIENCE = 'experience'
- ICONLIB_FATCOW = 'fatcow'
- ICONLIB_ICOMOON = 'icomoon'
- ICONNAME_DEFAULT = 'default'
- Standard icon paths
- ICONSIZE_16X16 = '16x16'
- Icon sizes
- ICONSIZE_19X16 = '19x16'
- ICONSIZE_32X32 = '32x32'
- ICONSIZE_64X64 = '64x64'
- ICONSIZE_VECTOR = 'vector'
- URLBASE_EXTERNAL = 'external'
- URLBASE_INTERNAL = 'internal'
- URLBASE_RELATIVE = 'relative'
- URL base rewriting options
- WARNING_FILEDOESNOTEXIST = 12001
- Warning consts
- getFavIcon() : string
- Retrieves the path of the project favicon.
- getFileIcon() : string
- Returns a flat icon for a given file type
- getFlatIcon() : string
- Returns a flat icon with a specific color, size or topping.
- getIcon() : string
- Returns the path to the specified icon.
- getIconForBackgroundColor() : string
- Returns an 16x16 icon to be used on a given background color
- getImageFolderPaths() : array<string|int, mixed>
- Return the array of image file path.
- getImagePath() : string
- Return the path of the image file which is going to be searched.
- getPopupIcon() : string
- Returns a 16x16 icon to be used in popups
- getPreviewImage() : string
- Returns a preview image path for the specified context.
- getProductIcon() : string
- Returns the path to the specified product icon.
- getScaledSize() : array<string|int, mixed>
- Calculates new dimensions from a given size structure by applying a constant scale factor to each dimension.
- getScaledSizeProportional() : array<string|int, mixed>|bool
- Calculates new dimensions from a given size structure by applying a constant scale factor to each dimension.
- getStudioIcon() : string
- Returns the path to the specified studio icon.
- getSuiteIcon() : string
- Returns the path to the specified suite icon.
- getToolbarIcon() : string
- Returns a 16x16 icon to be used in toolbars
- getTreeIcon() : string
- Returns a 19x16 icon to be used in trees
- getValidAudioTypes() : array<string|int, mixed>
- Returns all valid audio types as an array.
- getValidImageTypes() : array<string|int, mixed>
- Returns all valid image types as an array.
- getValidVideoTypes() : array<string|int, mixed>
- Returns all valid video types as an array.
- getValidWebImageTypes() : array<string|int, mixed>
- Returns all valid web image types as an array.
- isImage() : bool
- Tests a given file extension whether it belongs to an image.
- isWebImage() : bool
- Tests a given file extension whether it belongs to a web image.
Constants
DEFAULT_MASTER_GEOMETRY
Default master image geometry
public
mixed
DEFAULT_MASTER_GEOMETRY
= '1280x1280'
Tags
FLAT_OPTION_ICON_COLOR
Flat icon options
public
mixed
FLAT_OPTION_ICON_COLOR
= 'FlatIconsColor'
Tags
FLAT_OPTION_ICONS
public
mixed
FLAT_OPTION_ICONS
= 'FlatIcons'
Tags
FLAT_OPTION_TOOLBAR_ICON_COLOR
public
mixed
FLAT_OPTION_TOOLBAR_ICON_COLOR
= 'FlatToolbarIconsColor'
Tags
FLAT_OPTION_TREE_ICON_COLOR
public
mixed
FLAT_OPTION_TREE_ICON_COLOR
= 'FlatTreeIconsColor'
Tags
ICONCCOLOR_ORIGINAL
Icon colors
public
string
ICONCCOLOR_ORIGINAL
= 'original'
Tags
ICONCTX_FLAT
public
mixed
ICONCTX_FLAT
= 'flat'
Tags
ICONCTX_GUI
public
mixed
ICONCTX_GUI
= 'gui'
Tags
ICONCTX_NONE
Icon contexts
public
string
ICONCTX_NONE
= ''
Tags
ICONCTX_PORTAL
public
mixed
ICONCTX_PORTAL
= 'portal'
Tags
ICONCTX_STUDIO
public
mixed
ICONCTX_STUDIO
= 'studio'
Tags
ICONCTX_SUITES
public
mixed
ICONCTX_SUITES
= 'suites'
Tags
ICONLIB_CONTENTSERV
Standard icon libraries
public
string
ICONLIB_CONTENTSERV
= 'contentserv'
Tags
ICONLIB_EXPERIENCE
public
mixed
ICONLIB_EXPERIENCE
= 'experience'
Tags
ICONLIB_FATCOW
public
mixed
ICONLIB_FATCOW
= 'fatcow'
Tags
ICONLIB_ICOMOON
public
mixed
ICONLIB_ICOMOON
= 'icomoon'
Tags
ICONNAME_DEFAULT
Standard icon paths
public
string
ICONNAME_DEFAULT
= 'default'
Tags
ICONSIZE_16X16
Icon sizes
public
string
ICONSIZE_16X16
= '16x16'
Tags
ICONSIZE_19X16
public
mixed
ICONSIZE_19X16
= '19x16'
Tags
ICONSIZE_32X32
public
mixed
ICONSIZE_32X32
= '32x32'
Tags
ICONSIZE_64X64
public
mixed
ICONSIZE_64X64
= '64x64'
Tags
ICONSIZE_VECTOR
public
mixed
ICONSIZE_VECTOR
= 'vector'
Tags
URLBASE_EXTERNAL
public
mixed
URLBASE_EXTERNAL
= 'external'
Tags
URLBASE_INTERNAL
public
mixed
URLBASE_INTERNAL
= 'internal'
Tags
URLBASE_RELATIVE
URL base rewriting options
public
string
URLBASE_RELATIVE
= 'relative'
Tags
WARNING_FILEDOESNOTEXIST
Warning consts
public
mixed
WARNING_FILEDOESNOTEXIST
= 12001
Tags
Methods
getFavIcon()
Retrieves the path of the project favicon.
public
static getFavIcon() : string
If the project don't have a specific favicon, returns the default favicon on the /admin/images folder.
Tags
Return values
string —the url of the favicon.
getFileIcon()
Returns a flat icon for a given file type
public
static getFileIcon(string $sFileType[, null $sColor = null ][, bool $bAsUrl = true ]) : string
Parameters
- $sFileType : string
-
the file type like png or xlsx
- $sColor : null = null
-
the color like #00FFAA
- $bAsUrl : bool = true
-
if false only the mapped icon type will be returned
Tags
Return values
string —the file icon that can be used in trees, which means relative to images/tree
getFlatIcon()
Returns a flat icon with a specific color, size or topping.
public
static getFlatIcon(string $sIconName[, string $sColor = null ][, string $sSize = null ][, array<string|int, string> $aToppings = array() ][, mixed $sModuleName = null ]) : string
The method searches the icon in the libraries "contentserv" & "icomoon". But it is possible to overwrite the icon in the project (See possible paths)
Possible paths:
-
{PROJECT}/modules/{MODULENAME}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
Possible sizes: {SIZE}
- vector
- {SIZE} - The size parameter
- 16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sIconName : string
-
{ICON} - The icon name or the icon path
- $sColor : string = null
-
The color of the icon in #HEX or rgb(255,255,255) format
- $sSize : string = null
-
{SIZE} - The icon size (e.g. 16x16)
- $aToppings : array<string|int, string> = array()
-
Array with optional toppings that should be placed on top of the icon
- $sModuleName : mixed = null
Tags
Return values
string —the path to the icon as seen from a web browser
getIcon()
Returns the path to the specified icon.
public
static getIcon(mixed $sIconName[, string $sLibrary = self::ICONLIB_CONTENTSERV ][, string $sContext = self::ICONCTX_NONE ][, string $sIconSize = self::ICONSIZE_19X16 ][, string $sExtension = 'png' ][, string $sModuleName = null ]) : string
Possible paths:
-
{PROJECT}/modules/{MODULENAME}/images/{CONTEXT}/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/{CONTEXT}/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/{LIBRARY}/{CONTEXT}/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/{LIBRARY}/{CONTEXT}/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/{LIBRARY}/{CONTEXT}/{SIZE}/{ICON}.{EXTENSION}
Parameters
- $sIconName : mixed
- $sLibrary : string = self::ICONLIB_CONTENTSERV
-
{LIBRARY} - The library to search in
- $sContext : string = self::ICONCTX_NONE
-
{CONTEXT} - The library context to use
- $sIconSize : string = self::ICONSIZE_19X16
-
{SIZE} - The size of the icon (one of the CSImageUtils::ICONSIZE_* constants)
- $sExtension : string = 'png'
-
{EXTENSION} - The the extension of the icon
- $sModuleName : string = null
-
{MODULENAME} - The project module name of the icon
Tags
Return values
string —the path to the icon
getIconForBackgroundColor()
Returns an 16x16 icon to be used on a given background color
public
static getIconForBackgroundColor(string $sImagePath[, string $sBackgroundColor = '#FFFFFF' ][, string $sSize = self::ICONSIZE_16X16 ][, array<string|int, string> $aToppings = array() ][, mixed $sModuleName = null ]) : string
Possible paths:
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/modules/{MODULENAME}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
Possible sizes: {SIZE}
- vector
- {SIZE} - The size parameter
- 16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sImagePath : string
-
{ICON} - The image path or name from the icomoon library
- $sBackgroundColor : string = '#FFFFFF'
-
The color of the icon in the #HEX or rgb or cmyk format
- $sSize : string = self::ICONSIZE_16X16
-
{SIZE} - The dimensions of the icon in the {width}x{height} format or one of the ICONSIZE constants
- $aToppings : array<string|int, string> = array()
-
array with optional toppings that should be placed on top of the icon
- $sModuleName : mixed = null
Tags
Return values
string —the path to the icon as seen from a web browser
getImageFolderPaths()
Return the array of image file path.
public
static getImageFolderPaths([string $sModuleName = '' ]) : array<string|int, mixed>
Parameters
- $sModuleName : string = ''
-
Include the Module folder in the Image folder path.
Tags
Return values
array<string|int, mixed> —Array of Image folder paths.
getImagePath()
Return the path of the image file which is going to be searched.
public
static getImagePath(string $sImageFileName, string $sSubFolderPath[, string $sModuleName = '' ]) : string
Parameters
- $sImageFileName : string
-
Name of image file whose path to be searched.
- $sSubFolderPath : string
-
Include the subfolder so that image would search in this sub folder.
- $sModuleName : string = ''
-
Include the Module so that image would search in this Module too.
Tags
Return values
string —Path of the image file.
getPopupIcon()
Returns a 16x16 icon to be used in popups
public
static getPopupIcon(string $sImagePath[, string $sColor = null ][, array<string|int, string> $aToppings = array() ][, mixed $sModuleName = null ]) : string
Possible paths:
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
-
Possible sizes: {SIZE}
-
vector
-
19x16
-
16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sImagePath : string
-
{ICON} - The image path or name
- $sColor : string = null
-
The color of the icon in the #HEX or rgb(255,255,255) format, if null the configured default value is returned
- $aToppings : array<string|int, string> = array()
-
array with optional toppings that should be placed on top of the icon
- $sModuleName : mixed = null
Tags
Return values
string —the path to the icon as seen from a web browser
getPreviewImage()
Returns a preview image path for the specified context.
public
static getPreviewImage(mixed $context[, int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $dpi = null ]) : string
Parameters
- $context : mixed
-
The context for the preview image, CSMamFile, MamFileID or file path.
- $width : int = null
-
The image's target width.
- $height : int = null
-
The image's target height.
- $format : int = null
-
The image's target format (jpg, gif, ...).
- $colorspace : int = null
-
The image's target colorspace (rgb, cmyk).
- $dpi : int = null
-
The image's target resolution in DPI.
Tags
Return values
string —An URL relative to the ADMIN directory, referring to the $context's preview image.
getProductIcon()
Returns the path to the specified product icon.
public
static getProductIcon(string $sSuiteName, string $sProductName[, string $sIconSize = self::ICONSIZE_19X16 ][, string $sDefaultIcon = self::ICONNAME_DEFAULT ][, string $sExtension = 'png' ]) : string
Possible paths:
-
{PROJECT}/images/flat/16x16/{SUITE}.{PRODUCT}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/16x16/{SUITE}.{PRODUCT}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/16x16/{SUITE}.{PRODUCT}.{EXTENSION}
-
admin/images/library/contentserv/flat/16x16/{SUITE}.{PRODUCT}.{EXTENSION}
Parameters
- $sSuiteName : string
-
{SUITE] - The name of the suite which the product belongs to.
- $sProductName : string
-
{PRODUCT} - The short name of the product.
- $sIconSize : string = self::ICONSIZE_19X16
-
WARNING: This parameter is deprecated since CS 16.1 and is not used anymore.
- $sDefaultIcon : string = self::ICONNAME_DEFAULT
-
The default icon, which should be returned if no icon is found.
- $sExtension : string = 'png'
-
{EXTENSION} - The file extension of the icon.
Tags
Return values
string —The path to the product icon (relative to the ADMIN directory).
getScaledSize()
Calculates new dimensions from a given size structure by applying a constant scale factor to each dimension.
public
static getScaledSize(array<string|int, mixed> $amOrigSize, float $fScale[, array<string|int, mixed> $amMinSize = array() ][, array<string|int, mixed> $amMaxSize = array() ][, bool $bAllowUpscale = FALSE ]) : array<string|int, mixed>
This method tries to perform proportional scaling, but may(!) produce a non-proportional result due to potential clipping at the lower or upper boundaries (if applicable). The advantages are that (1) it is up to three times faster than the corresponding getScaledSizeProportional() method and that (2) it always returns a result in the form of a size structure, regardless of min/max boundary violations -- but, remember, at the cost of returning a potentially non-proportional result. If you need to obtain a result that definitely preserves the original aspect ratio, the getScaledSizeProportional() method should be used instead.
Parameters
- $amOrigSize : array<string|int, mixed>
-
A size structure providing the width and height which should be scaled. This should be created using the makeSize() method. When creating the structure, you should take care of the number type that you are using (integer vs. floating-point numbers, see the return value description and the makeSize() documentation for more information).
- $fScale : float
-
The scale factor that should be applied. Negative values are clipped at zero.
- $amMinSize : array<string|int, mixed> = array()
-
A size struct providing the lower boundaries for each dimension. This should be created using the makeSize() method. A limit of NULL for a specific dimension means that it is not being limited. Negative minimum values will be mapped to "double"-typed zero.
- $amMaxSize : array<string|int, mixed> = array()
-
A size struct providing the upper boundaries for each dimension. This should be created using the makeSize() method. A limit of NULL for a specific dimension means that it is not being limited.
- $bAllowUpscale : bool = FALSE
-
If set to TRUE, the $fScale parameter may be greater than 1.0. Otherwise, if set to FALSE, scale factors greater than 1.0 will be mapped to that value, preventing an upscaling calculation. The default is FALSE, as image operations in CONTENTSERV usually prohibit upscaling to avoid the loss of image quality (unless explicitly required).
Tags
Return values
array<string|int, mixed> —A size structure containing the scaled values for each dimension. During the scaling process, the result is checked against the minimum and maximum boundaries. If one of these is hit, the violating dimension will be increased or reduced to match the exceeded minimum or maximum value. In this case, the scale result is non-proportional, because the aspect ratio has changed. Also, rounding operations may take place, depending on the type of the input values. If the type of the input dimensions is "double", the result is returned as "double" without applying any rounding functions. Otherwise, if the type is "integer", the result is rounded and then converted to "int". EXTREME CARE should be taken when using strings as input values, as it is common to CONTENTSERV procedures: These are converted into double, even when they contain numbers that would fit into an "int". When trying to determine scaled dimensions for (integer) pixel units instead of (double) units like millimeters or inches, you should cast the string input values into "int" values BEFORE creating the input size structure.
getScaledSizeProportional()
Calculates new dimensions from a given size structure by applying a constant scale factor to each dimension.
public
static getScaledSizeProportional(array<string|int, mixed> $amOrigSize, float $fScale[, array<string|int, mixed> $amMinSize = array() ][, array<string|int, mixed> $amMaxSize = array() ][, bool $bAllowUpscale = FALSE ]) : array<string|int, mixed>|bool
This method performs proportional scaling only, but may NOT return a pair of dimensions if the original aspect ratio cannot be preserved without exceeding applicable boundaries. This method is up to three times slower than the corresponding getScaledSize() method, because it will try to obtain a result that fits into the specified boundaries by modifying the scale factor and restarting the operation. If you do not necessarily need to obtain a proportional result (which preserves the original aspect ratio), consider using the getScaledSize() method for performance reasons and a finite result.
Parameters
- $amOrigSize : array<string|int, mixed>
-
A size structure providing the width and height which should be scaled. This should be created using the makeSize() method. When creating the structure, you should take care of the number type that you are using (integer vs. floating-point numbers, see the return value description and the makeSize() documentation for more information).
- $fScale : float
-
The scale factor that should be applied. Negative values are clipped at zero.
- $amMinSize : array<string|int, mixed> = array()
-
A size struct providing the lower boundaries for each dimension. This should be created using the makeSize() method. A limit of NULL for a specific dimension means that it is not being limited. Negative minimum values will be mapped to "double"-typed zero.
- $amMaxSize : array<string|int, mixed> = array()
-
A size struct providing the upper boundaries for each dimension. This should be created using the makeSize() method. A limit of NULL for a specific dimension means that it is not being limited.
- $bAllowUpscale : bool = FALSE
-
If set to TRUE, the $fScale parameter may be greater than 1.0. Otherwise, if set to FALSE, scale factors greater than 1.0 will be mapped to that value, preventing an upscaling calculation. The default is FALSE, as image operations in CONTENTSERV usually prohibit upscaling to avoid the loss of image quality (unless explicitly required).
Tags
Return values
array<string|int, mixed>|bool —A size structure containing the scaled values for each dimension. During the scaling process, the result is checked against the minimum and maximum boundaries. If one of these is hit, the violating dimension will be used to calculate a new scale factor. Then, the scaling and adaptation is retried up to two times (one for each dimension). If the result is still violating boundaries, this behaviour indicates an infinite oscillation. At this point, the method returns boolean FALSE to prevent it. Rounding operations and typecasts may be applied to the result. For a complete list of these implications, be sure to read the description of the getScaledSize() method's return value very carefully.
getStudioIcon()
Returns the path to the specified studio icon.
public
static getStudioIcon(string $sName[, string $sSize = self::ICONSIZE_16X16 ][, string $sColor = null ]) : string
Possible paths:
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
Possible sizes: {SIZE}
- vector
- {SIZE} - The size parameter
- 16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sName : string
-
{ICON} - The name of the icon without the .png
- $sSize : string = self::ICONSIZE_16X16
-
{SIZE} - The size of the icon (one of the CSImageUtils::ICONSIZE_* constants).
- $sColor : string = null
-
The color of the icon, if null the skin color will be used
Tags
Return values
string —The path to the studio icon (relative to the ADMIN directory).
getSuiteIcon()
Returns the path to the specified suite icon.
public
static getSuiteIcon(string $sSuiteName[, string $sIconSize = self::ICONSIZE_19X16 ][, string $sDefaultIcon = null ][, string $sExtension = 'png' ]) : string
Possible paths:
-
admin/images/library/contentserv/suites/flat/{ICON}.{EXTENSION}
-
{PROJECT}/images/suites/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/{LIBRARY}/suites/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/{LIBRARY}/suites/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/{LIBRARY}/suites/{SIZE}/{ICON}.{EXTENSION}
Parameters
- $sSuiteName : string
-
{ICON} - The name of the suite.
- $sIconSize : string = self::ICONSIZE_19X16
-
{SIZE} - The size of the icon (one of the CSImageUtils::ICONSIZE_* constants).
- $sDefaultIcon : string = null
-
The default icon, which should be returned if no icon is found.
- $sExtension : string = 'png'
-
{EXTENSION} - The file extension of the icon.
Tags
Return values
string —The path to the suite icon (relative to the ADMIN directory).
getToolbarIcon()
Returns a 16x16 icon to be used in toolbars
public
static getToolbarIcon(string $sImagePath[, string $sColor = null ][, array<string|int, string> $aToppings = array() ][, mixed $sModuleName = null ]) : string
Possible paths:
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
-
Possible sizes: {SIZE}
-
vector
-
19x16
-
16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sImagePath : string
-
{ICON} - The image path or name
- $sColor : string = null
-
The color of the icon in the #HEX or rgb(255,255,255) format, if null the configured default value is returned
- $aToppings : array<string|int, string> = array()
-
array with optional toppings that should be placed on top of the icon
- $sModuleName : mixed = null
Tags
Return values
string —the path to the icon as seen from a web browser
getTreeIcon()
Returns a 19x16 icon to be used in trees
public
static getTreeIcon(string $sImagePath[, string $sColor = null ][, array<string|int, string> $aToppings = array() ][, mixed $sModuleName = null ]) : string
Possible paths:
-
{PROJECT}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
{PROJECT}/modules/{MODULENAME}/images/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin.local/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/contentserv/flat/{SIZE}/{ICON}.{EXTENSION}
-
admin/images/library/icomoon/{SIZE}/{ICON}.{EXTENSION}
-
Possible sizes: {SIZE}
-
vector
-
19x16
-
16x16
Possible extension: {EXTENSION}
- svg
- png
Parameters
- $sImagePath : string
-
{ICON} - The image path or name
- $sColor : string = null
-
The color of the icon in the #HEX or rgb(255,255,255) format, if null the configured default value is returned
- $aToppings : array<string|int, string> = array()
-
array with optional toppings that should be placed on top of the icon
- $sModuleName : mixed = null
Tags
Return values
string —the path to the icon as seen from a web browser
getValidAudioTypes()
Returns all valid audio types as an array.
public
static getValidAudioTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getValidImageTypes()
Returns all valid image types as an array.
public
static getValidImageTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —All valid image file extensions as known by CONTENTSERV.
getValidVideoTypes()
Returns all valid video types as an array.
public
static getValidVideoTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —All valid video file extensions as known by CONTENTSERV.
getValidWebImageTypes()
Returns all valid web image types as an array.
public
static getValidWebImageTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —All valid web image file extensions as known by CONTENTSERV.
isImage()
Tests a given file extension whether it belongs to an image.
public
static isImage(string $type) : bool
Parameters
- $type : string
-
The file extension without the initial dot character.
Tags
Return values
bool —TRUE, if the given file extension is an image extension according to the image file extensions as known by CONTENTSERV, or FALSE, if not.
isWebImage()
Tests a given file extension whether it belongs to a web image.
public
static isWebImage(string $type) : bool
Parameters
- $type : string
-
The file extension without the initial dot character.
Tags
Return values
bool —TRUE, if the given file extension is a web image extension according to the web image file extensions as known by CONTENTSERV, or FALSE, if not.
