Yii 1.1: elfinder

Extension to use elFinder file manager in yii application
25 followers

This extension allows use elFinder file manager in your Yii application. Possible usage:

  • chose file on server side (ServerFileInput widget)
  • manage files in specified folder (ElFinder widget)
  • add file browser to tinyMce wysiwyg editor

Requirements

Tested with Yii 1.1.10, but should work with previous versions too

Usage

  1. Checkout source code to your project, for example to ext.elFinder
  2. Create controller for connector action, and configure it params
  3. ServerFileInput - use this widget to choose file on server using ElFinder pop-up
  4. ElFinderWidget use this widget to manage files
  5. To use TinyMceElFinder see: My TinyMce extension
// controller to host connector action
class ElfinderController extends CController
{
    public function actions()
    {
        return array(
            'connector' => array(
                'class' => 'ext.elFinder.ElFinderConnectorAction',
                'settings' => array(
                    'root' => Yii::getPathOfAlias('webroot') . '/uploads/',
                    'URL' => Yii::app()->baseUrl . '/uploads/',
                    'rootAlias' => 'Home',
                    'mimeDetect' => 'none'
                )
            ),
        );
    }
}
 
//server file input
$this->widget('ext.elFinder.ServerFileInput', array(
        'model' => $model,
        'attribute' => 'serverFile',
        'connectorRoute' => 'admin/elfinder/connector',
        )
);
 
// ElFinder widget
$this->widget('ext.elFinder.ElFinderWidget', array(
        'connectorRoute' => 'admin/elfinder/connector',
        )
);

Changelog

  • January 16, 2013 Fixed jQuery 1.8.3 compatibility, added CSRF validation support, added i18n support, begin using compressed script when not debugging
  • August 14, 2012 Fixed bug with upload(from comments here)
  • July 18, 2012 Adding support for multiple ServerFileInput instances with different connectors

Resources

Total 20 comments

#17050 report it
skysham at 2014/04/29 12:03am
Multiple Roots?

Hi, can I set up multiple roots and set the folder permission?

Also, I got a error on elfinder with tinymce.

Uncaught TypeError: Cannot set property 'value' of undefined

How can I fix it? Thanks!

#16310 report it
aliabdzad at 2014/02/08 03:58pm
Great!!!

tanx alot ;)

#15757 report it
minh0409 at 2013/12/13 01:07pm
elfinder Jquery

When elfinder runs, it generates asset folder with jquery and jquery ui in it. Do u know where can i specify elfinder to use a specific jquery and jquery ui version ? It works with jquery 1.8.3 , but it is not working with latest jquery 1.9.0.

#15579 report it
Bogdan Savluk at 2013/11/24 09:46am
Re: Permission

As i remember there is some configuration options related to permissions in elFinder connector, so you can try to configure it using user iformation.

But, maybe the best option would be to create separete connector actions for separate resources, and setup access filters for them.

#15577 report it
minh0409 at 2013/11/24 02:13am
Permission

I have different folders in elFinder: hr, accountant, admin, employee. I have Yii roles ( hr, accountant, admin, employee). Is there a way that specific Yii roles access to only that folder. Lets say a Yii roles accountant can only have access (read and upload , delete files ) to accountant folder but not other folders like hr, admin , employee. Thank you for your help.

#15175 report it
meadows at 2013/10/15 12:58am
Upgrade to version 2.0

Any interest in upgrading to version elFinder 2.0? It is on RC1 right now, I can help with either coding aspect of it or some $$ for your time.

#14817 report it
Bogdan Savluk at 2013/09/11 06:53pm
Re: Compressor still causing problems...

Looks, like, you have two jquery scripts on page(details in PM)

Anyway, comments is not good place for this discussion - let continue in PM or on extension issue tracker

#14816 report it
Ocean Wind at 2013/09/11 04:43pm
Compressor still causing problems...

Thanks for the fast turn-around, Bogdan. I installed the new version you sent and it still throws a ".tinymce is not a function" error.

(Apologies everyone. I realize we're talking about newtinymce in the elfinder page, but they're intimately related)

