* This module only works the CVS version of TinyMCE. See this file for more details.
[project/tinymce.git] / INSTALL.txt
CommitLineData
6f760c55
MW
1********************************************************************
2 D R U P A L M O D U L E
3********************************************************************
4Name: TinyMCE module
5Authors: Matt Westgate <drupal at asitis dot org> and
6 Richard Bennett <richard.b@gritechnologies.com>
7Dependancies:
8 This module requires the third-party TinyMCE editor and a
9 Javascript-enabled web browser. Currently it is known to work
10 with Internet Explorer, Mozilla and Firefox and degrade gracefully
11 for Safari and Konqueror users. A browser compatibility chart is here:
12
13 http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/compatiblity.htm
14
15INSTALLATION:
16********************************************************************
171. Place the entire tinymce directory into your Drupal modules/
18 directory.
19
3337e489 202. Download the latest CVS version of TinyMCE as TinyMCE 1.43 will not work.
6f760c55 21
3337e489
MW
22 If you're comfortable using the CVS tool, instructions for checking
23 out the repository are here:
01a85ffd 24
3337e489 25 http://sourceforge.net/cvs/?group_id=103281
01a85ffd 26
3337e489 27 Otherwise, you may downlad the CVS version here:
01a85ffd 28
3337e489
MW
29 http://asitis.org/tinymce_cvs.zip
30
31 Remember to uncompress the file and make sure the folder is named
32 'tinymce'.
6f760c55 33
3337e489 343. Place the entire 'tinymce' folder inside your modules/tinymce directory.
6f760c55 35
01a85ffd
MW
364. Load the database definition file (tinymce.mysql) using the
37 tool of your choice (e.g. phpmyadmin). For mysql and command line
38 access use:
39
40 mysql -u user -p drupal < tinymce.mysql
41
42 Replace 'user' with the MySQL username, and 'drupal' with the
43 database being used.
44
6f760c55
MW
454. Enable this module by navigating to:
46
47 administer > modules
48
01a85ffd 495. Optionally, setup role based tinymce profiles via
6f760c55 50
01a85ffd 51 administer > tinymce
6f760c55 52
6739c75d
MW
53Create new content and see TinyMCE in action!
54
55README:
56********************************************************************
57Once TinyMCE is enabled, the default behavior is that all textareas
58will use TinyMCE for all users. The admin can change these defaults
59at
60
61 administer > settings > tinymce
62
63For example, the default theme TinyMCE will use is called 'simple'.
64Themes control the functionality TinyMCE makes visible. It comes
65with 3 themes:
66
67 1) Simple - basic formatting
68 2) Default - basic formatting with tables
69 3) Advanced - many many features. See a demo at
70 http://tinymce.moxiecode.com/example_advanced.php?example=true
71
72The admin can choose what theme TinyMCE should be the default and
64d74024
MW
73user's can override this by editing their account (if they've been
74given permissions to do so). User's also have the option of disabling
75TinyMCE completely.
6739c75d
MW
76
77The admin can also define which pages TinyMCE should be used on.
78This cannot be changed on a per user basis.
79
64d74024
MW
80DRUPAL PLUGINS FOR TINYMCE:
81********************************************************************
093240f8
MW
82NOTE: If you want to use img_assist with TinyMCE, you don't have to
83 install a plugin. Just enable the img_assist module and click
84 the photo icon that appears below each textarea.
85
64d74024
MW
86Located in the plugins directory are Drupal specific plugins for
87TinyMCE. Once you've downloaded and installed the TinyMCE engine,
88copy this plugins over the directory of TinyMCE
89(tinymce/jscripts/tiny_mce/). Most of these plugins will already be
90active if you use the 'advanced' theme for tinymce. See the
91documentation in each plugin folder for more details.
92
35d76353
MW
93CAVEATS
94********************************************************************
95By default, Drupal uses the 'Filtered HTML' input format for adding
96content to the site and this can create conflicts with TinyMCE. It's
97best when using this editor to use an input format that has all
98filters disabled. What I usually do is create an input format called
99'Rich-text editing' and set that as the default format for roles which
100use TinyMCE exclusively. To modify your input formats go to:
101
102 Administer > input formats > configure > configure filters
103
104TWEAKING THE TINYMCE THEME
105********************************************************************
6739c75d
MW
106
107Developers have complete control over the arguments which invoke a
ae7b55ca
MW
108TinyMCE theme by creating a custom Drupal theme function. In your
109Drupal theme file create a new function called tinymce_theme:
110
111/**
112 * Customize a TinyMCE theme.
113 *
114 * @param init
115 * An array of settings TinyMCE should invoke a theme. You may override any
116 * of the TinyMCE settings. Details here:
117 *
118 * http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
119 *
120 * @param textarea_name
121 * The name of the textarea TinyMCE wants to enable.
122 *
123 * @param theme_name
124 * The default theme name to be enabled for this textarea. The sitewide
125 * default is 'simple', but the user may also override this.
dd7d7335
MW
126 *
127 * @param is_running
128 * A boolean flag that identifies id TinyMCE is currently running for this
129 * request life cycle. If it's already running then anything returned by this
130 * will be ignored. This is necessary since TinyMCE works by being invoked
131 * once per request and not once per textarea.
ae7b55ca 132 */
dd7d7335 133function tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
ae7b55ca
MW
134 switch ($theme_name) {
135 case 'advanced':
136 $init['extended_valid_elements'] = 'a[href|target|name]';
64d74024 137 // Add the names of custom plugins here.
ae7b55ca
MW
138 $init['plugins'] = 'table,emotions,iespell, print';
139 $init['theme_advanced_buttons3_add_before'] = 'tablecontrols,separator';
140 $init['theme_advanced_buttons3_add'] = 'emotions,iespell,separator,print';
141 return $init;
142 }
6739c75d
MW
143}
144
ae7b55ca
MW
145The above function would add tables, emotions, spellchecking
146(IE only) and a print button to the 'advanced' theme. There are
147many ways this function can be used. For example you could make
148comment textareas use the 'simple' theme while node forms use
149'advanced' by inspecting the name of the textarea ($textarea_name).
6739c75d
MW
150
151Note that the way you build the theme function depends on the theme
152engine you're using.
153
ae7b55ca
MW
154See the TinyMCE manual for details on the parameters that can be
155sent to TinyMCE:
6739c75d
MW
156
157http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/index.htm