summaryrefslogtreecommitdiffstats
path: root/INSTALL.txt
blob: eab5b39e164671e97431a28111d458dc2132752a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
********************************************************************
                     D R U P A L    M O D U L E
********************************************************************
Name: TinyMCE module
Authors: Matt Westgate <drupal at asitis dot org> and
         Richard Bennett <richard.b@gritechnologies.com>
Dependancies:
  This module requires the third-party TinyMCE editor and a
  Javascript-enabled web browser.  Currently it is known to work
  with Internet Explorer, Mozilla and Firefox and degrade gracefully
  for Safari and Konqueror users. A browser compatibility chart is here:

  http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/compatiblity.htm

INSTALLATION:
********************************************************************
1. Place the entire tinymce directory into your Drupal modules/
   directory.

2. Download TinyMCE 1.44 from

     http://prdownloads.sourceforge.net/tinymce/tinymce_1_44.zip

   Remember to uncompress the file and make sure the folder is named
   'tinymce'.

3. Place the entire 'tinymce' folder inside your modules/tinymce directory.

4. Load the database definition file (tinymce.mysql) using the
   tool of your choice (e.g. phpmyadmin). For mysql and command line
   access use:

     mysql -u user -p drupal < tinymce.mysql

   Replace 'user' with the MySQL username, and 'drupal' with the
   database being used.

4. Enable this module by navigating to:

     administer > modules

5. Optionally, setup role based tinymce profiles via

     administer > settings > tinymce

Create new content and see TinyMCE in action!

README:
********************************************************************
Once TinyMCE is enabled, the default behavior is that all textareas
will use TinyMCE for all users. The admin can change these defaults
at

  administer > settings > tinymce

For example, the default theme TinyMCE will use is called 'simple'.
Themes control the functionality TinyMCE makes visible. It comes
with 3 themes:

  1) Simple - basic formatting
  2) Default - basic formatting with lists and hyperlinks
  3) Advanced - many many features. See a demo at
        http://tinymce.moxiecode.com/example_advanced.php?example=true

The admin can choose what theme TinyMCE should be the default and
user's can override this by editing their account (if they've been
given permissions to do so). User's also have the option of disabling
TinyMCE completely.

The admin can also define which pages TinyMCE should be used on.
This cannot be changed on a per user basis.

DRUPAL PLUGINS FOR TINYMCE:
********************************************************************
NOTE: If you want to use img_assist with TinyMCE, you don't have to
      install a plugin. Just enable the img_assist module and click
      the photo icon that appears below each textarea.

Located in the plugins directory are Drupal specific plugins for
TinyMCE. Once you've downloaded and installed the TinyMCE engine,
copy this plugins over the directory of TinyMCE
(tinymce/jscripts/tiny_mce/). Most of these plugins will already be
active if you use the 'advanced' theme for tinymce. See the
documentation in each plugin folder for more details.

CAVEATS
********************************************************************
By default, Drupal uses the 'Filtered HTML' input format for adding
content to the site and this can create conflicts with TinyMCE. It's
best when using this editor to use an input format that has all
filters disabled. What I usually do is create an input format called
'Rich-text editing' and set that as the default format for roles which
use TinyMCE exclusively. To modify your input formats go to:

    Administer > input formats > configure > configure filters

TWEAKING THE TINYMCE THEME
********************************************************************

Developers have complete control over when and how tinymce is enabled
for each textarea inside Drupal by creating a custom Drupal theme
function. The following example assumes you're using a phptemplate based theme.

Put the following function in your themes template.php file:

/**
 * Customize a TinyMCE theme.
 *
 * @param init
 *   An array of settings TinyMCE should invoke a theme. You may override any
 *   of the TinyMCE settings. Details here:
 *
 *    http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/using.htm
 *
 * @param textarea_name
 *   The name of the textarea TinyMCE wants to enable.
 *
 * @param theme_name
 *   The default tinymce theme name to be enabled for this textarea. The
 *   sitewide default is 'simple', but the user may also override this.
 *
 * @param is_running
 *   A boolean flag that identifies id TinyMCE is currently running for this
 *   request life cycle. It can be ignored.
 */
function phptemplate_tinymce_theme($init, $textarea_name, $theme_name, $is_running) {
  switch ($textarea_name) {
    // Disable tinymce for these textareas
    case 'log':
    case 'img_assist_pages':
    case 'caption':
      unset($init);
      break;

    // Force the 'simple' theme for some of the smaller textareas.
    case 'signature':
    case 'site_mission':
    case 'site_footer':
    case 'settings][access_pages':
      $init['theme'] = 'simple';
      unset($init['theme_advanced_toolbar_location']);
      unset($init['theme_advanced_toolbar_align']);
      unset($init['theme_advanced_path_location']);
      unset($init['theme_advanced_blockformats']);
      unset($init['theme_advanced_styles']);
      break;
  }

  // Add some extra features when using the advanced theme.
  switch ($theme_name) {
    case 'advanced':
      $init['extended_valid_elements'] = 'a[href|target|name|title|onclick]';
      $init['theme_advanced_buttons3_add_before'] = 'tablecontrols,separator';
      $init['plugins'] = file_exists(drupal_get_path('module', 'tinymce'). '/tinymce/jscripts/tiny_mce/plugins/drupalimage') ? 'drupalimage,table,emotions,print' : 'table,emotions,print';
      $init['theme_advanced_buttons3_add'] = 'drupalimage,emotions,separator,print';
      break;
  }

  // Always return $init; !!
  return $init;
}

If you study the above function you can see that tinymce can be completely
disabled or you can even switch themes for a given textarea.

See the TinyMCE manual for details on the parameters that can be
sent to TinyMCE:

http://tinymce.moxiecode.com/wrapper.php?url=tinymce/docs/index.htm