Reuse / hook into File Manager?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Locked
hansom

Reuse / hook into File Manager?

Post 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.
arwan

Re: Reuse / hook into File Manager?

Post 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
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm
Location: the Netherlands

Re: Reuse / hook into File Manager?

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Reuse / hook into File Manager?

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
hansom

Re: Reuse / hook into File Manager?

Post 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?
Locked

Return to “Developers Discussion”