ezze / ezze-elfinder

YII framework's extension used to integrate ElFinder file manager.
11 stars 5 forks source link

Added Feature: getFileCallback option for client widget working #5

Closed cbelizon closed 11 years ago

cbelizon commented 11 years ago

I was trying to use the option getFileCallback documented here:

https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-getFileCallback

I've changed your EzzeElfinder.init function to get the chance of embed code like this in the options array for your ElFinderWidget

$this->widget("application.common.extensions.ezzeelfinder.ElFinderWidget",
  array(
         'getFileCallback' => "console.log(file);",
  )
);

If wysiwyg option is defined too, getFileCallback takes preference.

My best regards.

ezze commented 11 years ago

I believe you don't have to do that. Everything already is done in evaluateOptions method. You have to prefix the value of option with js: to make it interpreted as JavaScript code being evaluated: 'getFileCallback' => "js: function(file) { console.log(file); }"

cbelizon commented 11 years ago

Your'e right, I didn't see the filter. Is this the standard notation of Yii?

ezze commented 11 years ago

I've seen it somewhere in Yii so it's definitely not my own invention. You can see this prefix in CJavaScriptExpression class.