一、简介
2004年11月30日推出了FCKeditor 2.0 RC1版,据其官方网站称:这是FCKeditor 2.0版的第一个稳定版本。大家现在可以考虑正式使用它了。目前支持的后台语言有ASP、ASP.Net、PHP和ColdFusion。
笔者在经过简单的试用发现,在线编辑器2.0版确实比1.6版有了许多的改进。首先是FCKeditor的文件结构更加清晰,可以更方便地将其部署在自己的系统中。另外2.0版终于支持了Firefox 1.0浏览器,这将为FCKeditor赢得更多的使用者。废话不多说,让我们赶快来学习如何安装、配置FCKeditor 2.0吧。
| /FCKeditor //FCKeditor目录 /UserFiles //上传文件目录 /admin test.php //提交数据页面 testsubmit.php //显示数据页面 进入到FCKeditor目录下,打开_samples目录,里面含有各种编程语言调用FCKeditor的范例程序页面,其中php目录中包含着一些使用PHP来调用FCKeditor的范例,大家可以看一下,了解FCKeditord的调用方法,下面是我简写了一个test.php程序,放在网站根目录下的admin目录中: if($_POST["ADD"]){ $Content=$_POST['EditorDefault']; echo $Content; //变量$Content就是我们在FCKeditord里面编辑的内容,这里可以将其保存到数据库,代码省略。 } |
| //## //## Toolbar Buttons Sets //## FCKConfig.ToolbarSets["Default"] = [ ['Source','-','Save','NewPage','Preview'], ['Cut','Copy','Paste','PasteText','PasteWord','-','Print'], ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'], ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'], ['OrderedList','UnorderedList','-','Outdent','Indent'], ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'], ['Link','Unlink'], ['Image','Table','Rule','SpecialChar','Smiley'], ['Style','FontFormat','FontName','FontSize'], ['TextColor','BGColor'], ['About'] ] ; |
| FCKLanguageManager.AvailableLanguages = { 'ar' : 'Arabic', 'bs' : 'Bosnian', 'ca' : 'Catalan', 'en' : 'English', 'es' : 'Spanish', 'et' : 'Estonian', 'fi' : 'Finnish', 'fr' : 'French', 'gr' : 'Greek', 'he' : 'Hebrew', 'hr' : 'Croatian', 'it' : 'Italian', 'ko' : 'Korean', 'lt' : 'Lithuanian', 'no' : 'Norwegian', 'pl' : 'Polish', 'sr' : 'Serbian (Cyrillic)', 'sr-latn' : 'Serbian (Latin)', 'sv' : 'Swedish' } |
| FCKLanguageManager.AvailableLanguages = { 'ar' : 'Arabic', 'bs' : 'Bosnian', 'ca' : 'Catalan', 'en' : 'English', 'es' : 'Spanish', 'et' : 'Estonian', 'fi' : 'Finnish', 'fr' : 'French', 'gr' : 'Greek', 'he' : 'Hebrew', 'hr' : 'Croatian', 'it' : 'Italian', 'ko' : 'Korean', 'lt' : 'Lithuanian', 'no' : 'Norwegian', 'pl' : 'Polish', 'sr' : 'Serbian (Cyrillic)', 'sr-latn' : 'Serbian (Latin)', 'sv' : 'Swedish', 'zh-cn' : 'Chinese' } |
| //Link Browsing FCKConfig.LinkBrowser = true ; FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/php/connector.php" ; FCKConfig.LinkBrowserWindowWidth = screen.width * 0.7 ; // 70% FCKConfig.LinkBrowserWindowHeight = screen.height * 0.7 ; // 70% //Image Browsing FCKConfig.ImageBrowser = true ; FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php" ; FCKConfig.ImageBrowserWindowWidth = screen.width * 0.7 ; // 70% ; FCKConfig.ImageBrowserWindowHeight = screen.height * 0.7 ; // 70% ; |
| FCKeditoreditorfilemanagerbrowserdefaultconnectorsphpconnector.php // Get the "UserFiles" path. $GLOBALS["UserFilesPath"] = '/UserFiles/' ; |
|
引用值 |
含义 |
|
InstanceName |
实例化编辑器所需的唯一名称 |
|
Width |
编辑器的宽度,单位为象素或者百分比(可选择的,默认为:100%) |
|
Height |
编辑器的高度,单位为象素或者百分比(可选择的,默认为:200) |
|
ToolbarSet |
工具栏的名称(可选择的,默认为:Default) |
|
Value |
编辑器的内容(HTML)初始值(可选择的) |
| $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = '../FCKeditor/' ; $oFCKeditor->ToolbarSet = 'Default' ; $oFCKeditor->InstanceName = 'EditorDefault' ; $oFCKeditor->Width = '100%' ; $oFCKeditor->Height = '400' ; $oFCKeditor->Create() ; |

