|
来源:http://trac.seagullproject.org/wiki/Howto/Templates/IntegrateWYSIWYG 使用一个文本块WYSIWIG编辑器要集成所见即所得编辑器(标准是TinyFCK,它集合了大多数最佳的所见即所得编辑器)你必须: 在Seagull模块中在Mgr类的行为方法中在你想使用所见即所得编辑器的类方法中,你只需告诉Seagull你要使用它。 // enable hmtl wysiwyg editor $output->wysiwyg = true; 这包含了你的输出所必须的JavaScript脚本。 在模板中所有class属性值为wysiwyg的文本块将被所见即所得编辑器替换。这样你可以在一个页面有多个编辑器: <textarea name="frmBodyName" id="frmBodyName" class="wysiwyg">{event.text}</textarea>
在Mgr类validation方法中想知道为什么没给validation传递HTML?为了安全起见Seagull自动剥去了所有的HTML代码。有一种方法可以改变这种情况:在$req→get中使用 $allowTags = true $input->event = (object)$req->get('frmBodyName', $allowTags = true);
集成文件连接器如果你想更新TinyFCK,你可以这样集成它: 你必须告诉php连接器在什么地方找到图像。编辑ww/tinyfck/filemanager/connectors/php/config.php <?php include '../../../../../lib/SGL/FrontController.php'; SGL_FrontController::init(); session_start(); [...] global $Config ; // SECURITY: You must explicitelly enable this "connector". (Set it to "true"). $Config['Enabled'] = true ; // Path to user files relative to the document root. $Config['UserFilesPath'] = SGL_BASE_URL . '/images/' ; // Fill the following value it you prefer to specify the absolute path for the // user files directory. Usefull if you are using a virtual directory, symbolic // link or alias. Examples: 'C:\\MySite\\UserFiles\\' or '/root/mysite/UserFiles/'. // Attention: The above 'UserFilesPath' must point to the same directory. $Config['UserFilesAbsolutePath'] = SGL_WEB_ROOT.'/images/'; [...] ?> 配置TinyFCK你可以在这里找到配置文件: /www/js/SglTinyFckConfig.js。更多使用这个文件的参考资料请看TinyMCE文档 |