<?php
/*--------------------------------------------------------- 
 * File:fckeditor.php
 * Author:Tomix
 * Description: 
 * Created:2009
 * -------------------------------------------------------
 * Modified history:2023/08/23
 * Copyright © 2023 蘋果世界股份有限公司 版權所有
 * -------------------------------------------------------
 */
require_once dirname(__FILE__)."/fckeditor/fckeditor.php";
class fckeditor {
    public $width = "100%";     // 編輯器寬度
    public $height = "300px";   // 編輯器高度
    public $value;              // 編輯器值

    public $instance = null;
    public function __construct($instanceName) {
        $this->instance = new _FCKeditor($instanceName);
        $this->instance->InstanceName = $instanceName;
        $this->instance->BasePath = "/controls/fckeditor/";
        $this->instance->ToolbarSet = "Default";
    }

    public function getContent() {
        $this->instance->Width = $this->width;
        $this->instance->Height = $this->height;
        $this->instance->Value = $this->value;
        return $this->instance->CreateHtml();
    }

    public function render() {
        echo $this->getContent();
    }
}
?>