xi /filebrowser-bundle
该包最新版本(dev-master)的许可信息不可用。
Filelib 文件浏览器,用于 wysiwyg 编辑器
dev-master
2012-09-04 11:22 UTC
Requires
- symfony/event-dispatcher: 2.1.*
- symfony/form: 2.1.*
- symfony/http-foundation: 2.1.*
- xi/filelib: 2.1.x-dev
This package is not auto-updated.
Last update: 2024-09-14 11:55:53 UTC
README
Filelib 文件浏览器,用于 wysiwyg 编辑器
依赖关系
- filelib *https://github.com/xi-project/xi-filelib
- xi-bundle-filelib *https://github.com/xi-project/xi-bundle-filelib
如何设置
- 确保已安装 filelib 和 xi-bundle-filelib
- 安装您的 wysivyg 编辑器。此包已测试与 TinyMCE 兼容,但应也能与 CKEditor 兼容
- 在您的 js/coffeescript 中初始化自定义浏览器回调
- 编辑您的配置文件
- 您可能希望限制对 /file/browser/ 的访问。为此请使用您的项目安全配置文件。
1. 安装 filelib 和 xi-bundle-filelib
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(), ?>
2. 安装 wysiwyg 编辑器
您可以选择任何方式完成此操作。可以使用 stfalcon TinymceBundle 来完成此操作 *https://github.com/stfalcon/TinymceBundle
如果您使用 stfalcon tinymcebundle,请务必在每个主题中指定您的回调
theme: simple: file_browser_callback: TinyMceFilelibFilebrowserCallback
3. 在您的 js/coffeescript 中初始化自定义浏览器回调
以下示例使用 coffeescript 格式,适用于 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;
4. 编辑您的配置文件
文件夹是包含您文件的虚拟文件lib文件夹的名称
xi_filebrowser: folder: filebrowser
更新您的路由以考虑 filebrowser routing.yml 路由
XiFilebrowserBundle: resource: "@XiFilebrowserBundle/Resources/config/routing.yml" prefix: /