PaulSchulz\SilverStripe\Gallery\Extensions\ImageCollectionExtension
This extension is responsible for creating the appearance of the gallery.
It can be applied to any DataObject, to support listing of images.
This extension only provides support for listing the images of a gallery. For a more advanced gallery see the subclass GalleryExtension.
When applied to a DataObject the cms fields must be created by the object itself. This class does not create any cms fields.
Synopsis
class ImageCollectionExtension
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $many_many = ;
- private static array $many_many_extraFields = ;
- private static array $owns = ;
- // methods
- protected Config_ForClass getOwnerConfig()
- public int getDesiredHeight()
- public int getOptimizedWidth()
- public DataList SortedImages()
- public SS_List getGalleryImages()
- public ImageLineCollection AdjustImages()
- public ImageLineCollection findQuickImageOrder()
- public ImageLineCollection findBestImageOrder()
- public ImageLine putImagesToLine()
- public void updateCMSFields()
- public DBHTMLText getBiasModeDescription()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $db
- $many_many
- $many_many_extraFields
- $owns
Methods
protected
- getOwnerConfig() — This function returns a Config object for the owner of this class.
public
- AdjustImages() — This function returns the images with the best combination of lines, calculated by findBestImageOrder().
- SortedImages() — Returns the images in the correct order specified by the Sort int.
- findBestImageOrder() — Returns an ImageLineCollection with all images, which are put in lines.
- findQuickImageOrder() — Returns an ImageLineCollection with all images, which are put in lines.
- getBiasModeDescription() — Returns a description for all bias modes. Useful for description of cms fields.
- getDesiredHeight() — Returns the desired height a line should have. The actually height can be slightly different through the calculation process.
- getGalleryImages() — Wraps the images of this DataObject into a GalleryImage object for further processing.
- getOptimizedWidth() — Returns the optimized width a line has.
- putImagesToLine() — Puts as many images from $images into one line as they can fit into the line.
- updateCMSFields() — Updates the cms fields in $fields.