WebbuildersGroup\ImageCropField\Forms\ImageCropField
An Image Selection Field that allows the user to select a section of the image this also will save the crop box data so on refresh the selection remains.
This field also has the option to create a cropped image and save it to the
files system (work in progress).
Synopsis
class ImageCropField
extends FormField
{
- // members
- private static array $allowed_actions = ;
- protected boolean $enable_crop = false;
- protected array $data = ;
- protected $imageDataField;
- protected $schemaDataType = FormField::SCHEMA_DATA_TYPE_CUSTOM;
- protected string $schemaComponent = 'ImageCropField';
- // methods
- public void __construct()
- public void getName()
- public void setEnabledCrop()
- public {Image} getImage()
- public void getSchemaStateDefaults()
- public {boolean} getEnableCrop()
- public void createImage()
- public void cropImage()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
private
- $allowed_actions
protected
- $data
- $enable_crop
- $imageDataField
- $schemaComponent
- $schemaDataType
Methods
public
- __construct()
- createImage() — Will attepmt to create the image in ss, regenerate thumbnails, and publish it.
- cropImage() — Crop the image using the data saved on the parent dataobject
- getEnableCrop() — get if the crop button should be active on this field
- getImage() — returns the Image
- getName()
- getSchemaStateDefaults()
- setEnabledCrop() — All cropping to be done on this image