Topic: CKeditor: Add new plugins
Hello,
how can i add new ckeditor plugins: config.extraPlugins = 'youtube'; ?
function cn_snippet_ckeditor($ids = '')
{
// pre-init
$CKSmiles = $CKBar = array();
for ($i = 1; $i <= 8; $i++)
{
$ck_bar = getoption("ck_ln{$i}");
if ($ck_bar) $CKBar[] = '["'.join('","', explode(',', cn_htmlspecialchars($ck_bar))).'"]';
}
$smiles = explode(',', getoption('smilies'));
foreach ($smiles as $smile) $CKSmiles[] = "'$smile.gif'";
$CKSmiles = join(', ', $CKSmiles);
$CKBar = join(', ', $CKBar);
// show
echo '<script src="'.getoption('http_script_dir').'/core/ckeditor/ckeditor.js"></script>';
echo '<script type="text/javascript">'."\n";
echo "(function() { var settings = {"."\n";
echo "skin: 'moono', width: 'auto', height: 350, customConfig: '', language: 'en', entities_latin: false, entities_greek: false, \n";
echo "toolbar: [ ". hook('settings/CKEDITOR_customize', $CKBar) . " ], \n";
$add_opt = array();
$compound = array();
$add_opt['filebrowserBrowseUrl'] = PHP_SELF.'?mod=media&opt=inline';
$add_opt['filebrowserImageBrowseUrl'] = PHP_SELF.'?mod=media&opt=inline';
$add_opt = hook('settings/CKEDITOR_filemanager', $add_opt);
foreach ($add_opt as $I => $V) $compound[] = "$I: \"$V\"";
// Insert updated FileBrowser
echo join(', ', $compound) . '};' . "\n";
// Smilies
echo 'CKEDITOR.config.smiley_path = "'.getoption('http_script_dir').'/skins/emoticons/"; '."\n";
echo 'CKEDITOR.config.smiley_images = [ '.hook('settings/CKEDITOR_emoticons', $CKSmiles).' ];'."\n";
echo 'CKEDITOR.config.smiley_descriptions = [];'."\n";
echo "CKEDITOR.config.allowedContent = true;";
echo 'CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;';
$ids = spsep($ids);
foreach ($ids as $id) echo "CKEDITOR.replace( '".trim($id)."', ".hook('settings/CKEDITOR_SetsName', 'settings')." );"."\n";
echo hook('settings/CKEDITOR_Settings');
echo '})(); </script>';
}