Filelib filebrowser for wysiwyg editors
dependencies:
- filelib *https://github.com/xi-project/xi-filelib
- xi-bundle-filelib *https://github.com/xi-project/xi-bundle-filelib
- Make sure you have filelib and xi-bundle-filelib installed
- Install your wysivyg editor. This pacage is tested to work with TinyMCE but it sould also work with CKEditor
- Initialize custom browser callback in your js/coffeescript
- Edit your config file
- You might want to restrict access to /file/browser/. Use your project security config file for this.
Deps -file:
[xi-filelib]
git=http://github.com/xi-project/xi-filelib.git
version=master
[XiFilelibBundle]
git=http://github.com/xi-project/xi-bundle-filelib
target=/bundles/Xi/Bundle/FilelibBundle
[XiFilebrowserBundle]
git@github.com:xi-project/xi-bundle-filebrowser.git
target=/bundles/Xi/Bundle/Filebrowser
version=master
AppKernel.php
<?php
new Xi\Bundle\FilelibBundle\XiFilelibBundle(),
?>
You can do this anyway you like. It is possible to use stfalcon TinymceBundle for this *https://github.com/stfalcon/TinymceBundle
if you use stfalcon tinymcebundle be adviced that you must specify your callback in each theme
theme:
simple:
file_browser_callback: TinyMceFilelibFilebrowserCallback
Following example is in coffeescript format and for TinyMce
window.TinyMceFilelibFilebrowserCallback = (field_name, url, type, win) ->
tinyMCE.activeEditor.windowManager.open({
file : "/file/browser/list/"+ type,
title : 'Filebrowser',
width : 800,
height : 800,
resizable : "yes",
inline : "yes",
close_previous : "no"
}, {
window : win,
input : field_name
});
return false;
folder is name of virtual filelib folder where your files are located
xi_filebrowser:
folder: filebrowser
Update your routing to take account filebrowser routing.yml
XiFilebrowserBundle:
resource: "@XiFilebrowserBundle/Resources/config/routing.yml"
prefix: /