]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WysiwygEdit/tinymce.php
Remove history
[SourceForge/phpwiki.git] / lib / WysiwygEdit / tinymce.php
1 <?php
2 rcs_id('$Id$');
3 /**
4  * Multiple browser support, currently Mozilla (PC, Mac and Linux), 
5  * MSIE (PC) and FireFox (PC, Mac and Linux) and some limited Safari support.
6  *
7  * Download: http://tinymce.moxiecode.com/
8  * Suggested installation of the jscripts subdirectory
9  *   tinymce/jscripts/tiny_mce/ into themes/default/tiny_mce/
10  *
11  * WARNING! Probably incompatible with ENABLE_XHTML_XML
12  *
13  * @package WysiwygEdit
14  * @author Reini Urban
15  */
16
17 require_once("lib/WysiwygEdit.php");
18
19 class WysiwygEdit_tinymce extends WysiwygEdit {
20
21     function WysiwygEdit_tinymce() {
22         $this->_transformer_tags = false;
23         $this->BasePath = DATA_PATH.'/themes/default/tiny_mce/';
24         $this->_htmltextid = "edit-content";
25         $this->_wikitextid = "editareawiki";
26     }
27
28     function Head($name='edit[content]') {
29         global $LANG, $WikiTheme;
30         $WikiTheme->addMoreHeaders
31             (Javascript('', array('src' => $this->BasePath . 'tiny_mce.js',
32                                   'language' => 'JavaScript')));
33         return Javascript("
34 tinyMCE.init({
35         mode    : 'exact',
36         elements: '$name',
37         theme   : 'advanced',
38         language: \"$LANG\",
39         ask     : false,
40         theme_advanced_toolbar_location : \"top\",
41         theme_advanced_toolbar_align : \"left\",
42         theme_advanced_path_location : \"bottom\",
43         theme_advanced_buttons1 : \"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink\",
44         theme_advanced_buttons2 : \"\",
45         theme_advanced_buttons3 : \"\",
46 });");
47         /*
48         plugins : \"table,contextmenu,paste,searchreplace,iespell,insertdatetime\",
49         extended_valid_elements : \"a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]\"
50 });
51         */
52     }
53
54     // to be called after </textarea>
55     // name ignored
56     function Textarea($textarea, $wikitext, $name='edit[content]') {
57         $out = HTML($textarea,
58                     HTML::div(array("id" => $this->_wikitextid, 
59                                     'style'=>'display:none'),
60                                          $wikitext),"\n");
61         //TODO: maybe some more custom links
62         return $out;
63     }
64 }
65
66 // Local Variables:
67 // mode: php
68 // tab-width: 8
69 // c-basic-offset: 4
70 // c-hanging-comment-ender-p: nil
71 // indent-tabs-mode: nil
72 // End:
73 ?>