There is no need to reinvent the wheel so how can I include some functionality of other modules into mine?
My module needs to browse the server for images (sometimes to upload them) and I first try the fckeditor and try to remove all toolbar buttons except for IMG. Then I realized that there are 2 file managers with no wysiwyg stuff so that is perfect.
How can I insert a button in my module to get a file, upload it if necessary and return the abs path or relative path of the selected file?
I could do my own functions for that but since both file managers are great and have a nice GUI I wish to use them.
J
Including other modules functionality into mine
Re: Including other modules functionality into mine
If you need help to create a module skeleton module or module maker are good starting points.
If you wanna use functions from another module you can "include" it with a function like
Hmm, sound like Uploads module ...ortegaj wrote: How can I insert a button in my module to get a file, upload it if necessary and return the abs path or relative path of the selected file?
If you wanna use functions from another module you can "include" it with a function like
Code: Select all
function GetDependencies()
{
return array();
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: Including other modules functionality into mine
you can do a:
Code: Select all
$module = $this->GetModuleInstance('ModuleName');
then call any method in that module.
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.
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.
Re: Including other modules functionality into mine
On the CMSMS site I found this:
but it says for modules with frontend.
I also tried this as posted in this topic
but I cant figure out how to make the module show its admin panel.
FileManager (not the buli-in) does not appear to have any methods
All I want is to be able to place aa button (done) in my EDIT XXXXX page so one of the fields is populated with the filename (of theimage) of the selected image (or thumbnail) that was displayed on a popup windows with all images of one dir. This functionality i habve made in other apps but there is no use into converting that into cmsms if that's already done.
Once I can use other modules I can manage all those things but right now I can't use any module.
If you could be more specific with a short example...
Code: Select all
global $gCms;
if( !isset( $gCms->modules['FileManager'] ) || !isset( $gCms->modules['FileManager']['object'] ) )
{
return;
}
$themoduleiwant = $gCms->modules['FileManager']['object'];
//$themoduleiwant->DoThis($somedata);
//$themoduleiwant->DoThat($somemoredata);
I also tried this as posted in this topic
Code: Select all
$module = $this->GetModuleInstance('FileManager');
then call any method in that module.
FileManager (not the buli-in) does not appear to have any methods
All I want is to be able to place aa button (done) in my EDIT XXXXX page so one of the fields is populated with the filename (of theimage) of the selected image (or thumbnail) that was displayed on a popup windows with all images of one dir. This functionality i habve made in other apps but there is no use into converting that into cmsms if that's already done.
Once I can use other modules I can manage all those things but right now I can't use any module.
If you could be more specific with a short example...