Yii 1.1: ckkceditor

WYSIWYG textarea using CMS ckEditor + kcFinder in one extension
39 followers

Fixed an old ckEditor extension and I added a File Browser to Upload and insert images on any given path. Great for CMS.

Requirements

Yii 1.1 or above)...

Usage

$this->widget('application.extensions.editor.CKkceditor',array(
    "model"=>$model,                # Data-Model
    "attribute"=>'descripcion',         # Attribute in the Data-Model
    "height"=>'400px',
    "width"=>'100%',
    "filespath"=>(!$model->isNewRecord)?Yii::app()->basePath."/../media/paquetes/".$model->idpaquete."/":"",
    "filesurl"=>(!$model->isNewRecord)?Yii::app()->baseUrl."/media/paquetes/".$model->idpaquete."/":"",
    ) 
);

Resources

Total 20 comments

#14979 report it
Crafter at 2013/09/26 03:16am
Add id to element

To add an id attribute to the generated textarea element. in the file ckeditor_php5.php (or ckeditor_php4.php), change the line :

$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";

to

$element_id = str_replace("[", "_", $name);
   $element_id = str_replace("]", "", $element_id);
 
   $out = "<textarea name=\"" . $name . "\" id=\"" . $element_id . "\" " . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
#13487 report it
fouss at 2013/05/31 07:46am
extraPlugins

I find how to insert my own made plugin.. Is there any way to d that?

#10741 report it
Thanasis Fotis at 2012/11/20 03:38pm
KCFinder with CDbHttpSession

I wrote a how-to about syncing the sessions between Yii and KCFinder when using CDbHttpSession

#8631 report it
huanito at 2012/06/14 09:04pm
in reply to #8604

TL;DR: its on github now, see Here

and also click on the link above that says project page...

#8604 report it
WebDevPT at 2012/06/14 02:53am
download missing?

erm what happened to this extension?

#7468 report it
Temir at 2012/03/24 02:27am
yiiframework.com comment editor

I wonder if yii developers who used this editor below on commenting field could share it with us as an extension )

meanwhile, this extension works great except that file browser works only when updating and not when creating post.. so this part:

"filespath"=>(!$model->isNewRecord)?Yii::app()->basePath."/../media/paquetes/".$model->idpaquete."/":"",
    "filesurl"=>(!$model->isNewRecord)?Yii::app()->baseUrl."/media/paquetes/".$model->idpaquete."/":"",
    )

i changed to this:

"filespath"=>Yii::app()->basePath."/../media/paquetes/".$model->idpaquete."/",
    "filesurl"=>Yii::app()->baseUrl."/media/paquetes/".$model->idpaquete."/",
    )

and now it works fine

#7290 report it
barbidurable at 2012/03/10 12:02pm
fire only kcfinder

Hi, is there a way to fire only kcfinder with a button to pick an image and populate a form field by example? Is somebody using this possibility ?

thanks in advance.

#6933 report it
hrrkii at 2012/02/14 10:52am
Basic Toolbar

For anyone trying to figure out how to use the "Basic" toolbar set, add this to your config:

'config' => array('toolbar' => 'Basic'),
#5732 report it
Vedran at 2011/11/07 06:20pm
@yiqing95 KCFinder with CDbHttpSession

I am also thinking about the same solution. I think this might solve the problem. I'll try your advise and post about it here. thanks.

#5729 report it
yiqing95 at 2011/11/07 04:50am
@Vedran session problem ! when use another session saving strategy,may meet some problem

may be i found the solution ,but haven't tried it : please read this doc carefully : http://kcfinder.sunhater.com/docs/integrate

in the kcfinder-2.51\core dir there is a autoload.php file. you should implements your own's SessionSaveHandler , this should be same logic with the yii's CDbHttpSession , so you should read the yii's session table and operate it from the SessionSaveHandler class these two class share the same table , yes may be this is the key!! but i haven't tried it . hope it help you!

#5714 report it
Vedran at 2011/11/06 05:00am
KCFinder with CDbHttpSession

I'm wondering how to use KCFinder with CDbHttpSession?

#4145 report it
marcovtwout at 2011/06/09 03:44am
Re: License

Probably because CKeditor uses GPL/LGPL, see: http://ckeditor.com/license

#3917 report it
Backslider at 2011/05/21 02:07am
License

Why is this licensed under GPL?? Yii is licensed BSD and anything like this should be also.

#3565 report it
Mariaczi+PL at 2011/04/19 08:24am
When update - content doesn't loading

Hi!

Editor is ok, but when I getting UPDATE action, content which should be in editor area, isn't there... why? how to fix this?

#3294 report it
mikeax at 2011/03/31 08:15pm
Trouble displaying editor

I'm sure i am missing something simple but i cannot get editor to display. Elements are created and JS loaded but editor does not display.

I am trying a simple test

$this->widget('application.extensions.editor.CKkceditor',array(
        "model"=>Person::model()->findByPk(2),                # Data-Model
        "attribute"=>'last_name',         # Attribute in the Data-Model
        "height"=>'400px',
        "width"=>'100%',
    "config"=>array(
        'toolbar' => array(
            array('Link','Unlink','Anchor'),
            array('Styles','Format','Font','FontSize'),
            array('TextColor','BGColor'),
            array('Maximize', 'ShowBlocks','-','About')
        )
 
        //"filespath"=>(!$model->isNewRecord)?Yii::app()->basePath."/../media/paquetes/".$model->idpaquete."/":"",
    //"filesurl"=>(!$model->isNewRecord)?Yii::app()->baseUrl."/media/paquetes/".$model->idpaquete."/":"",
    ) ));

One thing i find suspicious is that the text area created does not contain an id attribute

<textarea cols="60" rows="8" name="Person[last_name]" style="display: none;">Nguyen</textarea>
 
<script type="text/javascript">//<![CDATA[
CKEDITOR.replace('Person[last_name]', { "height": "400px", "width": "100%", "toolbar": [ [ "Link", "Unlink", "Anchor" ], [ "Styles", "Format", "Font", "FontSize" ], [ "TextColor", "BGColor" ], [ "Maximize", "ShowBlocks", "-", "About" ] ] });
//]]>
</script>

What am i missing? Any thoughts?

#3229 report it
idrozd at 2011/03/27 10:33pm
Troubles With thaccess, kcfinder breaks site

KCfinder puts htaccess which turns off PHP 8(( Can't understand why does it put it in wrong folder

#3218 report it
xalakox at 2011/03/25 06:30pm
Bugs Fixed

I have fixed the bugs pointed out and switched to github; you can download from there.

#3062 report it
Sarke at 2011/03/11 06:44am
Customizing toolbars

To customize the toolbar, you must use PHP arrays and not a string containing JavaScript arrays. Like so:

'config' => array(
    'toolbar' => array(
        array('BidiLtr', 'BidiRtl' ),
        array('Link','Unlink','Anchor'),
        '/',
        array('Styles','Format','Font','FontSize'),
        array('TextColor','BGColor'),
        array('Maximize', 'ShowBlocks','-','About')
    ),
),

Also, don't for get the bug mentioned by huanito and undsoft.

#3052 report it
undsoft at 2011/03/10 02:14pm
Config problem.

To make config work, change:

line 81 from: $oCKeditor->Config[$key] = $value; to $oCKeditor->config[$key] = $value;

#2974 report it
rebus at 2011/03/04 12:35pm
Toolbar

Toolbar Config not work.

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet