Yii Framework Forum: [EXTENSION] editMe - Yii Framework Forum

Jump to content

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] editMe WYSIWYG editor based on CKEditor Rate Topic: ***** 1 Votes

#21 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 10 May 2012 - 04:50 PM

Amazing!!! thanks a lot, its going to be included in the next update

View PostBStep, on 05 April 2012 - 10:20 AM, said:

I tracked down the problem. This is probably the best explanation:

http://stackoverflow...t-from-ckeditor

0

#22 User is offline   fonis 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 22-March 12

Posted 24 August 2012 - 12:17 PM

hey, how do i get rid of/hide the elements path down in the bottom of the editor area?
0

#23 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 27 August 2012 - 10:49 AM

hey fonis

as of version 1.2.2 this is not possible, i left the elements path at the bottom since it can be a helpful tool. I have however already created a ticket and will address this issue in the next editMe version which is already under development.

View Postfonis, on 24 August 2012 - 12:17 PM, said:

hey, how do i get rid of/hide the elements path down in the bottom of the editor area?

0

#24 User is offline   fonis 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 22-March 12

Posted 28 August 2012 - 05:56 AM

thank you for the answer.

can you tell a little more about when the next update will come, or is it to far ahead in the future to tell?
0

#25 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 30 August 2012 - 06:27 PM

youre welcome

it should be done in the next couple weeks, i will post an update in this topic when it is ready

View Postfonis, on 28 August 2012 - 05:56 AM, said:

thank you for the answer.

can you tell a little more about when the next update will come, or is it to far ahead in the future to tell?

0

#26 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 10 September 2012 - 10:17 AM

New version available. See the Changelog for a list of changes, bugfixes and improvements.
0

#27 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 10 September 2012 - 10:29 AM

This has been fixed in version 2.0

View PostKyleVan, on 28 August 2011 - 09:12 PM, said:

I love this extension however it wont save the results put into the editor.

Here is my code....

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'content-form',
'enableAjaxValidation'=>false,
)); ?>

<p class="note">Fields with <span class="required">*</span> are required.</p>

<?php echo $form->errorSummary($model); ?>

<div class="row">
<?php echo $form->labelEx($model,'content_title'); ?>
<?php echo $form->textField($model,'content_title',array('size'=>60,'maxlength'=>80)); ?>
<?php echo $form->error($model,'content_title'); ?>
</div>

<div class="row">
<?php echo $form->labelEx($model,'content_text'); ?>
<?php $this->widget('ext.editMe.ExtEditMe', array(
'model'=>$model,
'attribute'=>'content_text',
));?>
<?php echo $form->error($model,'content_text'); ?>
</div>

<div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
</div>


<?php $this->endWidget(); ?>

</div><!-- form -->

It populates with the data so I know its linked up right, but changes are not saved.



View PostSampa, on 29 February 2012 - 08:25 AM, said:

http://pastebin.com/CgcWDVKe
I have the same problem Kyle_van had above, $_POST['message'] stays at 0 always.

It seems to have some random errors when ajax is used to display it



View PostBStep, on 04 April 2012 - 03:06 PM, said:

I have the same problem KyleVan had where data would not submit to the web server from the widget. Unfortunately he never replied and said how he fixed it, so I have to bug everyone about it again. Any idea what I could be doing wrong?

When I look at the POST data submitted, text is always blank. Calling serialize() on the form within the JS console returns the POST string, and the text variable is blank. serialize() is what I'm using to create the POST string before submitting. Thanks!

_form.php (loaded via ajax)
<?php 
$form=$this->beginWidget('CActiveForm', array(
	'id'=>'note-form',
	'enableAjaxValidation'=>false,
	'action'=>$model->isNewRecord ? Yii::app()->createUrl('/note/ajaxcreate') : Yii::app()->createUrl('/note/ajaxupdate/'.$model->id)
));

$this->widget('ext.editMe.ExtEditMe', array(
        'model'=>$model,
        'attribute'=>'text',
        'width'=>'460',
        'height'=>'250',
        'toolbar'=>array(
            array(
                'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 
            ),
            array(
                'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote',
                '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock',
            ),
            array(
                'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', 
            ),
            array(
                'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'
            ),
        )
));
$this->endWidget();
?>




