Find out which set if any the selected file belongs too
Permalink
Hi all,
I'm trying to figure how to find out which set a file is in once I have the file ID.
Let's say I allow a user to select a picture from the file manager, I need to know which file set, if any, that file belongs to. How would I do that?
I have a sneaking suspicion I will have no choice but to go through manual sql fetching but I'd like to avoid that and use the api instead.
Anyone???
Thank you
I'm trying to figure how to find out which set a file is in once I have the file ID.
Let's say I allow a user to select a picture from the file manager, I need to know which file set, if any, that file belongs to. How would I do that?
I have a sneaking suspicion I will have no choice but to go through manual sql fetching but I'd like to avoid that and use the api instead.
Anyone???
Thank you
Hi, Thank you for your answer.
It's not, however what I'm looking for.
You see, in your solution, I can find the name of a fileset knowing its ID.
What I'm trying to find out is the ID of the fileset knowing the ID of a file inside it.
Thanks again for taking the time.
It's not, however what I'm looking for.
You see, in your solution, I can find the name of a fileset knowing its ID.
What I'm trying to find out is the ID of the fileset knowing the ID of a file inside it.
Thanks again for taking the time.
ohh yea lol my bad I think there is way with
$sets = $f->getFileSets()
Gets an array containing all FileSet objects in which the current File object appears.
from docs
$sets = $f->getFileSets()
Gets an array containing all FileSet objects in which the current File object appears.
from docs
Thanks. I can't believe I actually had a look at that page and didn't see it. Thanks again.
no problem mate,
I am going have play arround with it too i think it cud come in very handy if you get it working feel free to share.
Take care
I am going have play arround with it too i think it cud come in very handy if you get it working feel free to share.
Take care
Actually what I'm really trying to do is, I think, impossible through the api.
We know that a file can belong to different filesets. When using getFileSets(), I get all the file sets the file belongs too.
What I really want however is to know which fileset the user chose the file from when selecting the file through my add-on. I want to know which fileset exactly.
We know that a file can belong to different filesets. When using getFileSets(), I get all the file sets the file belongs too.
What I really want however is to know which fileset the user chose the file from when selecting the file through my add-on. I want to know which fileset exactly.
hi,
had a little think and maybe you can use javascript
put something like this in the file that is calling the filemanger
This will get the last selected fileset id from file manager
had a little think and maybe you can use javascript
put something like this in the file that is calling the filemanger
$('.group-option').live("click",function(){ curFsId =$(this).attr("id").substr(-1); alert(curFsId);})
This will get the last selected fileset id from file manager
it works. I'll just have to figure out how to get the value from js to php but should be ok.
Thanks again
Thanks again
yeah I looked for this the other week too ...answer can be found here
http://www.concrete5.org/community/forums/customizing_c5/get-file-s...
For those to lazy to click credits to "PauloCarvalhoDesign"