symfony 1.2/1.3/1.4 library upload assets manager
What is it ?
sfMediaBrowser is a symfony 1.2, 1.3, 1.4 plugin that allows you to manage all your file uploads.
It does NOT use any database as it works directly on file structure.
This plugin bundle an interface for managing folder and file under a configured folder. If you know sfMediaBrowser, you will most probably recognise its easy to understand interface.
The plugin also bundles a form widget and a form validator for replacing a html native file upload and therefore browser directly from the server.
The plugin is also ready for TinyMCE !
How to install ?
cd plugins git clone git://github.com/vinyll/sfMediaBrowserPlugin.git
_If you don't have git install and don't want to install it, you can download a sandbox version
edit /config/ProjectConfiguration.class.php :
How to run the media browser ?
edit /apps/your_app/settings.yml :
Open your browser, go to your app and run the url /sf_media_browser, and play around !
How to enable moving and renaming ?
Download ready to use jquery files. Copy the /js files into you /web/js folder.
Now edit /apps/your_app/app.yml :
all: sf_media_browser: assets_list: js: [/js/jquery.js, /js/jquery.dragndrop.js, /sfMediaBrowserPlugin/js/list.jquery.js] css: [/sfMediaBrowserPlugin/css/list.css]
You can now :
- drag and drop a file/folder into another folder to move it.
- doubleclick on a file/folder label to edit its name.
How to enable thumbnails ?
You may automatically display a thumbnail instead of the default image icon for files detected as images.
This requires sfImageTransformPlugin to be installed.
Then, update you /apps/your_app/app.yml :
all: sf_media_browser: thumbnails_enabled: true …
You may also configure other options such as the thumbnail directory or thumbnail width and height (see the app.yml file for details).
How to use the file upload widget ?
Edit your form class :
Here we use an "image" field as an example :
$this->setWidget('image', new sfWidgetFormInputMediaBrowser()); $this->setValidator('image', new sfValidatorMediaBrowserFile());
Refer to the full example upload file widget for a fully working sample code.
How to use with TinyMCE ?
Setup your tinyMCE.init with this option :
..., file_browser_callback: "sfMediaBrowserWindowManager.tinymceCallback"
Now, when selecting an image, video, link file from tinyMCE, it should pop up a sfMediaBrowser window.
See the full tinymce example page for a full working example
How to use with sfAssetsManager ?
The plugin is ready for sfAssetsManager as it bundles and uses a assets_manager.yml file.
There is no specific configuration as it will detect automatically if the plugin is available and use it by default.
This replaces the assets configuration in app.yml and makes it more flexible.
See sfAssetsManagerPlugin for details.
How to configure ?
see the /plugins/sfMediaBrowserPlugin/config/app.yml file for configuration.
If you need further configuration, you should consider [extending the plugin]
How to help ?
You can participate by many ways :
- Spreading the link
- Debugging, improving, testing, forking, adapting, patching the source code
- Mailing me to let me know what you think of it
- Going to http://www.symfony-project.org/plugins/sfMediaBrowserPlugin and add yourself as a user
- add another browsing view with folder tree and files seperated ?
- add image edition functionalities (resize and maybe rotate ?)
- finish the jquery optional version (dom's filepicker. ajax view ? crop image ?)
The lead developer is Vincent Agnano email@example.com. You may contact me at the email address here above.