View PostSina Aghasi, on 10 May 2012 - 08:59 AM, said:

How apply this solution to EditMe?

0

#28 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 10 September 2012 - 10:35 AM

the following example removes the elements path. this feature has been added in editMe 2.0

$this->widget('ext.editMe.widgets.ExtEditMe', array(
	'name'=>'example',
	'value'=>'',
	'ckeConfig'=>array('removePlugins'=>'elementspath'),
));


View Postfonis, on 24 August 2012 - 12:17 PM, said:

hey, how do i get rid of/hide the elements path down in the bottom of the editor area?

0

#29 User is offline   Deram 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 07-June 12

Posted 29 September 2012 - 06:18 AM

Awesome, thanks for making it possible to remove the elements path :)

By the way, if i put a maximum of characters a person can type in a text field as a rule in the model, say 300 characters, is it possible to have a "counter" on how many characters you have left showed above/besides the text editor?
0

#30 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 03 October 2012 - 10:10 AM

ure very welcome :)

yes this is possible but will not be implemented by the extension itself to keep editMe as slim as possible :)

but im sure it wont be too hard to code something like this urself or at least find some good example somewhere...

View PostDeram, on 29 September 2012 - 06:18 AM, said:

Awesome, thanks for making it possible to remove the elements path :)

By the way, if i put a maximum of characters a person can type in a text field as a rule in the model, say 300 characters, is it possible to have a "counter" on how many characters you have left showed above/besides the text editor?

0

#31 User is offline   sn4k3 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 08-December 10

Posted 21 October 2012 - 07:16 PM

Im getting a problem with it,
I was using older version, on upgrade it stop working because some error in JS

Error:
Uncaught TypeError: Object [object Object] has no method 'ckeditor' 


