Yii Framework Forum: ECLEditor extension - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

ECLEditor extension Bug report & discussion Rate Topic: ***** 2 Votes

#1 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 10 November 2010 - 05:11 PM

Just release this extension. Share your comments, bug reports and suggestions here.

Extension page

4

#2 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 11 November 2010 - 07:01 AM

Pretty good version, much more better approach than mine are easier to use. Didn't thought about extending CInputWidget


Best
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#3 User is offline   thiagovidal 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 147
  • Joined: 17-February 10
  • Location:Brazil, São Paulo

Posted 12 November 2010 - 07:41 AM

View PostAntonio Ramirez, on 11 November 2010 - 07:01 AM, said:

Pretty good version, much more better approach than mine are easier to use. Didn't thought about extending CInputWidget


Best


Oh thanks. Have you developed the other one? I tried to correct to send to developer my version but it was taking to much time so I developed another one.

Buy the way I didn`t have time to see your swfupload review. I will try this weekend.

Best regards

thiagovidal
www.othys.com
0

#4 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,450
  • Joined: 04-October 10

Posted 12 November 2010 - 09:44 AM

View Postthiagovidal, on 12 November 2010 - 07:41 AM, said:


By the way I didn`t have time to see your swfupload review. I will try this weekend.



No problem man! I am really busy, having three projects at this time -and using my free time to go through the forum and learn more -very frekyii

You gave me a good hint and I have reviewed my autocomplete widget.cya
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#5 User is offline   blackjack 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 19-February 11

Posted 21 March 2011 - 03:25 PM

Hi,
have installed this extension and it was really easy to get it run.

But i have no idea how to get out the formatted HTML code and display it in the view.

Code of _form.php:
		<?php echo $form->labelEx($model,'description'); ?>
		<?php $this->widget('application.extensions.cleditor.ECLEditor', array(
            'model'=>$model,
            'attribute'=>'description', //Model attribute name. Nome do atributo do modelo.
            'options'=>array(
                'width'=>'500',
                'height'=>250,
                'useCSS'=>false,
            'controls'=>     // controls to add to the toolbar
                  "bold italic | removeformat | bullets numbering | outdent " .
                  "indent | alignleft center alignright justify | undo redo | " .
                  "rule image link unlink | cut copy paste pastetext | print source",
            'colors'=>       // colors in the color popup
                  "",
            'fonts'=>        // font names in the font popup
                  "Arial,Arial Black,Comic Sans MS,Courier New,Narrow,Garamond," .
                  "Georgia,Impact,Sans Serif,Serif,Tahoma,Trebuchet MS,Verdana",
            'sizes'=>        // sizes in the font size popup
                  "1,2,3,4,5,6,7",
            'styles'=>       // styles in the style popup
                  array(
                    array("Paragraph", "<p>"),
                    array("Header 1", "<h1>"),
                    array("Header 2", "<h2>"),
                    array("Header 3", "<h3>"),
                    array("Header 4","<h4>"),
                    array("Header 5","<h5>"),
                    array("Header 6","<h6>")
                  ),
            'docType'=>      // Document type contained within the editor
                  '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
            'docCSSFile'=>   // CSS file used to style the document contained within the editor
                 "",
            'bodyStyle'=>    // style to assign to document body contained within the editor
                 "margin:4px; font:10pt Arial,Verdana; cursor:text"

            ),
            'value'=>$model->description, //If you want pass a value for the widget. I think you will. Se você precisar passar um valor para o gadget. Eu acho irá.
          )); ?>



Code of _view.php:
<?php echo CHtml::encode($data->getAttributeLabel('description')); ?>:

????

Could someone help me out?
THX
BJ
0

#6 User is offline   Jgsaw 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 01-March 11

Posted 03 August 2011 - 08:38 AM

Hi BJ,

What is it outputting? Im guessing its displaying the HTML? I think you just want to output the contents directly as its already in html

i.e.

<?php echo $data->attributeName; ?>

0

#7 User is offline   Jgsaw 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 01-March 11

Posted 03 August 2011 - 09:11 AM

Ive added the following to incorporate plugins and minified js in my version which may or may not benefit you. Posting here in case you want it!

in ECLEditor (or extended class if you wish as below)

Note: i had to change the ECLEditor->publishAssets() from being a static method to being an instance method. Not sure why it is static but there may be some reason im missing.

<?php

require_once('ECLEditor.php');

class ECLEditorExt extends ECLEditor {
	
    public $useMin = true;
	
    public $plugins = array();
	
    protected function publishAssets()
    {
        $minId = $this->useMin ? '.min' : '';
		
        $assets=dirname(__FILE__).'/assets';
        $baseUrl=Yii::app()->assetManager->publish($assets);
        if(is_dir($assets)){
            Yii::app()->clientScript->registerCoreScript('jquery');
            Yii::app()->clientScript->registerScriptFile($baseUrl."/jquery.cleditor$minId.js",CClientScript::POS_HEAD);
			
            foreach ($this->plugins as $plugin) {
                $pluginId = ".$plugin";
                Yii::app()->clientScript->registerScriptFile($baseUrl."/jquery.cleditor$pluginId$minId.js",CClientScript::POS_HEAD);
            }

        Yii::app()->clientScript->registerCssFile($baseUrl.'/jquery.cleditor.css');			
        } else {
            throw new Exception('EClEditor - Error: Couldn\'t find assets to publish.');
        }
    }
}



Then in your view

$this->widget('application.extensions.cleditor.ECLEditorExt', array(
    'model'=>$model,
    'attribute'=>'comment', //Model attribute name.
    'useMin'=>true,
    'plugins'=>array('xhtml', 'icon'),
    'options'=>array(
        ....
    ),
    'value'=>'',
));


