1 ********************************************************************
2 D R U P A L M O D U L E
3 ********************************************************************
6 Maintainers: Matt Westgate <drupal /at/ asitis /dot/ org> and
7 Richard Bennett <richard.b /at/ gritechnologies /dot/ com>
8 Jeff Robbins <robbins /at/ jjeff /dot/ com>
9 Theodore Serbinski <stanson /at/ gmail /dot/ com>
12 This module requires the third-party TinyMCE editor and a
13 Javascript-enabled web browser. Currently it is known to work
14 with Internet Explorer, Mozilla and Firefox and degrade gracefully
15 for Safari and Konqueror users. A browser compatibility chart is here:
17 http://tinymce.moxiecode.com/tinymce/docs/compatiblity_chart.html
21 ********************************************************************
23 NOTE: During this installation process you'll be asked to also
24 install the official TinyMCE package from
25 tinymce.moxiecode.com.
28 1. Place the entire tinymce directory into your Drupal modules/
31 2. Download TinyMCE 2.0 from
33 http://tinymce.moxiecode.com/
35 Remember to uncompress the file and make sure the folder is named
38 3. Place the entire 'tinymce' engine folder inside your modules/tinymce
39 directory. So the TinyMCE engine will live in modules/tinymce/tinymce
41 4. Enable this module by navigating to:
45 *note - all database tables will be automatically created during this step
47 5. Setup role based tinymce profiles via
49 administer > settings > tinymce
51 6. To boost the performance of TinyMCE, download the
52 "TinyMCE compressor" from
54 http://tinymce.moxiecode.com/download.php
56 Place the tiny_mce_gzip.php file in
58 modules/tinymce/tinymce/jscripts/tiny_mce
61 Create new content as a role that has TinyMCE permissions and see TinyMCE in
66 ********************************************************************
67 Once TinyMCE is enabled, the default behavior is that all textareas
68 will use TinyMCE for all users. The admin can change these defaults
71 administer > settings > tinymce
73 The admin can choose what theme TinyMCE should be the default and
74 user's can override this by editing their account (if they've been
75 given permissions to do so). User's also have the option of disabling
78 The admin can also define which pages TinyMCE should be used on.
79 This cannot be changed on a per user basis.
83 ********************************************************************
84 Adding plugins to TinyMCE is very easy. By default, all TinyMCE
85 plugins are disabled, but can easily be enabled by going to:
87 Administer > settings > tinymce
89 And then editing a profile (make sure you create one first!) and going
90 to the Buttons & Plugins section. To enable a button or a plugin,
91 simply check a box and TinyMCE will automatically be updated. To find
92 out more info on what a specific button or plugin does, click the
93 corresponding link (note not all buttons have help text).
95 If you wish to add more plugins to TinyMCE, simply extract these
96 plugins to the folder: tinymce\jscripts\tiny_mce\plugins
98 Then open up plugin_reg.php, found in the TinyMCE module folder.
100 Add the following lines:
102 $plugins['plugin_name'] = array();
103 $plugins['plugin_name']['theme_advanced_buttons3'] = array('icon_name');
104 // note, you can choose which row of buttons to use by changing
105 // the 3 to either 1 or 2
106 $plugins['plugin_name']['plugin_property'] = array('property_value');
108 Be sure to set the 'plugin_name' to the name of the plugin (generally
109 the plugin folder name) and set the 'icon_name' and other properties
110 (properties are optional). See plugin_reg.php for more examples.
112 To add Drupal specific plugins, TinyMCE comes bundled with plugins
113 in the main module directory. These plugins include:
115 - drupalimage: works in conjunction with the img_assist Drupal
118 NOTE: If you want to use img_assist with TinyMCE, you don't have to
119 install a plugin. Just enable the img_assist module and click
120 the photo icon that appears below each textarea.
122 Follow the directions in the README.txt for these plugins to enable them.
126 ********************************************************************
127 By default, Drupal uses the 'Filtered HTML' input format for adding
128 content to the site and this can create conflicts with TinyMCE. It's
129 best when using this editor to use an input format that has all
130 filters disabled. What I usually do is create an input format called
131 'Rich-text editing' and set that as the default format for roles which
132 use TinyMCE exclusively. To modify your input formats go to:
134 Administer > input formats > configure > configure filters
137 TWEAKING THE TINYMCE THEME
138 ********************************************************************
140 Developers have complete control over when and how tinymce is enabled
141 for each textarea inside Drupal by creating a custom Drupal theme
142 function. The following example assumes you're using a phptemplate based theme.
144 Put the following function in your themes template.php file:
147 * Customize a TinyMCE theme.
150 * An array of settings TinyMCE should invoke a theme. You may override any
151 * of the TinyMCE settings. Details here:
153 * http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
155 * @param textarea_name
156 * The name of the textarea TinyMCE wants to enable.
159 * The default tinymce theme name to be enabled for this textarea. The
160 * sitewide default is 'simple', but the user may also override this.
163 * A boolean flag that identifies id TinyMCE is currently running for this
164 * request life cycle. It can be ignored.
166 function theme_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
167 switch ($textarea_name) {
168 // Disable tinymce for these textareas
169 case 'log': // book and page log
170 case 'img_assist_pages':
171 case 'caption': // signature
173 case 'access_pages': //TinyMCE profile settings.
174 case 'user_mail_welcome_body': // user config settings
175 case 'user_mail_approval_body': // user config settings
176 case 'user_mail_pass_body': // user config settings
177 case 'synonyms': // taxonomy terms
178 case 'description': // taxonomy terms
182 // Force the 'simple' theme for some of the smaller textareas.
186 case 'site_offline_message':
188 case 'user_registration_help':
189 case 'user_picture_guidelines':
190 $init['theme'] = 'simple';
191 foreach ($init as $k => $v) {
192 if (strstr($k, 'theme_advanced_')) unset($init[$k]);
197 /* Example, add some extra features when using the advanced theme.
199 // If $init is available, we can extend it
201 switch ($theme_name) {
203 $init['extended_valid_elements'] = array('a[href|target|name|title|onclick]');
210 // Always return $init
214 If you study the above function you can see that tinymce can be completely
215 disabled or you can even switch themes for a given textarea.
217 See the TinyMCE manual for details on the parameters that can be
220 http://tinymce.moxiecode.com/documentation.php
223 TINYMCE KEYBOARD SHORTCUTS
224 ********************************************************************