Line 222:
jQuery('#Gametype_description').ckeditor({'toolbar':[['Source','-','NewPage','DocProps','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo'],['Find','Replace','-','SelectAll','-','SpellChecker','Scayt'],'/',['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat'],['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','BidiLtr','BidiRtl'],['Link','Unlink','Anchor'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']],'forcePasteAsPlainText':true,'extraPlugins':'','removeDialogTabs':'','contentsCss':['/yii/skilltournament/assets/9a506277/contents.css'],'resize_enabled':true,'resize_dir':'both','autoGrow_onStartup':false,'language':'','baseHref':'','bodyClass':'','bodyId':'','docType':'<!DOCTYPE html>','filebrowserBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html','filebrowserFlashBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html?Type=Flash','filebrowserImageBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html?Type=Images','filebrowserFlashUploadUrl':'/yii/skilltournament/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash','filebrowserUploadUrl':'','filebrowserImageBrowseLinkUrl':'','filebrowserImageUploadUrl':'/yii/skilltournament/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images','fullPage':false,'height':200,'width':'','uiColor':'','disableNativeSpellChecker':false,'autoUpdateElement':true});
Uncaught TypeError: Object [object Object] has no method 'ckeditor'


Source Code:
<?php
	echo $form->labelEx($model,'description');
    $this->widget('ext.editMe.widgets.ExtEditMe', array(
        'model'=>$model,
        'attribute'=>'description',
		'resizeMode'=>'both',
        'htmlOptions'=>array('maxlength'=>65535, 'class'=>'validate[required,minSize[5],maxSize[65535]]'),
        'toolbar'=>
                array( 
                    array(
                        'Source', '-', /*'Save',*/ 'NewPage', 'DocProps', 'Preview', /*'Print',*/ '-', 'Templates', 
                    ), 
                    array(
                        'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', 
                    ), 
                    array(
                        'Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'
                    ),
                    /*array(
                        'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'
                    ),*/ 
                    '/', 
                    array(
                        'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 
                    ), 
                    array(
                        'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'BidiLtr', 'BidiRtl', 
                    ), 
                    array(
                        'Link', 'Unlink', 'Anchor', 
                    ), 
                    array(
                        'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'
                    ), 
                    '/',
                    array(
                        'Styles', 'Format', 'Font', 'FontSize', 
                    ), 
                    array(
                        'TextColor', 'BGColor', 
                    ), 
                    array(
                        'Maximize', 'ShowBlocks', '-', 'About', 
                    ), 
                ),
        'filebrowserBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html',
        'filebrowserImageBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html?Type=Images',
        'filebrowserFlashBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html?Type=Flash',

        'filebrowserImageUploadUrl'=>BASEURL.'/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
        'filebrowserFlashUploadUrl'=>BASEURL.'/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',

    ));
    ?>


Thanks in advance
0

#32 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 24 October 2012 - 02:23 PM

hmm seems like the jQuery adapter wasn't loaded...

what does your html <head></head> section look like on that specific page? is there any php errors ? any entries in the yii application log?

have you already deleted the contents of your assets folder? this shouldnt be a problem since editMe should be republished based on the path mtime but one can try anyways...

View Postsn4k3, on 21 October 2012 - 07:16 PM, said:

Im getting a problem with it,
I was using older version, on upgrade it stop working because some error in JS

Error:
Uncaught TypeError: Object [object Object] has no method 'ckeditor' 


Line 222:
jQuery('#Gametype_description').ckeditor({'toolbar':[['Source','-','NewPage','DocProps','Preview','-','Templates'],['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo'],['Find','Replace','-','SelectAll','-','SpellChecker','Scayt'],'/',['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat'],['NumberedList','BulletedList','-','Outdent','Indent','-','Blockquote','CreateDiv','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock','BidiLtr','BidiRtl'],['Link','Unlink','Anchor'],['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak','Iframe'],'/',['Styles','Format','Font','FontSize'],['TextColor','BGColor'],['Maximize','ShowBlocks','-','About']],'forcePasteAsPlainText':true,'extraPlugins':'','removeDialogTabs':'','contentsCss':['/yii/skilltournament/assets/9a506277/contents.css'],'resize_enabled':true,'resize_dir':'both','autoGrow_onStartup':false,'language':'','baseHref':'','bodyClass':'','bodyId':'','docType':'<!DOCTYPE html>','filebrowserBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html','filebrowserFlashBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html?Type=Flash','filebrowserImageBrowseUrl':'/yii/skilltournament/resources/js/ckfinder/ckfinder.html?Type=Images','filebrowserFlashUploadUrl':'/yii/skilltournament/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash','filebrowserUploadUrl':'','filebrowserImageBrowseLinkUrl':'','filebrowserImageUploadUrl':'/yii/skilltournament/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images','fullPage':false,'height':200,'width':'','uiColor':'','disableNativeSpellChecker':false,'autoUpdateElement':true});
Uncaught TypeError: Object [object Object] has no method 'ckeditor'


Source Code:
<?php
	echo $form->labelEx($model,'description');
    $this->widget('ext.editMe.widgets.ExtEditMe', array(
        'model'=>$model,
        'attribute'=>'description',
		'resizeMode'=>'both',
        'htmlOptions'=>array('maxlength'=>65535, 'class'=>'validate[required,minSize[5],maxSize[65535]]'),
        'toolbar'=>
                array( 
                    array(
                        'Source', '-', /*'Save',*/ 'NewPage', 'DocProps', 'Preview', /*'Print',*/ '-', 'Templates', 
                    ), 
                    array(
                        'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo', 
                    ), 
                    array(
                        'Find', 'Replace', '-', 'SelectAll', '-', 'SpellChecker', 'Scayt'
                    ),
                    /*array(
                        'Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'
                    ),*/ 
                    '/', 
                    array(
                        'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat', 
                    ), 
                    array(
                        'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', 'BidiLtr', 'BidiRtl', 
                    ), 
                    array(
                        'Link', 'Unlink', 'Anchor', 
                    ), 
                    array(
                        'Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'
                    ), 
                    '/',
                    array(
                        'Styles', 'Format', 'Font', 'FontSize', 
                    ), 
                    array(
                        'TextColor', 'BGColor', 
                    ), 
                    array(
                        'Maximize', 'ShowBlocks', '-', 'About', 
                    ), 
                ),
        'filebrowserBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html',
        'filebrowserImageBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html?Type=Images',
        'filebrowserFlashBrowseUrl'=>BASEURL.'/resources/js/ckfinder/ckfinder.html?Type=Flash',

        'filebrowserImageUploadUrl'=>BASEURL.'/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
        'filebrowserFlashUploadUrl'=>BASEURL.'/resources/js/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',

    ));
    ?>


Thanks in advance

0

#33 User is offline   sn4k3 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 08-December 10

Posted 24 October 2012 - 02:47 PM

View PostTeamTPG, on 24 October 2012 - 02:23 PM, said:

hmm seems like the jQuery adapter wasn't loaded...

what does your html <head></head> section look like on that specific page? is there any php errors ? any entries in the yii application log?

have you already deleted the contents of your assets folder? this shouldnt be a problem since editMe should be republished based on the path mtime but one can try anyways...


Jquery is loaded, no php errors or js errors except that.
Yes i tried...

it says ckeditor doesn't exists, i checked in chrome console, and is a fact, object.ckeditor not exists.
CKEDITOR and CKEDITOR_BASEPATH shows and work, but CKEDITOR != object.ckeditor()

it work in last version 1.x

heres my <head>

<head>
	<script type="text/javascript" src="//www.google.com/jsapi"></script><script type="text/javascript">
/*<![CDATA[*/
google.load("jquery","1");
google.load("jqueryui","1");
/*]]>*/
</script>	<meta charset="utf-8">
	<meta name="noindex" content="robots" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/jquery-ui-bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii/themes/default/css/application.css" />
<link rel="stylesheet" type="text/css" href="/yii/resources/css/jquery/validation/validationEngine.jquery.css" />
<script type="text/javascript" src="/yii/assets/17d84b63/js/bootstrap.bootbox.min.js"></script>
<script type="text/javascript" src="/yii/assets/17d84b63/js/bootstrap.js"></script>
<script type="text/javascript" src="/yii/assets/9a506277/5db8134c4f58c1847e80e78fe3074d9f.js"></script>
<script type="text/javascript" src="/yii/assets/9a506277/ckeditor.js"></script>
<title>Create Gametype</title>

	<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
</head>


Thanks
0

#34 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 25 October 2012 - 07:08 AM

yes, jquery is loaded, but there is another file (the editMe jquery adapter) which should get loaded as well, but it is not because 'jquery.js' is probably defined inside Yii::app() -> clientScript -> scriptMap and the editMe jquery adapter's filename is 'jquery.js' so it gets excluded accidentally..

please try to add this before you load editMe (before $this->widget()):
$oldScriptMap = Yii::app() -> clientScript -> scriptMap;
Yii::app() -> clientScript -> scriptMap = array();


and this after your editMe widget call
Yii::app() -> clientScript -> scriptMap = $oldScriptMap;


please report back if this is working so i can add a fix for the next version... thank you very much

View Postsn4k3, on 24 October 2012 - 02:47 PM, said:

Jquery is loaded, no php errors or js errors except that.
Yes i tried...

it says ckeditor doesn't exists, i checked in chrome console, and is a fact, object.ckeditor not exists.
CKEDITOR and CKEDITOR_BASEPATH shows and work, but CKEDITOR != object.ckeditor()

it work in last version 1.x

heres my <head>

<head>
	<script type="text/javascript" src="//www.google.com/jsapi"></script><script type="text/javascript">
/*<![CDATA[*/
google.load("jquery","1");
google.load("jqueryui","1");
/*]]>*/
</script>	<meta charset="utf-8">
	<meta name="noindex" content="robots" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/bootstrap-yii.css" />
<link rel="stylesheet" type="text/css" href="/yii/assets/17d84b63/css/jquery-ui-bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/yii/themes/default/css/application.css" />
<link rel="stylesheet" type="text/css" href="/yii/resources/css/jquery/validation/validationEngine.jquery.css" />
<script type="text/javascript" src="/yii/assets/17d84b63/js/bootstrap.bootbox.min.js"></script>
<script type="text/javascript" src="/yii/assets/17d84b63/js/bootstrap.js"></script>
<script type="text/javascript" src="/yii/assets/9a506277/5db8134c4f58c1847e80e78fe3074d9f.js"></script>
<script type="text/javascript" src="/yii/assets/9a506277/ckeditor.js"></script>
<title>Create Gametype</title>

	<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
</head>


Thanks

0

#35 User is offline   sn4k3 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 73
  • Joined: 08-December 10

Posted 25 October 2012 - 03:02 PM

Hi,

i have try your solution:

	$oldScriptMap = Yii::app()->clientScript->scriptMap;
	Yii::app()->clientScript->scriptMap = array();
	
	echo $form->labelEx($model,'description');
    $this->widget('ext.editMe.widgets.ExtEditMe', array(
...
...


But still not working, adapter not get included.
After that i tried include manual and it works!

<script type="text/javascript" src="/yii/skill/assets/9a506277/adapters/jquery.js"></script>


any fast solution?
0

#36 User is offline   Giacomo 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 03-October 12

Posted 29 October 2012 - 11:54 AM

Hi! Thank you very much for this great extension B)
I wrote 2 questions in the extension page, can anyone take a look and let me know if/how is possible to solve them?
thanks in advance
0

#37 User is offline   fonis 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 55
  • Joined: 22-March 12

Posted 31 October 2012 - 11:23 AM

This might seem like a silly question, but since i'm not that good at server side scripting, i'm going to ask anyway. Is there a way to make the option of linking to an image on another side work without giving the user a way to do some hacking with it? I mean, he can just post the a php script to something (probably something bad) on another side that executes instead, right? so, how to prevent this from happening?
0

#38 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 01 November 2012 - 12:13 PM

sorry the code samples i gave you had a little error

try to NOT add this after loading editMe
Yii::app() -> clientScript -> scriptMap = $oldScriptMap;


even if this doesn't work, im pretty confident that a scriptMap remap is excluding the jquery.js adapter somewhere inside your code.

one of the fixes would be to load jquery from Yii and not from googles CDN and remove any occurrences of this in your code:
Yii::app() -> clientScript -> scriptMap['jquery.js'] = false;


i will probably have to rename the jquery adapter for ckeditor in the next version to not cause this naming conflict with yii's scriptMap...

View Postsn4k3, on 25 October 2012 - 03:02 PM, said:

Hi,

i have try your solution:

	$oldScriptMap = Yii::app()->clientScript->scriptMap;
	Yii::app()->clientScript->scriptMap = array();
	
	echo $form->labelEx($model,'description');
    $this->widget('ext.editMe.widgets.ExtEditMe', array(
...
...


But still not working, adapter not get included.
After that i tried include manual and it works!

<script type="text/javascript" src="/yii/skill/assets/9a506277/adapters/jquery.js"></script>


any fast solution?

0

#39 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 01 November 2012 - 12:17 PM

hey fonis

the best way to do this (as far as i know) is to use a html sanitizer like HTMLPurifier. HTMLPurifier is included inside Yii: http://www.yiiframew...1/CHtmlPurifier

You are probably looking for following option:
http://htmlpurifier....ternalResources

View Postfonis, on 31 October 2012 - 11:23 AM, said:

This might seem like a silly question, but since i'm not that good at server side scripting, i'm going to ask anyway. Is there a way to make the option of linking to an image on another side work without giving the user a way to do some hacking with it? I mean, he can just post the a php script to something (probably something bad) on another side that executes instead, right? so, how to prevent this from happening?

0

#40 User is offline   limitless 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 120
  • Joined: 22-July 11

Posted 01 November 2012 - 12:21 PM

Thank you very much for the appreciation :)

I will have a look in the next days

View PostGiacomo, on 29 October 2012 - 11:54 AM, said:

Hi! Thank you very much for this great extension B)
I wrote 2 questions in the extension page, can anyone take a look and let me know if/how is possible to solve them?
thanks in advance

0

Share this topic:


  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • 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