4 * FCKeditor is compatible with most internet browsers which
5 * include: IE 5.5+ (Windows), Firefox 1.0+, Mozilla 1.3+
8 * Download: http://fckeditor.net/
9 * Suggested installation into themes/default/FCKeditor/
10 * or the default /FCKeditor/. See $this->BasePath below.
12 * @package WysiwygEdit
16 require_once("lib/WysiwygEdit.php");
18 class WysiwygEdit_FCKeditor extends WysiwygEdit {
20 function WysiwygEdit_FCKeditor() {
22 $this->_transformer_tags = false;
23 $this->BasePath = DATA_PATH.'/themes/default/FCKeditor/';
24 $this->_htmltextid = "edit-content"; // FCKEditor1;
25 $this->_wikitextid = "editareawiki";
27 oFCKeditor.BasePath = '$this->BasePath';
28 oFCKeditor.Height = 300;
29 // oFCKeditor.ToolbarSet = 'Basic' ;
30 oFCKeditor.Config.DefaultLanguage = '$LANG';
31 oFCKeditor.Config.LinkBrowserURL = oFCKeditor.BasePath + 'editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php';
32 oFCKeditor.Config.ImageBrowserURL = oFCKeditor.BasePath + 'editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php';
34 if (!empty($_REQUEST['start_debug']))
35 $this->_jsdefault = "\noFCKeditor.Config.Debug = true;";
38 function Head($name='edit[content]') {
40 $WikiTheme->addMoreHeaders
41 (Javascript('', array('src' => $this->BasePath . 'fckeditor.js',
42 'language' => 'JavaScript')));
44 window.onload = function()
46 var oFCKeditor = new FCKeditor( '$this->_htmltextid' ) ;"
47 . $this->_jsdefault . "
48 // force textarea in favor of iFrame?
49 // oFCKeditor._IsCompatibleBrowser = function() { return false; }
50 oFCKeditor.ReplaceTextarea();
54 function Textarea ($textarea, $wikitext, $name='edit[content]') {
55 return $this->Textarea_Replace($textarea, $wikitext, $name);
58 /* either iframe or textarea */
59 function Textarea_Create ($textarea, $wikitext, $name='edit[content]') {
63 var oFCKeditor = new FCKeditor( '$htmltextid' ) ;
64 oFCKeditor.Value = '" . $textarea->_content[0]->asXML() . "';"
65 . $this->_jsdefault . "
66 oFCKeditor.Create();"),
67 HTML::div(array("id" => $this->_wikitextid,
68 'style' => 'display:none'),
75 function Textarea_Replace ($textarea, $wikitext, $name='edit[content]') {
76 $htmltextid = $this->_htmltextid;
77 $textarea->SetAttr('id', $htmltextid);
78 $out = HTML($textarea,
79 HTML::div(array("id" => $this->_wikitextid,
80 'style' => 'display:none'),
86 /* via the PHP object */
87 function Textarea_PHP ($textarea, $wikitext, $name='edit[content]') {
89 $this->FilePath = realpath(PHPWIKI_DIR.'/themes/default/FCKeditor') . "/";
91 $htmltextid = "edit-content";
93 include_once($this->FilePath . 'fckeditor.php');
94 $this->oFCKeditor = new FCKeditor($htmltextid) ;
95 $this->oFCKeditor->BasePath = $this->BasePath;
96 $this->oFCKeditor->Value = $textarea->_content[0]->asXML();
98 $this->oFCKeditor->Config['AutoDetectLanguage'] = true ;
99 $this->oFCKeditor->Config['DefaultLanguage'] = $LANG;
100 $this->oFCKeditor->Create();
102 return HTML::div(array("id" => $this->_wikitextid,
103 'style' => 'display:none'),
113 // c-hanging-comment-ender-p: nil
114 // indent-tabs-mode: nil