File manager allowed file types

Permalink
Hi all, i wanted to know if it was possible to add the allowed file types to the "file" function of the asset_library helper.

$al = Loader::helper('concrete/asset_library');
$img = File::getByID($image);
echo $al->file('ccm-b-image', 'image', t('Choose image'), $img);


Does it exist, or is this just not implemented yet?

I just want to add something like
array("mp3","png")
to the function to only allow selection of mp3 and png.

I dont want to globally change the allowed file types because i want this created in a block.

 
A3020 replied on at Permalink Best Answer Reply
A3020
Yes, this is possible. Check /core/libraries/file/types.php for additional file types. Here is an example:

$al = Loader::helper('concrete/asset_library');
$filterArgs = array(
   'fType' => FileType::T_AUDIO,
);
$img = File::getByID($image);
echo $al->file('ccm-b-image', 'image', t('Choose image'), $img, $filterArgs);