MCFileManager:JS options
From Moxiecode Documentation Wiki
Contents |
JavaScript options reference
This document is the index/reference page for all JavaScript initialization options available for the MCFileManager.
JavaScript options
These options are available when the JavaScript for MCFileManager is initialized or with a mcFileManager.open function call. These options are most useful for integration purposes or when using MCFileManager in standalone mode or as a TinyMCE plugin, but remember to add the "filemanager_" prefix infront of each option when it's used as a plugin for TinyMCE check the example below.
Options available in both standalone mode and as a TinyMCE plugin:
- document_base_url
- relative_urls
- remove_script_host
- path
- rootpath
- remember_last_path
- use_url_path
- insert_filter
TinyMCE plugin specific options
Some options are only available when the MCFileManager is used as a TinyMCE plugin, here are some TinyMCE specific options.
Setting page level options
Setting options for all open calls on a page is done using the mcFileManager.init javascript call, much like the init call in TinyMCE. Notice that this call is normally not needed unless you have specific requirements for the integration with TinyMCE or using the application in standalone mode.
Example of standalone init call
<script type="text/javascript">
mcFileManager.init({
document_base_url : "/",
relative_urls : true,
remove_script_host : true
});
</script>
Example of standalone link call
You can also override the init call settings by specifying them in the open call. See the example below.
<a href="javascript:mcFileManager.open('someform','somefield','','',{path : 'files', remember_last_path : false});">
Example of TinyMCE init call
This is a example on how to use the options above together with TinyMCE.
<script type="text/javascript">
tinyMCE.init({
plugins : 'filemanager',
filemanager_remember_last_path : false
});
</script>
