Page 1 of 1

Reuse / hook into File Manager?

Posted: Tue Aug 15, 2006 9:03 am
by hansom
Let's say wanted to create a module with a form including a control that allows the user to select one of the folders in either the uploads or the images directory, could the standard File Manager included in the core be used to accomplish this?

I imagine something like having a button that when clicked opens a new windows that shows the uploads directory and its sub directories. The user may select the current directory or choose to navigate into one of the subdirectories. The file names of the files residing in the current directory should be visible but neither click- nor selectable.

So, is it possible to reuse functionality of the File Manager to do (part of) this?

TIA.

Re: Reuse / hook into File Manager?

Posted: Tue Aug 22, 2006 4:08 pm
by arwan
I've also looked into how I could use the FileManager's code to aid me in the develoment of a module. IIRC, I had troubles with including the FileManager libraries into my code, I just couldn't get the file /lib/filemanager/ImageManager/config.inc.php properly included. Other priorities kept me from further investigating this matter.
I think I 'heard' on the IRC-channel that some new code is being prepared for the FileManager, maybe that will include ways of reusing that code? Maybe a more experience CMS-MS user and/or core developer can comment more on this?

arwan

Re: Reuse / hook into File Manager?

Posted: Wed Aug 23, 2006 12:40 pm
by Dee
I don't know FileManager well, but in cmsmadesimple-1.0 you can create a module object from another (installed) module very easy, just do:

Code: Select all

$filemanager = $this->GetModuleInstance('FileManager')
and you will have access to all it's members and methods.

Re: Reuse / hook into File Manager?

Posted: Wed Aug 23, 2006 1:05 pm
by calguy1000
The standard file manager included in the core is not a module per say....... the Uploads module is though, and you can see how it's integrated into the Banners module for an example.

Re: Reuse / hook into File Manager?

Posted: Wed Aug 23, 2006 6:05 pm
by hansom
calguy1000 wrote: The standard file manager included in the core is not a module per say....... the Uploads module is though [...]
So you're saying that the FileManager cannot be used e.g. by other modules? It seems a bit redundant to have to depend on another module that does the same thing as something that's already in the core, no?