elRTE + elFinder (File manager)
Ext pack contains all necessary to start work. Works with JQ, JQ UI, .php Tested with Yii v.1.1.5+ but I think it would work in earlier versions too. publishes it`s resources into assets dir.
ELRTEF 1.2.1:
ELRTEF 1.2:
ELRTEF 1.1:
ELRTEF 1.0:
elfinder/connectors/php/connector.php (or connectors/php/connector.php in v.1.0) and edit it. Enter your passkey in first lineNote: if you reconfigure your connector.php settings or changing styles - you must clean your assets dir to take effect.
//you can use any desired dir to install this extension $this->widget('application.widgets.elrtef.elRTE', array( 'model' => $model, 'attribute' => 'text', //'name' => 'text', //'htmlOptions' => array('height' => '600'), 'options' => array( 'doctype'=>'js:\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\'', 'cssClass' => 'el-rte', 'cssfiles' => array('css/elrte-inner.css'), 'absoluteURLs'=>true, 'allowSource' => true, 'lang' => 'ru', 'styleWithCss'=>'', 'height' => 400, 'fmAllow'=>true, //if you want to use Media-manager 'fmOpen'=>'js:function(callback) {$("<div id=\"elfinder\" />").elfinder(%elfopts%);}',//here used placeholder for settings 'toolbar' => 'maxi', ), 'elfoptions' => array( //elfinder options 'url'=>'auto', //if set auto - script tries to connect with native connector 'passkey'=>'mypass', //here passkey from first connector`s line 'lang'=>'ru', 'dialog'=>array('width'=>'900','modal'=>true,'title'=>'Media Manager'), 'closeOnEditorCallback'=>true, 'editorCallback'=>'js:callback' ), ) );
1.2.1
1.2.1 - bugfix by rhertogh
1.2
1.2 - adding jquery.ui loader
1.2 - updated elrte version to 1.3
1.2 - updated efinder version to 1.2
1.1
1.1 - lil bugfixes
1.1 - changed extension structure to easier update
1.1 - updated elrte version to 1.2
1.0
1.0 - initial release
elrtef extension to elrtef-bakelfinder/connectors/php/connector.php with your backup connector copyelrtef-bak directoryYou can try demo on this sites and see available script options too.
Total 20 comments
Hi,
1 - Can you update the extension to use the last version of ELRTEF library? 2 - i dont want set manually the absolute url on connector, i want pass from my view to the component, because the absolute url depending of my server. How i can get the absolute url from Yii and send to editor image path when select image?
Thanks!
Just installed it and set the language option to "en" but it still seems to default to russian. I cleaned the assets directory just in case ... Otherwise, looks great and easy to install - thx!
Hi! Is there any way to upload just regular files, neither images nor flashes? Just a word document.
Thank you!
but this means i'll duplicate the files, is there away to avoid that?
I don`t implemented separate elfinder widget, but other people do it: separate Elfinder widgets
great extension, and it's working, but i need to be able to run elfinder only in some pages without the editor, how?
Hi, great extension, i love it, but i am having a weird problem with it, i included it's intializer code in the _form view and it works greate with the create action, but when using update, it does not show the thumbnails nor the image in the editor nor the file manager, although the both create and update actions using the same _form file, so what is the problem?
@rhertogh Thanx for report. This ext. is very sensitive to JQ and JQUI versions. In my cmf i use JQUI 1.8.5, and I can`t see errors. Thanx for your bugfix.
after installing version 1.2 the dialogs(like the image window) were transparant.
I fixed this in elRTE.php
Line 6 from
to
And line 37 from
to
it's not work
Extension updated to v. 1.2. JQUI included by default Upgraded to elrte 1.3 + elfinder 1.2
Apparently this extension is sensitive to the jQuery version. When I used the version of jQuery included in Yii 1.1.8 everything worked except actually inserting the images into the content. I kept getting errors like "elrte object #<> has no method apply".
The solution is to use the version of jQuery and jQuery UI included with this extension, jquery-1.4.4.min.js and jquery-ui-1.8.7.custom.min.js.
elRTE.php
First make a new js file in the elRTE js folder, something like "protected/extensions/elrtef/elrte/js". You can name it anything you want, I named mine toolbar.js. I created one new panel which is called web2pyPanel. The panel is used in my custom toolbar web2pyToolbar.
toolbar.js
Tell the widget to load your custom toolbar definition.
elRTE.php
Now you can use your custom toolbar name (in my case web2pyToolbar) in the Options property of elRTE.
Previous problem => no jquery UI connected. But now i have a new problem - with file manager - "Invalid server response"
The editor is works fine. But when I pushed a button of File Manager, I've got an error:
Uncaught TypeError: Object [object Object] has no method 'resizable' elFinder.viewelfinder.min.js:1 elFinderelfinder.min.js:1 a.fn.elfinderelfinder.min.js:1 d.d.extend.eachjquery.min.js:16 d.d.fn.d.eachjquery.min.js:16 a.fn.elfinderelfinder.min.js:1 opts.fmOpencreate:29 commandelrte.min.js:148 elRTE.ui.buttons.buttonelrte.min.js:111 d.event.handlejquery.min.js:16 d.event.add.m.k.handle.mjquery.min.js:16
For a beginner, I need to figure out if it is what I think it is...
You should change line 87 of elRTE.php from:
to:
So it could support tabular input like 'model'=>model[$index],'attribute'=>"[$index]text"
$text=CHtml::resolveValue($this->model,$this->attribute); echo $text;
You need to register jquery.ui as well, not just jquery.
Hi,
Found a bug; When one uses this in a create view and the model is empty, CActiveRecord::getAttributes() will not return an array key and value for all attributes (those that aren't set).
The fix is this, at the bottom of elRTE.php:
$cs->registerScript($id,$js,CClientScript::POS_HEAD); echo '<textarea id="'.$id.'" name="'.$name.'" rows="10" cols="40">'; // echo $this->model['attributes'][$this->attribute]; echo $this->model->{$this->attribute}; echo '</textarea>';This asks for CActiveRecord::__get() instead, which returns a value even if its empty.
Leave a comment
Please login to leave your comment.