Then just drop the available plugins into the extensions/cleditor/assets and as long as they maintain the naming conventions they currently have e.g. jquery.cleditor.<pluginname>.js or jquery.cleditor.<pluginname>.min.js it should work.

Hope this benefits someone somewhere!

Ta
Ross
0

#8 User is offline   Lensi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 23-March 11

Posted 07 September 2011 - 05:53 AM

You can't put more than one of these per page.
0

#9 User is offline   zastava 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 06-March 12

Posted 06 March 2012 - 08:02 AM

hi, thanks for your great extension!
everything is working fine so far with me, but now I want users to be able to embed YouTube and Vimeo videos.
How would that be possible?

Thanks,
zastava
1

#10 User is offline   WebDevPT 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 06-February 12
  • Location:Portugal

Posted 09 March 2012 - 05:14 AM

View Postzastava, on 06 March 2012 - 08:02 AM, said:

hi, thanks for your great extension!
everything is working fine so far with me, but now I want users to be able to embed YouTube and Vimeo videos.
How would that be possible?

Thanks,
zastava



Hi i have the same question.

How can we use this extension to include youtube, vimeo, etc videos?

I know that Yii cleans the code for security reasons and iframe and objects are cleared out of the way, but how can we use videos without compromising security?

I know that yiitube works, but lets say i'm building a blog, and i want to include videos on my posts, i need this to be dynamic. Any ideas?
0

#11 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 17 April 2012 - 10:03 PM

View PostJgsaw, on 03 August 2011 - 08:38 AM, said:

Hi BJ,

What is it outputting? Im guessing its displaying the HTML? I think you just want to output the contents directly as its already in html

i.e.

<?php echo $data->attributeName; ?>




This one is still not working... still out put HTML like <xxx>..</xxx>, any ideas?
0

#12 User is offline   dunghoi0208@gmail.com 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 17-April 12

Posted 13 May 2012 - 11:12 AM

Hi all !
i have a question? how to user choose a picture from their compute when user click 'Insert image' in ECLEditor? (not use img url)
thanks all!
0

#13 User is offline   jiaming 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 262
  • Joined: 10-April 12

Posted 27 September 2012 - 11:40 AM

Dear all,

I am using Cleditor in a form and i rendered this same form as a fast reply in my other view(It's like multiple blogs in the same page and you can reply it without clicking and opening it).

However, i realized that if i use Cleditor for the same model multiple times at the same page, only the first field will change to CLeditor, others will still remain text area..

Any ideas would be appreciated.

My form.php view:

I am rendering the _form multiple times.

<?php $this->renderPartial('/reply/_form',array(          
  'model'=>$reply,           
 'answer'=>$answer,       
 )); ?>


code in _form.php:

 <div class="form" style="margin-bottom:-15px;">  
<?php $form=$this->beginWidget('application.extensions.ActiveForm', array( 	'id'=>'reply-form', 	'enableAjaxValidation'=>false,         'disableAfterSubmit'=>true,         'disableText'=>'Processing…',         'disableCssClass'=>'btn btn-large btn-success',         'htmlOptions'=>array('enctype'=>'multipart/form-data'), )); ?>  	
<?php echo $form->errorSummary($model); ?>  	
<div class="row"> 		
<?php echo $form->labelEx($model,'description',array('label'=>'Reply')); ?>  
<?php $this->widget('ext.cleditor.ECLEditor', array(
                        'model'=>$model,
                        'attribute'=>'description',
                        'options'=>array(
                                'width'=>500,
                                'height'=>320,
                                'useCSS'=>true,
                        ),
                        'value'=>$model->description,
                ));
 
                ?>	</div>  
......
.....
</div><!-- form -->

0

#14 User is offline   rooney10 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 29-August 12

Posted 24 October 2012 - 11:40 AM

Hey guys,

just integrated the extension into my project but when I want to display the editor I only get a textarea without any controls. This happens when I use the method with a model explained at the extension site:

My code:
$this->widget('ext.cleditor.ECLEditor', array(
        'model'=>$texts,
        'attribute'=>'display_value', //Model attribute name.
        'options'=>array(
            'width'=>900,
            'height'=>250,
            'useCSS'=>true,
        ),
        'value'=>$texts->display_value, //If you want pass a value for the widget. I think you will.
    ));


The "simple usage" does work allthough. Does anyone have an idea where the problem is?

Thx in advance :)
0

#15 User is offline   rooney10 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 29-August 12

Posted 24 October 2012 - 11:45 AM

Ok figured out what the problem was. I had an input field with the same attribute before I used the widget. After I got rid of the other input field, it worked :)


View Postrooney10, on 24 October 2012 - 11:40 AM, said:

Hey guys,

just integrated the extension into my project but when I want to display the editor I only get a textarea without any controls. This happens when I use the method with a model explained at the extension site:

My code:
$this->widget('ext.cleditor.ECLEditor', array(
        'model'=>$texts,
        'attribute'=>'display_value', //Model attribute name.
        'options'=>array(
            'width'=>900,
            'height'=>250,
            'useCSS'=>true,
        ),
        'value'=>$texts->display_value, //If you want pass a value for the widget. I think you will.
    ));


The "simple usage" does work allthough. Does anyone have an idea where the problem is?

Thx in advance :)

0

#16 User is offline   Eder Lima 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 24-August 11

Posted 15 August 2014 - 01:15 PM

tem como ocultar o botao de exibir o coidgo html?
nao gostaria que o usuario pudesse editar em html.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users