SilverStripe\AssetAdmin\Controller\AssetAdmin
AssetAdmin is the 'file store' section of the CMS.
It provides an interface for manipulating the File and Folder objects in the system.
Synopsis
class AssetAdmin
extends LeftAndMain
implements
PermissionProvider
{
- // members
- private static string $url_segment = 'assets';
- private static string $url_rule = '/$Action/$ID';
- private static string $menu_title = 'Files';
- private static string $menu_icon_class = 'font-icon-image';
- private static $tree_class = Folder::class;
- private static array $url_handlers = ;
- private static integer $page_length = 50;
- private static integer $max_history_entries = 100;
- private static $max_upload_size;
- private static integer $image_retry_min = 0;
- private static integer $image_retry_max = 0;
- private static integer $image_retry_failure_expiry = 300;
- private static array $allowed_actions = ;
- private static string $required_permission_codes = 'CMS_ACCESS_AssetAdmin';
- private static integer $thumbnail_width = 352;
- private static integer $thumbnail_height = 264;
- private static bool $bust_cache = true;
- protected ThumbnailGenerator $thumbnailGenerator;
- // methods
- public void init()
- public void getClientConfig()
- public HTTPRequest|HTTPResponse apiCreateFile()
- public HTTPRequest|HTTPResponse apiUploadFile()
- public HTTPResponse apiHistory()
- public void legacyRedirectForEditView()
- public string getFileEditLink()
- protected AssetNameGenerator getNameGenerator()
- public ArrayList breadcrumbs()
- public void baseCSSClasses()
- public void providePermissions()
- public FormFactory getFormFactory()
- public Form getFileEditForm()
- public Form|HTTPResponse fileEditForm()
- public Form getFileInsertForm()
- public Form|HTTPResponse fileInsertForm()
- public Form getFileEditorLinkForm()
- public Form|HTTPResponse fileEditorLinkForm()
- protected Form|HTTPResponse getAbstractFileForm()
- public Form fileSelectForm()
- public Form moveForm()
- public Form getMoveForm()
- public Form getFileSelectForm()
- public Form|HTTPResponse getFileHistoryForm()
- public HTTPResponse schema()
- public Form|HTTPResponse fileHistoryForm()
- public HTTPResponse createfolder()
- public HTTPResponse save()
- public HTTPResponse publish()
- protected HTTPResponse saveOrPublish()
- public void unpublish()
- public array getObjectFromData()
- public array getMinimalistObjectFromData()
- public array generateThumbnails()
- public DBHTMLText|HTTPResponse addtocampaign()
- public Form addToCampaignForm()
- public Form|HTTPResponse getAddToCampaignForm()
- protected Upload getUpload()
- protected HTTPResponse getRecordUpdatedResponse()
- public Form folderCreateForm()
- public Form getFolderCreateForm()
- public Form fileSearchForm()
- public Form getFileSearchform()
- public ThumbnailGenerator getThumbnailGenerator()
- public $this setThumbnailGenerator()
- public void canView()
Hierarchy
Extends
- SilverStripe\Admin\LeftAndMain
Implements
- SilverStripe\Security\PermissionProvider
Tasks
Line | Task |
---|---|
310 | Allow batch uploads |
577+ | Implement on client |
906 | Eventually all form scaffolding will be based on context rather than record ID |
Members
private
- $allowed_actions — array
- $bust_cache
—
SilverStripe\AssetAdmin\Controller\bool
Whatever the front end should try to bust cache by appending the version id to the image URL. - $image_retry_failure_expiry
—
int
If we fail after max_image_retry, a reload can be re-attempted again after this period, but won't be automatically started. - $image_retry_max
—
int
Stop retrying after we reach this retry period. - $image_retry_min
—
int
If an image load fails in JS, retry it after this many seconds. - $max_history_entries — int
- $max_upload_size — int
- $page_length
—
int
Amount of results showing on a single page. - $required_permission_codes
- $thumbnail_height
—
int
Retina thumbnail height (native size: 132) - $thumbnail_width
—
int
Retina thumbnail image (native size: 176) - $tree_class
- $url_handlers
- $url_rule
- $url_segment
protected
- $thumbnailGenerator — SilverStripe\AssetAdmin\Model\ThumbnailGenerator
Methods
protected
- getAbstractFileForm() — Abstract method for generating a form for a file
- getNameGenerator() — Get an asset renamer for the given filename.
- getRecordUpdatedResponse() — Get response for successfully updated record
- getUpload()
- saveOrPublish() — Update thisrecord
public
- addToCampaignForm() — Url handler for add to campaign form
- addtocampaign() — Action handler for adding pages to a campaign
- apiCreateFile() — Creates a single file based on a form-urlencoded upload.
- apiHistory() — Returns a JSON array for history of a given file ID. Returns a list of all the history.
- apiUploadFile() — Upload a new asset for a pre-existing record. Returns the asset tuple.
- baseCSSClasses() — Don't include class namespace in auto-generated CSS class
- canView()
- createfolder()
- fileEditForm() — Get file edit form
- fileEditorLinkForm() — Get the file insert link form
- fileHistoryForm() — Get file history form
- fileInsertForm() — Get file insert media form
- fileSearchForm() — Scaffold a search form.
- fileSelectForm() — Get form for selecting a file
- folderCreateForm()
- generateThumbnails() — Generate thumbnails and provide links for a given file
- getAddToCampaignForm()
- getClientConfig()
- getFileEditForm() — The form is used to generate a form schema, as well as an intermediary object to process data through API endpoints.
- getFileEditLink() — Given a file return the CMS link to edit it
- getFileEditorLinkForm() — The form used to generate a form schema, since it's used directly on API endpoints, it does not have any form actions.
- getFileHistoryForm()
- getFileInsertForm() — The form is used to generate a form schema, as well as an intermediary object to process data through API endpoints.
- getFileSearchform() — Allow search form to be accessible to schema
- getFileSelectForm() — Get form for selecting a file
- getFolderCreateForm() — Returns the form to be used for creating a new folder
- getFormFactory() — Build a form scaffolder for this model
- getMinimalistObjectFromData() — Build the array containing the minimal attributes needed to render an UploadFieldItem.
- getMoveForm() — Get form for moving files/folders to a new location
- getObjectFromData() — Build the array containing the all attributes the AssetAdmin client interact with.
- getThumbnailGenerator()
- init() — Set up the controller
- legacyRedirectForEditView() — Redirects 3.x style detail links to new 4.x style routing.
- moveForm() — Get form for moving files/folders to a new location
- providePermissions()
- publish()
- save()
- schema() — Gets a JSON schema representing the current edit form.
- setThumbnailGenerator()
- unpublish()