twFilemanager plugin
Overview
The twFilemanagerPlugin is Ajax filemanager based on simogeo/Filemanager for CKEditor
Requirements:
Installed CKEditor
Optional Requirements:
twMediaPlugin
Adding possibility to use this plugin stores like DB based file store (media)
sfAssetsLibraryPlugin
Adding possibility to use this plugin store type (assets)
sfCKEditorPlugin
Provide CKEditor widget
Installation
The Git way
Clone the plugin from Github:
git clone git://github.com/ldath/twFilemanagerPlugin.git
If you use Git as a VCS for your project, it should be better to add the plugin as a submodule:
git submodule add git://github.com/ldath/twFilemanagerPlugin.git plugins/twFilemanagerPlugin
The SVN way
Install the plugin via the subversion repository:
svn checkout http://svn.github.com/ldath/twFilemanagerPlugin.git plugins/twFilemanagerPlugin
Symfony PEAR way
Install plugin:
symfony plugin:install twFilemanagerPlugin
symfony cache:clear
Because in most of situations there is a problem with PEAR 1.3 and this kind of error shows:
PHP Fatal error: Class 'sfPearRest13' not found in .../lib/vendor/symfony/lib/plugin/sfPearConfig.class.php on line 27
One of solutions is for example copy patch from symfony-rest13.patch to .../lib/vendor/ folder and go to .../lib/vendor/symfony folder and then apply patch:
patch -p0 -i ../symfony-rest13.patch
Final step
Create backend or admin app if not exists:
symfony generate:app backend
Publish the plugin's assets:
plugin:publish-assets
Enable in backend settings.yml module file looks like in example:
all:
.settings:
enabled_modules:
- default
- twFilemanager
How to use
In this first example I'll use sfWidgetFormCKEditor from sfCKEditorPlugin
sfContext::getInstance()->getConfiguration()->loadHelpers(array(
'Helper',
'Tag',
'Url'));
$config = array(
'language' => 'pl',
'entities_latin' => false,
'entities_greek' => false,
'filebrowserBrowseUrl' => url_for('@tw_filemanager_index?sf_format=html').'?path=news/content'),
'customConfig' => '/twCorePlugin/js/ck_content.js',
);
$this->widgetSchema['content'] = new sfWidgetFormCKEditor(array('jsoptions' => $config));
TODO
- setting up multiple root folders avaiable for connector