This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

concrete5 provides an asset library helper, which makes it easy to add file support to your own custom forms and blocks. When used, the asset library helper creates a javascript area that is capable of launching the file manager, managing file permissions, etc…

Loading the Helper

$al = Loader::helper(‘concrete/asset_library’);

Methods

$al->file($formElementID, $formName, $chooseText, $fileObject = null)

Creates a concrete5 file element. Gives the element the ID $formElementID, and the form name $formName. This will be the name of the item in the $_REQUEST or $_POST array. (Note: the concrete5 file element does NOT post using $_FILES. It posts numerical file IDs of files already stored within the concrete5 file manager.)

$al->file(‘thumbnail’, ‘thumbnailFileID’, ‘Select Thumbnail’);

When the surrounding form is submitted, check $_POST[‘thumbnailFileID’] for a numerical file ID.

Optionally, a File object can be provided, and the form element will show that as initially selected.

$al->image($formElementID, $formName, $chooseText, $fileObject = null)

Exactly like file(), but restricts selection to image file types.

Loading Conversation