public function init($content = null) { require_once $this->ckeditor_path . "ckeditor.php"; require_once $this->ckfinder_path . "ckfinder.php"; $ckeditor = new CKEditor(); $ckeditor->returnOutput = true; $ckeditor->basePath = $this->ckeditor_webpath; CKFinder::SetupCKEditor($ckeditor, $this->ckfinder_webpath); //die($this->_content); $contentarea = $ckeditor->editor("editor_content", $content); return $contentarea; }
<textarea name="txtWarranty_offer<?php echo $ln; ?> " cols="80" rows="6" id="txtWarranty_offer<?php echo $ln; ?> "><?php echo $warranty_offer; ?> </textarea> <?php $ckeditor = new CKEditor(); $ckeditor->basePath = 'ckeditor/'; CKFinder::SetupCKEditor($ckeditor, 'ckfinder/'); $ckeditor->replace("txtWarranty_offer" . $ln); ?> </td> </tr> <tr> <td width="15%" class="smallfont" align="right"><?php echo TNOTSHOW; ?> </td> <td width="1%" class="smallfont" align="center"></td> <td width="83%" class="smallfont"> <input type="checkbox" name="chkStatus<?php echo $ln; ?>
$warned = true; } // This is a check for the CKEditor PHP integration file. If not found, the paths must be checked. // Usually you'll not include it in your site and use correct path in line 57 and basePath in line 70 instead. // Remove this code after correcting the include_once statement. if (!@file_exists('../../../ckeditor/ckeditor.php')) { if (@file_exists('../../../ckeditor/ckeditor.js') || @file_exists('../../../ckeditor/ckeditor_source.js')) { printNotFound('CKEditor 3.1+'); } else { printNotFound('CKEditor'); } } include_once '../../../ckeditor/ckeditor.php'; require_once '../../ckfinder.php'; // This is a check for the CKEditor class. If not defined, the paths in lines 57 and 70 must be checked. if (!class_exists('CKEditor')) { printNotFound('CKEditor'); } else { $initialValue = '<p>Just click the <b>Image</b> or <b>Link</b> button, and then <b>"Browse Server"</b>.</p>'; $ckeditor = new CKEditor(); $ckeditor->basePath = '../../../ckeditor/'; // Just call CKFinder::SetupCKEditor before calling editor(), replace() or replaceAll() // in CKEditor. The second parameter (optional), is the path for the // CKFinder installation (default = "/ckfinder/"). CKFinder::SetupCKEditor($ckeditor, '../../'); $ckeditor->editor('CKEditor1', $initialValue); } ?> </body> </html>
<?php include_once "../ckeditor_ckfinder/ckeditor/ckeditor.php"; //引用关键文件 include_once "../ckeditor_ckfinder/ckfinder/ckfinder.php"; //引用关键文件 $initialValue = ''; //编辑区域显示的默认值 $CKEditor = new CKEditor(); //实例化 $CKEditor->basePath = '../ckeditor_ckfinder/ckeditor/'; //设定ckeditor的目录 $CKEditor->config['width'] = 1200; //宽度 $CKEditor->config['height'] = 350; //高度 $config['skin'] = 'office2003'; //kama,office2003,v2 CKFinder::SetupCKEditor($CKEditor, '../ckeditor_ckfinder/ckfinder/'); //定义ckfinder的目录 $CKEditor->editor("content", $initialValue, $config); //建立editor1窗口,editor1的名字,$initialValue默认值,$config设置皮肤
function show_fckeditor($name, $toolbarset = 'Admin', $expand_toolbar = true, $height = "200", $value = "", $width = null) { include_once ROOT_DIR . 'ckeditor/ckeditor_php5.php'; include_once ROOT_DIR . 'ckfinder/ckfinder.php'; $editor = new CKEditor(ROOT_DIR . 'ckeditor'); $editor->config['toolbar'] = $toolbarset; $editor->config['toolbarStartupExpanded'] = $expand_toolbar; $editor->config['height'] = $height; CKFinder::SetupCKEditor($editor, '/ckfinder/'); if ($width) { $editor->config['width'] = $width; } $editor->editor($name, $value); }
<?php require_once $ckEditor; require_once $ckFinder; $oCKeditor = new CKeditor(get_class($model) . '[' . $attribute . ']'); $oCKeditor->basePath = $ckBasePath; if (isset($config) && is_array($config)) { foreach ($config as $key => $value) { $oCKeditor->config[$key] = $value; } } CKFinder::SetupCKEditor($oCKeditor, Yii::app()->request->baseUrl . '/ckfinder/'); $oCKeditor->editor(get_class($model) . '[' . $attribute . ']', $defaultValue);
/** * Tests CKFinder->SetupCKEditor() */ public function testSetupCKEditor() { // TODO Auto-generated CKFinderTest->testSetupCKEditor() $this->markTestIncomplete("SetupCKEditor test not implemented"); $this->cKFinder->SetupCKEditor(); }