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
21 function WysiwygEdit_FCKeditor()
24 $this->_transformer_tags = false;
25 $this->BasePath = DATA_PATH . '/themes/default/FCKeditor/';
26 $this->_htmltextid = "edit-content"; // FCKEditor1;
27 $this->_wikitextid = "editareawiki";
29 oFCKeditor.BasePath = '$this->BasePath';
30 oFCKeditor.Height = 300;
31 // oFCKeditor.ToolbarSet = 'Basic' ;
32 oFCKeditor.Config.DefaultLanguage = '$LANG';
33 oFCKeditor.Config.LinkBrowserURL = oFCKeditor.BasePath + 'editor/filemanager/browser/default/browser.html?Connector=connectors/php/connector.php';
34 oFCKeditor.Config.ImageBrowserURL = oFCKeditor.BasePath + 'editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php';
36 if (!empty($_REQUEST['start_debug']))
37 $this->_jsdefault = "\noFCKeditor.Config.Debug = true;";
40 function Head($name = 'edit[content]')
43 $WikiTheme->addMoreHeaders
44 (Javascript('', array('src' => $this->BasePath . 'fckeditor.js',
45 'language' => 'JavaScript')));
47 window.onload = function()
49 var oFCKeditor = new FCKeditor( '$this->_htmltextid' ) ;"
50 . $this->_jsdefault . "
51 // force textarea in favor of iFrame?
52 // oFCKeditor._IsCompatibleBrowser = function() { return false; }
53 oFCKeditor.ReplaceTextarea();
57 function Textarea($textarea, $wikitext, $name = 'edit[content]')
59 return $this->Textarea_Replace($textarea, $wikitext, $name);
62 /* either iframe or textarea */
63 function Textarea_Create($textarea, $wikitext, $name = 'edit[content]')
68 var oFCKeditor = new FCKeditor( '$htmltextid' ) ;
69 oFCKeditor.Value = '" . $textarea->_content[0]->asXML() . "';"
70 . $this->_jsdefault . "
71 oFCKeditor.Create();"),
72 HTML::div(array("id" => $this->_wikitextid,
73 'style' => 'display:none'),
80 function Textarea_Replace($textarea, $wikitext, $name = 'edit[content]')
82 $htmltextid = $this->_htmltextid;
83 $textarea->SetAttr('id', $htmltextid);
84 $out = HTML($textarea,
85 HTML::div(array("id" => $this->_wikitextid,
86 'style' => 'display:none'),
92 /* via the PHP object */
93 function Textarea_PHP($textarea, $wikitext, $name = 'edit[content]')
96 $this->FilePath = realpath(PHPWIKI_DIR . '/themes/default/FCKeditor') . "/";
98 $htmltextid = "edit-content";
100 include_once($this->FilePath . 'fckeditor.php');
101 $this->oFCKeditor = new FCKeditor($htmltextid);
102 $this->oFCKeditor->BasePath = $this->BasePath;
103 $this->oFCKeditor->Value = $textarea->_content[0]->asXML();
105 $this->oFCKeditor->Config['AutoDetectLanguage'] = true;
106 $this->oFCKeditor->Config['DefaultLanguage'] = $LANG;
107 $this->oFCKeditor->Create();
109 return HTML::div(array("id" => $this->_wikitextid,
110 'style' => 'display:none'),
120 // c-hanging-comment-ender-p: nil
121 // indent-tabs-mode: nil