$ckeditor_basepath = '/assets/js/ckeditor/';
require_once( $_SERVER["DOCUMENT_ROOT"] . $ckeditor_basepath. 'ckeditor.php' );
//if data is an array then extract name else instanceName is $data
$instanceName = ( is_array($data) && isset($data['name']) ) ? $data['name'] : $data;
$ckeditor = new CKEditor();
$ckeditor->Value = html_entity_decode($value);
$initialValue = $value;
$ckeditor->basePath = $ckeditor_basepath;
//session_start();
// $_SESSION['upload_image_file_manager'] = TRUE;
//session_start();
$_SESSION['KCFINDER'] = array();
$_SESSION['KCFINDER']['disabled'] = false;
//todo
if( is_array($data) )
{
}
$config['extraPlugins'] = 'youtube,justify,showblocks,div';
$config['toolbar'] = array(
array('Format', 'Styles', 'Source', 'Maximize', 'ShowBlocks', 'Preview'),
array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'),
array('Find', 'Replace', 'SelectAll', 'SpellChecker', 'Scayt'),
array('Bold', 'Italic', 'Underline', 'Strike', 'RemoveFormat'),
array('NumberedList', 'BulletedList', 'Blockquote', 'CreateDiv', 'JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'),
array('Link', 'Unlink', 'Anchor'),
array('Image','Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar','Iframe','Youtube')
);
//print_r($_SESSION);
return $ckeditor->editor($instanceName, $initialValue, $config);