Skip to content

@damusnet /ck.php
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CKEditor Helper for CakePHP v1.3.4
<?php
/**
* Helper CKEditor pour CakePHP v1.3.4
* Code Original par Pierre-Emmanuel Fringant
* URL : http://www.formation-cakephp.com/388/ckeditor-helper
* Modifié par Damien Varron, 09/10/2010
*/
class CkHelper extends AppHelper
{
var $helpers = array('Html', 'Js');
function replace($fieldName, $options = array())
{
$defaults = array(
'customConfig' => '/js/ckeditor/app.config.js',
'loadFinder' => true
);
$options = array_merge($defaults, $options);
$fieldId = $this->domId($fieldName);
$loadFinder = $options['loadFinder'];
unset($options['loadFinder']);
$script = "\tvar ck_$fieldId = CKEDITOR.replace('$fieldId', {$this->Js->object($options)});";
if($loadFinder)
{
$script .= "\n\tCKFinder.setupCKEditor(ck_$fieldId, '/js/ckfinder/');";
}
return $this->Html->scriptBlock($script, array('inline' => false));
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.