<?php require_once $_SERVER['SRVROOT'] . '/cms/admin/config/ini.php'; require_once $_SERVER['SRVROOT'] . FCK . 'fckeditor.php'; // 1. 以正確的絕對路徑 include fckeditor.php 主程式 require_once $_SERVER['SRVROOT'] . '/cms/lib/editor/ckfinder/ckfinder.php'; $oFCKeditor = new FCKeditor('content'); //2. FCKeditor 元件 具現化 new FCKeditor('表單欄位名稱') $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '200px'; $oFCKeditor->BasePath = WEBROOT . FCK; //3.重要參數: 以 url路徑指定 FCKeditor 主程式所在位置 $oFCKeditor->ToolbarSet = 'myBasic'; //載入內容 $oFCKeditor->Value = $content; CKFinder::SetupFCKeditor($oFCKeditor, WEBROOT . '/cms/lib/editor/ckfinder/'); $oFCKeditor->Create(); //4. 執行 Create() 動作完成設計步驟
the "Image" or "Link" icons and then the "<strong>Browse Server</strong>" button.</div> <p> <?php include_once '../../../fckeditor/fckeditor.php'; require_once '../../ckfinder.php'; // This is a check for the FCKeditor class. If not defined, the paths must be checked. if (!class_exists('FCKeditor')) { echo '<br><strong><span class="error">Error</span>: FCKeditor not found</strong>. ' . 'This sample assumes that FCKeditor (not included with CKFinder) is installed in ' . 'the "fckeditor" sibling folder of the CKFinder installation folder. If you have it installed in ' . 'a different place, just edit this file, changing the wrong paths in the include ' . '(line 31) and the "BasePath" values (line 47).'; } else { $fckeditor = new FCKeditor('FCKeditor1'); $fckeditor->BasePath = '../../../fckeditor/'; $fckeditor->Value = '<p>Just click the <b>Image</b> or <b>Link</b> button, and then <b>"Browse Server"</b>.</p>'; // Just call CKFinder::SetupFCKeditor before calling Create() or CreateHtml() // in FCKeditor. The second parameter (optional), is the path for the // CKFinder installation (default = "/ckfinder/"). CKFinder::SetupFCKeditor($fckeditor, '../../'); $fckeditor->Create(); } ?> </p> <div id="footer"> <hr /> <p> CKFinder - Ajax File Manager - <a class="samples" href="http://cksource.com/ckfinder/">http://cksource.com/ckfinder</a> </p> <p id="copy"> Copyright © 2007-2014, <a class="samples" href="http://cksource.com/">CKSource</a> - Frederico Knabben. All rights reserved. </p> </div> </body> </html>
/** * Tests CKFinder->SetupFCKeditor() */ public function testSetupFCKeditor() { // TODO Auto-generated CKFinderTest->testSetupFCKeditor() $this->markTestIncomplete("SetupFCKeditor test not implemented"); $this->cKFinder->SetupFCKeditor(); }