![]() |
TYPO3
7.6
|
Public Member Functions | |
process (ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData) | |
Protected Member Functions | |
getConfigurationValue ($key, $dataArrayKey=null) | |
determineGalleryPosition () | |
determineMaximumGalleryWidth () | |
calculateRowsAndColumns () | |
calculateMediaWidthsAndHeights () | |
getCroppedDimensionalProperty (FileInterface $fileObject, $dimensionalProperty) | |
prepareGalleryData () | |
This data processor will calculate rows, columns and dimensions for a gallery based on several settings and can be used for f.i. the CType "textmedia"
The output will be an array which contains the rows and columns, including the file references and the calculated width and height for each media element, but also some more information of the gallery, like position, width and counters
Example TypoScript configuration:
10 = TYPO3 10 { filesProcessedDataKey = files mediaOrientation.field = imageorient numberOfColumns.field = imagecols equalMediaHeight.field = imageheight equalMediaWidth.field = imagewidth columnSpacing = 0 borderEnabled.field = imageborder borderPadding = 0 borderWidth = 0 maxGalleryWidth = {$styles.content.mediatext.maxW} maxGalleryWidthInText = {$styles.content.mediatext.maxWInText} as = gallery }
Output example:
gallery { position { horizontal = center vertical = above noWrap = FALSE } width = 600 count { files = 2 columns = 1 rows = 2 } rows { 1 { columns { 1 { media = TYPO3 dimensions { width = 600 height = 400 } } } } 2 { columns { 1 { media = TYPO3 dimensions { width = 600 height = 400 } } } } } columnSpacing = 0 border { enabled = FALSE width = 0 padding = 0 } }
Definition at line 95 of file GalleryProcessor.php.
|
protected |
Calculate the width/height of the media elements
Based on the width of the gallery, defined equal width or height by a user, the spacing between columns and the use of a border, defined by user, where the border width and padding are taken into account
File objects MUST already be filtered. They need a height and width to be shown in the gallery
Definition at line 379 of file GalleryProcessor.php.
References GalleryProcessor\$equalMediaWidth, elseif, and GalleryProcessor\getCroppedDimensionalProperty().
Referenced by GalleryProcessor\process().
|
protected |
Calculate the amount of rows and columns
Definition at line 347 of file GalleryProcessor.php.
Referenced by GalleryProcessor\process().
|
protected |
Define the gallery position
Gallery has a horizontal and a vertical position towards the text and a possible wrapping of the text around the gallery.
Definition at line 313 of file GalleryProcessor.php.
Referenced by GalleryProcessor\process().
|
protected |
Get the gallery width based on vertical position
Definition at line 333 of file GalleryProcessor.php.
References GalleryProcessor\$maxGalleryWidth, and GalleryProcessor\$maxGalleryWidthInText.
Referenced by GalleryProcessor\process().
|
protected |
Get configuration value from processorConfiguration with when $dataArrayKey fallback to value from cObj->data array
string | $key | |
string | NULL | $dataArrayKey |
Definition at line 292 of file GalleryProcessor.php.
Referenced by GalleryProcessor\process().
|
protected |
When retrieving the height or width for a media file a possible cropping needs to be taken into account.
FileInterface | $fileObject | |
string | $dimensionalProperty | 'width' or 'height' |
Definition at line 476 of file GalleryProcessor.php.
References FileInterface\getProperty(), and FileInterface\hasProperty().
Referenced by GalleryProcessor\calculateMediaWidthsAndHeights().
|
protected |
Prepare the gallery data
Make an array for rows, columns and configuration
Definition at line 492 of file GalleryProcessor.php.
References GalleryProcessor\$borderEnabled, GalleryProcessor\$borderPadding, GalleryProcessor\$borderWidth, and GalleryProcessor\$columnSpacing.
Referenced by GalleryProcessor\process().
process | ( | ContentObjectRenderer | $cObj, |
array | $contentObjectConfiguration, | ||
array | $processorConfiguration, | ||
array | $processedData | ||
) |
Process data for a gallery, for instance the CType "textmedia"
ContentObjectRenderer | $cObj | The content object renderer, which contains data of the content element |
array | $contentObjectConfiguration | The configuration of Content Object |
array | $processorConfiguration | The configuration of this processor |
array | $processedData | Key/value store of processed data (e.g. to be passed to a Fluid View) |
ContentRenderingException |
Implements DataProcessorInterface.
Definition at line 229 of file GalleryProcessor.php.
References GalleryProcessor\$galleryData, GalleryProcessor\$processorConfiguration, GalleryProcessor\calculateMediaWidthsAndHeights(), GalleryProcessor\calculateRowsAndColumns(), ContentObjectRenderer\checkIf(), GalleryProcessor\determineGalleryPosition(), GalleryProcessor\determineMaximumGalleryWidth(), GalleryProcessor\getConfigurationValue(), GalleryProcessor\prepareGalleryData(), and ContentObjectRenderer\stdWrapValue().
|
protected |
Definition at line 116 of file GalleryProcessor.php.
|
protected |
Definition at line 193 of file GalleryProcessor.php.
Referenced by GalleryProcessor\prepareGalleryData().
|
protected |
Definition at line 203 of file GalleryProcessor.php.
Referenced by GalleryProcessor\prepareGalleryData().
|
protected |
Definition at line 198 of file GalleryProcessor.php.
Referenced by GalleryProcessor\prepareGalleryData().
|
protected |
Definition at line 188 of file GalleryProcessor.php.
Referenced by GalleryProcessor\prepareGalleryData().
|
protected |
Definition at line 102 of file GalleryProcessor.php.
|
protected |
Definition at line 178 of file GalleryProcessor.php.
|
protected |
Definition at line 183 of file GalleryProcessor.php.
Referenced by GalleryProcessor\calculateMediaWidthsAndHeights().
|
protected |
Definition at line 210 of file GalleryProcessor.php.
|
protected |
Definition at line 134 of file GalleryProcessor.php.
Referenced by GalleryProcessor\process().
|
protected |
Definition at line 168 of file GalleryProcessor.php.
Referenced by GalleryProcessor\determineMaximumGalleryWidth().
|
protected |
Definition at line 173 of file GalleryProcessor.php.
Referenced by GalleryProcessor\determineMaximumGalleryWidth().
|
protected |
Definition at line 217 of file GalleryProcessor.php.
|
protected |
Definition at line 163 of file GalleryProcessor.php.
|
protected |
Definition at line 158 of file GalleryProcessor.php.
|
protected |
Definition at line 109 of file GalleryProcessor.php.
Referenced by GalleryProcessor\process().