#14814 report it
Bogdan Savluk at 2013/09/11 03:20pm
Re: Compressor Route

Just updated extension, try updated version (there was bug with caching in compressor action)

#14813 report it
Ocean Wind at 2013/09/11 02:47pm
Compressor Route

It seems the problem is with the compressor route. When I remove the compressor route from the widget code, tinyMCE loads as it should.

#14812 report it
Ocean Wind at 2013/09/11 02:33pm
toolbar not displaying / javascript not loading ?

Thanks for your work on this extension.

I'm having a problem. The TinyMCE toolbar is not displaying, and I'm getting the following javascript error:

Error: TypeError: $(...).tinymce is not a function

Seems the JS file may not be loading?

#14757 report it
Bogdan Savluk at 2013/09/07 09:42am
Re: Import path

This controllers is examples how to use actions from extensions in your application, also *Route properties in examples are pointing to that controllers.

The only thing you need, to use that controllers, is to put them somewhere in application and specify correct routes in widgets, thats is all.

To integrate ElFinder with TinyMCE, you need to have working ElFinderConnectorAction(there is an example in ElfinderController above), and fileManager configuration for TinyMce(example also is provided on extension page):

'fileManager' => array(
        'class' => 'ext.elFinder.TinyMceElFinder',
        'connectorRoute'=>'admin/elfinder/connector',
    ),
#14755 report it
LarryTX at 2013/09/07 08:23am
Import Path

Thanks for the information on adding TineMCE and ElFinder to the import paths in config/main.php. I thought it was strange that the instructions didn't say to do that, but I figured that there must be a reason not to since they didn't included it. Anyway, adding them to the import array resolved that problem.

Now, I'm getting the infamous "Unable to connect to backend." Then, I have to figure out how to use the ElfinderController and TinyMceController since they never get used in your instructions. And how to integrate ElFinder with TinyMCE since your instructions only relate to independent ElFinder widgets.

#14754 report it
Bogdan Savluk at 2013/09/07 06:05am
include(TinyMceFileManager.php): failed to open stream: No such file or directory

This is because TinyMceFileManager is not in imports paths..

To fix this you can add to you import paths. You can import just before use Yii::import('ext.tinymce.TinyMceFileManager'), or in application configuration(personally I have imported both extensions in application configuration):

'import'=>array(
//...
   'ext.tinymce.*',
   'ext.elFinder.*',
//...
)
#14742 report it
LarryTX at 2013/09/06 08:19pm
include(TinyMceFileManager.php): failed to open stream: No such file or directory

I'm trying to implement TinyMCE/ElFinder in my Yii application. After installing both extensions and creating the two accompanying controllers, I get the error message include(TinyMceFileManager.php): failed to open stream: No such file or directory. This arises from the class definition class TinyMceElFinder extends TinyMceFileManager in TinyMceElFinder.php. Can you give me any guidance on how I should remedy this situation?

TinyMCE works great until I enable ElFinder.

#13481 report it
Bogdan Savluk at 2013/05/31 03:54am
Re: migrate to yii2

Not yet, I think before doing this we need to wait at least for the alpha version.

#13480 report it
PinkBrainPlan at 2013/05/31 01:43am
migrate to yii2

Hi, are you already working on a yii2 version of this extension?

Would be cool to know, as I would love to use this extension in my new "internal" intranet site...

#12384 report it
v_bogdan at 2013/03/17 01:43pm
How can i add zip/unzip button to panel

there are no those buttons. Check it out. I was donwload last version of ext. and i has no change any files.

#12382 report it
Bogdan Savluk at 2013/03/17 12:22pm
Re: How can i add zip/unzip button to panel?

There is settings property where you can override default widget settings, you can read more about these options here: https://github.com/Studio-42/elFinder/wiki/elFinder-1.x#client-configuration

But as I remember, by default, there is all avaliable buttons on toolbar, so - in order to add these buttons to toolbar probably you will need to modify elFinder scripts.

#12376 report it
v_bogdan at 2013/03/17 10:03am
zip/unzip

How can i add zip/unzip button to panel?

Leave a comment

Please to leave your comment.

Create extension