Filter File manager by Set

Permalink
Hi,
I did not want to make a new post for something i thought would be so simple... but after hours of investigation, I am stuck - please help!

I am using the File Manager to add files to a block but would like to filter the file list by a given Set name.

The only filtering option I could find is by file type:
ccm_launchFileManager('&fType=' +ccmi18n_filemanager.FTYPE_IMAGE);


Is it possible to pass a set name?

rockface
 
wagdi replied on at Permalink Reply
wagdi
You can do this via the file manager in the dashboard. You'll see all your sets on the left. Select a set and only files in that set will show.

If your files aren't already in sets, select your desired files, click on the top menu bar in the file manager and you'll see a drop down menu, select 'sets' and you can create a new set which will have all your previously selected files instantly added to it.

Does that help at all or have I confused you even more?
rockface replied on at Permalink Reply
rockface
That is an option, yes.
But I was looking to see if I could pass the set name to the file manager from my code. Trying to make the window open with the set name already checked - and filtered.
NBardales replied on at Permalink Reply
NBardales
Have you tried altering the code on C5.5? The File Manager in version 5.5 has more filtering options.
xclydes replied on at Permalink Reply
xclydes
I believe this may be of help to you, and hopefully it isn't too late. After a bit of digging I found out how to have the file manager open to the a selected fileset.
$assetHelper = Loader::helper('concrete/asset_library');
$filterArgs = array(
   'fType' => FileType::T_IMAGE,
   'fsID' => 1,
);
echo $assetHelper->file('id', 'post', 'Text', $defFile, $filterArgs);


The fsID property is the ID of the fileset, if you do not know the ID I would suggest getting the fileset by name, then getting its ID.
$fs = FileSet::getByName($fsName);
$fsID = $fs->->getFileSetID();


The fsID can then be injected into your js from php.

ccm_launchFileManager('&fType=' +ccmi18n_filemanager.FTYPE_IMAGE);

would become (or similar to)
ccm_launchFileManager('&fType=' +ccmi18n_filemanager.FTYPE_IMAGE + '&fsID={$fsID}');


There are some issues I experienced while using this for my own purposes, but that's another post.
kdyer replied on at Permalink Reply
kdyer
I think this maybe what you are looking for?

http://www.concrete5.org/community/forums/documentation_efforts/how...

HTH,

Kent
surefyre replied on at Permalink Reply
surefyre
I know it's on old thread but that link is a 404.

Need to try and glean how to filter files by Set name