]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WysiwygEdit/tinymce.php
Reformat code
[SourceForge/phpwiki.git] / lib / WysiwygEdit / tinymce.php
1 <?php
2
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
22     function WysiwygEdit_tinymce()
23     {
24         $this->_transformer_tags = false;
25         $this->BasePath = DATA_PATH . '/themes/default/tiny_mce/';
26         $this->_htmltextid = "edit-content";
27         $this->_wikitextid = "editareawiki";
28     }
29
30     function Head($name = 'edit[content]')
31     {
32         global $LANG, $WikiTheme;
33         $WikiTheme->addMoreHeaders
34         (Javascript('', array('src' => $this->BasePath . 'tiny_mce.js',
35             'language' => 'JavaScript')));
36         return Javascript("
37 tinyMCE.init({
38     mode    : 'exact',
39     elements: '$name',
40         theme   : 'advanced',
41         language: \"$LANG\",
42         ask     : false,
43     theme_advanced_toolbar_location : \"top\",
44     theme_advanced_toolbar_align : \"left\",
45     theme_advanced_path_location : \"bottom\",
46     theme_advanced_buttons1 : \"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,undo,redo,link,unlink\",
47     theme_advanced_buttons2 : \"\",
48     theme_advanced_buttons3 : \"\",
49 });");
50         /*
51         plugins : \"table,contextmenu,paste,searchreplace,iespell,insertdatetime\",
52     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]\"
53 });
54         */
55     }
56
57     // to be called after </textarea>
58     // name ignored
59     function Textarea($textarea, $wikitext, $name = 'edit[content]')
60     {
61         $out = HTML($textarea,
62             HTML::div(array("id" => $this->_wikitextid,
63                     'style' => 'display:none'),
64                 $wikitext), "\n");
65         //TODO: maybe some more custom links
66         return $out;
67     }
68 }
69
70 // Local Variables:
71 // mode: php
72 // tab-width: 8
73 // c-basic-offset: 4
74 // c-hanging-comment-ender-p: nil
75 // indent-tabs-mode: nil
76 // End: