\FrontendUploadField
FrontendUploadField
An upload field ready to use in a front end context
- Prevent access to cms files
- Add a gallery button for preselected images
- Enable editing on the front end with focuspoint or cropzoom
Please note that to enable front end edition, the method canEditFrontend on the image
must return true
- Author: lekoala
Synopsis
class FrontendUploadField
extends BaseUploadField
{
- // members
- private static array $allowed_actions = ;
- protected boolean $useCropbox = true;
- protected boolean $useFocuspoint = false;
- protected $galleryUrl = NULL;
- protected boolean $editEnabled = true;
- protected boolean $keepOriginalName = false;
- private static array $common_image_types = ;
- private static string $common_image_size = '2M';
- // methods
- public void __construct()
- public void Field()
- public void attach()
- public UploadField setCanChooseFromGallery()
- public boolean canChooseFromGallery()
- public UploadField setGalleryUrl()
- public string GalleryUrl()
- public $this setEditEnabled()
- public bool EditEnabled()
- public $this setKeepOriginalName()
- public bool KeepOriginalName()
- public UploadField_ItemHandler getItemHandler()
- public void getUseCropbox()
- public void setUseCropbox()
- public void getUseFocuspoint()
- public void setUseFocuspoint()
- public void handleGallery()
- public void getAttributes()
- public void getAttributesHTML()
- protected File saveTemporaryFile()
- protected ViewableData_Customised customiseFile()
- public void getFileEditFields()
- public void setValue()
- public void UikitIcons()
- public void IconUpload()
- public void IconEdit()
- public void IconRemove()
- public void IconPicture()
- // Inherited methods from BaseUploadField
- public static static createForClass()
- public static string getFolderForClass()
- public void setImageOptions()
- public void __construct()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
108 | hmmm, remove it? |
Members
private
- $allowed_actions — array
- $common_image_size
- $common_image_types
protected
- $editEnabled
- $galleryUrl
- $keepOriginalName
- $useCropbox
- $useFocuspoint
Methods
protected
- customiseFile() — Customises a file with additional details suitable for rendering in the UploadField.ss template
- saveTemporaryFile() — Loads the temporary file data into a File object
public
- __construct()
- EditEnabled()
- Field()
- GalleryUrl() — Get gallery items url. Default to action "gallery" on current controller if none set
- IconEdit()
- IconPicture()
- IconRemove()
- IconUpload()
- KeepOriginalName()
- UikitIcons()
- attach()
- canChooseFromGallery()
- getAttributes()
- getAttributesHTML()
- getFileEditFields()
- getItemHandler() — Override default item handler
- getUseCropbox()
- getUseFocuspoint()
- handleGallery()
- setCanChooseFromGallery()
- setEditEnabled() — Disallow editing - also suppress iframe => faster load
- setGalleryUrl() — Set the url from where gallery items are loaded
- setKeepOriginalName() — By default, the uploaded file will be renamed with field name + date.
- setUseCropbox()
- setUseFocuspoint()
- setValue()
Inherited from BaseUploadField
public
- createForClass() — Return an instance of UploadField with the folder name already set up
- getFolderForClass() — Get folder for a given class
- setImageOptions()