modules/Administration/SugarSpriteBuilder.php

Show: inherited
Table of Contents

\SpritePlacement

Package: SugarCRM

SpritePlacement

Properties

Propertypublic  $config= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $minSurface= '0'
Default value0Details
Type
n/a
Propertypublic  $spriteMatrix= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $spriteSrc= 'array()'
Default valuearray()Details
Type
n/a

Methods

methodpublic__construct(  $spriteSrc,  $config ) : void

Parameters
Name Type Description
$spriteSrc
$config
methodpublicaddSprite(  $w,  $h ) : void

Parameters
Name Type Description
$w
$h
methodpublicgetMaxAxis(  $axis ) : void

Parameters
Name Type Description
$axis
methodpublicheight( ) : void

methodpublicprocessSprites( ) : void

methodpublicwidth( ) : void

\SugarSpriteBuilder

Package:

Properties

Propertypublic  $cssMinify= 'true'
Default valuetrueDetails
Type
n/a
Propertypublic  $debug= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $fileName= ''sprites''
Default value'sprites'Details
Type
n/a
Propertypublic  $fromSilentUpgrade= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $imageTypes= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $isAvailable= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $maxHeight= '75'
Default value75Details
Type
n/a
Propertypublic  $maxWidth= '75'
Default value75Details
Type
n/a
Propertypublic  $pngCompression= '9'
Default value9Details
Type
n/a
Propertypublic  $pngFilter= 'PNG_NO_FILTER'
Default valuePNG_NO_FILTERDetails
Type
n/a
Propertypublic  $rowCnt= '30'
Default value30Details
Type
n/a
Propertypublic  $silentRun= 'false'
Default valuefalseDetails
Type
n/a
Propertypublic  $spriteImg= ''
Details
Type
n/a
Propertypublic  $spriteRepeat= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $spriteSrc= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $sprites_config= 'array()'
Default valuearray()Details
Type
n/a
Propertypublic  $supportedTypeMap= 'array( IMG_GIF => IMAGETYPE_GIF, IMG_JPG => IMAGETYPE_JPEG, IMG_PNG => IMAGETYPE_PNG, )'
Default valuearray( IMG_GIF => IMAGETYPE_GIF, IMG_JPG => IMAGETYPE_JPEG, IMG_PNG => IMAGETYPE_PNG, )Details
Type
n/a
Propertypublic  $writeToUpgradeLog= 'false'
Default valuefalseDetails
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicaddDirectory( \$name $name, \$dir $dir ) : void

addDirectory

This function is used to create the spriteSrc array

Parameters
Name Type Description
$name \$name

String value of the sprite name

$dir \$dir

String value of the directory associated with the sprite entry

methodpubliccreateSprites( ) : \$result

createSprites

This is the public function to allow the sprites to be built.

Returns
Type Description
\$result boolean value indicating whether or not sprites were created
methodprivategetFileInfo(  $dir,  $file ) : array

getFileInfo

This is a private helper function to return attributes about an image. If the width, height or type of the image file cannot be determined, then we do not process the file.

Parameters
Name Type Description
$dir
$file
Returns
Type Description
array of file info entries containing file information (x, y, type) if image type is supported
methodprivategetFileList( \$dir $dir ) : void

getFileList

This method processes files in a directory and adds them to the sprites array

Parameters
Name Type Description
$dir \$dir

String value of the directory to scan for image files in

methodprivateinitSpriteImg( \w $w, \h $h ) : void

initSpriteImg

Parameters
Name Type Description
$w \w

int value representing width of sprite

$h \h

int value representing height of sprite Private function to initialize creating the sprite canvas image

methodprivateloadImage( \$dir $dir, \$file $file, \$type $type ) : void

loadImage

private function to load image resources

Parameters
Name Type Description
$dir \$dir

String value of directory where image is located

$file \$file

String value of file

$type \$type

String value of the file type (IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG)

methodprivateloadSpritesConfig( \$dir $dir ) : void

loadSpritesConfig

This function is used to load the sprites_config.php file. The sprites_config.php file may be used to add entries to the sprites_config member variable which may contain a list of array entries of files/directories to exclude from being included into the sprites image.

Parameters
Name Type Description
$dir \$dir

String value of the directory containing the custom sprites_config.php file

methodprivatelogMessage( \$msg $msg ) : void

private logMessage

This is a private function used to log messages generated from this class. Depending on whether or not silentRun or fromSilentUpgrade is set to true/false then it will either output to screen or write to log file

Parameters
Name Type Description
$msg \$msg

String value of message to log into file or echo into output buffer depending on the context

Documentation was generated by DocBlox 0.18.1.